poro-editor 1.7.4 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.d.ts CHANGED
@@ -44,7 +44,7 @@ export namespace DEFAULT_CONFIG {
44
44
  export let theme: string;
45
45
  export let locale: string;
46
46
  export { DEFAULT_EXPORT_FORMATS as exportFormats };
47
- export let maxLength: null;
47
+ export let maxLength: number;
48
48
  export let showCharCount: boolean;
49
49
  export let readonly: boolean;
50
50
  export { DEFAULT_VARIABLE_CONFIG as variables };
@@ -24808,7 +24808,7 @@ const WN = Og(IV), Kg = {
24808
24808
  getPrefixCls: RV,
24809
24809
  iconPrefixCls: mp
24810
24810
  }), {
24811
- Consumer: cie
24811
+ Consumer: uie
24812
24812
  } = Ct, sx = {};
24813
24813
  function xr(e) {
24814
24814
  const t = g.useContext(Ct), {
@@ -62422,47 +62422,100 @@ var hoe = poe, moe = Wn.create({
62422
62422
  };
62423
62423
  }
62424
62424
  }), boe = voe, yoe = BH;
62425
- const Coe = qt.create({
62425
+ const Coe = (e, t) => {
62426
+ const n = {
62427
+ zh: `粘贴的内容超出字数限制,超出 ${e} 个字符`,
62428
+ en: `Pasted content exceeds character limit by ${e} characters`,
62429
+ ja: `貼り付けたコンテンツが文字数制限を${e}文字超えています`
62430
+ }, r = n[t] || n.zh, o = document.createElement("div");
62431
+ if (o.className = "paste-limit-toast", o.textContent = r, o.style.cssText = `
62432
+ position: fixed;
62433
+ top: 20px;
62434
+ left: 50%;
62435
+ transform: translateX(-50%);
62436
+ background: #faad14;
62437
+ color: #fff;
62438
+ padding: 12px 24px;
62439
+ border-radius: 4px;
62440
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15);
62441
+ z-index: 10000;
62442
+ font-size: 14px;
62443
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
62444
+ animation: slideDown 0.3s ease;
62445
+ `, !document.getElementById("paste-limit-toast-style")) {
62446
+ const i = document.createElement("style");
62447
+ i.id = "paste-limit-toast-style", i.textContent = `
62448
+ @keyframes slideDown {
62449
+ from {
62450
+ opacity: 0;
62451
+ transform: translateX(-50%) translateY(-20px);
62452
+ }
62453
+ to {
62454
+ opacity: 1;
62455
+ transform: translateX(-50%) translateY(0);
62456
+ }
62457
+ }
62458
+ `, document.head.appendChild(i);
62459
+ }
62460
+ document.body.appendChild(o), setTimeout(() => {
62461
+ o.style.opacity = "0", o.style.transform = "translateX(-50%) translateY(-20px)", o.style.transition = "all 0.3s ease", setTimeout(() => {
62462
+ document.body.removeChild(o);
62463
+ }, 300);
62464
+ }, 3e3);
62465
+ }, Soe = qt.create({
62426
62466
  name: "pasteMarkdown",
62467
+ addOptions() {
62468
+ return {
62469
+ maxLength: null,
62470
+ locale: "zh"
62471
+ };
62472
+ },
62427
62473
  addProseMirrorPlugins() {
62428
- const { editor: e } = this;
62474
+ const { editor: e } = this, t = this.options.maxLength, n = this.options.locale;
62429
62475
  return [
62430
62476
  new sn({
62431
62477
  props: {
62432
- handlePaste(t, n, r) {
62433
- var s, l;
62434
- if (!t.editable) return !1;
62435
- const o = (s = n.clipboardData) == null ? void 0 : s.getData("text/html"), i = (l = n.clipboardData) == null ? void 0 : l.getData("text/plain");
62436
- if (!i)
62478
+ handlePaste(r, o, i) {
62479
+ var c, u, d, f;
62480
+ if (!r.editable) return !1;
62481
+ const a = (c = o.clipboardData) == null ? void 0 : c.getData("text/html"), s = (u = o.clipboardData) == null ? void 0 : u.getData("text/plain");
62482
+ if (console.log("Paste check:", { maxLength: t, hasText: !!s, textLength: s == null ? void 0 : s.length }), !s)
62437
62483
  return !1;
62438
- const a = Soe(i);
62484
+ if (t) {
62485
+ const p = ((f = (d = e.storage.characterCount) == null ? void 0 : d.characters) == null ? void 0 : f.call(d)) ?? e.getText().length, h = s.length, v = p + h;
62486
+ if (console.log("Length check:", { currentLength: p, pasteLength: h, totalLength: v, maxLength: t }), v > t) {
62487
+ const m = v - t;
62488
+ return console.log("Exceeded limit by:", m), Coe(m, n), !0;
62489
+ }
62490
+ }
62491
+ const l = xoe(s);
62439
62492
  if (console.log("Paste detection:", {
62440
- hasHtml: !!o,
62441
- htmlLength: o == null ? void 0 : o.length,
62442
- textLength: i.length,
62493
+ hasHtml: !!a,
62494
+ htmlLength: a == null ? void 0 : a.length,
62495
+ textLength: s.length,
62443
62496
  hasMarkdownExt: !!e.markdown,
62444
- hasMarkdownSyntax: a,
62445
- textPreview: i.substring(0, 100),
62446
- htmlPreview: o == null ? void 0 : o.substring(0, 500)
62447
- }), o) {
62497
+ hasMarkdownSyntax: l,
62498
+ textPreview: s.substring(0, 100),
62499
+ htmlPreview: a == null ? void 0 : a.substring(0, 500)
62500
+ }), a) {
62448
62501
  console.log("Using HTML paste");
62449
62502
  try {
62450
- return e.commands.insertContent(o, {
62503
+ return e.commands.insertContent(a, {
62451
62504
  parseOptions: {
62452
62505
  preserveWhitespace: "full"
62453
62506
  }
62454
62507
  }), !0;
62455
- } catch (c) {
62456
- console.warn("HTML parse error:", c);
62508
+ } catch (p) {
62509
+ console.warn("HTML parse error:", p);
62457
62510
  }
62458
62511
  }
62459
- if (e.markdown && a)
62512
+ if (e.markdown && l)
62460
62513
  try {
62461
- const c = e.markdown.parse(i);
62462
- if (console.log("Markdown parsed result:", JSON.stringify(c, null, 2)), c && c.content && c.content.length > 0)
62463
- return e.commands.insertContent(c), !0;
62464
- } catch (c) {
62465
- console.warn("Markdown parse error:", c);
62514
+ const p = e.markdown.parse(s);
62515
+ if (console.log("Markdown parsed result:", JSON.stringify(p, null, 2)), p && p.content && p.content.length > 0)
62516
+ return e.commands.insertContent(p), !0;
62517
+ } catch (p) {
62518
+ console.warn("Markdown parse error:", p);
62466
62519
  }
62467
62520
  return !1;
62468
62521
  }
@@ -62471,7 +62524,7 @@ const Coe = qt.create({
62471
62524
  ];
62472
62525
  }
62473
62526
  });
62474
- function Soe(e) {
62527
+ function xoe(e) {
62475
62528
  const t = [
62476
62529
  /\*\*[^*]+\*\*/,
62477
62530
  /\*[^*\n]+\*/,
@@ -62494,10 +62547,10 @@ function Soe(e) {
62494
62547
  return !0;
62495
62548
  return !1;
62496
62549
  }
62497
- const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe = (e, t, n, r, o) => {
62550
+ const woe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), Eoe = (e, t, n, r, o) => {
62498
62551
  switch (e) {
62499
62552
  case "separator":
62500
- return /* @__PURE__ */ P(xoe, {}, `separator-${r}`);
62553
+ return /* @__PURE__ */ P(woe, {}, `separator-${r}`);
62501
62554
  case "heading":
62502
62555
  return /* @__PURE__ */ Xe(j.Fragment, { children: [
62503
62556
  /* @__PURE__ */ P(
@@ -62566,7 +62619,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
62566
62619
  default:
62567
62620
  return null;
62568
62621
  }
62569
- }, Eoe = ({ editor: e, config: t }) => {
62622
+ }, $oe = ({ editor: e, config: t }) => {
62570
62623
  const { t: n } = pt(Cn) || {}, r = aa({
62571
62624
  editor: e,
62572
62625
  selector: (o) => ({
@@ -62578,8 +62631,8 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
62578
62631
  isBlockquote: o.editor.isActive("blockquote")
62579
62632
  })
62580
62633
  });
62581
- return /* @__PURE__ */ P(Hr, { children: t.map((o, i) => woe(o, e, r, i, n)) });
62582
- }, $oe = ({ editor: e, t }) => {
62634
+ return /* @__PURE__ */ P(Hr, { children: t.map((o, i) => Eoe(o, e, r, i, n)) });
62635
+ }, Ooe = ({ editor: e, t }) => {
62583
62636
  var m, b;
62584
62637
  const [n, r] = $e(!1), [o, i] = $e(""), [a, s] = $e(!1), { config: l } = pt(Cn) || {}, c = (l == null ? void 0 : l.ai) || {}, u = (l == null ? void 0 : l.locale) || "zh", d = hy(), f = () => {
62585
62638
  if (!e) return "";
@@ -62657,10 +62710,10 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
62657
62710
  }
62658
62711
  )
62659
62712
  ] });
62660
- }, Ooe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), koe = (e, t, n, r) => {
62713
+ }, koe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), Noe = (e, t, n, r) => {
62661
62714
  switch (e) {
62662
62715
  case "separator":
62663
- return /* @__PURE__ */ P(Ooe, {}, `separator-${Math.random()}`);
62716
+ return /* @__PURE__ */ P(koe, {}, `separator-${Math.random()}`);
62664
62717
  case "bold":
62665
62718
  return /* @__PURE__ */ P(
62666
62719
  pn,
@@ -62723,11 +62776,11 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
62723
62776
  case "link":
62724
62777
  return /* @__PURE__ */ P(pP, { editor: t, t: r }, "link");
62725
62778
  case "ai":
62726
- return /* @__PURE__ */ P($oe, { editor: t, t: r }, "ai");
62779
+ return /* @__PURE__ */ P(Ooe, { editor: t, t: r }, "ai");
62727
62780
  default:
62728
62781
  return null;
62729
62782
  }
62730
- }, Noe = ({ editor: e, config: t }) => {
62783
+ }, Moe = ({ editor: e, config: t }) => {
62731
62784
  const { t: n } = pt(Cn) || {}, r = aa({
62732
62785
  editor: e,
62733
62786
  selector: (o) => ({
@@ -62738,8 +62791,8 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
62738
62791
  isCode: o.editor.isActive("code")
62739
62792
  })
62740
62793
  });
62741
- return /* @__PURE__ */ P(Hr, { children: t.map((o) => koe(o, e, r, n)) });
62742
- }, Moe = ({ editor: e, node: t, deleteNode: n, selected: r }) => {
62794
+ return /* @__PURE__ */ P(Hr, { children: t.map((o) => Noe(o, e, r, n)) });
62795
+ }, Ioe = ({ editor: e, node: t, deleteNode: n, selected: r }) => {
62743
62796
  var c, u, d;
62744
62797
  const { t: o } = pt(Cn) || {}, [i, a] = $e([]), s = de(null);
62745
62798
  it(() => {
@@ -62905,7 +62958,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
62905
62958
  ]
62906
62959
  }
62907
62960
  );
62908
- }, Ioe = Wn.create({
62961
+ }, Toe = Wn.create({
62909
62962
  name: "outline",
62910
62963
  group: "block",
62911
62964
  atom: !0,
@@ -62949,7 +63002,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
62949
63002
  };
62950
63003
  },
62951
63004
  addNodeView() {
62952
- return Rb(Moe);
63005
+ return Rb(Ioe);
62953
63006
  },
62954
63007
  addCommands() {
62955
63008
  return {
@@ -62961,10 +63014,10 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
62961
63014
  }
62962
63015
  };
62963
63016
  }
62964
- }), Toe = (e, t) => {
63017
+ }), Roe = (e, t) => {
62965
63018
  const n = e.toLowerCase().replace(/\s+/g, "-").replace(/[^\w\u4e00-\u9fa5-]/g, "").slice(0, 30);
62966
63019
  return `heading-${t}-${n || "untitled"}`;
62967
- }, Roe = wF.extend({
63020
+ }, Poe = wF.extend({
62968
63021
  addAttributes() {
62969
63022
  var e;
62970
63023
  return {
@@ -62986,7 +63039,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
62986
63039
  let o = !1;
62987
63040
  return n.doc.descendants((i, a) => {
62988
63041
  if (i.type.name === "heading" && !i.attrs.id) {
62989
- const s = Toe(i.textContent, a);
63042
+ const s = Roe(i.textContent, a);
62990
63043
  r.setNodeMarkup(a, null, { ...i.attrs, id: s }), o = !0;
62991
63044
  }
62992
63045
  }), o ? r : null;
@@ -62994,10 +63047,10 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
62994
63047
  })
62995
63048
  ];
62996
63049
  }
62997
- }), Poe = ({ node: e, extension: t }) => {
63050
+ }), Aoe = ({ node: e, extension: t }) => {
62998
63051
  const n = t.options.prefix || "${", r = t.options.suffix || "}";
62999
63052
  return /* @__PURE__ */ P(Pd, { className: "variable-node-wrapper", as: "span", children: /* @__PURE__ */ P("span", { className: "variable-node-content", "data-id": e.attrs.id, children: `${n}${e.attrs.label || e.attrs.id}${r}` }) });
63000
- }, Aoe = Wn.create({
63053
+ }, _oe = Wn.create({
63001
63054
  name: "variable",
63002
63055
  group: "inline",
63003
63056
  inline: !0,
@@ -63040,7 +63093,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63040
63093
  ];
63041
63094
  },
63042
63095
  addNodeView() {
63043
- return Rb(Poe);
63096
+ return Rb(Aoe);
63044
63097
  },
63045
63098
  addCommands() {
63046
63099
  return {
@@ -63059,7 +63112,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63059
63112
  disabled: r,
63060
63113
  children: /* @__PURE__ */ P(ut, { icon: e, size: 16 })
63061
63114
  }
63062
- ) }), _oe = ({ editor: e }) => {
63115
+ ) }), Doe = ({ editor: e }) => {
63063
63116
  const { t } = pt(Cn) || {}, n = de(null), [r, o] = $e(!1), [i, a] = $e({ top: 0, left: 0 }), s = de(null), l = an(() => {
63064
63117
  s.current && (s.current.classList.remove("table-selected"), s.current = null);
63065
63118
  }, []), c = an(() => {
@@ -63126,11 +63179,11 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63126
63179
  },
63127
63180
  children: [
63128
63181
  /* @__PURE__ */ P("div", { className: "table-toolbar-toggle", children: /* @__PURE__ */ P(ut, { icon: "mdi:table", size: 16 }) }),
63129
- /* @__PURE__ */ P("div", { className: "table-toolbar-expanded", children: /* @__PURE__ */ P(Doe, { editor: e, t }) })
63182
+ /* @__PURE__ */ P("div", { className: "table-toolbar-expanded", children: /* @__PURE__ */ P(Loe, { editor: e, t }) })
63130
63183
  ]
63131
63184
  }
63132
63185
  );
63133
- }, Doe = ({ editor: e, t }) => {
63186
+ }, Loe = ({ editor: e, t }) => {
63134
63187
  const n = aa({
63135
63188
  editor: e,
63136
63189
  selector: (r) => ({
@@ -63240,14 +63293,14 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63240
63293
  }
63241
63294
  )
63242
63295
  ] });
63243
- }, Loe = ({ status: e, error: t, onRetry: n }) => e === "uploading" ? /* @__PURE__ */ Xe("div", { className: "image-placeholder uploading", children: [
63296
+ }, zoe = ({ status: e, error: t, onRetry: n }) => e === "uploading" ? /* @__PURE__ */ Xe("div", { className: "image-placeholder uploading", children: [
63244
63297
  /* @__PURE__ */ P("div", { className: "image-placeholder-spinner" }),
63245
63298
  /* @__PURE__ */ P("span", { className: "image-placeholder-text", children: "上传中..." })
63246
63299
  ] }) : e === "error" ? /* @__PURE__ */ Xe("div", { className: "image-placeholder error", onClick: n, children: [
63247
63300
  /* @__PURE__ */ P(ut, { icon: "mdi:image-broken", size: 32 }),
63248
63301
  /* @__PURE__ */ P("span", { className: "image-placeholder-text", children: t || "上传失败" }),
63249
63302
  /* @__PURE__ */ P("span", { className: "image-placeholder-retry", children: "点击重试" })
63250
- ] }) : null, zoe = ({ node: e, updateAttributes: t, deleteNode: n, selected: r, editor: o }) => {
63303
+ ] }) : null, Boe = ({ node: e, updateAttributes: t, deleteNode: n, selected: r, editor: o }) => {
63251
63304
  const { config: i } = pt(Cn) || {}, a = (i == null ? void 0 : i.upload) || {}, [s, l] = $e(e.attrs.status || "done"), [c, u] = $e(e.attrs.error || null), d = de(null), [f, p] = $e(!1), [h, v] = $e(null), m = de({ x: 0, y: 0, width: 0, height: 0, corner: "", aspectRatio: 1 }), [b, y] = $e({ width: 0, height: 0 }), C = an(async () => {
63252
63305
  const T = e.attrs.file;
63253
63306
  if (T) {
@@ -63358,7 +63411,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63358
63411
  { name: "sw", cursor: "nesw-resize", style: { bottom: -6, left: -6 } },
63359
63412
  { name: "se", cursor: "nwse-resize", style: { bottom: -6, right: -6 } }
63360
63413
  ];
63361
- return s !== "done" ? /* @__PURE__ */ P(Pd, { className: "image-node-wrapper", style: M, ref: d, children: /* @__PURE__ */ P("div", { style: I, children: /* @__PURE__ */ P(Loe, { status: s, error: c, onRetry: x }) }) }) : /* @__PURE__ */ P(Pd, { className: "image-node-wrapper", style: M, ref: d, children: /* @__PURE__ */ Xe("div", { style: I, children: [
63414
+ return s !== "done" ? /* @__PURE__ */ P(Pd, { className: "image-node-wrapper", style: M, ref: d, children: /* @__PURE__ */ P("div", { style: I, children: /* @__PURE__ */ P(zoe, { status: s, error: c, onRetry: x }) }) }) : /* @__PURE__ */ P(Pd, { className: "image-node-wrapper", style: M, ref: d, children: /* @__PURE__ */ Xe("div", { style: I, children: [
63362
63415
  /* @__PURE__ */ P(
63363
63416
  "img",
63364
63417
  {
@@ -63386,7 +63439,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63386
63439
  T.name
63387
63440
  )) })
63388
63441
  ] }) });
63389
- }, Boe = Wn.create({
63442
+ }, joe = Wn.create({
63390
63443
  name: "customImage",
63391
63444
  group: "block",
63392
63445
  atom: !0,
@@ -63438,7 +63491,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63438
63491
  return ["img", fn(e)];
63439
63492
  },
63440
63493
  addNodeView() {
63441
- return Rb(zoe);
63494
+ return Rb(Boe);
63442
63495
  },
63443
63496
  addCommands() {
63444
63497
  return {
@@ -63449,12 +63502,12 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63449
63502
  updateImage: (e) => ({ commands: t }) => t.updateAttributes(this.name, e)
63450
63503
  };
63451
63504
  }
63452
- }), joe = new gn("imagePaste"), Foe = qt.create({
63505
+ }), Foe = new gn("imagePaste"), Hoe = qt.create({
63453
63506
  name: "imagePaste",
63454
63507
  addProseMirrorPlugins() {
63455
63508
  return [
63456
63509
  new sn({
63457
- key: joe,
63510
+ key: Foe,
63458
63511
  props: {
63459
63512
  handlePaste: (e, t) => {
63460
63513
  var i;
@@ -63513,7 +63566,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63513
63566
  onClick: r,
63514
63567
  children: /* @__PURE__ */ P(ut, { icon: e, size: 16 })
63515
63568
  }
63516
- ) }), Hoe = ({ label: e, width: t, currentWidth: n, onClick: r }) => /* @__PURE__ */ P(
63569
+ ) }), Voe = ({ label: e, width: t, currentWidth: n, onClick: r }) => /* @__PURE__ */ P(
63517
63570
  "button",
63518
63571
  {
63519
63572
  type: "button",
@@ -63521,7 +63574,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63521
63574
  onClick: () => r(t),
63522
63575
  children: e
63523
63576
  }
63524
- ), Voe = ({ editor: e }) => {
63577
+ ), Woe = ({ editor: e }) => {
63525
63578
  var T, A, _, D, B, H, X, q, L, V, F, U, te, J, re, ae, ne, K, ie, oe, G;
63526
63579
  const { t } = pt(Cn) || {}, n = de(null), [r, o] = $e(!1), [i, a] = $e({ top: 0, left: 0 }), [s, l] = $e(""), [c, u] = $e(""), [d, f] = $e(""), [p, h] = $e({}), { config: v } = pt(Cn) || {}, m = (v == null ? void 0 : v.theme) === "dark", b = m ? "#374151" : "#ffffff", y = m ? "#4b5563" : "#e5e7eb", C = m ? "#f9fafb" : "#1f2937", x = m ? "#9ca3af" : "#6b7280", S = an(() => {
63527
63580
  if (!e || e.isDestroyed) return;
@@ -63668,7 +63721,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63668
63721
  /* @__PURE__ */ Xe("div", { className: "image-toolbar-section", children: [
63669
63722
  /* @__PURE__ */ P("span", { className: "image-toolbar-label", children: ((F = t == null ? void 0 : t.image) == null ? void 0 : F.width) || "宽度" }),
63670
63723
  /* @__PURE__ */ P("div", { className: "image-toolbar-sizes", children: M.map((Q) => /* @__PURE__ */ P(
63671
- Hoe,
63724
+ Voe,
63672
63725
  {
63673
63726
  label: Q.label,
63674
63727
  width: Q.width,
@@ -63752,7 +63805,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63752
63805
  ]
63753
63806
  }
63754
63807
  );
63755
- }, Woe = () => {
63808
+ }, Uoe = () => {
63756
63809
  const { editor: e, config: t } = pt(Cn) || {}, n = t == null ? void 0 : t.maxLength, r = t == null ? void 0 : t.showCharCount, [o, i] = $e(0);
63757
63810
  if (it(() => {
63758
63811
  if (!e) return;
@@ -63774,7 +63827,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63774
63827
  /* @__PURE__ */ P("span", { className: "char-count-max", children: n })
63775
63828
  ] })
63776
63829
  ] });
63777
- }, Uoe = {
63830
+ }, qoe = {
63778
63831
  toolbar: {
63779
63832
  undo: "撤销",
63780
63833
  redo: "重做",
@@ -63966,7 +64019,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
63966
64019
  error: "AI 请求失败",
63967
64020
  processing: "AI 正在处理..."
63968
64021
  }
63969
- }, qoe = {
64022
+ }, Koe = {
63970
64023
  toolbar: {
63971
64024
  undo: "Undo",
63972
64025
  redo: "Redo",
@@ -64158,7 +64211,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64158
64211
  error: "AI request failed",
64159
64212
  processing: "AI is processing..."
64160
64213
  }
64161
- }, Koe = {
64214
+ }, Goe = {
64162
64215
  toolbar: {
64163
64216
  undo: "元に戻す",
64164
64217
  redo: "やり直し",
@@ -64350,11 +64403,11 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64350
64403
  error: "AI リクエストが失敗しました",
64351
64404
  processing: "AI 処理中..."
64352
64405
  }
64353
- }, hE = { zh: Uoe, en: qoe, ja: Koe }, MP = () => {
64406
+ }, hE = { zh: qoe, en: Koe, ja: Goe }, MP = () => {
64354
64407
  if (typeof navigator > "u") return "zh";
64355
64408
  const t = (navigator.language || navigator.userLanguage || "").toLowerCase().split("-")[0];
64356
64409
  return t === "zh" ? "zh" : t === "ja" ? "ja" : t === "en" ? "en" : "zh";
64357
- }, Goe = [
64410
+ }, Xoe = [
64358
64411
  "undo",
64359
64412
  "redo",
64360
64413
  "separator",
@@ -64395,7 +64448,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64395
64448
  "separator",
64396
64449
  "import",
64397
64450
  "export"
64398
- ], Xoe = [
64451
+ ], Yoe = [
64399
64452
  "bold",
64400
64453
  "italic",
64401
64454
  "underline",
@@ -64409,13 +64462,13 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64409
64462
  ,
64410
64463
  "separator",
64411
64464
  "ai"
64412
- ], Yoe = [
64465
+ ], Joe = [
64413
64466
  "heading",
64414
64467
  "bulletList",
64415
64468
  "orderedList",
64416
64469
  "codeBlock",
64417
64470
  "blockquote"
64418
- ], Joe = {
64471
+ ], Qoe = {
64419
64472
  uploadUrl: "/api/common/upload/file",
64420
64473
  fieldName: "file",
64421
64474
  headers: {
@@ -64432,18 +64485,18 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64432
64485
  compressMaxHeight: 1080,
64433
64486
  compressType: "image/jpeg",
64434
64487
  customUploader: null
64435
- }, Qoe = ["html", "md", "json", "text"], Zoe = [
64488
+ }, Zoe = ["html", "md", "json", "text"], eie = [
64436
64489
  { id: "avatar", label: "头像" },
64437
64490
  { id: "nickname", label: "昵称" },
64438
64491
  { id: "email", label: "邮箱" },
64439
64492
  { id: "phone", label: "手机号" },
64440
64493
  { id: "date", label: "日期" },
64441
64494
  { id: "time", label: "时间" }
64442
- ], eie = {
64443
- items: Zoe,
64495
+ ], tie = {
64496
+ items: eie,
64444
64497
  prefix: "${",
64445
64498
  suffix: "}"
64446
- }, tie = {
64499
+ }, nie = {
64447
64500
  enabled: !1,
64448
64501
  apiKey: "",
64449
64502
  baseURL: "https://api.openai.com/v1",
@@ -64453,26 +64506,26 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64453
64506
  stream: !0,
64454
64507
  customHandler: null
64455
64508
  }, Jr = {
64456
- menuBar: Goe,
64457
- bubbleMenu: Xoe,
64458
- floatingMenu: Yoe,
64509
+ menuBar: Xoe,
64510
+ bubbleMenu: Yoe,
64511
+ floatingMenu: Joe,
64459
64512
  theme: "light",
64460
64513
  locale: MP(),
64461
- exportFormats: Qoe,
64462
- maxLength: null,
64463
- showCharCount: !1,
64514
+ exportFormats: Zoe,
64464
64515
  readonly: !1,
64465
- variables: eie,
64516
+ variables: tie,
64466
64517
  injectStyles: !1,
64467
- placeholder: "请输入内容"
64468
- }, Mm = new gn("poroFloatingMenu"), Cn = Xo(null), uie = ({ content: e = "<p>Ola!</p>", onChange: t, config: n }) => {
64518
+ placeholder: "请输入内容",
64519
+ maxLength: 10,
64520
+ showCharCount: !0
64521
+ }, Mm = new gn("poroFloatingMenu"), Cn = Xo(null), die = ({ content: e = "<p>Ola!</p>", onChange: t, config: n }) => {
64469
64522
  var s, l;
64470
64523
  const r = $n(() => ({
64471
64524
  menuBar: (n == null ? void 0 : n.menuBar) ?? Jr.menuBar,
64472
64525
  bubbleMenu: (n == null ? void 0 : n.bubbleMenu) ?? Jr.bubbleMenu,
64473
64526
  floatingMenu: (n == null ? void 0 : n.floatingMenu) ?? Jr.floatingMenu,
64474
64527
  upload: {
64475
- ...Joe,
64528
+ ...Qoe,
64476
64529
  ...n == null ? void 0 : n.upload
64477
64530
  },
64478
64531
  theme: (n == null ? void 0 : n.theme) ?? Jr.theme,
@@ -64486,7 +64539,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64486
64539
  ...n == null ? void 0 : n.variables
64487
64540
  },
64488
64541
  ai: {
64489
- ...tie,
64542
+ ...nie,
64490
64543
  ...n == null ? void 0 : n.ai
64491
64544
  },
64492
64545
  injectStyles: (n == null ? void 0 : n.injectStyles) ?? Jr.injectStyles,
@@ -64514,13 +64567,16 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64514
64567
  target: "_blank"
64515
64568
  }
64516
64569
  }),
64517
- Roe,
64570
+ Poe,
64518
64571
  eoe.configure({
64519
64572
  transformPastedText: !0
64520
64573
  }),
64521
- Coe,
64522
- Ioe,
64523
- Aoe.configure({
64574
+ Soe.configure({
64575
+ maxLength: r.maxLength,
64576
+ locale: r.locale
64577
+ }),
64578
+ Toe,
64579
+ _oe.configure({
64524
64580
  prefix: ((s = r.variables) == null ? void 0 : s.prefix) || "${",
64525
64581
  suffix: ((l = r.variables) == null ? void 0 : l.suffix) || "}"
64526
64582
  }),
@@ -64532,8 +64588,8 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64532
64588
  boe.configure({
64533
64589
  types: ["heading", "paragraph"]
64534
64590
  }),
64535
- Boe,
64536
- Foe,
64591
+ joe,
64592
+ Hoe,
64537
64593
  ...r.placeholder ? [i3.configure({
64538
64594
  placeholder: r.placeholder
64539
64595
  })] : [],
@@ -64593,7 +64649,7 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64593
64649
  }, [i, r.readonly]), i ? /* @__PURE__ */ P(Cn.Provider, { value: a, children: /* @__PURE__ */ Xe("div", { className: `nice-editor ${r.readonly ? "readonly" : ""}`, "data-theme": r.theme, children: [
64594
64650
  !r.readonly && r.menuBar && r.menuBar.length > 0 && /* @__PURE__ */ P(ire, { editor: i, config: r.menuBar }),
64595
64651
  /* @__PURE__ */ P(kO, { editor: i }),
64596
- !r.readonly && r.floatingMenu && r.floatingMenu.length > 0 && /* @__PURE__ */ P(sF, { editor: i, pluginKey: Mm, className: "floating-menu", tabIndex: -1, children: /* @__PURE__ */ P(Eoe, { editor: i, config: r.floatingMenu, tabIndex: -1 }) }),
64652
+ !r.readonly && r.floatingMenu && r.floatingMenu.length > 0 && /* @__PURE__ */ P(sF, { editor: i, pluginKey: Mm, className: "floating-menu", tabIndex: -1, children: /* @__PURE__ */ P($oe, { editor: i, config: r.floatingMenu, tabIndex: -1 }) }),
64597
64653
  !r.readonly && r.bubbleMenu && r.bubbleMenu.length > 0 && /* @__PURE__ */ P(
64598
64654
  aF,
64599
64655
  {
@@ -64604,17 +64660,17 @@ const xoe = () => /* @__PURE__ */ P("div", { className: "menu-separator" }), woe
64604
64660
  const { from: u, to: d } = c.selection;
64605
64661
  return u === d ? !1 : c.doc.textBetween(u, d, "").length > 0;
64606
64662
  },
64607
- children: /* @__PURE__ */ P(Noe, { editor: i, config: r.bubbleMenu })
64663
+ children: /* @__PURE__ */ P(Moe, { editor: i, config: r.bubbleMenu })
64608
64664
  }
64609
64665
  ),
64610
- !r.readonly && /* @__PURE__ */ P(_oe, { editor: i }),
64611
- !r.readonly && /* @__PURE__ */ P(Voe, { editor: i }),
64612
- /* @__PURE__ */ P(Woe, {})
64666
+ !r.readonly && /* @__PURE__ */ P(Doe, { editor: i }),
64667
+ !r.readonly && /* @__PURE__ */ P(Woe, { editor: i }),
64668
+ /* @__PURE__ */ P(Uoe, {})
64613
64669
  ] }) }) : null;
64614
64670
  };
64615
64671
  export {
64616
64672
  Cn as EditorContext,
64617
- uie as Tiptap,
64618
- uie as default
64673
+ die as Tiptap,
64674
+ die as default
64619
64675
  };
64620
64676
  //# sourceMappingURL=poro-editor.js.map