@vuu-ui/vuu-codemirror 0.6.13-debug → 0.6.14-debug

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/esm/index.js CHANGED
@@ -1,3 +1,17 @@
1
+ var __accessCheck = (obj, member, msg) => {
2
+ if (!member.has(obj))
3
+ throw TypeError("Cannot " + msg);
4
+ };
5
+ var __privateGet = (obj, member, getter) => {
6
+ __accessCheck(obj, member, "read from private field");
7
+ return getter ? getter.call(obj) : member.get(obj);
8
+ };
9
+ var __privateAdd = (obj, member, value) => {
10
+ if (member.has(obj))
11
+ throw TypeError("Cannot add the same private member more than once");
12
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
13
+ };
14
+
1
15
  // ../../node_modules/@codemirror/state/dist/index.js
2
16
  var Text = class {
3
17
  /**
@@ -146,10 +160,10 @@ var Text = class {
146
160
  }
147
161
  };
148
162
  var TextLeaf = class extends Text {
149
- constructor(text, length = textLength(text)) {
163
+ constructor(text, length2 = textLength(text)) {
150
164
  super();
151
165
  this.text = text;
152
- this.length = length;
166
+ this.length = length2;
153
167
  }
154
168
  get lines() {
155
169
  return this.text.length;
@@ -226,10 +240,10 @@ var TextLeaf = class extends Text {
226
240
  }
227
241
  };
228
242
  var TextNode = class extends Text {
229
- constructor(children, length) {
243
+ constructor(children, length2) {
230
244
  super();
231
245
  this.children = children;
232
- this.length = length;
246
+ this.length = length2;
233
247
  this.lines = 0;
234
248
  for (let child of children)
235
249
  this.lines += child.lines;
@@ -293,18 +307,18 @@ var TextNode = class extends Text {
293
307
  scanIdentical(other, dir) {
294
308
  if (!(other instanceof TextNode))
295
309
  return 0;
296
- let length = 0;
310
+ let length2 = 0;
297
311
  let [iA, iB, eA, eB] = dir > 0 ? [0, 0, this.children.length, other.children.length] : [this.children.length - 1, other.children.length - 1, -1, -1];
298
312
  for (; ; iA += dir, iB += dir) {
299
313
  if (iA == eA || iB == eB)
300
- return length;
314
+ return length2;
301
315
  let chA = this.children[iA], chB = other.children[iB];
302
316
  if (chA != chB)
303
- return length + chA.scanIdentical(chB, dir);
304
- length += chA.length + 1;
317
+ return length2 + chA.scanIdentical(chB, dir);
318
+ length2 += chA.length + 1;
305
319
  }
306
320
  }
307
- static from(children, length = children.reduce((l, ch) => l + ch.length + 1, -1)) {
321
+ static from(children, length2 = children.reduce((l, ch) => l + ch.length + 1, -1)) {
308
322
  let lines = 0;
309
323
  for (let ch of children)
310
324
  lines += ch.lines;
@@ -312,7 +326,7 @@ var TextNode = class extends Text {
312
326
  let flat = [];
313
327
  for (let ch of children)
314
328
  ch.flatten(flat);
315
- return new TextLeaf(flat, length);
329
+ return new TextLeaf(flat, length2);
316
330
  }
317
331
  let chunk = Math.max(
318
332
  32,
@@ -350,15 +364,15 @@ var TextNode = class extends Text {
350
364
  for (let child of children)
351
365
  add(child);
352
366
  flush();
353
- return chunked.length == 1 ? chunked[0] : new TextNode(chunked, length);
367
+ return chunked.length == 1 ? chunked[0] : new TextNode(chunked, length2);
354
368
  }
355
369
  };
356
370
  Text.empty = /* @__PURE__ */ new TextLeaf([""], 0);
357
371
  function textLength(text) {
358
- let length = -1;
372
+ let length2 = -1;
359
373
  for (let line of text)
360
- length += line.length + 1;
361
- return length;
374
+ length2 += line.length + 1;
375
+ return length2;
362
376
  }
363
377
  function appendText(text, target, from = 0, to = 1e9) {
364
378
  for (let pos = 0, i = 0, first = true; i < text.length && pos <= to; i++) {
@@ -930,14 +944,14 @@ var ChangeSet = class extends ChangeDesc {
930
944
  Create a change set for the given changes, for a document of the
931
945
  given length, using `lineSep` as line separator.
932
946
  */
933
- static of(changes, length, lineSep) {
947
+ static of(changes, length2, lineSep) {
934
948
  let sections = [], inserted = [], pos = 0;
935
949
  let total = null;
936
950
  function flush(force = false) {
937
951
  if (!force && !sections.length)
938
952
  return;
939
- if (pos < length)
940
- addSection(sections, length - pos, -1);
953
+ if (pos < length2)
954
+ addSection(sections, length2 - pos, -1);
941
955
  let set = new ChangeSet(sections, inserted);
942
956
  total = total ? total.compose(set.map(total)) : set;
943
957
  sections = [];
@@ -949,14 +963,14 @@ var ChangeSet = class extends ChangeDesc {
949
963
  for (let sub of spec)
950
964
  process2(sub);
951
965
  } else if (spec instanceof ChangeSet) {
952
- if (spec.length != length)
953
- throw new RangeError(`Mismatched change set length (got ${spec.length}, expected ${length})`);
966
+ if (spec.length != length2)
967
+ throw new RangeError(`Mismatched change set length (got ${spec.length}, expected ${length2})`);
954
968
  flush();
955
969
  total = total ? total.compose(spec.map(total)) : spec;
956
970
  } else {
957
971
  let { from, to = from, insert: insert2 } = spec;
958
- if (from > to || from < 0 || to > length)
959
- throw new RangeError(`Invalid change range ${from} to ${to} (in doc of length ${length})`);
972
+ if (from > to || from < 0 || to > length2)
973
+ throw new RangeError(`Invalid change range ${from} to ${to} (in doc of length ${length2})`);
960
974
  let insText = !insert2 ? Text.empty : typeof insert2 == "string" ? Text.of(insert2.split(lineSep || DefaultSplit)) : insert2;
961
975
  let insLen = insText.length;
962
976
  if (from == to && insLen == 0)
@@ -977,8 +991,8 @@ var ChangeSet = class extends ChangeDesc {
977
991
  /**
978
992
  Create an empty changeset of the given length.
979
993
  */
980
- static empty(length) {
981
- return new ChangeSet(length ? [length, -1] : [], []);
994
+ static empty(length2) {
995
+ return new ChangeSet(length2 ? [length2, -1] : [], []);
982
996
  }
983
997
  /**
984
998
  Create a changeset from its JSON representation (as produced by
@@ -2512,7 +2526,7 @@ var EditorState = class {
2512
2526
  this returns null.
2513
2527
  */
2514
2528
  wordAt(pos) {
2515
- let { text, from, length } = this.doc.lineAt(pos);
2529
+ let { text, from, length: length2 } = this.doc.lineAt(pos);
2516
2530
  let cat = this.charCategorizer(pos);
2517
2531
  let start = pos - from, end = pos - from;
2518
2532
  while (start > 0) {
@@ -2521,7 +2535,7 @@ var EditorState = class {
2521
2535
  break;
2522
2536
  start = prev;
2523
2537
  }
2524
- while (end < length) {
2538
+ while (end < length2) {
2525
2539
  let next = findClusterBreak(text, end);
2526
2540
  if (cat(text.slice(end, next)) != CharCategory.Word)
2527
2541
  break;
@@ -2814,7 +2828,7 @@ var RangeSet = class {
2814
2828
  let sharedChunks = findSharedChunks(a, b, textDiff);
2815
2829
  let sideA = new SpanCursor(a, sharedChunks, minPointSize);
2816
2830
  let sideB = new SpanCursor(b, sharedChunks, minPointSize);
2817
- textDiff.iterGaps((fromA, fromB, length) => compare(sideA, fromA, sideB, fromB, length, comparator));
2831
+ textDiff.iterGaps((fromA, fromB, length2) => compare(sideA, fromA, sideB, fromB, length2, comparator));
2818
2832
  if (textDiff.empty && textDiff.length == 0)
2819
2833
  compare(sideA, 0, sideB, 0, 0, comparator);
2820
2834
  }
@@ -3266,10 +3280,10 @@ var SpanCursor = class {
3266
3280
  return open;
3267
3281
  }
3268
3282
  };
3269
- function compare(a, startA, b, startB, length, comparator) {
3283
+ function compare(a, startA, b, startB, length2, comparator) {
3270
3284
  a.goto(startA);
3271
3285
  b.goto(startB);
3272
- let endB = startB + length;
3286
+ let endB = startB + length2;
3273
3287
  let pos = startB, dPos = startB - startA;
3274
3288
  for (; ; ) {
3275
3289
  let diff = a.to + dPos - b.to || a.endSide - b.endSide;
@@ -3420,11 +3434,11 @@ var StyleSet = class {
3420
3434
  constructor(root) {
3421
3435
  if (!root.head && root.adoptedStyleSheets && typeof CSSStyleSheet != "undefined") {
3422
3436
  if (adoptedSet) {
3423
- root.adoptedStyleSheets = [adoptedSet.sheet].concat(root.adoptedStyleSheets);
3437
+ root.adoptedStyleSheets = [adoptedSet.sheet, ...root.adoptedStyleSheets];
3424
3438
  return root[SET] = adoptedSet;
3425
3439
  }
3426
3440
  this.sheet = new CSSStyleSheet();
3427
- root.adoptedStyleSheets = [this.sheet].concat(root.adoptedStyleSheets);
3441
+ root.adoptedStyleSheets = [this.sheet, ...root.adoptedStyleSheets];
3428
3442
  adoptedSet = this;
3429
3443
  } else {
3430
3444
  this.styleTag = (root.ownerDocument || root).createElement("style");
@@ -4283,11 +4297,11 @@ var TextView = class extends ContentView {
4283
4297
  }
4284
4298
  };
4285
4299
  var MarkView = class extends ContentView {
4286
- constructor(mark, children = [], length = 0) {
4300
+ constructor(mark, children = [], length2 = 0) {
4287
4301
  super();
4288
4302
  this.mark = mark;
4289
4303
  this.children = children;
4290
- this.length = length;
4304
+ this.length = length2;
4291
4305
  for (let ch of children)
4292
4306
  ch.setParent(this);
4293
4307
  }
@@ -4331,13 +4345,13 @@ var MarkView = class extends ContentView {
4331
4345
  off = end;
4332
4346
  i++;
4333
4347
  }
4334
- let length = this.length - from;
4348
+ let length2 = this.length - from;
4335
4349
  this.length = from;
4336
4350
  if (detachFrom > -1) {
4337
4351
  this.children.length = detachFrom;
4338
4352
  this.markDirty();
4339
4353
  }
4340
- return new MarkView(this.mark, result, length);
4354
+ return new MarkView(this.mark, result, length2);
4341
4355
  }
4342
4356
  domAtPos(pos) {
4343
4357
  return inlineDOMAtPos(this, pos);
@@ -4347,16 +4361,16 @@ var MarkView = class extends ContentView {
4347
4361
  }
4348
4362
  };
4349
4363
  function textCoords(text, pos, side) {
4350
- let length = text.nodeValue.length;
4351
- if (pos > length)
4352
- pos = length;
4364
+ let length2 = text.nodeValue.length;
4365
+ if (pos > length2)
4366
+ pos = length2;
4353
4367
  let from = pos, to = pos, flatten2 = 0;
4354
- if (pos == 0 && side < 0 || pos == length && side >= 0) {
4368
+ if (pos == 0 && side < 0 || pos == length2 && side >= 0) {
4355
4369
  if (!(browser.chrome || browser.gecko)) {
4356
4370
  if (pos) {
4357
4371
  from--;
4358
4372
  flatten2 = 1;
4359
- } else if (to < length) {
4373
+ } else if (to < length2) {
4360
4374
  to++;
4361
4375
  flatten2 = -1;
4362
4376
  }
@@ -4364,7 +4378,7 @@ function textCoords(text, pos, side) {
4364
4378
  } else {
4365
4379
  if (side < 0)
4366
4380
  from--;
4367
- else if (to < length)
4381
+ else if (to < length2)
4368
4382
  to++;
4369
4383
  }
4370
4384
  let rects = textRange(text, from, to).getClientRects();
@@ -4376,15 +4390,15 @@ function textCoords(text, pos, side) {
4376
4390
  return flatten2 ? flattenRect(rect, flatten2 < 0) : rect || null;
4377
4391
  }
4378
4392
  var WidgetView = class extends ContentView {
4379
- constructor(widget, length, side) {
4393
+ constructor(widget, length2, side) {
4380
4394
  super();
4381
4395
  this.widget = widget;
4382
- this.length = length;
4396
+ this.length = length2;
4383
4397
  this.side = side;
4384
4398
  this.prevWidget = null;
4385
4399
  }
4386
- static create(widget, length, side) {
4387
- return new (widget.customView || WidgetView)(widget, length, side);
4400
+ static create(widget, length2, side) {
4401
+ return new (widget.customView || WidgetView)(widget, length2, side);
4388
4402
  }
4389
4403
  split(from) {
4390
4404
  let result = WidgetView.create(this.widget, this.length - from, this.side);
@@ -4527,8 +4541,9 @@ function scanCompositionTree(pos, side, view, text, enterView, fromText) {
4527
4541
  }
4528
4542
  function posFromDOMInCompositionTree(node, offset, view, text) {
4529
4543
  if (view instanceof MarkView) {
4544
+ let pos = 0;
4530
4545
  for (let child of view.children) {
4531
- let pos = 0, hasComp = contains(child.dom, text);
4546
+ let hasComp = contains(child.dom, text);
4532
4547
  if (contains(child.dom, node))
4533
4548
  return pos + (hasComp ? posFromDOMInCompositionTree(node, offset, child, text) : child.localPosFromDOM(node, offset));
4534
4549
  pos += hasComp ? text.nodeValue.length : child.length;
@@ -4567,7 +4582,7 @@ var WidgetBufferView = class extends ContentView {
4567
4582
  return this.side;
4568
4583
  }
4569
4584
  domAtPos(pos) {
4570
- return DOMPos.before(this.dom);
4585
+ return this.side > 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom);
4571
4586
  }
4572
4587
  localPosFromDOM() {
4573
4588
  return 0;
@@ -5039,7 +5054,7 @@ var LineView = class extends ContentView {
5039
5054
  measureTextSize() {
5040
5055
  if (this.children.length == 0 || this.length > 20)
5041
5056
  return null;
5042
- let totalWidth = 0;
5057
+ let totalWidth = 0, textHeight;
5043
5058
  for (let child of this.children) {
5044
5059
  if (!(child instanceof TextView) || /[^ -~]/.test(child.text))
5045
5060
  return null;
@@ -5047,14 +5062,24 @@ var LineView = class extends ContentView {
5047
5062
  if (rects.length != 1)
5048
5063
  return null;
5049
5064
  totalWidth += rects[0].width;
5065
+ textHeight = rects[0].height;
5050
5066
  }
5051
5067
  return !totalWidth ? null : {
5052
5068
  lineHeight: this.dom.getBoundingClientRect().height,
5053
- charWidth: totalWidth / this.length
5069
+ charWidth: totalWidth / this.length,
5070
+ textHeight
5054
5071
  };
5055
5072
  }
5056
5073
  coordsAt(pos, side) {
5057
- return coordsInChildren(this, pos, side);
5074
+ let rect = coordsInChildren(this, pos, side);
5075
+ if (!this.children.length && rect && this.parent) {
5076
+ let { heightOracle } = this.parent.view.viewState, height = rect.bottom - rect.top;
5077
+ if (Math.abs(height - heightOracle.lineHeight) < 2 && heightOracle.textHeight < height) {
5078
+ let dist = (height - heightOracle.textHeight) / 2;
5079
+ return { top: rect.top + dist, bottom: rect.bottom - dist, left: rect.left, right: rect.left };
5080
+ }
5081
+ }
5082
+ return rect;
5058
5083
  }
5059
5084
  become(_other) {
5060
5085
  return false;
@@ -5077,10 +5102,10 @@ var LineView = class extends ContentView {
5077
5102
  }
5078
5103
  };
5079
5104
  var BlockWidgetView = class extends ContentView {
5080
- constructor(widget, length, type) {
5105
+ constructor(widget, length2, type) {
5081
5106
  super();
5082
5107
  this.widget = widget;
5083
- this.length = length;
5108
+ this.length = length2;
5084
5109
  this.type = type;
5085
5110
  this.breakAfter = 0;
5086
5111
  this.prevWidget = null;
@@ -5201,8 +5226,8 @@ var ContentBuilder = class {
5201
5226
  if (!this.posCovered())
5202
5227
  this.getLine();
5203
5228
  }
5204
- buildText(length, active, openStart) {
5205
- while (length > 0) {
5229
+ buildText(length2, active, openStart) {
5230
+ while (length2 > 0) {
5206
5231
  if (this.textOff == this.text.length) {
5207
5232
  let { value, lineBreak, done } = this.cursor.next(this.skip);
5208
5233
  this.skip = 0;
@@ -5218,7 +5243,7 @@ var ContentBuilder = class {
5218
5243
  this.flushBuffer();
5219
5244
  this.curLine = null;
5220
5245
  this.atCursorPos = true;
5221
- length--;
5246
+ length2--;
5222
5247
  continue;
5223
5248
  } else {
5224
5249
  this.text = value;
@@ -5227,7 +5252,7 @@ var ContentBuilder = class {
5227
5252
  }
5228
5253
  let take = Math.min(
5229
5254
  this.text.length - this.textOff,
5230
- length,
5255
+ length2,
5231
5256
  512
5232
5257
  /* T.Chunk */
5233
5258
  );
@@ -5235,7 +5260,7 @@ var ContentBuilder = class {
5235
5260
  this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff, this.textOff + take)), active), openStart);
5236
5261
  this.atCursorPos = true;
5237
5262
  this.textOff += take;
5238
- length -= take;
5263
+ length2 -= take;
5239
5264
  openStart = 0;
5240
5265
  }
5241
5266
  }
@@ -5747,8 +5772,8 @@ function computeOrder(line, direction) {
5747
5772
  }
5748
5773
  return order;
5749
5774
  }
5750
- function trivialOrder(length) {
5751
- return [new BidiSpan(0, length, 0)];
5775
+ function trivialOrder(length2) {
5776
+ return [new BidiSpan(0, length2, 0)];
5752
5777
  }
5753
5778
  var movedOver = "";
5754
5779
  function moveVisually(line, order, dir, start, forward) {
@@ -6147,7 +6172,7 @@ var DocView = class extends ContentView {
6147
6172
  return measure;
6148
6173
  }
6149
6174
  }
6150
- let dummy = document.createElement("div"), lineHeight, charWidth;
6175
+ let dummy = document.createElement("div"), lineHeight, charWidth, textHeight;
6151
6176
  dummy.className = "cm-line";
6152
6177
  dummy.style.width = "99999px";
6153
6178
  dummy.textContent = "abc def ghi jkl mno pqr stu";
@@ -6156,9 +6181,10 @@ var DocView = class extends ContentView {
6156
6181
  let rect = clientRectsFor(dummy.firstChild)[0];
6157
6182
  lineHeight = dummy.getBoundingClientRect().height;
6158
6183
  charWidth = rect ? rect.width / 27 : 7;
6184
+ textHeight = rect ? rect.height : lineHeight;
6159
6185
  dummy.remove();
6160
6186
  });
6161
- return { lineHeight, charWidth };
6187
+ return { lineHeight, charWidth, textHeight };
6162
6188
  }
6163
6189
  childCursor(pos = this.length) {
6164
6190
  let i = this.children.length;
@@ -6332,20 +6358,30 @@ var CompositionWidget = class extends WidgetType {
6332
6358
  return CompositionView;
6333
6359
  }
6334
6360
  };
6335
- function nearbyTextNode(node, offset, side) {
6336
- for (; ; ) {
6337
- if (node.nodeType == 3)
6338
- return node;
6339
- if (node.nodeType == 1 && offset > 0 && side <= 0) {
6340
- node = node.childNodes[offset - 1];
6341
- offset = maxOffset(node);
6342
- } else if (node.nodeType == 1 && offset < node.childNodes.length && side >= 0) {
6343
- node = node.childNodes[offset];
6344
- offset = 0;
6345
- } else {
6346
- return null;
6361
+ function nearbyTextNode(startNode, startOffset, side) {
6362
+ if (side <= 0)
6363
+ for (let node = startNode, offset = startOffset; ; ) {
6364
+ if (node.nodeType == 3)
6365
+ return node;
6366
+ if (node.nodeType == 1 && offset > 0) {
6367
+ node = node.childNodes[offset - 1];
6368
+ offset = maxOffset(node);
6369
+ } else {
6370
+ break;
6371
+ }
6347
6372
  }
6348
- }
6373
+ if (side >= 0)
6374
+ for (let node = startNode, offset = startOffset; ; ) {
6375
+ if (node.nodeType == 3)
6376
+ return node;
6377
+ if (node.nodeType == 1 && offset < node.childNodes.length && side >= 0) {
6378
+ node = node.childNodes[offset];
6379
+ offset = 0;
6380
+ } else {
6381
+ break;
6382
+ }
6383
+ }
6384
+ return null;
6349
6385
  }
6350
6386
  function nextToUneditable(node, offset) {
6351
6387
  if (node.nodeType != 1)
@@ -6501,7 +6537,7 @@ function domPosInText(node, x, y) {
6501
6537
  return { node, offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node.nodeValue.length : 0 };
6502
6538
  }
6503
6539
  function posAtCoords(view, coords, precise, bias = -1) {
6504
- var _a2;
6540
+ var _a2, _b;
6505
6541
  let content2 = view.contentDOM.getBoundingClientRect(), docTop = content2.top + view.viewState.paddingTop;
6506
6542
  let block, { docHeight } = view.viewState;
6507
6543
  let { x, y } = coords, yOffset = y - docTop;
@@ -6564,7 +6600,7 @@ function posAtCoords(view, coords, precise, bias = -1) {
6564
6600
  let nearest = view.docView.nearest(node);
6565
6601
  if (!nearest)
6566
6602
  return null;
6567
- if (nearest.isWidget) {
6603
+ if (nearest.isWidget && ((_b = nearest.dom) === null || _b === void 0 ? void 0 : _b.nodeType) == 1) {
6568
6604
  let rect = nearest.dom.getBoundingClientRect();
6569
6605
  return coords.y < rect.top || coords.y <= rect.bottom && coords.x <= (rect.left + rect.right) / 2 ? nearest.posAtStart : nearest.posAtEnd;
6570
6606
  } else {
@@ -6737,8 +6773,14 @@ var InputState = class {
6737
6773
  this.registeredEvents.push(type);
6738
6774
  }
6739
6775
  view.scrollDOM.addEventListener("mousedown", (event) => {
6740
- if (event.target == view.scrollDOM && event.clientY > view.contentDOM.getBoundingClientRect().bottom)
6776
+ if (event.target == view.scrollDOM && event.clientY > view.contentDOM.getBoundingClientRect().bottom) {
6741
6777
  handleEvent(handlers.mousedown, event);
6778
+ if (!event.defaultPrevented && event.button == 2) {
6779
+ let start = view.contentDOM.style.minHeight;
6780
+ view.contentDOM.style.minHeight = "100%";
6781
+ setTimeout(() => view.contentDOM.style.minHeight = start, 200);
6782
+ }
6783
+ }
6742
6784
  });
6743
6785
  if (browser.chrome && browser.chrome_version == 102) {
6744
6786
  view.scrollDOM.addEventListener("wheel", () => {
@@ -7223,7 +7265,7 @@ handlers.paste = (view, event) => {
7223
7265
  view.observer.flush();
7224
7266
  let data = brokenClipboardAPI ? null : event.clipboardData;
7225
7267
  if (data) {
7226
- doPaste(view, data.getData("text/plain"));
7268
+ doPaste(view, data.getData("text/plain") || data.getData("text/uri-text"));
7227
7269
  event.preventDefault();
7228
7270
  } else {
7229
7271
  capturePaste(view);
@@ -7366,6 +7408,7 @@ var HeightOracle = class {
7366
7408
  this.heightSamples = {};
7367
7409
  this.lineHeight = 14;
7368
7410
  this.charWidth = 7;
7411
+ this.textHeight = 14;
7369
7412
  this.lineLength = 30;
7370
7413
  this.heightChanged = false;
7371
7414
  }
@@ -7375,10 +7418,10 @@ var HeightOracle = class {
7375
7418
  lines += Math.max(0, Math.ceil((to - from - lines * this.lineLength * 0.5) / this.lineLength));
7376
7419
  return this.lineHeight * lines;
7377
7420
  }
7378
- heightForLine(length) {
7421
+ heightForLine(length2) {
7379
7422
  if (!this.lineWrapping)
7380
7423
  return this.lineHeight;
7381
- let lines = 1 + Math.max(0, Math.ceil((length - this.lineLength) / (this.lineLength - 5)));
7424
+ let lines = 1 + Math.max(0, Math.ceil((length2 - this.lineLength) / (this.lineLength - 5)));
7382
7425
  return lines * this.lineHeight;
7383
7426
  }
7384
7427
  setDoc(doc2) {
@@ -7401,12 +7444,13 @@ var HeightOracle = class {
7401
7444
  }
7402
7445
  return newHeight;
7403
7446
  }
7404
- refresh(whiteSpace, lineHeight, charWidth, lineLength, knownHeights) {
7447
+ refresh(whiteSpace, lineHeight, charWidth, textHeight, lineLength, knownHeights) {
7405
7448
  let lineWrapping = wrappingWhiteSpace.indexOf(whiteSpace) > -1;
7406
7449
  let changed = Math.round(lineHeight) != Math.round(this.lineHeight) || this.lineWrapping != lineWrapping;
7407
7450
  this.lineWrapping = lineWrapping;
7408
7451
  this.lineHeight = lineHeight;
7409
7452
  this.charWidth = charWidth;
7453
+ this.textHeight = textHeight;
7410
7454
  this.lineLength = lineLength;
7411
7455
  if (changed) {
7412
7456
  this.heightSamples = {};
@@ -7435,9 +7479,9 @@ var BlockInfo = class {
7435
7479
  /**
7436
7480
  @internal
7437
7481
  */
7438
- constructor(from, length, top2, height, type) {
7482
+ constructor(from, length2, top2, height, type) {
7439
7483
  this.from = from;
7440
- this.length = length;
7484
+ this.length = length2;
7441
7485
  this.top = top2;
7442
7486
  this.height = height;
7443
7487
  this.type = type;
@@ -7470,8 +7514,8 @@ var QueryType = /* @__PURE__ */ function(QueryType2) {
7470
7514
  }(QueryType || (QueryType = {}));
7471
7515
  var Epsilon = 1e-3;
7472
7516
  var HeightMap = class {
7473
- constructor(length, height, flags = 2) {
7474
- this.length = length;
7517
+ constructor(length2, height, flags = 2) {
7518
+ this.length = length2;
7475
7519
  this.height = height;
7476
7520
  this.flags = flags;
7477
7521
  }
@@ -7578,8 +7622,8 @@ var HeightMap = class {
7578
7622
  };
7579
7623
  HeightMap.prototype.size = 1;
7580
7624
  var HeightMapBlock = class extends HeightMap {
7581
- constructor(length, height, type) {
7582
- super(length, height);
7625
+ constructor(length2, height, type) {
7626
+ super(length2, height);
7583
7627
  this.type = type;
7584
7628
  }
7585
7629
  blockAt(_height, _oracle, top2, offset) {
@@ -7603,8 +7647,8 @@ var HeightMapBlock = class extends HeightMap {
7603
7647
  }
7604
7648
  };
7605
7649
  var HeightMapText = class extends HeightMapBlock {
7606
- constructor(length, height) {
7607
- super(length, height, BlockType.Text);
7650
+ constructor(length2, height) {
7651
+ super(length2, height, BlockType.Text);
7608
7652
  this.collapsed = 0;
7609
7653
  this.widgetHeight = 0;
7610
7654
  }
@@ -7635,8 +7679,8 @@ var HeightMapText = class extends HeightMapBlock {
7635
7679
  }
7636
7680
  };
7637
7681
  var HeightMapGap = class extends HeightMap {
7638
- constructor(length) {
7639
- super(length, 0);
7682
+ constructor(length2) {
7683
+ super(length2, 0);
7640
7684
  }
7641
7685
  heightMetrics(oracle, offset) {
7642
7686
  let firstLine = oracle.doc.lineAt(offset).number, lastLine = oracle.doc.lineAt(offset + this.length).number;
@@ -7660,8 +7704,8 @@ var HeightMapGap = class extends HeightMap {
7660
7704
  return new BlockInfo(line.from, line.length, lineTop, lineHeight, BlockType.Text);
7661
7705
  } else {
7662
7706
  let line = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top2) / perLine)));
7663
- let { from, length } = oracle.doc.line(firstLine + line);
7664
- return new BlockInfo(from, length, top2 + perLine * line, perLine, BlockType.Text);
7707
+ let { from, length: length2 } = oracle.doc.line(firstLine + line);
7708
+ return new BlockInfo(from, length2, top2 + perLine * line, perLine, BlockType.Text);
7665
7709
  }
7666
7710
  }
7667
7711
  lineAt(value, type, oracle, top2, offset) {
@@ -7962,12 +8006,12 @@ var NodeBuilder = class {
7962
8006
  if (block.type != BlockType.WidgetBefore)
7963
8007
  this.covering = block;
7964
8008
  }
7965
- addLineDeco(height, length) {
8009
+ addLineDeco(height, length2) {
7966
8010
  let line = this.ensureLine();
7967
- line.length += length;
7968
- line.collapsed += length;
8011
+ line.length += length2;
8012
+ line.collapsed += length2;
7969
8013
  line.widgetHeight = Math.max(line.widgetHeight, height);
7970
- this.writtenTo = this.pos = this.pos + length;
8014
+ this.writtenTo = this.pos = this.pos + length2;
7971
8015
  }
7972
8016
  finish(from) {
7973
8017
  let last = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1];
@@ -8211,8 +8255,8 @@ var ViewState = class {
8211
8255
  if (oracle.mustRefreshForHeights(lineHeights))
8212
8256
  refresh = true;
8213
8257
  if (refresh || oracle.lineWrapping && Math.abs(contentWidth - this.contentDOMWidth) > oracle.charWidth) {
8214
- let { lineHeight, charWidth } = view.docView.measureTextSize();
8215
- refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, contentWidth / charWidth, lineHeights);
8258
+ let { lineHeight, charWidth, textHeight } = view.docView.measureTextSize();
8259
+ refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, contentWidth / charWidth, lineHeights);
8216
8260
  if (refresh) {
8217
8261
  view.docView.minWidth = 0;
8218
8262
  result |= 8;
@@ -8615,6 +8659,9 @@ var baseTheme$1 = /* @__PURE__ */ buildTheme("." + baseThemeID, {
8615
8659
  padding: "0 2px 0 6px"
8616
8660
  },
8617
8661
  ".cm-layer": {
8662
+ position: "absolute",
8663
+ left: 0,
8664
+ top: 0,
8618
8665
  contain: "size style",
8619
8666
  "& > *": {
8620
8667
  position: "absolute"
@@ -9643,7 +9690,7 @@ var EditorView = class {
9643
9690
  if (this.destroyed)
9644
9691
  return;
9645
9692
  if (this.measureScheduled > -1)
9646
- cancelAnimationFrame(this.measureScheduled);
9693
+ this.win.cancelAnimationFrame(this.measureScheduled);
9647
9694
  this.measureScheduled = 0;
9648
9695
  if (flush)
9649
9696
  this.observer.forceFlush();
@@ -10074,7 +10121,7 @@ var EditorView = class {
10074
10121
  this.dom.remove();
10075
10122
  this.observer.destroy();
10076
10123
  if (this.measureScheduled > -1)
10077
- cancelAnimationFrame(this.measureScheduled);
10124
+ this.win.cancelAnimationFrame(this.measureScheduled);
10078
10125
  this.destroyed = true;
10079
10126
  }
10080
10127
  /**
@@ -10437,9 +10484,9 @@ function rectanglesForRange(view, className, range) {
10437
10484
  let from = Math.max(range.from, view.viewport.from), to = Math.min(range.to, view.viewport.to);
10438
10485
  let ltr = view.textDirection == Direction.LTR;
10439
10486
  let content2 = view.contentDOM, contentRect = content2.getBoundingClientRect(), base2 = getBase(view);
10440
- let lineStyle = window.getComputedStyle(content2.firstChild);
10441
- let leftSide = contentRect.left + parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent));
10442
- let rightSide = contentRect.right - parseInt(lineStyle.paddingRight);
10487
+ let lineElt = content2.querySelector(".cm-line"), lineStyle = lineElt && window.getComputedStyle(lineElt);
10488
+ let leftSide = contentRect.left + (lineStyle ? parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent)) : 0);
10489
+ let rightSide = contentRect.right - (lineStyle ? parseInt(lineStyle.paddingRight) : 0);
10443
10490
  let startBlock = blockAt(view, from), endBlock = blockAt(view, to);
10444
10491
  let visualStart = startBlock.type == BlockType.Text ? startBlock : null;
10445
10492
  let visualEnd = endBlock.type == BlockType.Text ? endBlock : null;
@@ -11427,11 +11474,11 @@ var IterMode;
11427
11474
  })(IterMode || (IterMode = {}));
11428
11475
  var Tree = class {
11429
11476
  /// Construct a new tree. See also [`Tree.build`](#common.Tree^build).
11430
- constructor(type, children, positions, length, props) {
11477
+ constructor(type, children, positions, length2, props) {
11431
11478
  this.type = type;
11432
11479
  this.children = children;
11433
11480
  this.positions = positions;
11434
- this.length = length;
11481
+ this.length = length2;
11435
11482
  this.props = null;
11436
11483
  if (props && props.length) {
11437
11484
  this.props = /* @__PURE__ */ Object.create(null);
@@ -11544,7 +11591,7 @@ var Tree = class {
11544
11591
  /// which may have children grouped into subtrees with type
11545
11592
  /// [`NodeType.none`](#common.NodeType^none).
11546
11593
  balance(config2 = {}) {
11547
- return this.children.length <= 8 ? this : balanceRange(NodeType.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree(this.type, children, positions, length, this.propValues), config2.makeTree || ((children, positions, length) => new Tree(NodeType.none, children, positions, length)));
11594
+ return this.children.length <= 8 ? this : balanceRange(NodeType.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length2) => new Tree(this.type, children, positions, length2, this.propValues), config2.makeTree || ((children, positions, length2) => new Tree(NodeType.none, children, positions, length2)));
11548
11595
  }
11549
11596
  /// Build a tree from a postfix-ordered buffer of node information,
11550
11597
  /// or a cursor over such a buffer.
@@ -11582,9 +11629,9 @@ var FlatBufferCursor = class {
11582
11629
  };
11583
11630
  var TreeBuffer = class {
11584
11631
  /// Create a tree buffer.
11585
- constructor(buffer, length, set) {
11632
+ constructor(buffer, length2, set) {
11586
11633
  this.buffer = buffer;
11587
- this.length = length;
11634
+ this.length = length2;
11588
11635
  this.set = set;
11589
11636
  }
11590
11637
  /// @internal
@@ -12395,15 +12442,15 @@ function buildTree(data) {
12395
12442
  positions2.push(startPos);
12396
12443
  }
12397
12444
  function makeBalanced(type) {
12398
- return (children2, positions2, length2) => {
12445
+ return (children2, positions2, length3) => {
12399
12446
  let lookAhead2 = 0, lastI = children2.length - 1, last, lookAheadProp;
12400
12447
  if (lastI >= 0 && (last = children2[lastI]) instanceof Tree) {
12401
- if (!lastI && last.type == type && last.length == length2)
12448
+ if (!lastI && last.type == type && last.length == length3)
12402
12449
  return last;
12403
12450
  if (lookAheadProp = last.prop(NodeProp.lookAhead))
12404
12451
  lookAhead2 = positions2[lastI] + last.length + lookAheadProp;
12405
12452
  }
12406
- return makeTree(type, children2, positions2, length2, lookAhead2);
12453
+ return makeTree(type, children2, positions2, length3, lookAhead2);
12407
12454
  };
12408
12455
  }
12409
12456
  function makeRepeatLeaf(children2, positions2, base2, i, from, to, type, lookAhead2) {
@@ -12415,7 +12462,7 @@ function buildTree(data) {
12415
12462
  children2.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from, lookAhead2 - to));
12416
12463
  positions2.push(from - base2);
12417
12464
  }
12418
- function makeTree(type, children2, positions2, length2, lookAhead2 = 0, props) {
12465
+ function makeTree(type, children2, positions2, length3, lookAhead2 = 0, props) {
12419
12466
  if (contextHash) {
12420
12467
  let pair2 = [NodeProp.contextHash, contextHash];
12421
12468
  props = props ? [pair2].concat(props) : [pair2];
@@ -12424,7 +12471,7 @@ function buildTree(data) {
12424
12471
  let pair2 = [NodeProp.lookAhead, lookAhead2];
12425
12472
  props = props ? [pair2].concat(props) : [pair2];
12426
12473
  }
12427
- return new Tree(type, children2, positions2, length2, props);
12474
+ return new Tree(type, children2, positions2, length3, props);
12428
12475
  }
12429
12476
  function findBufferSize(maxSize, inRepeat) {
12430
12477
  let fork = cursor.fork();
@@ -12494,8 +12541,8 @@ function buildTree(data) {
12494
12541
  let children = [], positions = [];
12495
12542
  while (cursor.pos > 0)
12496
12543
  takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1);
12497
- let length = (_a2 = data.length) !== null && _a2 !== void 0 ? _a2 : children.length ? positions[0] + children[0].length : 0;
12498
- return new Tree(types2[data.topID], children.reverse(), positions.reverse(), length);
12544
+ let length2 = (_a2 = data.length) !== null && _a2 !== void 0 ? _a2 : children.length ? positions[0] + children[0].length : 0;
12545
+ return new Tree(types2[data.topID], children.reverse(), positions.reverse(), length2);
12499
12546
  }
12500
12547
  var nodeSizeCache = /* @__PURE__ */ new WeakMap();
12501
12548
  function nodeSize(balanceType, node) {
@@ -12515,7 +12562,7 @@ function nodeSize(balanceType, node) {
12515
12562
  }
12516
12563
  return size;
12517
12564
  }
12518
- function balanceRange(balanceType, children, positions, from, to, start, length, mkTop, mkTree) {
12565
+ function balanceRange(balanceType, children, positions, from, to, start, length2, mkTop, mkTree) {
12519
12566
  let total = 0;
12520
12567
  for (let i = from; i < to; i++)
12521
12568
  total += nodeSize(balanceType, children[i]);
@@ -12542,14 +12589,14 @@ function balanceRange(balanceType, children, positions, from, to, start, length,
12542
12589
  }
12543
12590
  localChildren.push(children2[groupFrom]);
12544
12591
  } else {
12545
- let length2 = positions2[i - 1] + children2[i - 1].length - groupStart;
12546
- localChildren.push(balanceRange(balanceType, children2, positions2, groupFrom, i, groupStart, length2, null, mkTree));
12592
+ let length3 = positions2[i - 1] + children2[i - 1].length - groupStart;
12593
+ localChildren.push(balanceRange(balanceType, children2, positions2, groupFrom, i, groupStart, length3, null, mkTree));
12547
12594
  }
12548
12595
  localPositions.push(groupStart + offset - start);
12549
12596
  }
12550
12597
  }
12551
12598
  divide(children, positions, from, to, 0);
12552
- return (mkTop || mkTree)(localChildren, localPositions, length);
12599
+ return (mkTop || mkTree)(localChildren, localPositions, length2);
12553
12600
  }
12554
12601
  var TreeFragment = class {
12555
12602
  /// Construct a tree fragment. You'll usually want to use
@@ -15107,12 +15154,12 @@ function moveCompletionSelection(forward, by = "option") {
15107
15154
  let step = 1, tooltip;
15108
15155
  if (by == "page" && (tooltip = getTooltip(view, cState.open.tooltip)))
15109
15156
  step = Math.max(2, Math.floor(tooltip.dom.offsetHeight / tooltip.dom.querySelector("li").offsetHeight) - 1);
15110
- let { length } = cState.open.options;
15111
- let selected = cState.open.selected > -1 ? cState.open.selected + step * (forward ? 1 : -1) : forward ? 0 : length - 1;
15157
+ let { length: length2 } = cState.open.options;
15158
+ let selected = cState.open.selected > -1 ? cState.open.selected + step * (forward ? 1 : -1) : forward ? 0 : length2 - 1;
15112
15159
  if (selected < 0)
15113
- selected = by == "page" ? 0 : length - 1;
15114
- else if (selected >= length)
15115
- selected = by == "page" ? length - 1 : 0;
15160
+ selected = by == "page" ? 0 : length2 - 1;
15161
+ else if (selected >= length2)
15162
+ selected = by == "page" ? length2 - 1 : 0;
15116
15163
  view.dispatch({ effects: setSelectedEffect.of(selected) });
15117
15164
  return true;
15118
15165
  };
@@ -15966,16 +16013,16 @@ function popSelection(branch) {
15966
16013
  function addMappingToBranch(branch, mapping) {
15967
16014
  if (!branch.length)
15968
16015
  return branch;
15969
- let length = branch.length, selections = none3;
15970
- while (length) {
15971
- let event = mapEvent(branch[length - 1], mapping, selections);
16016
+ let length2 = branch.length, selections = none3;
16017
+ while (length2) {
16018
+ let event = mapEvent(branch[length2 - 1], mapping, selections);
15972
16019
  if (event.changes && !event.changes.empty || event.effects.length) {
15973
- let result = branch.slice(0, length);
15974
- result[length - 1] = event;
16020
+ let result = branch.slice(0, length2);
16021
+ result[length2 - 1] = event;
15975
16022
  return result;
15976
16023
  } else {
15977
16024
  mapping = event.mapped;
15978
- length--;
16025
+ length2--;
15979
16026
  selections = event.selectionsAfter;
15980
16027
  }
15981
16028
  }
@@ -18244,27 +18291,351 @@ function getSpecializer(spec) {
18244
18291
  }
18245
18292
  return spec.get;
18246
18293
  }
18294
+
18295
+ // src/codemirror-basic-setup.ts
18296
+ var keyBindings = [
18297
+ ...defaultKeymap,
18298
+ ...historyKeymap
18299
+ ];
18300
+ var minimalSetup = (() => [
18301
+ highlightSpecialChars(),
18302
+ history(),
18303
+ drawSelection(),
18304
+ syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
18305
+ keymap.of(keyBindings)
18306
+ ])();
18307
+
18308
+ // src/parser-utils.ts
18309
+ var getValue = (node, state) => state.doc.sliceString(node.from, node.to);
18310
+ var getNodeByName = (node, state, nodeName = "Column") => {
18311
+ var _a2;
18312
+ if (((_a2 = node.firstChild) == null ? void 0 : _a2.name) === nodeName) {
18313
+ return getValue(node.firstChild, state);
18314
+ } else {
18315
+ let maybeColumnNode = node.prevSibling || node.parent;
18316
+ while (maybeColumnNode && maybeColumnNode.name !== nodeName) {
18317
+ maybeColumnNode = maybeColumnNode.prevSibling || maybeColumnNode.parent;
18318
+ }
18319
+ if (maybeColumnNode) {
18320
+ return getValue(maybeColumnNode, state);
18321
+ }
18322
+ }
18323
+ };
18324
+ var getPreviousNode = (node) => {
18325
+ const prevNode = node.prevSibling;
18326
+ console.log(`prevNode ${prevNode == null ? void 0 : prevNode.name}`);
18327
+ return prevNode;
18328
+ };
18329
+ var getNamedParentNode = (node) => {
18330
+ let maybeParent = node.parent;
18331
+ while (maybeParent && maybeParent.name === "\u26A0") {
18332
+ maybeParent = maybeParent.parent;
18333
+ }
18334
+ return maybeParent;
18335
+ };
18336
+ var getPreviousNamedNode = (node) => {
18337
+ let maybeParent = node.prevSibling;
18338
+ while (maybeParent && maybeParent.name === "\u26A0") {
18339
+ maybeParent = maybeParent.prevSibling;
18340
+ }
18341
+ return maybeParent;
18342
+ };
18343
+
18344
+ // ../vuu-utils/src/column-utils.ts
18345
+ var isNumericColumn = ({ serverDataType, type }) => {
18346
+ if (serverDataType === "int" || serverDataType === "long" || serverDataType === "double") {
18347
+ return true;
18348
+ }
18349
+ if (typeof type === "string") {
18350
+ return type === "number";
18351
+ }
18352
+ if (typeof (type == null ? void 0 : type.name) === "string") {
18353
+ return (type == null ? void 0 : type.name) === "number";
18354
+ }
18355
+ return false;
18356
+ };
18357
+ var metadataKeys = {
18358
+ IDX: 0,
18359
+ RENDER_IDX: 1,
18360
+ IS_LEAF: 2,
18361
+ IS_EXPANDED: 3,
18362
+ DEPTH: 4,
18363
+ COUNT: 5,
18364
+ KEY: 6,
18365
+ SELECTED: 7,
18366
+ count: 8,
18367
+ // TODO following only used in datamodel
18368
+ PARENT_IDX: "parent_idx",
18369
+ IDX_POINTER: "idx_pointer",
18370
+ FILTER_COUNT: "filter_count",
18371
+ NEXT_FILTER_IDX: "next_filter_idx"
18372
+ };
18373
+
18374
+ // ../vuu-utils/src/DataWindow.ts
18375
+ var { KEY } = metadataKeys;
18376
+
18377
+ // ../vuu-utils/src/logging-utils.ts
18378
+ var NO_OP = () => void 0;
18379
+ var DEFAULT_DEBUG_LEVEL = false ? "error" : "info";
18380
+ var { loggingLevel = DEFAULT_DEBUG_LEVEL } = typeof loggingSettings !== "undefined" ? loggingSettings : {};
18381
+ var logger = (category) => {
18382
+ const debugEnabled2 = loggingLevel === "debug";
18383
+ const infoEnabled = debugEnabled2 || loggingLevel === "info";
18384
+ const warnEnabled = infoEnabled || loggingLevel === "warn";
18385
+ const errorEnabled = warnEnabled || loggingLevel === "error";
18386
+ const info = infoEnabled ? (message) => console.info(`[${category}] ${message}`) : NO_OP;
18387
+ const warn = warnEnabled ? (message) => console.warn(`[${category}] ${message}`) : NO_OP;
18388
+ const debug2 = debugEnabled2 ? (message) => console.debug(`[${category}] ${message}`) : NO_OP;
18389
+ const error = errorEnabled ? (message) => console.error(`[${category}] ${message}`) : NO_OP;
18390
+ if (false) {
18391
+ return {
18392
+ errorEnabled,
18393
+ error
18394
+ };
18395
+ } else {
18396
+ return {
18397
+ debugEnabled: debugEnabled2,
18398
+ infoEnabled,
18399
+ warnEnabled,
18400
+ errorEnabled,
18401
+ info,
18402
+ warn,
18403
+ debug: debug2,
18404
+ error
18405
+ };
18406
+ }
18407
+ };
18408
+
18409
+ // ../vuu-utils/src/debug-utils.ts
18410
+ var { debug, debugEnabled } = logger("range-monitor");
18411
+
18412
+ // ../vuu-utils/src/event-emitter.ts
18413
+ function isArrayOfListeners(listeners) {
18414
+ return Array.isArray(listeners);
18415
+ }
18416
+ function isOnlyListener(listeners) {
18417
+ return !Array.isArray(listeners);
18418
+ }
18419
+ var _events;
18420
+ var EventEmitter = class {
18421
+ constructor() {
18422
+ __privateAdd(this, _events, /* @__PURE__ */ new Map());
18423
+ }
18424
+ addListener(event, listener) {
18425
+ const listeners = __privateGet(this, _events).get(event);
18426
+ if (!listeners) {
18427
+ __privateGet(this, _events).set(event, listener);
18428
+ } else if (isArrayOfListeners(listeners)) {
18429
+ listeners.push(listener);
18430
+ } else if (isOnlyListener(listeners)) {
18431
+ __privateGet(this, _events).set(event, [listeners, listener]);
18432
+ }
18433
+ }
18434
+ removeListener(event, listener) {
18435
+ if (!__privateGet(this, _events).has(event)) {
18436
+ return;
18437
+ }
18438
+ const listenerOrListeners = __privateGet(this, _events).get(event);
18439
+ let position = -1;
18440
+ if (listenerOrListeners === listener) {
18441
+ __privateGet(this, _events).delete(event);
18442
+ } else if (Array.isArray(listenerOrListeners)) {
18443
+ for (let i = length; i-- > 0; ) {
18444
+ if (listenerOrListeners[i] === listener) {
18445
+ position = i;
18446
+ break;
18447
+ }
18448
+ }
18449
+ if (position < 0) {
18450
+ return;
18451
+ }
18452
+ if (listenerOrListeners.length === 1) {
18453
+ listenerOrListeners.length = 0;
18454
+ __privateGet(this, _events).delete(event);
18455
+ } else {
18456
+ listenerOrListeners.splice(position, 1);
18457
+ }
18458
+ }
18459
+ }
18460
+ removeAllListeners(event) {
18461
+ if (event && __privateGet(this, _events).has(event)) {
18462
+ __privateGet(this, _events).delete(event);
18463
+ } else if (event === void 0) {
18464
+ __privateGet(this, _events).clear();
18465
+ }
18466
+ }
18467
+ emit(event, ...args) {
18468
+ if (__privateGet(this, _events)) {
18469
+ const handler = __privateGet(this, _events).get(event);
18470
+ if (handler) {
18471
+ this.invokeHandler(handler, args);
18472
+ }
18473
+ }
18474
+ }
18475
+ once(event, listener) {
18476
+ const handler = (...args) => {
18477
+ this.removeListener(event, handler);
18478
+ listener(...args);
18479
+ };
18480
+ this.on(event, handler);
18481
+ }
18482
+ on(event, listener) {
18483
+ this.addListener(event, listener);
18484
+ }
18485
+ invokeHandler(handler, args) {
18486
+ if (isArrayOfListeners(handler)) {
18487
+ handler.slice().forEach((listener) => this.invokeHandler(listener, args));
18488
+ } else {
18489
+ switch (args.length) {
18490
+ case 0:
18491
+ handler();
18492
+ break;
18493
+ case 1:
18494
+ handler(args[0]);
18495
+ break;
18496
+ case 2:
18497
+ handler(args[0], args[1]);
18498
+ break;
18499
+ default:
18500
+ handler.call(null, ...args);
18501
+ }
18502
+ }
18503
+ }
18504
+ };
18505
+ _events = new WeakMap();
18506
+
18507
+ // ../vuu-utils/src/round-decimal.ts
18508
+ var PUNCTUATION_STR = String.fromCharCode(8200);
18509
+ var DIGIT_STR = String.fromCharCode(8199);
18510
+ var Space = {
18511
+ DIGIT: DIGIT_STR,
18512
+ TWO_DIGITS: DIGIT_STR + DIGIT_STR,
18513
+ THREE_DIGITS: DIGIT_STR + DIGIT_STR + DIGIT_STR,
18514
+ FULL_PADDING: [
18515
+ null,
18516
+ PUNCTUATION_STR + DIGIT_STR,
18517
+ PUNCTUATION_STR + DIGIT_STR + DIGIT_STR,
18518
+ PUNCTUATION_STR + DIGIT_STR + DIGIT_STR + DIGIT_STR,
18519
+ PUNCTUATION_STR + DIGIT_STR + DIGIT_STR + DIGIT_STR + DIGIT_STR
18520
+ ]
18521
+ };
18522
+ var LEADING_FILL = DIGIT_STR + DIGIT_STR + DIGIT_STR + DIGIT_STR + DIGIT_STR + DIGIT_STR + DIGIT_STR + DIGIT_STR + DIGIT_STR;
18523
+
18524
+ // ../vuu-utils/src/input-utils.ts
18525
+ var actionKeys = {
18526
+ Enter: "Enter",
18527
+ Delete: "Delete"
18528
+ };
18529
+ var navigationKeys = {
18530
+ Home: "Home",
18531
+ End: "End",
18532
+ ArrowRight: "ArrowRight",
18533
+ ArrowLeft: "ArrowLeft",
18534
+ ArrowDown: "ArrowDown",
18535
+ ArrowUp: "ArrowUp",
18536
+ Tab: "Tab"
18537
+ };
18538
+ var functionKeys = {
18539
+ F1: "F1",
18540
+ F2: "F2",
18541
+ F3: "F3",
18542
+ F4: "F4",
18543
+ F5: "F5",
18544
+ F6: "F6",
18545
+ F7: "F7",
18546
+ F8: "F8",
18547
+ F9: "F9",
18548
+ F10: "F10",
18549
+ F11: "F11",
18550
+ F12: "F12"
18551
+ };
18552
+ var specialKeys = {
18553
+ ...actionKeys,
18554
+ ...navigationKeys,
18555
+ ...functionKeys
18556
+ };
18557
+
18558
+ // ../vuu-utils/src/json-utils.ts
18559
+ var { COUNT: COUNT2 } = metadataKeys;
18560
+
18561
+ // src/suggestion-utils.ts
18562
+ var NO_OPTIONS = {};
18563
+ var toSuggestions = (values, options = NO_OPTIONS) => {
18564
+ const {
18565
+ prefix = "",
18566
+ quoted = false,
18567
+ suffix = " ",
18568
+ isIllustration = false
18569
+ } = options;
18570
+ const quote = quoted ? '"' : "";
18571
+ return values.map((value) => ({
18572
+ isIllustration,
18573
+ label: value,
18574
+ apply: isIllustration ? `${quote}${prefix}${quote}` : `${prefix}${quote}${value}${quote}${suffix}`
18575
+ }));
18576
+ };
18577
+ var asNameSuggestion = { label: "as", apply: "as ", boost: 1 };
18578
+ var booleanJoinSuggestions = [
18579
+ { label: "and", apply: "and ", boost: 5 },
18580
+ { label: "or", apply: "or ", boost: 3 }
18581
+ ];
18582
+ var equalityOperators = [
18583
+ { label: "=", boost: 10, type: "operator" },
18584
+ { label: "!=", boost: 9, type: "operator" }
18585
+ ];
18586
+ var stringOperators = [
18587
+ ...equalityOperators,
18588
+ { label: "in", boost: 6, type: "operator" },
18589
+ { label: "starts", boost: 5, type: "operator" },
18590
+ { label: "ends", boost: 4, type: "operator" }
18591
+ ];
18592
+ var numericOperators = [
18593
+ ...equalityOperators,
18594
+ { label: ">", boost: 8, type: "operator" },
18595
+ { label: "<", boost: 7, type: "operator" }
18596
+ ];
18597
+ var getRelationalOperators = (column) => {
18598
+ if (column === void 0 || isNumericColumn(column)) {
18599
+ return numericOperators;
18600
+ } else {
18601
+ return equalityOperators;
18602
+ }
18603
+ };
18247
18604
  export {
18605
+ AnnotationType,
18248
18606
  EditorState,
18249
18607
  EditorView,
18250
18608
  HighlightStyle,
18251
18609
  LRLanguage,
18252
18610
  LRParser,
18253
18611
  LanguageSupport,
18612
+ asNameSuggestion,
18254
18613
  autocompletion,
18614
+ booleanJoinSuggestions,
18255
18615
  closeBrackets,
18256
18616
  defaultHighlightStyle,
18257
18617
  defaultKeymap,
18258
18618
  drawSelection,
18259
18619
  ensureSyntaxTree,
18620
+ equalityOperators,
18621
+ getNamedParentNode,
18622
+ getNodeByName,
18623
+ getPreviousNamedNode,
18624
+ getPreviousNode,
18625
+ getRelationalOperators,
18626
+ getValue,
18260
18627
  highlightSpecialChars,
18261
18628
  history,
18262
18629
  historyKeymap,
18263
18630
  keymap,
18631
+ minimalSetup,
18632
+ numericOperators,
18264
18633
  startCompletion,
18634
+ stringOperators,
18265
18635
  styleTags,
18266
18636
  syntaxHighlighting,
18267
18637
  syntaxTree,
18268
- tags
18638
+ tags,
18639
+ toSuggestions
18269
18640
  };
18270
18641
  //# sourceMappingURL=index.js.map