@srcker/editor-vue-next 1.0.9 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { defineComponent as et, shallowRef as Zd, onMounted as tt, onBeforeUnmount as Ve, h as Sn, ref as ne, getCurrentInstance as ef, watchEffect as tf, nextTick as Pa, unref as Ae, markRaw as nf, customRef as rf, createElementBlock as z, openBlock as L, createElementVNode as b, computed as Mn, normalizeClass as _, createVNode as $, toDisplayString as Be, Transition as rr, withCtx as Tn, withDirectives as ir, Fragment as Zt, renderList as en, normalizeStyle as hn, vShow as sr, createCommentVNode as pn, createBlock as Xs, withModifiers as sf, watch as of } from "vue";
1
+ import { defineComponent as et, shallowRef as Zd, onMounted as tt, onBeforeUnmount as Ve, h as Sn, ref as te, getCurrentInstance as ef, watchEffect as tf, nextTick as Pa, unref as Ae, markRaw as nf, customRef as rf, createElementBlock as z, openBlock as I, createElementVNode as b, computed as Mn, normalizeClass as _, createVNode as $, toDisplayString as Be, Transition as rr, withCtx as Tn, withDirectives as ir, Fragment as Zt, renderList as en, normalizeStyle as hn, vShow as sr, createCommentVNode as pn, createBlock as Xs, withModifiers as sf, watch as of } from "vue";
2
2
  /* empty css */
3
3
  function ce(n) {
4
4
  this.content = n;
@@ -3110,7 +3110,7 @@ class pe {
3110
3110
  return Ui[e] = t, t.prototype.jsonID = e, t;
3111
3111
  }
3112
3112
  }
3113
- class te {
3113
+ class ne {
3114
3114
  /**
3115
3115
  @internal
3116
3116
  */
@@ -3121,13 +3121,13 @@ class te {
3121
3121
  Create a successful step result.
3122
3122
  */
3123
3123
  static ok(e) {
3124
- return new te(e, null);
3124
+ return new ne(e, null);
3125
3125
  }
3126
3126
  /**
3127
3127
  Create a failed step result.
3128
3128
  */
3129
3129
  static fail(e) {
3130
- return new te(null, e);
3130
+ return new ne(null, e);
3131
3131
  }
3132
3132
  /**
3133
3133
  Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given
@@ -3136,10 +3136,10 @@ class te {
3136
3136
  */
3137
3137
  static fromReplace(e, t, r, i) {
3138
3138
  try {
3139
- return te.ok(e.replace(t, r, i));
3139
+ return ne.ok(e.replace(t, r, i));
3140
3140
  } catch (s) {
3141
3141
  if (s instanceof Ir)
3142
- return te.fail(s.message);
3142
+ return ne.fail(s.message);
3143
3143
  throw s;
3144
3144
  }
3145
3145
  }
@@ -3161,7 +3161,7 @@ class St extends pe {
3161
3161
  }
3162
3162
  apply(e) {
3163
3163
  let t = e.slice(this.from, this.to), r = e.resolve(this.from), i = r.node(r.sharedDepth(this.to)), s = new T(Qs(t.content, (o, l) => !o.isAtom || !l.type.allowsMarkType(this.mark.type) ? o : o.mark(this.mark.addToSet(o.marks)), i), t.openStart, t.openEnd);
3164
- return te.fromReplace(e, this.from, this.to, s);
3164
+ return ne.fromReplace(e, this.from, this.to, s);
3165
3165
  }
3166
3166
  invert() {
3167
3167
  return new ze(this.from, this.to, this.mark);
@@ -3200,7 +3200,7 @@ class ze extends pe {
3200
3200
  }
3201
3201
  apply(e) {
3202
3202
  let t = e.slice(this.from, this.to), r = new T(Qs(t.content, (i) => i.mark(this.mark.removeFromSet(i.marks)), e), t.openStart, t.openEnd);
3203
- return te.fromReplace(e, this.from, this.to, r);
3203
+ return ne.fromReplace(e, this.from, this.to, r);
3204
3204
  }
3205
3205
  invert() {
3206
3206
  return new St(this.from, this.to, this.mark);
@@ -3240,9 +3240,9 @@ class Mt extends pe {
3240
3240
  apply(e) {
3241
3241
  let t = e.nodeAt(this.pos);
3242
3242
  if (!t)
3243
- return te.fail("No node at mark step's position");
3243
+ return ne.fail("No node at mark step's position");
3244
3244
  let r = t.type.create(t.attrs, null, this.mark.addToSet(t.marks));
3245
- return te.fromReplace(e, this.pos, this.pos + 1, new T(w.from(r), 0, t.isLeaf ? 0 : 1));
3245
+ return ne.fromReplace(e, this.pos, this.pos + 1, new T(w.from(r), 0, t.isLeaf ? 0 : 1));
3246
3246
  }
3247
3247
  invert(e) {
3248
3248
  let t = e.nodeAt(this.pos);
@@ -3284,9 +3284,9 @@ class Gt extends pe {
3284
3284
  apply(e) {
3285
3285
  let t = e.nodeAt(this.pos);
3286
3286
  if (!t)
3287
- return te.fail("No node at mark step's position");
3287
+ return ne.fail("No node at mark step's position");
3288
3288
  let r = t.type.create(t.attrs, null, this.mark.removeFromSet(t.marks));
3289
- return te.fromReplace(e, this.pos, this.pos + 1, new T(w.from(r), 0, t.isLeaf ? 0 : 1));
3289
+ return ne.fromReplace(e, this.pos, this.pos + 1, new T(w.from(r), 0, t.isLeaf ? 0 : 1));
3290
3290
  }
3291
3291
  invert(e) {
3292
3292
  let t = e.nodeAt(this.pos);
@@ -3323,7 +3323,7 @@ class oe extends pe {
3323
3323
  super(), this.from = e, this.to = t, this.slice = r, this.structure = i;
3324
3324
  }
3325
3325
  apply(e) {
3326
- return this.structure && xs(e, this.from, this.to) ? te.fail("Structure replace would overwrite content") : te.fromReplace(e, this.from, this.to, this.slice);
3326
+ return this.structure && xs(e, this.from, this.to) ? ne.fail("Structure replace would overwrite content") : ne.fromReplace(e, this.from, this.to, this.slice);
3327
3327
  }
3328
3328
  getMap() {
3329
3329
  return new Se([this.from, this.to - this.from, this.slice.size]);
@@ -3373,12 +3373,12 @@ class le extends pe {
3373
3373
  }
3374
3374
  apply(e) {
3375
3375
  if (this.structure && (xs(e, this.from, this.gapFrom) || xs(e, this.gapTo, this.to)))
3376
- return te.fail("Structure gap-replace would overwrite content");
3376
+ return ne.fail("Structure gap-replace would overwrite content");
3377
3377
  let t = e.slice(this.gapFrom, this.gapTo);
3378
3378
  if (t.openStart || t.openEnd)
3379
- return te.fail("Gap is not a flat range");
3379
+ return ne.fail("Gap is not a flat range");
3380
3380
  let r = this.slice.insertAt(this.insert, t.content);
3381
- return r ? te.fromReplace(e, this.from, this.to, r) : te.fail("Content does not fit in gap");
3381
+ return r ? ne.fromReplace(e, this.from, this.to, r) : ne.fail("Content does not fit in gap");
3382
3382
  }
3383
3383
  getMap() {
3384
3384
  return new Se([
@@ -4015,13 +4015,13 @@ class un extends pe {
4015
4015
  apply(e) {
4016
4016
  let t = e.nodeAt(this.pos);
4017
4017
  if (!t)
4018
- return te.fail("No node at attribute step's position");
4018
+ return ne.fail("No node at attribute step's position");
4019
4019
  let r = /* @__PURE__ */ Object.create(null);
4020
4020
  for (let s in t.attrs)
4021
4021
  r[s] = t.attrs[s];
4022
4022
  r[this.attr] = this.value;
4023
4023
  let i = t.type.create(r, null, t.marks);
4024
- return te.fromReplace(e, this.pos, this.pos + 1, new T(w.from(i), 0, t.isLeaf ? 0 : 1));
4024
+ return ne.fromReplace(e, this.pos, this.pos + 1, new T(w.from(i), 0, t.isLeaf ? 0 : 1));
4025
4025
  }
4026
4026
  getMap() {
4027
4027
  return Se.empty;
@@ -4056,7 +4056,7 @@ class Jn extends pe {
4056
4056
  t[i] = e.attrs[i];
4057
4057
  t[this.attr] = this.value;
4058
4058
  let r = e.type.create(t, e.content, e.marks);
4059
- return te.ok(r);
4059
+ return ne.ok(r);
4060
4060
  }
4061
4061
  getMap() {
4062
4062
  return Se.empty;
@@ -4406,7 +4406,7 @@ class D {
4406
4406
  found.
4407
4407
  */
4408
4408
  static findFrom(e, t, r = !1) {
4409
- let i = e.parent.inlineContent ? new I(e) : sn(e.node(0), e.parent, e.pos, e.index(), t, r);
4409
+ let i = e.parent.inlineContent ? new L(e) : sn(e.node(0), e.parent, e.pos, e.index(), t, r);
4410
4410
  if (i)
4411
4411
  return i;
4412
4412
  for (let s = e.depth - 1; s >= 0; s--) {
@@ -4473,7 +4473,7 @@ class D {
4473
4473
  returns the bookmark for that.
4474
4474
  */
4475
4475
  getBookmark() {
4476
- return I.between(this.$anchor, this.$head).getBookmark();
4476
+ return L.between(this.$anchor, this.$head).getBookmark();
4477
4477
  }
4478
4478
  }
4479
4479
  D.prototype.visible = !0;
@@ -4489,7 +4489,7 @@ let cl = !1;
4489
4489
  function ul(n) {
4490
4490
  !cl && !n.parent.inlineContent && (cl = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
4491
4491
  }
4492
- class I extends D {
4492
+ class L extends D {
4493
4493
  /**
4494
4494
  Construct a text selection between the given points.
4495
4495
  */
@@ -4508,7 +4508,7 @@ class I extends D {
4508
4508
  if (!r.parent.inlineContent)
4509
4509
  return D.near(r);
4510
4510
  let i = e.resolve(t.map(this.anchor));
4511
- return new I(i.parent.inlineContent ? i : r, r);
4511
+ return new L(i.parent.inlineContent ? i : r, r);
4512
4512
  }
4513
4513
  replace(e, t = T.empty) {
4514
4514
  if (super.replace(e, t), t == T.empty) {
@@ -4517,7 +4517,7 @@ class I extends D {
4517
4517
  }
4518
4518
  }
4519
4519
  eq(e) {
4520
- return e instanceof I && e.anchor == this.anchor && e.head == this.head;
4520
+ return e instanceof L && e.anchor == this.anchor && e.head == this.head;
4521
4521
  }
4522
4522
  getBookmark() {
4523
4523
  return new Ei(this.anchor, this.head);
@@ -4531,7 +4531,7 @@ class I extends D {
4531
4531
  static fromJSON(e, t) {
4532
4532
  if (typeof t.anchor != "number" || typeof t.head != "number")
4533
4533
  throw new RangeError("Invalid input for TextSelection.fromJSON");
4534
- return new I(e.resolve(t.anchor), e.resolve(t.head));
4534
+ return new L(e.resolve(t.anchor), e.resolve(t.head));
4535
4535
  }
4536
4536
  /**
4537
4537
  Create a text selection from non-resolved positions.
@@ -4557,10 +4557,10 @@ class I extends D {
4557
4557
  else
4558
4558
  return D.near(t, r);
4559
4559
  }
4560
- return e.parent.inlineContent || (i == 0 ? e = t : (e = (D.findFrom(e, -r, !0) || D.findFrom(e, r, !0)).$anchor, e.pos < t.pos != i < 0 && (e = t))), new I(e, t);
4560
+ return e.parent.inlineContent || (i == 0 ? e = t : (e = (D.findFrom(e, -r, !0) || D.findFrom(e, r, !0)).$anchor, e.pos < t.pos != i < 0 && (e = t))), new L(e, t);
4561
4561
  }
4562
4562
  }
4563
- D.jsonID("text", I);
4563
+ D.jsonID("text", L);
4564
4564
  class Ei {
4565
4565
  constructor(e, t) {
4566
4566
  this.anchor = e, this.head = t;
@@ -4569,7 +4569,7 @@ class Ei {
4569
4569
  return new Ei(e.map(this.anchor), e.map(this.head));
4570
4570
  }
4571
4571
  resolve(e) {
4572
- return I.between(e.resolve(this.anchor), e.resolve(this.head));
4572
+ return L.between(e.resolve(this.anchor), e.resolve(this.head));
4573
4573
  }
4574
4574
  }
4575
4575
  class O extends D {
@@ -4679,7 +4679,7 @@ const Qf = {
4679
4679
  };
4680
4680
  function sn(n, e, t, r, i, s = !1) {
4681
4681
  if (e.inlineContent)
4682
- return I.create(n, t);
4682
+ return L.create(n, t);
4683
4683
  for (let o = r - (i > 0 ? 0 : 1); i > 0 ? o < e.childCount : o >= 0; o += i) {
4684
4684
  let l = e.child(o);
4685
4685
  if (l.isAtom) {
@@ -5188,7 +5188,7 @@ function kc(n, e, t) {
5188
5188
  return !1;
5189
5189
  if (t) {
5190
5190
  let u = n.tr.step(c);
5191
- u.setSelection(I.create(u.doc, s)), t(u.scrollIntoView());
5191
+ u.setSelection(L.create(u.doc, s)), t(u.scrollIntoView());
5192
5192
  }
5193
5193
  return !0;
5194
5194
  }
@@ -5330,7 +5330,7 @@ const oh = (n, e) => {
5330
5330
  return !1;
5331
5331
  if (e) {
5332
5332
  let o = (!r.parentOffset && i.index() < i.parent.childCount ? r : i).pos, l = n.tr.insert(o, s.createAndFill());
5333
- l.setSelection(I.create(l.doc, o + 1)), e(l.scrollIntoView());
5333
+ l.setSelection(L.create(l.doc, o + 1)), e(l.scrollIntoView());
5334
5334
  }
5335
5335
  return !0;
5336
5336
  }, Tc = (n, e) => {
@@ -5363,7 +5363,7 @@ function lh(n) {
5363
5363
  s.unshift(null);
5364
5364
  }
5365
5365
  let u = e.tr;
5366
- (e.selection instanceof I || e.selection instanceof Me) && u.deleteSelection();
5366
+ (e.selection instanceof L || e.selection instanceof Me) && u.deleteSelection();
5367
5367
  let d = u.mapping.map(r.pos), f = dt(u.doc, d, s.length, s);
5368
5368
  if (f || (s[0] = l ? { type: l } : null, f = dt(u.doc, d, s.length, s)), !f)
5369
5369
  return !1;
@@ -5429,7 +5429,7 @@ function Ac(n) {
5429
5429
  return !1;
5430
5430
  s--;
5431
5431
  }
5432
- return i.node(s).isTextblock ? (t && t(e.tr.setSelection(I.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
5432
+ return i.node(s).isTextblock ? (t && t(e.tr.setSelection(L.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
5433
5433
  };
5434
5434
  }
5435
5435
  const dh = Ac(-1), fh = Ac(1);
@@ -6526,7 +6526,7 @@ class Nt extends ar {
6526
6526
  }
6527
6527
  localCompositionInfo(e, t) {
6528
6528
  let { from: r, to: i } = e.state.selection;
6529
- if (!(e.state.selection instanceof I) || r < t || i > t + this.node.content.size)
6529
+ if (!(e.state.selection instanceof L) || r < t || i > t + this.node.content.size)
6530
6530
  return null;
6531
6531
  let s = e.input.compositionNode;
6532
6532
  if (!s || !this.dom.contains(s.parentNode))
@@ -7085,7 +7085,7 @@ function ft(n, e = !1) {
7085
7085
  tp(n);
7086
7086
  else {
7087
7087
  let { anchor: r, head: i } = t, s, o;
7088
- Tl && !(t instanceof I) && (t.$from.parent.inlineContent || (s = El(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = El(n, t.to))), n.docView.setSelection(r, i, n, e), Tl && (s && Al(s), o && Al(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && ep(n));
7088
+ Tl && !(t instanceof L) && (t.$from.parent.inlineContent || (s = El(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = El(n, t.to))), n.docView.setSelection(r, i, n, e), Tl && (s && Al(s), o && Al(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && ep(n));
7089
7089
  }
7090
7090
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
7091
7091
  }
@@ -7136,7 +7136,7 @@ function Ol(n) {
7136
7136
  n.lastSelectedViewDesc && (n.lastSelectedViewDesc.parent && n.lastSelectedViewDesc.deselectNode(), n.lastSelectedViewDesc = void 0);
7137
7137
  }
7138
7138
  function co(n, e, t, r) {
7139
- return n.someProp("createSelectionBetween", (i) => i(n, e, t)) || I.between(e, t, r);
7139
+ return n.someProp("createSelectionBetween", (i) => i(n, e, t)) || L.between(e, t, r);
7140
7140
  }
7141
7141
  function Nl(n) {
7142
7142
  return n.editable && !n.hasFocus() ? !1 : Wc(n);
@@ -7164,13 +7164,13 @@ function kt(n, e) {
7164
7164
  }
7165
7165
  function Dl(n, e, t) {
7166
7166
  let r = n.state.selection;
7167
- if (r instanceof I)
7167
+ if (r instanceof L)
7168
7168
  if (t.indexOf("s") > -1) {
7169
7169
  let { $head: i } = r, s = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter;
7170
7170
  if (!s || s.isText || !s.isLeaf)
7171
7171
  return !1;
7172
7172
  let o = n.state.doc.resolve(i.pos + s.nodeSize * (e < 0 ? -1 : 1));
7173
- return kt(n, new I(r.$anchor, o));
7173
+ return kt(n, new L(r.$anchor, o));
7174
7174
  } else if (r.empty) {
7175
7175
  if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
7176
7176
  let i = Os(n.state, e);
@@ -7180,12 +7180,12 @@ function Dl(n, e, t) {
7180
7180
  if (!s || s.isText)
7181
7181
  return !1;
7182
7182
  let l = e < 0 ? i.pos - s.nodeSize : i.pos;
7183
- return s.isAtom || (o = n.docView.descAt(l)) && !o.contentDOM ? O.isSelectable(s) ? kt(n, new O(e < 0 ? n.state.doc.resolve(i.pos - s.nodeSize) : i)) : lr ? kt(n, new I(n.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
7183
+ return s.isAtom || (o = n.docView.descAt(l)) && !o.contentDOM ? O.isSelectable(s) ? kt(n, new O(e < 0 ? n.state.doc.resolve(i.pos - s.nodeSize) : i)) : lr ? kt(n, new L(n.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
7184
7184
  }
7185
7185
  } else return !1;
7186
7186
  else {
7187
7187
  if (r instanceof O && r.node.isInline)
7188
- return kt(n, new I(e > 0 ? r.$to : r.$from));
7188
+ return kt(n, new L(e > 0 ? r.$to : r.$from));
7189
7189
  {
7190
7190
  let i = Os(n.state, e);
7191
7191
  return i ? kt(n, i) : !1;
@@ -7335,7 +7335,7 @@ function Rl(n, e) {
7335
7335
  }
7336
7336
  function Il(n, e, t) {
7337
7337
  let r = n.state.selection;
7338
- if (r instanceof I && !r.empty || t.indexOf("s") > -1 || Ne && t.indexOf("m") > -1)
7338
+ if (r instanceof L && !r.empty || t.indexOf("s") > -1 || Ne && t.indexOf("m") > -1)
7339
7339
  return !1;
7340
7340
  let { $from: i, $to: s } = r;
7341
7341
  if (!i.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
@@ -7350,7 +7350,7 @@ function Il(n, e, t) {
7350
7350
  return !1;
7351
7351
  }
7352
7352
  function Ll(n, e) {
7353
- if (!(n.state.selection instanceof I))
7353
+ if (!(n.state.selection instanceof L))
7354
7354
  return !0;
7355
7355
  let { $head: t, $anchor: r, empty: i } = n.state.selection;
7356
7356
  if (!t.sameParent(r))
@@ -7668,7 +7668,7 @@ ke.keypress = (n, e) => {
7668
7668
  return;
7669
7669
  }
7670
7670
  let r = n.state.selection;
7671
- if (!(r instanceof I) || !r.$from.sameParent(r.$to)) {
7671
+ if (!(r instanceof L) || !r.$from.sameParent(r.$to)) {
7672
7672
  let i = String.fromCharCode(t.charCode), s = () => n.state.tr.insertText(i).scrollIntoView();
7673
7673
  !/[\r\n]/.test(i) && !n.someProp("handleTextInput", (o) => o(n, r.$from.pos, r.$to.pos, i, s)) && n.dispatch(s()), t.preventDefault();
7674
7674
  }
@@ -7730,12 +7730,12 @@ function Ap(n, e, t) {
7730
7730
  return !1;
7731
7731
  let r = n.state.doc;
7732
7732
  if (e == -1)
7733
- return r.inlineContent ? (dn(n, I.create(r, 0, r.content.size)), !0) : !1;
7733
+ return r.inlineContent ? (dn(n, L.create(r, 0, r.content.size)), !0) : !1;
7734
7734
  let i = r.resolve(e);
7735
7735
  for (let s = i.depth + 1; s > 0; s--) {
7736
7736
  let o = s > i.depth ? i.nodeAfter : i.node(s), l = i.before(s);
7737
7737
  if (o.inlineContent)
7738
- dn(n, I.create(r, l + 1, l + 1 + o.content.size));
7738
+ dn(n, L.create(r, l + 1, l + 1 + o.content.size));
7739
7739
  else if (O.isSelectable(o))
7740
7740
  dn(n, O.create(r, l));
7741
7741
  else
@@ -7816,7 +7816,7 @@ ke.compositionstart = ke.compositionupdate = (n) => {
7816
7816
  if (!n.composing) {
7817
7817
  n.domObserver.flush();
7818
7818
  let { state: e } = n, t = e.selection.$to;
7819
- if (e.selection instanceof I && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1)))
7819
+ if (e.selection instanceof L && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1)))
7820
7820
  n.markCursor = n.state.storedMarks || t.marks(), Fr(n, !0), n.markCursor = null;
7821
7821
  else if (Fr(n, !e.selection.empty), Re && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
7822
7822
  let r = n.domSelectionRange();
@@ -8796,7 +8796,7 @@ function Gp(n, e, t, r, i) {
8796
8796
  return;
8797
8797
  }
8798
8798
  if (!p)
8799
- if (r && a instanceof I && !a.empty && a.$head.sameParent(a.$anchor) && !n.composing && !(c.sel && c.sel.anchor != c.sel.head))
8799
+ if (r && a instanceof L && !a.empty && a.$head.sameParent(a.$anchor) && !n.composing && !(c.sel && c.sel.anchor != c.sel.head))
8800
8800
  p = { start: a.from, endA: a.to, endB: a.to };
8801
8801
  else {
8802
8802
  if (c.sel) {
@@ -8808,7 +8808,7 @@ function Gp(n, e, t, r, i) {
8808
8808
  }
8809
8809
  return;
8810
8810
  }
8811
- n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof I && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), ve && Ot <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == "  " && (p.start--, p.endA--, p.endB--);
8811
+ n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof L && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), ve && Ot <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == "  " && (p.start--, p.endA--, p.endB--);
8812
8812
  let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = u.resolve(p.start), k = m.sameParent(g) && m.parent.inlineContent && y.end() >= p.endA;
8813
8813
  if ((bn && n.input.lastIOSEnter > Date.now() - 225 && (!k || i.some((S) => S.nodeName == "DIV" || S.nodeName == "P")) || !k && m.pos < c.doc.content.size && (!m.sameParent(g) || !m.parent.inlineContent) && m.pos < g.pos && !/\S/.test(c.doc.textBetween(m.pos, g.pos, "", ""))) && n.someProp("handleKeyDown", (S) => S(n, Ft(13, "Enter")))) {
8814
8814
  n.input.lastIOSEnter = 0;
@@ -9631,7 +9631,7 @@ var um = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
9631
9631
  const { state: i } = t, s = i.doc.slice(n.from, n.to);
9632
9632
  r.deleteRange(n.from, n.to);
9633
9633
  const o = r.mapping.map(e);
9634
- return r.insert(o, s.content), r.setSelection(new I(r.doc.resolve(Math.max(o - 1, 0)))), !0;
9634
+ return r.insert(o, s.content), r.setSelection(new L(r.doc.resolve(Math.max(o - 1, 0)))), !0;
9635
9635
  }, gm = () => ({ tr: n, dispatch: e }) => {
9636
9636
  const { selection: t } = n, r = t.$anchor.node();
9637
9637
  if (r.content.size > 0)
@@ -9717,7 +9717,7 @@ var xm = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
9717
9717
  if (i) {
9718
9718
  const d = wo(a, s, e);
9719
9719
  if (d && d.from <= c && d.to >= u) {
9720
- const f = I.create(o, d.from, d.to);
9720
+ const f = L.create(o, d.from, d.to);
9721
9721
  t.setSelection(f);
9722
9722
  }
9723
9723
  }
@@ -9730,7 +9730,7 @@ var xm = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
9730
9730
  return !1;
9731
9731
  };
9732
9732
  function vo(n) {
9733
- return n instanceof I;
9733
+ return n instanceof L;
9734
9734
  }
9735
9735
  function ut(n = 0, e = 0, t = 0) {
9736
9736
  return Math.min(Math.max(n, e), t);
@@ -9744,7 +9744,7 @@ function du(n, e = null) {
9744
9744
  if (e === "end")
9745
9745
  return r;
9746
9746
  const i = t.from, s = r.to;
9747
- return e === "all" ? I.create(n, ut(0, i, s), ut(n.content.size, i, s)) : I.create(n, ut(e, i, s), ut(e, i, s));
9747
+ return e === "all" ? L.create(n, ut(0, i, s), ut(n.content.size, i, s)) : L.create(n, ut(e, i, s), ut(e, i, s));
9748
9748
  }
9749
9749
  function Yl() {
9750
9750
  return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
@@ -10697,7 +10697,7 @@ var bg = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
10697
10697
  }), !0;
10698
10698
  }, Cg = (n) => ({ tr: e, dispatch: t }) => {
10699
10699
  if (t) {
10700
- const { doc: r } = e, { from: i, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = I.atStart(r).from, l = I.atEnd(r).to, a = ut(i, o, l), c = ut(s, o, l), u = I.create(r, a, c);
10700
+ const { doc: r } = e, { from: i, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = L.atStart(r).from, l = L.atEnd(r).to, a = ut(i, o, l), c = ut(s, o, l), u = L.create(r, a, c);
10701
10701
  e.setSelection(u);
10702
10702
  }
10703
10703
  return !0;
@@ -10731,7 +10731,7 @@ var Mg = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
10731
10731
  attrs: u
10732
10732
  }
10733
10733
  ] : void 0), r) {
10734
- if (p && (s instanceof I && e.deleteSelection(), e.split(e.mapping.map(l.pos), 1, h), f && !d && !l.parentOffset && l.parent.type !== f)) {
10734
+ if (p && (s instanceof L && e.deleteSelection(), e.split(e.mapping.map(l.pos), 1, h), f && !d && !l.parentOffset && l.parent.type !== f)) {
10735
10735
  const m = e.mapping.map(l.before()), g = e.doc.resolve(m);
10736
10736
  l.node(-1).canReplaceWith(g.index(), g.index() + 1, f) && e.setNodeMarkup(e.mapping.map(l.before()), f);
10737
10737
  }
@@ -10770,7 +10770,7 @@ var Mg = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
10770
10770
  if (S > -1)
10771
10771
  return !1;
10772
10772
  N.isTextblock && N.content.size === 0 && (S = P + 1);
10773
- }), S > -1 && t.setSelection(I.near(t.doc.resolve(S))), t.scrollIntoView();
10773
+ }), S > -1 && t.setSelection(L.near(t.doc.resolve(S))), t.scrollIntoView();
10774
10774
  }
10775
10775
  return !0;
10776
10776
  }
@@ -13308,7 +13308,7 @@ var c0 = class extends Qg {
13308
13308
  }
13309
13309
  },
13310
13310
  setup(n) {
13311
- const e = ne(), t = ef();
13311
+ const e = te(), t = ef();
13312
13312
  return tf(() => {
13313
13313
  const r = n.editor;
13314
13314
  r && r.options.element && e.value && Pa(() => {
@@ -13717,7 +13717,7 @@ ${t}
13717
13717
  let M = u;
13718
13718
  for (let E = 0; E < p; E += 1)
13719
13719
  M += h[E].length + 1;
13720
- return l.delete(M, M + x), c - M <= x && l.setSelection(I.create(l.doc, M)), !0;
13720
+ return l.delete(M, M + x), c - M <= x && l.setSelection(L.create(l.doc, M)), !0;
13721
13721
  }) : n.commands.command(({ tr: l }) => {
13722
13722
  const { from: a, to: c } = i, f = r.doc.textBetween(a, c, `
13723
13723
  `, `
@@ -13788,7 +13788,7 @@ ${t}
13788
13788
  return !1;
13789
13789
  const { tr: o, schema: l } = n.state, a = l.text(t.replace(/\r\n?/g, `
13790
13790
  `));
13791
- return o.replaceSelectionWith(this.type.create({ language: s }, a)), o.selection.$from.parent.type !== this.type && o.setSelection(I.near(o.doc.resolve(Math.max(0, o.selection.from - 2)))), o.setMeta("paste", !0), n.dispatch(o), !0;
13791
+ return o.replaceSelectionWith(this.type.create({ language: s }, a)), o.selection.$from.parent.type !== this.type && o.setSelection(L.near(o.doc.resolve(Math.max(0, o.selection.from - 2)))), o.setMeta("paste", !0), n.dispatch(o), !0;
13792
13792
  }
13793
13793
  }
13794
13794
  })
@@ -13943,10 +13943,10 @@ ${t}
13943
13943
  if (l) {
13944
13944
  const { $to: a } = o.selection, c = a.end();
13945
13945
  if (a.nodeAfter)
13946
- a.nodeAfter.isTextblock ? o.setSelection(I.create(o.doc, a.pos + 1)) : a.nodeAfter.isBlock ? o.setSelection(O.create(o.doc, a.pos)) : o.setSelection(I.create(o.doc, a.pos));
13946
+ a.nodeAfter.isTextblock ? o.setSelection(L.create(o.doc, a.pos + 1)) : a.nodeAfter.isBlock ? o.setSelection(O.create(o.doc, a.pos)) : o.setSelection(L.create(o.doc, a.pos));
13947
13947
  else {
13948
13948
  const u = s.schema.nodes[this.options.nextNodeType] || a.parent.type.contentMatch.defaultType, d = u?.create();
13949
- d && (o.insert(c, d), o.setSelection(I.create(o.doc, c + 1)));
13949
+ d && (o.insert(c, d), o.setSelection(L.create(o.doc, c + 1)));
13950
13950
  }
13951
13951
  o.scrollIntoView();
13952
13952
  }
@@ -16146,7 +16146,7 @@ function xr(n, e) {
16146
16146
  const t = n == "vert" ? e > 0 ? "down" : "up" : e > 0 ? "right" : "left";
16147
16147
  return function(r, i, s) {
16148
16148
  let o = r.selection, l = e > 0 ? o.$to : o.$from, a = o.empty;
16149
- if (o instanceof I) {
16149
+ if (o instanceof L) {
16150
16150
  if (!s.endOfTextblock(t) || l.depth == 0)
16151
16151
  return !1;
16152
16152
  a = !1, l = r.doc.resolve(e > 0 ? l.after() : l.before());
@@ -16174,7 +16174,7 @@ function A1(n, e) {
16174
16174
  for (let o = r.length - 1; o >= 0; o--)
16175
16175
  i = w.from(r[o].createAndFill(null, i));
16176
16176
  let s = n.state.tr.replace(t.pos, t.pos, new T(i, 0, 0));
16177
- return s.setSelection(I.near(s.doc.resolve(t.pos + 1))), n.dispatch(s), !1;
16177
+ return s.setSelection(L.near(s.doc.resolve(t.pos + 1))), n.dispatch(s), !1;
16178
16178
  }
16179
16179
  function O1(n) {
16180
16180
  if (!(n.selection instanceof Z))
@@ -17248,7 +17248,7 @@ const hy = Fo.extend({
17248
17248
  return {
17249
17249
  types: ["paragraph", "heading"],
17250
17250
  min: 0,
17251
- max: 7,
17251
+ max: 10,
17252
17252
  step: 1
17253
17253
  };
17254
17254
  },
@@ -17259,9 +17259,9 @@ const hy = Fo.extend({
17259
17259
  attributes: {
17260
17260
  indent: {
17261
17261
  default: 0,
17262
- parseHTML: (n) => parseInt(n.style.marginLeft || "0") / 24 || 0,
17262
+ parseHTML: (n) => parseInt(n.style.textIndent) || 0,
17263
17263
  renderHTML: (n) => n.indent ? {
17264
- style: `margin-left: ${n.indent * 24}px`
17264
+ style: `text-indent: ${n.indent}em`
17265
17265
  } : {}
17266
17266
  }
17267
17267
  }
@@ -17283,6 +17283,15 @@ const hy = Fo.extend({
17283
17283
  }).run();
17284
17284
  }
17285
17285
  };
17286
+ },
17287
+ addKeyboardShortcuts() {
17288
+ return {
17289
+ Tab: () => this.editor.commands.increaseIndent(),
17290
+ "Shift-Tab": () => this.editor.commands.decreaseIndent(),
17291
+ "Mod-Tab": () => this.editor.commands.decreaseIndent(),
17292
+ "Mod-]": () => this.editor.commands.increaseIndent(),
17293
+ "Mod-[": () => this.editor.commands.decreaseIndent()
17294
+ };
17286
17295
  }
17287
17296
  }), gy = H.create({
17288
17297
  name: "fontSize",
@@ -18868,7 +18877,7 @@ var Ge = class ot extends D {
18868
18877
  const s = this.$anchorCell.node(-1) != r.node(-1);
18869
18878
  return s && this.isRowSelection() ? ot.rowSelection(r, i) : s && this.isColSelection() ? ot.colSelection(r, i) : new ot(r, i);
18870
18879
  }
18871
- return I.between(r, i);
18880
+ return L.between(r, i);
18872
18881
  }
18873
18882
  // Returns a rectangular slice of table rows containing the selected
18874
18883
  // cells.
@@ -19189,7 +19198,7 @@ function Mr(n, e) {
19189
19198
  };
19190
19199
  }
19191
19200
  function Yd(n, e, t) {
19192
- if (!(n.state.selection instanceof I)) return null;
19201
+ if (!(n.state.selection instanceof L)) return null;
19193
19202
  const { $head: r } = n.state.selection;
19194
19203
  for (let i = r.depth - 1; i >= 0; i--) {
19195
19204
  const s = r.node(i);
@@ -19416,7 +19425,7 @@ var xb = class {
19416
19425
  }
19417
19426
  },
19418
19427
  setup(n, { slots: e, attrs: t }) {
19419
- const r = ne(null);
19428
+ const r = te(null);
19420
19429
  return tt(() => {
19421
19430
  const {
19422
19431
  editor: i,
@@ -19609,7 +19618,7 @@ et({
19609
19618
  }
19610
19619
  },
19611
19620
  setup(n, { slots: e, attrs: t }) {
19612
- const r = ne(null);
19621
+ const r = te(null);
19613
19622
  return tt(() => {
19614
19623
  const { pluginKey: i, editor: s, updateDelay: o, resizeDelay: l, options: a, appendTo: c, shouldShow: u } = n, d = r.value;
19615
19624
  d && (d.style.visibility = "hidden", d.style.position = "absolute", d.remove(), s.registerPlugin(
@@ -19642,7 +19651,7 @@ const Eb = ["disabled"], Ab = {
19642
19651
  }
19643
19652
  },
19644
19653
  setup(n) {
19645
- return (e, t) => (L(), z("button", {
19654
+ return (e, t) => (I(), z("button", {
19646
19655
  class: "icon-button",
19647
19656
  type: "button",
19648
19657
  disabled: !n.editor.can().undo(),
@@ -19675,7 +19684,7 @@ const Eb = ["disabled"], Ab = {
19675
19684
  }
19676
19685
  },
19677
19686
  setup(n) {
19678
- return (e, t) => (L(), z("button", {
19687
+ return (e, t) => (I(), z("button", {
19679
19688
  class: "icon-button",
19680
19689
  type: "button",
19681
19690
  disabled: !n.editor.can().redo(),
@@ -19708,7 +19717,7 @@ const Eb = ["disabled"], Ab = {
19708
19717
  }
19709
19718
  },
19710
19719
  setup(n) {
19711
- return (e, t) => (L(), z("button", {
19720
+ return (e, t) => (I(), z("button", {
19712
19721
  class: "icon-button",
19713
19722
  type: "button",
19714
19723
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().unsetAllMarks().run())
@@ -19745,7 +19754,7 @@ const Eb = ["disabled"], Ab = {
19745
19754
  }
19746
19755
  },
19747
19756
  setup(n) {
19748
- const e = ne(!1), t = ne(null), r = { 1: "24px", 2: "20px", 3: "18px", 4: "16px", 5: "14px" }, i = (c) => {
19757
+ const e = te(!1), t = te(null), r = { 1: "24px", 2: "20px", 3: "18px", 4: "16px", 5: "14px" }, i = (c) => {
19749
19758
  l.editor.chain().focus().toggleHeading({ level: c }).run(), e.value = !1;
19750
19759
  }, s = () => {
19751
19760
  l.editor.chain().focus().setParagraph().run(), e.value = !1;
@@ -19762,7 +19771,7 @@ const Eb = ["disabled"], Ab = {
19762
19771
  document.addEventListener("mousedown", a);
19763
19772
  }), Ve(() => {
19764
19773
  document.removeEventListener("mousedown", a);
19765
- }), (c, u) => (L(), z("div", {
19774
+ }), (c, u) => (I(), z("div", {
19766
19775
  class: _(["dropdown-button heading-button", { "is-open": e.value }]),
19767
19776
  ref_key: "wrapperRef",
19768
19777
  ref: t
@@ -19798,7 +19807,7 @@ const Eb = ["disabled"], Ab = {
19798
19807
  b("span", { class: "icon" }, "H", -1),
19799
19808
  b("span", { class: "text" }, "正文", -1)
19800
19809
  ])], 2),
19801
- (L(), z(Zt, null, en([1, 2, 3, 4, 5], (d) => b("div", {
19810
+ (I(), z(Zt, null, en([1, 2, 3, 4, 5], (d) => b("div", {
19802
19811
  class: _(["item", { "is-selected": n.editor.isActive("heading", { level: d }) }]),
19803
19812
  key: d,
19804
19813
  onClick: (f) => i(d)
@@ -19817,7 +19826,7 @@ const Eb = ["disabled"], Ab = {
19817
19826
  })
19818
19827
  ], 2));
19819
19828
  }
19820
- }, Bb = /* @__PURE__ */ je(zb, [["__scopeId", "data-v-6741127f"]]), $b = { class: "label" }, Fb = { class: "dropdown" }, Hb = ["onClick"], Vb = { class: "text" }, _b = {
19829
+ }, Bb = /* @__PURE__ */ je(zb, [["__scopeId", "data-v-5aae4186"]]), $b = { class: "label" }, Fb = { class: "dropdown" }, Hb = ["onClick"], Vb = { class: "text" }, _b = {
19821
19830
  __name: "FontSizeButton",
19822
19831
  props: {
19823
19832
  editor: {
@@ -19826,16 +19835,16 @@ const Eb = ["disabled"], Ab = {
19826
19835
  }
19827
19836
  },
19828
19837
  setup(n) {
19829
- const e = ne(!1), t = ne(null), r = ["12px", "14px", "16px", "18px", "20px", "24px", "30px", "36px", "48px"], i = (a) => {
19838
+ const e = te(!1), t = te(null), r = ["12px", "14px", "16px", "18px", "20px", "24px", "30px", "36px", "48px", "60px", "75px"], i = (a) => {
19830
19839
  o.editor.chain().focus().setMark("textStyle", { fontSize: a }).run(), e.value = !1;
19831
- }, s = Mn(() => o.editor && o.editor.getAttributes("textStyle").fontSize || "16px"), o = n, l = (a) => {
19840
+ }, s = Mn(() => o.editor ? o.editor.getAttributes("textStyle").fontSize || "默认字号" : "16px"), o = n, l = (a) => {
19832
19841
  t.value && (t.value.contains(a.target) || (e.value = !1));
19833
19842
  };
19834
19843
  return tt(() => {
19835
19844
  document.addEventListener("mousedown", l);
19836
19845
  }), Ve(() => {
19837
19846
  document.removeEventListener("mousedown", l);
19838
- }), (a, c) => (L(), z("div", {
19847
+ }), (a, c) => (I(), z("div", {
19839
19848
  class: _(["dropdown-button font-button", { "is-open": e.value }]),
19840
19849
  ref_key: "wrapperRef",
19841
19850
  ref: t
@@ -19864,7 +19873,7 @@ const Eb = ["disabled"], Ab = {
19864
19873
  $(rr, { name: "dropdown" }, {
19865
19874
  default: Tn(() => [
19866
19875
  ir(b("div", Fb, [
19867
- (L(), z(Zt, null, en(r, (u) => b("div", {
19876
+ (I(), z(Zt, null, en(r, (u) => b("div", {
19868
19877
  class: _(["item", { "is-selected": n.editor.isActive("textStyle", { fontSize: u }) }]),
19869
19878
  key: u,
19870
19879
  onClick: (d) => i(u)
@@ -19879,7 +19888,7 @@ const Eb = ["disabled"], Ab = {
19879
19888
  })
19880
19889
  ], 2));
19881
19890
  }
19882
- }, jb = /* @__PURE__ */ je(_b, [["__scopeId", "data-v-2a890871"]]), Wb = {
19891
+ }, jb = /* @__PURE__ */ je(_b, [["__scopeId", "data-v-69936158"]]), Wb = {
19883
19892
  __name: "BoldButton",
19884
19893
  props: {
19885
19894
  editor: {
@@ -19888,7 +19897,7 @@ const Eb = ["disabled"], Ab = {
19888
19897
  }
19889
19898
  },
19890
19899
  setup(n) {
19891
- return (e, t) => (L(), z("button", {
19900
+ return (e, t) => (I(), z("button", {
19892
19901
  class: _(["icon-button", { active: n.editor.isActive("bold") }]),
19893
19902
  type: "button",
19894
19903
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().toggleBold().run())
@@ -19920,7 +19929,7 @@ const Eb = ["disabled"], Ab = {
19920
19929
  }
19921
19930
  },
19922
19931
  setup(n) {
19923
- return (e, t) => (L(), z("button", {
19932
+ return (e, t) => (I(), z("button", {
19924
19933
  class: _(["icon-button", { active: n.editor.isActive("italic") }]),
19925
19934
  type: "button",
19926
19935
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().toggleItalic().run())
@@ -19952,7 +19961,7 @@ const Eb = ["disabled"], Ab = {
19952
19961
  }
19953
19962
  },
19954
19963
  setup(n) {
19955
- return (e, t) => (L(), z("button", {
19964
+ return (e, t) => (I(), z("button", {
19956
19965
  class: _(["icon-button", { active: n.editor.isActive("underline") }]),
19957
19966
  type: "button",
19958
19967
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().toggleUnderline().run())
@@ -19984,7 +19993,7 @@ const Eb = ["disabled"], Ab = {
19984
19993
  }
19985
19994
  },
19986
19995
  setup(n) {
19987
- return (e, t) => (L(), z("button", {
19996
+ return (e, t) => (I(), z("button", {
19988
19997
  class: _(["icon-button", { active: n.editor.isActive("strike") }]),
19989
19998
  type: "button",
19990
19999
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().toggleStrike().run())
@@ -20016,7 +20025,7 @@ const Eb = ["disabled"], Ab = {
20016
20025
  }
20017
20026
  },
20018
20027
  setup(n) {
20019
- return (e, t) => (L(), z("button", {
20028
+ return (e, t) => (I(), z("button", {
20020
20029
  class: _(["icon-button", { active: n.editor.isActive("code") }]),
20021
20030
  type: "button",
20022
20031
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().toggleCode().run())
@@ -20048,7 +20057,7 @@ const Eb = ["disabled"], Ab = {
20048
20057
  }
20049
20058
  },
20050
20059
  setup(n) {
20051
- return (e, t) => (L(), z("button", {
20060
+ return (e, t) => (I(), z("button", {
20052
20061
  class: _(["icon-button", { active: n.editor.isActive("codeBlock") }]),
20053
20062
  type: "button",
20054
20063
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().toggleCodeBlock().run())
@@ -20080,10 +20089,10 @@ const Eb = ["disabled"], Ab = {
20080
20089
  }
20081
20090
  },
20082
20091
  setup(n) {
20083
- return (e, t) => (L(), z("button", {
20092
+ return (e, t) => (I(), z("button", {
20084
20093
  class: "icon-button",
20085
20094
  type: "button",
20086
- onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().decreaseIndent().run())
20095
+ onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().increaseIndent().run())
20087
20096
  }, [...t[1] || (t[1] = [
20088
20097
  b("div", { class: "icon" }, [
20089
20098
  b("svg", {
@@ -20100,7 +20109,7 @@ const Eb = ["disabled"], Ab = {
20100
20109
  })
20101
20110
  ])
20102
20111
  ], -1),
20103
- b("div", { class: "tips" }, "减少缩进", -1)
20112
+ b("div", { class: "tips" }, "增加缩进", -1)
20104
20113
  ])]));
20105
20114
  }
20106
20115
  }, Xb = {
@@ -20112,10 +20121,10 @@ const Eb = ["disabled"], Ab = {
20112
20121
  }
20113
20122
  },
20114
20123
  setup(n) {
20115
- return (e, t) => (L(), z("button", {
20124
+ return (e, t) => (I(), z("button", {
20116
20125
  class: "icon-button",
20117
20126
  type: "button",
20118
- onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().increaseIndent().run())
20127
+ onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().decreaseIndent().run())
20119
20128
  }, [...t[1] || (t[1] = [
20120
20129
  b("div", { class: "icon" }, [
20121
20130
  b("svg", {
@@ -20136,7 +20145,7 @@ const Eb = ["disabled"], Ab = {
20136
20145
  })
20137
20146
  ])
20138
20147
  ], -1),
20139
- b("div", { class: "tips" }, "增加缩进", -1)
20148
+ b("div", { class: "tips" }, "减少缩进", -1)
20140
20149
  ])]));
20141
20150
  }
20142
20151
  }, Qb = {
@@ -20148,7 +20157,7 @@ const Eb = ["disabled"], Ab = {
20148
20157
  }
20149
20158
  },
20150
20159
  setup(n) {
20151
- return (e, t) => (L(), z("button", {
20160
+ return (e, t) => (I(), z("button", {
20152
20161
  class: _(["icon-button", { active: n.editor.isActive({ textAlign: "left" }) }]),
20153
20162
  type: "button",
20154
20163
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().setTextAlign("left").run())
@@ -20180,7 +20189,7 @@ const Eb = ["disabled"], Ab = {
20180
20189
  }
20181
20190
  },
20182
20191
  setup(n) {
20183
- return (e, t) => (L(), z("button", {
20192
+ return (e, t) => (I(), z("button", {
20184
20193
  class: _(["icon-button", { active: n.editor.isActive({ textAlign: "center" }) }]),
20185
20194
  type: "button",
20186
20195
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().setTextAlign("center").run())
@@ -20212,7 +20221,7 @@ const Eb = ["disabled"], Ab = {
20212
20221
  }
20213
20222
  },
20214
20223
  setup(n) {
20215
- return (e, t) => (L(), z("button", {
20224
+ return (e, t) => (I(), z("button", {
20216
20225
  class: _(["icon-button", { active: n.editor.isActive({ textAlign: "right" }) }]),
20217
20226
  type: "button",
20218
20227
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().setTextAlign("right").run())
@@ -20244,7 +20253,7 @@ const Eb = ["disabled"], Ab = {
20244
20253
  }
20245
20254
  },
20246
20255
  setup(n) {
20247
- return (e, t) => (L(), z("button", {
20256
+ return (e, t) => (I(), z("button", {
20248
20257
  type: "button",
20249
20258
  class: _(["icon-button", { active: n.editor.isActive("blockquote") }]),
20250
20259
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().toggleBlockquote().run())
@@ -20289,7 +20298,7 @@ const Eb = ["disabled"], Ab = {
20289
20298
  e.editor.chain().focus().extendMarkRange("link").setLink({ href: i }).run();
20290
20299
  }
20291
20300
  };
20292
- return (r, i) => (L(), z("button", {
20301
+ return (r, i) => (I(), z("button", {
20293
20302
  class: _(["icon-button", { active: n.editor.isActive("link") }]),
20294
20303
  type: "button",
20295
20304
  onClick: t
@@ -20321,16 +20330,16 @@ const Eb = ["disabled"], Ab = {
20321
20330
  }
20322
20331
  },
20323
20332
  setup(n) {
20324
- const e = ne(!1), t = ne(null), r = ["1.0", "1.2", "1.5", "2.0", "2.5", "3.0"], i = (a) => {
20333
+ const e = te(!1), t = te(null), r = ["1.0", "1.2", "1.5", "2.0", "2.5", "3.0"], i = (a) => {
20325
20334
  o.editor.chain().focus().toggleTextStyle({ lineHeight: a }).run(), e.value = !1;
20326
- }, s = Mn(() => o.editor ? o.editor.getAttributes("textStyle").lineHeight || "1.5" : "16px"), o = n, l = (a) => {
20335
+ }, s = Mn(() => o.editor ? o.editor.getAttributes("textStyle").lineHeight || "默认行高" : "16px"), o = n, l = (a) => {
20327
20336
  t.value && (t.value.contains(a.target) || (e.value = !1));
20328
20337
  };
20329
20338
  return tt(() => {
20330
20339
  document.addEventListener("mousedown", l);
20331
20340
  }), Ve(() => {
20332
20341
  document.removeEventListener("mousedown", l);
20333
- }), (a, c) => (L(), z("div", {
20342
+ }), (a, c) => (I(), z("div", {
20334
20343
  class: _(["dropdown-button line-height-button", { "is-open": e.value }]),
20335
20344
  ref_key: "wrapperRef",
20336
20345
  ref: t
@@ -20359,7 +20368,7 @@ const Eb = ["disabled"], Ab = {
20359
20368
  $(rr, { name: "dropdown" }, {
20360
20369
  default: Tn(() => [
20361
20370
  ir(b("div", i2, [
20362
- (L(), z(Zt, null, en(r, (u) => b("div", {
20371
+ (I(), z(Zt, null, en(r, (u) => b("div", {
20363
20372
  class: _(["item", { "is-selected": n.editor.isActive("textStyle", { lineHeight: u }) }]),
20364
20373
  key: u,
20365
20374
  onClick: (d) => i(u)
@@ -20374,7 +20383,7 @@ const Eb = ["disabled"], Ab = {
20374
20383
  })
20375
20384
  ], 2));
20376
20385
  }
20377
- }, a2 = /* @__PURE__ */ je(l2, [["__scopeId", "data-v-307ea6e9"]]), c2 = ["disabled"], u2 = {
20386
+ }, a2 = /* @__PURE__ */ je(l2, [["__scopeId", "data-v-5cb0ec55"]]), c2 = ["disabled"], u2 = {
20378
20387
  key: 0,
20379
20388
  class: "icon"
20380
20389
  }, d2 = {
@@ -20388,7 +20397,7 @@ const Eb = ["disabled"], Ab = {
20388
20397
  },
20389
20398
  emits: ["upload-start", "upload-end", "error"],
20390
20399
  setup(n, { emit: e }) {
20391
- const t = n, r = e, i = ne(null), s = ne(!1), o = () => {
20400
+ const t = n, r = e, i = te(null), s = te(!1), o = () => {
20392
20401
  s.value || i.value?.click();
20393
20402
  }, l = async (a) => {
20394
20403
  const c = a.target, u = c.files?.[0];
@@ -20408,7 +20417,7 @@ const Eb = ["disabled"], Ab = {
20408
20417
  s.value = !1, r("upload-end"), c.value = "";
20409
20418
  }
20410
20419
  };
20411
- return (a, c) => (L(), z("button", {
20420
+ return (a, c) => (I(), z("button", {
20412
20421
  class: "icon-button image-button",
20413
20422
  type: "button",
20414
20423
  onClick: o,
@@ -20423,7 +20432,7 @@ const Eb = ["disabled"], Ab = {
20423
20432
  onChange: l,
20424
20433
  style: { display: "none" }
20425
20434
  }, null, 544),
20426
- s.value ? (L(), z("div", d2, [...c[1] || (c[1] = [
20435
+ s.value ? (I(), z("div", d2, [...c[1] || (c[1] = [
20427
20436
  b("svg", { viewBox: "0 0 38 38" }, [
20428
20437
  b("circle", {
20429
20438
  stroke: "currentColor",
@@ -20445,7 +20454,7 @@ const Eb = ["disabled"], Ab = {
20445
20454
  })
20446
20455
  ])
20447
20456
  ], -1)
20448
- ])])) : (L(), z("div", u2, [...c[0] || (c[0] = [
20457
+ ])])) : (I(), z("div", u2, [...c[0] || (c[0] = [
20449
20458
  b("svg", {
20450
20459
  xmlns: "http://www.w3.org/2000/svg",
20451
20460
  viewBox: "0 0 448 512"
@@ -20459,10 +20468,11 @@ const Eb = ["disabled"], Ab = {
20459
20468
  d: "M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80zM0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm128 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm136 72c8.5 0 16.4 4.5 20.7 11.8l80 136c4.4 7.4 4.4 16.6 .1 24.1S352.6 384 344 384l-240 0c-8.9 0-17.2-5-21.3-12.9s-3.5-17.5 1.6-24.8l56-80c4.5-6.4 11.8-10.2 19.7-10.2s15.2 3.8 19.7 10.2l17.2 24.6 46.5-79c4.3-7.3 12.2-11.8 20.7-11.8z"
20460
20469
  })
20461
20470
  ], -1)
20462
- ])]))
20471
+ ])])),
20472
+ c[2] || (c[2] = b("div", { class: "tips" }, "上传图片", -1))
20463
20473
  ], 8, c2));
20464
20474
  }
20465
- }), h2 = /* @__PURE__ */ je(f2, [["__scopeId", "data-v-6f15cba5"]]), p2 = ["height"], m2 = {
20475
+ }), h2 = /* @__PURE__ */ je(f2, [["__scopeId", "data-v-9419e63b"]]), p2 = ["height"], m2 = {
20466
20476
  __name: "IconCheck",
20467
20477
  props: {
20468
20478
  editor: {
@@ -20479,11 +20489,11 @@ const Eb = ["disabled"], Ab = {
20479
20489
  }
20480
20490
  },
20481
20491
  setup(n) {
20482
- return (e, t) => (L(), z("div", {
20492
+ return (e, t) => (I(), z("div", {
20483
20493
  class: "icon",
20484
20494
  style: hn({ color: n.color })
20485
20495
  }, [
20486
- (L(), z("svg", {
20496
+ (I(), z("svg", {
20487
20497
  xmlns: "http://www.w3.org/2000/svg",
20488
20498
  viewBox: "0 0 448 512",
20489
20499
  height: n.size
@@ -20511,7 +20521,7 @@ const Eb = ["disabled"], Ab = {
20511
20521
  }
20512
20522
  },
20513
20523
  setup(n) {
20514
- const e = ne(!1), t = ne(null), r = [
20524
+ const e = te(!1), t = te(null), r = [
20515
20525
  // 黑白灰
20516
20526
  "#000000",
20517
20527
  "#262626",
@@ -20598,7 +20608,7 @@ const Eb = ["disabled"], Ab = {
20598
20608
  document.addEventListener("mousedown", l);
20599
20609
  }), Ve(() => {
20600
20610
  document.removeEventListener("mousedown", l);
20601
- }), (a, c) => (L(), z("div", {
20611
+ }), (a, c) => (I(), z("div", {
20602
20612
  class: _(["color-button", { open: e.value }]),
20603
20613
  ref_key: "wrapperRef",
20604
20614
  ref: t,
@@ -20626,16 +20636,16 @@ const Eb = ["disabled"], Ab = {
20626
20636
  style: hn({ backgroundColor: s.value || "#000" })
20627
20637
  }, null, 4)
20628
20638
  ]),
20629
- e.value ? (L(), z("div", y2, [
20639
+ e.value ? (I(), z("div", y2, [
20630
20640
  b("div", b2, [
20631
- (L(), z(Zt, null, en(r, (u) => b("div", {
20641
+ (I(), z(Zt, null, en(r, (u) => b("div", {
20632
20642
  key: u,
20633
20643
  class: "item",
20634
20644
  style: hn({ backgroundColor: u }),
20635
20645
  onClick: (d) => i(u),
20636
20646
  title: u
20637
20647
  }, [
20638
- n.editor.isActive("textStyle", { color: u }) ? (L(), Xs(Xd, {
20648
+ n.editor.isActive("textStyle", { color: u }) ? (I(), Xs(Xd, {
20639
20649
  key: 0,
20640
20650
  size: 10,
20641
20651
  color: "#fff"
@@ -20673,7 +20683,7 @@ const Eb = ["disabled"], Ab = {
20673
20683
  }
20674
20684
  },
20675
20685
  setup(n) {
20676
- const e = ne(!1), t = ne(null), r = [
20686
+ const e = te(!1), t = te(null), r = [
20677
20687
  // 黑白灰
20678
20688
  "#000000",
20679
20689
  "#262626",
@@ -20760,7 +20770,7 @@ const Eb = ["disabled"], Ab = {
20760
20770
  document.addEventListener("mousedown", l);
20761
20771
  }), Ve(() => {
20762
20772
  document.removeEventListener("mousedown", l);
20763
- }), (a, c) => (L(), z("div", {
20773
+ }), (a, c) => (I(), z("div", {
20764
20774
  class: _(["color-button", { open: e.value }]),
20765
20775
  ref_key: "wrapperRef",
20766
20776
  ref: t,
@@ -20788,16 +20798,16 @@ const Eb = ["disabled"], Ab = {
20788
20798
  style: hn({ backgroundColor: s.value || "#000" })
20789
20799
  }, null, 4)
20790
20800
  ]),
20791
- e.value ? (L(), z("div", T2, [
20801
+ e.value ? (I(), z("div", T2, [
20792
20802
  b("div", E2, [
20793
- (L(), z(Zt, null, en(r, (u) => b("div", {
20803
+ (I(), z(Zt, null, en(r, (u) => b("div", {
20794
20804
  key: u,
20795
20805
  class: "item",
20796
20806
  style: hn({ backgroundColor: u }),
20797
20807
  onClick: (d) => i(u),
20798
20808
  title: u
20799
20809
  }, [
20800
- n.editor.isActive("textStyle", { color: u }) ? (L(), Xs(Xd, {
20810
+ n.editor.isActive("textStyle", { color: u }) ? (I(), Xs(Xd, {
20801
20811
  key: 0,
20802
20812
  size: 10,
20803
20813
  color: "#fff"
@@ -20832,7 +20842,7 @@ const Eb = ["disabled"], Ab = {
20832
20842
  }
20833
20843
  },
20834
20844
  setup(n) {
20835
- return (e, t) => (L(), z("button", {
20845
+ return (e, t) => (I(), z("button", {
20836
20846
  class: _(["icon-button", { active: n.editor.isActive("subscript") }]),
20837
20847
  type: "button",
20838
20848
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().toggleSubscript().run())
@@ -20864,7 +20874,7 @@ const Eb = ["disabled"], Ab = {
20864
20874
  }
20865
20875
  },
20866
20876
  setup(n) {
20867
- return (e, t) => (L(), z("button", {
20877
+ return (e, t) => (I(), z("button", {
20868
20878
  class: _(["icon-button", { active: n.editor.isActive("superscript") }]),
20869
20879
  type: "button",
20870
20880
  onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().toggleSuperscript().run())
@@ -20896,7 +20906,7 @@ const Eb = ["disabled"], Ab = {
20896
20906
  }
20897
20907
  },
20898
20908
  setup(n) {
20899
- const e = ne(!1), t = ne(null), r = [
20909
+ const e = te(!1), t = te(null), r = [
20900
20910
  { icon: "●", label: "实心圆", value: "disc" },
20901
20911
  { icon: "○", label: "空心圆", value: "circle" },
20902
20912
  { icon: "■", label: "方块", value: "square" },
@@ -20912,7 +20922,7 @@ const Eb = ["disabled"], Ab = {
20912
20922
  document.addEventListener("mousedown", o);
20913
20923
  }), Ve(() => {
20914
20924
  document.removeEventListener("mousedown", o);
20915
- }), (l, a) => (L(), z("div", {
20925
+ }), (l, a) => (I(), z("div", {
20916
20926
  class: "dropdown-button list-button",
20917
20927
  ref_key: "wrapperRef",
20918
20928
  ref: t
@@ -20935,12 +20945,13 @@ const Eb = ["disabled"], Ab = {
20935
20945
  d: "M48 144a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM48 464a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM96 256a48 48 0 1 0 -96 0 48 48 0 1 0 96 0z"
20936
20946
  })
20937
20947
  ])
20938
- ], -1)
20948
+ ], -1),
20949
+ b("div", { class: "tips" }, "无序列表", -1)
20939
20950
  ])], 2),
20940
20951
  $(rr, { name: "dropdown" }, {
20941
20952
  default: Tn(() => [
20942
20953
  ir(b("div", z2, [
20943
- (L(), z(Zt, null, en(r, (c) => b("div", {
20954
+ (I(), z(Zt, null, en(r, (c) => b("div", {
20944
20955
  class: _(["item", { "is-selected": n.editor.isActive("bulletList") && n.editor.getAttributes("bulletList").listStyleType === c.value }]),
20945
20956
  key: c.value,
20946
20957
  onClick: (u) => i(c.value)
@@ -20956,7 +20967,7 @@ const Eb = ["disabled"], Ab = {
20956
20967
  })
20957
20968
  ], 512));
20958
20969
  }
20959
- }, V2 = /* @__PURE__ */ je(H2, [["__scopeId", "data-v-db1b450f"]]), _2 = { class: "dropdown" }, j2 = ["onClick"], W2 = { class: "icon" }, U2 = { class: "text" }, K2 = {
20970
+ }, V2 = /* @__PURE__ */ je(H2, [["__scopeId", "data-v-5a634115"]]), _2 = { class: "dropdown" }, j2 = ["onClick"], W2 = { class: "icon" }, U2 = { class: "text" }, K2 = {
20960
20971
  __name: "OrderedListButton",
20961
20972
  props: {
20962
20973
  editor: {
@@ -20965,7 +20976,7 @@ const Eb = ["disabled"], Ab = {
20965
20976
  }
20966
20977
  },
20967
20978
  setup(n) {
20968
- const e = ne(!1), t = ne(null), r = [
20979
+ const e = te(!1), t = te(null), r = [
20969
20980
  { icon: "1", label: "1. 2. 3.", value: "decimal" },
20970
20981
  { icon: "01", label: "01. 02. 03.", value: "decimal-leading-zero" },
20971
20982
  { icon: "a", label: "a. b. c.", value: "lower-alpha" },
@@ -20984,7 +20995,7 @@ const Eb = ["disabled"], Ab = {
20984
20995
  document.addEventListener("mousedown", o);
20985
20996
  }), Ve(() => {
20986
20997
  document.removeEventListener("mousedown", o);
20987
- }), (l, a) => (L(), z("div", {
20998
+ }), (l, a) => (I(), z("div", {
20988
20999
  class: "dropdown-button list-button",
20989
21000
  ref_key: "wrapperRef",
20990
21001
  ref: t
@@ -21007,12 +21018,13 @@ const Eb = ["disabled"], Ab = {
21007
21018
  d: "M0 72C0 58.8 10.7 48 24 48l48 0c13.3 0 24 10.7 24 24l0 104 24 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-96 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-80-24 0C10.7 96 0 85.3 0 72zM30.4 301.2C41.8 292.6 55.7 288 70 288l4.9 0c33.7 0 61.1 27.4 61.1 61.1 0 19.6-9.4 37.9-25.2 49.4l-24 17.5 33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-90.7 0C13.1 464 0 450.9 0 434.7 0 425.3 4.5 416.5 12.1 411l70.5-51.3c3.4-2.5 5.4-6.4 5.4-10.6 0-7.2-5.9-13.1-13.1-13.1L70 336c-3.9 0-7.7 1.3-10.8 3.6L38.4 355.2c-10.6 8-25.6 5.8-33.6-4.8S-1 324.8 9.6 316.8l20.8-15.6zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"
21008
21019
  })
21009
21020
  ])
21010
- ], -1)
21021
+ ], -1),
21022
+ b("div", { class: "tips" }, "有序列表", -1)
21011
21023
  ])], 2),
21012
21024
  $(rr, { name: "dropdown" }, {
21013
21025
  default: Tn(() => [
21014
21026
  ir(b("div", _2, [
21015
- (L(), z(Zt, null, en(r, (c) => b("div", {
21027
+ (I(), z(Zt, null, en(r, (c) => b("div", {
21016
21028
  class: _(["item", { "is-selected": n.editor.isActive("orderedList") && n.editor.getAttributes("orderedList").listStyleType === c.value }]),
21017
21029
  key: c.value,
21018
21030
  onClick: (u) => i(c.value)
@@ -21028,15 +21040,47 @@ const Eb = ["disabled"], Ab = {
21028
21040
  })
21029
21041
  ], 512));
21030
21042
  }
21031
- }, q2 = /* @__PURE__ */ je(K2, [["__scopeId", "data-v-683570d4"]]), J2 = { class: "icon" }, G2 = {
21043
+ }, q2 = /* @__PURE__ */ je(K2, [["__scopeId", "data-v-1a4525ea"]]), J2 = {
21044
+ __name: "TaskListButton",
21045
+ props: {
21046
+ editor: {
21047
+ type: Object,
21048
+ required: !0
21049
+ }
21050
+ },
21051
+ setup(n) {
21052
+ return (e, t) => (I(), z("button", {
21053
+ class: _(["icon-button", { active: n.editor.isActive("taskList") }]),
21054
+ type: "button",
21055
+ onClick: t[0] || (t[0] = (r) => n.editor.chain().focus().toggleTaskList().run())
21056
+ }, [...t[1] || (t[1] = [
21057
+ b("div", { class: "icon" }, [
21058
+ b("svg", {
21059
+ xmlns: "http://www.w3.org/2000/svg",
21060
+ viewBox: "0 0 512 512"
21061
+ }, [
21062
+ b("path", {
21063
+ fill: "currentColor",
21064
+ stroke: "currentColor",
21065
+ "stroke-width": "4",
21066
+ "stroke-linecap": "round",
21067
+ "stroke-linejoin": "round",
21068
+ d: "M133.8 36.3c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 158 47 153L7 113C-2.3 103.6-2.3 88.4 7 79S31.6 69.7 41 79l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zm0 160c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 318 47 313L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM64 376a40 40 0 1 1 0 80 40 40 0 1 1 0-80z"
21069
+ })
21070
+ ])
21071
+ ], -1),
21072
+ b("div", { class: "tips" }, "任务列表", -1)
21073
+ ])], 2));
21074
+ }
21075
+ }, G2 = { class: "icon" }, Y2 = {
21032
21076
  key: 0,
21033
21077
  xmlns: "http://www.w3.org/2000/svg",
21034
21078
  viewBox: "0 0 512 512"
21035
- }, Y2 = {
21079
+ }, X2 = {
21036
21080
  key: 1,
21037
21081
  xmlns: "http://www.w3.org/2000/svg",
21038
21082
  viewBox: "0 0 512 512"
21039
- }, X2 = /* @__PURE__ */ et({
21083
+ }, Q2 = /* @__PURE__ */ et({
21040
21084
  __name: "ThemeButton",
21041
21085
  props: {
21042
21086
  theme: {}
@@ -21046,13 +21090,13 @@ const Eb = ["disabled"], Ab = {
21046
21090
  const t = e, r = () => {
21047
21091
  t("toggle-theme");
21048
21092
  };
21049
- return (i, s) => (L(), z("button", {
21093
+ return (i, s) => (I(), z("button", {
21050
21094
  class: "icon-button",
21051
21095
  type: "button",
21052
21096
  onClick: r
21053
21097
  }, [
21054
- b("div", J2, [
21055
- n.theme === "light" ? (L(), z("svg", G2, [...s[0] || (s[0] = [
21098
+ b("div", G2, [
21099
+ n.theme === "light" ? (I(), z("svg", Y2, [...s[0] || (s[0] = [
21056
21100
  b("path", {
21057
21101
  fill: "currentColor",
21058
21102
  stroke: "currentColor",
@@ -21061,7 +21105,7 @@ const Eb = ["disabled"], Ab = {
21061
21105
  "stroke-linejoin": "round",
21062
21106
  d: "M256 0C114.6 0 0 114.6 0 256S114.6 512 256 512c68.8 0 131.3-27.2 177.3-71.4 7.3-7 9.4-17.9 5.3-27.1s-13.7-14.9-23.8-14.1c-4.9 .4-9.8 .6-14.8 .6-101.6 0-184-82.4-184-184 0-72.1 41.5-134.6 102.1-164.8 9.1-4.5 14.3-14.3 13.1-24.4S322.6 8.5 312.7 6.3C294.4 2.2 275.4 0 256 0z"
21063
21107
  }, null, -1)
21064
- ])])) : (L(), z("svg", Y2, [...s[1] || (s[1] = [
21108
+ ])])) : (I(), z("svg", X2, [...s[1] || (s[1] = [
21065
21109
  b("path", {
21066
21110
  fill: "currentColor",
21067
21111
  stroke: "currentColor",
@@ -21075,7 +21119,7 @@ const Eb = ["disabled"], Ab = {
21075
21119
  s[2] || (s[2] = b("div", { class: "tips" }, "切换主题", -1))
21076
21120
  ]));
21077
21121
  }
21078
- }), Q2 = { class: "group" }, Z2 = { class: "group" }, ek = { class: "group" }, tk = { class: "group" }, nk = { class: "group" }, rk = { class: "group" }, ik = { class: "group" }, sk = /* @__PURE__ */ et({
21122
+ }), Z2 = { class: "tools" }, ek = { class: "group" }, tk = { class: "group" }, nk = { class: "group" }, rk = { class: "group" }, ik = { class: "group" }, sk = { class: "group" }, ok = { class: "group" }, lk = { class: "theme" }, ak = /* @__PURE__ */ et({
21079
21123
  __name: "EditorToolbar",
21080
21124
  props: {
21081
21125
  theme: {},
@@ -21085,73 +21129,79 @@ const Eb = ["disabled"], Ab = {
21085
21129
  emits: ["toggle-theme"],
21086
21130
  setup(n, { emit: e }) {
21087
21131
  const t = e;
21088
- return (r, i) => n.editor ? (L(), z("div", {
21132
+ return (r, i) => n.editor ? (I(), z("div", {
21089
21133
  key: 0,
21090
21134
  class: "toolbar",
21091
21135
  onClick: i[1] || (i[1] = sf(() => {
21092
21136
  }, ["stop"]))
21093
21137
  }, [
21094
- b("div", Q2, [
21095
- $(Ab, { editor: n.editor }, null, 8, ["editor"]),
21096
- $(Nb, { editor: n.editor }, null, 8, ["editor"]),
21097
- $(Db, { editor: n.editor }, null, 8, ["editor"])
21098
- ]),
21099
21138
  b("div", Z2, [
21100
- $(Bb, { editor: n.editor }, null, 8, ["editor"]),
21101
- $(jb, { editor: n.editor }, null, 8, ["editor"]),
21102
- $(a2, { editor: n.editor }, null, 8, ["editor"])
21103
- ]),
21104
- b("div", ek, [
21105
- $(Wb, { editor: n.editor }, null, 8, ["editor"]),
21106
- $(Ub, { editor: n.editor }, null, 8, ["editor"]),
21107
- $(Kb, { editor: n.editor }, null, 8, ["editor"]),
21108
- $(qb, { editor: n.editor }, null, 8, ["editor"]),
21109
- $(Xb, { editor: n.editor }, null, 8, ["editor"]),
21110
- $(Yb, { editor: n.editor }, null, 8, ["editor"]),
21111
- $(S2, { editor: n.editor }, null, 8, ["editor"]),
21112
- $(I2, { editor: n.editor }, null, 8, ["editor"]),
21113
- $(t2, { editor: n.editor }, null, 8, ["editor"])
21114
- ]),
21115
- b("div", tk, [
21116
- $(V2, { editor: n.editor }, null, 8, ["editor"]),
21117
- $(q2, { editor: n.editor }, null, 8, ["editor"])
21118
- ]),
21119
- b("div", nk, [
21120
- $(Qb, { editor: n.editor }, null, 8, ["editor"]),
21121
- $(Zb, { editor: n.editor }, null, 8, ["editor"]),
21122
- $(e2, { editor: n.editor }, null, 8, ["editor"]),
21123
- $(L2, { editor: n.editor }, null, 8, ["editor"]),
21124
- $(P2, { editor: n.editor }, null, 8, ["editor"])
21125
- ]),
21126
- b("div", rk, [
21127
- $(n2, { editor: n.editor }, null, 8, ["editor"]),
21128
- $(Jb, { editor: n.editor }, null, 8, ["editor"]),
21129
- $(Gb, { editor: n.editor }, null, 8, ["editor"]),
21130
- $(h2, {
21131
- editor: n.editor,
21132
- uploadImage: n.uploadImage
21133
- }, null, 8, ["editor", "uploadImage"])
21139
+ b("div", ek, [
21140
+ $(Ab, { editor: n.editor }, null, 8, ["editor"]),
21141
+ $(Nb, { editor: n.editor }, null, 8, ["editor"]),
21142
+ $(Db, { editor: n.editor }, null, 8, ["editor"])
21143
+ ]),
21144
+ b("div", tk, [
21145
+ $(Bb, { editor: n.editor }, null, 8, ["editor"]),
21146
+ $(jb, { editor: n.editor }, null, 8, ["editor"]),
21147
+ $(a2, { editor: n.editor }, null, 8, ["editor"])
21148
+ ]),
21149
+ b("div", nk, [
21150
+ $(S2, { editor: n.editor }, null, 8, ["editor"]),
21151
+ $(I2, { editor: n.editor }, null, 8, ["editor"])
21152
+ ]),
21153
+ b("div", rk, [
21154
+ $(Wb, { editor: n.editor }, null, 8, ["editor"]),
21155
+ $(Ub, { editor: n.editor }, null, 8, ["editor"]),
21156
+ $(Kb, { editor: n.editor }, null, 8, ["editor"]),
21157
+ $(qb, { editor: n.editor }, null, 8, ["editor"]),
21158
+ $(Xb, { editor: n.editor }, null, 8, ["editor"]),
21159
+ $(Yb, { editor: n.editor }, null, 8, ["editor"]),
21160
+ $(Qb, { editor: n.editor }, null, 8, ["editor"]),
21161
+ $(Zb, { editor: n.editor }, null, 8, ["editor"]),
21162
+ $(e2, { editor: n.editor }, null, 8, ["editor"]),
21163
+ $(t2, { editor: n.editor }, null, 8, ["editor"])
21164
+ ]),
21165
+ b("div", ik, [
21166
+ $(V2, { editor: n.editor }, null, 8, ["editor"]),
21167
+ $(q2, { editor: n.editor }, null, 8, ["editor"]),
21168
+ $(J2, { editor: n.editor }, null, 8, ["editor"])
21169
+ ]),
21170
+ b("div", sk, [
21171
+ $(L2, { editor: n.editor }, null, 8, ["editor"]),
21172
+ $(P2, { editor: n.editor }, null, 8, ["editor"])
21173
+ ]),
21174
+ b("div", ok, [
21175
+ $(n2, { editor: n.editor }, null, 8, ["editor"]),
21176
+ $(Jb, { editor: n.editor }, null, 8, ["editor"]),
21177
+ $(Gb, { editor: n.editor }, null, 8, ["editor"]),
21178
+ $(h2, {
21179
+ editor: n.editor,
21180
+ uploadImage: n.uploadImage
21181
+ }, null, 8, ["editor", "uploadImage"])
21182
+ ])
21134
21183
  ]),
21135
- b("div", ik, [
21136
- $(X2, {
21184
+ b("div", lk, [
21185
+ $(Q2, {
21137
21186
  theme: n.theme,
21138
21187
  onToggleTheme: i[0] || (i[0] = () => t("toggle-theme"))
21139
21188
  }, null, 8, ["theme"])
21140
21189
  ])
21141
21190
  ])) : pn("", !0);
21142
21191
  }
21143
- }), ok = /* @__PURE__ */ je(sk, [["__scopeId", "data-v-5db8794e"]]), lk = /* @__PURE__ */ et({
21192
+ }), ck = /* @__PURE__ */ je(ak, [["__scopeId", "data-v-032877ca"]]), uk = /* @__PURE__ */ et({
21144
21193
  __name: "RichEditor",
21145
21194
  props: {
21195
+ format: {},
21146
21196
  theme: {},
21147
21197
  modelValue: {},
21148
21198
  uploadImage: { type: Function }
21149
21199
  },
21150
21200
  emits: ["update:modelValue"],
21151
21201
  setup(n, { emit: e }) {
21152
- const t = n, r = e, i = ne(t.theme ?? "light"), s = () => {
21202
+ const t = n, r = e, i = te(t.theme ?? "light"), s = te(t.format ?? "html"), o = () => {
21153
21203
  i.value = i.value === "light" ? "dark" : "light";
21154
- }, o = d0({
21204
+ }, l = d0({
21155
21205
  content: t.modelValue,
21156
21206
  extensions: [
21157
21207
  q1,
@@ -21185,69 +21235,92 @@ const Eb = ["disabled"], Ab = {
21185
21235
  }),
21186
21236
  v0
21187
21237
  ],
21188
- onUpdate({ editor: a }) {
21189
- r("update:modelValue", a.getHTML());
21238
+ onUpdate({ editor: c }) {
21239
+ let u = "";
21240
+ switch (s.value) {
21241
+ case "html":
21242
+ u = c.getHTML();
21243
+ break;
21244
+ case "json":
21245
+ u = JSON.stringify(c.getJSON());
21246
+ break;
21247
+ case "text":
21248
+ u = c.getText();
21249
+ break;
21250
+ }
21251
+ r("update:modelValue", u);
21190
21252
  }
21191
21253
  });
21192
21254
  of(
21193
21255
  () => t.modelValue,
21194
- (a) => {
21195
- o.value && a !== o.value.getHTML() && o.value.commands.setContent(a || "");
21256
+ (c) => {
21257
+ if (!l.value) return;
21258
+ const u = (() => {
21259
+ switch (s.value) {
21260
+ case "html":
21261
+ return l.value.getHTML();
21262
+ case "json":
21263
+ return JSON.stringify(l.value.getJSON());
21264
+ case "text":
21265
+ return l.value.getText();
21266
+ }
21267
+ })();
21268
+ c && c !== u && l.value.commands.setContent(c);
21196
21269
  }
21197
21270
  );
21198
- const l = async (a) => {
21199
- console.log(a);
21200
- const c = new FileReader();
21201
- return c.readAsDataURL(a), {
21202
- url: await new Promise((d, f) => {
21203
- c.onload = () => d(c.result), c.onerror = (h) => f(h);
21271
+ const a = async (c) => {
21272
+ console.log(c);
21273
+ const u = new FileReader();
21274
+ return u.readAsDataURL(c), {
21275
+ url: await new Promise((f, h) => {
21276
+ u.onload = () => f(u.result), u.onerror = (p) => h(p);
21204
21277
  }),
21205
- name: a.name
21278
+ name: c.name
21206
21279
  };
21207
21280
  };
21208
- return (a, c) => (L(), z("div", {
21281
+ return (c, u) => (I(), z("div", {
21209
21282
  class: _(["srcker-editor", i.value])
21210
21283
  }, [
21211
- $(ok, {
21212
- editor: Ae(o),
21284
+ $(ck, {
21285
+ editor: Ae(l),
21213
21286
  theme: i.value,
21214
- onToggleTheme: c[0] || (c[0] = () => s()),
21215
- uploadImage: (u) => t.uploadImage ? t.uploadImage(u) : l(u)
21287
+ onToggleTheme: u[0] || (u[0] = () => o()),
21288
+ uploadImage: (d) => t.uploadImage ? t.uploadImage(d) : a(d)
21216
21289
  }, null, 8, ["editor", "theme", "uploadImage"]),
21217
- Ae(o) ? (L(), Xs(Ae(Sb), {
21290
+ Ae(l) ? (I(), Xs(Ae(Sb), {
21218
21291
  key: 0,
21219
21292
  class: "bubble-menu",
21220
- "should-show": () => Ae(o).isActive("image"),
21293
+ "should-show": () => Ae(l).isActive("image"),
21221
21294
  options: { placement: "top-start", offset: 8 },
21222
- editor: Ae(o)
21295
+ editor: Ae(l)
21223
21296
  }, {
21224
21297
  default: Tn(() => [
21225
21298
  b("button", {
21226
21299
  type: "button",
21227
- onClick: c[1] || (c[1] = (u) => Ae(o).chain().focus().updateAttributes("image", { width: "20%" }).run())
21300
+ onClick: u[1] || (u[1] = (d) => Ae(l).chain().focus().updateAttributes("image", { width: "20%" }).run())
21228
21301
  }, "20%"),
21229
21302
  b("button", {
21230
21303
  type: "button",
21231
- onClick: c[2] || (c[2] = (u) => Ae(o).chain().focus().updateAttributes("image", { width: "50%" }).run())
21304
+ onClick: u[2] || (u[2] = (d) => Ae(l).chain().focus().updateAttributes("image", { width: "50%" }).run())
21232
21305
  }, "50%"),
21233
21306
  b("button", {
21234
21307
  type: "button",
21235
- onClick: c[3] || (c[3] = (u) => Ae(o).chain().focus().updateAttributes("image", { width: "100%" }).run())
21308
+ onClick: u[3] || (u[3] = (d) => Ae(l).chain().focus().updateAttributes("image", { width: "100%" }).run())
21236
21309
  }, "100%"),
21237
21310
  b("button", {
21238
21311
  type: "button",
21239
- onClick: c[4] || (c[4] = (u) => Ae(o).chain().focus().updateAttributes("image", { width: "auto" }).run())
21312
+ onClick: u[4] || (u[4] = (d) => Ae(l).chain().focus().updateAttributes("image", { width: "auto" }).run())
21240
21313
  }, "默认")
21241
21314
  ]),
21242
21315
  _: 1
21243
21316
  }, 8, ["should-show", "editor"])) : pn("", !0),
21244
21317
  $(Ae(u0), {
21245
- editor: Ae(o),
21318
+ editor: Ae(l),
21246
21319
  class: _(["editor-body srcker-html-content", i.value])
21247
21320
  }, null, 8, ["editor", "class"])
21248
21321
  ], 2));
21249
21322
  }
21250
- }), La = /* @__PURE__ */ je(lk, [["__scopeId", "data-v-08b75f5f"]]);
21323
+ }), La = /* @__PURE__ */ je(uk, [["__scopeId", "data-v-58bc3fb5"]]);
21251
21324
  La.install = (n) => {
21252
21325
  n.component("RichEditor", La);
21253
21326
  };