@grapesjs/studio-sdk-plugins 1.0.21-rc.1 → 1.0.21

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.
@@ -669,7 +669,7 @@ function $e(n, e) {
669
669
  let t = e.length - 1;
670
670
  t >= 0 && n.isText && n.sameMarkup(e[t]) ? e[t] = n.withText(e[t].text + n.text) : e.push(n);
671
671
  }
672
- function kt(n, e, t, r) {
672
+ function St(n, e, t, r) {
673
673
  let i = (e || n).node(t), s = 0, o = e ? e.index(t) : i.childCount;
674
674
  n && (s = n.index(t), n.depth > t ? s++ : n.textOffset && ($e(n.nodeAfter, r), s++));
675
675
  for (let l = s; l < o; l++)
@@ -681,15 +681,15 @@ function We(n, e) {
681
681
  }
682
682
  function ns(n, e, t, r, i) {
683
683
  let s = n.depth > i && Jn(n, e, i + 1), o = r.depth > i && Jn(t, r, i + 1), l = [];
684
- return kt(null, n, i, l), s && o && e.index(i) == t.index(i) ? (ts(s, o), $e(We(s, ns(n, e, t, r, i + 1)), l)) : (s && $e(We(s, Zt(n, e, i + 1)), l), kt(e, t, i, l), o && $e(We(o, Zt(t, r, i + 1)), l)), kt(r, null, i, l), new y(l);
684
+ return St(null, n, i, l), s && o && e.index(i) == t.index(i) ? (ts(s, o), $e(We(s, ns(n, e, t, r, i + 1)), l)) : (s && $e(We(s, Zt(n, e, i + 1)), l), St(e, t, i, l), o && $e(We(o, Zt(t, r, i + 1)), l)), St(r, null, i, l), new y(l);
685
685
  }
686
686
  function Zt(n, e, t) {
687
687
  let r = [];
688
- if (kt(null, n, t, r), n.depth > t) {
688
+ if (St(null, n, t, r), n.depth > t) {
689
689
  let i = Jn(n, e, t + 1);
690
690
  $e(We(i, Zt(n, e, t + 1)), r);
691
691
  }
692
- return kt(e, null, t, r), new y(r);
692
+ return St(e, null, t, r), new y(r);
693
693
  }
694
694
  function Jo(n, e) {
695
695
  let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
@@ -700,7 +700,7 @@ function Jo(n, e) {
700
700
  end: i.resolveNoCache(i.content.size - n.openEnd - t)
701
701
  };
702
702
  }
703
- class Ot {
703
+ class Nt {
704
704
  /**
705
705
  @internal
706
706
  */
@@ -928,7 +928,7 @@ class Ot {
928
928
  break;
929
929
  s = c - 1, i += a + 1;
930
930
  }
931
- return new Ot(t, r, s);
931
+ return new Nt(t, r, s);
932
932
  }
933
933
  /**
934
934
  @internal
@@ -943,7 +943,7 @@ class Ot {
943
943
  }
944
944
  else
945
945
  Dr.set(e, r = new qo());
946
- let i = r.elts[r.i] = Ot.resolve(e, t);
946
+ let i = r.elts[r.i] = Nt.resolve(e, t);
947
947
  return r.i = (r.i + 1) % Ko, i;
948
948
  }
949
949
  }
@@ -1198,13 +1198,13 @@ let Je = class qn {
1198
1198
  [object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.
1199
1199
  */
1200
1200
  resolve(e) {
1201
- return Ot.resolveCached(this, e);
1201
+ return Nt.resolveCached(this, e);
1202
1202
  }
1203
1203
  /**
1204
1204
  @internal
1205
1205
  */
1206
1206
  resolveNoCache(e) {
1207
- return Ot.resolve(this, e);
1207
+ return Nt.resolve(this, e);
1208
1208
  }
1209
1209
  /**
1210
1210
  Test whether a given mark or mark type occurs in this document
@@ -2301,13 +2301,13 @@ const ds = {
2301
2301
  script: !0,
2302
2302
  style: !0,
2303
2303
  title: !0
2304
- }, us = { ol: !0, ul: !0 }, tn = 1, nn = 2, St = 4;
2304
+ }, us = { ol: !0, ul: !0 }, tn = 1, nn = 2, Ct = 4;
2305
2305
  function zr(n, e, t) {
2306
- return e != null ? (e ? tn : 0) | (e === "full" ? nn : 0) : n && n.whitespace == "pre" ? tn | nn : t & ~St;
2306
+ return e != null ? (e ? tn : 0) | (e === "full" ? nn : 0) : n && n.whitespace == "pre" ? tn | nn : t & ~Ct;
2307
2307
  }
2308
2308
  class Ht {
2309
2309
  constructor(e, t, r, i, s, o) {
2310
- this.type = e, this.attrs = t, this.marks = r, this.solid = i, this.options = o, this.content = [], this.activeMarks = N.none, this.match = s || (o & St ? null : e.contentMatch);
2310
+ this.type = e, this.attrs = t, this.marks = r, this.solid = i, this.options = o, this.content = [], this.activeMarks = N.none, this.match = s || (o & Ct ? null : e.contentMatch);
2311
2311
  }
2312
2312
  findWrapping(e) {
2313
2313
  if (!this.match) {
@@ -2341,7 +2341,7 @@ class Ht {
2341
2341
  class Br {
2342
2342
  constructor(e, t, r) {
2343
2343
  this.parser = e, this.options = t, this.isOpen = r, this.open = 0;
2344
- let i = t.topNode, s, o = zr(null, t.preserveWhitespace, 0) | (r ? St : 0);
2344
+ let i = t.topNode, s, o = zr(null, t.preserveWhitespace, 0) | (r ? Ct : 0);
2345
2345
  i ? s = new Ht(i.type, i.attrs, N.none, !0, t.topMatch || i.type.contentMatch, o) : r ? s = new Ht(null, null, N.none, !0, null, o) : s = new Ht(e.schema.topNodeType, null, N.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
2346
2346
  }
2347
2347
  get top() {
@@ -2508,7 +2508,7 @@ class Br {
2508
2508
  let o = this.top;
2509
2509
  o.match = o.match && o.match.matchType(e);
2510
2510
  let l = zr(e, s, o.options);
2511
- o.options & St && o.content.length == 0 && (l |= St);
2511
+ o.options & Ct && o.content.length == 0 && (l |= Ct);
2512
2512
  let a = N.none;
2513
2513
  return r = r.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : Vr(c.type, e)) ? (a = c.addToSet(a), !1) : !0), this.nodes.push(new Ht(e, t, a, i, null, l)), this.open++, r;
2514
2514
  }
@@ -3785,9 +3785,9 @@ class El {
3785
3785
  let { content: e, openStart: t, openEnd: r } = this.unplaced, i = On(e, t);
3786
3786
  if (i.childCount <= 1 && t > 0) {
3787
3787
  let s = e.size - t <= t + i.size;
3788
- this.unplaced = new x(yt(e, t - 1, 1), t - 1, s ? t - 1 : r);
3788
+ this.unplaced = new x(bt(e, t - 1, 1), t - 1, s ? t - 1 : r);
3789
3789
  } else
3790
- this.unplaced = new x(yt(e, t, 1), t, r);
3790
+ this.unplaced = new x(bt(e, t, 1), t, r);
3791
3791
  }
3792
3792
  // Move content from the unplaced slice at `sliceDepth` to the
3793
3793
  // frontier node at `frontierDepth`. Close that frontier node when
@@ -3812,12 +3812,12 @@ class El {
3812
3812
  c++, (c > 1 || a == 0 || m.content.size) && (h = g, f.push(ws(m.mark(d.allowedMarks(m.marks)), c == 1 ? a : 0, c == l.childCount ? u : -1)));
3813
3813
  }
3814
3814
  let p = c == l.childCount;
3815
- p || (u = -1), this.placed = bt(this.placed, t, y.from(f)), this.frontier[t].match = h, p && u < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
3815
+ p || (u = -1), this.placed = xt(this.placed, t, y.from(f)), this.frontier[t].match = h, p && u < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
3816
3816
  for (let m = 0, g = l; m < u; m++) {
3817
3817
  let b = g.lastChild;
3818
3818
  this.frontier.push({ type: b.type, match: b.contentMatchAt(b.childCount) }), g = b.content;
3819
3819
  }
3820
- this.unplaced = p ? e == 0 ? x.empty : new x(yt(o.content, e - 1, 1), e - 1, u < 0 ? o.openEnd : e - 1) : new x(yt(o.content, e, c), o.openStart, o.openEnd);
3820
+ this.unplaced = p ? e == 0 ? x.empty : new x(bt(o.content, e - 1, 1), e - 1, u < 0 ? o.openEnd : e - 1) : new x(bt(o.content, e, c), o.openStart, o.openEnd);
3821
3821
  }
3822
3822
  mustMoveInline() {
3823
3823
  if (!this.$to.parent.isTextblock)
@@ -3849,7 +3849,7 @@ class El {
3849
3849
  return null;
3850
3850
  for (; this.depth > t.depth; )
3851
3851
  this.closeFrontierNode();
3852
- t.fit.childCount && (this.placed = bt(this.placed, t.depth, t.fit)), e = t.move;
3852
+ t.fit.childCount && (this.placed = xt(this.placed, t.depth, t.fit)), e = t.move;
3853
3853
  for (let r = t.depth + 1; r <= e.depth; r++) {
3854
3854
  let i = e.node(r), s = i.type.contentMatch.fillBefore(i.content, !0, e.index(r));
3855
3855
  this.openFrontierNode(i.type, i.attrs, s);
@@ -3858,18 +3858,18 @@ class El {
3858
3858
  }
3859
3859
  openFrontierNode(e, t = null, r) {
3860
3860
  let i = this.frontier[this.depth];
3861
- i.match = i.match.matchType(e), this.placed = bt(this.placed, this.depth, y.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
3861
+ i.match = i.match.matchType(e), this.placed = xt(this.placed, this.depth, y.from(e.create(t, r))), this.frontier.push({ type: e, match: e.contentMatch });
3862
3862
  }
3863
3863
  closeFrontierNode() {
3864
3864
  let t = this.frontier.pop().match.fillBefore(y.empty, !0);
3865
- t.childCount && (this.placed = bt(this.placed, this.frontier.length, t));
3865
+ t.childCount && (this.placed = xt(this.placed, this.frontier.length, t));
3866
3866
  }
3867
3867
  }
3868
- function yt(n, e, t) {
3869
- return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(yt(n.firstChild.content, e - 1, t)));
3870
- }
3871
3868
  function bt(n, e, t) {
3872
- return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(bt(n.lastChild.content, e - 1, t)));
3869
+ return e == 0 ? n.cutByIndex(t, n.childCount) : n.replaceChild(0, n.firstChild.copy(bt(n.firstChild.content, e - 1, t)));
3870
+ }
3871
+ function xt(n, e, t) {
3872
+ return e == 0 ? n.append(t) : n.replaceChild(n.childCount - 1, n.lastChild.copy(xt(n.lastChild.content, e - 1, t)));
3873
3873
  }
3874
3874
  function On(n, e) {
3875
3875
  for (let t = 0; t < e; t++)
@@ -4025,7 +4025,7 @@ class st extends W {
4025
4025
  }
4026
4026
  }
4027
4027
  W.jsonID("attr", st);
4028
- class Nt extends W {
4028
+ class Tt extends W {
4029
4029
  /**
4030
4030
  Construct an attribute step.
4031
4031
  */
@@ -4044,7 +4044,7 @@ class Nt extends W {
4044
4044
  return G.empty;
4045
4045
  }
4046
4046
  invert(e) {
4047
- return new Nt(this.attr, e.attrs[this.attr]);
4047
+ return new Tt(this.attr, e.attrs[this.attr]);
4048
4048
  }
4049
4049
  map(e) {
4050
4050
  return this;
@@ -4055,10 +4055,10 @@ class Nt extends W {
4055
4055
  static fromJSON(e, t) {
4056
4056
  if (typeof t.attr != "string")
4057
4057
  throw new RangeError("Invalid input for DocAttrStep.fromJSON");
4058
- return new Nt(t.attr, t.value);
4058
+ return new Tt(t.attr, t.value);
4059
4059
  }
4060
4060
  }
4061
- W.jsonID("docAttr", Nt);
4061
+ W.jsonID("docAttr", Tt);
4062
4062
  let ct = class extends Error {
4063
4063
  };
4064
4064
  ct = function n(e) {
@@ -4231,7 +4231,7 @@ class Ns {
4231
4231
  Set a single attribute on the document to a new value.
4232
4232
  */
4233
4233
  setDocAttribute(e, t) {
4234
- return this.step(new Nt(e, t)), this;
4234
+ return this.step(new Tt(e, t)), this;
4235
4235
  }
4236
4236
  /**
4237
4237
  Add a mark to the node at position `pos`.
@@ -4838,13 +4838,13 @@ class Vl extends Ns {
4838
4838
  function jr(n, e) {
4839
4839
  return !e || !n ? n : n.bind(e);
4840
4840
  }
4841
- class xt {
4841
+ class kt {
4842
4842
  constructor(e, t, r) {
4843
4843
  this.name = e, this.init = jr(t.init, r), this.apply = jr(t.apply, r);
4844
4844
  }
4845
4845
  }
4846
4846
  const Fl = [
4847
- new xt("doc", {
4847
+ new kt("doc", {
4848
4848
  init(n) {
4849
4849
  return n.doc || n.schema.topNodeType.createAndFill();
4850
4850
  },
@@ -4852,7 +4852,7 @@ const Fl = [
4852
4852
  return n.doc;
4853
4853
  }
4854
4854
  }),
4855
- new xt("selection", {
4855
+ new kt("selection", {
4856
4856
  init(n, e) {
4857
4857
  return n.selection || S.atStart(e.doc);
4858
4858
  },
@@ -4860,7 +4860,7 @@ const Fl = [
4860
4860
  return n.selection;
4861
4861
  }
4862
4862
  }),
4863
- new xt("storedMarks", {
4863
+ new kt("storedMarks", {
4864
4864
  init(n) {
4865
4865
  return n.storedMarks || null;
4866
4866
  },
@@ -4868,7 +4868,7 @@ const Fl = [
4868
4868
  return r.selection.$cursor ? n.storedMarks : null;
4869
4869
  }
4870
4870
  }),
4871
- new xt("scrollToSelection", {
4871
+ new kt("scrollToSelection", {
4872
4872
  init() {
4873
4873
  return 0;
4874
4874
  },
@@ -4882,7 +4882,7 @@ class An {
4882
4882
  this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Fl.slice(), t && t.forEach((r) => {
4883
4883
  if (this.pluginsByKey[r.key])
4884
4884
  throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
4885
- this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new xt(r.key, r.spec.state, r));
4885
+ this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new kt(r.key, r.spec.state, r));
4886
4886
  });
4887
4887
  }
4888
4888
  }
@@ -5058,7 +5058,7 @@ function As(n, e, t) {
5058
5058
  }
5059
5059
  return t;
5060
5060
  }
5061
- class It {
5061
+ class ut {
5062
5062
  /**
5063
5063
  Create a plugin.
5064
5064
  */
@@ -5410,7 +5410,7 @@ function Pe(n, e = null, t) {
5410
5410
  return !0;
5411
5411
  };
5412
5412
  }
5413
- function Tt(...n) {
5413
+ function At(...n) {
5414
5414
  return function(e, t, r) {
5415
5415
  for (let i = 0; i < n.length; i++)
5416
5416
  if (n[i](e, t, r))
@@ -5418,9 +5418,9 @@ function Tt(...n) {
5418
5418
  return !1;
5419
5419
  };
5420
5420
  }
5421
- let En = Tt(Es, Hl, $l), Gr = Tt(Es, Jl, ql);
5421
+ let En = At(Es, Hl, $l), Gr = At(Es, Jl, ql);
5422
5422
  const ge = {
5423
- Enter: Tt(Kl, Ul, zs, jl),
5423
+ Enter: At(Kl, Ul, zs, jl),
5424
5424
  "Mod-Enter": vs,
5425
5425
  Backspace: En,
5426
5426
  "Mod-Backspace": En,
@@ -5744,7 +5744,7 @@ function ca(n = {}) {
5744
5744
  return n = {
5745
5745
  depth: n.depth || 100,
5746
5746
  newGroupDelay: n.newGroupDelay || 500
5747
- }, new It({
5747
+ }, new ut({
5748
5748
  key: qe,
5749
5749
  state: {
5750
5750
  init() {
@@ -5898,7 +5898,7 @@ function zn(n, e, t = !0) {
5898
5898
  return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
5899
5899
  }
5900
5900
  function Bn(n) {
5901
- return new It({ props: { handleKeyDown: Js(n) } });
5901
+ return new ut({ props: { handleKeyDown: Js(n) } });
5902
5902
  }
5903
5903
  function Js(n) {
5904
5904
  let e = ma(n);
@@ -6030,7 +6030,7 @@ const V = function(n) {
6030
6030
  for (var e = 0; ; e++)
6031
6031
  if (n = n.previousSibling, !n)
6032
6032
  return e;
6033
- }, At = function(n) {
6033
+ }, Dt = function(n) {
6034
6034
  let e = n.assignedSlot || n.parentNode;
6035
6035
  return e && e.nodeType == 11 ? e.host : e;
6036
6036
  };
@@ -6165,7 +6165,7 @@ function Ra(n) {
6165
6165
  }
6166
6166
  function ei(n, e, t) {
6167
6167
  let r = n.someProp("scrollThreshold") || 0, i = n.someProp("scrollMargin") || 5, s = n.dom.ownerDocument;
6168
- for (let o = t || n.dom; o; o = At(o)) {
6168
+ for (let o = t || n.dom; o; o = Dt(o)) {
6169
6169
  if (o.nodeType != 1)
6170
6170
  continue;
6171
6171
  let l = o, a = l == s.body, c = a ? Ea(s) : Ra(l), f = 0, h = 0;
@@ -6198,7 +6198,7 @@ function Ia(n) {
6198
6198
  }
6199
6199
  function Us(n) {
6200
6200
  let e = [], t = n.ownerDocument;
6201
- for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r = At(r))
6201
+ for (let r = n; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), n != t); r = Dt(r))
6202
6202
  ;
6203
6203
  return e;
6204
6204
  }
@@ -6321,7 +6321,7 @@ function La(n, e) {
6321
6321
  return null;
6322
6322
  }
6323
6323
  if (J)
6324
- for (let c = o; r && c; c = At(c))
6324
+ for (let c = o; r && c; c = Dt(c))
6325
6325
  c.draggable && (r = void 0);
6326
6326
  if (o = Pa(o, e), r) {
6327
6327
  if (ie && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
@@ -6358,13 +6358,13 @@ function Xs(n, e, t) {
6358
6358
  if (c.top == a.top) {
6359
6359
  let f = Se(me(r, i, i + 1), -1);
6360
6360
  if (f.top != a.top)
6361
- return ut(f, f.left < c.left);
6361
+ return pt(f, f.left < c.left);
6362
6362
  }
6363
6363
  }
6364
6364
  return a;
6365
6365
  } else {
6366
6366
  let a = i, c = i, f = t < 0 ? 1 : -1;
6367
- return t < 0 && !i ? (c++, f = -1) : t >= 0 && i == r.nodeValue.length ? (a--, f = 1) : t < 0 ? a-- : c++, ut(Se(me(r, a, c), f), f < 0);
6367
+ return t < 0 && !i ? (c++, f = -1) : t >= 0 && i == r.nodeValue.length ? (a--, f = 1) : t < 0 ? a-- : c++, pt(Se(me(r, a, c), f), f < 0);
6368
6368
  }
6369
6369
  if (!n.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
6370
6370
  if (s == null && i && (t < 0 || i == Q(r))) {
@@ -6382,7 +6382,7 @@ function Xs(n, e, t) {
6382
6382
  if (s == null && i && (t < 0 || i == Q(r))) {
6383
6383
  let a = r.childNodes[i - 1], c = a.nodeType == 3 ? me(a, Q(a) - (o ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
6384
6384
  if (c)
6385
- return ut(Se(c, 1), !1);
6385
+ return pt(Se(c, 1), !1);
6386
6386
  }
6387
6387
  if (s == null && i < Q(r)) {
6388
6388
  let a = r.childNodes[i];
@@ -6390,11 +6390,11 @@ function Xs(n, e, t) {
6390
6390
  a = a.nextSibling;
6391
6391
  let c = a ? a.nodeType == 3 ? me(a, 0, o ? 0 : 1) : a.nodeType == 1 ? a : null : null;
6392
6392
  if (c)
6393
- return ut(Se(c, -1), !0);
6393
+ return pt(Se(c, -1), !0);
6394
6394
  }
6395
- return ut(Se(r.nodeType == 3 ? me(r) : r, -t), t >= 0);
6395
+ return pt(Se(r.nodeType == 3 ? me(r) : r, -t), t >= 0);
6396
6396
  }
6397
- function ut(n, e) {
6397
+ function pt(n, e) {
6398
6398
  if (n.width == 0)
6399
6399
  return n;
6400
6400
  let t = e ? n.left : n.right;
@@ -7138,22 +7138,22 @@ function eo(n, e, t) {
7138
7138
  r = li(r), i = !0;
7139
7139
  i && t.trackWrites == n && (t.trackWrites = null);
7140
7140
  }
7141
- const Ct = function(n) {
7141
+ const wt = function(n) {
7142
7142
  n && (this.nodeName = n);
7143
7143
  };
7144
- Ct.prototype = /* @__PURE__ */ Object.create(null);
7145
- const Le = [new Ct()];
7144
+ wt.prototype = /* @__PURE__ */ Object.create(null);
7145
+ const Le = [new wt()];
7146
7146
  function Qn(n, e, t) {
7147
7147
  if (n.length == 0)
7148
7148
  return Le;
7149
- let r = t ? Le[0] : new Ct(), i = [r];
7149
+ let r = t ? Le[0] : new wt(), i = [r];
7150
7150
  for (let s = 0; s < n.length; s++) {
7151
7151
  let o = n[s].type.attrs;
7152
7152
  if (o) {
7153
- o.nodeName && i.push(r = new Ct(o.nodeName));
7153
+ o.nodeName && i.push(r = new wt(o.nodeName));
7154
7154
  for (let l in o) {
7155
7155
  let a = o[l];
7156
- a != null && (t && i.length == 1 && i.push(r = new Ct(e.isInline ? "span" : "div")), l == "class" ? r.class = (r.class ? r.class + " " : "") + a : l == "style" ? r.style = (r.style ? r.style + ";" : "") + a : l != "nodeName" && (r[l] = a));
7156
+ a != null && (t && i.length == 1 && i.push(r = new wt(e.isInline ? "span" : "div")), l == "class" ? r.class = (r.class ? r.class + " " : "") + a : l == "style" ? r.style = (r.style ? r.style + ";" : "") + a : l != "nodeName" && (r[l] = a));
7157
7157
  }
7158
7158
  }
7159
7159
  }
@@ -7641,7 +7641,7 @@ function ui(n, e, t) {
7641
7641
  function ln(n) {
7642
7642
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
7643
7643
  }
7644
- function wt(n, e) {
7644
+ function Mt(n, e) {
7645
7645
  let t = n.pmViewDesc;
7646
7646
  return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
7647
7647
  }
@@ -7653,13 +7653,13 @@ function rc(n) {
7653
7653
  if (!t)
7654
7654
  return;
7655
7655
  let i, s, o = !1;
7656
- for (ie && t.nodeType == 1 && r < ln(t) && wt(t.childNodes[r], -1) && (o = !0); ; )
7656
+ for (ie && t.nodeType == 1 && r < ln(t) && Mt(t.childNodes[r], -1) && (o = !0); ; )
7657
7657
  if (r > 0) {
7658
7658
  if (t.nodeType != 1)
7659
7659
  break;
7660
7660
  {
7661
7661
  let l = t.childNodes[r - 1];
7662
- if (wt(l, -1))
7662
+ if (Mt(l, -1))
7663
7663
  i = t, s = --r;
7664
7664
  else if (l.nodeType == 3)
7665
7665
  t = l, r = t.nodeValue.length;
@@ -7671,7 +7671,7 @@ function rc(n) {
7671
7671
  break;
7672
7672
  {
7673
7673
  let l = t.previousSibling;
7674
- for (; l && wt(l, -1); )
7674
+ for (; l && Mt(l, -1); )
7675
7675
  i = t.parentNode, s = V(l), l = l.previousSibling;
7676
7676
  if (l)
7677
7677
  t = l, r = ln(t);
@@ -7694,7 +7694,7 @@ function ic(n) {
7694
7694
  if (t.nodeType != 1)
7695
7695
  break;
7696
7696
  let l = t.childNodes[r];
7697
- if (wt(l, 1))
7697
+ if (Mt(l, 1))
7698
7698
  s = t, o = ++r;
7699
7699
  else
7700
7700
  break;
@@ -7703,7 +7703,7 @@ function ic(n) {
7703
7703
  break;
7704
7704
  {
7705
7705
  let l = t.nextSibling;
7706
- for (; l && wt(l, 1); )
7706
+ for (; l && Mt(l, 1); )
7707
7707
  s = l.parentNode, o = V(l) + 1, l = l.nextSibling;
7708
7708
  if (l)
7709
7709
  t = l, r = 0, i = ln(t);
@@ -8332,12 +8332,12 @@ function vc(n, e) {
8332
8332
  t.parentNode && t.parentNode.removeChild(t), n.focus();
8333
8333
  }, 50);
8334
8334
  }
8335
- const Dt = j && Ee < 15 || ht && Da < 604;
8335
+ const Et = j && Ee < 15 || ht && Da < 604;
8336
8336
  q.copy = K.cut = (n, e) => {
8337
8337
  let t = e, r = n.state.selection, i = t.type == "cut";
8338
8338
  if (r.empty)
8339
8339
  return;
8340
- let s = Dt ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = lo(n, o);
8340
+ let s = Et ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = lo(n, o);
8341
8341
  s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : vc(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
8342
8342
  };
8343
8343
  function zc(n) {
@@ -8350,10 +8350,10 @@ function Bc(n, e) {
8350
8350
  t || (r.contentEditable = "true"), r.style.cssText = "position: fixed; left: -10000px; top: 10px", r.focus();
8351
8351
  let i = n.input.shiftKey && n.input.lastKeyCode != 45;
8352
8352
  setTimeout(() => {
8353
- n.focus(), r.parentNode && r.parentNode.removeChild(r), t ? Et(n, r.value, null, i, e) : Et(n, r.textContent, r.innerHTML, i, e);
8353
+ n.focus(), r.parentNode && r.parentNode.removeChild(r), t ? Rt(n, r.value, null, i, e) : Rt(n, r.textContent, r.innerHTML, i, e);
8354
8354
  }, 50);
8355
8355
  }
8356
- function Et(n, e, t, r, i) {
8356
+ function Rt(n, e, t, r, i) {
8357
8357
  let s = ao(n, e, t, r, n.state.selection.$from);
8358
8358
  if (n.someProp("handlePaste", (a) => a(n, i, s || x.empty)))
8359
8359
  return !0;
@@ -8373,8 +8373,8 @@ K.paste = (n, e) => {
8373
8373
  let t = e;
8374
8374
  if (n.composing && !ne)
8375
8375
  return;
8376
- let r = Dt ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
8377
- r && Et(n, xo(r), r.getData("text/html"), i, t) ? t.preventDefault() : Bc(n, t);
8376
+ let r = Et ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
8377
+ r && Rt(n, xo(r), r.getData("text/html"), i, t) ? t.preventDefault() : Bc(n, t);
8378
8378
  };
8379
8379
  class ko {
8380
8380
  constructor(e, t, r) {
@@ -8396,7 +8396,7 @@ q.dragstart = (n, e) => {
8396
8396
  }
8397
8397
  }
8398
8398
  let l = (o || n.state.selection).content(), { dom: a, text: c, slice: f } = lo(n, l);
8399
- (!t.dataTransfer.files.length || !$ || Ks > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Dt ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Dt || t.dataTransfer.setData("text/plain", c), n.dragging = new ko(f, !t[So], o);
8399
+ (!t.dataTransfer.files.length || !$ || Ks > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Et ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Et || t.dataTransfer.setData("text/plain", c), n.dragging = new ko(f, !t[So], o);
8400
8400
  };
8401
8401
  q.dragend = (n) => {
8402
8402
  let e = n.dragging;
@@ -8415,7 +8415,7 @@ K.drop = (n, e) => {
8415
8415
  let s = n.state.doc.resolve(i.pos), o = r && r.slice;
8416
8416
  o ? n.someProp("transformPasted", (p) => {
8417
8417
  o = p(o, n);
8418
- }) : o = ao(n, xo(t.dataTransfer), Dt ? null : t.dataTransfer.getData("text/html"), !1, s);
8418
+ }) : o = ao(n, xo(t.dataTransfer), Et ? null : t.dataTransfer.getData("text/html"), !1, s);
8419
8419
  let l = !!(r && !t[So]);
8420
8420
  if (n.someProp("handleDrop", (p) => p(n, t, o || x.empty, l))) {
8421
8421
  t.preventDefault();
@@ -8466,7 +8466,7 @@ q.beforeinput = (n, e) => {
8466
8466
  };
8467
8467
  for (let n in K)
8468
8468
  q[n] = K[n];
8469
- function Rt(n, e) {
8469
+ function It(n, e) {
8470
8470
  if (n == e)
8471
8471
  return !0;
8472
8472
  for (let t in n)
@@ -8489,7 +8489,7 @@ class cn {
8489
8489
  return !0;
8490
8490
  }
8491
8491
  eq(e) {
8492
- return this == e || e instanceof cn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Rt(this.spec, e.spec));
8492
+ return this == e || e instanceof cn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && It(this.spec, e.spec));
8493
8493
  }
8494
8494
  destroy(e) {
8495
8495
  this.spec.destroy && this.spec.destroy(e);
@@ -8507,7 +8507,7 @@ class Ie {
8507
8507
  return t.from < t.to;
8508
8508
  }
8509
8509
  eq(e) {
8510
- return this == e || e instanceof Ie && Rt(this.attrs, e.attrs) && Rt(this.spec, e.spec);
8510
+ return this == e || e instanceof Ie && It(this.attrs, e.attrs) && It(this.spec, e.spec);
8511
8511
  }
8512
8512
  static is(e) {
8513
8513
  return e.type instanceof Ie;
@@ -8531,7 +8531,7 @@ class Cr {
8531
8531
  return i == t.from && !(s = e.child(r)).isText && i + s.nodeSize == t.to;
8532
8532
  }
8533
8533
  eq(e) {
8534
- return this == e || e instanceof Cr && Rt(this.attrs, e.attrs) && Rt(this.spec, e.spec);
8534
+ return this == e || e instanceof Cr && It(this.attrs, e.attrs) && It(this.spec, e.spec);
8535
8535
  }
8536
8536
  destroy() {
8537
8537
  }
@@ -9057,9 +9057,9 @@ class $c {
9057
9057
  if (!e.focusNode)
9058
9058
  return !0;
9059
9059
  let t = /* @__PURE__ */ new Set(), r;
9060
- for (let s = e.focusNode; s; s = At(s))
9060
+ for (let s = e.focusNode; s; s = Dt(s))
9061
9061
  t.add(s);
9062
- for (let s = e.anchorNode; s; s = At(s))
9062
+ for (let s = e.anchorNode; s; s = Dt(s))
9063
9063
  if (t.has(s)) {
9064
9064
  r = s;
9065
9065
  break;
@@ -9634,13 +9634,13 @@ class Zc {
9634
9634
  [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
9635
9635
  */
9636
9636
  pasteHTML(e, t) {
9637
- return Et(this, "", e, !1, t || new ClipboardEvent("paste"));
9637
+ return Rt(this, "", e, !1, t || new ClipboardEvent("paste"));
9638
9638
  }
9639
9639
  /**
9640
9640
  Run the editor's paste logic with the given plain-text input.
9641
9641
  */
9642
9642
  pasteText(e, t) {
9643
- return Et(this, e, null, !0, t || new ClipboardEvent("paste"));
9643
+ return Rt(this, e, null, !0, t || new ClipboardEvent("paste"));
9644
9644
  }
9645
9645
  /**
9646
9646
  Removes the editor from the DOM and destroys all [node
@@ -10976,7 +10976,7 @@ function Af({
10976
10976
  View: r = Tf,
10977
10977
  lastColumnResizable: i = !0
10978
10978
  } = {}) {
10979
- const s = new It({
10979
+ const s = new ut({
10980
10980
  key: _,
10981
10981
  state: {
10982
10982
  init(o, l) {
@@ -11194,7 +11194,7 @@ function Vf(n, e) {
11194
11194
  function Ff({
11195
11195
  allowTableNodeSelection: n = !1
11196
11196
  } = {}) {
11197
- return new It({
11197
+ return new ut({
11198
11198
  key: Ne,
11199
11199
  // This piece of state is used to remember when a mouse-drag
11200
11200
  // cell-selection is happening, so that it can continue even as
@@ -11333,7 +11333,7 @@ async function Gf(n) {
11333
11333
  return console.error("Error during SDK license check:", i), !1;
11334
11334
  }
11335
11335
  }
11336
- const Mt = (n) => {
11336
+ const Ot = (n) => {
11337
11337
  const e = Object.fromEntries(Array.from(n.attributes).map((t) => [t.name, t.value]));
11338
11338
  return delete e.draggable, e;
11339
11339
  }, qi = "data-gs-mrk-fs", Ki = "data-gs-ib", dn = "data-gs-ifrg", be = "attrs", vo = {
@@ -11341,8 +11341,8 @@ const Mt = (n) => {
11341
11341
  }, de = {
11342
11342
  [be]: { default: {} }
11343
11343
  }, zo = (n) => ({
11344
- [be]: JSON.stringify(Mt(n))
11345
- }), ue = (n) => ({ attrs: Mt(n) }), pt = (n) => (e) => [n, e.attrs.attrs, 0], Me = (n) => n.attrs[be] ? JSON.parse(n.attrs[be]) : {}, _f = {
11344
+ [be]: JSON.stringify(Ot(n))
11345
+ }), ue = (n) => ({ attrs: Ot(n) }), mt = (n) => (e) => [n, e.attrs.attrs, 0], Me = (n) => n.attrs[be] ? JSON.parse(n.attrs[be]) : {}, _f = {
11346
11346
  doc: {
11347
11347
  content: "block+"
11348
11348
  },
@@ -11362,35 +11362,35 @@ const Mt = (n) => {
11362
11362
  content: "inline*",
11363
11363
  attrs: de,
11364
11364
  parseDOM: [{ tag: "div", getAttrs: ue }],
11365
- toDOM: pt("div")
11365
+ toDOM: mt("div")
11366
11366
  },
11367
11367
  paragraph: {
11368
11368
  group: "block",
11369
11369
  content: "inline*",
11370
11370
  attrs: de,
11371
11371
  parseDOM: [{ tag: "p", getAttrs: ue }],
11372
- toDOM: pt("p")
11372
+ toDOM: mt("p")
11373
11373
  },
11374
11374
  orderedList: {
11375
11375
  group: "block",
11376
11376
  content: "listItem+",
11377
11377
  attrs: de,
11378
11378
  parseDOM: [{ tag: "ol", getAttrs: ue }],
11379
- toDOM: pt("ol")
11379
+ toDOM: mt("ol")
11380
11380
  },
11381
11381
  bulletList: {
11382
11382
  group: "block",
11383
11383
  content: "listItem+",
11384
11384
  attrs: de,
11385
11385
  parseDOM: [{ tag: "ul", getAttrs: ue }],
11386
- toDOM: pt("ul")
11386
+ toDOM: mt("ul")
11387
11387
  },
11388
11388
  listItem: {
11389
11389
  content: "block*",
11390
11390
  group: "block",
11391
11391
  attrs: de,
11392
11392
  parseDOM: [{ tag: "li", getAttrs: ue }],
11393
- toDOM: pt("li"),
11393
+ toDOM: mt("li"),
11394
11394
  defining: !0
11395
11395
  },
11396
11396
  codeBlock: {
@@ -11438,7 +11438,7 @@ const Mt = (n) => {
11438
11438
  tag: `h${e + 1}`,
11439
11439
  getAttrs: (t) => ({
11440
11440
  level: e + 1,
11441
- attrs: Mt(t)
11441
+ attrs: Ot(t)
11442
11442
  })
11443
11443
  })),
11444
11444
  toDOM({ attrs: n }) {
@@ -11452,7 +11452,7 @@ const Mt = (n) => {
11452
11452
  cellAttributes: {
11453
11453
  [be]: {
11454
11454
  default: de[be].default,
11455
- getFromDOM: Mt,
11455
+ getFromDOM: Ot,
11456
11456
  setDOMAttr: (n, e) => {
11457
11457
  n && Object.assign(e, n);
11458
11458
  }
@@ -11481,7 +11481,7 @@ const Mt = (n) => {
11481
11481
  tag: "*:not(tbody)",
11482
11482
  getAttrs: (n) => ({
11483
11483
  tagName: n.tagName.toLowerCase(),
11484
- attrs: Mt(n)
11484
+ attrs: Ot(n)
11485
11485
  }),
11486
11486
  priority: 0
11487
11487
  }
@@ -11491,7 +11491,7 @@ const Mt = (n) => {
11491
11491
  return [e, t, 0];
11492
11492
  }
11493
11493
  }
11494
- }, mt = (n, e) => ({
11494
+ }, gt = (n, e) => ({
11495
11495
  attrs: vo,
11496
11496
  parseDOM: n.map((t) => ({
11497
11497
  tag: t,
@@ -11499,11 +11499,11 @@ const Mt = (n) => {
11499
11499
  })),
11500
11500
  toDOM: e
11501
11501
  }), Xf = {
11502
- strong: mt(["strong", "b"], (n) => ["b", Me(n)]),
11503
- link: mt(["a"], (n) => ["a", Me(n), 0]),
11504
- em: mt(["em", "i"], (n) => ["em", Me(n)]),
11505
- underline: mt(["u"], (n) => ["u", Me(n), 0]),
11506
- strikethrough: mt(["s"], (n) => ["s", Me(n), 0]),
11502
+ strong: gt(["strong", "b"], (n) => ["b", Me(n)]),
11503
+ link: gt(["a"], (n) => ["a", Me(n), 0]),
11504
+ em: gt(["em", "i"], (n) => ["em", Me(n)]),
11505
+ underline: gt(["u"], (n) => ["u", Me(n), 0]),
11506
+ strikethrough: gt(["s"], (n) => ["s", Me(n), 0]),
11507
11507
  font_size: {
11508
11508
  attrs: {
11509
11509
  ...vo,
@@ -11636,7 +11636,7 @@ function oh(n, e, t) {
11636
11636
  }
11637
11637
  o.docChanged && i(o.scrollIntoView());
11638
11638
  }
11639
- const gt = (n, e) => {
11639
+ const yt = (n, e) => {
11640
11640
  const { from: t, to: r } = n.selection;
11641
11641
  let i = !1;
11642
11642
  return n.doc.nodesBetween(t, r, (s) => {
@@ -11747,19 +11747,19 @@ const hh = (n, e) => {
11747
11747
  },
11748
11748
  bold: {
11749
11749
  toggle: () => Pe(i.strong)(n.state, t),
11750
- isActive: () => gt(n.state, i.strong)
11750
+ isActive: () => yt(n.state, i.strong)
11751
11751
  },
11752
11752
  italic: {
11753
11753
  toggle: () => Pe(i.em)(n.state, t),
11754
- isActive: () => gt(n.state, i.em)
11754
+ isActive: () => yt(n.state, i.em)
11755
11755
  },
11756
11756
  underline: {
11757
11757
  toggle: () => Pe(i.underline)(n.state, t),
11758
- isActive: () => gt(n.state, i.underline)
11758
+ isActive: () => yt(n.state, i.underline)
11759
11759
  },
11760
11760
  strikethrough: {
11761
11761
  toggle: () => Pe(i.strikethrough)(n.state, t),
11762
- isActive: () => gt(n.state, i.strikethrough)
11762
+ isActive: () => yt(n.state, i.strikethrough)
11763
11763
  },
11764
11764
  link: {
11765
11765
  get: () => {
@@ -11772,7 +11772,7 @@ const hh = (n, e) => {
11772
11772
  }
11773
11773
  },
11774
11774
  toggle: () => Pe(i.link)(n.state, t),
11775
- isActive: () => gt(n.state, i.link),
11775
+ isActive: () => yt(n.state, i.link),
11776
11776
  create: (s) => {
11777
11777
  const o = ji(n);
11778
11778
  o != null && o.is("link") ? (o.addAttributes({ href: s.url, target: s.target }), n.focus()) : lh(n, s.url, s.target);
@@ -11871,7 +11871,7 @@ function yh(n) {
11871
11871
  }
11872
11872
  const bh = 500;
11873
11873
  function xh({ rules: n }) {
11874
- let e = new It({
11874
+ let e = new ut({
11875
11875
  state: {
11876
11876
  init() {
11877
11877
  return null;
@@ -12270,6 +12270,7 @@ const Vh = function(n, e = {}) {
12270
12270
  schema: a,
12271
12271
  plugins: (m = t.plugins) == null ? void 0 : m.call(t, {
12272
12272
  editor: n,
12273
+ Plugin: ut,
12273
12274
  plugins: [
12274
12275
  Af(),
12275
12276
  Ff(),
@@ -12280,8 +12281,8 @@ const Vh = function(n, e = {}) {
12280
12281
  "Shift-Tab": zi(-1)
12281
12282
  }),
12282
12283
  Bn({
12283
- Enter: Tt(zs, ya(c.listItem), rh),
12284
- "Shift-Enter": Tt(vs, (g, b) => (b && b(g.tr.replaceSelectionWith(c.inlineBreak.create()).scrollIntoView()), !0)),
12284
+ Enter: At(zs, ya(c.listItem), rh),
12285
+ "Shift-Enter": At(vs, (g, b) => (b && b(g.tr.replaceSelectionWith(c.inlineBreak.create()).scrollIntoView()), !0)),
12285
12286
  "Mod-z": Ws,
12286
12287
  "Mod-y": jn,
12287
12288
  // On Windows