reactjs-tiptap-editor 1.0.9 → 1.0.11

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.
Files changed (159) hide show
  1. package/lib/{ActionMenuButton-CmDopTWt.cjs → ActionMenuButton-BLlse5KO.cjs} +1 -1
  2. package/lib/{ActionMenuButton-C4aNFFa8.js → ActionMenuButton-DTXFBdGX.js} +2 -2
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +7 -7
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +3 -3
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +6 -6
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +3 -3
  11. package/lib/Clear.cjs +1 -1
  12. package/lib/Clear.js +3 -3
  13. package/lib/Code.cjs +1 -1
  14. package/lib/Code.js +6 -6
  15. package/lib/CodeBlock.cjs +1 -1
  16. package/lib/CodeBlock.js +4 -4
  17. package/lib/CodeView.cjs +1 -1
  18. package/lib/CodeView.js +3 -3
  19. package/lib/Color.cjs +1 -1
  20. package/lib/Color.js +5 -5
  21. package/lib/Column.cjs +1 -1
  22. package/lib/Column.js +8 -8
  23. package/lib/{Drawer-DG0gPU_U.js → Drawer-D0yQ0wR7.js} +6 -6
  24. package/lib/{Drawer-CTr2snNd.cjs → Drawer-kv6BU_6O.cjs} +1 -1
  25. package/lib/Drawer.cjs +1 -1
  26. package/lib/Drawer.js +3 -3
  27. package/lib/Emoji.cjs +1 -1
  28. package/lib/Emoji.js +8 -7
  29. package/lib/{Excalidraw-DtezFdjR.cjs → Excalidraw-B82ThkJA.cjs} +1 -1
  30. package/lib/{Excalidraw-DpgdxOsc.js → Excalidraw-CO4IRHmG.js} +7 -7
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +2 -2
  33. package/lib/ExportPdf.cjs +1 -1
  34. package/lib/ExportPdf.js +3 -3
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +3 -3
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +5 -5
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +5 -5
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +5 -5
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +5 -5
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +4 -4
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +3 -3
  49. package/lib/{Icon-C_buGjWy.js → Icon-DRuJhcHK.js} +1 -1
  50. package/lib/{Icon-b6HQAURz.cjs → Icon-DXePECFW.cjs} +1 -1
  51. package/lib/{Iframe-CUrXCDxj.cjs → Iframe-03dn9wcM.cjs} +1 -1
  52. package/lib/{Iframe-De88TYvj.js → Iframe-BEO28NPs.js} +8 -8
  53. package/lib/Iframe.cjs +1 -1
  54. package/lib/Iframe.js +2 -2
  55. package/lib/Image.cjs +1 -1
  56. package/lib/Image.js +13 -13
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +14 -14
  59. package/lib/ImportWord.cjs +1 -1
  60. package/lib/ImportWord.js +3 -3
  61. package/lib/{Indent-Bensb2nf.js → Indent-CXurBbOr.js} +5 -5
  62. package/lib/{Indent-D_KtZNHW.cjs → Indent-Cqjdn3Jt.cjs} +1 -1
  63. package/lib/Indent.cjs +1 -1
  64. package/lib/Indent.js +2 -2
  65. package/lib/Italic.cjs +1 -1
  66. package/lib/Italic.js +3 -3
  67. package/lib/{Katex-C0dtqznb.js → Katex-Bvj469K1.js} +7 -7
  68. package/lib/{Katex-NqelWRoi.cjs → Katex-DdWTV5NJ.cjs} +1 -1
  69. package/lib/Katex.cjs +1 -1
  70. package/lib/Katex.js +2 -2
  71. package/lib/LineHeight.cjs +1 -1
  72. package/lib/LineHeight.js +5 -5
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +2 -2
  75. package/lib/{LinkEditBlock-BSZ-vgNB.cjs → LinkEditBlock-8ePAZ-G1.cjs} +1 -1
  76. package/lib/{LinkEditBlock-Bv12sKvW.js → LinkEditBlock-DjXUEubR.js} +32 -32
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +23 -22
  79. package/lib/Mermaid.cjs +1 -1
  80. package/lib/Mermaid.js +26 -26
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +5 -5
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +3 -3
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +9 -9
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +39 -266
  89. package/lib/SlashCommandNodeView-Bl_gwZJB.cjs +1 -0
  90. package/lib/SlashCommandNodeView-CcqL8ymb.js +254 -0
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +3 -3
  93. package/lib/{Table-D9ckv6Tb.js → Table-9Y0Cg8Ab.js} +5 -5
  94. package/lib/{Table-cy1mUM2X.cjs → Table-DBGjezZK.cjs} +1 -1
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +3 -3
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +5 -5
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +5 -5
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +3 -3
  105. package/lib/{Twitter-Bvs3sW8F.cjs → Twitter-Cnvt7GBg.cjs} +1 -1
  106. package/lib/{Twitter-KUvyySA0.js → Twitter-DWwd0vHR.js} +46 -46
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +2 -2
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +7 -7
  111. package/lib/bubble.cjs +4 -4
  112. package/lib/bubble.js +1659 -1567
  113. package/lib/{button-U6XpZt2X.cjs → button-BW5bDPz_.cjs} +1 -1
  114. package/lib/{button-D8SI-g7p.js → button-RnHbJfd-.js} +1 -1
  115. package/lib/{checkbox-xrY2c5yo.js → checkbox-CLSoR1Qj.js} +1 -1
  116. package/lib/{checkbox-DaIBNthL.cjs → checkbox-CTEN0q4y.cjs} +1 -1
  117. package/lib/{dialog-DgnnVCfv.cjs → dialog-CMC9hsCo.cjs} +1 -1
  118. package/lib/{dialog-DjnkASYP.js → dialog-D_HCtKvc.js} +1 -1
  119. package/lib/{dropdown-menu-bI14Gyw4.js → dropdown-menu-66q7Ofc5.js} +3 -2
  120. package/lib/dropdown-menu-DKSAS-w_.cjs +1 -0
  121. package/lib/extensions/SlashCommand/types.d.ts +1 -0
  122. package/lib/index-9A6-kVBM.js +1351 -0
  123. package/lib/{index-4pRt5Vqu.js → index-C3zg3DPB.js} +442 -403
  124. package/lib/index-C838s-or.cjs +8 -0
  125. package/lib/index-Cv9Z6dyV.cjs +1 -0
  126. package/lib/{index-EKFybgpP.js → index-DKt5wfAc.js} +1 -1
  127. package/lib/{index-BimeTI7q.js → index-DRHrDScg.js} +1 -1
  128. package/lib/{index-BQ6ZdLsu.js → index-DmPwbBqm.js} +1 -1
  129. package/lib/{index-CbIQPoF6.js → index-sVScpCFG.js} +20 -20
  130. package/lib/index.cjs +1 -1
  131. package/lib/index.js +5 -5
  132. package/lib/{input-C5zU49Q1.js → input-CvyMYMZG.js} +1 -1
  133. package/lib/{input-BtDj0NeF.cjs → input-D555880-.cjs} +1 -1
  134. package/lib/{isNumber-8HKEgTkA.js → isNumber-DF0fU3ob.js} +1 -1
  135. package/lib/{label-BEUVs-IA.js → label-DsOYPjAo.js} +1 -1
  136. package/lib/{label-C8BonzOY.cjs → label-E6jF3Xud.cjs} +1 -1
  137. package/lib/{popover-CPY5lMCj.js → popover-B7ec5-u2.js} +1 -1
  138. package/lib/{popover-DjL0De8d.cjs → popover-BSzR_R01.cjs} +1 -1
  139. package/lib/{separator-BlIlS7LP.js → separator-JaTTqb3J.js} +4 -4
  140. package/lib/{separator-BzMkiI_c.cjs → separator-PGnA-6Hr.cjs} +1 -1
  141. package/lib/{store-D_GvIPxo.js → store-Cf7tFiiI.js} +1 -1
  142. package/lib/{store-BSCjQxMK.cjs → store-oDk-lTPM.cjs} +1 -1
  143. package/lib/style.css +1 -1
  144. package/lib/{tabs-CHy82_rs.cjs → tabs-BTwiZkWd.cjs} +1 -1
  145. package/lib/{tabs-tQpXIzfV.js → tabs-CWr9HYaM.js} +1 -1
  146. package/lib/{textarea-CMDYVXYo.js → textarea-BdeLXbp8.js} +1 -1
  147. package/lib/{textarea-B-qfanCT.cjs → textarea-Yetl_PZi.cjs} +1 -1
  148. package/lib/{throttle-BIkZV3Y_.js → throttle-DsowOft0.js} +1 -1
  149. package/lib/updatePosition-Bbd8ETMv.js +16 -0
  150. package/lib/updatePosition-M2IyqkI1.cjs +1 -0
  151. package/lib/{useButtonProps-BqBGuqoP.cjs → useButtonProps-DfnJiJLV.cjs} +1 -1
  152. package/lib/{useButtonProps-DTngjZge.js → useButtonProps-cMoicZgd.js} +14 -14
  153. package/package.json +1 -1
  154. package/lib/dropdown-menu-BvVMltdB.cjs +0 -1
  155. package/lib/floating-ui.dom-U1vPFQ5f.js +0 -1151
  156. package/lib/floating-ui.dom-VCrc58uF.cjs +0 -1
  157. package/lib/index-DvvMf6Wu.cjs +0 -7
  158. package/lib/updatePosition-GLTrgcib.js +0 -215
  159. package/lib/updatePosition-u2mTh3mG.cjs +0 -1
@@ -1,14 +1,14 @@
1
- import { C as U, aa as rt, s as Mt, N as jt, m as Wt, ab as Bt, R as Ft } from "./index-CbIQPoF6.js";
1
+ import { C as U, aa as rt, q as Mt, N as jt, m as Wt, ab as Bt, u as Ft } from "./index-sVScpCFG.js";
2
2
  import { jsx as r, jsxs as h, Fragment as Pt } from "react/jsx-runtime";
3
3
  import Be, { useState as se, Fragment as Ut, useEffect as Fe, useMemo as Pe, createContext as zt, useLayoutEffect as Ht, useContext as Gt, useRef as K, useCallback as Te, useDebugValue as Xt } from "react";
4
- import { A as Kt } from "./index-4pRt5Vqu.js";
4
+ import { A as Kt } from "./index-C3zg3DPB.js";
5
5
  import { u as Qt } from "./index-0OnGZkVF.js";
6
- import { L as Jt } from "./label-BEUVs-IA.js";
7
- import { I as Yt } from "./input-C5zU49Q1.js";
8
- import { B as Zt } from "./button-D8SI-g7p.js";
9
- import { c as en, u as tn, a as nn } from "./useButtonProps-DTngjZge.js";
10
- import { P as rn, a as on, b as an } from "./popover-CPY5lMCj.js";
11
- import { I as sn } from "./Icon-C_buGjWy.js";
6
+ import { L as Jt } from "./label-DsOYPjAo.js";
7
+ import { I as Yt } from "./input-CvyMYMZG.js";
8
+ import { B as Zt } from "./button-RnHbJfd-.js";
9
+ import { c as en, u as tn, a as nn } from "./useButtonProps-cMoicZgd.js";
10
+ import { P as rn, a as on, b as an } from "./popover-B7ec5-u2.js";
11
+ import { I as sn } from "./Icon-DRuJhcHK.js";
12
12
  const cn = "_verified_lvyh0_1", Ue = {
13
13
  verified: cn
14
14
  }, ln = () => /* @__PURE__ */ r("svg", {
@@ -157,7 +157,7 @@ const cn = "_verified_lvyh0_1", Ue = {
157
157
  alt: o.description
158
158
  })
159
159
  }) : null;
160
- }, wn = "_header_nqq4j_1", yn = "_avatar_nqq4j_11", bn = "_avatarOverflow_nqq4j_16", Tn = "_avatarSquare_nqq4j_23", xn = "_avatarShadow_nqq4j_26", Nn = "_author_nqq4j_37", In = "_authorLink_nqq4j_44", Rn = "_authorVerified_nqq4j_53", Sn = "_authorLinkText_nqq4j_56", kn = "_authorMeta_nqq4j_63", En = "_authorFollow_nqq4j_66", Cn = "_username_nqq4j_69", On = "_follow_nqq4j_74", Ln = "_separator_nqq4j_82", $n = "_brand_nqq4j_86", qn = "_twitterIcon_nqq4j_90", N = {
160
+ }, wn = "_header_nqq4j_1", yn = "_avatar_nqq4j_11", bn = "_avatarOverflow_nqq4j_16", Tn = "_avatarSquare_nqq4j_23", xn = "_avatarShadow_nqq4j_26", Nn = "_author_nqq4j_37", In = "_authorLink_nqq4j_44", Rn = "_authorVerified_nqq4j_53", Sn = "_authorLinkText_nqq4j_56", kn = "_authorMeta_nqq4j_63", En = "_authorFollow_nqq4j_66", Cn = "_username_nqq4j_69", On = "_follow_nqq4j_74", Ln = "_separator_nqq4j_82", qn = "_brand_nqq4j_86", $n = "_twitterIcon_nqq4j_90", N = {
161
161
  header: wn,
162
162
  avatar: yn,
163
163
  avatarOverflow: bn,
@@ -172,8 +172,8 @@ const cn = "_verified_lvyh0_1", Ue = {
172
172
  username: Cn,
173
173
  follow: On,
174
174
  separator: Ln,
175
- brand: $n,
176
- twitterIcon: qn
175
+ brand: qn,
176
+ twitterIcon: $n
177
177
  }, Dn = ({ tweet: e, components: t }) => {
178
178
  var n;
179
179
  const o = (n = t == null ? void 0 : t.AvatarImg) != null ? n : vt, { user: a } = e;
@@ -642,13 +642,13 @@ const or = (e) => ({
642
642
  })
643
643
  })
644
644
  ]
645
- }), Er = "_actions_n2anf_1", Cr = "_like_n2anf_13", Or = "_reply_n2anf_14", Lr = "_copy_n2anf_15", $r = "_likeIconWrapper_n2anf_27", qr = "_likeCount_n2anf_30", Dr = "_replyIconWrapper_n2anf_35", Ar = "_copyIconWrapper_n2anf_36", Vr = "_likeIcon_n2anf_27", Mr = "_replyIcon_n2anf_35", jr = "_copyIcon_n2anf_36", Wr = "_replyText_n2anf_56", Br = "_copyText_n2anf_57", k = {
645
+ }), Er = "_actions_n2anf_1", Cr = "_like_n2anf_13", Or = "_reply_n2anf_14", Lr = "_copy_n2anf_15", qr = "_likeIconWrapper_n2anf_27", $r = "_likeCount_n2anf_30", Dr = "_replyIconWrapper_n2anf_35", Ar = "_copyIconWrapper_n2anf_36", Vr = "_likeIcon_n2anf_27", Mr = "_replyIcon_n2anf_35", jr = "_copyIcon_n2anf_36", Wr = "_replyText_n2anf_56", Br = "_copyText_n2anf_57", k = {
646
646
  actions: Er,
647
647
  like: Cr,
648
648
  reply: Or,
649
649
  copy: Lr,
650
- likeIconWrapper: $r,
651
- likeCount: qr,
650
+ likeIconWrapper: qr,
651
+ likeCount: $r,
652
652
  replyIconWrapper: Dr,
653
653
  copyIconWrapper: Ar,
654
654
  likeIcon: Vr,
@@ -975,7 +975,7 @@ const or = (e) => ({
975
975
  ]
976
976
  }), Nt = 0, It = 1, Rt = 2, lt = 3;
977
977
  var dt = Object.prototype.hasOwnProperty;
978
- function $e(e, t) {
978
+ function qe(e, t) {
979
979
  var n, o;
980
980
  if (e === t) return !0;
981
981
  if (e && t && (n = e.constructor) === t.constructor) {
@@ -983,13 +983,13 @@ function $e(e, t) {
983
983
  if (n === RegExp) return e.toString() === t.toString();
984
984
  if (n === Array) {
985
985
  if ((o = e.length) === t.length)
986
- for (; o-- && $e(e[o], t[o]); ) ;
986
+ for (; o-- && qe(e[o], t[o]); ) ;
987
987
  return o === -1;
988
988
  }
989
989
  if (!n || typeof e == "object") {
990
990
  o = 0;
991
991
  for (n in e)
992
- if (dt.call(e, n) && ++o && !dt.call(t, n) || !(n in t) || !$e(e[n], t[n])) return !1;
992
+ if (dt.call(e, n) && ++o && !dt.call(t, n) || !(n in t) || !qe(e[n], t[n])) return !1;
993
993
  return Object.keys(t).length === o;
994
994
  }
995
995
  }
@@ -999,7 +999,7 @@ const F = /* @__PURE__ */ new WeakMap(), P = () => {
999
999
  }, R = (
1000
1000
  /*#__NOINLINE__*/
1001
1001
  P()
1002
- ), qe = Object, u = (e) => e === R, j = (e) => typeof e == "function", z = (e, t) => ({
1002
+ ), $e = Object, u = (e) => e === R, j = (e) => typeof e == "function", z = (e, t) => ({
1003
1003
  ...e,
1004
1004
  ...t
1005
1005
  }), St = (e) => j(e.then), Re = {}, ve = {}, He = "undefined", ue = typeof window != He, De = typeof document != He, wo = ue && "Deno" in window, yo = () => ue && typeof window.requestAnimationFrame != He, kt = (e, t) => {
@@ -1050,12 +1050,12 @@ const bo = () => Ae, [Ve, Me] = ue && window.addEventListener ? [
1050
1050
  }, ut = !Be.useId, ie = !ue || wo, So = (e) => yo() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Se = ie ? Fe : Ht, ke = typeof navigator < "u" && navigator.connection, ft = !ie && ke && ([
1051
1051
  "slow-2g",
1052
1052
  "2g"
1053
- ].includes(ke.effectiveType) || ke.saveData), ge = /* @__PURE__ */ new WeakMap(), ko = (e) => qe.prototype.toString.call(e), Ee = (e, t) => e === `[object ${t}]`;
1053
+ ].includes(ke.effectiveType) || ke.saveData), ge = /* @__PURE__ */ new WeakMap(), ko = (e) => $e.prototype.toString.call(e), Ee = (e, t) => e === `[object ${t}]`;
1054
1054
  let Eo = 0;
1055
1055
  const je = (e) => {
1056
1056
  const t = typeof e, n = ko(e), o = Ee(n, "Date"), a = Ee(n, "RegExp"), i = Ee(n, "Object");
1057
1057
  let s, c;
1058
- if (qe(e) === e && !o && !a) {
1058
+ if ($e(e) === e && !o && !a) {
1059
1059
  if (s = ge.get(e), s) return s;
1060
1060
  if (s = ++Eo + "~", ge.set(e, s), Array.isArray(e)) {
1061
1061
  for (s = "@", c = 0; c < e.length; c++)
@@ -1064,7 +1064,7 @@ const je = (e) => {
1064
1064
  }
1065
1065
  if (i) {
1066
1066
  s = "#";
1067
- const f = qe.keys(e).sort();
1067
+ const f = $e.keys(e).sort();
1068
1068
  for (; !u(c = f.pop()); )
1069
1069
  u(e[c]) || (s += c + ":" + je(e[c]) + ",");
1070
1070
  ge.set(e, s);
@@ -1110,8 +1110,8 @@ async function Et(...e) {
1110
1110
  const [I] = Ge(b);
1111
1111
  if (!I) return;
1112
1112
  const [E, L] = kt(t, I), [D, ce, l, fe] = F.get(t), J = () => {
1113
- const $ = D[I];
1114
- return (j(i.revalidate) ? i.revalidate(E().data, b) : i.revalidate !== !1) && (delete l[I], delete fe[I], $ && $[0]) ? $[0](Rt).then(() => E().data) : E().data;
1113
+ const q = D[I];
1114
+ return (j(i.revalidate) ? i.revalidate(E().data, b) : i.revalidate !== !1) && (delete l[I], delete fe[I], q && q[0]) ? q[0](Rt).then(() => E().data) : E().data;
1115
1115
  };
1116
1116
  if (e.length < 3)
1117
1117
  return J();
@@ -1128,12 +1128,12 @@ async function Et(...e) {
1128
1128
  })), j(T))
1129
1129
  try {
1130
1130
  T = T(H);
1131
- } catch ($) {
1132
- A = $, V = !0;
1131
+ } catch (q) {
1132
+ A = q, V = !0;
1133
1133
  }
1134
1134
  if (T && St(T))
1135
- if (T = await T.catch(($) => {
1136
- A = $, V = !0;
1135
+ if (T = await T.catch((q) => {
1136
+ A = q, V = !0;
1137
1137
  }), Y !== ce[I][0]) {
1138
1138
  if (V) throw A;
1139
1139
  return T;
@@ -1143,9 +1143,9 @@ async function Et(...e) {
1143
1143
  }));
1144
1144
  if (s && !V)
1145
1145
  if (j(s)) {
1146
- const $ = s(T, H);
1146
+ const q = s(T, H);
1147
1147
  L({
1148
- data: $,
1148
+ data: q,
1149
1149
  error: R,
1150
1150
  _c: R
1151
1151
  });
@@ -1212,7 +1212,7 @@ const ht = (e, t) => {
1212
1212
  }, Lo = (e, t, n, o, a) => {
1213
1213
  const i = n.errorRetryCount, s = a.retryCount, c = ~~((Math.random() + 0.5) * (1 << (s < 8 ? s : 8))) * n.errorRetryInterval;
1214
1214
  !u(i) && s > i || setTimeout(o, c, a);
1215
- }, $o = $e, [Ct, qo] = Oo(/* @__PURE__ */ new Map()), Do = z(
1215
+ }, qo = qe, [Ct, $o] = Oo(/* @__PURE__ */ new Map()), Do = z(
1216
1216
  {
1217
1217
  // events
1218
1218
  onLoadingSlow: P,
@@ -1231,10 +1231,10 @@ const ht = (e, t) => {
1231
1231
  dedupingInterval: 2 * 1e3,
1232
1232
  loadingTimeout: ft ? 5e3 : 3e3,
1233
1233
  // providers
1234
- compare: $o,
1234
+ compare: qo,
1235
1235
  isPaused: () => !1,
1236
1236
  cache: Ct,
1237
- mutate: qo,
1237
+ mutate: $o,
1238
1238
  fallback: {}
1239
1239
  },
1240
1240
  // use web preset by default
@@ -1304,7 +1304,7 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1304
1304
  }), Oe = {
1305
1305
  dedupe: !0
1306
1306
  }, _t = Promise.resolve(R), Go = (e, t, n) => {
1307
- const { cache: o, compare: a, suspense: i, fallbackData: s, revalidateOnMount: c, revalidateIfStale: f, refreshInterval: d, refreshWhenHidden: g, refreshWhenOffline: m, keepPreviousData: b, strictServerPrefetchWarning: I } = n, [E, L, D, ce] = F.get(o), [l, fe] = Ge(e), J = K(!1), T = K(!1), A = K(l), V = K(t), Y = K(n), p = () => Y.current, Z = () => p().isVisible() && p().isOnline(), [M, ee, H, $] = kt(o, l), te = K({}).current, he = u(s) ? u(n.fallback) ? R : n.fallback[l] : s, Xe = (_, v) => {
1307
+ const { cache: o, compare: a, suspense: i, fallbackData: s, revalidateOnMount: c, revalidateIfStale: f, refreshInterval: d, refreshWhenHidden: g, refreshWhenOffline: m, keepPreviousData: b, strictServerPrefetchWarning: I } = n, [E, L, D, ce] = F.get(o), [l, fe] = Ge(e), J = K(!1), T = K(!1), A = K(l), V = K(t), Y = K(n), p = () => Y.current, Z = () => p().isVisible() && p().isOnline(), [M, ee, H, q] = kt(o, l), te = K({}).current, he = u(s) ? u(n.fallback) ? R : n.fallback[l] : s, Xe = (_, v) => {
1308
1308
  for (const y in te) {
1309
1309
  const w = y;
1310
1310
  if (w === "data") {
@@ -1322,8 +1322,8 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1322
1322
  isLoading: !0,
1323
1323
  ...W
1324
1324
  } : W;
1325
- }, y = M(), w = $(), q = v(y), oe = y === w ? q : v(w);
1326
- let x = q;
1325
+ }, y = M(), w = q(), $ = v(y), oe = y === w ? $ : v(w);
1326
+ let x = $;
1327
1327
  return [
1328
1328
  () => {
1329
1329
  const S = v(M());
@@ -1343,15 +1343,15 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1343
1343
  o,
1344
1344
  l
1345
1345
  ]
1346
- ), Ke[0], Ke[1]), Qe = !J.current, $t = E[l] && E[l].length > 0, re = ne.data, G = u(re) ? he && St(he) ? Ce(he) : he : re, _e = ne.error, we = K(G), me = b ? u(re) ? u(we.current) ? G : we.current : re : G, X = l && u(G), qt = !ie && // eslint-disable-next-line react-hooks/rules-of-hooks
1346
+ ), Ke[0], Ke[1]), Qe = !J.current, qt = E[l] && E[l].length > 0, re = ne.data, G = u(re) ? he && St(he) ? Ce(he) : he : re, _e = ne.error, we = K(G), me = b ? u(re) ? u(we.current) ? G : we.current : re : G, X = l && u(G), $t = !ie && // eslint-disable-next-line react-hooks/rules-of-hooks
1347
1347
  rt.useSyncExternalStore(() => P, () => !1, () => !0);
1348
- I && qt && !i && X && console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);
1349
- const Je = $t && !u(_e) ? !1 : Qe && !u(c) ? c : p().isPaused() ? !1 : i ? u(G) ? !1 : f : u(G) || f, Ye = !!(l && t && Qe && Je), Dt = u(ne.isValidating) ? Ye : ne.isValidating, At = u(ne.isLoading) ? Ye : ne.isLoading, le = Te(
1348
+ I && $t && !i && X && console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);
1349
+ const Je = qt && !u(_e) ? !1 : Qe && !u(c) ? c : p().isPaused() ? !1 : i ? u(G) ? !1 : f : u(G) || f, Ye = !!(l && t && Qe && Je), Dt = u(ne.isValidating) ? Ye : ne.isValidating, At = u(ne.isLoading) ? Ye : ne.isLoading, le = Te(
1350
1350
  async (_) => {
1351
1351
  const v = V.current;
1352
1352
  if (!l || !v || T.current || p().isPaused())
1353
1353
  return !1;
1354
- let y, w, q = !0;
1354
+ let y, w, $ = !0;
1355
1355
  const oe = _ || {}, x = !D[l] || !oe.dedupe, S = () => ut ? !T.current && l === A.current && J.current : l === A.current, W = {
1356
1356
  isValidating: !1,
1357
1357
  isLoading: !1
@@ -1366,7 +1366,7 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1366
1366
  u(M().data) && (nt.isLoading = !0);
1367
1367
  try {
1368
1368
  if (x && (ee(nt), n.loadingTimeout && u(M().data) && setTimeout(() => {
1369
- q && S() && p().onLoadingSlow(l, n);
1369
+ $ && S() && p().onLoadingSlow(l, n);
1370
1370
  }, n.loadingTimeout), D[l] = [
1371
1371
  v(fe),
1372
1372
  We()
@@ -1392,7 +1392,7 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1392
1392
  dedupe: !0
1393
1393
  })));
1394
1394
  }
1395
- return q = !1, et(), !0;
1395
+ return $ = !1, et(), !0;
1396
1396
  },
1397
1397
  // `setState` is immutable, and `eventsCallback`, `fnArg`, and
1398
1398
  // `keyValidating` are depending on `key`, so we can exclude them from
@@ -1422,16 +1422,16 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
1422
1422
  const _ = le.bind(R, Oe);
1423
1423
  let v = 0;
1424
1424
  p().revalidateOnFocus && (v = Date.now() + p().focusThrottleInterval);
1425
- const w = Ho(l, E, (q, oe = {}) => {
1426
- if (q == Nt) {
1425
+ const w = Ho(l, E, ($, oe = {}) => {
1426
+ if ($ == Nt) {
1427
1427
  const x = Date.now();
1428
1428
  p().revalidateOnFocus && x > v && Z() && (v = x + p().focusThrottleInterval, _());
1429
- } else if (q == It)
1429
+ } else if ($ == It)
1430
1430
  p().revalidateOnReconnect && Z() && _();
1431
1431
  else {
1432
- if (q == Rt)
1432
+ if ($ == Rt)
1433
1433
  return le();
1434
- if (q == lt)
1434
+ if ($ == lt)
1435
1435
  return le(oe);
1436
1436
  }
1437
1437
  });
package/lib/Twitter.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-BBNITgNi.cjs");const t=require("./Twitter-Bvs3sW8F.cjs");exports.RichTextTwitter=t.RichTextTwitter;exports.Twitter=t.Twitter;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-BBNITgNi.cjs");const t=require("./Twitter-Cnvt7GBg.cjs");exports.RichTextTwitter=t.RichTextTwitter;exports.Twitter=t.Twitter;
package/lib/Twitter.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./index-CbIQPoF6.js";
2
- import { R as i, T } from "./Twitter-KUvyySA0.js";
1
+ import "./index-sVScpCFG.js";
2
+ import { R as i, T } from "./Twitter-DWwd0vHR.js";
3
3
  export {
4
4
  i as RichTextTwitter,
5
5
  T as Twitter
package/lib/Video.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./index-BBNITgNi.cjs"),k=require("./index-FSRjMsxW.cjs"),p=require("./useButtonProps-BqBGuqoP.cjs"),o=require("react/jsx-runtime"),d=require("react"),E=require("./index-DvvMf6Wu.cjs"),g=require("./dialog-DgnnVCfv.cjs"),M=require("./events.constant-DQYeJpu5.cjs"),u=require("./tabs-CHy82_rs.cjs"),D=require("./button-U6XpZt2X.cjs"),I=require("./input-BtDj0NeF.cjs");function R(e,t){let n;try{n=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(s=>{if(s.includes("*")){const l=s.replace(/\./g,String.raw`\.`).replace(/\*/g,".*");return new RegExp(`^${l}$`).test(n.hostname)}return n.hostname.includes(s)})}function H(){const{t:e}=k.useLocale(),t=p.useEditorInstance(),n=p.useButtonProps(T.name),{icon:s,tooltip:l}=(n==null?void 0:n.componentProps)??{},{editorDisabled:c}=p.useToggleActive(),[f,x]=d.useState(""),w=d.useRef(null),[y,m]=d.useState(""),[V,h]=d.useState(!1),v=p.useExtension(T.name),C=r=>{h(r.detail)};d.useEffect(()=>{const r=M.listenEvent(M.EVENTS.UPLOAD_VIDEO(t.id),C);return()=>{r()}},[t]);const i=d.useMemo(()=>(v==null?void 0:v.options)??{},[v]);async function S(r){var L;const a=(L=r==null?void 0:r.target)==null?void 0:L.files;if(!t||t.isDestroyed||a.length===0)return;const b=a[0];let j="";i.upload?j=await i.upload(b):j=URL.createObjectURL(b),t.chain().focus().setVideo({src:j,width:"100%"}).run(),h(!1)}function A(r){r.preventDefault(),r.stopPropagation(),f&&(t.chain().focus().setVideo({src:f,width:"100%"}).run(),h(!1),x(""))}function q(r){var a;r.preventDefault(),(a=w.current)==null||a.click()}return o.jsxs(g.Dialog,{onOpenChange:h,open:V,children:[o.jsx(g.DialogTrigger,{asChild:!0,children:o.jsx(E.ActionButton,{disabled:c,icon:s,tooltip:l,action:()=>{c||h(!0)}})}),o.jsxs(g.DialogContent,{children:[o.jsx(g.DialogTitle,{children:e("editor.video.dialog.title")}),o.jsxs(u.Tabs,{activationMode:"manual",defaultValue:(i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="upload"?"upload":"link",children:[o.jsxs(u.TabsList,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="upload")&&o.jsx(u.TabsTrigger,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="link")&&o.jsx(u.TabsTrigger,{value:"link",children:e("editor.video.dialog.link")})]}),o.jsxs(u.TabsContent,{value:"upload",children:[o.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:o.jsx(D.Button,{className:"richtext-mt-1 richtext-w-full",onClick:q,size:"sm",children:e("editor.video.dialog.tab.upload")})}),o.jsx("input",{accept:"video/*",multiple:!0,onChange:S,ref:w,type:"file",style:{display:"none"}})]}),o.jsxs(u.TabsContent,{value:"link",children:[o.jsx("div",{children:o.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[o.jsx(I.Input,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:f,onBlur:r=>{const a=r.target.value,b=i.videoProviders||["."];a&&!R(a,b)?m("Invalid video URL"):m("")},onChange:r=>{x(r.target.value)}}),o.jsx(D.Button,{onClick:A,type:"button",children:e("editor.video.dialog.button.apply")})]})}),y&&o.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:y})]})]})]})]})}function B(e){e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/");const t=e.match(/^https:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);t&&(e=`https://www.youtube.com/embed/${t[1]}`);const n=e.match(/^https:\/\/vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?/);if(n){const l=n[1],c=n[2];c?e=`https://player.vimeo.com/video/${l}?h=${c}`:e=`https://player.vimeo.com/video/${l}`}return/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const T=$.Node3.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:k.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper"},button:({editor:e,t})=>{var n,s;return{componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((s=(n=e.can()).setVideo)!=null&&s.call(n,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?B(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:p.getCssUnitWithDefault(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},align:{default:"center",renderHTML:({align:e})=>({align:e})}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%",align:n="center"}=e??{},s={...e,width:"100%",height:"100%"},l=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,c=`flex: 1;padding-bottom: ${9/16*100}%;`,m=["div",{style:`display: flex; justify-content: ${n};`},["div",{style:l},["div",{style:c}],["iframe",s]]];return["div",{...this.options.HTMLAttributes,class:"iframe-wrapper","data-video":""},m]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}});exports.RichTextVideo=H;exports.Video=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./index-BBNITgNi.cjs"),k=require("./index-FSRjMsxW.cjs"),p=require("./useButtonProps-DfnJiJLV.cjs"),o=require("react/jsx-runtime"),d=require("react"),E=require("./index-C838s-or.cjs"),g=require("./dialog-CMC9hsCo.cjs"),M=require("./events.constant-DQYeJpu5.cjs"),u=require("./tabs-BTwiZkWd.cjs"),D=require("./button-BW5bDPz_.cjs"),I=require("./input-D555880-.cjs");function R(e,t){let n;try{n=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(s=>{if(s.includes("*")){const l=s.replace(/\./g,String.raw`\.`).replace(/\*/g,".*");return new RegExp(`^${l}$`).test(n.hostname)}return n.hostname.includes(s)})}function H(){const{t:e}=k.useLocale(),t=p.useEditorInstance(),n=p.useButtonProps(T.name),{icon:s,tooltip:l}=(n==null?void 0:n.componentProps)??{},{editorDisabled:c}=p.useToggleActive(),[f,x]=d.useState(""),w=d.useRef(null),[y,m]=d.useState(""),[V,h]=d.useState(!1),v=p.useExtension(T.name),C=r=>{h(r.detail)};d.useEffect(()=>{const r=M.listenEvent(M.EVENTS.UPLOAD_VIDEO(t.id),C);return()=>{r()}},[t]);const i=d.useMemo(()=>(v==null?void 0:v.options)??{},[v]);async function S(r){var L;const a=(L=r==null?void 0:r.target)==null?void 0:L.files;if(!t||t.isDestroyed||a.length===0)return;const b=a[0];let j="";i.upload?j=await i.upload(b):j=URL.createObjectURL(b),t.chain().focus().setVideo({src:j,width:"100%"}).run(),h(!1)}function A(r){r.preventDefault(),r.stopPropagation(),f&&(t.chain().focus().setVideo({src:f,width:"100%"}).run(),h(!1),x(""))}function q(r){var a;r.preventDefault(),(a=w.current)==null||a.click()}return o.jsxs(g.Dialog,{onOpenChange:h,open:V,children:[o.jsx(g.DialogTrigger,{asChild:!0,children:o.jsx(E.ActionButton,{disabled:c,icon:s,tooltip:l,action:()=>{c||h(!0)}})}),o.jsxs(g.DialogContent,{children:[o.jsx(g.DialogTitle,{children:e("editor.video.dialog.title")}),o.jsxs(u.Tabs,{activationMode:"manual",defaultValue:(i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="upload"?"upload":"link",children:[o.jsxs(u.TabsList,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="upload")&&o.jsx(u.TabsTrigger,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="link")&&o.jsx(u.TabsTrigger,{value:"link",children:e("editor.video.dialog.link")})]}),o.jsxs(u.TabsContent,{value:"upload",children:[o.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:o.jsx(D.Button,{className:"richtext-mt-1 richtext-w-full",onClick:q,size:"sm",children:e("editor.video.dialog.tab.upload")})}),o.jsx("input",{accept:"video/*",multiple:!0,onChange:S,ref:w,type:"file",style:{display:"none"}})]}),o.jsxs(u.TabsContent,{value:"link",children:[o.jsx("div",{children:o.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[o.jsx(I.Input,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:f,onBlur:r=>{const a=r.target.value,b=i.videoProviders||["."];a&&!R(a,b)?m("Invalid video URL"):m("")},onChange:r=>{x(r.target.value)}}),o.jsx(D.Button,{onClick:A,type:"button",children:e("editor.video.dialog.button.apply")})]})}),y&&o.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:y})]})]})]})]})}function B(e){e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/");const t=e.match(/^https:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);t&&(e=`https://www.youtube.com/embed/${t[1]}`);const n=e.match(/^https:\/\/vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?/);if(n){const l=n[1],c=n[2];c?e=`https://player.vimeo.com/video/${l}?h=${c}`:e=`https://player.vimeo.com/video/${l}`}return/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const T=$.Node3.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:k.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper"},button:({editor:e,t})=>{var n,s;return{componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((s=(n=e.can()).setVideo)!=null&&s.call(n,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?B(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:p.getCssUnitWithDefault(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},align:{default:"center",renderHTML:({align:e})=>({align:e})}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%",align:n="center"}=e??{},s={...e,width:"100%",height:"100%"},l=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,c=`flex: 1;padding-bottom: ${9/16*100}%;`,m=["div",{style:`display: flex; justify-content: ${n};`},["div",{style:l},["div",{style:c}],["iframe",s]]];return["div",{...this.options.HTMLAttributes,class:"iframe-wrapper","data-video":""},m]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}});exports.RichTextVideo=H;exports.Video=T;
package/lib/Video.js CHANGED
@@ -1,14 +1,14 @@
1
- import { N as I } from "./index-CbIQPoF6.js";
1
+ import { N as I } from "./index-sVScpCFG.js";
2
2
  import { u as S, V as $ } from "./index-0OnGZkVF.js";
3
- import { c as H, u as N, a as U, d as z, g as B } from "./useButtonProps-DTngjZge.js";
3
+ import { c as H, u as N, a as U, d as z, g as B } from "./useButtonProps-cMoicZgd.js";
4
4
  import { jsxs as d, jsx as s } from "react/jsx-runtime";
5
5
  import { useState as y, useRef as R, useEffect as j, useMemo as F } from "react";
6
- import { A as O } from "./index-4pRt5Vqu.js";
7
- import { D as Z, a as _, b as q, c as W } from "./dialog-DjnkASYP.js";
6
+ import { A as O } from "./index-C3zg3DPB.js";
7
+ import { D as Z, a as _, b as q, c as W } from "./dialog-D_HCtKvc.js";
8
8
  import { l as G, E as J } from "./events.constant-wrlJ_7JZ.js";
9
- import { T as K, a as P, b as D, c as L } from "./tabs-tQpXIzfV.js";
10
- import { B as T } from "./button-D8SI-g7p.js";
11
- import { I as Q } from "./input-C5zU49Q1.js";
9
+ import { T as K, a as P, b as D, c as L } from "./tabs-CWr9HYaM.js";
10
+ import { B as T } from "./button-RnHbJfd-.js";
11
+ import { I as Q } from "./input-CvyMYMZG.js";
12
12
  function X(e, t) {
13
13
  let r;
14
14
  try {