@bpmn-io/form-js-playground 1.14.0 → 1.15.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.
@@ -30,7 +30,7 @@
30
30
  r,
31
31
  f = {};
32
32
  for (r in u) "key" == r ? t = u[r] : "ref" == r ? o = u[r] : f[r] = u[r];
33
- if (arguments.length > 2 && (f.children = arguments.length > 3 ? n$1.call(arguments, 2) : i), "function" == typeof l && null != l.defaultProps) for (r in l.defaultProps) undefined === f[r] && (f[r] = l.defaultProps[r]);
33
+ if (arguments.length > 2 && (f.children = arguments.length > 3 ? n$1.call(arguments, 2) : i), "function" == typeof l && null != l.defaultProps) for (r in l.defaultProps) void 0 === f[r] && (f[r] = l.defaultProps[r]);
34
34
  return d$1(l, f, t, o, null);
35
35
  }
36
36
  function d$1(n, i, t, o, r) {
@@ -43,10 +43,10 @@
43
43
  __: null,
44
44
  __b: 0,
45
45
  __e: null,
46
- __d: undefined,
46
+ __d: void 0,
47
47
  __c: null,
48
48
  __h: null,
49
- constructor: undefined,
49
+ constructor: void 0,
50
50
  __v: null == r ? ++u$1 : r
51
51
  };
52
52
  return null == r && null != l$2.vnode && l$2.vnode(f), f;
@@ -77,7 +77,7 @@
77
77
  }
78
78
  function x() {
79
79
  var n, l, u, i, o, r, e, c;
80
- for (t$2.sort(f$1); n = t$2.shift();) n.__d && (l = t$2.length, i = undefined, o = undefined, e = (r = (u = n).__v).__e, (c = u.__P) && (i = [], (o = h$1({}, r)).__v = r.__v + 1, L$2(c, r, o, u.__n, undefined !== c.ownerSVGElement, null != r.__h ? [e] : null, i, null == e ? g$2(r) : e, r.__h), M$1(i, r), r.__e != e && m$1(r)), t$2.length > l && t$2.sort(f$1));
80
+ for (t$2.sort(f$1); n = t$2.shift();) n.__d && (l = t$2.length, i = void 0, o = void 0, e = (r = (u = n).__v).__e, (c = u.__P) && (i = [], (o = h$1({}, r)).__v = r.__v + 1, L$2(c, r, o, u.__n, void 0 !== c.ownerSVGElement, null != r.__h ? [e] : null, i, null == e ? g$2(r) : e, r.__h), M$1(i, r), r.__e != e && m$1(r)), t$2.length > l && t$2.sort(f$1));
81
81
  x.__r = 0;
82
82
  }
83
83
  function P$3(n, l, u, i, t, o, r, f, e, a) {
@@ -93,9 +93,9 @@
93
93
  for (u.__k = [], h = 0; h < l.length; h++) if (null != (_ = u.__k[h] = null == (_ = l[h]) || "boolean" == typeof _ || "function" == typeof _ ? null : "string" == typeof _ || "number" == typeof _ || "bigint" == typeof _ ? d$1(null, _, null, null, _) : v$2(_) ? d$1(k$2, {
94
94
  children: _
95
95
  }, null, null, null) : _.__b > 0 ? d$1(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : _)) {
96
- if (_.__ = u, _.__b = u.__b + 1, null === (y = x[h]) || y && _.key == y.key && _.type === y.type) x[h] = undefined;else for (p = 0; p < P; p++) {
96
+ if (_.__ = u, _.__b = u.__b + 1, null === (y = x[h]) || y && _.key == y.key && _.type === y.type) x[h] = void 0;else for (p = 0; p < P; p++) {
97
97
  if ((y = x[p]) && _.key == y.key && _.type === y.type) {
98
- x[p] = undefined;
98
+ x[p] = void 0;
99
99
  break;
100
100
  }
101
101
  y = null;
@@ -116,11 +116,11 @@
116
116
  }
117
117
  function $$1(n, l, u, i, t, o) {
118
118
  var r, f, e;
119
- if (undefined !== l.__d) r = l.__d, l.__d = undefined;else if (null == u || t != o || null == t.parentNode) n: if (null == o || o.parentNode !== n) n.appendChild(t), r = null;else {
119
+ if (void 0 !== l.__d) r = l.__d, l.__d = void 0;else if (null == u || t != o || null == t.parentNode) n: if (null == o || o.parentNode !== n) n.appendChild(t), r = null;else {
120
120
  for (f = o, e = 0; (f = f.nextSibling) && e < i.length; e += 1) if (f == t) break n;
121
121
  n.insertBefore(t, o), r = o;
122
122
  }
123
- return undefined !== r ? r : t.nextSibling;
123
+ return void 0 !== r ? r : t.nextSibling;
124
124
  }
125
125
  function A(n) {
126
126
  var l, u, i;
@@ -174,7 +174,7 @@
174
174
  A,
175
175
  H,
176
176
  I = u.type;
177
- if (undefined !== u.constructor) return null;
177
+ if (void 0 !== u.constructor) return null;
178
178
  null != i.__h && (c = i.__h, e = u.__e = i.__e, u.__h = null, r = [e]), (s = l$2.__b) && s(u);
179
179
  try {
180
180
  n: if ("function" == typeof I) {
@@ -236,7 +236,7 @@
236
236
  (h || a) && (h && (a && h.__html == a.__html || h.__html === l.innerHTML) || (l.innerHTML = h && h.__html || ""));
237
237
  }
238
238
  if (H$1(l, d, y, o, e), h) u.__k = [];else if (P$3(l, v$2(k = u.props.children) ? k : [k], u, i, t, o && "foreignObject" !== _, r, f, r ? r[0] : i.__k && g$2(i, 0), e), null != r) for (k = r.length; k--;) null != r[k] && p$1(r[k]);
239
- e || ("value" in d && undefined !== (k = d.value) && (k !== l.value || "progress" === _ && !k || "option" === _ && k !== y.value) && T$3(l, "value", k, y.value, false), "checked" in d && undefined !== (k = d.checked) && k !== l.checked && T$3(l, "checked", k, y.checked, false));
239
+ e || ("value" in d && void 0 !== (k = d.value) && (k !== l.value || "progress" === _ && !k || "option" === _ && k !== y.value) && T$3(l, "value", k, y.value, false), "checked" in d && void 0 !== (k = d.checked) && k !== l.checked && T$3(l, "checked", k, y.checked, false));
240
240
  }
241
241
  return l;
242
242
  }
@@ -255,17 +255,17 @@
255
255
  } catch (n) {
256
256
  l$2.__e(n, u);
257
257
  }
258
- t.base = t.__P = null, n.__c = undefined;
258
+ t.base = t.__P = null, n.__c = void 0;
259
259
  }
260
260
  if (t = n.__k) for (o = 0; o < t.length; o++) t[o] && q$2(t[o], u, i || "function" != typeof n.type);
261
- i || null == n.__e || p$1(n.__e), n.__ = n.__e = n.__d = undefined;
261
+ i || null == n.__e || p$1(n.__e), n.__ = n.__e = n.__d = void 0;
262
262
  }
263
263
  function B$2(n, l, u) {
264
264
  return this.constructor(n, u);
265
265
  }
266
266
  function D$1(u, i, t) {
267
267
  var o, r, f;
268
- l$2.__ && l$2.__(u, i), r = (o = "function" == "undefined") ? null : i.__k, f = [], L$2(i, u = (i).__k = y$1(k$2, null, [u]), r || c$1, c$1, undefined !== i.ownerSVGElement, r ? null : i.firstChild ? n$1.call(i.childNodes) : null, f, r ? r.__e : i.firstChild, o), M$1(f, u);
268
+ l$2.__ && l$2.__(u, i), r = (o = "function" == "undefined") ? null : i.__k, f = [], L$2(i, u = (i).__k = y$1(k$2, null, [u]), r || c$1, c$1, void 0 !== i.ownerSVGElement, r ? null : i.firstChild ? n$1.call(i.childNodes) : null, f, r ? r.__e : i.firstChild, o), M$1(f, u);
269
269
  }
270
270
  function G(n, l) {
271
271
  var u = {
@@ -824,7 +824,7 @@
824
824
  }
825
825
  function s$1(n, u, i) {
826
826
  var o = d(t$1++, 2);
827
- if (o.t = n, !o.__c && (o.__ = [i ? i(u) : B$1(undefined, u), function (n) {
827
+ if (o.t = n, !o.__c && (o.__ = [i ? i(u) : B$1(void 0, u), function (n) {
828
828
  var t = o.__N ? o.__N[0] : o.__[0],
829
829
  r = o.t(t, n);
830
830
  t !== r && (o.__N = [r, o.__[1]], o.__c.setState({}));
@@ -841,7 +841,7 @@
841
841
  return u.forEach(function (n) {
842
842
  if (n.__N) {
843
843
  var t = n.__[0];
844
- n.__ = n.__N, n.__N = undefined, t !== n.__[0] && (i = true);
844
+ n.__ = n.__N, n.__N = void 0, t !== n.__[0] && (i = true);
845
845
  }
846
846
  }), !(!i && o.__c.props === n) && (!c || c.call(this, n, t, r));
847
847
  };
@@ -851,7 +851,7 @@
851
851
  r.componentWillUpdate = function (n, t, r) {
852
852
  if (this.__e) {
853
853
  var u = c;
854
- c = undefined, f(n, t, r), c = u;
854
+ c = void 0, f(n, t, r), c = u;
855
855
  }
856
856
  e && e.call(this, n, t, r);
857
857
  }, r.shouldComponentUpdate = f;
@@ -900,13 +900,13 @@
900
900
  a && a(n), t$1 = 0;
901
901
  var i = (r = n.__c).__H;
902
902
  i && (u === r ? (i.__h = [], r.__h = [], i.__.forEach(function (n) {
903
- n.__N && (n.__ = n.__N), n.__V = c, n.__N = n.i = undefined;
903
+ n.__N && (n.__ = n.__N), n.__V = c, n.__N = n.i = void 0;
904
904
  })) : (i.__h.forEach(k$1), i.__h.forEach(w$1), i.__h = [], t$1 = 0)), u = r;
905
905
  }, l$2.diffed = function (t) {
906
906
  v$1 && v$1(t);
907
907
  var o = t.__c;
908
908
  o && o.__H && (o.__H.__h.length && (1 !== f.push(o) && i$1 === l$2.requestAnimationFrame || ((i$1 = l$2.requestAnimationFrame) || j$1)(b)), o.__H.__.forEach(function (n) {
909
- n.i && (n.__H = n.i), n.__V !== c && (n.__ = n.__V), n.i = undefined, n.__V = c;
909
+ n.i && (n.__H = n.i), n.__V !== c && (n.__ = n.__V), n.i = void 0, n.__V = c;
910
910
  })), u = r = null;
911
911
  }, l$2.__c = function (t, r) {
912
912
  r.some(function (t) {
@@ -930,7 +930,7 @@
930
930
  } catch (n) {
931
931
  r = n;
932
932
  }
933
- }), u.__H = undefined, r && l$2.__e(r, u.__v));
933
+ }), u.__H = void 0, r && l$2.__e(r, u.__v));
934
934
  };
935
935
  var g$1 = "function" == typeof requestAnimationFrame;
936
936
  function j$1(n) {
@@ -944,7 +944,7 @@
944
944
  function k$1(n) {
945
945
  var t = r,
946
946
  u = n.__c;
947
- "function" == typeof u && (n.__c = undefined, u()), r = t;
947
+ "function" == typeof u && (n.__c = void 0, u()), r = t;
948
948
  }
949
949
  function w$1(n) {
950
950
  var t = r;
@@ -1926,7 +1926,7 @@
1926
1926
  DIV_BY_ZERO$1 = NAME$1 + 'Division by zero',
1927
1927
  // The shared prototype object.
1928
1928
  P$2 = {},
1929
- UNDEFINED$1 = undefined,
1929
+ UNDEFINED$1 = void 0,
1930
1930
  NUMERIC$1 = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
1931
1931
 
1932
1932
  /*
@@ -2800,15 +2800,15 @@
2800
2800
  __: null,
2801
2801
  __b: 0,
2802
2802
  __e: null,
2803
- __d: undefined,
2803
+ __d: void 0,
2804
2804
  __c: null,
2805
2805
  __h: null,
2806
- constructor: undefined,
2806
+ constructor: void 0,
2807
2807
  __v: --_,
2808
2808
  __source: f,
2809
2809
  __self: l
2810
2810
  };
2811
- if ("function" == typeof o && (s = o.defaultProps)) for (u in s) undefined === a[u] && (a[u] = s[u]);
2811
+ if ("function" == typeof o && (s = o.defaultProps)) for (u in s) void 0 === a[u] && (a[u] = s[u]);
2812
2812
  return l$2.vnode && l$2.vnode(i), i;
2813
2813
  }
2814
2814
 
@@ -13516,7 +13516,7 @@
13516
13516
  };
13517
13517
 
13518
13518
  var pad = function (number, length) {
13519
- if (length === undefined) {
13519
+ if (length === void 0) {
13520
13520
  length = 2;
13521
13521
  }
13522
13522
  return ("000" + number).slice(length * -1);
@@ -13760,11 +13760,11 @@
13760
13760
 
13761
13761
  var createDateFormatter = function (_a) {
13762
13762
  var _b = _a.config,
13763
- config = _b === undefined ? defaults$2 : _b,
13763
+ config = _b === void 0 ? defaults$2 : _b,
13764
13764
  _c = _a.l10n,
13765
- l10n = _c === undefined ? english : _c,
13765
+ l10n = _c === void 0 ? english : _c,
13766
13766
  _d = _a.isMobile,
13767
- isMobile = _d === undefined ? false : _d;
13767
+ isMobile = _d === void 0 ? false : _d;
13768
13768
  return function (dateObj, frmt, overrideLocale) {
13769
13769
  var locale = overrideLocale || l10n;
13770
13770
  if (config.formatDate !== undefined && !isMobile) {
@@ -13777,9 +13777,9 @@
13777
13777
  };
13778
13778
  var createDateParser = function (_a) {
13779
13779
  var _b = _a.config,
13780
- config = _b === undefined ? defaults$2 : _b,
13780
+ config = _b === void 0 ? defaults$2 : _b,
13781
13781
  _c = _a.l10n,
13782
- l10n = _c === undefined ? english : _c;
13782
+ l10n = _c === void 0 ? english : _c;
13783
13783
  return function (date, givenFormat, timeless, customLocale) {
13784
13784
  if (date !== 0 && !date) return undefined;
13785
13785
  var locale = customLocale || l10n;
@@ -13796,7 +13796,7 @@
13796
13796
  } else if (/Z$/.test(datestr) || /GMT$/.test(datestr)) {
13797
13797
  parsedDate = new Date(date);
13798
13798
  } else {
13799
- var matched = undefined,
13799
+ var matched = void 0,
13800
13800
  ops = [];
13801
13801
  for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) {
13802
13802
  var token = format[i];
@@ -13831,7 +13831,7 @@
13831
13831
  };
13832
13832
  };
13833
13833
  function compareDates(date1, date2, timeless) {
13834
- if (timeless === undefined) {
13834
+ if (timeless === void 0) {
13835
13835
  timeless = true;
13836
13836
  }
13837
13837
  if (timeless !== false) {
@@ -13957,10 +13957,10 @@
13957
13957
  function setupHelperFunctions() {
13958
13958
  self.utils = {
13959
13959
  getDaysInMonth: function (month, yr) {
13960
- if (month === undefined) {
13960
+ if (month === void 0) {
13961
13961
  month = self.currentMonth;
13962
13962
  }
13963
- if (yr === undefined) {
13963
+ if (yr === void 0) {
13964
13964
  yr = self.currentYear;
13965
13965
  }
13966
13966
  if (month === 1 && (yr % 4 === 0 && yr % 100 !== 0 || yr % 400 === 0)) return 29;
@@ -13993,7 +13993,7 @@
13993
13993
  }
13994
13994
  function getClosestActiveElement() {
13995
13995
  var _a;
13996
- return ((_a = self.calendarContainer) === null || _a === undefined ? undefined : _a.getRootNode()).activeElement || document.activeElement;
13996
+ return ((_a = self.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode()).activeElement || document.activeElement;
13997
13997
  }
13998
13998
  function bindToInstance(fn) {
13999
13999
  return fn.bind(self);
@@ -14583,7 +14583,7 @@
14583
14583
  };
14584
14584
  }
14585
14585
  function changeMonth(value, isOffset) {
14586
- if (isOffset === undefined) {
14586
+ if (isOffset === void 0) {
14587
14587
  isOffset = true;
14588
14588
  }
14589
14589
  var delta = isOffset ? value : value - self.currentMonth;
@@ -14600,10 +14600,10 @@
14600
14600
  updateNavigationCurrentMonth();
14601
14601
  }
14602
14602
  function clear(triggerChangeEvent, toInitial) {
14603
- if (triggerChangeEvent === undefined) {
14603
+ if (triggerChangeEvent === void 0) {
14604
14604
  triggerChangeEvent = true;
14605
14605
  }
14606
- if (toInitial === undefined) {
14606
+ if (toInitial === void 0) {
14607
14607
  toInitial = true;
14608
14608
  }
14609
14609
  self.input.value = "";
@@ -14714,7 +14714,7 @@
14714
14714
  }
14715
14715
  function isEnabled(date, timeless) {
14716
14716
  var _a;
14717
- if (timeless === undefined) {
14717
+ if (timeless === void 0) {
14718
14718
  timeless = true;
14719
14719
  }
14720
14720
  var dateToCheck = self.parseDate(date, undefined, timeless);
@@ -14722,8 +14722,8 @@
14722
14722
  if (!self.config.enable && self.config.disable.length === 0) return true;
14723
14723
  if (dateToCheck === undefined) return false;
14724
14724
  var bool = !!self.config.enable,
14725
- array = (_a = self.config.enable) !== null && _a !== undefined ? _a : self.config.disable;
14726
- for (var i = 0, d = undefined; i < array.length; i++) {
14725
+ array = (_a = self.config.enable) !== null && _a !== void 0 ? _a : self.config.disable;
14726
+ for (var i = 0, d = void 0; i < array.length; i++) {
14727
14727
  d = array[i];
14728
14728
  if (typeof d === "function" && d(dateToCheck)) return bool;else if (d instanceof Date && dateToCheck !== undefined && d.getTime() === dateToCheck.getTime()) return bool;else if (typeof d === "string") {
14729
14729
  var parsed = self.parseDate(d, undefined, true);
@@ -14850,7 +14850,7 @@
14850
14850
  }
14851
14851
  }
14852
14852
  function onMouseOver(elem, cellClass) {
14853
- if (cellClass === undefined) {
14853
+ if (cellClass === void 0) {
14854
14854
  cellClass = "flatpickr-day";
14855
14855
  }
14856
14856
  if (self.selectedDates.length !== 1 || elem && (!elem.classList.contains(cellClass) || elem.classList.contains("flatpickr-disabled"))) return;
@@ -14893,7 +14893,7 @@
14893
14893
  if (self.isOpen && !self.config.static && !self.config.inline) positionCalendar();
14894
14894
  }
14895
14895
  function open(e, positionElement) {
14896
- if (positionElement === undefined) {
14896
+ if (positionElement === void 0) {
14897
14897
  positionElement = self._positionElement;
14898
14898
  }
14899
14899
  if (self.isMobile === true) {
@@ -15267,10 +15267,10 @@
15267
15267
  });
15268
15268
  }
15269
15269
  function setDate(date, triggerChange, format) {
15270
- if (triggerChange === undefined) {
15270
+ if (triggerChange === void 0) {
15271
15271
  triggerChange = false;
15272
15272
  }
15273
- if (format === undefined) {
15273
+ if (format === void 0) {
15274
15274
  format = self.config.dateFormat;
15275
15275
  }
15276
15276
  if (date !== 0 && !date || date instanceof Array && date.length === 0) return self.clear(triggerChange);
@@ -15420,7 +15420,7 @@
15420
15420
  }).join(self.config.mode !== "range" ? self.config.conjunction : self.l10n.rangeSeparator);
15421
15421
  }
15422
15422
  function updateValue(triggerChange) {
15423
- if (triggerChange === undefined) {
15423
+ if (triggerChange === void 0) {
15424
15424
  triggerChange = true;
15425
15425
  }
15426
15426
  if (self.mobileInput !== undefined && self.mobileFormatStr) {
@@ -15755,7 +15755,7 @@
15755
15755
  var i = t[o];
15756
15756
  if (!("value" === o && "defaultValue" in t && null == i || $ && "children" === o && "noscript" === e || "class" === o || "className" === o)) {
15757
15757
  var l = o.toLowerCase();
15758
- "defaultValue" === o && "value" in t && null == t.value ? o = "value" : "download" === o && true === i ? i = "" : "ondoubleclick" === l ? o = "ondblclick" : "onchange" !== l || "input" !== e && "textarea" !== e || q(t.type) ? "onfocus" === l ? o = "onfocusin" : "onblur" === l ? o = "onfocusout" : Z.test(o) ? o = l : -1 === e.indexOf("-") && H.test(o) ? o = o.replace(Y$1, "-$&").toLowerCase() : null === i && (i = undefined) : l = o = "oninput", "oninput" === l && u[o = l] && (o = "oninputCapture"), u[o] = i;
15758
+ "defaultValue" === o && "value" in t && null == t.value ? o = "value" : "download" === o && true === i ? i = "" : "ondoubleclick" === l ? o = "ondblclick" : "onchange" !== l || "input" !== e && "textarea" !== e || q(t.type) ? "onfocus" === l ? o = "onfocusin" : "onblur" === l ? o = "onfocusout" : Z.test(o) ? o = l : -1 === e.indexOf("-") && H.test(o) ? o = o.replace(Y$1, "-$&").toLowerCase() : null === i && (i = void 0) : l = o = "oninput", "oninput" === l && u[o = l] && (o = "oninputCapture"), u[o] = i;
15759
15759
  }
15760
15760
  }
15761
15761
  "select" == e && u.multiple && Array.isArray(u.value) && (u.value = S(t.children).forEach(function (n) {
@@ -15777,7 +15777,7 @@
15777
15777
  null != e && "textarea" === n.type && "value" in t && t.value !== e.value && (e.value = null == t.value ? "" : t.value);
15778
15778
  };
15779
15779
 
15780
- /*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */
15780
+ /*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
15781
15781
 
15782
15782
  const {
15783
15783
  entries,
@@ -15816,8 +15816,10 @@
15816
15816
  };
15817
15817
  }
15818
15818
  const arrayForEach = unapply(Array.prototype.forEach);
15819
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
15819
15820
  const arrayPop = unapply(Array.prototype.pop);
15820
15821
  const arrayPush = unapply(Array.prototype.push);
15822
+ const arraySplice = unapply(Array.prototype.splice);
15821
15823
  const stringToLowerCase = unapply(String.prototype.toLowerCase);
15822
15824
  const stringToString = unapply(String.prototype.toString);
15823
15825
  const stringMatch = unapply(String.prototype.match);
@@ -15971,7 +15973,7 @@
15971
15973
  // eslint-disable-next-line unicorn/better-regex
15972
15974
  const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
15973
15975
  const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
15974
- const TMPLIT_EXPR = seal(/\$\{[\w\W]*}/gm); // eslint-disable-line unicorn/better-regex
15976
+ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
15975
15977
  const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
15976
15978
  const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
15977
15979
  const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
@@ -15999,20 +16001,11 @@
15999
16001
  // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
16000
16002
  const NODE_TYPE = {
16001
16003
  element: 1,
16002
- attribute: 2,
16003
16004
  text: 3,
16004
- cdataSection: 4,
16005
- entityReference: 5,
16006
- // Deprecated
16007
- entityNode: 6,
16008
16005
  // Deprecated
16009
16006
  progressingInstruction: 7,
16010
16007
  comment: 8,
16011
- document: 9,
16012
- documentType: 10,
16013
- documentFragment: 11,
16014
- notation: 12 // Deprecated
16015
- };
16008
+ document: 9};
16016
16009
  const getGlobal = function getGlobal() {
16017
16010
  return typeof window === 'undefined' ? null : window;
16018
16011
  };
@@ -16070,9 +16063,9 @@
16070
16063
  function createDOMPurify() {
16071
16064
  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
16072
16065
  const DOMPurify = root => createDOMPurify(root);
16073
- DOMPurify.version = '3.2.3';
16066
+ DOMPurify.version = '3.2.4';
16074
16067
  DOMPurify.removed = [];
16075
- if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {
16068
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
16076
16069
  // Not running in a browser, provide a factory function
16077
16070
  // so that you can pass your own Window
16078
16071
  DOMPurify.isSupported = false;
@@ -17091,7 +17084,11 @@
17091
17084
  }
17092
17085
  arrayPush(hooks[entryPoint], hookFunction);
17093
17086
  };
17094
- DOMPurify.removeHook = function (entryPoint) {
17087
+ DOMPurify.removeHook = function (entryPoint, hookFunction) {
17088
+ if (hookFunction !== undefined) {
17089
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
17090
+ return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
17091
+ }
17095
17092
  return arrayPop(hooks[entryPoint]);
17096
17093
  };
17097
17094
  DOMPurify.removeHooks = function (entryPoint) {
@@ -27707,7 +27704,7 @@
27707
27704
  let mode = overlays ? 0 : IterMode.IgnoreOverlays;
27708
27705
  // Must go up out of overlays when those do not overlap with pos
27709
27706
  if (overlays) for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) {
27710
- if (scan instanceof TreeNode && scan.index < 0 && ((_a = parent.enter(pos, side, mode)) === null || _a === undefined ? undefined : _a.from) != scan.from) node = parent;
27707
+ if (scan instanceof TreeNode && scan.index < 0 && ((_a = parent.enter(pos, side, mode)) === null || _a === void 0 ? void 0 : _a.from) != scan.from) node = parent;
27711
27708
  }
27712
27709
  for (;;) {
27713
27710
  let inner = node.enter(pos, side, mode);
@@ -27733,7 +27730,7 @@
27733
27730
  return resolveNode(this, pos, side, true);
27734
27731
  }
27735
27732
  matchContext(context) {
27736
- return matchNodeContext(this, context);
27733
+ return matchNodeContext(this.parent, context);
27737
27734
  }
27738
27735
  enterUnfinishedNodesBefore(pos) {
27739
27736
  let scan = this.childBefore(pos),
@@ -27869,7 +27866,7 @@
27869
27866
  }
27870
27867
  }
27871
27868
  function matchNodeContext(node, context, i = context.length - 1) {
27872
- for (let p = node.parent; i >= 0; p = p.parent) {
27869
+ for (let p = node; i >= 0; p = p.parent) {
27873
27870
  if (!p) return false;
27874
27871
  if (!p.type.isAnonymous) {
27875
27872
  if (context[i] && context[i] != p.name) return false;
@@ -28239,7 +28236,7 @@
28239
28236
  return this.move(1, enter);
28240
28237
  }
28241
28238
  /**
28242
- Move to the next node in a last-to-first pre-order traveral. A
28239
+ Move to the next node in a last-to-first pre-order traversal. A
28243
28240
  node is followed by its last child or, if it has none, its
28244
28241
  previous sibling or the previous sibling of the first parent
28245
28242
  node that has one.
@@ -28309,8 +28306,8 @@
28309
28306
  for (;;) {
28310
28307
  if (mustLeave && leave) leave(this);
28311
28308
  mustLeave = this.type.isAnonymous;
28312
- if (this.nextSibling()) break;
28313
28309
  if (!depth) return;
28310
+ if (this.nextSibling()) break;
28314
28311
  this.parent();
28315
28312
  depth--;
28316
28313
  mustLeave = true;
@@ -28323,7 +28320,7 @@
28323
28320
  are treated as wildcards.
28324
28321
  */
28325
28322
  matchContext(context) {
28326
- if (!this.buffer) return matchNodeContext(this.node, context);
28323
+ if (!this.buffer) return matchNodeContext(this.node.parent, context);
28327
28324
  let {
28328
28325
  buffer
28329
28326
  } = this.buffer,
@@ -28331,7 +28328,7 @@
28331
28328
  types
28332
28329
  } = buffer.set;
28333
28330
  for (let i = context.length - 1, d = this.stack.length - 1; i >= 0; d--) {
28334
- if (d < 0) return matchNodeContext(this.node, context, i);
28331
+ if (d < 0) return matchNodeContext(this._tree, context, i);
28335
28332
  let type = types[buffer.buffer[this.stack[d]]];
28336
28333
  if (!type.isAnonymous) {
28337
28334
  if (context[i] && context[i] != type.name) return false;
@@ -28364,7 +28361,8 @@
28364
28361
  end,
28365
28362
  size
28366
28363
  } = cursor;
28367
- let lookAheadAtStart = lookAhead;
28364
+ let lookAheadAtStart = lookAhead,
28365
+ contextAtStart = contextHash;
28368
28366
  while (size < 0) {
28369
28367
  cursor.next();
28370
28368
  if (size == -1 /* SpecialRecord.Reuse */) {
@@ -28407,7 +28405,7 @@
28407
28405
  while (cursor.pos > endPos) {
28408
28406
  if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) {
28409
28407
  if (cursor.end <= lastEnd - maxBufferLength) {
28410
- makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart);
28408
+ makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart, contextAtStart);
28411
28409
  lastGroup = localChildren.length;
28412
28410
  lastEnd = cursor.end;
28413
28411
  }
@@ -28418,14 +28416,14 @@
28418
28416
  takeNode(start, endPos, localChildren, localPositions, localInRepeat, depth + 1);
28419
28417
  }
28420
28418
  }
28421
- if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length) makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart);
28419
+ if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length) makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart, contextAtStart);
28422
28420
  localChildren.reverse();
28423
28421
  localPositions.reverse();
28424
28422
  if (localInRepeat > -1 && lastGroup > 0) {
28425
- let make = makeBalanced(type);
28423
+ let make = makeBalanced(type, contextAtStart);
28426
28424
  node = balanceRange(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make);
28427
28425
  } else {
28428
- node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end);
28426
+ node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end, contextAtStart);
28429
28427
  }
28430
28428
  }
28431
28429
  children.push(node);
@@ -28467,7 +28465,7 @@
28467
28465
  positions.push(start - parentStart);
28468
28466
  }
28469
28467
  }
28470
- function makeBalanced(type) {
28468
+ function makeBalanced(type, contextHash) {
28471
28469
  return (children, positions, length) => {
28472
28470
  let lookAhead = 0,
28473
28471
  lastI = children.length - 1,
@@ -28477,20 +28475,20 @@
28477
28475
  if (!lastI && last.type == type && last.length == length) return last;
28478
28476
  if (lookAheadProp = last.prop(NodeProp.lookAhead)) lookAhead = positions[lastI] + last.length + lookAheadProp;
28479
28477
  }
28480
- return makeTree(type, children, positions, length, lookAhead);
28478
+ return makeTree(type, children, positions, length, lookAhead, contextHash);
28481
28479
  };
28482
28480
  }
28483
- function makeRepeatLeaf(children, positions, base, i, from, to, type, lookAhead) {
28481
+ function makeRepeatLeaf(children, positions, base, i, from, to, type, lookAhead, contextHash) {
28484
28482
  let localChildren = [],
28485
28483
  localPositions = [];
28486
28484
  while (children.length > i) {
28487
28485
  localChildren.push(children.pop());
28488
28486
  localPositions.push(positions.pop() + base - from);
28489
28487
  }
28490
- children.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from, lookAhead - to));
28488
+ children.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from, lookAhead - to, contextHash));
28491
28489
  positions.push(from - base);
28492
28490
  }
28493
- function makeTree(type, children, positions, length, lookAhead = 0, props) {
28491
+ function makeTree(type, children, positions, length, lookAhead, contextHash, props) {
28494
28492
  if (contextHash) {
28495
28493
  let pair = [NodeProp.contextHash, contextHash];
28496
28494
  props = props ? [pair].concat(props) : [pair];
@@ -28584,7 +28582,7 @@
28584
28582
  let children = [],
28585
28583
  positions = [];
28586
28584
  while (cursor.pos > 0) takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1, 0);
28587
- let length = (_a = data.length) !== null && _a !== undefined ? _a : children.length ? positions[0] + children[0].length : 0;
28585
+ let length = (_a = data.length) !== null && _a !== void 0 ? _a : children.length ? positions[0] + children[0].length : 0;
28588
28586
  return new Tree(types[data.topID], children.reverse(), positions.reverse(), length);
28589
28587
  }
28590
28588
  const nodeSizeCache = new WeakMap();
@@ -28937,7 +28935,13 @@
28937
28935
  }
28938
28936
  } else if (overlay && (range = overlay.predicate(cursor))) {
28939
28937
  if (range === true) range = new Range$3(cursor.from, cursor.to);
28940
- if (range.from < range.to) overlay.ranges.push(range);
28938
+ if (range.from < range.to) {
28939
+ let last = overlay.ranges.length - 1;
28940
+ if (last >= 0 && overlay.ranges[last].to == range.from) overlay.ranges[last] = {
28941
+ from: overlay.ranges[last].from,
28942
+ to: range.to
28943
+ };else overlay.ranges.push(range);
28944
+ }
28941
28945
  }
28942
28946
  if (enter && cursor.firstChild()) {
28943
28947
  if (overlay) overlay.depth++;
@@ -29057,7 +29061,7 @@
29057
29061
  this.fragI = 0;
29058
29062
  if (fragments.length) {
29059
29063
  let first = this.curFrag = fragments[0];
29060
- this.curTo = (_a = first.tree.prop(stoppedInner)) !== null && _a !== undefined ? _a : first.to;
29064
+ this.curTo = (_a = first.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : first.to;
29061
29065
  this.inner = new StructureCursor(first.tree, -first.offset);
29062
29066
  } else {
29063
29067
  this.curFrag = this.inner = null;
@@ -29074,7 +29078,7 @@
29074
29078
  this.curFrag = this.inner = null;
29075
29079
  } else {
29076
29080
  let frag = this.curFrag = this.fragments[this.fragI];
29077
- this.curTo = (_a = frag.tree.prop(stoppedInner)) !== null && _a !== undefined ? _a : frag.to;
29081
+ this.curTo = (_a = frag.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : frag.to;
29078
29082
  this.inner = new StructureCursor(frag.tree, -frag.offset);
29079
29083
  }
29080
29084
  }
@@ -29084,7 +29088,7 @@
29084
29088
  if (this.inner) {
29085
29089
  this.inner.cursor.moveTo(pos, 1);
29086
29090
  for (let pos = this.inner.cursor.node; pos; pos = pos.parent) {
29087
- let mount = (_a = pos.tree) === null || _a === undefined ? undefined : _a.prop(NodeProp.mounted);
29091
+ let mount = (_a = pos.tree) === null || _a === void 0 ? void 0 : _a.prop(NodeProp.mounted);
29088
29092
  if (mount && mount.parser == parser) {
29089
29093
  for (let i = this.fragI; i < this.fragments.length; i++) {
29090
29094
  let frag = this.fragments[i];
@@ -29339,7 +29343,7 @@
29339
29343
  // This is a kludge to try and detect overly deep left-associative
29340
29344
  // trees, which will not increase the parse stack depth and thus
29341
29345
  // won't be caught by the regular stack-depth limit check.
29342
- if (size >= 2000 /* Recover.MinBigReduction */ && !((_a = this.p.parser.nodeSet.types[type]) === null || _a === undefined ? undefined : _a.isAnonymous)) {
29346
+ if (size >= 2000 /* Recover.MinBigReduction */ && !((_a = this.p.parser.nodeSet.types[type]) === null || _a === void 0 ? void 0 : _a.isAnonymous)) {
29343
29347
  if (start == this.p.lastBigReductionStart) {
29344
29348
  this.p.bigReductionCount++;
29345
29349
  this.p.lastBigReductionSize = size;
@@ -30991,7 +30995,7 @@
30991
30995
  static define(nameOrParent, parent) {
30992
30996
  let name = typeof nameOrParent == "string" ? nameOrParent : "?";
30993
30997
  if (nameOrParent instanceof Tag) parent = nameOrParent;
30994
- if (parent === null || parent === undefined ? undefined : parent.base) throw new Error("Can not derive from a modified tag");
30998
+ if (parent === null || parent === void 0 ? void 0 : parent.base) throw new Error("Can not derive from a modified tag");
30995
30999
  let tag = new Tag(name, [], null, []);
30996
31000
  tag.set.push(tag);
30997
31001
  if (parent) for (let t of parent.set) tag.set.push(t);
@@ -33886,11 +33890,11 @@
33886
33890
  includeOffset: false
33887
33891
  });
33888
33892
  }
33889
- if ((_a = obj.zone) === null || _a === undefined ? undefined : _a.zoneName) {
33893
+ if ((_a = obj.zone) === null || _a === void 0 ? void 0 : _a.zoneName) {
33890
33894
  return obj.toISO({
33891
33895
  suppressMilliseconds: true,
33892
33896
  includeOffset: false
33893
- }) + '@' + ((_b = obj.zone) === null || _b === undefined ? undefined : _b.zoneName);
33897
+ }) + '@' + ((_b = obj.zone) === null || _b === void 0 ? void 0 : _b.zoneName);
33894
33898
  }
33895
33899
  return obj.toISO({
33896
33900
  suppressMilliseconds: true
@@ -33909,11 +33913,11 @@
33909
33913
  includeOffset: false
33910
33914
  });
33911
33915
  }
33912
- if ((_c = obj.zone) === null || _c === undefined ? undefined : _c.zoneName) {
33916
+ if ((_c = obj.zone) === null || _c === void 0 ? void 0 : _c.zoneName) {
33913
33917
  return obj.toISOTime({
33914
33918
  suppressMilliseconds: true,
33915
33919
  includeOffset: false
33916
- }) + '@' + ((_d = obj.zone) === null || _d === undefined ? undefined : _d.zoneName);
33920
+ }) + '@' + ((_d = obj.zone) === null || _d === void 0 ? void 0 : _d.zoneName);
33917
33921
  }
33918
33922
  return obj.toISOTime({
33919
33923
  suppressMilliseconds: true
@@ -35969,11 +35973,11 @@
35969
35973
  includeOffset: false
35970
35974
  });
35971
35975
  }
35972
- if ((_a = obj.zone) === null || _a === undefined ? undefined : _a.zoneName) {
35976
+ if ((_a = obj.zone) === null || _a === void 0 ? void 0 : _a.zoneName) {
35973
35977
  return obj.toISO({
35974
35978
  suppressMilliseconds: true,
35975
35979
  includeOffset: false
35976
- }) + '@' + ((_b = obj.zone) === null || _b === undefined ? undefined : _b.zoneName);
35980
+ }) + '@' + ((_b = obj.zone) === null || _b === void 0 ? void 0 : _b.zoneName);
35977
35981
  }
35978
35982
  return obj.toISO({
35979
35983
  suppressMilliseconds: true
@@ -35992,11 +35996,11 @@
35992
35996
  includeOffset: false
35993
35997
  });
35994
35998
  }
35995
- if ((_c = obj.zone) === null || _c === undefined ? undefined : _c.zoneName) {
35999
+ if ((_c = obj.zone) === null || _c === void 0 ? void 0 : _c.zoneName) {
35996
36000
  return obj.toISOTime({
35997
36001
  suppressMilliseconds: true,
35998
36002
  includeOffset: false
35999
- }) + '@' + ((_d = obj.zone) === null || _d === undefined ? undefined : _d.zoneName);
36003
+ }) + '@' + ((_d = obj.zone) === null || _d === void 0 ? void 0 : _d.zoneName);
36000
36004
  }
36001
36005
  return obj.toISOTime({
36002
36006
  suppressMilliseconds: true
@@ -38526,13 +38530,13 @@
38526
38530
  safely ignore the optional arguments in most situations.
38527
38531
  */
38528
38532
  static cursor(pos, assoc = 0, bidiLevel, goalColumn) {
38529
- return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 8 /* RangeFlag.AssocBefore */ : 16 /* RangeFlag.AssocAfter */) | (bidiLevel == null ? 7 : Math.min(6, bidiLevel)) | (goalColumn !== null && goalColumn !== undefined ? goalColumn : 16777215 /* RangeFlag.NoGoalColumn */) << 6 /* RangeFlag.GoalColumnOffset */);
38533
+ return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 8 /* RangeFlag.AssocBefore */ : 16 /* RangeFlag.AssocAfter */) | (bidiLevel == null ? 7 : Math.min(6, bidiLevel)) | (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215 /* RangeFlag.NoGoalColumn */) << 6 /* RangeFlag.GoalColumnOffset */);
38530
38534
  }
38531
38535
  /**
38532
38536
  Create a selection range.
38533
38537
  */
38534
38538
  static range(anchor, head, goalColumn, bidiLevel) {
38535
- let flags = (goalColumn !== null && goalColumn !== undefined ? goalColumn : 16777215 /* RangeFlag.NoGoalColumn */) << 6 /* RangeFlag.GoalColumnOffset */ | (bidiLevel == null ? 7 : Math.min(6, bidiLevel));
38539
+ let flags = (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215 /* RangeFlag.NoGoalColumn */) << 6 /* RangeFlag.GoalColumnOffset */ | (bidiLevel == null ? 7 : Math.min(6, bidiLevel));
38536
38540
  return head < anchor ? SelectionRange.create(head, anchor, 32 /* RangeFlag.Inverted */ | 16 /* RangeFlag.AssocAfter */ | flags) : SelectionRange.create(anchor, head, (head > anchor ? 8 /* RangeFlag.AssocBefore */ : 0) | flags);
38537
38541
  }
38538
38542
  /**
@@ -38664,7 +38668,7 @@
38664
38668
  depSel = false,
38665
38669
  depAddrs = [];
38666
38670
  for (let dep of this.dependencies) {
38667
- if (dep == "doc") depDoc = true;else if (dep == "selection") depSel = true;else if ((((_a = addresses[dep.id]) !== null && _a !== undefined ? _a : 1) & 1) == 0) depAddrs.push(addresses[dep.id]);
38671
+ if (dep == "doc") depDoc = true;else if (dep == "selection") depSel = true;else if ((((_a = addresses[dep.id]) !== null && _a !== void 0 ? _a : 1) & 1) == 0) depAddrs.push(addresses[dep.id]);
38668
38672
  }
38669
38673
  return {
38670
38674
  create(state) {
@@ -38792,7 +38796,7 @@
38792
38796
  }
38793
38797
  create(state) {
38794
38798
  let init = state.facet(initField).find(i => i.field == this);
38795
- return ((init === null || init === undefined ? undefined : init.create) || this.createF)(state);
38799
+ return ((init === null || init === void 0 ? void 0 : init.create) || this.createF)(state);
38796
38800
  }
38797
38801
  /**
38798
38802
  @internal
@@ -38812,6 +38816,13 @@
38812
38816
  return 1 /* SlotStatus.Changed */;
38813
38817
  },
38814
38818
  reconfigure: (state, oldState) => {
38819
+ let init = state.facet(initField),
38820
+ oldInit = oldState.facet(initField),
38821
+ reInit;
38822
+ if ((reInit = init.find(i => i.field == this)) && reInit != oldInit.find(i => i.field == this)) {
38823
+ state.values[idx] = reInit.create(state);
38824
+ return 1 /* SlotStatus.Changed */;
38825
+ }
38815
38826
  if (oldState.config.address[this.id] != null) {
38816
38827
  state.values[idx] = oldState.field(this);
38817
38828
  return 0;
@@ -38961,7 +38972,7 @@
38961
38972
  address[field.id] = dynamicSlots.length << 1;
38962
38973
  dynamicSlots.push(a => field.slot(a));
38963
38974
  }
38964
- let oldFacets = oldState === null || oldState === undefined ? undefined : oldState.config.facets;
38975
+ let oldFacets = oldState === null || oldState === void 0 ? void 0 : oldState.config.facets;
38965
38976
  for (let id in facets) {
38966
38977
  let providers = facets[id],
38967
38978
  facet = providers[0].facet;
@@ -39396,7 +39407,7 @@
39396
39407
  }
39397
39408
  return {
39398
39409
  changes,
39399
- selection: b.selection ? b.selection.map(mapForB) : (_a = a.selection) === null || _a === undefined ? undefined : _a.map(mapForA),
39410
+ selection: b.selection ? b.selection.map(mapForB) : (_a = a.selection) === null || _a === void 0 ? void 0 : _a.map(mapForA),
39400
39411
  effects: StateEffect.mapEffects(a.effects, mapForA).concat(StateEffect.mapEffects(b.effects, mapForB)),
39401
39412
  annotations: a.annotations.length ? a.annotations.concat(b.annotations) : b.annotations,
39402
39413
  scrollIntoView: a.scrollIntoView || b.scrollIntoView
@@ -40494,7 +40505,7 @@
40494
40505
  let shared = new Set();
40495
40506
  for (let set of b) for (let i = 0; i < set.chunk.length; i++) {
40496
40507
  let known = inA.get(set.chunk[i]);
40497
- if (known != null && (textDiff ? textDiff.mapPos(known) : known) == set.chunkPos[i] && !(textDiff === null || textDiff === undefined ? undefined : textDiff.touchesRange(known, known + set.chunk[i].length))) shared.add(set.chunk[i]);
40508
+ if (known != null && (textDiff ? textDiff.mapPos(known) : known) == set.chunkPos[i] && !(textDiff === null || textDiff === void 0 ? void 0 : textDiff.touchesRange(known, known + set.chunk[i].length))) shared.add(set.chunk[i]);
40498
40509
  }
40499
40510
  return shared;
40500
40511
  }
@@ -41246,11 +41257,11 @@
41246
41257
  moveY = 0;
41247
41258
  if (y == "nearest") {
41248
41259
  if (rect.top < bounding.top) {
41249
- moveY = -(bounding.top - rect.top + yMargin);
41250
- if (side > 0 && rect.bottom > bounding.bottom + moveY) moveY = rect.bottom - bounding.bottom + moveY + yMargin;
41260
+ moveY = rect.top - (bounding.top + yMargin);
41261
+ if (side > 0 && rect.bottom > bounding.bottom + moveY) moveY = rect.bottom - bounding.bottom + yMargin;
41251
41262
  } else if (rect.bottom > bounding.bottom) {
41252
41263
  moveY = rect.bottom - bounding.bottom + yMargin;
41253
- if (side < 0 && rect.top - moveY < bounding.top) moveY = -(bounding.top + moveY - rect.top + yMargin);
41264
+ if (side < 0 && rect.top - moveY < bounding.top) moveY = rect.top - (bounding.top + yMargin);
41254
41265
  }
41255
41266
  } else {
41256
41267
  let rectHeight = rect.bottom - rect.top,
@@ -41260,11 +41271,11 @@
41260
41271
  }
41261
41272
  if (x == "nearest") {
41262
41273
  if (rect.left < bounding.left) {
41263
- moveX = -(bounding.left - rect.left + xMargin);
41264
- if (side > 0 && rect.right > bounding.right + moveX) moveX = rect.right - bounding.right + moveX + xMargin;
41274
+ moveX = rect.left - (bounding.left + xMargin);
41275
+ if (side > 0 && rect.right > bounding.right + moveX) moveX = rect.right - bounding.right + xMargin;
41265
41276
  } else if (rect.right > bounding.right) {
41266
41277
  moveX = rect.right - bounding.right + xMargin;
41267
- if (side < 0 && rect.left < bounding.left + moveX) moveX = -(bounding.left + moveX - rect.left + xMargin);
41278
+ if (side < 0 && rect.left < bounding.left + moveX) moveX = rect.left - (bounding.left + xMargin);
41268
41279
  }
41269
41280
  } else {
41270
41281
  let targetLeft = x == "center" ? rect.left + (rect.right - rect.left) / 2 - (bounding.right - bounding.left) / 2 : x == "start" == ltr ? rect.left - xMargin : rect.right - (bounding.right - bounding.left) + xMargin;
@@ -41297,6 +41308,12 @@
41297
41308
  }
41298
41309
  }
41299
41310
  if (top) break;
41311
+ if (rect.top < bounding.top || rect.bottom > bounding.bottom || rect.left < bounding.left || rect.right > bounding.right) rect = {
41312
+ left: Math.max(rect.left, bounding.left),
41313
+ right: Math.min(rect.right, bounding.right),
41314
+ top: Math.max(rect.top, bounding.top),
41315
+ bottom: Math.min(rect.bottom, bounding.bottom)
41316
+ };
41300
41317
  cur = cur.assignedSlot || cur.parentNode;
41301
41318
  } else if (cur.nodeType == 11) {
41302
41319
  // A shadow root
@@ -41737,7 +41754,7 @@
41737
41754
  if (toI < children.length) {
41738
41755
  let after = children[toI];
41739
41756
  // Make sure the end of the child after the update is preserved in `after`
41740
- if (after && (toOff < after.length || after.breakAfter && (last === null || last === undefined ? undefined : last.breakAfter))) {
41757
+ if (after && (toOff < after.length || after.breakAfter && (last === null || last === void 0 ? void 0 : last.breakAfter))) {
41741
41758
  // If we're splitting a child, separate part of it to avoid that
41742
41759
  // being mangled when updating the child before the update.
41743
41760
  if (fromI == toI) {
@@ -41754,7 +41771,7 @@
41754
41771
  if (toOff || after.children.length && !after.children[0].length) after.merge(0, toOff, null, false, 0, openEnd);
41755
41772
  insert.push(after);
41756
41773
  }
41757
- } else if (after === null || after === undefined ? undefined : after.breakAfter) {
41774
+ } else if (after === null || after === void 0 ? void 0 : after.breakAfter) {
41758
41775
  // The element at `toI` is entirely covered by this range.
41759
41776
  // Preserve its line break, if any.
41760
41777
  if (last) last.breakAfter = 1;else breakAtStart = 1;
@@ -42470,7 +42487,7 @@
42470
42487
  }
42471
42488
  eq(other) {
42472
42489
  var _a, _b;
42473
- return this == other || other instanceof MarkDecoration && this.tagName == other.tagName && (this.class || ((_a = this.attrs) === null || _a === undefined ? undefined : _a.class)) == (other.class || ((_b = other.attrs) === null || _b === undefined ? undefined : _b.class)) && attrsEq(this.attrs, other.attrs, "class");
42490
+ return this == other || other instanceof MarkDecoration && this.tagName == other.tagName && (this.class || ((_a = this.attrs) === null || _a === void 0 ? void 0 : _a.class)) == (other.class || ((_b = other.attrs) === null || _b === void 0 ? void 0 : _b.class)) && attrsEq(this.attrs, other.attrs, "class");
42474
42491
  }
42475
42492
  range(from, to = from) {
42476
42493
  if (from >= to) throw new RangeError("Mark decorations may not be empty");
@@ -42524,8 +42541,8 @@
42524
42541
  if (start == null) start = spec.inclusive;
42525
42542
  if (end == null) end = spec.inclusive;
42526
42543
  return {
42527
- start: start !== null && start !== undefined ? start : block,
42528
- end: end !== null && end !== undefined ? end : block
42544
+ start: start !== null && start !== void 0 ? start : block,
42545
+ end: end !== null && end !== void 0 ? end : block
42529
42546
  };
42530
42547
  }
42531
42548
  function widgetsEq(a, b) {
@@ -42631,7 +42648,7 @@
42631
42648
  super.sync(view, track);
42632
42649
  let last = this.dom.lastChild;
42633
42650
  while (last && ContentView.get(last) instanceof MarkView) last = last.lastChild;
42634
- if (!last || !this.length || last.nodeName != "BR" && ((_a = ContentView.get(last)) === null || _a === undefined ? undefined : _a.isEditable) == false && (!browser.ios || !this.children.some(ch => ch instanceof TextView))) {
42651
+ if (!last || !this.length || last.nodeName != "BR" && ((_a = ContentView.get(last)) === null || _a === void 0 ? void 0 : _a.isEditable) == false && (!browser.ios || !this.children.some(ch => ch instanceof TextView))) {
42635
42652
  let hack = document.createElement("BR");
42636
42653
  hack.cmIgnore = true;
42637
42654
  this.dom.appendChild(hack);
@@ -43365,7 +43382,7 @@
43365
43382
  function moveVisually(line, order, dir, start, forward) {
43366
43383
  var _a;
43367
43384
  let startIndex = start.head - line.from;
43368
- let spanI = BidiSpan.find(order, startIndex, (_a = start.bidiLevel) !== null && _a !== undefined ? _a : -1, start.assoc);
43385
+ let spanI = BidiSpan.find(order, startIndex, (_a = start.bidiLevel) !== null && _a !== void 0 ? _a : -1, start.assoc);
43369
43386
  let span = order[spanI],
43370
43387
  spanEnd = span.side(forward, dir);
43371
43388
  // End of span
@@ -43554,7 +43571,7 @@
43554
43571
  }
43555
43572
  destroy(view) {
43556
43573
  var _a;
43557
- if ((_a = this.value) === null || _a === undefined ? undefined : _a.destroy) {
43574
+ if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.destroy) {
43558
43575
  try {
43559
43576
  this.value.destroy();
43560
43577
  } catch (e) {
@@ -43824,7 +43841,7 @@
43824
43841
  this.updateEditContextFormatting(update);
43825
43842
  let readCompositionAt = -1;
43826
43843
  if (this.view.inputState.composing >= 0 && !this.view.observer.editContext) {
43827
- if ((_a = this.domChanged) === null || _a === undefined ? undefined : _a.newSel) readCompositionAt = this.domChanged.newSel.head;else if (!touchesComposition(update.changes, this.hasComposition) && !update.selectionSet) readCompositionAt = update.state.selection.main.head;
43844
+ if ((_a = this.domChanged) === null || _a === void 0 ? void 0 : _a.newSel) readCompositionAt = this.domChanged.newSel.head;else if (!touchesComposition(update.changes, this.hasComposition) && !update.selectionSet) readCompositionAt = update.state.selection.main.head;
43828
43845
  }
43829
43846
  let composition = readCompositionAt > -1 ? findCompositionRange(this.view, update.changes, readCompositionAt) : null;
43830
43847
  this.domChanged = null;
@@ -44630,7 +44647,7 @@
44630
44647
  // using caret(Position|Range)FromPoint as a shortcut
44631
44648
  let node,
44632
44649
  offset = -1;
44633
- if (element && ((_a = view.docView.nearest(element)) === null || _a === undefined ? undefined : _a.isEditable) != false) {
44650
+ if (element && ((_a = view.docView.nearest(element)) === null || _a === void 0 ? void 0 : _a.isEditable) != false) {
44634
44651
  if (doc.caretPositionFromPoint) {
44635
44652
  let pos = doc.caretPositionFromPoint(x, y);
44636
44653
  if (pos) ({
@@ -44663,7 +44680,7 @@
44663
44680
  }
44664
44681
  let nearest = view.docView.nearest(node);
44665
44682
  if (!nearest) return null;
44666
- if (nearest.isWidget && ((_b = nearest.dom) === null || _b === undefined ? undefined : _b.nodeType) == 1) {
44683
+ if (nearest.isWidget && ((_b = nearest.dom) === null || _b === void 0 ? void 0 : _b.nodeType) == 1) {
44667
44684
  let rect = nearest.dom.getBoundingClientRect();
44668
44685
  return coords.y < rect.top || coords.y <= rect.bottom && coords.x <= (rect.left + rect.right) / 2 ? nearest.posAtStart : nearest.posAtEnd;
44669
44686
  } else {
@@ -44773,7 +44790,7 @@
44773
44790
  startY = (dir < 0 ? line.top : line.bottom) + docTop;
44774
44791
  }
44775
44792
  let resolvedGoal = rect.left + goal;
44776
- let dist = distance !== null && distance !== undefined ? distance : view.viewState.heightOracle.textHeight >> 1;
44793
+ let dist = distance !== null && distance !== void 0 ? distance : view.viewState.heightOracle.textHeight >> 1;
44777
44794
  for (let extra = 0;; extra += 10) {
44778
44795
  let curY = startY + (dist + extra) * dir;
44779
44796
  let pos = posAtCoords(view, {
@@ -45238,7 +45255,7 @@
45238
45255
  handleEvent(event) {
45239
45256
  if (!eventBelongsToEditor(this.view, event) || this.ignoreDuringComposition(event)) return;
45240
45257
  if (event.type == "keydown" && this.keydown(event)) return;
45241
- this.runHandlers(event.type, event);
45258
+ if (this.view.updateState != 0 /* UpdateState.Idle */) Promise.resolve().then(() => this.runHandlers(event.type, event));else this.runHandlers(event.type, event);
45242
45259
  }
45243
45260
  runHandlers(type, event) {
45244
45261
  let handlers = this.handlers[type];
@@ -45999,7 +46016,7 @@
45999
46016
  // In EditContext mode, we must handle insertReplacementText events
46000
46017
  // directly, to make spell checking corrections work
46001
46018
  if (event.inputType == "insertReplacementText" && view.observer.editContext) {
46002
- let text = (_a = event.dataTransfer) === null || _a === undefined ? undefined : _a.getData("text/plain"),
46019
+ let text = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData("text/plain"),
46003
46020
  ranges = event.getTargetRanges();
46004
46021
  if (text && ranges.length) {
46005
46022
  let r = ranges[0];
@@ -46024,13 +46041,13 @@
46024
46041
  if (browser.chrome && browser.android && (pending = PendingKeys.find(key => key.inputType == event.inputType))) {
46025
46042
  view.observer.delayAndroidKey(pending.key, pending.keyCode);
46026
46043
  if (pending.key == "Backspace" || pending.key == "Delete") {
46027
- let startViewHeight = ((_b = window.visualViewport) === null || _b === undefined ? undefined : _b.height) || 0;
46044
+ let startViewHeight = ((_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.height) || 0;
46028
46045
  setTimeout(() => {
46029
46046
  var _a;
46030
46047
  // Backspacing near uneditable nodes on Chrome Android sometimes
46031
46048
  // closes the virtual keyboard. This tries to crudely detect
46032
46049
  // that and refocus to get it back.
46033
- if ((((_a = window.visualViewport) === null || _a === undefined ? undefined : _a.height) || 0) > startViewHeight + 10 && view.hasFocus) {
46050
+ if ((((_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height) || 0) > startViewHeight + 10 && view.hasFocus) {
46034
46051
  view.contentDOM.blur();
46035
46052
  view.focus();
46036
46053
  }
@@ -47814,7 +47831,7 @@
47814
47831
  if (typeof ResizeObserver == "function") {
47815
47832
  this.resizeScroll = new ResizeObserver(() => {
47816
47833
  var _a;
47817
- if (((_a = this.view.docView) === null || _a === undefined ? undefined : _a.lastUpdate) < Date.now() - 75) this.onResize();
47834
+ if (((_a = this.view.docView) === null || _a === void 0 ? void 0 : _a.lastUpdate) < Date.now() - 75) this.onResize();
47818
47835
  });
47819
47836
  this.resizeScroll.observe(view.scrollDOM);
47820
47837
  }
@@ -48003,7 +48020,7 @@
48003
48020
  // this isn't coming right after another change, in which case
48004
48021
  // it is probably part of a weird chain of updates, and should
48005
48022
  // be ignored if it returns the DOM to its previous state.
48006
- force: this.lastChange < Date.now() - 50 || !!((_a = this.delayedAndroidKey) === null || _a === undefined ? undefined : _a.force)
48023
+ force: this.lastChange < Date.now() - 50 || !!((_a = this.delayedAndroidKey) === null || _a === void 0 ? void 0 : _a.force)
48007
48024
  };
48008
48025
  }
48009
48026
  clearDelayedAndroidKey() {
@@ -48144,9 +48161,9 @@
48144
48161
  destroy() {
48145
48162
  var _a, _b, _c;
48146
48163
  this.stop();
48147
- (_a = this.intersection) === null || _a === undefined ? undefined : _a.disconnect();
48148
- (_b = this.gapIntersection) === null || _b === undefined ? undefined : _b.disconnect();
48149
- (_c = this.resizeScroll) === null || _c === undefined ? undefined : _c.disconnect();
48164
+ (_a = this.intersection) === null || _a === void 0 ? void 0 : _a.disconnect();
48165
+ (_b = this.gapIntersection) === null || _b === void 0 ? void 0 : _b.disconnect();
48166
+ (_c = this.resizeScroll) === null || _c === void 0 ? void 0 : _c.disconnect();
48150
48167
  for (let dom of this.scrollTargets) dom.removeEventListener("scroll", this.onScroll);
48151
48168
  this.removeWindowListeners(this.win);
48152
48169
  clearTimeout(this.parentCheck);
@@ -48375,8 +48392,9 @@
48375
48392
  return !abort;
48376
48393
  }
48377
48394
  update(update) {
48378
- let reverted = this.pendingContextChange;
48379
- if (this.composing && (this.composing.drifted || update.transactions.some(tr => !tr.isUserEvent("input.type") && tr.changes.touchesRange(this.from, this.to)))) {
48395
+ let reverted = this.pendingContextChange,
48396
+ startSel = update.startState.selection.main;
48397
+ if (this.composing && (this.composing.drifted || !update.changes.touchesRange(startSel.from, startSel.to) && update.transactions.some(tr => !tr.isUserEvent("input.type") && tr.changes.touchesRange(this.from, this.to)))) {
48380
48398
  this.composing.drifted = true;
48381
48399
  this.composing.editorBase = update.changes.mapPos(this.composing.editorBase);
48382
48400
  } else if (!this.applyEdits(update) || !this.rangeIsValid(update.state)) {
@@ -48570,7 +48588,7 @@
48570
48588
  this.updateAttrs();
48571
48589
  this.updateState = 0 /* UpdateState.Idle */;
48572
48590
  this.requestMeasure();
48573
- if ((_a = document.fonts) === null || _a === undefined ? undefined : _a.ready) document.fonts.ready.then(() => this.requestMeasure());
48591
+ if ((_a = document.fonts) === null || _a === void 0 ? void 0 : _a.ready) document.fonts.ready.then(() => this.requestMeasure());
48574
48592
  }
48575
48593
  dispatch(...input) {
48576
48594
  let trs = input.length == 1 && input[0] instanceof Transaction ? input : input.length == 1 && Array.isArray(input[0]) ? input[0] : [this.state.update(...input)];
@@ -49196,7 +49214,7 @@
49196
49214
  // or closing, which leads us to ignore selection changes from the
49197
49215
  // context menu because it looks like the editor isn't focused.
49198
49216
  // This kludges around that.
49199
- return (this.dom.ownerDocument.hasFocus() || browser.safari && ((_a = this.inputState) === null || _a === undefined ? undefined : _a.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM;
49217
+ return (this.dom.ownerDocument.hasFocus() || browser.safari && ((_a = this.inputState) === null || _a === void 0 ? void 0 : _a.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM;
49200
49218
  }
49201
49219
  /**
49202
49220
  Put focus on the editor.
@@ -49349,7 +49367,7 @@
49349
49367
  var _a;
49350
49368
  let content = dom.querySelector(".cm-content");
49351
49369
  let cView = content && ContentView.get(content) || ContentView.get(dom);
49352
- return ((_a = cView === null || cView === undefined ? undefined : cView.rootView) === null || _a === undefined ? undefined : _a.view) || null;
49370
+ return ((_a = cView === null || cView === void 0 ? void 0 : cView.rootView) === null || _a === void 0 ? void 0 : _a.view) || null;
49353
49371
  }
49354
49372
  }
49355
49373
  /**
@@ -49667,7 +49685,7 @@
49667
49685
  let binding = scopeObj[full] || (scopeObj[full] = {
49668
49686
  preventDefault: false,
49669
49687
  stopPropagation: false,
49670
- run: ((_b = (_a = scopeObj._any) === null || _a === undefined ? undefined : _a.run) === null || _b === undefined ? undefined : _b.slice()) || []
49688
+ run: ((_b = (_a = scopeObj._any) === null || _a === void 0 ? void 0 : _a.run) === null || _b === void 0 ? void 0 : _b.slice()) || []
49671
49689
  });
49672
49690
  if (command) binding.run.push(command);
49673
49691
  if (preventDefault) binding.preventDefault = true;
@@ -49908,8 +49926,8 @@
49908
49926
  bottom = Math.max(fromCoords.bottom, toCoords.bottom, bottom);
49909
49927
  if (dir == Direction.LTR) horizontal.push(ltr && fromOpen ? leftSide : fromCoords.left, ltr && toOpen ? rightSide : toCoords.right);else horizontal.push(!ltr && toOpen ? leftSide : toCoords.left, !ltr && fromOpen ? rightSide : fromCoords.right);
49910
49928
  }
49911
- let start = from !== null && from !== undefined ? from : line.from,
49912
- end = to !== null && to !== undefined ? to : line.to;
49929
+ let start = from !== null && from !== void 0 ? from : line.from,
49930
+ end = to !== null && to !== void 0 ? to : line.to;
49913
49931
  // Split the range by visible range and document line
49914
49932
  for (let r of view.visibleRanges) if (r.to > start && r.from < end) {
49915
49933
  for (let pos = Math.max(r.from, start), endPos = Math.min(r.to, end);;) {
@@ -50149,7 +50167,7 @@
50149
50167
  let cursorPos = update.state.field(dropCursorPos);
50150
50168
  if (cursorPos == null) {
50151
50169
  if (this.cursor != null) {
50152
- (_a = this.cursor) === null || _a === undefined ? undefined : _a.remove();
50170
+ (_a = this.cursor) === null || _a === void 0 ? void 0 : _a.remove();
50153
50171
  this.cursor = null;
50154
50172
  }
50155
50173
  } else {
@@ -50382,7 +50400,7 @@
50382
50400
  var _a;
50383
50401
  if (_supportsTabSize == null && typeof document != "undefined" && document.body) {
50384
50402
  let styles = document.body.style;
50385
- _supportsTabSize = ((_a = styles.tabSize) !== null && _a !== undefined ? _a : styles.MozTabSize) != null;
50403
+ _supportsTabSize = ((_a = styles.tabSize) !== null && _a !== void 0 ? _a : styles.MozTabSize) != null;
50386
50404
  }
50387
50405
  return _supportsTabSize || false;
50388
50406
  }
@@ -50721,7 +50739,7 @@
50721
50739
  });
50722
50740
  return [plugin, EditorView.contentAttributes.of(view => {
50723
50741
  var _a;
50724
- return ((_a = view.plugin(plugin)) === null || _a === undefined ? undefined : _a.isDown) ? showCrosshair : null;
50742
+ return ((_a = view.plugin(plugin)) === null || _a === void 0 ? void 0 : _a.isDown) ? showCrosshair : null;
50725
50743
  })];
50726
50744
  }
50727
50745
  const Outside = "-10000px";
@@ -50764,7 +50782,7 @@
50764
50782
  }
50765
50783
  for (let t of this.tooltipViews) if (tooltipViews.indexOf(t) < 0) {
50766
50784
  this.removeTooltipView(t);
50767
- (_a = t.destroy) === null || _a === undefined ? undefined : _a.call(t);
50785
+ (_a = t.destroy) === null || _a === void 0 ? void 0 : _a.call(t);
50768
50786
  }
50769
50787
  if (above) {
50770
50788
  newAbove.forEach((val, i) => above[i] = val);
@@ -50783,23 +50801,21 @@
50783
50801
  return tooltipConfig.of(config);
50784
50802
  }
50785
50803
  function windowSpace(view) {
50786
- let {
50787
- win
50788
- } = view;
50804
+ let docElt = view.dom.ownerDocument.documentElement;
50789
50805
  return {
50790
50806
  top: 0,
50791
50807
  left: 0,
50792
- bottom: win.innerHeight,
50793
- right: win.innerWidth
50808
+ bottom: docElt.clientHeight,
50809
+ right: docElt.clientWidth
50794
50810
  };
50795
50811
  }
50796
50812
  const tooltipConfig = /*@__PURE__*/Facet.define({
50797
50813
  combine: values => {
50798
50814
  var _a, _b, _c;
50799
50815
  return {
50800
- position: browser.ios ? "absolute" : ((_a = values.find(conf => conf.position)) === null || _a === undefined ? undefined : _a.position) || "fixed",
50801
- parent: ((_b = values.find(conf => conf.parent)) === null || _b === undefined ? undefined : _b.parent) || null,
50802
- tooltipSpace: ((_c = values.find(conf => conf.tooltipSpace)) === null || _c === undefined ? undefined : _c.tooltipSpace) || windowSpace
50816
+ position: browser.ios ? "absolute" : ((_a = values.find(conf => conf.position)) === null || _a === void 0 ? void 0 : _a.position) || "fixed",
50817
+ parent: ((_b = values.find(conf => conf.parent)) === null || _b === void 0 ? void 0 : _b.parent) || null,
50818
+ tooltipSpace: ((_c = values.find(conf => conf.tooltipSpace)) === null || _c === void 0 ? void 0 : _c.tooltipSpace) || windowSpace
50803
50819
  };
50804
50820
  }
50805
50821
  });
@@ -50903,11 +50919,11 @@
50903
50919
  this.view.win.removeEventListener("resize", this.measureSoon);
50904
50920
  for (let tooltipView of this.manager.tooltipViews) {
50905
50921
  tooltipView.dom.remove();
50906
- (_a = tooltipView.destroy) === null || _a === undefined ? undefined : _a.call(tooltipView);
50922
+ (_a = tooltipView.destroy) === null || _a === void 0 ? void 0 : _a.call(tooltipView);
50907
50923
  }
50908
50924
  if (this.parent) this.container.remove();
50909
- (_b = this.resizeObserver) === null || _b === undefined ? undefined : _b.disconnect();
50910
- (_c = this.intersectionObserver) === null || _c === undefined ? undefined : _c.disconnect();
50925
+ (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
50926
+ (_c = this.intersectionObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
50911
50927
  clearTimeout(this.measureTimeout);
50912
50928
  }
50913
50929
  readMeasure() {
@@ -50997,7 +51013,7 @@
50997
51013
  let arrow = tooltip.arrow ? tView.dom.querySelector(".cm-tooltip-arrow") : null;
50998
51014
  let arrowHeight = arrow ? 7 /* Arrow.Size */ : 0;
50999
51015
  let width = size.right - size.left,
51000
- height = (_a = knownHeight.get(tView)) !== null && _a !== undefined ? _a : size.bottom - size.top;
51016
+ height = (_a = knownHeight.get(tView)) !== null && _a !== void 0 ? _a : size.bottom - size.top;
51001
51017
  let offset = tView.offset || noOffset,
51002
51018
  ltr = this.view.textDirection == Direction.LTR;
51003
51019
  let left = size.width > space.right - space.left ? ltr ? space.left : space.right - size.width : ltr ? Math.max(space.left, Math.min(pos.left - (arrow ? 14 /* Arrow.Offset */ : 0) + offset.x, space.right - width)) : Math.min(Math.max(space.left, pos.left - width + (arrow ? 14 /* Arrow.Offset */ : 0) - offset.x), space.right - width);
@@ -51169,7 +51185,7 @@
51169
51185
  }
51170
51186
  destroy() {
51171
51187
  var _a;
51172
- for (let t of this.manager.tooltipViews) (_a = t.destroy) === null || _a === undefined ? undefined : _a.call(t);
51188
+ for (let t of this.manager.tooltipViews) (_a = t.destroy) === null || _a === void 0 ? void 0 : _a.call(t);
51173
51189
  }
51174
51190
  passProp(name) {
51175
51191
  let value = undefined;
@@ -51201,7 +51217,7 @@
51201
51217
  pos: Math.min(...tooltips.map(t => t.pos)),
51202
51218
  end: Math.max(...tooltips.map(t => {
51203
51219
  var _a;
51204
- return (_a = t.end) !== null && _a !== undefined ? _a : t.pos;
51220
+ return (_a = t.end) !== null && _a !== void 0 ? _a : t.pos;
51205
51221
  })),
51206
51222
  create: HoverTooltipHost.create,
51207
51223
  above: tooltips[0].above,
@@ -51266,7 +51282,7 @@
51266
51282
  side = lastMove.x < posCoords.left ? -rtl : rtl;
51267
51283
  }
51268
51284
  let open = this.source(view, pos, side);
51269
- if (open === null || open === undefined ? undefined : open.then) {
51285
+ if (open === null || open === void 0 ? void 0 : open.then) {
51270
51286
  let pending = this.pending = {
51271
51287
  pos
51272
51288
  };
@@ -51306,7 +51322,7 @@
51306
51322
  let {
51307
51323
  pos
51308
51324
  } = active[0] || this.pending,
51309
- end = (_b = (_a = active[0]) === null || _a === undefined ? undefined : _a.end) !== null && _b !== undefined ? _b : pos;
51325
+ end = (_b = (_a = active[0]) === null || _a === void 0 ? void 0 : _a.end) !== null && _b !== void 0 ? _b : pos;
51310
51326
  if (pos == end ? this.view.posAtCoords(this.lastMove) != pos : !isOverRange(this.view, pos, end, event.clientX, event.clientY)) {
51311
51327
  this.view.dispatch({
51312
51328
  effects: this.setHover.of([])
@@ -52147,7 +52163,7 @@
52147
52163
  */
52148
52164
  findRegions(state) {
52149
52165
  let lang = state.facet(language$1);
52150
- if ((lang === null || lang === undefined ? undefined : lang.data) == this.data) return [{
52166
+ if ((lang === null || lang === void 0 ? void 0 : lang.data) == this.data) return [{
52151
52167
  from: 0,
52152
52168
  to: state.doc.length
52153
52169
  }];
@@ -52350,7 +52366,7 @@
52350
52366
  */
52351
52367
  work(until, upto) {
52352
52368
  if (upto != null && upto >= this.state.doc.length) upto = undefined;
52353
- if (this.tree != Tree.empty && this.isDone(upto !== null && upto !== undefined ? upto : this.state.doc.length)) {
52369
+ if (this.tree != Tree.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) {
52354
52370
  this.takeTree();
52355
52371
  return true;
52356
52372
  }
@@ -52366,10 +52382,10 @@
52366
52382
  let done = this.parse.advance();
52367
52383
  if (done) {
52368
52384
  this.fragments = this.withoutTempSkipped(TreeFragment.addTree(done, this.fragments, this.parse.stoppedAt != null));
52369
- this.treeLen = (_a = this.parse.stoppedAt) !== null && _a !== undefined ? _a : this.state.doc.length;
52385
+ this.treeLen = (_a = this.parse.stoppedAt) !== null && _a !== void 0 ? _a : this.state.doc.length;
52370
52386
  this.tree = done;
52371
52387
  this.parse = null;
52372
- if (this.treeLen < (upto !== null && upto !== undefined ? upto : this.state.doc.length)) this.parse = this.startParse();else return true;
52388
+ if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length)) this.parse = this.startParse();else return true;
52373
52389
  }
52374
52390
  if (until()) return false;
52375
52391
  }
@@ -52591,7 +52607,7 @@
52591
52607
  }, 100 /* Work.MinPause */);
52592
52608
  return () => idle < 0 ? clearTimeout(timeout) : cancelIdleCallback(idle);
52593
52609
  };
52594
- const isInputPending = typeof navigator != "undefined" && ((_a = navigator.scheduling) === null || _a === undefined ? undefined : _a.isInputPending) ? () => navigator.scheduling.isInputPending() : null;
52610
+ const isInputPending = typeof navigator != "undefined" && ((_a = navigator.scheduling) === null || _a === void 0 ? void 0 : _a.isInputPending) ? () => navigator.scheduling.isInputPending() : null;
52595
52611
  const parseWorker = /*@__PURE__*/ViewPlugin.fromClass(class ParseWorker {
52596
52612
  constructor(view) {
52597
52613
  this.view = view;
@@ -53312,7 +53328,7 @@
53312
53328
  function findFold(state, from, to) {
53313
53329
  var _a;
53314
53330
  let found = null;
53315
- (_a = state.field(foldState, false)) === null || _a === undefined ? undefined : _a.between(from, to, (from, to) => {
53331
+ (_a = state.field(foldState, false)) === null || _a === void 0 ? void 0 : _a.between(from, to, (from, to) => {
53316
53332
  if (!found || found.from > from) found = {
53317
53333
  from,
53318
53334
  to
@@ -53546,7 +53562,7 @@
53546
53562
  class: "cm-foldGutter",
53547
53563
  markers(view) {
53548
53564
  var _a;
53549
- return ((_a = view.plugin(markers)) === null || _a === undefined ? undefined : _a.markers) || RangeSet.empty;
53565
+ return ((_a = view.plugin(markers)) === null || _a === void 0 ? void 0 : _a.markers) || RangeSet.empty;
53550
53566
  },
53551
53567
  initialSpacer() {
53552
53568
  return new FoldMarker(fullConfig, false);
@@ -53663,7 +53679,7 @@
53663
53679
  if (highlighter.module) ext.push(EditorView.styleModule.of(highlighter.module));
53664
53680
  themeType = highlighter.themeType;
53665
53681
  }
53666
- if (options === null || options === undefined ? undefined : options.fallback) ext.push(fallbackHighlighter.of(highlighter));else if (themeType) ext.push(highlighterFacet.computeN([EditorView.darkTheme], state => {
53682
+ if (options === null || options === void 0 ? void 0 : options.fallback) ext.push(fallbackHighlighter.of(highlighter));else if (themeType) ext.push(highlighterFacet.computeN([EditorView.darkTheme], state => {
53667
53683
  return state.facet(EditorView.darkTheme) == (themeType == "dark") ? [highlighter] : [];
53668
53684
  }));else ext.push(highlighterFacet.of(highlighter));
53669
53685
  return ext;
@@ -53882,7 +53898,7 @@
53882
53898
  to: handle.to
53883
53899
  };
53884
53900
  let depth = 0,
53885
- cursor = parent === null || parent === undefined ? undefined : parent.cursor();
53901
+ cursor = parent === null || parent === void 0 ? void 0 : parent.cursor();
53886
53902
  if (cursor && (dir < 0 ? cursor.childBefore(token.from) : cursor.childAfter(token.to))) do {
53887
53903
  if (dir < 0 ? cursor.to <= token.from : cursor.from >= token.to) {
53888
53904
  if (depth == 0 && matching.indexOf(cursor.type.name) > -1 && cursor.from < cursor.to) {
@@ -54017,16 +54033,7 @@
54017
54033
  dir: "ltr"
54018
54034
  },
54019
54035
  bidiIsolate: Direction.LTR
54020
- }),
54021
- auto: /*@__PURE__*/Decoration.mark({
54022
- class: "cm-iso",
54023
- inclusive: true,
54024
- attributes: {
54025
- dir: "auto"
54026
- },
54027
- bidiIsolate: null
54028
- })
54029
- });
54036
+ })});
54030
54037
 
54031
54038
  /**
54032
54039
  An instance of this is passed to completion source functions.
@@ -54166,19 +54173,6 @@
54166
54173
  } : null;
54167
54174
  };
54168
54175
  }
54169
- /**
54170
- Wrap the given completion source so that it will not fire when the
54171
- cursor is in a syntax node with one of the given names.
54172
- */
54173
- function ifNotIn(nodes, source) {
54174
- return context => {
54175
- for (let pos = syntaxTree(context.state).resolveInner(context.pos, -1); pos; pos = pos.parent) {
54176
- if (nodes.indexOf(pos.name) > -1) return null;
54177
- if (pos.type.isTop) break;
54178
- }
54179
- return source(context);
54180
- };
54181
- }
54182
54176
  class Option {
54183
54177
  constructor(completion, source, match, score) {
54184
54178
  this.completion = completion;
@@ -54200,7 +54194,7 @@
54200
54194
  let addStart = start && source[0] != "^",
54201
54195
  addEnd = source[source.length - 1] != "$";
54202
54196
  if (!addStart && !addEnd) return expr;
54203
- return new RegExp(`${addStart ? "^" : ""}(?:${source})${addEnd ? "$" : ""}`, (_a = expr.flags) !== null && _a !== undefined ? _a : expr.ignoreCase ? "i" : "");
54197
+ return new RegExp(`${addStart ? "^" : ""}(?:${source})${addEnd ? "$" : ""}`, (_a = expr.flags) !== null && _a !== void 0 ? _a : expr.ignoreCase ? "i" : "");
54204
54198
  }
54205
54199
  /**
54206
54200
  This annotation is added to transactions that are produced by
@@ -54595,7 +54589,7 @@
54595
54589
  this.showOptions(options, cState.id);
54596
54590
  }
54597
54591
  this.updateSel();
54598
- if (disabled != ((_a = prevState.open) === null || _a === undefined ? undefined : _a.disabled)) this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!disabled);
54592
+ if (disabled != ((_a = prevState.open) === null || _a === void 0 ? void 0 : _a.disabled)) this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!disabled);
54599
54593
  }
54600
54594
  }
54601
54595
  updateTooltipClass(state) {
@@ -54680,12 +54674,12 @@
54680
54674
  let selRect = sel.getBoundingClientRect();
54681
54675
  let space = this.space;
54682
54676
  if (!space) {
54683
- let win = this.dom.ownerDocument.defaultView || window;
54677
+ let docElt = this.dom.ownerDocument.documentElement;
54684
54678
  space = {
54685
54679
  left: 0,
54686
54680
  top: 0,
54687
- right: win.innerWidth,
54688
- bottom: win.innerHeight
54681
+ right: docElt.clientWidth,
54682
+ bottom: docElt.clientHeight
54689
54683
  };
54690
54684
  }
54691
54685
  if (selRect.top > Math.min(space.bottom, listRect.bottom) - 10 || selRect.bottom < Math.max(space.top, listRect.top) + 10) return null;
@@ -54707,6 +54701,10 @@
54707
54701
  ul.setAttribute("role", "listbox");
54708
54702
  ul.setAttribute("aria-expanded", "true");
54709
54703
  ul.setAttribute("aria-label", this.view.state.phrase("Completions"));
54704
+ ul.addEventListener("mousedown", e => {
54705
+ // Prevent focus change when clicking the scrollbar
54706
+ if (e.target == ul) e.preventDefault();
54707
+ });
54710
54708
  let curSection = null;
54711
54709
  for (let i = range.from; i < range.to; i++) {
54712
54710
  let {
@@ -54806,7 +54804,7 @@
54806
54804
  pos = 0;
54807
54805
  let cmp = (a, b) => {
54808
54806
  var _a, _b;
54809
- return ((_a = a.rank) !== null && _a !== undefined ? _a : 1e9) - ((_b = b.rank) !== null && _b !== undefined ? _b : 1e9) || (a.name < b.name ? -1 : 1);
54807
+ return ((_a = a.rank) !== null && _a !== void 0 ? _a : 1e9) - ((_b = b.rank) !== null && _b !== void 0 ? _b : 1e9) || (a.name < b.name ? -1 : 1);
54810
54808
  };
54811
54809
  for (let s of sections.sort(cmp)) {
54812
54810
  pos -= 1e5;
@@ -54991,7 +54989,7 @@
54991
54989
  if (pos > to || !result || type & 2 /* UpdateType.Backspacing */ && (cur(tr.startState) == this.from || pos < this.limit)) return new ActiveSource(this.source, type & 4 /* UpdateType.Activate */ ? 1 /* State.Pending */ : 0 /* State.Inactive */);
54992
54990
  let limit = tr.changes.mapPos(this.limit);
54993
54991
  if (checkValid(result.validFor, tr.state, from, to)) return new ActiveResult(this.source, this.explicit, limit, result, from, to);
54994
- if (result.update && (result = result.update(result, from, to, new CompletionContext(tr.state, pos, false)))) return new ActiveResult(this.source, this.explicit, limit, result, result.from, (_a = result.to) !== null && _a !== undefined ? _a : cur(tr.state));
54992
+ if (result.update && (result = result.update(result, from, to, new CompletionContext(tr.state, pos, false)))) return new ActiveResult(this.source, this.explicit, limit, result, result.from, (_a = result.to) !== null && _a !== void 0 ? _a : cur(tr.state));
54995
54993
  return new ActiveSource(this.source, 1 /* State.Pending */, this.explicit);
54996
54994
  }
54997
54995
  map(mapping) {
@@ -55193,7 +55191,7 @@
55193
55191
  if (query.done) {
55194
55192
  let pos = cur(query.updates.length ? query.updates[0].startState : this.view.state);
55195
55193
  let limit = Math.min(pos, query.done.from + (query.active.explicit ? 0 : 1));
55196
- let active = new ActiveResult(query.active.source, query.active.explicit, limit, query.done, query.done.from, (_a = query.done.to) !== null && _a !== undefined ? _a : pos);
55194
+ let active = new ActiveResult(query.active.source, query.active.explicit, limit, query.done, query.done.from, (_a = query.done.to) !== null && _a !== void 0 ? _a : pos);
55197
55195
  // Replay the transactions that happened since the start of
55198
55196
  // the request and see if that preserves the result
55199
55197
  for (let tr of query.updates) active = active.update(tr, conf);
@@ -55749,7 +55747,7 @@
55749
55747
  function closeBrackets() {
55750
55748
  return [inputHandler, bracketState];
55751
55749
  }
55752
- const definedClosing = "()[]{}<>";
55750
+ const definedClosing = "()[]{}<>«»»«[]{}";
55753
55751
  function closing(ch) {
55754
55752
  for (let i = 0; i < definedClosing.length; i += 2) if (definedClosing.charCodeAt(i) == ch) return definedClosing.charAt(i + 1);
55755
55753
  return fromCodePoint(ch < 128 ? ch : ch + 1);
@@ -56411,9 +56409,9 @@
56411
56409
  toJSON() {
56412
56410
  var _a, _b, _c;
56413
56411
  return {
56414
- changes: (_a = this.changes) === null || _a === undefined ? undefined : _a.toJSON(),
56415
- mapped: (_b = this.mapped) === null || _b === undefined ? undefined : _b.toJSON(),
56416
- startSelection: (_c = this.startSelection) === null || _c === undefined ? undefined : _c.toJSON(),
56412
+ changes: (_a = this.changes) === null || _a === void 0 ? void 0 : _a.toJSON(),
56413
+ mapped: (_b = this.mapped) === null || _b === void 0 ? void 0 : _b.toJSON(),
56414
+ startSelection: (_c = this.startSelection) === null || _c === void 0 ? void 0 : _c.toJSON(),
56417
56415
  selectionsAfter: this.selectionsAfter.map(s => s.toJSON())
56418
56416
  };
56419
56417
  }
@@ -56714,8 +56712,8 @@
56714
56712
  if (selfScroll) {
56715
56713
  for (let source of view.state.facet(EditorView.scrollMargins)) {
56716
56714
  let margins = source(view);
56717
- if (margins === null || margins === undefined ? undefined : margins.top) marginTop = Math.max(margins === null || margins === undefined ? undefined : margins.top, marginTop);
56718
- if (margins === null || margins === undefined ? undefined : margins.bottom) marginBottom = Math.max(margins === null || margins === undefined ? undefined : margins.bottom, marginBottom);
56715
+ if (margins === null || margins === void 0 ? void 0 : margins.top) marginTop = Math.max(margins === null || margins === void 0 ? void 0 : margins.top, marginTop);
56716
+ if (margins === null || margins === void 0 ? void 0 : margins.bottom) marginBottom = Math.max(margins === null || margins === void 0 ? void 0 : margins.bottom, marginBottom);
56719
56717
  }
56720
56718
  height = view.scrollDOM.clientHeight - marginTop - marginBottom;
56721
56719
  } else {
@@ -58233,7 +58231,7 @@
58233
58231
  class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity
58234
58232
  }, crelt("span", {
58235
58233
  class: "cm-diagnosticText"
58236
- }, diagnostic.renderMessage ? diagnostic.renderMessage(view) : diagnostic.message), (_a = diagnostic.actions) === null || _a === undefined ? undefined : _a.map((action, i) => {
58234
+ }, diagnostic.renderMessage ? diagnostic.renderMessage(view) : diagnostic.message), (_a = diagnostic.actions) === null || _a === void 0 ? void 0 : _a.map((action, i) => {
58237
58235
  let fired = false,
58238
58236
  click = e => {
58239
58237
  e.preventDefault();
@@ -59509,7 +59507,7 @@
59509
59507
  }
59510
59508
  /// @internal
59511
59509
  addNode(block, from, to) {
59512
- if (typeof block == "number") block = new Tree(this.parser.nodeSet.types[block], none, none, (to !== null && to !== undefined ? to : this.prevLineEnd()) - from);
59510
+ if (typeof block == "number") block = new Tree(this.parser.nodeSet.types[block], none, none, (to !== null && to !== void 0 ? to : this.prevLineEnd()) - from);
59513
59511
  this.block.addChild(block, from - this.block.from);
59514
59512
  }
59515
59513
  /// Add a block element. Can be called by [block
@@ -60340,190 +60338,6 @@
60340
60338
  });
60341
60339
  /// The default CommonMark parser.
60342
60340
  const parser$2 = new MarkdownParser(new NodeSet(nodeTypes).extend(markdownHighlighting), Object.keys(DefaultBlockParsers).map(n => DefaultBlockParsers[n]), Object.keys(DefaultBlockParsers).map(n => DefaultLeafBlocks[n]), Object.keys(DefaultBlockParsers), DefaultEndLeaf, DefaultSkipMarkup, Object.keys(DefaultInline).map(n => DefaultInline[n]), Object.keys(DefaultInline), []);
60343
- const StrikethroughDelim = {
60344
- resolve: "Strikethrough",
60345
- mark: "StrikethroughMark"
60346
- };
60347
- /// An extension that implements
60348
- /// [GFM-style](https://github.github.com/gfm/#strikethrough-extension-)
60349
- /// Strikethrough syntax using `~~` delimiters.
60350
- ({
60351
- defineNodes: [{
60352
- name: "Strikethrough",
60353
- style: {
60354
- "Strikethrough/...": tags.strikethrough
60355
- }
60356
- }, {
60357
- name: "StrikethroughMark",
60358
- style: tags.processingInstruction
60359
- }],
60360
- parseInline: [{
60361
- name: "Strikethrough",
60362
- parse(cx, next, pos) {
60363
- if (next != 126 /* '~' */ || cx.char(pos + 1) != 126 || cx.char(pos + 2) == 126) return -1;
60364
- let before = cx.slice(pos - 1, pos),
60365
- after = cx.slice(pos + 2, pos + 3);
60366
- let sBefore = /\s|^$/.test(before),
60367
- sAfter = /\s|^$/.test(after);
60368
- let pBefore = Punctuation.test(before),
60369
- pAfter = Punctuation.test(after);
60370
- return cx.addDelimiter(StrikethroughDelim, pos, pos + 2, !sAfter && (!pAfter || sBefore || pBefore), !sBefore && (!pBefore || sAfter || pAfter));
60371
- },
60372
- after: "Emphasis"
60373
- }]
60374
- });
60375
- function parseRow(cx, line, startI = 0, elts, offset = 0) {
60376
- let count = 0,
60377
- first = true,
60378
- cellStart = -1,
60379
- cellEnd = -1,
60380
- esc = false;
60381
- let parseCell = () => {
60382
- elts.push(cx.elt("TableCell", offset + cellStart, offset + cellEnd, cx.parser.parseInline(line.slice(cellStart, cellEnd), offset + cellStart)));
60383
- };
60384
- for (let i = startI; i < line.length; i++) {
60385
- let next = line.charCodeAt(i);
60386
- if (next == 124 /* '|' */ && !esc) {
60387
- if (!first || cellStart > -1) count++;
60388
- first = false;
60389
- if (elts) {
60390
- if (cellStart > -1) parseCell();
60391
- elts.push(cx.elt("TableDelimiter", i + offset, i + offset + 1));
60392
- }
60393
- cellStart = cellEnd = -1;
60394
- } else if (esc || next != 32 && next != 9) {
60395
- if (cellStart < 0) cellStart = i;
60396
- cellEnd = i + 1;
60397
- }
60398
- esc = !esc && next == 92;
60399
- }
60400
- if (cellStart > -1) {
60401
- count++;
60402
- if (elts) parseCell();
60403
- }
60404
- return count;
60405
- }
60406
- function hasPipe(str, start) {
60407
- for (let i = start; i < str.length; i++) {
60408
- let next = str.charCodeAt(i);
60409
- if (next == 124 /* '|' */) return true;
60410
- if (next == 92 /* '\\' */) i++;
60411
- }
60412
- return false;
60413
- }
60414
- const delimiterLine = /^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;
60415
- class TableParser {
60416
- constructor() {
60417
- // Null means we haven't seen the second line yet, false means this
60418
- // isn't a table, and an array means this is a table and we've
60419
- // parsed the given rows so far.
60420
- this.rows = null;
60421
- }
60422
- nextLine(cx, line, leaf) {
60423
- if (this.rows == null) {
60424
- // Second line
60425
- this.rows = false;
60426
- let lineText;
60427
- if ((line.next == 45 || line.next == 58 || line.next == 124 /* '-:|' */) && delimiterLine.test(lineText = line.text.slice(line.pos))) {
60428
- let firstRow = [],
60429
- firstCount = parseRow(cx, leaf.content, 0, firstRow, leaf.start);
60430
- if (firstCount == parseRow(cx, lineText, line.pos)) this.rows = [cx.elt("TableHeader", leaf.start, leaf.start + leaf.content.length, firstRow), cx.elt("TableDelimiter", cx.lineStart + line.pos, cx.lineStart + line.text.length)];
60431
- }
60432
- } else if (this.rows) {
60433
- // Line after the second
60434
- let content = [];
60435
- parseRow(cx, line.text, line.pos, content, cx.lineStart);
60436
- this.rows.push(cx.elt("TableRow", cx.lineStart + line.pos, cx.lineStart + line.text.length, content));
60437
- }
60438
- return false;
60439
- }
60440
- finish(cx, leaf) {
60441
- if (!this.rows) return false;
60442
- cx.addLeafElement(leaf, cx.elt("Table", leaf.start, leaf.start + leaf.content.length, this.rows));
60443
- return true;
60444
- }
60445
- }
60446
- /// This extension provides
60447
- /// [GFM-style](https://github.github.com/gfm/#tables-extension-)
60448
- /// tables, using syntax like this:
60449
- ///
60450
- /// ```
60451
- /// | head 1 | head 2 |
60452
- /// | --- | --- |
60453
- /// | cell 1 | cell 2 |
60454
- /// ```
60455
- ({
60456
- defineNodes: [{
60457
- name: "Table",
60458
- block: true
60459
- }, {
60460
- name: "TableHeader",
60461
- style: {
60462
- "TableHeader/...": tags.heading
60463
- }
60464
- }, "TableRow", {
60465
- name: "TableCell",
60466
- style: tags.content
60467
- }, {
60468
- name: "TableDelimiter",
60469
- style: tags.processingInstruction
60470
- }],
60471
- parseBlock: [{
60472
- name: "Table",
60473
- leaf(_, leaf) {
60474
- return hasPipe(leaf.content, 0) ? new TableParser() : null;
60475
- },
60476
- endLeaf(cx, line, leaf) {
60477
- if (leaf.parsers.some(p => p instanceof TableParser) || !hasPipe(line.text, line.basePos)) return false;
60478
- let next = cx.scanLine(cx.absoluteLineEnd + 1).text;
60479
- return delimiterLine.test(next) && parseRow(cx, line.text, line.basePos) == parseRow(cx, next, line.basePos);
60480
- },
60481
- before: "SetextHeading"
60482
- }]
60483
- });
60484
- class TaskParser {
60485
- nextLine() {
60486
- return false;
60487
- }
60488
- finish(cx, leaf) {
60489
- cx.addLeafElement(leaf, cx.elt("Task", leaf.start, leaf.start + leaf.content.length, [cx.elt("TaskMarker", leaf.start, leaf.start + 3), ...cx.parser.parseInline(leaf.content.slice(3), leaf.start + 3)]));
60490
- return true;
60491
- }
60492
- }
60493
- /// Extension providing
60494
- /// [GFM-style](https://github.github.com/gfm/#task-list-items-extension-)
60495
- /// task list items, where list items can be prefixed with `[ ]` or
60496
- /// `[x]` to add a checkbox.
60497
- ({
60498
- defineNodes: [{
60499
- name: "Task",
60500
- block: true,
60501
- style: tags.list
60502
- }, {
60503
- name: "TaskMarker",
60504
- style: tags.atom
60505
- }],
60506
- parseBlock: [{
60507
- name: "TaskList",
60508
- leaf(cx, leaf) {
60509
- return /^\[[ xX]\][ \t]/.test(leaf.content) && cx.parentType().name == "ListItem" ? new TaskParser() : null;
60510
- },
60511
- after: "SetextHeading"
60512
- }]
60513
- });
60514
- function parseSubSuper(ch, node, mark) {
60515
- return (cx, next, pos) => {
60516
- if (next != ch || cx.char(pos + 1) == ch) return -1;
60517
- let elts = [cx.elt(mark, pos, pos + 1)];
60518
- for (let i = pos + 1; i < cx.end; i++) {
60519
- let next = cx.char(i);
60520
- if (next == ch) return cx.addElement(cx.elt(node, pos, i + 1, elts.concat(cx.elt(mark, i, i + 1))));
60521
- if (next == 92 /* '\\' */) elts.push(cx.elt("Escape", i, i++ + 2));
60522
- if (space(next)) break;
60523
- }
60524
- return -1;
60525
- };
60526
- }
60527
60341
  /// Extension providing
60528
60342
  /// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)
60529
60343
  /// superscript using `^` markers.
@@ -60534,12 +60348,7 @@
60534
60348
  }, {
60535
60349
  name: "SuperscriptMark",
60536
60350
  style: tags.processingInstruction
60537
- }],
60538
- parseInline: [{
60539
- name: "Superscript",
60540
- parse: parseSubSuper(94 /* '^' */, "Superscript", "SuperscriptMark")
60541
- }]
60542
- });
60351
+ }]});
60543
60352
  /// Extension providing
60544
60353
  /// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)
60545
60354
  /// subscript using `~` markers.
@@ -60550,28 +60359,7 @@
60550
60359
  }, {
60551
60360
  name: "SubscriptMark",
60552
60361
  style: tags.processingInstruction
60553
- }],
60554
- parseInline: [{
60555
- name: "Subscript",
60556
- parse: parseSubSuper(126 /* '~' */, "Subscript", "SubscriptMark")
60557
- }]
60558
- });
60559
- /// Extension that parses two colons with only letters, underscores,
60560
- /// and numbers between them as `Emoji` nodes.
60561
- ({
60562
- defineNodes: [{
60563
- name: "Emoji",
60564
- style: tags.character
60565
- }],
60566
- parseInline: [{
60567
- name: "Emoji",
60568
- parse(cx, next, pos) {
60569
- let match;
60570
- if (next != 58 /* ':' */ || !(match = /^[a-zA-Z_0-9]+:/.exec(cx.slice(pos + 1, cx.end)))) return -1;
60571
- return cx.addElement(cx.elt("Emoji", pos, pos + 1 + match[0].length));
60572
- }
60573
- }]
60574
- });
60362
+ }]});
60575
60363
 
60576
60364
  /**
60577
60365
  * @typedef {import('@lezer/common').Tree} Tree
@@ -60646,7 +60434,7 @@
60646
60434
  from,
60647
60435
  to,
60648
60436
  message: 'First item is accessed via [1]',
60649
- severity: 'error',
60437
+ severity: 'warning',
60650
60438
  type: RULE_NAME,
60651
60439
  actions: [{
60652
60440
  name: 'fix',
@@ -60793,7 +60581,6 @@
60793
60581
  darkGrey: '#2f3d58',
60794
60582
  grey: '#404a5c',
60795
60583
  midGrey: '#576071',
60796
- lightGrey: '#c5d1e5',
60797
60584
  offWhite: '#d9e0f5',
60798
60585
  snowWhite: '#eaf1ff',
60799
60586
  white: '#ffffff',
@@ -61705,7 +61492,7 @@
61705
61492
  };
61706
61493
 
61707
61494
  /**
61708
- * marked v15.0.6 - a markdown parser
61495
+ * marked v15.0.7 - a markdown parser
61709
61496
  * Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
61710
61497
  * https://github.com/markedjs/marked
61711
61498
  */
@@ -61821,12 +61608,22 @@
61821
61608
  const hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
61822
61609
  const heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
61823
61610
  const bullet = /(?:[*+-]|\d{1,9}[.)])/;
61824
- const lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, bullet) // lists can interrupt
61611
+ const lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
61612
+ const lheading = edit(lheadingCore).replace(/bull/g, bullet) // lists can interrupt
61825
61613
  .replace(/blockCode/g, /(?: {4}| {0,3}\t)/) // indented code blocks can interrupt
61826
61614
  .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt
61827
61615
  .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt
61828
61616
  .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt
61829
61617
  .replace(/html/g, / {0,3}<[^\n>]+>\n/) // block html can interrupt
61618
+ .replace(/\|table/g, '') // table not in commonmark
61619
+ .getRegex();
61620
+ const lheadingGfm = edit(lheadingCore).replace(/bull/g, bullet) // lists can interrupt
61621
+ .replace(/blockCode/g, /(?: {4}| {0,3}\t)/) // indented code blocks can interrupt
61622
+ .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt
61623
+ .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt
61624
+ .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt
61625
+ .replace(/html/g, / {0,3}<[^\n>]+>\n/) // block html can interrupt
61626
+ .replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/) // table can interrupt
61830
61627
  .getRegex();
61831
61628
  const _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
61832
61629
  const blockText = /^[^\n]+/;
@@ -61879,6 +61676,7 @@
61879
61676
  .getRegex();
61880
61677
  const blockGfm = {
61881
61678
  ...blockNormal,
61679
+ lheading: lheadingGfm,
61882
61680
  table: gfmTable,
61883
61681
  paragraph: edit(_paragraph).replace('hr', hr).replace('heading', ' {0,3}#{1,6}(?:\\s|$)').replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs
61884
61682
  .replace('table', gfmTable) // interrupt paragraphs with table
@@ -65051,7 +64849,6 @@
65051
64849
  * @enum { String }
65052
64850
  */
65053
64851
  const LOAD_STATES = {
65054
- LOADING: 'loading',
65055
64852
  LOADED: 'loaded',
65056
64853
  ERROR: 'error'
65057
64854
  };
@@ -65261,6 +65058,8 @@
65261
65058
  const overflowY = style.overflowY || style.overflow;
65262
65059
  return (overflowY === 'auto' || overflowY === 'scroll') && el.scrollHeight > el.clientHeight;
65263
65060
  }
65061
+ const EMPTY_OBJECT = {};
65062
+ const EMPTY_ARRAY$2 = [];
65264
65063
 
65265
65064
  /**
65266
65065
  * Custom hook to scroll an element within a scrollable container.
@@ -65275,8 +65074,8 @@
65275
65074
  * @param {Array} [flagRefs] - An array of refs that are used as flags to control when to scroll.
65276
65075
  */
65277
65076
  function useScrollIntoView(scrolledElementRef, deps, scrollOptions, flagRefs) {
65278
- const _scrollOptions = scrollOptions;
65279
- const _flagRefs = flagRefs;
65077
+ const _scrollOptions = scrollOptions || EMPTY_OBJECT;
65078
+ const _flagRefs = flagRefs || EMPTY_ARRAY$2;
65280
65079
  p(() => {
65281
65080
  // return early if flags are not raised, or component is not mounted
65282
65081
  if (some(_flagRefs, ref => !ref.current) || !scrolledElementRef.current) {
@@ -70231,10 +70030,15 @@
70231
70030
  };
70232
70031
  const type$k = 'documentPreview';
70233
70032
 
70033
+ /**
70034
+ * @typedef DocumentEndpointBuilder
70035
+ * @property {(document: DocumentMetadata) => string} buildUrl
70036
+ */
70037
+
70234
70038
  /**
70235
70039
  * @typedef DocumentMetadata
70236
70040
  * @property {string} documentId
70237
- * @property {string} contentHash
70041
+ * @property {string} endpoint
70238
70042
  * @property {Object} metadata
70239
70043
  * @property {string|undefined} [metadata.contentType]
70240
70044
  * @property {string} metadata.fileName
@@ -70243,7 +70047,6 @@
70243
70047
  * @property {string} id
70244
70048
  * @property {string} [title]
70245
70049
  * @property {string} [dataSource]
70246
- * @property {string} [endpointKey]
70247
70050
  * @property {number} [maxHeight]
70248
70051
  * @property {string} [label]
70249
70052
  *
@@ -70255,18 +70058,18 @@
70255
70058
  * @returns {import("preact").JSX.Element}
70256
70059
  */
70257
70060
  function DocumentPreview(props) {
70061
+ /** @type {DocumentEndpointBuilder | null} */
70062
+ const documentEndpointBuilder = useService$2('documentEndpointBuilder', false);
70258
70063
  const {
70259
70064
  field,
70260
70065
  domId
70261
70066
  } = props;
70262
70067
  const {
70263
70068
  dataSource,
70264
- endpointKey,
70265
70069
  maxHeight,
70266
70070
  label
70267
70071
  } = field;
70268
70072
  const errorMessageId = `${domId}-error-message`;
70269
- const endpoint = useExpressionEvaluation(endpointKey || '');
70270
70073
  const data = useValidDocumentData(dataSource || '');
70271
70074
  const evaluatedLabel = useSingleLineTemplateEvaluation(label, {
70272
70075
  debug: true
@@ -70279,18 +70082,19 @@
70279
70082
  }), o("div", {
70280
70083
  class: `fjs-${type$k}-document-container`,
70281
70084
  id: domId,
70282
- children: isValidDocumentEndpoint(endpoint) ? data.map((document, index) => o(DocumentRenderer, {
70283
- documentMetadata: document,
70284
- endpoint: endpoint,
70285
- maxHeight: maxHeight,
70286
- domId: `${domId}-${index}`
70287
- }, document.documentId)) : null
70085
+ children: data.map((document, index) => {
70086
+ const finalEndpoint = tryCatch(() => documentEndpointBuilder?.buildUrl(document)) ?? document.endpoint;
70087
+ return isValidDocumentEndpoint(finalEndpoint) ? o(DocumentRenderer, {
70088
+ documentMetadata: document,
70089
+ endpoint: finalEndpoint,
70090
+ maxHeight: maxHeight,
70091
+ domId: `${domId}-${index}`
70092
+ }, document.documentId) : null;
70093
+ })
70288
70094
  }), o(Errors, {
70289
70095
  id: errorMessageId,
70290
70096
  errors: getErrors({
70291
- dataSource,
70292
- endpoint,
70293
- endpointKey
70097
+ dataSource
70294
70098
  })
70295
70099
  })]
70296
70100
  });
@@ -70302,43 +70106,27 @@
70302
70106
  name: 'Document preview',
70303
70107
  create: (options = {}) => ({
70304
70108
  label: 'Document preview',
70305
- endpointKey: DEFAULT_ENDPOINT_KEY,
70306
70109
  ...options
70307
70110
  })
70308
70111
  };
70309
70112
 
70310
70113
  // helpers /////////////////////////////
70311
70114
 
70312
- const DOCUMENT_ID_PLACEHOLDER = '{documentId}';
70313
- const DEFAULT_ENDPOINT_KEY = '=defaultDocumentsEndpointKey';
70314
-
70315
70115
  /**
70316
70116
  * @typedef GetErrorOptions
70317
70117
  * @property {string|undefined} dataSource
70318
- * @property {string|undefined} endpointKey
70319
- * @property {string|null} endpoint
70320
70118
  *
70321
70119
  * @param {GetErrorOptions} options
70322
70120
  * @returns {string[]}
70323
70121
  */
70324
70122
  function getErrors(options) {
70325
70123
  const {
70326
- dataSource,
70327
- endpointKey,
70328
- endpoint
70124
+ dataSource
70329
70125
  } = options;
70330
70126
  let errors = [];
70331
70127
  if (!isString$3(dataSource) || dataSource.length < 1) {
70332
70128
  errors.push('Document reference is not defined.');
70333
70129
  }
70334
- if (!isString$3(endpointKey) || endpointKey.length < 1) {
70335
- errors.push('Endpoint key is not defined.');
70336
- }
70337
- if (endpointKey !== DEFAULT_ENDPOINT_KEY && !URL.canParse(endpoint)) {
70338
- errors.push(`If you change the endpoint key from "${DEFAULT_ENDPOINT_KEY}", the document preview won't work with Camunda Tasklist and you must provide a valid URL.`);
70339
- } else if (endpointKey !== DEFAULT_ENDPOINT_KEY && !isValidDocumentEndpoint(endpoint)) {
70340
- errors.push('Endpoint must contain "{documentId}".');
70341
- }
70342
70130
  return errors;
70343
70131
  }
70344
70132
 
@@ -70348,7 +70136,7 @@
70348
70136
  * @returns boolean
70349
70137
  */
70350
70138
  function isValidDocumentEndpoint(endpoint) {
70351
- return typeof endpoint === 'string' && URL.canParse(endpoint) && endpoint.includes(DOCUMENT_ID_PLACEHOLDER);
70139
+ return typeof endpoint === 'string' && URL.canParse(endpoint);
70352
70140
  }
70353
70141
 
70354
70142
  /**
@@ -70371,6 +70159,61 @@
70371
70159
  return data.filter(isValidDocument);
70372
70160
  }
70373
70161
 
70162
+ /**
70163
+ * @param {Object} props
70164
+ * @param {string} props.url
70165
+ * @param {string} props.fileName
70166
+ * @param {Function} props.onError
70167
+ * @param {string} props.errorMessageId
70168
+ * @returns {import("preact").JSX.Element}
70169
+ */
70170
+ function PdfRenderer(props) {
70171
+ const {
70172
+ url,
70173
+ onError,
70174
+ errorMessageId
70175
+ } = props;
70176
+ /** @type {ReturnType<typeof import("preact/hooks").useState<null | string>>} */
70177
+ const [pdfObjectUrl, setPdfObjectUrl] = h(null);
70178
+ const [hasError, setHasError] = h(false);
70179
+ p(() => {
70180
+ /** @type {null | string} */
70181
+ let objectUrl = null;
70182
+ const fetchPdf = async () => {
70183
+ try {
70184
+ const response = await fetch(url);
70185
+ if (!response.ok) {
70186
+ setHasError(true);
70187
+ onError();
70188
+ return;
70189
+ }
70190
+ const blob = await response.blob();
70191
+ objectUrl = URL.createObjectURL(blob);
70192
+ setPdfObjectUrl(objectUrl);
70193
+ } catch {
70194
+ setHasError(true);
70195
+ onError();
70196
+ }
70197
+ };
70198
+ fetchPdf();
70199
+ return () => {
70200
+ if (objectUrl) {
70201
+ URL.revokeObjectURL(objectUrl);
70202
+ }
70203
+ };
70204
+ }, [url, onError]);
70205
+ return o(k$2, {
70206
+ children: [pdfObjectUrl !== null ? o("embed", {
70207
+ src: pdfObjectUrl,
70208
+ type: "application/pdf",
70209
+ class: `fjs-${type$k}-pdf-viewer`
70210
+ }) : null, hasError ? o(Errors, {
70211
+ id: errorMessageId,
70212
+ errors: ['Unable to download document']
70213
+ }) : null]
70214
+ });
70215
+ }
70216
+
70374
70217
  /**
70375
70218
  *
70376
70219
  * @param {Object} props
@@ -70394,11 +70237,6 @@
70394
70237
  const [hasError, setHasError] = h(false);
70395
70238
  const ref = _$1(null);
70396
70239
  const isInViewport = useInViewport(ref);
70397
- const fullUrl = buildUrl({
70398
- baseUrl: endpoint,
70399
- documentId: documentMetadata.documentId,
70400
- contentHash: documentMetadata.contentHash
70401
- });
70402
70240
  const singleDocumentContainerClassName = `fjs-${type$k}-single-document-container`;
70403
70241
  const errorMessageId = `${domId}-error-message`;
70404
70242
  const errorMessage = 'Unable to download document';
@@ -70411,11 +70249,11 @@
70411
70249
  },
70412
70250
  "aria-describedby": hasError ? errorMessageId : undefined,
70413
70251
  children: [o("img", {
70414
- src: fullUrl,
70252
+ src: endpoint,
70415
70253
  alt: metadata.fileName,
70416
70254
  class: `fjs-${type$k}-image`
70417
70255
  }), o(DownloadButton, {
70418
- endpoint: fullUrl,
70256
+ endpoint: endpoint,
70419
70257
  fileName: metadata.fileName,
70420
70258
  onDownloadError: () => {
70421
70259
  setHasError(true);
@@ -70433,14 +70271,12 @@
70433
70271
  maxHeight
70434
70272
  },
70435
70273
  "aria-describedby": hasError ? errorMessageId : undefined,
70436
- children: [o("embed", {
70437
- src: fullUrl,
70438
- type: "application/pdf",
70439
- class: `fjs-${type$k}-pdf-viewer`
70440
- }), hasError ? o(Errors, {
70441
- id: errorMessageId,
70442
- errors: [errorMessage]
70443
- }) : null]
70274
+ children: o(PdfRenderer, {
70275
+ url: endpoint,
70276
+ fileName: metadata.fileName,
70277
+ onError: () => setHasError(true),
70278
+ errorMessageId: errorMessageId
70279
+ })
70444
70280
  });
70445
70281
  }
70446
70282
  return o("div", {
@@ -70456,7 +70292,7 @@
70456
70292
  errors: [errorMessage]
70457
70293
  }) : null]
70458
70294
  }), o(DownloadButton, {
70459
- endpoint: fullUrl,
70295
+ endpoint: endpoint,
70460
70296
  fileName: metadata.fileName,
70461
70297
  onDownloadError: () => {
70462
70298
  setHasError(true);
@@ -70536,27 +70372,18 @@
70536
70372
  }
70537
70373
 
70538
70374
  /**
70539
- * This solution should be a temporary fix, we should try to remove it via: https://github.com/bpmn-io/form-js/issues/1341
70540
- *
70541
- * @param {Object} options
70542
- * @param {string} options.baseUrl
70543
- * @param {string} options.documentId
70544
- * @param {string} [options.contentHash]
70545
- *
70546
- * @returns {string}
70375
+ * @template T
70376
+ * @param {() => T} fn - Function to execute
70377
+ * @returns {T | null}
70547
70378
  */
70548
- function buildUrl(options) {
70549
- const {
70550
- baseUrl,
70551
- documentId,
70552
- contentHash
70553
- } = options;
70554
- const finalUrl = new URL(baseUrl.replace(DOCUMENT_ID_PLACEHOLDER, documentId));
70555
- if (contentHash !== undefined) {
70556
- finalUrl.searchParams.set('contentHash', contentHash);
70379
+ const tryCatch = fn => {
70380
+ try {
70381
+ return fn();
70382
+ } catch (error) {
70383
+ console.error(error);
70384
+ return null;
70557
70385
  }
70558
- return decodeURI(finalUrl.toString());
70559
- }
70386
+ };
70560
70387
 
70561
70388
  /**
70562
70389
  * This file must not be changed or exchanged.
@@ -70711,7 +70538,7 @@
70711
70538
  return this._formFields[type];
70712
70539
  }
70713
70540
  }
70714
- const EXPRESSION_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'conditional.hide', 'description', 'label', 'source', 'readonly', 'text', 'validate.min', 'validate.max', 'validate.minLength', 'validate.maxLength', 'valuesExpression', 'url', 'dataSource', 'columnsExpression', 'expression', 'multiple', 'accept', 'endpointKey', 'title'];
70541
+ const EXPRESSION_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'conditional.hide', 'description', 'label', 'source', 'readonly', 'text', 'validate.min', 'validate.max', 'validate.minLength', 'validate.maxLength', 'valuesExpression', 'url', 'dataSource', 'columnsExpression', 'expression', 'multiple', 'accept', 'title'];
70715
70542
  const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'content', 'url', 'title'];
70716
70543
 
70717
70544
  /**
@@ -74139,7 +73966,7 @@
74139
73966
  Ye = function (n, o) {
74140
73967
  var l = o || {},
74141
73968
  c = {};
74142
- return n === undefined && (n = {}), n.on = function (d, h) {
73969
+ return n === void 0 && (n = {}), n.on = function (d, h) {
74143
73970
  return c[d] ? c[d].push(h) : c[d] = [h], n;
74144
73971
  }, n.once = function (d, h) {
74145
73972
  return h._once = true, n.on(d, h), n;
@@ -74198,11 +74025,11 @@
74198
74025
  ...t
74199
74026
  });
74200
74027
  function ne(t) {
74201
- if (t.touches !== undefined) return t.touches.length;
74202
- if (t.which !== undefined && t.which !== 0) return t.which;
74203
- if (t.buttons !== undefined) return t.buttons;
74028
+ if (t.touches !== void 0) return t.touches.length;
74029
+ if (t.which !== void 0 && t.which !== 0) return t.which;
74030
+ if (t.buttons !== void 0) return t.buttons;
74204
74031
  const n = t.button;
74205
- if (n !== undefined) return n & 1 ? 1 : n & 2 ? 3 : n & 4 ? 2 : 0;
74032
+ if (n !== void 0) return n & 1 ? 1 : n & 2 ? 3 : n & 4 ? 2 : 0;
74206
74033
  }
74207
74034
  const Ae = t => {
74208
74035
  const n = t.getBoundingClientRect();
@@ -74280,7 +74107,7 @@
74280
74107
  D({});
74281
74108
  return;
74282
74109
  }
74283
- if (e.clientX !== undefined && Math.abs(e.clientX - S) <= (s.slideFactorX || 0) && e.clientY !== undefined && Math.abs(e.clientY - C) <= (s.slideFactorY || 0)) return;
74110
+ if (e.clientX !== void 0 && Math.abs(e.clientX - S) <= (s.slideFactorX || 0) && e.clientY !== void 0 && Math.abs(e.clientY - C) <= (s.slideFactorY || 0)) return;
74284
74111
  if (s.ignoreInputTextSelection) {
74285
74112
  const {
74286
74113
  clientX: O = 0,
@@ -74362,7 +74189,7 @@
74362
74189
  }
74363
74190
  function P(e, r) {
74364
74191
  let i;
74365
- return r !== undefined ? i = r : o ? i = E : i = T(a || c), e === l && i === X;
74192
+ return r !== void 0 ? i = r : o ? i = E : i = T(a || c), e === l && i === X;
74366
74193
  }
74367
74194
  function J(e, r, i) {
74368
74195
  let u = e;
@@ -74489,6 +74316,18 @@
74489
74316
  label: 'context',
74490
74317
  detail: 'block',
74491
74318
  type: 'keyword'
74319
+ }), snippetCompletion$1('null', {
74320
+ label: 'null',
74321
+ detail: 'literal',
74322
+ type: 'keyword'
74323
+ }), snippetCompletion$1('true', {
74324
+ label: 'true',
74325
+ detail: 'literal',
74326
+ type: 'keyword'
74327
+ }), snippetCompletion$1('false', {
74328
+ label: 'false',
74329
+ detail: 'literal',
74330
+ type: 'keyword'
74492
74331
  })];
74493
74332
  function _extends$6() {
74494
74333
  _extends$6 = Object.assign ? Object.assign.bind() : function (target) {
@@ -74542,9 +74381,27 @@
74542
74381
  after: 'InExpressions',
74543
74382
  keyword: 'return'
74544
74383
  })];
74545
- const dontComplete = ['StringLiteral', 'Identifier', 'LineComment', 'BlockComment', 'PathExpression'];
74384
+ const dontComplete = ['StringLiteral', 'Identifier', 'LineComment', 'BlockComment', 'PathExpression', 'Context', 'Key', 'ParameterName'];
74385
+ const doComplete = ['Expr', 'ContextEntry'];
74386
+ function ifExpression(completionSource) {
74387
+ const allNodes = [...dontComplete, ...doComplete];
74388
+ return context => {
74389
+ const {
74390
+ state,
74391
+ pos
74392
+ } = context;
74393
+ const match = matchUp(syntaxTree(state).resolveInner(pos, -1), allNodes);
74394
+ if (match) {
74395
+ const [_, name] = match;
74396
+ if (dontComplete.includes(name)) {
74397
+ return null;
74398
+ }
74399
+ }
74400
+ return completionSource(context);
74401
+ };
74402
+ }
74546
74403
  function snippetCompletion(snippets) {
74547
- return ifNotIn(dontComplete, completeFromList(snippets.map(s => _extends$6({}, s, {
74404
+ return ifExpression(completeFromList(snippets.map(s => _extends$6({}, s, {
74548
74405
  type: 'text'
74549
74406
  }))));
74550
74407
  }
@@ -74574,10 +74431,12 @@
74574
74431
  nodeNames = [nodeNames];
74575
74432
  }
74576
74433
  for (; node; node = node.parent) {
74577
- if (nodeNames.includes(node.name)) {
74578
- return node;
74434
+ const nodeType = node.type;
74435
+ const matchedName = nodeNames.find(name => name && nodeType.is(name));
74436
+ if (matchedName) {
74437
+ return [node, matchedName];
74579
74438
  }
74580
- if (node.type.isTop) {
74439
+ if (nodeType.isTop) {
74581
74440
  break;
74582
74441
  }
74583
74442
  }
@@ -74595,10 +74454,11 @@
74595
74454
  state,
74596
74455
  pos
74597
74456
  } = context;
74598
- const node = matchUp(syntaxTree(state).resolveInner(pos, -1), nodes);
74599
- if (!node) {
74457
+ const match = matchUp(syntaxTree(state).resolveInner(pos, -1), nodes);
74458
+ if (!match) {
74600
74459
  return null;
74601
74460
  }
74461
+ const [node] = match;
74602
74462
  if (matchLeft(node, pos, [keyword, before])) {
74603
74463
  return null;
74604
74464
  }
@@ -75051,9 +74911,14 @@
75051
74911
  * @typedef { 'expression' | 'unaryTests' } Dialect
75052
74912
  */
75053
74913
 
74914
+ /**
74915
+ * @typedef { 'camunda' | undefined } ParserDialect
74916
+ */
74917
+
75054
74918
  /**
75055
74919
  * @param { {
75056
74920
  * dialect?: Dialect,
74921
+ * parserDialect?: ParserDialect,
75057
74922
  * context?: Record<string, any>,
75058
74923
  * completions?: import('@codemirror/autocomplete').CompletionSource[]
75059
74924
  * } } options
@@ -75069,7 +74934,7 @@
75069
74934
  *
75070
74935
  * @return {Record<string, any>}
75071
74936
  */
75072
- function createContext(variables, builtins) {
74937
+ function createContext(variables) {
75073
74938
  return variables.slice().reverse().reduce((context, builtin) => {
75074
74939
  context[builtin.name] = () => {};
75075
74940
  return context;
@@ -75077,7 +74942,8 @@
75077
74942
  }
75078
74943
 
75079
74944
  /**
75080
- * @typedef { 'expression' | 'unaryTests' } Dialect
74945
+ * @typedef { import('../language').Dialect } Dialect
74946
+ * @typedef { import('../language').ParserDialect } ParserDialect
75081
74947
  * @typedef { import('..').Variable } Variable
75082
74948
  */
75083
74949
 
@@ -75092,10 +74958,15 @@
75092
74958
  const variablesFacet$1 = Facet.define();
75093
74959
 
75094
74960
  /**
75095
- * @type {Facet<dialect>}
74961
+ * @type {Facet<Dialect>}
75096
74962
  */
75097
74963
  const dialectFacet = Facet.define();
75098
74964
 
74965
+ /**
74966
+ * @type {Facet<ParserDialect>}
74967
+ */
74968
+ const parserDialectFacet = Facet.define();
74969
+
75099
74970
  /**
75100
74971
  * @typedef {object} Variable
75101
74972
  * @property {string} name name or key of the variable
@@ -75110,6 +74981,7 @@
75110
74981
  /**
75111
74982
  * @typedef { {
75112
74983
  * dialect?: import('../language').Dialect,
74984
+ * parserDialect?: import('../language').ParserDialect,
75113
74985
  * variables?: Variable[],
75114
74986
  * builtins?: Variable[]
75115
74987
  * } } CoreConfig
@@ -75125,6 +74997,7 @@
75125
74997
  */
75126
74998
  function configure({
75127
74999
  dialect = 'expression',
75000
+ parserDialect,
75128
75001
  variables = [],
75129
75002
  builtins = [],
75130
75003
  completions: completions$1$1 = completions$1({
@@ -75133,8 +75006,9 @@
75133
75006
  })
75134
75007
  }) {
75135
75008
  const context = createContext([...variables, ...builtins]);
75136
- return [dialectFacet.of(dialect), builtinsFacet.of(builtins), variablesFacet$1.of(variables), language({
75009
+ return [dialectFacet.of(dialect), builtinsFacet.of(builtins), variablesFacet$1.of(variables), parserDialectFacet.of(parserDialect), language({
75137
75010
  dialect,
75011
+ parserDialect,
75138
75012
  context,
75139
75013
  completions: completions$1$1
75140
75014
  })];
@@ -75149,10 +75023,12 @@
75149
75023
  const builtins = state.facet(builtinsFacet)[0];
75150
75024
  const variables = state.facet(variablesFacet$1)[0];
75151
75025
  const dialect = state.facet(dialectFacet)[0];
75026
+ const parserDialect = state.facet(parserDialectFacet)[0];
75152
75027
  return {
75153
75028
  builtins,
75154
75029
  variables,
75155
- dialect
75030
+ dialect,
75031
+ parserDialect
75156
75032
  };
75157
75033
  }
75158
75034
  var camundaTags = [{
@@ -75193,16 +75069,16 @@
75193
75069
  description: "<p>Returns the given value as a string representation.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">string(from: Any): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">string(1.1)\n// &quot;1.1&quot;\n\nstring(date(&quot;2012-12-25&quot;))\n// &quot;2012-12-25&quot;\n</code></pre>\n"
75194
75070
  }, {
75195
75071
  name: "number(from)",
75196
- description: "<p>Parses the given string to a number.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">number(from: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">number(&quot;1500.5&quot;)\n// 1500.5\n</code></pre>\n"
75072
+ description: "<p>Parses the given string to a number.</p>\n<p>Returns <code>null</code> if the string is not a number.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">number(from: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">number(&quot;1500.5&quot;)\n// 1500.5\n</code></pre>\n"
75197
75073
  }, {
75198
75074
  name: "context(entries)",
75199
75075
  description: "<p>Constructs a context of the given list of key-value pairs. It is the reverse function to <a href=\"feel-built-in-functions-context.md#get-entriescontext\">get entries()</a>.</p>\n<p>Each key-value pair must be a context with two entries: <code>key</code> and <code>value</code>. The entry with name <code>key</code> must have a value of the type <code>string</code>.</p>\n<p>It might override context entries if the keys are equal. The entries are overridden in the same order as the contexts in the given list.</p>\n<p>Returns <code>null</code> if one of the entries is not a context or if a context doesn&#39;t contain the required entries.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">context(entries: list&lt;context&gt;): context\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">context([{&quot;key&quot;:&quot;a&quot;, &quot;value&quot;:1}, {&quot;key&quot;:&quot;b&quot;, &quot;value&quot;:2}])\n// {a:1, b:2}\n</code></pre>\n"
75200
75076
  }, {
75201
75077
  name: "date(from)",
75202
- description: "<p>Returns a date from the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(from: string): date\n</code></pre>\n<p>Parses the given string into a date.</p>\n<pre><code class=\"language-feel\">date(from: date and time): date\n</code></pre>\n<p>Extracts the date component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date(&quot;2018-04-29&quot;)\n// date(&quot;2018-04-29&quot;)\n\ndate(date and time(&quot;2012-12-25T11:00:00&quot;))\n// date(&quot;2012-12-25&quot;)\n</code></pre>\n"
75078
+ description: "<p>Returns a date from the given value.</p>\n<p>Returns <code>null</code> if the string is not a valid calendar date. For example, <code>&quot;2024-06-31&quot;</code> is invalid because June has\nonly 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(from: string): date\n</code></pre>\n<p>Parses the given string into a date.</p>\n<pre><code class=\"language-feel\">date(from: date and time): date\n</code></pre>\n<p>Extracts the date component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date(&quot;2018-04-29&quot;)\n// date(&quot;2018-04-29&quot;)\n\ndate(date and time(&quot;2012-12-25T11:00:00&quot;))\n// date(&quot;2012-12-25&quot;)\n</code></pre>\n"
75203
75079
  }, {
75204
75080
  name: "date(year, month, day)",
75205
- description: "<p>Returns a date from the given components.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(year: number, month: number, day: number): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date(2012, 12, 25)\n// date(&quot;2012-12-25&quot;)\n</code></pre>\n"
75081
+ description: "<p>Returns a date from the given components.</p>\n<p>Returns <code>null</code> if the components don&#39;t represent a valid calendar date. For example, <code>2024,6,31</code> is invalid because\nJune has only 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(year: number, month: number, day: number): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date(2012, 12, 25)\n// date(&quot;2012-12-25&quot;)\n</code></pre>\n"
75206
75082
  }, {
75207
75083
  name: "time(from)",
75208
75084
  description: "<p>Returns a time from the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">time(from: string): time\n</code></pre>\n<p>Parses the given string into a time.</p>\n<pre><code class=\"language-feel\">time(from: date and time): time\n</code></pre>\n<p>Extracts the time component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">time(&quot;12:00:00&quot;)\n// time(&quot;12:00:00&quot;)\n\ntime(date and time(&quot;2012-12-25T11:00:00&quot;))\n// time(&quot;11:00:00&quot;)\n</code></pre>\n"
@@ -75214,7 +75090,7 @@
75214
75090
  description: "<p>Returns a time from the given components, including a timezone offset.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">time(hour: number, minute: number, second: number, offset: days and time duration): time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">time(14, 30, 0, duration(&quot;PT1H&quot;))\n// time(&quot;14:30:00+01:00&quot;)\n</code></pre>\n"
75215
75091
  }, {
75216
75092
  name: "date and time(from)",
75217
- description: "<p>Parses the given string into a date and time.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date and time(from: string): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date and time(&quot;2018-04-29T09:30:00&quot;)\n// date and time(&quot;2018-04-29T09:30:00&quot;)\n</code></pre>\n"
75093
+ description: "<p>Parses the given string into a date and time.</p>\n<p>Returns <code>null</code> if the string is not a valid calendar date. For example, <code>&quot;2024-06-31T10:00:00&quot;</code> is invalid because\nJune has only 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date and time(from: string): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date and time(&quot;2018-04-29T09:30:00&quot;)\n// date and time(&quot;2018-04-29T09:30:00&quot;)\n</code></pre>\n"
75218
75094
  }, {
75219
75095
  name: "date and time(date, time)",
75220
75096
  description: "<p>Returns a date and time from the given components.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date and time(date: date, time: time): date and time\n</code></pre>\n<pre><code class=\"language-feel\">date and time(date: date and time, time: time): date and time\n</code></pre>\n<p>Returns a date and time value that consists of the date component of <code>date</code> combined with <code>time</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date and time(date(&quot;2012-12-24&quot;),time(&quot;T23:59:00&quot;))\n// date and time(&quot;2012-12-24T23:59:00&quot;)\n\ndate and time(date and time(&quot;2012-12-25T11:00:00&quot;),time(&quot;T23:59:00&quot;))\n// date and time(&quot;2012-12-25T23:59:00&quot;)\n</code></pre>\n"
@@ -75311,6 +75187,12 @@
75311
75187
  }, {
75312
75188
  name: "string join(list, delimiter, prefix, suffix)",
75313
75189
  description: "<p><em>Camunda Extension</em></p>\n<p>Joins a list of strings into a single string. This is similar to\nJava&#39;s <a href=\"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Collectors.html#joining(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)\">joining</a>\nfunction.</p>\n<p>If an item of the list is <code>null</code>, the item is ignored for the result string. If an item is\nneither a string nor <code>null</code>, the function returns <code>null</code> instead of a string.</p>\n<p>The resulting string starts with <code>prefix</code>, contains a <code>delimiter</code> between each element, and ends\nwith <code>suffix</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">string join(list: list&lt;string&gt;, delimiter: string, prefix: string, suffix: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">string join([&quot;a&quot;,&quot;b&quot;,&quot;c&quot;], &quot;, &quot;, &quot;[&quot;, &quot;]&quot;)\n// &quot;[a, b, c]&quot;\n</code></pre>\n"
75190
+ }, {
75191
+ name: "is empty(list)",
75192
+ description: "<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given list is empty. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">is empty(list: list): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">is empty([])\n// true\n\nis empty([1,2,3])\n// false\n</code></pre>\n"
75193
+ }, {
75194
+ name: "partition(list, size)",
75195
+ description: "<p><em>Camunda Extension</em></p>\n<p>Returns consecutive sublists of a list, each of the same size (the final list may be smaller).</p>\n<p>If <code>size</code> is less than <code>0</code>, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">partition(list: list, size: number): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">partition([1,2,3,4,5], 2)\n// [[1,2], [3,4], [5]]\n\npartition([], 2)\n// []\n\npartition([1,2], 0)\n// null\n</code></pre>\n"
75314
75196
  }, {
75315
75197
  name: "decimal(n, scale)",
75316
75198
  description: "<p>Rounds the given value at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">decimal(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">decimal(1/3, 2)\n// .33\n\ndecimal(1.5, 0)\n// 2\n</code></pre>\n"
@@ -75445,10 +75327,10 @@
75445
75327
  description: "<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">coincides(range1: range, range2: range): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">coincides([1..5], [1..5])\n// true\n\ncoincides((1..5], [1..5))\n// false\n\ncoincides([1..5], [2..6])\n// false\n</code></pre>\n"
75446
75328
  }, {
75447
75329
  name: "substring(string, start position)",
75448
- description: "<p>Returns a substring of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">substring(string: string, start position: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">substring(&quot;foobar&quot;, 3)\n// &quot;obar&quot;\n</code></pre>\n"
75330
+ description: "<p>Returns a substring of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">substring(string: string, start position: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">substring(&quot;foobar&quot;, 3)\n// &quot;obar&quot;\n\nsubstring(&quot;foobar&quot;, -2)\n// &quot;ar&quot;\n</code></pre>\n"
75449
75331
  }, {
75450
75332
  name: "substring(string, start position, length)",
75451
- description: "<p>Returns a substring of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">substring(string: string, start position: number, length: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">substring(&quot;foobar&quot;, 3, 3)\n// &quot;oba&quot;\n</code></pre>\n"
75333
+ description: "<p>Returns a substring of the given value, starting at <code>start position</code> with the given <code>length</code>. If <code>length</code> is greater than\nthe remaining characters of the value, it returns all characters from <code>start position</code> until the end.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">substring(string: string, start position: number, length: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">substring(&quot;foobar&quot;, 3, 3)\n// &quot;oba&quot;\n\nsubstring(&quot;foobar&quot;, -3, 2)\n// &quot;ba&quot;\n\nsubstring(&quot;foobar&quot;, 3, 10)\n// &quot;obar&quot;\n</code></pre>\n"
75452
75334
  }, {
75453
75335
  name: "string length(string)",
75454
75336
  description: "<p>Returns the number of characters in the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">string length(string: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">string length(&quot;foo&quot;)\n// 3\n</code></pre>\n"
@@ -75491,6 +75373,18 @@
75491
75373
  }, {
75492
75374
  name: "extract(string, pattern)",
75493
75375
  description: "<p><em>Camunda Extension</em></p>\n<p>Returns all matches of the pattern in the given string. Returns an empty list if the pattern doesn&#39;t\nmatch.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">extract(string: string, pattern: string): list&lt;string&gt;\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">extract(&quot;references are 1234, 1256, 1378&quot;, &quot;12[0-9]*&quot;)\n// [&quot;1234&quot;,&quot;1256&quot;]\n</code></pre>\n"
75376
+ }, {
75377
+ name: "trim(string)",
75378
+ description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string without leading and trailing spaces.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">trim(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">trim(&quot; hello world &quot;)\n// &quot;hello world&quot;\n\ntrim(&quot;hello world &quot;)\n// &quot;hello world&quot;\n</code></pre>\n"
75379
+ }, {
75380
+ name: "uuid()",
75381
+ description: "<p><em>Camunda Extension</em></p>\n<p>Returns a UUID (Universally Unique Identifier) with 36 characters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">uuid(): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">uuid()\n// &quot;7793aab1-d761-4d38-916b-b7270e309894&quot;\n</code></pre>\n"
75382
+ }, {
75383
+ name: "to base64(value)",
75384
+ description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string encoded in Base64 format.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">to base64(value: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">to base64(&quot;FEEL&quot;)\n// &quot;RkVFTA==&quot;\n</code></pre>\n"
75385
+ }, {
75386
+ name: "is blank(string)",
75387
+ description: "<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given string is blank (empty or contains only whitespaces).</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">is blank(string: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">is blank(&quot;&quot;)\n// true\n\nis blank(&quot; &quot;)\n// true\n\nis blank(&quot;hello world&quot;)\n// false\n</code></pre>\n"
75494
75388
  }, {
75495
75389
  name: "now()",
75496
75390
  description: "<p>Returns the current date and time including the timezone.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">now(): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">now()\n// date and time(&quot;2020-07-31T14:27:30@Europe/Berlin&quot;)\n</code></pre>\n"
@@ -75515,18 +75409,6 @@
75515
75409
  }, {
75516
75410
  name: "last day of month(date)",
75517
75411
  description: "<p><em>Camunda Extension</em></p>\n<p>Takes the month of the given date or date-time value and returns the last day of this month.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">last day of month(date: date): date\n</code></pre>\n<pre><code class=\"language-feel\">last day of month(date: date and time): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">last day of month(date(&quot;2022-10-01&quot;))\n// date(&quot;2022-10-31&quot;))\n\nlast day of month(date and time(&quot;2022-10-16T12:00:00&quot;))\n// date(&quot;2022-10-31&quot;))\n</code></pre>\n"
75518
- }, {
75519
- name: "is empty(list)",
75520
- description: "<p><em>Camunda Extension</em></p>\n<p>Returns true if the given list is empty. Otherwise, returns false.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">is empty(list: list): boolean</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">is empty([])\n// true\n\nis empty([1,2,3])\n// false\n</code></pre>"
75521
- }, {
75522
- name: "trim(string)",
75523
- description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string without leading and trailing spaces.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">trim(string: string): string</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">trim(\" hello world \")\n// \"hello world\"\n\ntrim(\"hello world \")\n// \"hello world\"\n</code></pre>"
75524
- }, {
75525
- name: "uuid()",
75526
- description: "<p><em>Camunda Extension</em></p>\n<p>Returns a UUID (Universally Unique Identifier) with 36 characters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">uuid(): string</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">uuid()\n// \"7793aab1-d761-4d38-916b-b7270e309894\"\n</code></pre>"
75527
- }, {
75528
- name: "to base64(string)",
75529
- description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string encoded in Base64 format.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">to base64(value: string): string</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">to base64(\"FEEL\")\n// \"RkVFTA==\"\n</code></pre>"
75530
75412
  }];
75531
75413
 
75532
75414
  /**
@@ -75572,6 +75454,11 @@
75572
75454
  * @typedef { import('./core').Variable } Variable
75573
75455
  */
75574
75456
 
75457
+ /**
75458
+ * @typedef { import('./language').Dialect } Dialect
75459
+ * @typedef { import('./language').ParserDialect } ParserDialect
75460
+ */
75461
+
75575
75462
  /**
75576
75463
  * @typedef {object} Builtin
75577
75464
  * @property {string} name
@@ -75588,6 +75475,7 @@
75588
75475
  * @param {DOMNode} config.container
75589
75476
  * @param {Extension[]} [config.extensions]
75590
75477
  * @param {Dialect} [config.dialect='expression']
75478
+ * @param {ParserDialect} [config.parserDialect]
75591
75479
  * @param {DOMNode|String} [config.tooltipContainer]
75592
75480
  * @param {Function} [config.onChange]
75593
75481
  * @param {Function} [config.onKeyDown]
@@ -75596,12 +75484,11 @@
75596
75484
  * @param {String} [config.value]
75597
75485
  * @param {Variable[]} [config.variables]
75598
75486
  * @param {Variable[]} [config.builtins]
75599
- *
75600
- * @returns {Object} editor
75601
75487
  */
75602
75488
  function FeelEditor({
75603
75489
  extensions: editorExtensions = [],
75604
75490
  dialect = 'expression',
75491
+ parserDialect,
75605
75492
  container,
75606
75493
  contentAttributes = {},
75607
75494
  tooltipContainer,
@@ -75641,7 +75528,8 @@
75641
75528
  const extensions = [autocompletion(), coreConf.of(configure({
75642
75529
  dialect,
75643
75530
  builtins,
75644
- variables
75531
+ variables,
75532
+ parserDialect
75645
75533
  })), bracketMatching(), indentOnInput(), closeBrackets(), EditorView.contentAttributes.of(contentAttributes), changeHandler, keyHandler, keymap.of([...defaultKeymap]), linter, lintHandler, tooltipLayout, placeholderConf.of(placeholder(placeholder$1)), theme, ...editorExtensions];
75646
75534
  if (readOnly) {
75647
75535
  extensions.push(EditorView.editable.of(false));
@@ -75708,14 +75596,10 @@
75708
75596
  * @param {Variable[]} variables
75709
75597
  */
75710
75598
  FeelEditor.prototype.setVariables = function (variables) {
75711
- const {
75712
- dialect,
75713
- builtins
75714
- } = get(this._cmEditor.state);
75599
+ const config = get(this._cmEditor.state);
75715
75600
  this._cmEditor.dispatch({
75716
75601
  effects: [coreConf.reconfigure(configure({
75717
- dialect,
75718
- builtins,
75602
+ ...config,
75719
75603
  variables
75720
75604
  }))]
75721
75605
  });
@@ -75747,9 +75631,9 @@
75747
75631
  var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
75748
75632
  var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
75749
75633
  var _element$getRootNode;
75750
- return element === null || element === undefined ? undefined : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === undefined ? undefined : _element$getRootNode.call(element);
75634
+ return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);
75751
75635
  } : function (element) {
75752
- return element === null || element === undefined ? undefined : element.ownerDocument;
75636
+ return element === null || element === void 0 ? void 0 : element.ownerDocument;
75753
75637
  };
75754
75638
 
75755
75639
  /**
@@ -75762,13 +75646,13 @@
75762
75646
  */
75763
75647
  var isInert = function isInert(node, lookUp) {
75764
75648
  var _node$getAttribute;
75765
- if (lookUp === undefined) {
75649
+ if (lookUp === void 0) {
75766
75650
  lookUp = true;
75767
75651
  }
75768
75652
  // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`
75769
75653
  // JS API property; we have to check the attribute, which can either be empty or 'true';
75770
75654
  // if it's `null` (not specified) or 'false', it's an active element
75771
- var inertAtt = node === null || node === undefined ? undefined : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === undefined ? undefined : _node$getAttribute.call(node, 'inert');
75655
+ var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');
75772
75656
  var inert = inertAtt === '' || inertAtt === 'true';
75773
75657
 
75774
75658
  // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`
@@ -75791,7 +75675,7 @@
75791
75675
  // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have
75792
75676
  // to use the attribute directly to check for this, which can either be empty or 'true';
75793
75677
  // if it's `null` (not specified) or 'false', it's a non-editable element
75794
- var attValue = node === null || node === undefined ? undefined : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === undefined ? undefined : _node$getAttribute2.call(node, 'contenteditable');
75678
+ var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');
75795
75679
  return attValue === '' || attValue === 'true';
75796
75680
  };
75797
75681
 
@@ -76043,22 +75927,22 @@
76043
75927
  // from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then
76044
75928
  // `ownerDocument` will be `null`, hence the optional chaining on it.
76045
75929
  var nodeRoot = node && getRootNode(node);
76046
- var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === undefined ? undefined : _nodeRoot.host;
75930
+ var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;
76047
75931
 
76048
75932
  // in some cases, a detached node will return itself as the root instead of a document or
76049
75933
  // shadow root object, in which case, we shouldn't try to look further up the host chain
76050
75934
  var attached = false;
76051
75935
  if (nodeRoot && nodeRoot !== node) {
76052
75936
  var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;
76053
- attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== undefined && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== undefined && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== undefined && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== undefined && _node$ownerDocument.contains(node));
75937
+ attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));
76054
75938
  while (!attached && nodeRootHost) {
76055
75939
  var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;
76056
75940
  // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
76057
75941
  // which means we need to get the host's host and check if that parent host is contained
76058
75942
  // in (i.e. attached to) the document
76059
75943
  nodeRoot = getRootNode(nodeRootHost);
76060
- nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === undefined ? undefined : _nodeRoot2.host;
76061
- attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== undefined && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== undefined && _nodeRootHost2$ownerD.contains(nodeRootHost));
75944
+ nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;
75945
+ attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));
76062
75946
  }
76063
75947
  }
76064
75948
  return attached;
@@ -76344,7 +76228,7 @@
76344
76228
  if (typeof input !== "object" || input === null) return input;
76345
76229
  var prim = input[Symbol.toPrimitive];
76346
76230
  if (prim !== undefined) {
76347
- var res = prim.call(input, hint || "default");
76231
+ var res = prim.call(input, hint);
76348
76232
  if (typeof res !== "object") return res;
76349
76233
  throw new TypeError("@@toPrimitive must return a primitive value.");
76350
76234
  }
@@ -76385,10 +76269,10 @@
76385
76269
  return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
76386
76270
  };
76387
76271
  var isEscapeEvent = function isEscapeEvent(e) {
76388
- return (e === null || e === undefined ? undefined : e.key) === 'Escape' || (e === null || e === undefined ? undefined : e.key) === 'Esc' || (e === null || e === undefined ? undefined : e.keyCode) === 27;
76272
+ return (e === null || e === void 0 ? void 0 : e.key) === 'Escape' || (e === null || e === void 0 ? void 0 : e.key) === 'Esc' || (e === null || e === void 0 ? void 0 : e.keyCode) === 27;
76389
76273
  };
76390
76274
  var isTabEvent = function isTabEvent(e) {
76391
- return (e === null || e === undefined ? undefined : e.key) === 'Tab' || (e === null || e === undefined ? undefined : e.keyCode) === 9;
76275
+ return (e === null || e === void 0 ? void 0 : e.key) === 'Tab' || (e === null || e === void 0 ? void 0 : e.keyCode) === 9;
76392
76276
  };
76393
76277
 
76394
76278
  // checks for TAB by default
@@ -76429,7 +76313,7 @@
76429
76313
  for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
76430
76314
  params[_key - 1] = arguments[_key];
76431
76315
  }
76432
- return typeof value === 'function' ? value.apply(undefined, params) : value;
76316
+ return typeof value === 'function' ? value.apply(void 0, params) : value;
76433
76317
  };
76434
76318
  var getActualTarget = function getActualTarget(event) {
76435
76319
  // NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
@@ -76448,8 +76332,8 @@
76448
76332
  var createFocusTrap = function createFocusTrap(elements, userOptions) {
76449
76333
  // SSR: a live trap shouldn't be created in this type of environment so this
76450
76334
  // should be safe code to execute if the `document` option isn't specified
76451
- var doc = (userOptions === null || userOptions === undefined ? undefined : userOptions.document) || document;
76452
- var trapStack = (userOptions === null || userOptions === undefined ? undefined : userOptions.trapStack) || internalTrapStack;
76335
+ var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
76336
+ var trapStack = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.trapStack) || internalTrapStack;
76453
76337
  var config = _objectSpread2({
76454
76338
  returnFocusOnDeactivate: true,
76455
76339
  escapeDeactivates: true,
@@ -76520,7 +76404,7 @@
76520
76404
  * if the element isn't found.
76521
76405
  */
76522
76406
  var findContainerIndex = function findContainerIndex(element, event) {
76523
- var composedPath = typeof (event === null || event === undefined ? undefined : event.composedPath) === 'function' ? event.composedPath() : undefined;
76407
+ var composedPath = typeof (event === null || event === void 0 ? void 0 : event.composedPath) === 'function' ? event.composedPath() : undefined;
76524
76408
  // NOTE: search `containerGroups` because it's possible a group contains no tabbable
76525
76409
  // nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
76526
76410
  // and we still need to find the element in there
@@ -76532,7 +76416,7 @@
76532
76416
  // web components if the `tabbableOptions.getShadowRoot` option was used for
76533
76417
  // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
76534
76418
  // look inside web components even if open)
76535
- composedPath === null || composedPath === undefined ? undefined : composedPath.includes(container)) || tabbableNodes.find(function (node) {
76419
+ composedPath === null || composedPath === void 0 ? void 0 : composedPath.includes(container)) || tabbableNodes.find(function (node) {
76536
76420
  return node === element;
76537
76421
  });
76538
76422
  });
@@ -76557,7 +76441,7 @@
76557
76441
  for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
76558
76442
  params[_key2 - 1] = arguments[_key2];
76559
76443
  }
76560
- optionValue = optionValue.apply(undefined, params);
76444
+ optionValue = optionValue.apply(void 0, params);
76561
76445
  }
76562
76446
  if (optionValue === true) {
76563
76447
  optionValue = undefined; // use default value
@@ -76738,7 +76622,7 @@
76738
76622
  var target = _ref2.target,
76739
76623
  event = _ref2.event,
76740
76624
  _ref2$isBackward = _ref2.isBackward,
76741
- isBackward = _ref2$isBackward === undefined ? false : _ref2$isBackward;
76625
+ isBackward = _ref2$isBackward === void 0 ? false : _ref2$isBackward;
76742
76626
  target = target || getActualTarget(event);
76743
76627
  updateTabbableNodes();
76744
76628
  var destinationNode = null;
@@ -77115,14 +76999,14 @@
77115
76999
  state.active = true;
77116
77000
  state.paused = false;
77117
77001
  state.nodeFocusedBeforeActivation = doc.activeElement;
77118
- onActivate === null || onActivate === undefined ? undefined : onActivate();
77002
+ onActivate === null || onActivate === void 0 ? void 0 : onActivate();
77119
77003
  var finishActivation = function finishActivation() {
77120
77004
  if (checkCanFocusTrap) {
77121
77005
  updateTabbableNodes();
77122
77006
  }
77123
77007
  addListeners();
77124
77008
  updateObservedNodes();
77125
- onPostActivate === null || onPostActivate === undefined ? undefined : onPostActivate();
77009
+ onPostActivate === null || onPostActivate === void 0 ? void 0 : onPostActivate();
77126
77010
  };
77127
77011
  if (checkCanFocusTrap) {
77128
77012
  checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
@@ -77151,13 +77035,13 @@
77151
77035
  var onPostDeactivate = getOption(options, 'onPostDeactivate');
77152
77036
  var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
77153
77037
  var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
77154
- onDeactivate === null || onDeactivate === undefined ? undefined : onDeactivate();
77038
+ onDeactivate === null || onDeactivate === void 0 ? void 0 : onDeactivate();
77155
77039
  var finishDeactivation = function finishDeactivation() {
77156
77040
  delay(function () {
77157
77041
  if (returnFocus) {
77158
77042
  tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
77159
77043
  }
77160
- onPostDeactivate === null || onPostDeactivate === undefined ? undefined : onPostDeactivate();
77044
+ onPostDeactivate === null || onPostDeactivate === void 0 ? void 0 : onPostDeactivate();
77161
77045
  });
77162
77046
  };
77163
77047
  if (returnFocus && checkCanReturnFocus) {
@@ -77174,10 +77058,10 @@
77174
77058
  var onPause = getOption(pauseOptions, 'onPause');
77175
77059
  var onPostPause = getOption(pauseOptions, 'onPostPause');
77176
77060
  state.paused = true;
77177
- onPause === null || onPause === undefined ? undefined : onPause();
77061
+ onPause === null || onPause === void 0 ? void 0 : onPause();
77178
77062
  removeListeners();
77179
77063
  updateObservedNodes();
77180
- onPostPause === null || onPostPause === undefined ? undefined : onPostPause();
77064
+ onPostPause === null || onPostPause === void 0 ? void 0 : onPostPause();
77181
77065
  return this;
77182
77066
  },
77183
77067
  unpause: function unpause(unpauseOptions) {
@@ -77187,11 +77071,11 @@
77187
77071
  var onUnpause = getOption(unpauseOptions, 'onUnpause');
77188
77072
  var onPostUnpause = getOption(unpauseOptions, 'onPostUnpause');
77189
77073
  state.paused = false;
77190
- onUnpause === null || onUnpause === undefined ? undefined : onUnpause();
77074
+ onUnpause === null || onUnpause === void 0 ? void 0 : onUnpause();
77191
77075
  updateTabbableNodes();
77192
77076
  addListeners();
77193
77077
  updateObservedNodes();
77194
- onPostUnpause === null || onPostUnpause === undefined ? undefined : onPostUnpause();
77078
+ onPostUnpause === null || onPostUnpause === void 0 ? void 0 : onPostUnpause();
77195
77079
  return this;
77196
77080
  },
77197
77081
  updateContainerElements: function updateContainerElements(containerElements) {
@@ -77283,7 +77167,7 @@
77283
77167
  DIV_BY_ZERO = NAME + 'Division by zero',
77284
77168
  // The shared prototype object.
77285
77169
  P = {},
77286
- UNDEFINED = undefined,
77170
+ UNDEFINED = void 0,
77287
77171
  NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
77288
77172
 
77289
77173
  /*
@@ -83650,7 +83534,7 @@
83650
83534
  return o(Tooltip, {
83651
83535
  ...props,
83652
83536
  value: value,
83653
- forId: prefixId$9(forId)
83537
+ forId: `bio-properties-panel-${forId}`
83654
83538
  });
83655
83539
  }
83656
83540
  function Tooltip(props) {
@@ -83661,71 +83545,52 @@
83661
83545
  direction = 'right',
83662
83546
  position
83663
83547
  } = props;
83664
- const [visible, setShow] = h(false);
83665
- const [focusedViaKeyboard, setFocusedViaKeyboard] = h(false);
83548
+ const [visible, setVisible] = h(false);
83549
+
83550
+ // Tooltip will be shown after SHOW_DELAY ms from hovering over the source element.
83551
+ const SHOW_DELAY = 200;
83666
83552
  let timeout = null;
83667
83553
  const wrapperRef = _$1(null);
83668
83554
  const tooltipRef = _$1(null);
83669
- const showTooltip = async event => {
83670
- const show = () => setShow(true);
83671
- if (!visible && !timeout) {
83672
- if (event instanceof MouseEvent) {
83673
- timeout = setTimeout(show, 200);
83674
- } else {
83675
- show();
83676
- setFocusedViaKeyboard(true);
83677
- }
83555
+ const show = (_, delay) => {
83556
+ if (visible) return;
83557
+ if (delay) {
83558
+ timeout = setTimeout(() => {
83559
+ setVisible(true);
83560
+ }, SHOW_DELAY);
83561
+ } else {
83562
+ setVisible(true);
83678
83563
  }
83679
83564
  };
83680
- const hideTooltip = () => {
83681
- setShow(false);
83682
- setFocusedViaKeyboard(false);
83683
- };
83684
- const hideTooltipViaEscape = e => {
83685
- e.code === 'Escape' && hideTooltip();
83565
+ const hide = () => {
83566
+ clearTimeout(timeout);
83567
+ setVisible(false);
83686
83568
  };
83687
- const isTooltipHovered = ({
83688
- x,
83689
- y
83569
+ const handleMouseLeave = ({
83570
+ relatedTarget
83690
83571
  }) => {
83691
- const tooltip = tooltipRef.current;
83692
- const wrapper = wrapperRef.current;
83693
- return tooltip && (inBounds(x, y, wrapper.getBoundingClientRect()) || inBounds(x, y, tooltip.getBoundingClientRect()));
83572
+ // Don't hide the tooltip when moving mouse between the wrapper and the tooltip.
83573
+ if (relatedTarget === wrapperRef.current || relatedTarget === tooltipRef.current || relatedTarget?.parentElement === tooltipRef.current) {
83574
+ return;
83575
+ }
83576
+ hide();
83694
83577
  };
83695
- p(() => {
83578
+ const handleFocusOut = e => {
83696
83579
  const {
83697
- current
83698
- } = wrapperRef;
83699
- if (!current) {
83580
+ target
83581
+ } = e;
83582
+
83583
+ // Don't hide the tooltip if the wrapper or the tooltip itself is clicked.
83584
+ const isHovered = target.matches(':hover') || tooltipRef.current?.matches(':hover');
83585
+ if (target === wrapperRef.current && isHovered) {
83586
+ e.stopPropagation();
83700
83587
  return;
83701
83588
  }
83702
- const hideHoveredTooltip = e => {
83703
- const isFocused = document.activeElement === wrapperRef.current || document.activeElement.closest('.bio-properties-panel-tooltip');
83704
- if (visible && !isTooltipHovered({
83705
- x: e.x,
83706
- y: e.y
83707
- }) && !(isFocused && focusedViaKeyboard)) {
83708
- hideTooltip();
83709
- }
83710
- };
83711
- const hideFocusedTooltip = e => {
83712
- const {
83713
- relatedTarget
83714
- } = e;
83715
- const isTooltipChild = el => !!el.closest('.bio-properties-panel-tooltip');
83716
- if (visible && !isHovered(wrapperRef.current) && relatedTarget && !isTooltipChild(relatedTarget)) {
83717
- hideTooltip();
83718
- }
83719
- };
83720
- document.addEventListener('wheel', hideHoveredTooltip);
83721
- document.addEventListener('focusout', hideFocusedTooltip);
83722
- document.addEventListener('mousemove', hideHoveredTooltip);
83723
- return () => {
83724
- document.removeEventListener('wheel', hideHoveredTooltip);
83725
- document.removeEventListener('mousemove', hideHoveredTooltip);
83726
- document.removeEventListener('focusout', hideFocusedTooltip);
83727
- };
83728
- }, [wrapperRef.current, visible, focusedViaKeyboard]);
83589
+ hide();
83590
+ };
83591
+ const hideTooltipViaEscape = e => {
83592
+ e.code === 'Escape' && hide();
83593
+ };
83729
83594
  const renderTooltip = () => {
83730
83595
  return o("div", {
83731
83596
  class: `bio-properties-panel-tooltip ${direction}`,
@@ -83735,6 +83600,7 @@
83735
83600
  style: position || getTooltipPosition(wrapperRef.current),
83736
83601
  ref: tooltipRef,
83737
83602
  onClick: e => e.stopPropagation(),
83603
+ onMouseLeave: handleMouseLeave,
83738
83604
  children: [o("div", {
83739
83605
  class: "bio-properties-panel-tooltip-content",
83740
83606
  children: value
@@ -83747,39 +83613,23 @@
83747
83613
  class: "bio-properties-panel-tooltip-wrapper",
83748
83614
  tabIndex: "0",
83749
83615
  ref: wrapperRef,
83750
- onMouseEnter: showTooltip,
83751
- onMouseLeave: () => {
83752
- clearTimeout(timeout);
83753
- timeout = null;
83754
- },
83755
- onFocus: showTooltip,
83616
+ onMouseEnter: e => show(e, true),
83617
+ onMouseLeave: handleMouseLeave,
83618
+ onFocus: show,
83619
+ onBlur: handleFocusOut,
83756
83620
  onKeyDown: hideTooltipViaEscape,
83757
83621
  children: [props.children, visible ? parent ? z$1(renderTooltip(), parent.current) : renderTooltip() : null]
83758
83622
  });
83759
83623
  }
83760
83624
 
83761
83625
  // helper
83762
- function inBounds(x, y, bounds) {
83763
- const {
83764
- top,
83765
- right,
83766
- bottom,
83767
- left
83768
- } = bounds;
83769
- return x >= left && x <= right && y >= top && y <= bottom;
83770
- }
83626
+
83771
83627
  function getTooltipPosition(refElement) {
83772
83628
  const refPosition = refElement.getBoundingClientRect();
83773
83629
  const right = `calc(100% - ${refPosition.x}px)`;
83774
83630
  const top = `${refPosition.top - 10}px`;
83775
83631
  return `right: ${right}; top: ${top};`;
83776
83632
  }
83777
- function isHovered(element) {
83778
- return element.matches(':hover');
83779
- }
83780
- function prefixId$9(id) {
83781
- return `bio-properties-panel-${id}`;
83782
- }
83783
83633
 
83784
83634
  /**
83785
83635
  * Accesses the global DescriptionContext and returns a description for a given id and element.
@@ -85302,6 +85152,7 @@
85302
85152
  label,
85303
85153
  hostLanguage,
85304
85154
  onInput,
85155
+ onBlur,
85305
85156
  onError,
85306
85157
  placeholder,
85307
85158
  feel,
@@ -85367,6 +85218,12 @@
85367
85218
  setFocus(-1);
85368
85219
  }
85369
85220
  };
85221
+ const handleOnBlur = e => {
85222
+ if (onBlur) {
85223
+ onBlur(e);
85224
+ }
85225
+ setLocalValue(e.target.value.trim());
85226
+ };
85370
85227
  const handleLint = useStaticCallback((lint = []) => {
85371
85228
  const syntaxError = lint.some(report => report.type === 'Syntax Error');
85372
85229
  if (syntaxError) {
@@ -85488,6 +85345,7 @@
85488
85345
  ...props,
85489
85346
  popupOpen: popuOpen,
85490
85347
  onInput: handleLocalInput,
85348
+ onBlur: handleOnBlur,
85491
85349
  contentAttributes: {
85492
85350
  'id': prefixId$5(id),
85493
85351
  'aria-label': label
@@ -86786,6 +86644,12 @@
86786
86644
  autoResize && resizeToContents(e.target);
86787
86645
  setLocalValue(e.target.value);
86788
86646
  };
86647
+ const handleOnBlur = e => {
86648
+ if (onBlur) {
86649
+ onBlur(e);
86650
+ }
86651
+ setLocalValue(e.target.value.trim());
86652
+ };
86789
86653
  y(() => {
86790
86654
  autoResize && resizeToContents(ref.current);
86791
86655
  }, []);
@@ -86817,7 +86681,7 @@
86817
86681
  class: classNames('bio-properties-panel-input', monospace ? 'bio-properties-panel-input-monospace' : '', autoResize ? 'auto-resize' : ''),
86818
86682
  onInput: handleInput,
86819
86683
  onFocus: onFocus,
86820
- onBlur: onBlur,
86684
+ onBlur: handleOnBlur,
86821
86685
  placeholder: placeholder,
86822
86686
  rows: rows,
86823
86687
  value: localValue,
@@ -86935,6 +86799,12 @@
86935
86799
  const handleInputCallback = F$1(() => {
86936
86800
  return debounce(target => onInput(target.value.length ? target.value : undefined));
86937
86801
  }, [onInput, debounce]);
86802
+ const handleOnBlur = e => {
86803
+ if (onBlur) {
86804
+ onBlur(e);
86805
+ }
86806
+ setLocalValue(e.target.value.trim());
86807
+ };
86938
86808
  const handleInput = e => {
86939
86809
  handleInputCallback(e.target);
86940
86810
  setLocalValue(e.target.value);
@@ -86967,7 +86837,7 @@
86967
86837
  class: "bio-properties-panel-input",
86968
86838
  onInput: handleInput,
86969
86839
  onFocus: onFocus,
86970
- onBlur: onBlur,
86840
+ onBlur: handleOnBlur,
86971
86841
  placeholder: placeholder,
86972
86842
  value: localValue
86973
86843
  })]
@@ -87493,7 +87363,7 @@
87493
87363
  editField,
87494
87364
  id
87495
87365
  } = props;
87496
- const debounce = useService('debounce');
87366
+ useService('debounce');
87497
87367
  const formLayoutValidator = useService('formLayoutValidator');
87498
87368
  const validate = T$2(value => {
87499
87369
  return formLayoutValidator.validateField(field, value ? parseInt(value) : null);
@@ -87519,7 +87389,6 @@
87519
87389
  ...asArray(16).filter(i => i >= MIN_COLUMNS).map(asOption)];
87520
87390
  };
87521
87391
  return SelectEntry({
87522
- debounce,
87523
87392
  element: field,
87524
87393
  id,
87525
87394
  label: 'Columns',
@@ -88582,7 +88451,7 @@
88582
88451
  id,
88583
88452
  getValue,
88584
88453
  setValue,
88585
- validate: validate$a
88454
+ validate: validate$9
88586
88455
  });
88587
88456
  }
88588
88457
 
@@ -88592,7 +88461,7 @@
88592
88461
  * @param {number|void} value
88593
88462
  * @returns {string|null}
88594
88463
  */
88595
- const validate$a = value => {
88464
+ const validate$9 = value => {
88596
88465
  if (typeof value !== 'number') {
88597
88466
  return 'A number is required.';
88598
88467
  }
@@ -88654,7 +88523,7 @@
88654
88523
  setValue,
88655
88524
  singleLine: true,
88656
88525
  tooltip: getTooltip$1(),
88657
- validate: validate$9,
88526
+ validate: validate$8,
88658
88527
  variables
88659
88528
  });
88660
88529
  }
@@ -88682,7 +88551,7 @@
88682
88551
  * @param {string|void} value
88683
88552
  * @returns {string|null}
88684
88553
  */
88685
- const validate$9 = value => {
88554
+ const validate$8 = value => {
88686
88555
  if (!value || value.startsWith('=')) {
88687
88556
  return;
88688
88557
  }
@@ -88771,7 +88640,7 @@
88771
88640
  };
88772
88641
  return FeelTemplatingEntry({
88773
88642
  debounce,
88774
- description: description$4,
88643
+ description: description$3,
88775
88644
  element: field,
88776
88645
  getValue,
88777
88646
  id,
@@ -88781,7 +88650,7 @@
88781
88650
  variables
88782
88651
  });
88783
88652
  }
88784
- const description$4 = o(k$2, {
88653
+ const description$3 = o(k$2, {
88785
88654
  children: ["Supports markdown and templating.", ' ', o("a", {
88786
88655
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
88787
88656
  target: "_blank",
@@ -88823,13 +88692,13 @@
88823
88692
  };
88824
88693
  return FeelTemplatingEntry({
88825
88694
  debounce,
88826
- description: description$3,
88695
+ description: description$2,
88827
88696
  element: field,
88828
88697
  getValue,
88829
88698
  id,
88830
88699
  label: 'Content',
88831
88700
  hostLanguage: 'html',
88832
- validate: validate$8,
88701
+ validate: validate$7,
88833
88702
  setValue,
88834
88703
  variables
88835
88704
  });
@@ -88837,7 +88706,7 @@
88837
88706
 
88838
88707
  // helpers //////////
88839
88708
 
88840
- const description$3 = o(k$2, {
88709
+ const description$2 = o(k$2, {
88841
88710
  children: ["Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component.", ' ', o("a", {
88842
88711
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-html/",
88843
88712
  target: "_blank",
@@ -88850,7 +88719,7 @@
88850
88719
  * @param {string|void} value
88851
88720
  * @returns {string|null}
88852
88721
  */
88853
- const validate$8 = value => {
88722
+ const validate$7 = value => {
88854
88723
  // allow empty state
88855
88724
  if (typeof value !== 'string' || value === '') {
88856
88725
  return null;
@@ -89677,7 +89546,7 @@
89677
89546
  id,
89678
89547
  label: 'Input values key',
89679
89548
  setValue,
89680
- validate: validate$7
89549
+ validate: validate$6
89681
89550
  });
89682
89551
  }
89683
89552
 
@@ -89687,7 +89556,7 @@
89687
89556
  * @param {string|void} value
89688
89557
  * @returns {string|null}
89689
89558
  */
89690
- const validate$7 = value => {
89559
+ const validate$6 = value => {
89691
89560
  if (typeof value !== 'string' || value.length === 0) {
89692
89561
  return 'Must not be empty.';
89693
89562
  }
@@ -89712,7 +89581,14 @@
89712
89581
  editField(field, OPTIONS_SOURCES_PATHS[OPTIONS_SOURCES.STATIC], arrayAdd(values, values.length, entry));
89713
89582
  };
89714
89583
  const removeEntry = entry => {
89715
- editField(field, OPTIONS_SOURCES_PATHS[OPTIONS_SOURCES.STATIC], without(values, entry));
89584
+ if (field.defaultValue === entry.value) {
89585
+ editField(field, {
89586
+ values: without(values, entry),
89587
+ defaultValue: undefined
89588
+ });
89589
+ } else {
89590
+ editField(field, OPTIONS_SOURCES_PATHS[OPTIONS_SOURCES.STATIC], without(values, entry));
89591
+ }
89716
89592
  };
89717
89593
  const validateFactory = (key, getValue) => {
89718
89594
  return value => {
@@ -89964,7 +89840,6 @@
89964
89840
  path: ['nonCollapsedItems'],
89965
89841
  label: 'Number of non-collapsing items',
89966
89842
  min: 1,
89967
- defaultValue: 5,
89968
89843
  props
89969
89844
  });
89970
89845
  entries.push(nonCollapseItemsEntry);
@@ -90122,7 +89997,7 @@
90122
89997
  setValue,
90123
89998
  singleLine: true,
90124
89999
  variables,
90125
- validate: validate$6
90000
+ validate: validate$5
90126
90001
  });
90127
90002
  }
90128
90003
 
@@ -90132,7 +90007,7 @@
90132
90007
  * @param {string|void} value
90133
90008
  * @returns {string|null}
90134
90009
  */
90135
- const validate$6 = value => {
90010
+ const validate$5 = value => {
90136
90011
  if (!isString$3(value) || value.length === 0) {
90137
90012
  return 'Must not be empty.';
90138
90013
  }
@@ -90234,7 +90109,7 @@
90234
90109
  id,
90235
90110
  getValue,
90236
90111
  setValue,
90237
- validate: validate$5
90112
+ validate: validate$4
90238
90113
  });
90239
90114
  }
90240
90115
 
@@ -90244,7 +90119,7 @@
90244
90119
  * @param {string|void} value
90245
90120
  * @returns {string|null}
90246
90121
  */
90247
- const validate$5 = value => {
90122
+ const validate$4 = value => {
90248
90123
  if (isNil(value)) {
90249
90124
  return null;
90250
90125
  }
@@ -90416,7 +90291,7 @@
90416
90291
  setValue,
90417
90292
  singleLine: true,
90418
90293
  variables,
90419
- validate: validate$4
90294
+ validate: validate$3
90420
90295
  });
90421
90296
  }
90422
90297
 
@@ -90426,7 +90301,7 @@
90426
90301
  * @param {string|void} value
90427
90302
  * @returns {string|null}
90428
90303
  */
90429
- const validate$4 = value => {
90304
+ const validate$3 = value => {
90430
90305
  if (!isString$3(value) || value.length === 0 || value === '=') {
90431
90306
  return 'Must not be empty.';
90432
90307
  }
@@ -90523,7 +90398,7 @@
90523
90398
  id,
90524
90399
  label: 'Key',
90525
90400
  setValue,
90526
- validate: validate$3
90401
+ validate: validate$2
90527
90402
  });
90528
90403
  }
90529
90404
 
@@ -90533,7 +90408,7 @@
90533
90408
  * @param {string|void} value
90534
90409
  * @returns {string|null}
90535
90410
  */
90536
- function validate$3(value) {
90411
+ function validate$2(value) {
90537
90412
  if (!isString$3(value) || value.length === 0) {
90538
90413
  return 'Must not be empty.';
90539
90414
  }
@@ -90668,13 +90543,13 @@
90668
90543
  singleLine: true,
90669
90544
  setValue,
90670
90545
  variables,
90671
- description: description$2
90546
+ description: description$1
90672
90547
  });
90673
90548
  }
90674
90549
 
90675
90550
  // helpers //////////
90676
90551
 
90677
- const description$2 = o(k$2, {
90552
+ const description$1 = o(k$2, {
90678
90553
  children: ["A comma-separated list of", ' ', o("a", {
90679
90554
  href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers",
90680
90555
  target: "_blank",
@@ -90793,84 +90668,6 @@
90793
90668
  setValue,
90794
90669
  variables,
90795
90670
  tooltip,
90796
- validate: validate$2
90797
- });
90798
- }
90799
-
90800
- // helpers //////////
90801
-
90802
- /**
90803
- * @param {string|undefined} value
90804
- * @returns {string|null}
90805
- */
90806
- const validate$2 = value => {
90807
- if (typeof value !== 'string' || value.length === 0) {
90808
- return 'The document data source is required.';
90809
- }
90810
- };
90811
- function EndpointKeyEntry(props) {
90812
- const {
90813
- editField,
90814
- field
90815
- } = props;
90816
- const entries = [];
90817
- entries.push({
90818
- id: 'endpointKey',
90819
- component: EndpointKey,
90820
- editField: editField,
90821
- field: field,
90822
- isEdited: isEdited$6,
90823
- isDefaultVisible: field => field.type === 'documentPreview'
90824
- });
90825
- return entries;
90826
- }
90827
- function EndpointKey(props) {
90828
- const {
90829
- editField,
90830
- field,
90831
- id
90832
- } = props;
90833
- const debounce = useService('debounce');
90834
- const variables = useVariables().map(name => ({
90835
- name
90836
- }));
90837
- const path = ['endpointKey'];
90838
- const getValue = () => {
90839
- return get$1(field, path, '');
90840
- };
90841
- const setValue = value => {
90842
- return editField(field, path, value);
90843
- };
90844
- const tooltip = o("div", {
90845
- children: [o("p", {
90846
- children: "Enter a context key that generates a string with the API endpoint to download a document."
90847
- }), o("p", {
90848
- children: ["The string must contain ", o("code", {
90849
- children: '{ documentId }'
90850
- }), ", which will be replaced with the document ID from the document\u2018s reference."]
90851
- }), o("p", {
90852
- children: "If you\u2018re using the Camunda Tasklist, this variable is automatically added to the context for you."
90853
- }), o("p", {
90854
- children: ["For more details, see the", ' ', o("a", {
90855
- href: "https://docs.camunda.io/docs/next/components/modeler/forms/form-element-library/forms-element-library-document-preview/",
90856
- rel: "noopener noreferrer",
90857
- target: "_blank",
90858
- children: "Camunda documentation"
90859
- })]
90860
- })]
90861
- });
90862
- return FeelTemplatingEntry({
90863
- debounce,
90864
- element: field,
90865
- getValue,
90866
- id,
90867
- label: 'Document URL',
90868
- feel: 'required',
90869
- singleLine: true,
90870
- setValue,
90871
- variables,
90872
- description: description$1,
90873
- tooltip,
90874
90671
  validate: validate$1
90875
90672
  });
90876
90673
  }
@@ -90883,12 +90680,9 @@
90883
90680
  */
90884
90681
  const validate$1 = value => {
90885
90682
  if (typeof value !== 'string' || value.length === 0) {
90886
- return 'The document reference is required.';
90683
+ return 'The document data source is required.';
90887
90684
  }
90888
90685
  };
90889
- const description$1 = o(k$2, {
90890
- children: "Define an API URL for downloading a document"
90891
- });
90892
90686
  function MaxHeightEntry(props) {
90893
90687
  const {
90894
90688
  editField,
@@ -90990,12 +90784,10 @@
90990
90784
  editField
90991
90785
  }), ...TextEntry({
90992
90786
  field,
90993
- editField,
90994
- getService
90787
+ editField
90995
90788
  }), ...HtmlEntry({
90996
90789
  field,
90997
- editField,
90998
- getService
90790
+ editField
90999
90791
  }), ...IFrameUrlEntry({
91000
90792
  field,
91001
90793
  editField
@@ -91315,12 +91107,11 @@
91315
91107
  id,
91316
91108
  onChange
91317
91109
  } = props;
91318
- const debounce = useService('debounce');
91110
+ useService('debounce');
91319
91111
  const setValue = validationType => {
91320
91112
  onChange('validationType')(validationType || undefined);
91321
91113
  };
91322
91114
  return SelectEntry({
91323
- debounce,
91324
91115
  element: field,
91325
91116
  getValue: getValue('validationType'),
91326
91117
  id,
@@ -91662,20 +91453,6 @@
91662
91453
 
91663
91454
  "Expression" defines options that are populated from a FEEL expression.
91664
91455
  `;
91665
- function DownloadSettings(field, editField) {
91666
- const entries = [...EndpointKeyEntry({
91667
- field,
91668
- editField
91669
- })];
91670
- if (!entries.length) {
91671
- return null;
91672
- }
91673
- return {
91674
- id: 'downloadSettings',
91675
- label: 'Download settings',
91676
- entries
91677
- };
91678
- }
91679
91456
  class PropertiesProvider {
91680
91457
  constructor(propertiesPanel, injector) {
91681
91458
  this._injector = injector;
@@ -91711,7 +91488,7 @@
91711
91488
  return groups;
91712
91489
  }
91713
91490
  const getService = (type, strict = true) => this._injector.get(type, strict);
91714
- groups = [...groups, GeneralGroup(field, editField, getService), DownloadSettings(field, editField), ...OptionsGroups(field, editField, getService), ...TableHeaderGroups(field, editField), SecurityAttributesGroup(field, editField), ConditionGroup(field, editField), LayoutGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ConstraintsGroup(field, editField), ValidationGroup(field, editField), CustomPropertiesGroup(field, editField)].filter(group => group != null);
91491
+ groups = [...groups, GeneralGroup(field, editField, getService), ...OptionsGroups(field, editField, getService), ...TableHeaderGroups(field, editField), SecurityAttributesGroup(field, editField), ConditionGroup(field, editField), LayoutGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ConstraintsGroup(field, editField), ValidationGroup(field, editField), CustomPropertiesGroup(field, editField)].filter(group => group != null);
91715
91492
  this._filterVisibleEntries(groups, field, getService);
91716
91493
 
91717
91494
  // contract: if a group has no entries or items, it should not be displayed at all
@@ -92365,8 +92142,8 @@
92365
92142
  */
92366
92143
  this.value = empty;
92367
92144
  if (/\\[sWDnr]|\n|\r|\[\^/.test(query)) return new MultilineRegExpCursor(text, query, options, from, to);
92368
- this.re = new RegExp(query, baseFlags + ((options === null || options === undefined ? undefined : options.ignoreCase) ? "i" : ""));
92369
- this.test = options === null || options === undefined ? undefined : options.test;
92145
+ this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? "i" : ""));
92146
+ this.test = options === null || options === void 0 ? void 0 : options.test;
92370
92147
  this.iter = text.iter();
92371
92148
  let startLine = text.lineAt(from);
92372
92149
  this.curLineStart = startLine.from;
@@ -92456,8 +92233,8 @@
92456
92233
  this.done = false;
92457
92234
  this.value = empty;
92458
92235
  this.matchPos = toCharEnd(text, from);
92459
- this.re = new RegExp(query, baseFlags + ((options === null || options === undefined ? undefined : options.ignoreCase) ? "i" : ""));
92460
- this.test = options === null || options === undefined ? undefined : options.test;
92236
+ this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? "i" : ""));
92237
+ this.test = options === null || options === void 0 ? void 0 : options.test;
92461
92238
  this.flat = FlattenedDoc.get(text, from, this.chunkEnd(from + 5000 /* Chunk.Base */));
92462
92239
  }
92463
92240
  chunkEnd(pos) {
@@ -93196,10 +92973,10 @@
93196
92973
  if (fallback && !selText) return fallback;
93197
92974
  let config = state.facet(searchConfigFacet);
93198
92975
  return new SearchQuery({
93199
- search: ((_a = fallback === null || fallback === undefined ? undefined : fallback.literal) !== null && _a !== undefined ? _a : config.literal) ? selText : selText.replace(/\n/g, "\\n"),
93200
- caseSensitive: (_b = fallback === null || fallback === undefined ? undefined : fallback.caseSensitive) !== null && _b !== undefined ? _b : config.caseSensitive,
93201
- literal: (_c = fallback === null || fallback === undefined ? undefined : fallback.literal) !== null && _c !== undefined ? _c : config.literal,
93202
- wholeWord: (_d = fallback === null || fallback === undefined ? undefined : fallback.wholeWord) !== null && _d !== undefined ? _d : config.wholeWord
92976
+ search: ((_a = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _a !== void 0 ? _a : config.literal) ? selText : selText.replace(/\n/g, "\\n"),
92977
+ caseSensitive: (_b = fallback === null || fallback === void 0 ? void 0 : fallback.caseSensitive) !== null && _b !== void 0 ? _b : config.caseSensitive,
92978
+ literal: (_c = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _c !== void 0 ? _c : config.literal,
92979
+ wholeWord: (_d = fallback === null || fallback === void 0 ? void 0 : fallback.wholeWord) !== null && _d !== void 0 ? _d : config.wholeWord
93203
92980
  });
93204
92981
  }
93205
92982
  /**
@@ -93599,25 +93376,130 @@
93599
93376
  override: [completions]
93600
93377
  })];
93601
93378
  }
93379
+
93380
+ /**
93381
+ * @param {import('@codemirror/autocomplete').CompletionContext} context
93382
+ */
93602
93383
  function completions(context) {
93603
93384
  const variables = context.state.facet(variablesFacet)[0];
93604
- const options = variables.map(v => ({
93605
- label: v,
93385
+ /** @type {import('@codemirror/autocomplete').Completion[]} */
93386
+ const objectOptions = variables.map(label => ({
93387
+ displayLabel: `"${label}"`,
93388
+ label: `"${label}": `,
93389
+ type: 'variable',
93390
+ apply: (view, completion, from, to) => {
93391
+ const doc = view.state.doc;
93392
+ const beforeChar = doc.sliceString(from - 1, from);
93393
+ const line = doc.lineAt(from);
93394
+ const indentation = /^\s*/.exec(line.text)[0];
93395
+ const baseInsert = completion.label;
93396
+ if (beforeChar === '{') {
93397
+ const insert = `\n ${indentation}${baseInsert},\n`;
93398
+ view.dispatch({
93399
+ changes: {
93400
+ from,
93401
+ to,
93402
+ insert
93403
+ },
93404
+ selection: {
93405
+ anchor: from + insert.length - 2
93406
+ }
93407
+ });
93408
+ } else if (beforeChar === ',') {
93409
+ const insert = `\n${indentation}${baseInsert},`;
93410
+ view.dispatch({
93411
+ changes: {
93412
+ from,
93413
+ to,
93414
+ insert
93415
+ },
93416
+ selection: {
93417
+ anchor: from + insert.length - 1
93418
+ }
93419
+ });
93420
+ } else {
93421
+ const insert = `${baseInsert},`;
93422
+ view.dispatch({
93423
+ changes: {
93424
+ from,
93425
+ to,
93426
+ insert
93427
+ },
93428
+ selection: {
93429
+ anchor: from + insert.length - 1
93430
+ }
93431
+ });
93432
+ }
93433
+ }
93434
+ }));
93435
+ /** @type {import('@codemirror/autocomplete').Completion[]} */
93436
+ const propertyNameOptions = variables.map(label => ({
93437
+ label,
93606
93438
  type: 'variable'
93607
93439
  }));
93440
+ /** @type {import('@codemirror/autocomplete').Completion[]} */
93441
+ const propertyValueOptions = [{
93442
+ label: 'true',
93443
+ type: 'constant keyword',
93444
+ boost: 3
93445
+ }, {
93446
+ label: 'false',
93447
+ type: 'constant keyword',
93448
+ boost: 2
93449
+ }, {
93450
+ label: 'null',
93451
+ type: 'constant keyword',
93452
+ boost: 1
93453
+ }, {
93454
+ displayLabel: '[ .. ]',
93455
+ label: '[ ]',
93456
+ apply: (view, completion, from, to) => {
93457
+ view.dispatch({
93458
+ changes: {
93459
+ from,
93460
+ to,
93461
+ insert: completion.label
93462
+ },
93463
+ selection: {
93464
+ anchor: from + 2
93465
+ }
93466
+ });
93467
+ }
93468
+ }, {
93469
+ displayLabel: '{ .. }',
93470
+ label: '{ }',
93471
+ apply: (view, completion, from, to) => {
93472
+ view.dispatch({
93473
+ changes: {
93474
+ from,
93475
+ to,
93476
+ insert: completion.label
93477
+ },
93478
+ selection: {
93479
+ anchor: from + 2
93480
+ }
93481
+ });
93482
+ }
93483
+ }];
93484
+ let finalOptions = [];
93608
93485
  let nodeBefore = syntaxTree(context.state).resolve(context.pos, -1);
93609
-
93610
- // handle inside property name as explicit call
93486
+ let word = context.matchBefore(/\w*/);
93487
+ if (['Object', '{'].includes(nodeBefore.type.name)) {
93488
+ finalOptions = objectOptions;
93489
+ }
93611
93490
  if (nodeBefore.type.name === 'PropertyName') {
93612
93491
  context.explicit = true;
93492
+ finalOptions = propertyNameOptions;
93493
+ }
93494
+ if (['Property', '[', 'Array'].includes(nodeBefore.type.name)) {
93495
+ finalOptions = propertyValueOptions;
93613
93496
  }
93614
- let word = context.matchBefore(/\w*/);
93615
93497
  if (word.from == word.to && !context.explicit) {
93616
93498
  return null;
93617
93499
  }
93618
93500
  return {
93619
93501
  from: word.from,
93620
- options
93502
+ options: finalOptions
93621
93503
  };
93622
93504
  }
93623
93505