@hpcc-js/codemirror 2.51.0 → 2.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@hpcc-js/common')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', '@hpcc-js/common'], factory) :
4
- (global = global || self, factory(global['@hpcc-js/codemirror'] = {}, global['@hpcc-js/common']));
5
- }(this, (function (exports, common) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@hpcc-js/codemirror"] = {}, global["@hpcc-js/common"]));
5
+ })(this, (function (exports, common) { 'use strict';
6
6
 
7
7
  var PKG_NAME = "@hpcc-js/codemirror";
8
- var PKG_VERSION = "2.51.0";
9
- var BUILD_VERSION = "2.88.0";
8
+ var PKG_VERSION = "2.55.0";
9
+ var BUILD_VERSION = "2.97.0";
10
10
 
11
11
  /*! *****************************************************************************
12
12
  Copyright (c) Microsoft Corporation.
@@ -52,21 +52,11 @@
52
52
 
53
53
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
54
54
 
55
- function createCommonjsModule(fn, basedir, module) {
56
- return module = {
57
- path: basedir,
58
- exports: {},
59
- require: function (path, base) {
60
- return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
61
- }
62
- }, fn(module, module.exports), module.exports;
63
- }
55
+ var css = {exports: {}};
64
56
 
65
- function commonjsRequire () {
66
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
67
- }
57
+ var codemirror = {exports: {}};
68
58
 
69
- var codemirror = createCommonjsModule(function (module, exports) {
59
+ (function (module, exports) {
70
60
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
71
61
  // Distributed under an MIT license: https://codemirror.net/LICENSE
72
62
 
@@ -77,7 +67,7 @@
77
67
  // at http://marijnhaverbeke.nl/blog/#cm-internals .
78
68
 
79
69
  (function (global, factory) {
80
- module.exports = factory() ;
70
+ module.exports = factory() ;
81
71
  }(commonjsGlobal, (function () {
82
72
  // Kludges for bugs and behavior differences that can't be feature
83
73
  // detected are enabled based on userAgent etc sniffing.
@@ -98,7 +88,7 @@
98
88
  var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
99
89
  var phantom = /PhantomJS/.test(userAgent);
100
90
 
101
- var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
91
+ var ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2);
102
92
  var android = /Android/.test(userAgent);
103
93
  // This is woefully incomplete. Suggestions for alternative methods welcome.
104
94
  var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);
@@ -270,7 +260,7 @@
270
260
  }
271
261
 
272
262
  // Number of pixels added to scroller and sizer to hide scrollbar
273
- var scrollerGap = 30;
263
+ var scrollerGap = 50;
274
264
 
275
265
  // Returned or thrown by various protocols to signal 'I'm not
276
266
  // handling this'.
@@ -551,14 +541,15 @@
551
541
  for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
552
542
  order.push(new BidiSpan(0, start, i$7));
553
543
  } else {
554
- var pos = i$7, at = order.length;
544
+ var pos = i$7, at = order.length, isRTL = direction == "rtl" ? 1 : 0;
555
545
  for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
556
546
  for (var j$2 = pos; j$2 < i$7;) {
557
547
  if (countsAsNum.test(types[j$2])) {
558
- if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }
548
+ if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }
559
549
  var nstart = j$2;
560
550
  for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
561
551
  order.splice(at, 0, new BidiSpan(2, nstart, j$2));
552
+ at += isRTL;
562
553
  pos = j$2;
563
554
  } else { ++j$2; }
564
555
  }
@@ -1266,7 +1257,7 @@
1266
1257
  var prop = lineClass[1] ? "bgClass" : "textClass";
1267
1258
  if (output[prop] == null)
1268
1259
  { output[prop] = lineClass[2]; }
1269
- else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
1260
+ else if (!(new RegExp("(?:^|\\s)" + lineClass[2] + "(?:$|\\s)")).test(output[prop]))
1270
1261
  { output[prop] += " " + lineClass[2]; }
1271
1262
  } }
1272
1263
  return type
@@ -1376,6 +1367,7 @@
1376
1367
  if (span.marker == marker) { return span }
1377
1368
  } }
1378
1369
  }
1370
+
1379
1371
  // Remove a span from an array, returning undefined if no spans are
1380
1372
  // left (we don't store arrays for lines without spans).
1381
1373
  function removeMarkedSpan(spans, span) {
@@ -1384,9 +1376,16 @@
1384
1376
  { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }
1385
1377
  return r
1386
1378
  }
1379
+
1387
1380
  // Add a span to a line.
1388
- function addMarkedSpan(line, span) {
1389
- line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
1381
+ function addMarkedSpan(line, span, op) {
1382
+ var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));
1383
+ if (inThisOp && inThisOp.has(line.markedSpans)) {
1384
+ line.markedSpans.push(span);
1385
+ } else {
1386
+ line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
1387
+ if (inThisOp) { inThisOp.add(line.markedSpans); }
1388
+ }
1390
1389
  span.marker.attachLine(line);
1391
1390
  }
1392
1391
 
@@ -1906,7 +1905,7 @@
1906
1905
  }
1907
1906
  }
1908
1907
  builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;
1909
- if (style || startStyle || endStyle || mustWrap || css) {
1908
+ if (style || startStyle || endStyle || mustWrap || css || attributes) {
1910
1909
  var fullStyle = style || "";
1911
1910
  if (startStyle) { fullStyle += startStyle; }
1912
1911
  if (endStyle) { fullStyle += endStyle; }
@@ -2251,6 +2250,7 @@
2251
2250
  if (cm.options.lineNumbers || markers) {
2252
2251
  var wrap$1 = ensureLineWrapped(lineView);
2253
2252
  var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"));
2253
+ gutterWrap.setAttribute("aria-hidden", "true");
2254
2254
  cm.display.input.setUneditable(gutterWrap);
2255
2255
  wrap$1.insertBefore(gutterWrap, lineView.text);
2256
2256
  if (lineView.line.gutterClass)
@@ -2407,12 +2407,14 @@
2407
2407
  function mapFromLineView(lineView, line, lineN) {
2408
2408
  if (lineView.line == line)
2409
2409
  { return {map: lineView.measure.map, cache: lineView.measure.cache} }
2410
- for (var i = 0; i < lineView.rest.length; i++)
2411
- { if (lineView.rest[i] == line)
2412
- { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
2413
- for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
2414
- { if (lineNo(lineView.rest[i$1]) > lineN)
2415
- { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
2410
+ if (lineView.rest) {
2411
+ for (var i = 0; i < lineView.rest.length; i++)
2412
+ { if (lineView.rest[i] == line)
2413
+ { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
2414
+ for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
2415
+ { if (lineNo(lineView.rest[i$1]) > lineN)
2416
+ { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
2417
+ }
2416
2418
  }
2417
2419
 
2418
2420
  // Render a line into the hidden node display.externalMeasured. Used
@@ -3025,7 +3027,7 @@
3025
3027
  var x, y, space = display.lineSpace.getBoundingClientRect();
3026
3028
  // Fails unpredictably on IE[67] when mouse is dragged around quickly.
3027
3029
  try { x = e.clientX - space.left; y = e.clientY - space.top; }
3028
- catch (e) { return null }
3030
+ catch (e$1) { return null }
3029
3031
  var coords = coordsChar(cm, x, y), line;
3030
3032
  if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
3031
3033
  var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;
@@ -3206,13 +3208,19 @@
3206
3208
  var curFragment = result.cursors = document.createDocumentFragment();
3207
3209
  var selFragment = result.selection = document.createDocumentFragment();
3208
3210
 
3211
+ var customCursor = cm.options.$customCursor;
3212
+ if (customCursor) { primary = true; }
3209
3213
  for (var i = 0; i < doc.sel.ranges.length; i++) {
3210
3214
  if (!primary && i == doc.sel.primIndex) { continue }
3211
3215
  var range = doc.sel.ranges[i];
3212
3216
  if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }
3213
3217
  var collapsed = range.empty();
3214
- if (collapsed || cm.options.showCursorWhenSelecting)
3215
- { drawSelectionCursor(cm, range.head, curFragment); }
3218
+ if (customCursor) {
3219
+ var head = customCursor(cm, range);
3220
+ if (head) { drawSelectionCursor(cm, head, curFragment); }
3221
+ } else if (collapsed || cm.options.showCursorWhenSelecting) {
3222
+ drawSelectionCursor(cm, range.head, curFragment);
3223
+ }
3216
3224
  if (!collapsed)
3217
3225
  { drawSelectionRange(cm, range, selFragment); }
3218
3226
  }
@@ -3228,6 +3236,12 @@
3228
3236
  cursor.style.top = pos.top + "px";
3229
3237
  cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
3230
3238
 
3239
+ if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) {
3240
+ var charPos = charCoords(cm, head, "div", null, null);
3241
+ var width = charPos.right - charPos.left;
3242
+ cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px";
3243
+ }
3244
+
3231
3245
  if (pos.other) {
3232
3246
  // Secondary cursor, shown when on a 'jump' in bi-directional text
3233
3247
  var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
@@ -3341,26 +3355,31 @@
3341
3355
  var on = true;
3342
3356
  display.cursorDiv.style.visibility = "";
3343
3357
  if (cm.options.cursorBlinkRate > 0)
3344
- { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; },
3345
- cm.options.cursorBlinkRate); }
3358
+ { display.blinker = setInterval(function () {
3359
+ if (!cm.hasFocus()) { onBlur(cm); }
3360
+ display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden";
3361
+ }, cm.options.cursorBlinkRate); }
3346
3362
  else if (cm.options.cursorBlinkRate < 0)
3347
3363
  { display.cursorDiv.style.visibility = "hidden"; }
3348
3364
  }
3349
3365
 
3350
3366
  function ensureFocus(cm) {
3351
- if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
3367
+ if (!cm.hasFocus()) {
3368
+ cm.display.input.focus();
3369
+ if (!cm.state.focused) { onFocus(cm); }
3370
+ }
3352
3371
  }
3353
3372
 
3354
3373
  function delayBlurEvent(cm) {
3355
3374
  cm.state.delayingBlurEvent = true;
3356
3375
  setTimeout(function () { if (cm.state.delayingBlurEvent) {
3357
3376
  cm.state.delayingBlurEvent = false;
3358
- onBlur(cm);
3377
+ if (cm.state.focused) { onBlur(cm); }
3359
3378
  } }, 100);
3360
3379
  }
3361
3380
 
3362
3381
  function onFocus(cm, e) {
3363
- if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }
3382
+ if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }
3364
3383
 
3365
3384
  if (cm.options.readOnly == "nocursor") { return }
3366
3385
  if (!cm.state.focused) {
@@ -3395,10 +3414,14 @@
3395
3414
  function updateHeightsInViewport(cm) {
3396
3415
  var display = cm.display;
3397
3416
  var prevBottom = display.lineDiv.offsetTop;
3417
+ var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);
3418
+ var oldHeight = display.lineDiv.getBoundingClientRect().top;
3419
+ var mustScroll = 0;
3398
3420
  for (var i = 0; i < display.view.length; i++) {
3399
3421
  var cur = display.view[i], wrapping = cm.options.lineWrapping;
3400
3422
  var height = (void 0), width = 0;
3401
3423
  if (cur.hidden) { continue }
3424
+ oldHeight += cur.line.height;
3402
3425
  if (ie && ie_version < 8) {
3403
3426
  var bot = cur.node.offsetTop + cur.node.offsetHeight;
3404
3427
  height = bot - prevBottom;
@@ -3413,6 +3436,7 @@
3413
3436
  }
3414
3437
  var diff = cur.line.height - height;
3415
3438
  if (diff > .005 || diff < -.005) {
3439
+ if (oldHeight < viewTop) { mustScroll -= diff; }
3416
3440
  updateLineHeight(cur.line, height);
3417
3441
  updateWidgetHeight(cur.line);
3418
3442
  if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
@@ -3427,6 +3451,7 @@
3427
3451
  }
3428
3452
  }
3429
3453
  }
3454
+ if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }
3430
3455
  }
3431
3456
 
3432
3457
  // Read and store the height of line widgets associated with the
@@ -3490,8 +3515,8 @@
3490
3515
  // Set pos and end to the cursor positions around the character pos sticks to
3491
3516
  // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
3492
3517
  // If pos == Pos(_, 0, "before"), pos and end are unchanged
3493
- pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos;
3494
3518
  end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos;
3519
+ pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos;
3495
3520
  }
3496
3521
  for (var limit = 0; limit < 5; limit++) {
3497
3522
  var changed = false;
@@ -3542,14 +3567,15 @@
3542
3567
  if (newTop != screentop) { result.scrollTop = newTop; }
3543
3568
  }
3544
3569
 
3545
- var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;
3546
- var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);
3570
+ var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;
3571
+ var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;
3572
+ var screenw = displayWidth(cm) - display.gutters.offsetWidth;
3547
3573
  var tooWide = rect.right - rect.left > screenw;
3548
3574
  if (tooWide) { rect.right = rect.left + screenw; }
3549
3575
  if (rect.left < 10)
3550
3576
  { result.scrollLeft = 0; }
3551
3577
  else if (rect.left < screenleft)
3552
- { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }
3578
+ { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }
3553
3579
  else if (rect.right > screenw + screenleft - 3)
3554
3580
  { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }
3555
3581
  return result
@@ -3616,7 +3642,7 @@
3616
3642
  }
3617
3643
 
3618
3644
  function setScrollTop(cm, val, forceScroll) {
3619
- val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);
3645
+ val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));
3620
3646
  if (cm.display.scroller.scrollTop == val && !forceScroll) { return }
3621
3647
  cm.doc.scrollTop = val;
3622
3648
  cm.display.scrollbars.setScrollTop(val);
@@ -3626,7 +3652,7 @@
3626
3652
  // Sync scroller and scrollbar, ensure the gutter elements are
3627
3653
  // aligned.
3628
3654
  function setScrollLeft(cm, val, isScroller, forceScroll) {
3629
- val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
3655
+ val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));
3630
3656
  if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
3631
3657
  cm.doc.scrollLeft = val;
3632
3658
  alignHorizontally(cm);
@@ -3686,6 +3712,7 @@
3686
3712
  this.vert.firstChild.style.height =
3687
3713
  Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px";
3688
3714
  } else {
3715
+ this.vert.scrollTop = 0;
3689
3716
  this.vert.style.display = "";
3690
3717
  this.vert.firstChild.style.height = "0";
3691
3718
  }
@@ -3841,7 +3868,8 @@
3841
3868
  scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
3842
3869
  scrollToPos: null, // Used to scroll to a specific position
3843
3870
  focus: false,
3844
- id: ++nextOpId // Unique ID
3871
+ id: ++nextOpId, // Unique ID
3872
+ markArrays: null // Used by addMarkedSpan
3845
3873
  };
3846
3874
  pushOperation(cm.curOp);
3847
3875
  }
@@ -4115,7 +4143,8 @@
4115
4143
  function restoreSelection(snapshot) {
4116
4144
  if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }
4117
4145
  snapshot.activeElt.focus();
4118
- if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
4146
+ if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&
4147
+ snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
4119
4148
  var sel = window.getSelection(), range = document.createRange();
4120
4149
  range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);
4121
4150
  range.collapse(false);
@@ -4213,6 +4242,8 @@
4213
4242
  update.visible = visibleLines(cm.display, cm.doc, viewport);
4214
4243
  if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
4215
4244
  { break }
4245
+ } else if (first) {
4246
+ update.visible = visibleLines(cm.display, cm.doc, viewport);
4216
4247
  }
4217
4248
  if (!updateDisplayIfNeeded(cm, update)) { break }
4218
4249
  updateHeightsInViewport(cm);
@@ -4291,6 +4322,8 @@
4291
4322
  function updateGutterSpace(display) {
4292
4323
  var width = display.gutters.offsetWidth;
4293
4324
  display.sizer.style.marginLeft = width + "px";
4325
+ // Send an event to consumers responding to changes in gutter width.
4326
+ signalLater(display, "gutterChanged", display);
4294
4327
  }
4295
4328
 
4296
4329
  function setDocumentHeight(cm, measure) {
@@ -4430,6 +4463,10 @@
4430
4463
  // The element in which the editor lives.
4431
4464
  d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
4432
4465
 
4466
+ // This attribute is respected by automatic translation systems such as Google Translate,
4467
+ // and may also be respected by tools used by human translators.
4468
+ d.wrapper.setAttribute('translate', 'no');
4469
+
4433
4470
  // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
4434
4471
  if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
4435
4472
  if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }
@@ -4527,6 +4564,12 @@
4527
4564
 
4528
4565
  function onScrollWheel(cm, e) {
4529
4566
  var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
4567
+ var pixelsPerUnit = wheelPixelsPerUnit;
4568
+ if (e.deltaMode === 0) {
4569
+ dx = e.deltaX;
4570
+ dy = e.deltaY;
4571
+ pixelsPerUnit = 1;
4572
+ }
4530
4573
 
4531
4574
  var display = cm.display, scroll = display.scroller;
4532
4575
  // Quit if there's nothing to scroll here
@@ -4555,10 +4598,10 @@
4555
4598
  // estimated pixels/delta value, we just handle horizontal
4556
4599
  // scrolling entirely here. It'll be slightly off from native, but
4557
4600
  // better than glitching out.
4558
- if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
4601
+ if (dx && !gecko && !presto && pixelsPerUnit != null) {
4559
4602
  if (dy && canScrollY)
4560
- { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }
4561
- setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));
4603
+ { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }
4604
+ setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));
4562
4605
  // Only prevent default scrolling if vertical scrolling is
4563
4606
  // actually possible. Otherwise, it causes vertical scroll
4564
4607
  // jitter on OSX trackpads when deltaX is small and deltaY
@@ -4571,15 +4614,15 @@
4571
4614
 
4572
4615
  // 'Project' the visible viewport to cover the area that is being
4573
4616
  // scrolled into view (if we know enough to estimate it).
4574
- if (dy && wheelPixelsPerUnit != null) {
4575
- var pixels = dy * wheelPixelsPerUnit;
4617
+ if (dy && pixelsPerUnit != null) {
4618
+ var pixels = dy * pixelsPerUnit;
4576
4619
  var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
4577
4620
  if (pixels < 0) { top = Math.max(0, top + pixels - 50); }
4578
4621
  else { bot = Math.min(cm.doc.height, bot + pixels + 50); }
4579
4622
  updateDisplaySimple(cm, {top: top, bottom: bot});
4580
4623
  }
4581
4624
 
4582
- if (wheelSamples < 20) {
4625
+ if (wheelSamples < 20 && e.deltaMode !== 0) {
4583
4626
  if (display.wheelStartX == null) {
4584
4627
  display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
4585
4628
  display.wheelDX = dx; display.wheelDY = dy;
@@ -4838,6 +4881,7 @@
4838
4881
  estimateLineHeights(cm);
4839
4882
  loadMode(cm);
4840
4883
  setDirectionClass(cm);
4884
+ cm.options.direction = doc.direction;
4841
4885
  if (!cm.options.lineWrapping) { findMaxLine(cm); }
4842
4886
  cm.options.mode = doc.modeOption;
4843
4887
  regChange(cm);
@@ -4854,19 +4898,19 @@
4854
4898
  });
4855
4899
  }
4856
4900
 
4857
- function History(startGen) {
4901
+ function History(prev) {
4858
4902
  // Arrays of change events and selections. Doing something adds an
4859
4903
  // event to done and clears undo. Undoing moves events from done
4860
4904
  // to undone, redoing moves them in the other direction.
4861
4905
  this.done = []; this.undone = [];
4862
- this.undoDepth = Infinity;
4906
+ this.undoDepth = prev ? prev.undoDepth : Infinity;
4863
4907
  // Used to track when changes can be merged into a single undo
4864
4908
  // event
4865
4909
  this.lastModTime = this.lastSelTime = 0;
4866
4910
  this.lastOp = this.lastSelOp = null;
4867
4911
  this.lastOrigin = this.lastSelOrigin = null;
4868
4912
  // Used by the isClean() method
4869
- this.generation = this.maxGeneration = startGen || 1;
4913
+ this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;
4870
4914
  }
4871
4915
 
4872
4916
  // Create a history change event from an updateDoc-style change
@@ -5171,7 +5215,7 @@
5171
5215
  (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);
5172
5216
  setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));
5173
5217
 
5174
- if (!(options && options.scroll === false) && doc.cm)
5218
+ if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor")
5175
5219
  { ensureCursorVisible(doc.cm); }
5176
5220
  }
5177
5221
 
@@ -5799,7 +5843,7 @@
5799
5843
  };
5800
5844
 
5801
5845
  LineWidget.prototype.changed = function () {
5802
- var this$1 = this;
5846
+ var this$1$1 = this;
5803
5847
 
5804
5848
  var oldH = this.height, cm = this.doc.cm, line = this.line;
5805
5849
  this.height = null;
@@ -5810,7 +5854,7 @@
5810
5854
  runInOp(cm, function () {
5811
5855
  cm.curOp.forceUpdate = true;
5812
5856
  adjustScrollWhenAboveVisible(cm, line, diff);
5813
- signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line));
5857
+ signalLater(cm, "lineWidgetChanged", cm, this$1$1, lineNo(line));
5814
5858
  });
5815
5859
  }
5816
5860
  };
@@ -5828,7 +5872,7 @@
5828
5872
  changeLine(doc, handle, "widget", function (line) {
5829
5873
  var widgets = line.widgets || (line.widgets = []);
5830
5874
  if (widget.insertAt == null) { widgets.push(widget); }
5831
- else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }
5875
+ else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }
5832
5876
  widget.line = line;
5833
5877
  if (cm && !lineIsHidden(doc, line)) {
5834
5878
  var aboveVisible = heightAtLine(line) < doc.scrollTop;
@@ -5935,7 +5979,7 @@
5935
5979
  // Signals that the marker's widget changed, and surrounding layout
5936
5980
  // should be recomputed.
5937
5981
  TextMarker.prototype.changed = function () {
5938
- var this$1 = this;
5982
+ var this$1$1 = this;
5939
5983
 
5940
5984
  var pos = this.find(-1, true), widget = this, cm = this.doc.cm;
5941
5985
  if (!pos || !cm) { return }
@@ -5954,7 +5998,7 @@
5954
5998
  if (dHeight)
5955
5999
  { updateLineHeight(line, line.height + dHeight); }
5956
6000
  }
5957
- signalLater(cm, "markerChanged", cm, this$1);
6001
+ signalLater(cm, "markerChanged", cm, this$1$1);
5958
6002
  });
5959
6003
  };
5960
6004
 
@@ -6014,7 +6058,7 @@
6014
6058
  if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }
6015
6059
  addMarkedSpan(line, new MarkedSpan(marker,
6016
6060
  curLine == from.line ? from.ch : null,
6017
- curLine == to.line ? to.ch : null));
6061
+ curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);
6018
6062
  ++curLine;
6019
6063
  });
6020
6064
  // lineIsHidden depends on the presence of the spans, so needs a second pass
@@ -6186,6 +6230,7 @@
6186
6230
  getRange: function(from, to, lineSep) {
6187
6231
  var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
6188
6232
  if (lineSep === false) { return lines }
6233
+ if (lineSep === '') { return lines.join('') }
6189
6234
  return lines.join(lineSep || this.lineSeparator())
6190
6235
  },
6191
6236
 
@@ -6237,7 +6282,7 @@
6237
6282
  var out = [];
6238
6283
  for (var i = 0; i < ranges.length; i++)
6239
6284
  { out[i] = new Range(clipPos(this, ranges[i].anchor),
6240
- clipPos(this, ranges[i].head)); }
6285
+ clipPos(this, ranges[i].head || ranges[i].anchor)); }
6241
6286
  if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }
6242
6287
  setSelection(this, normalizeSelection(this.cm, out, primary), options);
6243
6288
  }),
@@ -6297,7 +6342,12 @@
6297
6342
  for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }
6298
6343
  return {undo: done, redo: undone}
6299
6344
  },
6300
- clearHistory: function() {this.history = new History(this.history.maxGeneration);},
6345
+ clearHistory: function() {
6346
+ var this$1$1 = this;
6347
+
6348
+ this.history = new History(this.history);
6349
+ linkedDocs(this, function (doc) { return doc.history = this$1$1.history; }, true);
6350
+ },
6301
6351
 
6302
6352
  markClean: function() {
6303
6353
  this.cleanGeneration = this.changeGeneration(true);
@@ -6316,7 +6366,7 @@
6316
6366
  undone: copyHistoryArray(this.history.undone)}
6317
6367
  },
6318
6368
  setHistory: function(histData) {
6319
- var hist = this.history = new History(this.history.maxGeneration);
6369
+ var hist = this.history = new History(this.history);
6320
6370
  hist.done = copyHistoryArray(histData.done.slice(0), null, true);
6321
6371
  hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);
6322
6372
  },
@@ -6331,11 +6381,11 @@
6331
6381
  }),
6332
6382
 
6333
6383
  clearGutter: docMethodOp(function(gutterID) {
6334
- var this$1 = this;
6384
+ var this$1$1 = this;
6335
6385
 
6336
6386
  this.iter(function (line) {
6337
6387
  if (line.gutterMarkers && line.gutterMarkers[gutterID]) {
6338
- changeLine(this$1, line, "gutter", function () {
6388
+ changeLine(this$1$1, line, "gutter", function () {
6339
6389
  line.gutterMarkers[gutterID] = null;
6340
6390
  if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }
6341
6391
  return true
@@ -6548,28 +6598,39 @@
6548
6598
  // and insert it.
6549
6599
  if (files && files.length && window.FileReader && window.File) {
6550
6600
  var n = files.length, text = Array(n), read = 0;
6551
- var loadFile = function (file, i) {
6552
- if (cm.options.allowDropFileTypes &&
6553
- indexOf(cm.options.allowDropFileTypes, file.type) == -1)
6554
- { return }
6555
-
6556
- var reader = new FileReader;
6557
- reader.onload = operation(cm, function () {
6558
- var content = reader.result;
6559
- if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = ""; }
6560
- text[i] = content;
6561
- if (++read == n) {
6601
+ var markAsReadAndPasteIfAllFilesAreRead = function () {
6602
+ if (++read == n) {
6603
+ operation(cm, function () {
6562
6604
  pos = clipPos(cm.doc, pos);
6563
6605
  var change = {from: pos, to: pos,
6564
- text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),
6606
+ text: cm.doc.splitLines(
6607
+ text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),
6565
6608
  origin: "paste"};
6566
6609
  makeChange(cm.doc, change);
6567
- setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));
6610
+ setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));
6611
+ })();
6612
+ }
6613
+ };
6614
+ var readTextFromFile = function (file, i) {
6615
+ if (cm.options.allowDropFileTypes &&
6616
+ indexOf(cm.options.allowDropFileTypes, file.type) == -1) {
6617
+ markAsReadAndPasteIfAllFilesAreRead();
6618
+ return
6619
+ }
6620
+ var reader = new FileReader;
6621
+ reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };
6622
+ reader.onload = function () {
6623
+ var content = reader.result;
6624
+ if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) {
6625
+ markAsReadAndPasteIfAllFilesAreRead();
6626
+ return
6568
6627
  }
6569
- });
6628
+ text[i] = content;
6629
+ markAsReadAndPasteIfAllFilesAreRead();
6630
+ };
6570
6631
  reader.readAsText(file);
6571
6632
  };
6572
- for (var i = 0; i < n; ++i) { loadFile(files[i], i); }
6633
+ for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }
6573
6634
  } else { // Normal drop
6574
6635
  // Don't do a replace if the drop happened inside of the selected text.
6575
6636
  if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {
@@ -6591,7 +6652,7 @@
6591
6652
  cm.display.input.focus();
6592
6653
  }
6593
6654
  }
6594
- catch(e){}
6655
+ catch(e$1){}
6595
6656
  }
6596
6657
  }
6597
6658
 
@@ -6687,7 +6748,7 @@
6687
6748
  46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
6688
6749
  106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 145: "ScrollLock",
6689
6750
  173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
6690
- 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
6751
+ 221: "]", 222: "'", 224: "Mod", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
6691
6752
  63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
6692
6753
  };
6693
6754
 
@@ -6724,10 +6785,9 @@
6724
6785
  // Very basic readline/emacs-style bindings, which are standard on Mac.
6725
6786
  keyMap.emacsy = {
6726
6787
  "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
6727
- "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
6728
- "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
6729
- "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
6730
- "Ctrl-O": "openLine"
6788
+ "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp",
6789
+ "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine",
6790
+ "Ctrl-T": "transposeChars", "Ctrl-O": "openLine"
6731
6791
  };
6732
6792
  keyMap.macDefault = {
6733
6793
  "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
@@ -6822,7 +6882,7 @@
6822
6882
  var base = name;
6823
6883
  if (event.altKey && base != "Alt") { name = "Alt-" + name; }
6824
6884
  if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; }
6825
- if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name; }
6885
+ if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Mod") { name = "Cmd-" + name; }
6826
6886
  if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name; }
6827
6887
  return name
6828
6888
  }
@@ -6879,6 +6939,7 @@
6879
6939
 
6880
6940
  function endOfLine(visually, cm, lineObj, lineNo, dir) {
6881
6941
  if (visually) {
6942
+ if (cm.doc.direction == "rtl") { dir = -dir; }
6882
6943
  var order = getOrder(lineObj, cm.doc.direction);
6883
6944
  if (order) {
6884
6945
  var part = dir < 0 ? lst(order) : order[0];
@@ -7047,7 +7108,7 @@
7047
7108
  goGroupRight: function (cm) { return cm.moveH(1, "group"); },
7048
7109
  goGroupLeft: function (cm) { return cm.moveH(-1, "group"); },
7049
7110
  goWordRight: function (cm) { return cm.moveH(1, "word"); },
7050
- delCharBefore: function (cm) { return cm.deleteH(-1, "char"); },
7111
+ delCharBefore: function (cm) { return cm.deleteH(-1, "codepoint"); },
7051
7112
  delCharAfter: function (cm) { return cm.deleteH(1, "char"); },
7052
7113
  delWordBefore: function (cm) { return cm.deleteH(-1, "word"); },
7053
7114
  delWordAfter: function (cm) { return cm.deleteH(1, "word"); },
@@ -7133,7 +7194,7 @@
7133
7194
  var line = getLine(cm.doc, start.line);
7134
7195
  var order = getOrder(line, cm.doc.direction);
7135
7196
  if (!order || order[0].level == 0) {
7136
- var firstNonWS = Math.max(0, line.text.search(/\S/));
7197
+ var firstNonWS = Math.max(start.ch, line.text.search(/\S/));
7137
7198
  var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;
7138
7199
  return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
7139
7200
  }
@@ -7236,6 +7297,7 @@
7236
7297
  var lastStoppedKey = null;
7237
7298
  function onKeyDown(e) {
7238
7299
  var cm = this;
7300
+ if (e.target && e.target != cm.display.input.getField()) { return }
7239
7301
  cm.curOp.focus = activeElt();
7240
7302
  if (signalDOMEvent(cm, e)) { return }
7241
7303
  // IE does strange things with escape.
@@ -7279,6 +7341,7 @@
7279
7341
 
7280
7342
  function onKeyPress(e) {
7281
7343
  var cm = this;
7344
+ if (e.target && e.target != cm.display.input.getField()) { return }
7282
7345
  if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }
7283
7346
  var keyCode = e.keyCode, charCode = e.charCode;
7284
7347
  if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}
@@ -7418,6 +7481,10 @@
7418
7481
  var dragEnd = operation(cm, function (e) {
7419
7482
  if (webkit) { display.scroller.draggable = false; }
7420
7483
  cm.state.draggingText = false;
7484
+ if (cm.state.delayingBlurEvent) {
7485
+ if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }
7486
+ else { delayBlurEvent(cm); }
7487
+ }
7421
7488
  off(display.wrapper.ownerDocument, "mouseup", dragEnd);
7422
7489
  off(display.wrapper.ownerDocument, "mousemove", mouseMove);
7423
7490
  off(display.scroller, "dragstart", dragStart);
@@ -7427,8 +7494,8 @@
7427
7494
  if (!behavior.addNew)
7428
7495
  { extendSelection(cm.doc, pos, null, null, behavior.extend); }
7429
7496
  // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
7430
- if (webkit || ie && ie_version == 9)
7431
- { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }
7497
+ if ((webkit && !safari) || ie && ie_version == 9)
7498
+ { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }
7432
7499
  else
7433
7500
  { display.input.focus(); }
7434
7501
  }
@@ -7441,15 +7508,15 @@
7441
7508
  if (webkit) { display.scroller.draggable = true; }
7442
7509
  cm.state.draggingText = dragEnd;
7443
7510
  dragEnd.copy = !behavior.moveOnDrag;
7444
- // IE's approach to draggable
7445
- if (display.scroller.dragDrop) { display.scroller.dragDrop(); }
7446
7511
  on(display.wrapper.ownerDocument, "mouseup", dragEnd);
7447
7512
  on(display.wrapper.ownerDocument, "mousemove", mouseMove);
7448
7513
  on(display.scroller, "dragstart", dragStart);
7449
7514
  on(display.scroller, "drop", dragEnd);
7450
7515
 
7451
- delayBlurEvent(cm);
7516
+ cm.state.delayingBlurEvent = true;
7452
7517
  setTimeout(function () { return display.input.focus(); }, 20);
7518
+ // IE's approach to draggable
7519
+ if (display.scroller.dragDrop) { display.scroller.dragDrop(); }
7453
7520
  }
7454
7521
 
7455
7522
  function rangeForUnit(cm, pos, unit) {
@@ -7462,6 +7529,7 @@
7462
7529
 
7463
7530
  // Normal selection, as opposed to text dragging.
7464
7531
  function leftButtonSelect(cm, event, start, behavior) {
7532
+ if (ie) { delayBlurEvent(cm); }
7465
7533
  var display = cm.display, doc = cm.doc;
7466
7534
  e_preventDefault(event);
7467
7535
 
@@ -7640,7 +7708,7 @@
7640
7708
  mY = e.touches[0].clientY;
7641
7709
  } else {
7642
7710
  try { mX = e.clientX; mY = e.clientY; }
7643
- catch(e) { return false }
7711
+ catch(e$1) { return false }
7644
7712
  }
7645
7713
  if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }
7646
7714
  if (prevent) { e_preventDefault(e); }
@@ -7740,7 +7808,7 @@
7740
7808
  for (var i = newBreaks.length - 1; i >= 0; i--)
7741
7809
  { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }
7742
7810
  });
7743
- option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) {
7811
+ option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) {
7744
7812
  cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
7745
7813
  if (old != Init) { cm.refresh(); }
7746
7814
  });
@@ -7804,6 +7872,12 @@
7804
7872
  }
7805
7873
  cm.display.input.readOnlyChanged(val);
7806
7874
  });
7875
+
7876
+ option("screenReaderLabel", null, function (cm, val) {
7877
+ val = (val === '') ? null : val;
7878
+ cm.display.input.screenReaderLabelChanged(val);
7879
+ });
7880
+
7807
7881
  option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);
7808
7882
  option("dragDrop", true, dragDropChanged);
7809
7883
  option("allowDropFileTypes", null);
@@ -7863,7 +7937,7 @@
7863
7937
  // that user code is usually dealing with.
7864
7938
 
7865
7939
  function CodeMirror(place, options) {
7866
- var this$1 = this;
7940
+ var this$1$1 = this;
7867
7941
 
7868
7942
  if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }
7869
7943
 
@@ -7904,7 +7978,7 @@
7904
7978
 
7905
7979
  // Override magic textarea content restore that IE sometimes does
7906
7980
  // on our hidden textarea on reload
7907
- if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }
7981
+ if (ie && ie_version < 11) { setTimeout(function () { return this$1$1.display.input.reset(true); }, 20); }
7908
7982
 
7909
7983
  registerEventHandlers(this);
7910
7984
  ensureGlobalHandlers();
@@ -7914,7 +7988,9 @@
7914
7988
  attachDoc(this, doc);
7915
7989
 
7916
7990
  if ((options.autofocus && !mobile) || this.hasFocus())
7917
- { setTimeout(bind(onFocus, this), 20); }
7991
+ { setTimeout(function () {
7992
+ if (this$1$1.hasFocus() && !this$1$1.state.focused) { onFocus(this$1$1); }
7993
+ }, 20); }
7918
7994
  else
7919
7995
  { onBlur(this); }
7920
7996
 
@@ -7956,6 +8032,9 @@
7956
8032
  // which point we can't mess with it anymore. Context menu is
7957
8033
  // handled in onMouseDown for these browsers.
7958
8034
  on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); });
8035
+ on(d.input.getField(), "contextmenu", function (e) {
8036
+ if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }
8037
+ });
7959
8038
 
7960
8039
  // Used to suppress mouse event handling when a touch happens
7961
8040
  var touchFinished, prevTouch = {end: 0};
@@ -8151,7 +8230,7 @@
8151
8230
  { from = Pos(from.line, from.ch - deleted); }
8152
8231
  else if (cm.state.overwrite && !paste) // Handle overwrite
8153
8232
  { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }
8154
- else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted)
8233
+ else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n"))
8155
8234
  { from = to = Pos(from.line, 0); }
8156
8235
  }
8157
8236
  var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,
@@ -8220,7 +8299,7 @@
8220
8299
  }
8221
8300
 
8222
8301
  function hiddenTextarea() {
8223
- var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none");
8302
+ var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");
8224
8303
  var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
8225
8304
  // The textarea is kept positioned near the cursor to prevent the
8226
8305
  // fact that it'll be scrolled into view on input from scrolling
@@ -8491,11 +8570,11 @@
8491
8570
  },
8492
8571
 
8493
8572
  moveH: methodOp(function(dir, unit) {
8494
- var this$1 = this;
8573
+ var this$1$1 = this;
8495
8574
 
8496
8575
  this.extendSelectionsBy(function (range) {
8497
- if (this$1.display.shift || this$1.doc.extend || range.empty())
8498
- { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }
8576
+ if (this$1$1.display.shift || this$1$1.doc.extend || range.empty())
8577
+ { return findPosH(this$1$1.doc, range.head, dir, unit, this$1$1.options.rtlMoveVisually) }
8499
8578
  else
8500
8579
  { return dir < 0 ? range.from() : range.to() }
8501
8580
  }, sel_move);
@@ -8527,19 +8606,19 @@
8527
8606
  },
8528
8607
 
8529
8608
  moveV: methodOp(function(dir, unit) {
8530
- var this$1 = this;
8609
+ var this$1$1 = this;
8531
8610
 
8532
8611
  var doc = this.doc, goals = [];
8533
8612
  var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();
8534
8613
  doc.extendSelectionsBy(function (range) {
8535
8614
  if (collapse)
8536
8615
  { return dir < 0 ? range.from() : range.to() }
8537
- var headPos = cursorCoords(this$1, range.head, "div");
8616
+ var headPos = cursorCoords(this$1$1, range.head, "div");
8538
8617
  if (range.goalColumn != null) { headPos.left = range.goalColumn; }
8539
8618
  goals.push(headPos.left);
8540
- var pos = findPosV(this$1, headPos, dir, unit);
8619
+ var pos = findPosV(this$1$1, headPos, dir, unit);
8541
8620
  if (unit == "page" && range == doc.sel.primary())
8542
- { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); }
8621
+ { addToScrollTop(this$1$1, charCoords(this$1$1, pos, "div").top - headPos.top); }
8543
8622
  return pos
8544
8623
  }, sel_move);
8545
8624
  if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)
@@ -8605,7 +8684,7 @@
8605
8684
  }),
8606
8685
 
8607
8686
  setSize: methodOp(function(width, height) {
8608
- var this$1 = this;
8687
+ var this$1$1 = this;
8609
8688
 
8610
8689
  var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; };
8611
8690
  if (width != null) { this.display.wrapper.style.width = interpret(width); }
@@ -8614,7 +8693,7 @@
8614
8693
  var lineNo = this.display.viewFrom;
8615
8694
  this.doc.iter(lineNo, this.display.viewTo, function (line) {
8616
8695
  if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)
8617
- { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } }
8696
+ { if (line.widgets[i].noHScroll) { regLineChange(this$1$1, lineNo, "widget"); break } } }
8618
8697
  ++lineNo;
8619
8698
  });
8620
8699
  this.curOp.forceUpdate = true;
@@ -8632,7 +8711,7 @@
8632
8711
  clearCaches(this);
8633
8712
  scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);
8634
8713
  updateGutterSpace(this.display);
8635
- if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)
8714
+ if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)
8636
8715
  { estimateLineHeights(this); }
8637
8716
  signal(this, "refresh", this);
8638
8717
  }),
@@ -8674,34 +8753,43 @@
8674
8753
  }
8675
8754
 
8676
8755
  // Used for horizontal relative motion. Dir is -1 or 1 (left or
8677
- // right), unit can be "char", "column" (like char, but doesn't
8678
- // cross line boundaries), "word" (across next word), or "group" (to
8679
- // the start of next group of word or non-word-non-whitespace
8680
- // chars). The visually param controls whether, in right-to-left
8681
- // text, direction 1 means to move towards the next index in the
8682
- // string, or towards the character to the right of the current
8683
- // position. The resulting position will have a hitSide=true
8684
- // property if it reached the end of the document.
8756
+ // right), unit can be "codepoint", "char", "column" (like char, but
8757
+ // doesn't cross line boundaries), "word" (across next word), or
8758
+ // "group" (to the start of next group of word or
8759
+ // non-word-non-whitespace chars). The visually param controls
8760
+ // whether, in right-to-left text, direction 1 means to move towards
8761
+ // the next index in the string, or towards the character to the right
8762
+ // of the current position. The resulting position will have a
8763
+ // hitSide=true property if it reached the end of the document.
8685
8764
  function findPosH(doc, pos, dir, unit, visually) {
8686
8765
  var oldPos = pos;
8687
8766
  var origDir = dir;
8688
8767
  var lineObj = getLine(doc, pos.line);
8768
+ var lineDir = visually && doc.direction == "rtl" ? -dir : dir;
8689
8769
  function findNextLine() {
8690
- var l = pos.line + dir;
8770
+ var l = pos.line + lineDir;
8691
8771
  if (l < doc.first || l >= doc.first + doc.size) { return false }
8692
8772
  pos = new Pos(l, pos.ch, pos.sticky);
8693
8773
  return lineObj = getLine(doc, l)
8694
8774
  }
8695
8775
  function moveOnce(boundToLine) {
8696
8776
  var next;
8697
- if (visually) {
8777
+ if (unit == "codepoint") {
8778
+ var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));
8779
+ if (isNaN(ch)) {
8780
+ next = null;
8781
+ } else {
8782
+ var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;
8783
+ next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);
8784
+ }
8785
+ } else if (visually) {
8698
8786
  next = moveVisually(doc.cm, lineObj, pos, dir);
8699
8787
  } else {
8700
8788
  next = moveLogically(lineObj, pos, dir);
8701
8789
  }
8702
8790
  if (next == null) {
8703
8791
  if (!boundToLine && findNextLine())
8704
- { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }
8792
+ { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }
8705
8793
  else
8706
8794
  { return false }
8707
8795
  } else {
@@ -8710,7 +8798,7 @@
8710
8798
  return true
8711
8799
  }
8712
8800
 
8713
- if (unit == "char") {
8801
+ if (unit == "char" || unit == "codepoint") {
8714
8802
  moveOnce();
8715
8803
  } else if (unit == "column") {
8716
8804
  moveOnce(true);
@@ -8774,39 +8862,48 @@
8774
8862
  };
8775
8863
 
8776
8864
  ContentEditableInput.prototype.init = function (display) {
8777
- var this$1 = this;
8865
+ var this$1$1 = this;
8778
8866
 
8779
8867
  var input = this, cm = input.cm;
8780
8868
  var div = input.div = display.lineDiv;
8869
+ div.contentEditable = true;
8781
8870
  disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);
8782
8871
 
8872
+ function belongsToInput(e) {
8873
+ for (var t = e.target; t; t = t.parentNode) {
8874
+ if (t == div) { return true }
8875
+ if (/\bCodeMirror-(?:line)?widget\b/.test(t.className)) { break }
8876
+ }
8877
+ return false
8878
+ }
8879
+
8783
8880
  on(div, "paste", function (e) {
8784
- if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
8881
+ if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
8785
8882
  // IE doesn't fire input events, so we schedule a read for the pasted content in this way
8786
- if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }
8883
+ if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1$1.updateFromDOM(); }), 20); }
8787
8884
  });
8788
8885
 
8789
8886
  on(div, "compositionstart", function (e) {
8790
- this$1.composing = {data: e.data, done: false};
8887
+ this$1$1.composing = {data: e.data, done: false};
8791
8888
  });
8792
8889
  on(div, "compositionupdate", function (e) {
8793
- if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }
8890
+ if (!this$1$1.composing) { this$1$1.composing = {data: e.data, done: false}; }
8794
8891
  });
8795
8892
  on(div, "compositionend", function (e) {
8796
- if (this$1.composing) {
8797
- if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }
8798
- this$1.composing.done = true;
8893
+ if (this$1$1.composing) {
8894
+ if (e.data != this$1$1.composing.data) { this$1$1.readFromDOMSoon(); }
8895
+ this$1$1.composing.done = true;
8799
8896
  }
8800
8897
  });
8801
8898
 
8802
8899
  on(div, "touchstart", function () { return input.forceCompositionEnd(); });
8803
8900
 
8804
8901
  on(div, "input", function () {
8805
- if (!this$1.composing) { this$1.readFromDOMSoon(); }
8902
+ if (!this$1$1.composing) { this$1$1.readFromDOMSoon(); }
8806
8903
  });
8807
8904
 
8808
8905
  function onCopyCut(e) {
8809
- if (signalDOMEvent(cm, e)) { return }
8906
+ if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }
8810
8907
  if (cm.somethingSelected()) {
8811
8908
  setLastCopied({lineWise: false, text: cm.getSelections()});
8812
8909
  if (e.type == "cut") { cm.replaceSelection("", null, "cut"); }
@@ -8836,7 +8933,7 @@
8836
8933
  var kludge = hiddenTextarea(), te = kludge.firstChild;
8837
8934
  cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
8838
8935
  te.value = lastCopied.text.join("\n");
8839
- var hadFocus = document.activeElement;
8936
+ var hadFocus = activeElt();
8840
8937
  selectInput(te);
8841
8938
  setTimeout(function () {
8842
8939
  cm.display.lineSpace.removeChild(kludge);
@@ -8848,9 +8945,18 @@
8848
8945
  on(div, "cut", onCopyCut);
8849
8946
  };
8850
8947
 
8948
+ ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {
8949
+ // Label for screenreaders, accessibility
8950
+ if(label) {
8951
+ this.div.setAttribute('aria-label', label);
8952
+ } else {
8953
+ this.div.removeAttribute('aria-label');
8954
+ }
8955
+ };
8956
+
8851
8957
  ContentEditableInput.prototype.prepareSelection = function () {
8852
8958
  var result = prepareSelection(this.cm, false);
8853
- result.focus = this.cm.state.focused;
8959
+ result.focus = activeElt() == this.div;
8854
8960
  return result
8855
8961
  };
8856
8962
 
@@ -8916,13 +9022,13 @@
8916
9022
  };
8917
9023
 
8918
9024
  ContentEditableInput.prototype.startGracePeriod = function () {
8919
- var this$1 = this;
9025
+ var this$1$1 = this;
8920
9026
 
8921
9027
  clearTimeout(this.gracePeriod);
8922
9028
  this.gracePeriod = setTimeout(function () {
8923
- this$1.gracePeriod = false;
8924
- if (this$1.selectionChanged())
8925
- { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }
9029
+ this$1$1.gracePeriod = false;
9030
+ if (this$1$1.selectionChanged())
9031
+ { this$1$1.cm.operation(function () { return this$1$1.cm.curOp.selectionChanged = true; }); }
8926
9032
  }, 20);
8927
9033
  };
8928
9034
 
@@ -8946,7 +9052,7 @@
8946
9052
 
8947
9053
  ContentEditableInput.prototype.focus = function () {
8948
9054
  if (this.cm.options.readOnly != "nocursor") {
8949
- if (!this.selectionInEditor())
9055
+ if (!this.selectionInEditor() || activeElt() != this.div)
8950
9056
  { this.showSelection(this.prepareSelection(), true); }
8951
9057
  this.div.focus();
8952
9058
  }
@@ -8957,9 +9063,11 @@
8957
9063
  ContentEditableInput.prototype.supportsTouch = function () { return true };
8958
9064
 
8959
9065
  ContentEditableInput.prototype.receivedFocus = function () {
9066
+ var this$1$1 = this;
9067
+
8960
9068
  var input = this;
8961
9069
  if (this.selectionInEditor())
8962
- { this.pollSelection(); }
9070
+ { setTimeout(function () { return this$1$1.pollSelection(); }, 20); }
8963
9071
  else
8964
9072
  { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }
8965
9073
 
@@ -9089,24 +9197,24 @@
9089
9197
  this.div.focus();
9090
9198
  };
9091
9199
  ContentEditableInput.prototype.readFromDOMSoon = function () {
9092
- var this$1 = this;
9200
+ var this$1$1 = this;
9093
9201
 
9094
9202
  if (this.readDOMTimeout != null) { return }
9095
9203
  this.readDOMTimeout = setTimeout(function () {
9096
- this$1.readDOMTimeout = null;
9097
- if (this$1.composing) {
9098
- if (this$1.composing.done) { this$1.composing = null; }
9204
+ this$1$1.readDOMTimeout = null;
9205
+ if (this$1$1.composing) {
9206
+ if (this$1$1.composing.done) { this$1$1.composing = null; }
9099
9207
  else { return }
9100
9208
  }
9101
- this$1.updateFromDOM();
9209
+ this$1$1.updateFromDOM();
9102
9210
  }, 80);
9103
9211
  };
9104
9212
 
9105
9213
  ContentEditableInput.prototype.updateFromDOM = function () {
9106
- var this$1 = this;
9214
+ var this$1$1 = this;
9107
9215
 
9108
9216
  if (this.cm.isReadOnly() || !this.pollContent())
9109
- { runInOp(this.cm, function () { return regChange(this$1.cm); }); }
9217
+ { runInOp(this.cm, function () { return regChange(this$1$1.cm); }); }
9110
9218
  };
9111
9219
 
9112
9220
  ContentEditableInput.prototype.setUneditable = function (node) {
@@ -9299,7 +9407,7 @@
9299
9407
  };
9300
9408
 
9301
9409
  TextareaInput.prototype.init = function (display) {
9302
- var this$1 = this;
9410
+ var this$1$1 = this;
9303
9411
 
9304
9412
  var input = this, cm = this.cm;
9305
9413
  this.createField(display);
@@ -9311,7 +9419,7 @@
9311
9419
  if (ios) { te.style.width = "0px"; }
9312
9420
 
9313
9421
  on(te, "input", function () {
9314
- if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }
9422
+ if (ie && ie_version >= 9 && this$1$1.hasSelection) { this$1$1.hasSelection = null; }
9315
9423
  input.poll();
9316
9424
  });
9317
9425
 
@@ -9388,6 +9496,15 @@
9388
9496
  this.textarea = this.wrapper.firstChild;
9389
9497
  };
9390
9498
 
9499
+ TextareaInput.prototype.screenReaderLabelChanged = function (label) {
9500
+ // Label for screenreaders, accessibility
9501
+ if(label) {
9502
+ this.textarea.setAttribute('aria-label', label);
9503
+ } else {
9504
+ this.textarea.removeAttribute('aria-label');
9505
+ }
9506
+ };
9507
+
9391
9508
  TextareaInput.prototype.prepareSelection = function () {
9392
9509
  // Redraw the selection and/or cursor
9393
9510
  var cm = this.cm, display = cm.display, doc = cm.doc;
@@ -9455,12 +9572,12 @@
9455
9572
  // Poll for input changes, using the normal rate of polling. This
9456
9573
  // runs as long as the editor is focused.
9457
9574
  TextareaInput.prototype.slowPoll = function () {
9458
- var this$1 = this;
9575
+ var this$1$1 = this;
9459
9576
 
9460
9577
  if (this.pollingFast) { return }
9461
9578
  this.polling.set(this.cm.options.pollInterval, function () {
9462
- this$1.poll();
9463
- if (this$1.cm.state.focused) { this$1.slowPoll(); }
9579
+ this$1$1.poll();
9580
+ if (this$1$1.cm.state.focused) { this$1$1.slowPoll(); }
9464
9581
  });
9465
9582
  };
9466
9583
 
@@ -9485,7 +9602,7 @@
9485
9602
  // seen text (can be empty), which is stored in prevInput (we must
9486
9603
  // not reset the textarea when typing, because that breaks IME).
9487
9604
  TextareaInput.prototype.poll = function () {
9488
- var this$1 = this;
9605
+ var this$1$1 = this;
9489
9606
 
9490
9607
  var cm = this.cm, input = this.textarea, prevInput = this.prevInput;
9491
9608
  // Since this is called a *lot*, try to bail out as cheaply as
@@ -9520,15 +9637,15 @@
9520
9637
 
9521
9638
  runInOp(cm, function () {
9522
9639
  applyTextInput(cm, text.slice(same), prevInput.length - same,
9523
- null, this$1.composing ? "*compose" : null);
9640
+ null, this$1$1.composing ? "*compose" : null);
9524
9641
 
9525
9642
  // Don't leave long text in the textarea, since it makes further polling slow
9526
- if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = ""; }
9527
- else { this$1.prevInput = text; }
9643
+ if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1$1.prevInput = ""; }
9644
+ else { this$1$1.prevInput = text; }
9528
9645
 
9529
- if (this$1.composing) {
9530
- this$1.composing.range.clear();
9531
- this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"),
9646
+ if (this$1$1.composing) {
9647
+ this$1$1.composing.range.clear();
9648
+ this$1$1.composing.range = cm.markText(this$1$1.composing.start, cm.getCursor("to"),
9532
9649
  {className: "CodeMirror-composing"});
9533
9650
  }
9534
9651
  });
@@ -9628,6 +9745,7 @@
9628
9745
  TextareaInput.prototype.readOnlyChanged = function (val) {
9629
9746
  if (!val) { this.reset(); }
9630
9747
  this.textarea.disabled = val == "nocursor";
9748
+ this.textarea.readOnly = !!val;
9631
9749
  };
9632
9750
 
9633
9751
  TextareaInput.prototype.setUneditable = function () {};
@@ -9778,19 +9896,21 @@
9778
9896
 
9779
9897
  addLegacyProps(CodeMirror);
9780
9898
 
9781
- CodeMirror.version = "5.50.2";
9899
+ CodeMirror.version = "5.65.0";
9782
9900
 
9783
9901
  return CodeMirror;
9784
9902
 
9785
9903
  })));
9786
- });
9904
+ }(codemirror));
9787
9905
 
9788
- var css = createCommonjsModule(function (module, exports) {
9906
+ var CodeMirror = codemirror.exports;
9907
+
9908
+ (function (module, exports) {
9789
9909
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
9790
9910
  // Distributed under an MIT license: https://codemirror.net/LICENSE
9791
9911
 
9792
9912
  (function(mod) {
9793
- mod(codemirror);
9913
+ mod(codemirror.exports);
9794
9914
  })(function(CodeMirror) {
9795
9915
 
9796
9916
  CodeMirror.defineMode("css", function(config, parserConfig) {
@@ -9811,7 +9931,8 @@
9811
9931
  valueKeywords = parserConfig.valueKeywords || {},
9812
9932
  allowNested = parserConfig.allowNested,
9813
9933
  lineComment = parserConfig.lineComment,
9814
- supportsAtComponent = parserConfig.supportsAtComponent === true;
9934
+ supportsAtComponent = parserConfig.supportsAtComponent === true,
9935
+ highlightNonStandardPropertyKeywords = config.highlightNonStandardPropertyKeywords !== false;
9815
9936
 
9816
9937
  var type, override;
9817
9938
  function ret(style, tp) { type = tp; return style; }
@@ -9859,8 +9980,8 @@
9859
9980
  return ret("qualifier", "qualifier");
9860
9981
  } else if (/[:;{}\[\]\(\)]/.test(ch)) {
9861
9982
  return ret(null, ch);
9862
- } else if (stream.match(/[\w-.]+(?=\()/)) {
9863
- if (/^(url(-prefix)?|domain|regexp)$/.test(stream.current().toLowerCase())) {
9983
+ } else if (stream.match(/^[\w-.]+(?=\()/)) {
9984
+ if (/^(url(-prefix)?|domain|regexp)$/i.test(stream.current())) {
9864
9985
  state.tokenize = tokenParenthesized;
9865
9986
  }
9866
9987
  return ret("variable callee", "variable");
@@ -9889,7 +10010,7 @@
9889
10010
 
9890
10011
  function tokenParenthesized(stream, state) {
9891
10012
  stream.next(); // Must be '('
9892
- if (!stream.match(/\s*[\"\')]/, false))
10013
+ if (!stream.match(/^\s*[\"\')]/, false))
9893
10014
  state.tokenize = tokenString(")");
9894
10015
  else
9895
10016
  state.tokenize = null;
@@ -9979,7 +10100,7 @@
9979
10100
  override = "property";
9980
10101
  return "maybeprop";
9981
10102
  } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
9982
- override = "string-2";
10103
+ override = highlightNonStandardPropertyKeywords ? "string-2" : "property";
9983
10104
  return "maybeprop";
9984
10105
  } else if (allowNested) {
9985
10106
  override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag";
@@ -10073,7 +10194,7 @@
10073
10194
  else if (propertyKeywords.hasOwnProperty(word))
10074
10195
  override = "property";
10075
10196
  else if (nonStandardPropertyKeywords.hasOwnProperty(word))
10076
- override = "string-2";
10197
+ override = highlightNonStandardPropertyKeywords ? "string-2" : "property";
10077
10198
  else if (valueKeywords.hasOwnProperty(word))
10078
10199
  override = "atom";
10079
10200
  else if (colorKeywords.hasOwnProperty(word))
@@ -10224,117 +10345,151 @@
10224
10345
  "monochrome", "min-monochrome", "max-monochrome", "resolution",
10225
10346
  "min-resolution", "max-resolution", "scan", "grid", "orientation",
10226
10347
  "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio",
10227
- "pointer", "any-pointer", "hover", "any-hover"
10348
+ "pointer", "any-pointer", "hover", "any-hover", "prefers-color-scheme",
10349
+ "dynamic-range", "video-dynamic-range"
10228
10350
  ], mediaFeatures = keySet(mediaFeatures_);
10229
10351
 
10230
10352
  var mediaValueKeywords_ = [
10231
10353
  "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover",
10232
- "interlace", "progressive"
10354
+ "interlace", "progressive",
10355
+ "dark", "light",
10356
+ "standard", "high"
10233
10357
  ], mediaValueKeywords = keySet(mediaValueKeywords_);
10234
10358
 
10235
10359
  var propertyKeywords_ = [
10236
10360
  "align-content", "align-items", "align-self", "alignment-adjust",
10237
- "alignment-baseline", "anchor-point", "animation", "animation-delay",
10361
+ "alignment-baseline", "all", "anchor-point", "animation", "animation-delay",
10238
10362
  "animation-direction", "animation-duration", "animation-fill-mode",
10239
10363
  "animation-iteration-count", "animation-name", "animation-play-state",
10240
- "animation-timing-function", "appearance", "azimuth", "backface-visibility",
10241
- "background", "background-attachment", "background-blend-mode", "background-clip",
10242
- "background-color", "background-image", "background-origin", "background-position",
10243
- "background-repeat", "background-size", "baseline-shift", "binding",
10244
- "bleed", "bookmark-label", "bookmark-level", "bookmark-state",
10245
- "bookmark-target", "border", "border-bottom", "border-bottom-color",
10246
- "border-bottom-left-radius", "border-bottom-right-radius",
10247
- "border-bottom-style", "border-bottom-width", "border-collapse",
10248
- "border-color", "border-image", "border-image-outset",
10364
+ "animation-timing-function", "appearance", "azimuth", "backdrop-filter",
10365
+ "backface-visibility", "background", "background-attachment",
10366
+ "background-blend-mode", "background-clip", "background-color",
10367
+ "background-image", "background-origin", "background-position",
10368
+ "background-position-x", "background-position-y", "background-repeat",
10369
+ "background-size", "baseline-shift", "binding", "bleed", "block-size",
10370
+ "bookmark-label", "bookmark-level", "bookmark-state", "bookmark-target",
10371
+ "border", "border-bottom", "border-bottom-color", "border-bottom-left-radius",
10372
+ "border-bottom-right-radius", "border-bottom-style", "border-bottom-width",
10373
+ "border-collapse", "border-color", "border-image", "border-image-outset",
10249
10374
  "border-image-repeat", "border-image-slice", "border-image-source",
10250
- "border-image-width", "border-left", "border-left-color",
10251
- "border-left-style", "border-left-width", "border-radius", "border-right",
10252
- "border-right-color", "border-right-style", "border-right-width",
10253
- "border-spacing", "border-style", "border-top", "border-top-color",
10254
- "border-top-left-radius", "border-top-right-radius", "border-top-style",
10255
- "border-top-width", "border-width", "bottom", "box-decoration-break",
10256
- "box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
10257
- "caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count",
10258
- "column-fill", "column-gap", "column-rule", "column-rule-color",
10259
- "column-rule-style", "column-rule-width", "column-span", "column-width",
10260
- "columns", "content", "counter-increment", "counter-reset", "crop", "cue",
10261
- "cue-after", "cue-before", "cursor", "direction", "display",
10262
- "dominant-baseline", "drop-initial-after-adjust",
10263
- "drop-initial-after-align", "drop-initial-before-adjust",
10264
- "drop-initial-before-align", "drop-initial-size", "drop-initial-value",
10265
- "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
10266
- "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
10267
- "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings",
10268
- "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust",
10269
- "font-stretch", "font-style", "font-synthesis", "font-variant",
10270
- "font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
10271
- "font-variant-ligatures", "font-variant-numeric", "font-variant-position",
10272
- "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",
10273
- "grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap",
10274
- "grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap",
10275
- "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
10276
- "grid-template-rows", "hanging-punctuation", "height", "hyphens",
10277
- "icon", "image-orientation", "image-rendering", "image-resolution",
10278
- "inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing",
10279
- "line-break", "line-height", "line-stacking", "line-stacking-ruby",
10375
+ "border-image-width", "border-left", "border-left-color", "border-left-style",
10376
+ "border-left-width", "border-radius", "border-right", "border-right-color",
10377
+ "border-right-style", "border-right-width", "border-spacing", "border-style",
10378
+ "border-top", "border-top-color", "border-top-left-radius",
10379
+ "border-top-right-radius", "border-top-style", "border-top-width",
10380
+ "border-width", "bottom", "box-decoration-break", "box-shadow", "box-sizing",
10381
+ "break-after", "break-before", "break-inside", "caption-side", "caret-color",
10382
+ "clear", "clip", "color", "color-profile", "column-count", "column-fill",
10383
+ "column-gap", "column-rule", "column-rule-color", "column-rule-style",
10384
+ "column-rule-width", "column-span", "column-width", "columns", "contain",
10385
+ "content", "counter-increment", "counter-reset", "crop", "cue", "cue-after",
10386
+ "cue-before", "cursor", "direction", "display", "dominant-baseline",
10387
+ "drop-initial-after-adjust", "drop-initial-after-align",
10388
+ "drop-initial-before-adjust", "drop-initial-before-align", "drop-initial-size",
10389
+ "drop-initial-value", "elevation", "empty-cells", "fit", "fit-content", "fit-position",
10390
+ "flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow",
10391
+ "flex-shrink", "flex-wrap", "float", "float-offset", "flow-from", "flow-into",
10392
+ "font", "font-family", "font-feature-settings", "font-kerning",
10393
+ "font-language-override", "font-optical-sizing", "font-size",
10394
+ "font-size-adjust", "font-stretch", "font-style", "font-synthesis",
10395
+ "font-variant", "font-variant-alternates", "font-variant-caps",
10396
+ "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric",
10397
+ "font-variant-position", "font-variation-settings", "font-weight", "gap",
10398
+ "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", "grid-auto-rows",
10399
+ "grid-column", "grid-column-end", "grid-column-gap", "grid-column-start",
10400
+ "grid-gap", "grid-row", "grid-row-end", "grid-row-gap", "grid-row-start",
10401
+ "grid-template", "grid-template-areas", "grid-template-columns",
10402
+ "grid-template-rows", "hanging-punctuation", "height", "hyphens", "icon",
10403
+ "image-orientation", "image-rendering", "image-resolution", "inline-box-align",
10404
+ "inset", "inset-block", "inset-block-end", "inset-block-start", "inset-inline",
10405
+ "inset-inline-end", "inset-inline-start", "isolation", "justify-content",
10406
+ "justify-items", "justify-self", "left", "letter-spacing", "line-break",
10407
+ "line-height", "line-height-step", "line-stacking", "line-stacking-ruby",
10280
10408
  "line-stacking-shift", "line-stacking-strategy", "list-style",
10281
10409
  "list-style-image", "list-style-position", "list-style-type", "margin",
10282
- "margin-bottom", "margin-left", "margin-right", "margin-top",
10283
- "marks", "marquee-direction", "marquee-loop",
10284
- "marquee-play-count", "marquee-speed", "marquee-style", "max-height",
10285
- "max-width", "min-height", "min-width", "mix-blend-mode", "move-to", "nav-down", "nav-index",
10286
- "nav-left", "nav-right", "nav-up", "object-fit", "object-position",
10287
- "opacity", "order", "orphans", "outline",
10288
- "outline-color", "outline-offset", "outline-style", "outline-width",
10289
- "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
10290
- "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
10291
- "page", "page-break-after", "page-break-before", "page-break-inside",
10292
- "page-policy", "pause", "pause-after", "pause-before", "perspective",
10293
- "perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position",
10294
- "presentation-level", "punctuation-trim", "quotes", "region-break-after",
10295
- "region-break-before", "region-break-inside", "region-fragment",
10296
- "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
10297
- "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",
10298
- "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin",
10299
- "shape-outside", "size", "speak", "speak-as", "speak-header",
10300
- "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
10301
- "tab-size", "table-layout", "target", "target-name", "target-new",
10302
- "target-position", "text-align", "text-align-last", "text-decoration",
10410
+ "margin-bottom", "margin-left", "margin-right", "margin-top", "marks",
10411
+ "marquee-direction", "marquee-loop", "marquee-play-count", "marquee-speed",
10412
+ "marquee-style", "mask-clip", "mask-composite", "mask-image", "mask-mode",
10413
+ "mask-origin", "mask-position", "mask-repeat", "mask-size","mask-type",
10414
+ "max-block-size", "max-height", "max-inline-size",
10415
+ "max-width", "min-block-size", "min-height", "min-inline-size", "min-width",
10416
+ "mix-blend-mode", "move-to", "nav-down", "nav-index", "nav-left", "nav-right",
10417
+ "nav-up", "object-fit", "object-position", "offset", "offset-anchor",
10418
+ "offset-distance", "offset-path", "offset-position", "offset-rotate",
10419
+ "opacity", "order", "orphans", "outline", "outline-color", "outline-offset",
10420
+ "outline-style", "outline-width", "overflow", "overflow-style",
10421
+ "overflow-wrap", "overflow-x", "overflow-y", "padding", "padding-bottom",
10422
+ "padding-left", "padding-right", "padding-top", "page", "page-break-after",
10423
+ "page-break-before", "page-break-inside", "page-policy", "pause",
10424
+ "pause-after", "pause-before", "perspective", "perspective-origin", "pitch",
10425
+ "pitch-range", "place-content", "place-items", "place-self", "play-during",
10426
+ "position", "presentation-level", "punctuation-trim", "quotes",
10427
+ "region-break-after", "region-break-before", "region-break-inside",
10428
+ "region-fragment", "rendering-intent", "resize", "rest", "rest-after",
10429
+ "rest-before", "richness", "right", "rotate", "rotation", "rotation-point",
10430
+ "row-gap", "ruby-align", "ruby-overhang", "ruby-position", "ruby-span",
10431
+ "scale", "scroll-behavior", "scroll-margin", "scroll-margin-block",
10432
+ "scroll-margin-block-end", "scroll-margin-block-start", "scroll-margin-bottom",
10433
+ "scroll-margin-inline", "scroll-margin-inline-end",
10434
+ "scroll-margin-inline-start", "scroll-margin-left", "scroll-margin-right",
10435
+ "scroll-margin-top", "scroll-padding", "scroll-padding-block",
10436
+ "scroll-padding-block-end", "scroll-padding-block-start",
10437
+ "scroll-padding-bottom", "scroll-padding-inline", "scroll-padding-inline-end",
10438
+ "scroll-padding-inline-start", "scroll-padding-left", "scroll-padding-right",
10439
+ "scroll-padding-top", "scroll-snap-align", "scroll-snap-type",
10440
+ "shape-image-threshold", "shape-inside", "shape-margin", "shape-outside",
10441
+ "size", "speak", "speak-as", "speak-header", "speak-numeral",
10442
+ "speak-punctuation", "speech-rate", "stress", "string-set", "tab-size",
10443
+ "table-layout", "target", "target-name", "target-new", "target-position",
10444
+ "text-align", "text-align-last", "text-combine-upright", "text-decoration",
10303
10445
  "text-decoration-color", "text-decoration-line", "text-decoration-skip",
10304
- "text-decoration-style", "text-emphasis", "text-emphasis-color",
10305
- "text-emphasis-position", "text-emphasis-style", "text-height",
10306
- "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow",
10307
- "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position",
10308
- "text-wrap", "top", "transform", "transform-origin", "transform-style",
10309
- "transition", "transition-delay", "transition-duration",
10310
- "transition-property", "transition-timing-function", "unicode-bidi",
10311
- "user-select", "vertical-align", "visibility", "voice-balance", "voice-duration",
10312
- "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
10313
- "voice-volume", "volume", "white-space", "widows", "width", "will-change", "word-break",
10314
- "word-spacing", "word-wrap", "z-index",
10446
+ "text-decoration-skip-ink", "text-decoration-style", "text-emphasis",
10447
+ "text-emphasis-color", "text-emphasis-position", "text-emphasis-style",
10448
+ "text-height", "text-indent", "text-justify", "text-orientation",
10449
+ "text-outline", "text-overflow", "text-rendering", "text-shadow",
10450
+ "text-size-adjust", "text-space-collapse", "text-transform",
10451
+ "text-underline-position", "text-wrap", "top", "touch-action", "transform", "transform-origin",
10452
+ "transform-style", "transition", "transition-delay", "transition-duration",
10453
+ "transition-property", "transition-timing-function", "translate",
10454
+ "unicode-bidi", "user-select", "vertical-align", "visibility", "voice-balance",
10455
+ "voice-duration", "voice-family", "voice-pitch", "voice-range", "voice-rate",
10456
+ "voice-stress", "voice-volume", "volume", "white-space", "widows", "width",
10457
+ "will-change", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index",
10315
10458
  // SVG-specific
10316
10459
  "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
10317
10460
  "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
10318
10461
  "color-interpolation", "color-interpolation-filters",
10319
10462
  "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering",
10320
- "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke",
10463
+ "marker", "marker-end", "marker-mid", "marker-start", "paint-order", "shape-rendering", "stroke",
10321
10464
  "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin",
10322
10465
  "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering",
10323
10466
  "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal",
10324
- "glyph-orientation-vertical", "text-anchor", "writing-mode"
10467
+ "glyph-orientation-vertical", "text-anchor", "writing-mode",
10325
10468
  ], propertyKeywords = keySet(propertyKeywords_);
10326
10469
 
10327
10470
  var nonStandardPropertyKeywords_ = [
10471
+ "accent-color", "aspect-ratio", "border-block", "border-block-color", "border-block-end",
10472
+ "border-block-end-color", "border-block-end-style", "border-block-end-width",
10473
+ "border-block-start", "border-block-start-color", "border-block-start-style",
10474
+ "border-block-start-width", "border-block-style", "border-block-width",
10475
+ "border-inline", "border-inline-color", "border-inline-end",
10476
+ "border-inline-end-color", "border-inline-end-style",
10477
+ "border-inline-end-width", "border-inline-start", "border-inline-start-color",
10478
+ "border-inline-start-style", "border-inline-start-width",
10479
+ "border-inline-style", "border-inline-width", "content-visibility", "margin-block",
10480
+ "margin-block-end", "margin-block-start", "margin-inline", "margin-inline-end",
10481
+ "margin-inline-start", "overflow-anchor", "overscroll-behavior", "padding-block", "padding-block-end",
10482
+ "padding-block-start", "padding-inline", "padding-inline-end",
10483
+ "padding-inline-start", "scroll-snap-stop", "scrollbar-3d-light-color",
10328
10484
  "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
10329
10485
  "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
10330
- "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside",
10331
- "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
10332
- "searchfield-results-decoration", "zoom"
10486
+ "scrollbar-track-color", "searchfield-cancel-button", "searchfield-decoration",
10487
+ "searchfield-results-button", "searchfield-results-decoration", "shape-inside", "zoom"
10333
10488
  ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
10334
10489
 
10335
10490
  var fontProperties_ = [
10336
- "font-family", "src", "unicode-range", "font-variant", "font-feature-settings",
10337
- "font-stretch", "font-weight", "font-style"
10491
+ "font-display", "font-family", "src", "unicode-range", "font-variant",
10492
+ "font-feature-settings", "font-stretch", "font-weight", "font-style"
10338
10493
  ], fontProperties = keySet(fontProperties_);
10339
10494
 
10340
10495
  var counterDescriptors_ = [
@@ -10347,16 +10502,16 @@
10347
10502
  "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
10348
10503
  "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
10349
10504
  "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
10350
- "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
10505
+ "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen",
10351
10506
  "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
10352
- "darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
10353
- "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
10507
+ "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet",
10508
+ "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick",
10354
10509
  "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
10355
10510
  "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
10356
10511
  "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
10357
10512
  "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
10358
- "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
10359
- "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
10513
+ "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink",
10514
+ "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey",
10360
10515
  "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
10361
10516
  "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
10362
10517
  "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
@@ -10366,7 +10521,7 @@
10366
10521
  "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
10367
10522
  "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
10368
10523
  "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
10369
- "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
10524
+ "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan",
10370
10525
  "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
10371
10526
  "whitesmoke", "yellow", "yellowgreen"
10372
10527
  ], colorKeywords = keySet(colorKeywords_);
@@ -10376,22 +10531,22 @@
10376
10531
  "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate",
10377
10532
  "always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
10378
10533
  "arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page",
10379
- "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",
10380
- "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
10381
- "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel",
10534
+ "avoid-region", "axis-pan", "background", "backwards", "baseline", "below", "bidi-override", "binary",
10535
+ "bengali", "blink", "block", "block-axis", "blur", "bold", "bolder", "border", "border-box",
10536
+ "both", "bottom", "break", "break-all", "break-word", "brightness", "bullets", "button", "button-bevel",
10382
10537
  "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian",
10383
10538
  "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
10384
10539
  "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
10385
10540
  "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
10386
10541
  "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
10387
10542
  "compact", "condensed", "contain", "content", "contents",
10388
- "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
10389
- "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
10543
+ "content-box", "context-menu", "continuous", "contrast", "copy", "counter", "counters", "cover", "crop",
10544
+ "cross", "crosshair", "cubic-bezier", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
10390
10545
  "decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
10391
10546
  "destination-in", "destination-out", "destination-over", "devanagari", "difference",
10392
10547
  "disc", "discard", "disclosure-closed", "disclosure-open", "document",
10393
10548
  "dot-dash", "dot-dot-dash",
10394
- "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
10549
+ "dotted", "double", "down", "drop-shadow", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
10395
10550
  "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
10396
10551
  "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
10397
10552
  "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
@@ -10400,11 +10555,11 @@
10400
10555
  "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
10401
10556
  "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
10402
10557
  "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
10403
- "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
10404
- "forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove",
10558
+ "extra-expanded", "fantasy", "fast", "fill", "fill-box", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
10559
+ "forwards", "from", "geometricPrecision", "georgian", "grayscale", "graytext", "grid", "groove",
10405
10560
  "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
10406
10561
  "help", "hidden", "hide", "higher", "highlight", "highlighttext",
10407
- "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
10562
+ "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "hue-rotate", "icon", "ignore",
10408
10563
  "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
10409
10564
  "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
10410
10565
  "inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert",
@@ -10415,7 +10570,7 @@
10415
10570
  "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
10416
10571
  "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
10417
10572
  "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
10418
- "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d",
10573
+ "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "manipulation", "match", "matrix", "matrix3d",
10419
10574
  "media-controls-background", "media-current-time-display",
10420
10575
  "media-fullscreen-button", "media-mute-button", "media-play-button",
10421
10576
  "media-return-to-realtime-button", "media-rewind-button",
@@ -10424,13 +10579,13 @@
10424
10579
  "media-volume-slider-container", "media-volume-sliderthumb", "medium",
10425
10580
  "menu", "menulist", "menulist-button", "menulist-text",
10426
10581
  "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
10427
- "mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize",
10582
+ "mix", "mongolian", "monospace", "move", "multiple", "multiple_mask_images", "multiply", "myanmar", "n-resize",
10428
10583
  "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
10429
10584
  "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
10430
10585
  "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "opacity", "open-quote",
10431
10586
  "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
10432
10587
  "outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
10433
- "painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter",
10588
+ "painted", "page", "paused", "persian", "perspective", "pinch-zoom", "plus-darker", "plus-lighter",
10434
10589
  "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d",
10435
10590
  "progress", "push-button", "radial-gradient", "radio", "read-only",
10436
10591
  "read-write", "read-write-plaintext-only", "rectangle", "region",
@@ -10438,18 +10593,18 @@
10438
10593
  "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
10439
10594
  "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
10440
10595
  "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
10441
- "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
10596
+ "s-resize", "sans-serif", "saturate", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
10442
10597
  "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
10443
10598
  "searchfield-cancel-button", "searchfield-decoration",
10444
10599
  "searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
10445
- "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
10600
+ "semi-condensed", "semi-expanded", "separate", "sepia", "serif", "show", "sidama",
10446
10601
  "simp-chinese-formal", "simp-chinese-informal", "single",
10447
10602
  "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
10448
10603
  "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
10449
10604
  "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
10450
10605
  "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
10451
- "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
10452
- "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
10606
+ "square-button", "start", "static", "status-bar", "stretch", "stroke", "stroke-box", "sub",
10607
+ "subpixel-antialiased", "svg_masks", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
10453
10608
  "table-caption", "table-cell", "table-column", "table-column-group",
10454
10609
  "table-footer-group", "table-header-group", "table-row", "table-row-group",
10455
10610
  "tamil",
@@ -10459,10 +10614,10 @@
10459
10614
  "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
10460
10615
  "trad-chinese-formal", "trad-chinese-informal", "transform",
10461
10616
  "translate", "translate3d", "translateX", "translateY", "translateZ",
10462
- "transparent", "ultra-condensed", "ultra-expanded", "underline", "unset", "up",
10617
+ "transparent", "ultra-condensed", "ultra-expanded", "underline", "unidirectional-pan", "unset", "up",
10463
10618
  "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
10464
10619
  "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
10465
- "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
10620
+ "var", "vertical", "vertical-text", "view-box", "visible", "visibleFill", "visiblePainted",
10466
10621
  "visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
10467
10622
  "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor",
10468
10623
  "xx-large", "xx-small"
@@ -10530,7 +10685,7 @@
10530
10685
  }
10531
10686
  },
10532
10687
  ":": function(stream) {
10533
- if (stream.match(/\s*\{/, false))
10688
+ if (stream.match(/^\s*\{/, false))
10534
10689
  return [null, null]
10535
10690
  return false;
10536
10691
  },
@@ -10611,14 +10766,14 @@
10611
10766
  });
10612
10767
 
10613
10768
  });
10614
- });
10769
+ }());
10615
10770
 
10616
- var ecl = createCommonjsModule(function (module, exports) {
10771
+ (function (module, exports) {
10617
10772
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
10618
10773
  // Distributed under an MIT license: https://codemirror.net/LICENSE
10619
10774
 
10620
10775
  (function(mod) {
10621
- mod(codemirror);
10776
+ mod(codemirror.exports);
10622
10777
  })(function(CodeMirror) {
10623
10778
 
10624
10779
  CodeMirror.defineMode("ecl", function(config) {
@@ -10814,14 +10969,18 @@
10814
10969
  CodeMirror.defineMIME("text/x-ecl", "ecl");
10815
10970
 
10816
10971
  });
10817
- });
10972
+ }());
10973
+
10974
+ var markdown = {exports: {}};
10975
+
10976
+ var xml = {exports: {}};
10818
10977
 
10819
- var xml = createCommonjsModule(function (module, exports) {
10978
+ (function (module, exports) {
10820
10979
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
10821
10980
  // Distributed under an MIT license: https://codemirror.net/LICENSE
10822
10981
 
10823
10982
  (function(mod) {
10824
- mod(codemirror);
10983
+ mod(codemirror.exports);
10825
10984
  })(function(CodeMirror) {
10826
10985
 
10827
10986
  var htmlConfig = {
@@ -11000,9 +11159,13 @@
11000
11159
  };
11001
11160
  }
11002
11161
 
11162
+ function lower(tagName) {
11163
+ return tagName && tagName.toLowerCase();
11164
+ }
11165
+
11003
11166
  function Context(state, tagName, startOfLine) {
11004
11167
  this.prev = state.context;
11005
- this.tagName = tagName;
11168
+ this.tagName = tagName || "";
11006
11169
  this.indent = state.indented;
11007
11170
  this.startOfLine = startOfLine;
11008
11171
  if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
@@ -11018,8 +11181,8 @@
11018
11181
  return;
11019
11182
  }
11020
11183
  parentTagName = state.context.tagName;
11021
- if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
11022
- !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
11184
+ if (!config.contextGrabbers.hasOwnProperty(lower(parentTagName)) ||
11185
+ !config.contextGrabbers[lower(parentTagName)].hasOwnProperty(lower(nextTagName))) {
11023
11186
  return;
11024
11187
  }
11025
11188
  popContext(state);
@@ -11053,7 +11216,7 @@
11053
11216
  if (type == "word") {
11054
11217
  var tagName = stream.current();
11055
11218
  if (state.context && state.context.tagName != tagName &&
11056
- config.implicitlyClosed.hasOwnProperty(state.context.tagName))
11219
+ config.implicitlyClosed.hasOwnProperty(lower(state.context.tagName)))
11057
11220
  popContext(state);
11058
11221
  if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
11059
11222
  setStyle = "tag";
@@ -11092,7 +11255,7 @@
11092
11255
  var tagName = state.tagName, tagStart = state.tagStart;
11093
11256
  state.tagName = state.tagStart = null;
11094
11257
  if (type == "selfcloseTag" ||
11095
- config.autoSelfClosers.hasOwnProperty(tagName)) {
11258
+ config.autoSelfClosers.hasOwnProperty(lower(tagName))) {
11096
11259
  maybePopContext(state, tagName);
11097
11260
  } else {
11098
11261
  maybePopContext(state, tagName);
@@ -11172,7 +11335,7 @@
11172
11335
  if (context.tagName == tagAfter[2]) {
11173
11336
  context = context.prev;
11174
11337
  break;
11175
- } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
11338
+ } else if (config.implicitlyClosed.hasOwnProperty(lower(context.tagName))) {
11176
11339
  context = context.prev;
11177
11340
  } else {
11178
11341
  break;
@@ -11180,8 +11343,8 @@
11180
11343
  }
11181
11344
  } else if (tagAfter) { // Opening tag spotted
11182
11345
  while (context) {
11183
- var grabbers = config.contextGrabbers[context.tagName];
11184
- if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
11346
+ var grabbers = config.contextGrabbers[lower(context.tagName)];
11347
+ if (grabbers && grabbers.hasOwnProperty(lower(tagAfter[2])))
11185
11348
  context = context.prev;
11186
11349
  else
11187
11350
  break;
@@ -11212,7 +11375,7 @@
11212
11375
  xmlCurrentContext: function(state) {
11213
11376
  var context = [];
11214
11377
  for (var cx = state.context; cx; cx = cx.prev)
11215
- if (cx.tagName) context.push(cx.tagName);
11378
+ context.push(cx.tagName);
11216
11379
  return context.reverse()
11217
11380
  }
11218
11381
  };
@@ -11224,14 +11387,16 @@
11224
11387
  CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
11225
11388
 
11226
11389
  });
11227
- });
11390
+ }());
11391
+
11392
+ var meta = {exports: {}};
11228
11393
 
11229
- var meta = createCommonjsModule(function (module, exports) {
11394
+ (function (module, exports) {
11230
11395
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
11231
11396
  // Distributed under an MIT license: https://codemirror.net/LICENSE
11232
11397
 
11233
11398
  (function(mod) {
11234
- mod(codemirror);
11399
+ mod(codemirror.exports);
11235
11400
  })(function(CodeMirror) {
11236
11401
 
11237
11402
  CodeMirror.modeInfo = [
@@ -11242,12 +11407,12 @@
11242
11407
  {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
11243
11408
  {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h", "ino"]},
11244
11409
  {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
11245
- {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
11410
+ {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy", "cbl"]},
11246
11411
  {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp", "cs"]},
11247
11412
  {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]},
11248
11413
  {name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]},
11249
11414
  {name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
11250
- {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/},
11415
+ {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists\.txt$/},
11251
11416
  {name: "CoffeeScript", mimes: ["application/vnd.coffeescript", "text/coffeescript", "text/x-coffeescript"], mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
11252
11417
  {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
11253
11418
  {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
@@ -11267,7 +11432,7 @@
11267
11432
  {name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]},
11268
11433
  {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
11269
11434
  {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
11270
- {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
11435
+ {name: "Embedded JavaScript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
11271
11436
  {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
11272
11437
  {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
11273
11438
  {name: "Esper", mime: "text/x-esper", mode: "sql"},
@@ -11278,7 +11443,7 @@
11278
11443
  {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
11279
11444
  {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
11280
11445
  {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
11281
- {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i},
11446
+ {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history)\.md$/i},
11282
11447
  {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
11283
11448
  {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"], file: /^Jenkinsfile$/},
11284
11449
  {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
@@ -11299,7 +11464,7 @@
11299
11464
  {name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
11300
11465
  {name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
11301
11466
  {name: "Jinja2", mime: "text/jinja2", mode: "jinja2", ext: ["j2", "jinja", "jinja2"]},
11302
- {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
11467
+ {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"], alias: ["jl"]},
11303
11468
  {name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
11304
11469
  {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
11305
11470
  {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
@@ -11367,7 +11532,7 @@
11367
11532
  {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v", "sv", "svh"]},
11368
11533
  {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
11369
11534
  {name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]},
11370
- {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
11535
+ {name: "TiddlyWiki", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
11371
11536
  {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
11372
11537
  {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
11373
11538
  {name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
@@ -11392,7 +11557,8 @@
11392
11557
  {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]},
11393
11558
  {name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]},
11394
11559
  {name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]},
11395
- {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]}
11560
+ {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]},
11561
+ {name: "WebAssembly", mime: "text/webassembly", mode: "wast", ext: ["wat", "wast"]},
11396
11562
  ];
11397
11563
  // Ensure all modes have a mime property for backwards compatibility
11398
11564
  for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
@@ -11441,14 +11607,14 @@
11441
11607
  }
11442
11608
  };
11443
11609
  });
11444
- });
11610
+ }());
11445
11611
 
11446
- var markdown = createCommonjsModule(function (module, exports) {
11612
+ (function (module, exports) {
11447
11613
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
11448
11614
  // Distributed under an MIT license: https://codemirror.net/LICENSE
11449
11615
 
11450
11616
  (function(mod) {
11451
- mod(codemirror, xml, meta);
11617
+ mod(codemirror.exports, xml.exports, meta.exports);
11452
11618
  })(function(CodeMirror) {
11453
11619
 
11454
11620
  CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
@@ -11488,6 +11654,9 @@
11488
11654
  if (modeCfg.fencedCodeBlockHighlighting === undefined)
11489
11655
  modeCfg.fencedCodeBlockHighlighting = true;
11490
11656
 
11657
+ if (modeCfg.fencedCodeBlockDefaultMode === undefined)
11658
+ modeCfg.fencedCodeBlockDefaultMode = 'text/plain';
11659
+
11491
11660
  if (modeCfg.xml === undefined)
11492
11661
  modeCfg.xml = true;
11493
11662
 
@@ -11527,9 +11696,9 @@
11527
11696
  , listRE = /^(?:[*\-+]|^[0-9]+([.)]))\s+/
11528
11697
  , taskListRE = /^\[(x| )\](?=\s)/i // Must follow listRE
11529
11698
  , atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/
11530
- , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/
11699
+ , setextHeaderRE = /^ {0,3}(?:\={1,}|-{2,})\s*$/
11531
11700
  , textRE = /^[^#!\[\]*_\\<>` "'(~:]+/
11532
- , fencedCodeRE = /^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/
11701
+ , fencedCodeRE = /^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/
11533
11702
  , linkDefRE = /^\s*\[[^\]]+?\]:.*$/ // naive link-definition
11534
11703
  , punctuation = /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/
11535
11704
  , expandedTab = " "; // CommonMark specifies tab as 4 spaces
@@ -11660,7 +11829,7 @@
11660
11829
 
11661
11830
  // Add this list item's content's indentation to the stack
11662
11831
  state.listStack.push(state.indentation);
11663
- // Reset inline styles which shouldn't propagate aross list items
11832
+ // Reset inline styles which shouldn't propagate across list items
11664
11833
  state.em = false;
11665
11834
  state.strong = false;
11666
11835
  state.code = false;
@@ -11676,7 +11845,7 @@
11676
11845
  state.quote = 0;
11677
11846
  state.fencedEndRE = new RegExp(match[1] + "+ *$");
11678
11847
  // try switching mode
11679
- state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2]);
11848
+ state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2] || modeCfg.fencedCodeBlockDefaultMode );
11680
11849
  if (state.localMode) state.localState = CodeMirror.startState(state.localMode);
11681
11850
  state.f = state.block = local;
11682
11851
  if (modeCfg.highlightFormatting) state.formatting = "code-block";
@@ -12049,7 +12218,7 @@
12049
12218
  return getType(state);
12050
12219
  }
12051
12220
  } else if (ch === ' ') {
12052
- if (stream.match(/^~~/, true)) { // Probably surrounded by space
12221
+ if (stream.match('~~', true)) { // Probably surrounded by space
12053
12222
  if (stream.peek() === ' ') { // Surrounded by spaces, ignore
12054
12223
  return getType(state);
12055
12224
  } else { // Not surrounded by spaces, back up pointer
@@ -12148,7 +12317,7 @@
12148
12317
  }
12149
12318
 
12150
12319
  function footnoteLinkInside(stream, state) {
12151
- if (stream.match(/^\]:/, true)) {
12320
+ if (stream.match(']:', true)) {
12152
12321
  state.f = state.inline = footnoteUrl;
12153
12322
  if (modeCfg.highlightFormatting) state.formatting = "link";
12154
12323
  var returnType = getType(state);
@@ -12172,7 +12341,7 @@
12172
12341
  if (stream.peek() === undefined) { // End of line, set flag to check next line
12173
12342
  state.linkTitle = true;
12174
12343
  } else { // More content on line, check if link title
12175
- stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
12344
+ stream.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/, true);
12176
12345
  }
12177
12346
  state.f = state.inline = inlineNormal;
12178
12347
  return tokenTypes.linkHref + " url";
@@ -12321,9 +12490,11 @@
12321
12490
  CodeMirror.defineMIME("text/x-markdown", "markdown");
12322
12491
 
12323
12492
  });
12324
- });
12493
+ }());
12494
+
12495
+ var overlay = {exports: {}};
12325
12496
 
12326
- var overlay = createCommonjsModule(function (module, exports) {
12497
+ (function (module, exports) {
12327
12498
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
12328
12499
  // Distributed under an MIT license: https://codemirror.net/LICENSE
12329
12500
 
@@ -12337,7 +12508,7 @@
12337
12508
  // combined.
12338
12509
 
12339
12510
  (function(mod) {
12340
- mod(codemirror);
12511
+ mod(codemirror.exports);
12341
12512
  })(function(CodeMirror) {
12342
12513
 
12343
12514
  CodeMirror.overlayMode = function(base, overlay, combine) {
@@ -12408,14 +12579,14 @@
12408
12579
  };
12409
12580
 
12410
12581
  });
12411
- });
12582
+ }());
12412
12583
 
12413
- var gfm = createCommonjsModule(function (module, exports) {
12584
+ (function (module, exports) {
12414
12585
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
12415
12586
  // Distributed under an MIT license: https://codemirror.net/LICENSE
12416
12587
 
12417
12588
  (function(mod) {
12418
- mod(codemirror, markdown, overlay);
12589
+ mod(codemirror.exports, markdown.exports, overlay.exports);
12419
12590
  })(function(CodeMirror) {
12420
12591
 
12421
12592
  var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;
@@ -12534,14 +12705,16 @@
12534
12705
 
12535
12706
  CodeMirror.defineMIME("text/x-gfm", "gfm");
12536
12707
  });
12537
- });
12708
+ }());
12709
+
12710
+ var javascript = {exports: {}};
12538
12711
 
12539
- var javascript = createCommonjsModule(function (module, exports) {
12712
+ (function (module, exports) {
12540
12713
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
12541
12714
  // Distributed under an MIT license: https://codemirror.net/LICENSE
12542
12715
 
12543
12716
  (function(mod) {
12544
- mod(codemirror);
12717
+ mod(codemirror.exports);
12545
12718
  })(function(CodeMirror) {
12546
12719
 
12547
12720
  CodeMirror.defineMode("javascript", function(config, parserConfig) {
@@ -12549,6 +12722,7 @@
12549
12722
  var statementIndent = parserConfig.statementIndent;
12550
12723
  var jsonldMode = parserConfig.jsonld;
12551
12724
  var jsonMode = parserConfig.json || jsonldMode;
12725
+ var trackScope = parserConfig.trackScope !== false;
12552
12726
  var isTS = parserConfig.typescript;
12553
12727
  var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
12554
12728
 
@@ -12631,21 +12805,25 @@
12631
12805
  } else if (ch == "`") {
12632
12806
  state.tokenize = tokenQuasi;
12633
12807
  return tokenQuasi(stream, state);
12634
- } else if (ch == "#") {
12808
+ } else if (ch == "#" && stream.peek() == "!") {
12635
12809
  stream.skipToEnd();
12636
- return ret("error", "error");
12637
- } else if (ch == "<" && stream.match("!--") || ch == "-" && stream.match("->")) {
12810
+ return ret("meta", "meta");
12811
+ } else if (ch == "#" && stream.eatWhile(wordRE)) {
12812
+ return ret("variable", "property")
12813
+ } else if (ch == "<" && stream.match("!--") ||
12814
+ (ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start)))) {
12638
12815
  stream.skipToEnd();
12639
12816
  return ret("comment", "comment")
12640
12817
  } else if (isOperatorChar.test(ch)) {
12641
12818
  if (ch != ">" || !state.lexical || state.lexical.type != ">") {
12642
12819
  if (stream.eat("=")) {
12643
12820
  if (ch == "!" || ch == "=") stream.eat("=");
12644
- } else if (/[<>*+\-]/.test(ch)) {
12821
+ } else if (/[<>*+\-|&?]/.test(ch)) {
12645
12822
  stream.eat(ch);
12646
12823
  if (ch == ">") stream.eat(ch);
12647
12824
  }
12648
12825
  }
12826
+ if (ch == "?" && stream.eat(".")) return ret(".")
12649
12827
  return ret("operator", "operator", stream.current());
12650
12828
  } else if (wordRE.test(ch)) {
12651
12829
  stream.eatWhile(wordRE);
@@ -12655,7 +12833,7 @@
12655
12833
  var kw = keywords[word];
12656
12834
  return ret(kw.type, kw.style, word)
12657
12835
  }
12658
- if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false))
12836
+ if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
12659
12837
  return ret("async", "keyword", word)
12660
12838
  }
12661
12839
  return ret("variable", "variable", word)
@@ -12747,7 +12925,8 @@
12747
12925
 
12748
12926
  // Parser
12749
12927
 
12750
- var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};
12928
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true,
12929
+ "regexp": true, "this": true, "import": true, "jsonld-keyword": true};
12751
12930
 
12752
12931
  function JSLexical(indented, column, type, align, prev, info) {
12753
12932
  this.indented = indented;
@@ -12759,6 +12938,7 @@
12759
12938
  }
12760
12939
 
12761
12940
  function inScope(state, varname) {
12941
+ if (!trackScope) return false
12762
12942
  for (var v = state.localVars; v; v = v.next)
12763
12943
  if (v.name == varname) return true;
12764
12944
  for (var cx = state.context; cx; cx = cx.prev) {
@@ -12805,6 +12985,7 @@
12805
12985
  function register(varname) {
12806
12986
  var state = cx.state;
12807
12987
  cx.marked = "def";
12988
+ if (!trackScope) return
12808
12989
  if (state.context) {
12809
12990
  if (state.lexical.info == "var" && state.context && state.context.block) {
12810
12991
  // FIXME function decls are also not block scoped
@@ -12903,7 +13084,7 @@
12903
13084
  return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
12904
13085
  }
12905
13086
  if (type == "function") return cont(functiondef);
12906
- if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
13087
+ if (type == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex);
12907
13088
  if (type == "class" || (isTS && value == "interface")) {
12908
13089
  cx.marked = "keyword";
12909
13090
  return cont(pushlex("form", type == "class" ? type : value), className, poplex)
@@ -12949,7 +13130,7 @@
12949
13130
  }
12950
13131
  function parenExpr(type) {
12951
13132
  if (type != "(") return pass()
12952
- return cont(pushlex(")"), expression, expect(")"), poplex)
13133
+ return cont(pushlex(")"), maybeexpression, expect(")"), poplex)
12953
13134
  }
12954
13135
  function expressionInner(type, value, noComma) {
12955
13136
  if (cx.state.fatArrowAt == cx.stream.start) {
@@ -12969,7 +13150,6 @@
12969
13150
  if (type == "{") return contCommasep(objprop, "}", null, maybeop);
12970
13151
  if (type == "quasi") return pass(quasi, maybeop);
12971
13152
  if (type == "new") return cont(maybeTarget(noComma));
12972
- if (type == "import") return cont(expression);
12973
13153
  return cont();
12974
13154
  }
12975
13155
  function maybeexpression(type) {
@@ -12978,7 +13158,7 @@
12978
13158
  }
12979
13159
 
12980
13160
  function maybeoperatorComma(type, value) {
12981
- if (type == ",") return cont(expression);
13161
+ if (type == ",") return cont(maybeexpression);
12982
13162
  return maybeoperatorNoComma(type, value, false);
12983
13163
  }
12984
13164
  function maybeoperatorNoComma(type, value, noComma) {
@@ -12987,7 +13167,7 @@
12987
13167
  if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
12988
13168
  if (type == "operator") {
12989
13169
  if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
12990
- if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false))
13170
+ if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false))
12991
13171
  return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
12992
13172
  if (value == "?") return cont(expression, expect(":"), expr);
12993
13173
  return cont(expr);
@@ -13007,7 +13187,7 @@
13007
13187
  function quasi(type, value) {
13008
13188
  if (type != "quasi") return pass();
13009
13189
  if (value.slice(value.length - 2) != "${") return cont(quasi);
13010
- return cont(expression, continueQuasi);
13190
+ return cont(maybeexpression, continueQuasi);
13011
13191
  }
13012
13192
  function continueQuasi(type) {
13013
13193
  if (type == "}") {
@@ -13133,7 +13313,7 @@
13133
13313
  }
13134
13314
  }
13135
13315
  function typeexpr(type, value) {
13136
- if (value == "keyof" || value == "typeof" || value == "infer") {
13316
+ if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") {
13137
13317
  cx.marked = "keyword";
13138
13318
  return cont(value == "typeof" ? expressionNoComma : typeexpr)
13139
13319
  }
@@ -13144,13 +13324,19 @@
13144
13324
  if (value == "|" || value == "&") return cont(typeexpr)
13145
13325
  if (type == "string" || type == "number" || type == "atom") return cont(afterType);
13146
13326
  if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
13147
- if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
13327
+ if (type == "{") return cont(pushlex("}"), typeprops, poplex, afterType)
13148
13328
  if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType)
13149
13329
  if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
13330
+ if (type == "quasi") { return pass(quasiType, afterType); }
13150
13331
  }
13151
13332
  function maybeReturnType(type) {
13152
13333
  if (type == "=>") return cont(typeexpr)
13153
13334
  }
13335
+ function typeprops(type) {
13336
+ if (type.match(/[\}\)\]]/)) return cont()
13337
+ if (type == "," || type == ";") return cont(typeprops)
13338
+ return pass(typeprop, typeprops)
13339
+ }
13154
13340
  function typeprop(type, value) {
13155
13341
  if (type == "variable" || cx.style == "keyword") {
13156
13342
  cx.marked = "property";
@@ -13163,6 +13349,20 @@
13163
13349
  return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop)
13164
13350
  } else if (type == "(") {
13165
13351
  return pass(functiondecl, typeprop)
13352
+ } else if (!type.match(/[;\}\)\],]/)) {
13353
+ return cont()
13354
+ }
13355
+ }
13356
+ function quasiType(type, value) {
13357
+ if (type != "quasi") return pass();
13358
+ if (value.slice(value.length - 2) != "${") return cont(quasiType);
13359
+ return cont(typeexpr, continueQuasiType);
13360
+ }
13361
+ function continueQuasiType(type) {
13362
+ if (type == "}") {
13363
+ cx.marked = "string-2";
13364
+ cx.state.tokenize = tokenQuasi;
13365
+ return cont(quasiType);
13166
13366
  }
13167
13367
  }
13168
13368
  function typearg(type, value) {
@@ -13289,11 +13489,11 @@
13289
13489
  }
13290
13490
  if (type == "variable" || cx.style == "keyword") {
13291
13491
  cx.marked = "property";
13292
- return cont(isTS ? classfield : functiondef, classBody);
13492
+ return cont(classfield, classBody);
13293
13493
  }
13294
- if (type == "number" || type == "string") return cont(isTS ? classfield : functiondef, classBody);
13494
+ if (type == "number" || type == "string") return cont(classfield, classBody);
13295
13495
  if (type == "[")
13296
- return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
13496
+ return cont(expression, maybetype, expect("]"), classfield, classBody)
13297
13497
  if (value == "*") {
13298
13498
  cx.marked = "keyword";
13299
13499
  return cont(classBody);
@@ -13304,6 +13504,7 @@
13304
13504
  if (value == "@") return cont(expression, classBody)
13305
13505
  }
13306
13506
  function classfield(type, value) {
13507
+ if (value == "!") return cont(classfield)
13307
13508
  if (value == "?") return cont(classfield)
13308
13509
  if (type == ":") return cont(typeexpr, maybeAssign)
13309
13510
  if (value == "=") return cont(expressionNoComma)
@@ -13323,6 +13524,7 @@
13323
13524
  function afterImport(type) {
13324
13525
  if (type == "string") return cont();
13325
13526
  if (type == "(") return pass(expression);
13527
+ if (type == ".") return pass(maybeoperatorComma);
13326
13528
  return pass(importSpec, maybeMoreImports, maybeFrom);
13327
13529
  }
13328
13530
  function importSpec(type, value) {
@@ -13396,14 +13598,14 @@
13396
13598
  },
13397
13599
 
13398
13600
  indent: function(state, textAfter) {
13399
- if (state.tokenize == tokenComment) return CodeMirror.Pass;
13601
+ if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;
13400
13602
  if (state.tokenize != tokenBase) return 0;
13401
13603
  var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top;
13402
13604
  // Kludge to prevent 'maybelse' from blocking lexical scope pops
13403
13605
  if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
13404
13606
  var c = state.cc[i];
13405
13607
  if (c == poplex) lexical = lexical.prev;
13406
- else if (c != maybeelse) break;
13608
+ else if (c != maybeelse && c != popcontext) break;
13407
13609
  }
13408
13610
  while ((lexical.type == "stat" || lexical.type == "form") &&
13409
13611
  (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
@@ -13440,8 +13642,7 @@
13440
13642
  expressionAllowed: expressionAllowed,
13441
13643
 
13442
13644
  skipExpression: function(state) {
13443
- var top = state.cc[state.cc.length - 1];
13444
- if (top == expression || top == expressionNoComma) state.cc.pop();
13645
+ parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null));
13445
13646
  }
13446
13647
  };
13447
13648
  });
@@ -13453,21 +13654,22 @@
13453
13654
  CodeMirror.defineMIME("application/javascript", "javascript");
13454
13655
  CodeMirror.defineMIME("application/x-javascript", "javascript");
13455
13656
  CodeMirror.defineMIME("application/ecmascript", "javascript");
13456
- CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
13457
- CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});
13458
- CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});
13657
+ CodeMirror.defineMIME("application/json", { name: "javascript", json: true });
13658
+ CodeMirror.defineMIME("application/x-json", { name: "javascript", json: true });
13659
+ CodeMirror.defineMIME("application/manifest+json", { name: "javascript", json: true });
13660
+ CodeMirror.defineMIME("application/ld+json", { name: "javascript", jsonld: true });
13459
13661
  CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
13460
13662
  CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
13461
13663
 
13462
13664
  });
13463
- });
13665
+ }());
13464
13666
 
13465
- var htmlmixed = createCommonjsModule(function (module, exports) {
13667
+ (function (module, exports) {
13466
13668
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
13467
13669
  // Distributed under an MIT license: https://codemirror.net/LICENSE
13468
13670
 
13469
13671
  (function(mod) {
13470
- mod(codemirror, xml, javascript, css);
13672
+ mod(codemirror.exports, xml.exports, javascript.exports, css.exports);
13471
13673
  })(function(CodeMirror) {
13472
13674
 
13473
13675
  var defaultTags = {
@@ -13533,7 +13735,8 @@
13533
13735
  name: "xml",
13534
13736
  htmlMode: true,
13535
13737
  multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
13536
- multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag
13738
+ multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag,
13739
+ allowMissingTagName: parserConfig.allowMissingTagName,
13537
13740
  });
13538
13741
 
13539
13742
  var tags = {};
@@ -13608,10 +13811,10 @@
13608
13811
 
13609
13812
  CodeMirror.defineMIME("text/html", "htmlmixed");
13610
13813
  });
13611
- });
13814
+ }());
13612
13815
 
13613
13816
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
13614
- codemirror.defineMode("dot", function (config) {
13817
+ CodeMirror.defineMode("dot", function (config) {
13615
13818
  var ops = /--|->|=|;/;
13616
13819
  var brackets = /[\[\]{}]/;
13617
13820
  return {
@@ -13706,22 +13909,22 @@
13706
13909
  blockCommentEnd: "*/"
13707
13910
  };
13708
13911
  });
13709
- codemirror.defineMIME("text/x-dot", "dot");
13912
+ CodeMirror.defineMIME("text/x-dot", "dot");
13710
13913
 
13711
13914
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
13712
- codemirror.defineMode("markdown", function (cmCfg, modeCfg) {
13713
- var htmlMode = codemirror.getMode(cmCfg, "text/html");
13915
+ CodeMirror.defineMode("markdown", function (cmCfg, modeCfg) {
13916
+ var htmlMode = CodeMirror.getMode(cmCfg, "text/html");
13714
13917
  var htmlModeMissing = htmlMode.name == "null";
13715
13918
  if (modeCfg.defaultMode === undefined)
13716
13919
  modeCfg.defaultMode = "";
13717
13920
  function getMode(name) {
13718
13921
  name = name === "" ? modeCfg.defaultMode : name;
13719
- if (codemirror.findModeByName) {
13720
- var found = codemirror.findModeByName(name);
13922
+ if (CodeMirror.findModeByName) {
13923
+ var found = CodeMirror.findModeByName(name);
13721
13924
  if (found)
13722
13925
  name = found.mime || found.mimes[0];
13723
13926
  }
13724
- var mode = codemirror.getMode(cmCfg, name);
13927
+ var mode = CodeMirror.getMode(cmCfg, name);
13725
13928
  return mode.name == "null" ? null : mode;
13726
13929
  }
13727
13930
  // Should characters that affect highlighting be highlighted separate?
@@ -13806,7 +14009,7 @@
13806
14009
  if (state.f == htmlBlock) {
13807
14010
  var exit = htmlModeMissing;
13808
14011
  if (!exit) {
13809
- var inner = codemirror.innerMode(htmlMode, state.htmlState);
14012
+ var inner = CodeMirror.innerMode(htmlMode, state.htmlState);
13810
14013
  exit = inner.mode.name == "xml" && inner.state.tagStart === null &&
13811
14014
  (!inner.state.context && inner.state.tokenize.isInText);
13812
14015
  }
@@ -13914,7 +14117,7 @@
13914
14117
  // try switching mode
13915
14118
  state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2]);
13916
14119
  if (state.localMode)
13917
- state.localState = codemirror.startState(state.localMode);
14120
+ state.localState = CodeMirror.startState(state.localMode);
13918
14121
  state.f = state.block = local;
13919
14122
  if (modeCfg.highlightFormatting)
13920
14123
  state.formatting = "code-block";
@@ -13960,7 +14163,7 @@
13960
14163
  function htmlBlock(stream, state) {
13961
14164
  var style = htmlMode.token(stream, state.htmlState);
13962
14165
  if (!htmlModeMissing) {
13963
- var inner = codemirror.innerMode(htmlMode, state.htmlState);
14166
+ var inner = CodeMirror.innerMode(htmlMode, state.htmlState);
13964
14167
  if ((inner.mode.name == "xml" && inner.state.tagStart === null &&
13965
14168
  (!inner.state.context && inner.state.tokenize.isInText)) ||
13966
14169
  (state.md_inside && stream.current().indexOf(">") > -1)) {
@@ -14247,7 +14450,7 @@
14247
14450
  state.md_inside = true;
14248
14451
  }
14249
14452
  stream.backUp(1);
14250
- state.htmlState = codemirror.startState(htmlMode);
14453
+ state.htmlState = CodeMirror.startState(htmlMode);
14251
14454
  return switchBlock(stream, state, htmlBlock);
14252
14455
  }
14253
14456
  if (modeCfg.xml && ch === '<' && stream.match(/^\/\w*?>/)) {
@@ -14476,10 +14679,10 @@
14476
14679
  prevLine: s.prevLine,
14477
14680
  thisLine: s.thisLine,
14478
14681
  block: s.block,
14479
- htmlState: s.htmlState && codemirror.copyState(htmlMode, s.htmlState),
14682
+ htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
14480
14683
  indentation: s.indentation,
14481
14684
  localMode: s.localMode,
14482
- localState: s.localMode ? codemirror.copyState(s.localMode, s.localState) : null,
14685
+ localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null,
14483
14686
  inline: s.inline,
14484
14687
  text: s.text,
14485
14688
  formatting: false,
@@ -14547,7 +14750,7 @@
14547
14750
  return htmlMode.indent(state.htmlState, textAfter, line);
14548
14751
  if (state.localState && state.localMode.indent)
14549
14752
  return state.localMode.indent(state.localState, textAfter, line);
14550
- return codemirror.Pass;
14753
+ return CodeMirror.Pass;
14551
14754
  },
14552
14755
  blankLine: blankLine,
14553
14756
  getType: getType,
@@ -14558,10 +14761,10 @@
14558
14761
  };
14559
14762
  return mode;
14560
14763
  }, "xml");
14561
- codemirror.defineMIME("text/markdown", "markdown");
14562
- codemirror.defineMIME("text/x-markdown", "markdown");
14764
+ CodeMirror.defineMIME("text/markdown", "markdown");
14765
+ CodeMirror.defineMIME("text/x-markdown", "markdown");
14563
14766
 
14564
- function styleInject(css, ref) {
14767
+ function styleInject$1(css, ref) {
14565
14768
  if ( ref === void 0 ) ref = {};
14566
14769
  var insertAt = ref.insertAt;
14567
14770
 
@@ -14588,22 +14791,22 @@
14588
14791
  }
14589
14792
  }
14590
14793
 
14591
- var css_248z = ".CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20,255,20,.5)}.cm-animate-fat-cursor,.cm-fat-cursor-mark{-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;border:0;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:\"\"}span.CodeMirror-selectedtext{background:none}";
14592
- styleInject(css_248z);
14794
+ var css_248z$2 = ".CodeMirror{color:#000;direction:ltr;font-family:monospace;height:300px}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{background-color:#f7f7f7;border-right:1px solid #ddd;white-space:nowrap}.CodeMirror-linenumber{color:#999;min-width:20px;padding:0 3px 0 5px;text-align:right;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{background:#7e7;border:0!important;width:auto}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:-50px}.CodeMirror-ruler{border-left:1px solid #ccc;bottom:0;position:absolute;top:0}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{background:#fff;overflow:hidden;position:relative}.CodeMirror-scroll{height:100%;margin-bottom:-50px;margin-right:-50px;outline:none;overflow:scroll!important;padding-bottom:50px;position:relative}.CodeMirror-sizer{border-right:50px solid transparent;position:relative}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{display:none;outline:none;position:absolute;z-index:6}.CodeMirror-vscrollbar{overflow-x:hidden;overflow-y:scroll;right:0;top:0}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-x:scroll;overflow-y:hidden}.CodeMirror-scrollbar-filler{bottom:0;right:0}.CodeMirror-gutter-filler{bottom:0;left:0}.CodeMirror-gutters{left:0;min-height:100%;position:absolute;top:0;z-index:3}.CodeMirror-gutter{display:inline-block;height:100%;margin-bottom:-50px;vertical-align:top;white-space:normal}.CodeMirror-gutter-wrapper{background:none!important;border:none!important;position:absolute;z-index:4}.CodeMirror-gutter-background{bottom:0;position:absolute;top:0;z-index:4}.CodeMirror-gutter-elt{cursor:default;position:absolute;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{word-wrap:normal;-webkit-tap-highlight-color:transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual;line-height:inherit;margin:0;overflow:visible;position:relative;white-space:pre;z-index:2}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}.CodeMirror-linewidget{padding:.1px;position:relative;z-index:2}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{height:0;overflow:hidden;position:absolute;visibility:hidden;width:100%}.CodeMirror-cursor{pointer-events:none;position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{position:relative;visibility:hidden;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:\"\"}span.CodeMirror-selectedtext{background:none}";
14795
+ styleInject$1(css_248z$2);
14593
14796
 
14594
- var braceFold = createCommonjsModule(function (module, exports) {
14797
+ (function (module, exports) {
14595
14798
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
14596
14799
  // Distributed under an MIT license: https://codemirror.net/LICENSE
14597
14800
 
14598
14801
  (function(mod) {
14599
- mod(codemirror);
14802
+ mod(codemirror.exports);
14600
14803
  })(function(CodeMirror) {
14601
14804
 
14602
14805
  CodeMirror.registerHelper("fold", "brace", function(cm, start) {
14603
14806
  var line = start.line, lineText = cm.getLine(line);
14604
- var tokenType;
14605
14807
 
14606
14808
  function findOpening(openCh) {
14809
+ var tokenType;
14607
14810
  for (var at = start.ch, pass = 0;;) {
14608
14811
  var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1);
14609
14812
  if (found == -1) {
@@ -14614,37 +14817,42 @@
14614
14817
  }
14615
14818
  if (pass == 1 && found < start.ch) break;
14616
14819
  tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
14617
- if (!/^(comment|string)/.test(tokenType)) return found + 1;
14820
+ if (!/^(comment|string)/.test(tokenType)) return {ch: found + 1, tokenType: tokenType};
14618
14821
  at = found - 1;
14619
14822
  }
14620
14823
  }
14621
14824
 
14622
- var startToken = "{", endToken = "}", startCh = findOpening("{");
14623
- if (startCh == null) {
14624
- startToken = "[", endToken = "]";
14625
- startCh = findOpening("[");
14626
- }
14627
-
14628
- if (startCh == null) return;
14629
- var count = 1, lastLine = cm.lastLine(), end, endCh;
14630
- outer: for (var i = line; i <= lastLine; ++i) {
14631
- var text = cm.getLine(i), pos = i == line ? startCh : 0;
14632
- for (;;) {
14633
- var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
14634
- if (nextOpen < 0) nextOpen = text.length;
14635
- if (nextClose < 0) nextClose = text.length;
14636
- pos = Math.min(nextOpen, nextClose);
14637
- if (pos == text.length) break;
14638
- if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) {
14639
- if (pos == nextOpen) ++count;
14640
- else if (!--count) { end = i; endCh = pos; break outer; }
14825
+ function findRange(startToken, endToken, found) {
14826
+ var count = 1, lastLine = cm.lastLine(), end, startCh = found.ch, endCh;
14827
+ outer: for (var i = line; i <= lastLine; ++i) {
14828
+ var text = cm.getLine(i), pos = i == line ? startCh : 0;
14829
+ for (;;) {
14830
+ var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
14831
+ if (nextOpen < 0) nextOpen = text.length;
14832
+ if (nextClose < 0) nextClose = text.length;
14833
+ pos = Math.min(nextOpen, nextClose);
14834
+ if (pos == text.length) break;
14835
+ if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == found.tokenType) {
14836
+ if (pos == nextOpen) ++count;
14837
+ else if (!--count) { end = i; endCh = pos; break outer; }
14838
+ }
14839
+ ++pos;
14641
14840
  }
14642
- ++pos;
14643
14841
  }
14842
+
14843
+ if (end == null || line == end) return null
14844
+ return {from: CodeMirror.Pos(line, startCh),
14845
+ to: CodeMirror.Pos(end, endCh)};
14846
+ }
14847
+
14848
+ var startBrace = findOpening("{"), startBracket = findOpening("[");
14849
+ if (startBrace && (!startBracket || startBracket.ch > startBrace.ch)) {
14850
+ return findRange("{", "}", startBrace) || (startBracket && findRange("[", "]", startBracket))
14851
+ } else if (startBracket) {
14852
+ return findRange("[", "]", startBracket) || (startBrace && findRange("{", "}", startBrace))
14853
+ } else {
14854
+ return null
14644
14855
  }
14645
- if (end == null || line == end) return;
14646
- return {from: CodeMirror.Pos(line, startCh),
14647
- to: CodeMirror.Pos(end, endCh)};
14648
14856
  });
14649
14857
 
14650
14858
  CodeMirror.registerHelper("fold", "import", function(cm, start) {
@@ -14691,14 +14899,14 @@
14691
14899
  });
14692
14900
 
14693
14901
  });
14694
- });
14902
+ }());
14695
14903
 
14696
- var commentFold = createCommonjsModule(function (module, exports) {
14904
+ (function (module, exports) {
14697
14905
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
14698
14906
  // Distributed under an MIT license: https://codemirror.net/LICENSE
14699
14907
 
14700
14908
  (function(mod) {
14701
- mod(codemirror);
14909
+ mod(codemirror.exports);
14702
14910
  })(function(CodeMirror) {
14703
14911
 
14704
14912
  CodeMirror.registerGlobalHelper("fold", "comment", function(mode) {
@@ -14747,14 +14955,16 @@
14747
14955
  });
14748
14956
 
14749
14957
  });
14750
- });
14958
+ }());
14751
14959
 
14752
- var foldcode = createCommonjsModule(function (module, exports) {
14960
+ var foldcode = {exports: {}};
14961
+
14962
+ (function (module, exports) {
14753
14963
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
14754
14964
  // Distributed under an MIT license: https://codemirror.net/LICENSE
14755
14965
 
14756
14966
  (function(mod) {
14757
- mod(codemirror);
14967
+ mod(codemirror.exports);
14758
14968
  })(function(CodeMirror) {
14759
14969
 
14760
14970
  function doFold(cm, pos, options, force) {
@@ -14770,9 +14980,11 @@
14770
14980
  function getRange(allowFolded) {
14771
14981
  var range = finder(cm, pos);
14772
14982
  if (!range || range.to.line - range.from.line < minSize) return null;
14983
+ if (force === "fold") return range;
14984
+
14773
14985
  var marks = cm.findMarksAt(range.from);
14774
14986
  for (var i = 0; i < marks.length; ++i) {
14775
- if (marks[i].__isFold && force !== "fold") {
14987
+ if (marks[i].__isFold) {
14776
14988
  if (!allowFolded) return null;
14777
14989
  range.cleared = true;
14778
14990
  marks[i].clear();
@@ -14845,18 +15057,18 @@
14845
15057
  cm.foldCode(cm.getCursor(), null, "fold");
14846
15058
  };
14847
15059
  CodeMirror.commands.unfold = function(cm) {
14848
- cm.foldCode(cm.getCursor(), null, "unfold");
15060
+ cm.foldCode(cm.getCursor(), { scanUp: false }, "unfold");
14849
15061
  };
14850
15062
  CodeMirror.commands.foldAll = function(cm) {
14851
15063
  cm.operation(function() {
14852
15064
  for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
14853
- cm.foldCode(CodeMirror.Pos(i, 0), null, "fold");
15065
+ cm.foldCode(CodeMirror.Pos(i, 0), { scanUp: false }, "fold");
14854
15066
  });
14855
15067
  };
14856
15068
  CodeMirror.commands.unfoldAll = function(cm) {
14857
15069
  cm.operation(function() {
14858
15070
  for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)
14859
- cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold");
15071
+ cm.foldCode(CodeMirror.Pos(i, 0), { scanUp: false }, "unfold");
14860
15072
  });
14861
15073
  };
14862
15074
 
@@ -14901,14 +15113,14 @@
14901
15113
  return getOption(this, options, name);
14902
15114
  });
14903
15115
  });
14904
- });
15116
+ }());
14905
15117
 
14906
- var foldgutter = createCommonjsModule(function (module, exports) {
15118
+ (function (module, exports) {
14907
15119
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
14908
15120
  // Distributed under an MIT license: https://codemirror.net/LICENSE
14909
15121
 
14910
15122
  (function(mod) {
14911
- mod(codemirror, foldcode);
15123
+ mod(codemirror.exports, foldcode.exports);
14912
15124
  })(function(CodeMirror) {
14913
15125
 
14914
15126
  CodeMirror.defineOption("foldGutter", false, function(cm, val, old) {
@@ -15061,14 +15273,14 @@
15061
15273
  updateFoldInfo(cm, line, line + 1);
15062
15274
  }
15063
15275
  });
15064
- });
15276
+ }());
15065
15277
 
15066
- var indentFold = createCommonjsModule(function (module, exports) {
15278
+ (function (module, exports) {
15067
15279
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
15068
15280
  // Distributed under an MIT license: https://codemirror.net/LICENSE
15069
15281
 
15070
15282
  (function(mod) {
15071
- mod(codemirror);
15283
+ mod(codemirror.exports);
15072
15284
  })(function(CodeMirror) {
15073
15285
 
15074
15286
  function lineIndent(cm, lineNo) {
@@ -15105,14 +15317,14 @@
15105
15317
  });
15106
15318
 
15107
15319
  });
15108
- });
15320
+ }());
15109
15321
 
15110
- var xmlFold = createCommonjsModule(function (module, exports) {
15322
+ (function (module, exports) {
15111
15323
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
15112
15324
  // Distributed under an MIT license: https://codemirror.net/LICENSE
15113
15325
 
15114
15326
  (function(mod) {
15115
- mod(codemirror);
15327
+ mod(codemirror.exports);
15116
15328
  })(function(CodeMirror) {
15117
15329
 
15118
15330
  var Pos = CodeMirror.Pos;
@@ -15286,19 +15498,21 @@
15286
15498
  return findMatchingClose(iter, name);
15287
15499
  };
15288
15500
  });
15289
- });
15501
+ }());
15290
15502
 
15291
- var css_248z$1 = ".CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:\"\\25BE\"}.CodeMirror-foldgutter-folded:after{content:\"\\25B8\"}";
15292
- styleInject(css_248z$1);
15503
+ var css_248z$1$1 = ".CodeMirror-foldmarker{color:blue;cursor:pointer;font-family:arial;line-height:.3;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:\"\\25BE\"}.CodeMirror-foldgutter-folded:after{content:\"\\25B8\"}";
15504
+ styleInject$1(css_248z$1$1);
15293
15505
 
15294
- var dialog = createCommonjsModule(function (module, exports) {
15506
+ var dialog = {exports: {}};
15507
+
15508
+ (function (module, exports) {
15295
15509
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
15296
15510
  // Distributed under an MIT license: https://codemirror.net/LICENSE
15297
15511
 
15298
15512
  // Open simple dialogs on top of an editor. Relies on dialog.css.
15299
15513
 
15300
15514
  (function(mod) {
15301
- mod(codemirror);
15515
+ mod(codemirror.exports);
15302
15516
  })(function(CodeMirror) {
15303
15517
  function dialogDiv(cm, template, bottom) {
15304
15518
  var wrap = cm.getWrapperElement();
@@ -15371,7 +15585,9 @@
15371
15585
  if (e.keyCode == 13) callback(inp.value, e);
15372
15586
  });
15373
15587
 
15374
- if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
15588
+ if (options.closeOnBlur !== false) CodeMirror.on(dialog, "focusout", function (evt) {
15589
+ if (evt.relatedTarget !== null) close();
15590
+ });
15375
15591
  } else if (button = dialog.getElementsByTagName("button")[0]) {
15376
15592
  CodeMirror.on(button, "click", function() {
15377
15593
  close();
@@ -15448,20 +15664,23 @@
15448
15664
  return close;
15449
15665
  });
15450
15666
  });
15451
- });
15667
+ }());
15452
15668
 
15453
- var jumpToLine = createCommonjsModule(function (module, exports) {
15669
+ (function (module, exports) {
15454
15670
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
15455
15671
  // Distributed under an MIT license: https://codemirror.net/LICENSE
15456
15672
 
15457
15673
  // Defines jumpToLine command. Uses dialog.js if present.
15458
15674
 
15459
15675
  (function(mod) {
15460
- mod(codemirror, dialog);
15676
+ mod(codemirror.exports, dialog.exports);
15461
15677
  })(function(CodeMirror) {
15462
15678
 
15679
+ // default search panel location
15680
+ CodeMirror.defineOption("search", {bottom: false});
15681
+
15463
15682
  function dialog(cm, text, shortText, deflt, f) {
15464
- if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
15683
+ if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});
15465
15684
  else f(prompt(shortText, deflt));
15466
15685
  }
15467
15686
 
@@ -15495,14 +15714,16 @@
15495
15714
 
15496
15715
  CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine";
15497
15716
  });
15498
- });
15717
+ }());
15718
+
15719
+ var searchcursor = {exports: {}};
15499
15720
 
15500
- var searchcursor = createCommonjsModule(function (module, exports) {
15721
+ (function (module, exports) {
15501
15722
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
15502
15723
  // Distributed under an MIT license: https://codemirror.net/LICENSE
15503
15724
 
15504
15725
  (function(mod) {
15505
- mod(codemirror);
15726
+ mod(codemirror.exports);
15506
15727
  })(function(CodeMirror) {
15507
15728
  var Pos = CodeMirror.Pos;
15508
15729
 
@@ -15696,6 +15917,7 @@
15696
15917
 
15697
15918
  function SearchCursor(doc, query, pos, options) {
15698
15919
  this.atOccurrence = false;
15920
+ this.afterEmptyMatch = false;
15699
15921
  this.doc = doc;
15700
15922
  pos = pos ? doc.clipPos(pos) : Pos(0, 0);
15701
15923
  this.pos = {from: pos, to: pos};
@@ -15731,21 +15953,29 @@
15731
15953
  findPrevious: function() {return this.find(true)},
15732
15954
 
15733
15955
  find: function(reverse) {
15734
- var result = this.matches(reverse, this.doc.clipPos(reverse ? this.pos.from : this.pos.to));
15735
-
15736
- // Implements weird auto-growing behavior on null-matches for
15737
- // backwards-compatiblity with the vim code (unfortunately)
15738
- while (result && CodeMirror.cmpPos(result.from, result.to) == 0) {
15956
+ var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
15957
+ if (this.afterEmptyMatch && this.atOccurrence) {
15958
+ // do not return the same 0 width match twice
15959
+ head = Pos(head.line, head.ch);
15739
15960
  if (reverse) {
15740
- if (result.from.ch) result.from = Pos(result.from.line, result.from.ch - 1);
15741
- else if (result.from.line == this.doc.firstLine()) result = null;
15742
- else result = this.matches(reverse, this.doc.clipPos(Pos(result.from.line - 1)));
15961
+ head.ch--;
15962
+ if (head.ch < 0) {
15963
+ head.line--;
15964
+ head.ch = (this.doc.getLine(head.line) || "").length;
15965
+ }
15743
15966
  } else {
15744
- if (result.to.ch < this.doc.getLine(result.to.line).length) result.to = Pos(result.to.line, result.to.ch + 1);
15745
- else if (result.to.line == this.doc.lastLine()) result = null;
15746
- else result = this.matches(reverse, Pos(result.to.line + 1, 0));
15967
+ head.ch++;
15968
+ if (head.ch > (this.doc.getLine(head.line) || "").length) {
15969
+ head.ch = 0;
15970
+ head.line++;
15971
+ }
15972
+ }
15973
+ if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) {
15974
+ return this.atOccurrence = false
15747
15975
  }
15748
15976
  }
15977
+ var result = this.matches(reverse, head);
15978
+ this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0;
15749
15979
 
15750
15980
  if (result) {
15751
15981
  this.pos = result;
@@ -15788,9 +16018,9 @@
15788
16018
  this.setSelections(ranges, 0);
15789
16019
  });
15790
16020
  });
15791
- });
16021
+ }());
15792
16022
 
15793
- var search = createCommonjsModule(function (module, exports) {
16023
+ (function (module, exports) {
15794
16024
  // CodeMirror, copyright (c) by Marijn Haverbeke and others
15795
16025
  // Distributed under an MIT license: https://codemirror.net/LICENSE
15796
16026
 
@@ -15803,9 +16033,12 @@
15803
16033
  // Ctrl-G.
15804
16034
 
15805
16035
  (function(mod) {
15806
- mod(codemirror, searchcursor, dialog);
16036
+ mod(codemirror.exports, searchcursor.exports, dialog.exports);
15807
16037
  })(function(CodeMirror) {
15808
16038
 
16039
+ // default search panel location
16040
+ CodeMirror.defineOption("search", {bottom: false});
16041
+
15809
16042
  function searchOverlay(query, caseInsensitive) {
15810
16043
  if (typeof query == "string")
15811
16044
  query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
@@ -15850,12 +16083,13 @@
15850
16083
  selectValueOnOpen: true,
15851
16084
  closeOnEnter: false,
15852
16085
  onClose: function() { clearSearch(cm); },
15853
- onKeyDown: onKeyDown
16086
+ onKeyDown: onKeyDown,
16087
+ bottom: cm.options.search.bottom
15854
16088
  });
15855
16089
  }
15856
16090
 
15857
16091
  function dialog(cm, text, shortText, deflt, f) {
15858
- if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
16092
+ if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});
15859
16093
  else f(prompt(shortText, deflt));
15860
16094
  }
15861
16095
 
@@ -15972,18 +16206,43 @@
15972
16206
  if (state.annotate) { state.annotate.clear(); state.annotate = null; }
15973
16207
  });}
15974
16208
 
16209
+ function el(tag, attrs) {
16210
+ var element = tag ? document.createElement(tag) : document.createDocumentFragment();
16211
+ for (var key in attrs) {
16212
+ element[key] = attrs[key];
16213
+ }
16214
+ for (var i = 2; i < arguments.length; i++) {
16215
+ var child = arguments[i];
16216
+ element.appendChild(typeof child == "string" ? document.createTextNode(child) : child);
16217
+ }
16218
+ return element;
16219
+ }
15975
16220
 
15976
16221
  function getQueryDialog(cm) {
15977
- return '<span class="CodeMirror-search-label">' + cm.phrase("Search:") + '</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">' + cm.phrase("(Use /re/ syntax for regexp search)") + '</span>';
16222
+ return el("", null,
16223
+ el("span", {className: "CodeMirror-search-label"}, cm.phrase("Search:")), " ",
16224
+ el("input", {type: "text", "style": "width: 10em", className: "CodeMirror-search-field"}), " ",
16225
+ el("span", {style: "color: #888", className: "CodeMirror-search-hint"},
16226
+ cm.phrase("(Use /re/ syntax for regexp search)")));
15978
16227
  }
15979
16228
  function getReplaceQueryDialog(cm) {
15980
- return ' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">' + cm.phrase("(Use /re/ syntax for regexp search)") + '</span>';
16229
+ return el("", null, " ",
16230
+ el("input", {type: "text", "style": "width: 10em", className: "CodeMirror-search-field"}), " ",
16231
+ el("span", {style: "color: #888", className: "CodeMirror-search-hint"},
16232
+ cm.phrase("(Use /re/ syntax for regexp search)")));
15981
16233
  }
15982
16234
  function getReplacementQueryDialog(cm) {
15983
- return '<span class="CodeMirror-search-label">' + cm.phrase("With:") + '</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
16235
+ return el("", null,
16236
+ el("span", {className: "CodeMirror-search-label"}, cm.phrase("With:")), " ",
16237
+ el("input", {type: "text", "style": "width: 10em", className: "CodeMirror-search-field"}));
15984
16238
  }
15985
16239
  function getDoReplaceConfirm(cm) {
15986
- return '<span class="CodeMirror-search-label">' + cm.phrase("Replace?") + '</span> <button>' + cm.phrase("Yes") + '</button> <button>' + cm.phrase("No") + '</button> <button>' + cm.phrase("All") + '</button> <button>' + cm.phrase("Stop") + '</button> ';
16240
+ return el("", null,
16241
+ el("span", {className: "CodeMirror-search-label"}, cm.phrase("Replace?")), " ",
16242
+ el("button", {}, cm.phrase("Yes")), " ",
16243
+ el("button", {}, cm.phrase("No")), " ",
16244
+ el("button", {}, cm.phrase("All")), " ",
16245
+ el("button", {}, cm.phrase("Stop")));
15987
16246
  }
15988
16247
 
15989
16248
  function replaceAll(cm, query, text) {
@@ -16000,8 +16259,11 @@
16000
16259
  function replace(cm, all) {
16001
16260
  if (cm.getOption("readOnly")) return;
16002
16261
  var query = cm.getSelection() || getSearchState(cm).lastQuery;
16003
- var dialogText = '<span class="CodeMirror-search-label">' + (all ? cm.phrase("Replace all:") : cm.phrase("Replace:")) + '</span>';
16004
- dialog(cm, dialogText + getReplaceQueryDialog(cm), dialogText, query, function(query) {
16262
+ var dialogText = all ? cm.phrase("Replace all:") : cm.phrase("Replace:");
16263
+ var fragment = el("", null,
16264
+ el("span", {className: "CodeMirror-search-label"}, dialogText),
16265
+ getReplaceQueryDialog(cm));
16266
+ dialog(cm, fragment, dialogText, query, function(query) {
16005
16267
  if (!query) return;
16006
16268
  query = parseQuery(query);
16007
16269
  dialog(cm, getReplacementQueryDialog(cm), cm.phrase("Replace with:"), "", function(text) {
@@ -16045,12 +16307,12 @@
16045
16307
  CodeMirror.commands.replace = replace;
16046
16308
  CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
16047
16309
  });
16048
- });
16310
+ }());
16049
16311
 
16050
- var css_248z$2 = ".CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:none;background:transparent;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}";
16051
- styleInject(css_248z$2);
16312
+ var css_248z$3 = ".CodeMirror-dialog{background:inherit;color:inherit;left:0;overflow:hidden;padding:.1em .8em;position:absolute;right:0;z-index:15}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{background:transparent;border:none;color:inherit;font-family:monospace;outline:none;width:20em}.CodeMirror-dialog button{font-size:70%}";
16313
+ styleInject$1(css_248z$3);
16052
16314
 
16053
- function styleInject$1(css, ref) {
16315
+ function styleInject(css, ref) {
16054
16316
  if ( ref === void 0 ) ref = {};
16055
16317
  var insertAt = ref.insertAt;
16056
16318
 
@@ -16077,8 +16339,8 @@
16077
16339
  }
16078
16340
  }
16079
16341
 
16080
- var css_248z$3 = ".codemirror_Editor{border:1px solid #d3d3d3}.codemirror_Editor .cm-marked-text{background-color:#ff0}.codemirror_Editor .cm-marked-error,.codemirror_Editor .cm-marked-info,.codemirror_Editor .cm-marked-warning{display:inline-block;position:relative;background-position:0 100%;background-repeat:repeat-x}.codemirror_Editor .cm-marked-info{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHElEQVQYV2NkgIP//xkYGBkZIXwIB0SDCQgHAgDEXAgCKU2DPwAAAABJRU5ErkJggg==\")}.codemirror_Editor .cm-marked-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHUlEQVQYV2NkgIL/DAz/GRkYGBlBfBgHTMM4MJUAzFoIAuwf4BEAAAAASUVORK5CYII=\")}.codemirror_Editor .cm-marked-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHUlEQVQYV2NkgIL/Sxn+M0YzMDKC+DAOmIZxYCoBKQkLp8ga+UwAAAAASUVORK5CYII=\")}";
16081
- styleInject$1(css_248z$3);
16342
+ var css_248z$1 = ".codemirror_Editor{border:1px solid #d3d3d3}.codemirror_Editor .cm-marked-text{background-color:#ff0}.codemirror_Editor .cm-marked-error,.codemirror_Editor .cm-marked-info,.codemirror_Editor .cm-marked-warning{background-position:0 100%;background-repeat:repeat-x;display:inline-block;position:relative}.codemirror_Editor .cm-marked-info{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHElEQVQYV2NkgIP//xkYGBkZIXwIB0SDCQgHAgDEXAgCKU2DPwAAAABJRU5ErkJggg==\")}.codemirror_Editor .cm-marked-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHUlEQVQYV2NkgIL/DAz/GRkYGBlBfBgHTMM4MJUAzFoIAuwf4BEAAAAASUVORK5CYII=\")}.codemirror_Editor .cm-marked-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAHUlEQVQYV2NkgIL/Sxn+M0YzMDKC+DAOmIZxYCoBKQkLp8ga+UwAAAAASUVORK5CYII=\")}";
16343
+ styleInject(css_248z$1);
16082
16344
 
16083
16345
  var Editor = /** @class */ (function (_super) {
16084
16346
  __extends(Editor, _super);
@@ -16101,7 +16363,7 @@
16101
16363
  if (this.gutterMarkerWidth() > 0) {
16102
16364
  gutters.unshift({
16103
16365
  className: "CodeMirror-guttermarker",
16104
- style: "width:" + this.gutterMarkerWidth() + "px;"
16366
+ style: "width:".concat(this.gutterMarkerWidth(), "px;")
16105
16367
  });
16106
16368
  }
16107
16369
  return gutters;
@@ -16213,7 +16475,7 @@
16213
16475
  Editor.prototype.enter = function (domNode, element) {
16214
16476
  var _this = this;
16215
16477
  _super.prototype.enter.call(this, domNode, element);
16216
- this._codemirror = codemirror.fromTextArea(element.append("textarea").node(), this.options());
16478
+ this._codemirror = CodeMirror.fromTextArea(element.append("textarea").node(), this.options());
16217
16479
  this._codemirror.on("changes", function (cm, changes) {
16218
16480
  _this.changes(changes);
16219
16481
  });
@@ -16275,8 +16537,8 @@
16275
16537
  }(Editor));
16276
16538
  DOTEditor.prototype._class += " codemirror_JSEditor";
16277
16539
 
16278
- var css_248z$4 = ".codemirror_ECLEditor .cm-s-default span.cm-comment{color:green}.codemirror_ECLEditor .cm-s-default span.cm-keyword{color:#00f}.codemirror_ECLEditor .cm-s-default span.cm-variable{font-weight:700;color:navy}.codemirror_ECLEditor .cm-s-default span.cm-variable-2,.codemirror_ECLEditor .cm-s-default span.cm-variable-3{color:maroon}.codemirror_ECLEditor .cm-s-default span.cm-builtin{color:purple}.codemirror_ECLEditor .cm-s-default span.cm-string{color:grey}.cm-s-default span.cm-atom,.codemirror_ECLEditor .cm-s-default span.cm-number{color:#000}.codemirror_ECLEditor .cm-s-default span.cm-meta{color:#004080}.codemirror_ECLEditor .ErrorLine{background:#c00!important;color:#fff!important}.codemirror_ECLEditor .WarningLine{background:#ff9!important}.codemirror_ECLEditor .highlightline{background:#e8f2ff!important}";
16279
- styleInject$1(css_248z$4);
16540
+ var css_248z = ".codemirror_ECLEditor .cm-s-default span.cm-comment{color:green}.codemirror_ECLEditor .cm-s-default span.cm-keyword{color:#00f}.codemirror_ECLEditor .cm-s-default span.cm-variable{color:navy;font-weight:700}.codemirror_ECLEditor .cm-s-default span.cm-variable-2,.codemirror_ECLEditor .cm-s-default span.cm-variable-3{color:maroon}.codemirror_ECLEditor .cm-s-default span.cm-builtin{color:purple}.codemirror_ECLEditor .cm-s-default span.cm-string{color:grey}.cm-s-default span.cm-atom,.codemirror_ECLEditor .cm-s-default span.cm-number{color:#000}.codemirror_ECLEditor .cm-s-default span.cm-meta{color:#004080}.codemirror_ECLEditor .ErrorLine{background:#c00!important;color:#fff!important}.codemirror_ECLEditor .WarningLine{background:#ff9!important}.codemirror_ECLEditor .highlightline{background:#e8f2ff!important}";
16541
+ styleInject(css_248z);
16280
16542
 
16281
16543
  var ECLEditor = /** @class */ (function (_super) {
16282
16544
  __extends(ECLEditor, _super);
@@ -16417,5 +16679,5 @@
16417
16679
 
16418
16680
  Object.defineProperty(exports, '__esModule', { value: true });
16419
16681
 
16420
- })));
16682
+ }));
16421
16683
  //# sourceMappingURL=index.js.map