reactjs-tiptap-editor 1.0.13 → 1.0.15

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 (186) hide show
  1. package/lib/{ActionMenuButton-DNj0f_A4.cjs → ActionMenuButton-CWufGd7i.cjs} +1 -1
  2. package/lib/{ActionMenuButton-l5rSmAO_.js → ActionMenuButton-yWfQQXo5.js} +5 -5
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +6 -6
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +4 -4
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +4 -4
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +4 -4
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +36 -40
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +3 -3
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +4 -4
  17. package/lib/CodeBlock.cjs +1 -1
  18. package/lib/CodeBlock.js +6 -6
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +4 -4
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +6 -6
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +4 -4
  25. package/lib/{Drawer-Cbi_MURj.js → Drawer-C0rJpSQV.js} +8 -8
  26. package/lib/{Drawer-DKU32YW_.cjs → Drawer-CK1NdsE9.cjs} +1 -1
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +3 -3
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +212 -2076
  31. package/lib/{Excalidraw-CWrVL5hs.js → Excalidraw-ChvBaUFj.js} +6 -6
  32. package/lib/{Excalidraw-Kb-TRcWY.cjs → Excalidraw-FQMP_e8X.cjs} +1 -1
  33. package/lib/Excalidraw.cjs +1 -1
  34. package/lib/Excalidraw.js +2 -2
  35. package/lib/ExportPdf.cjs +1 -1
  36. package/lib/ExportPdf.js +4 -4
  37. package/lib/ExportWord.cjs +1 -1
  38. package/lib/ExportWord.js +4 -4
  39. package/lib/FontFamily.cjs +1 -1
  40. package/lib/FontFamily.js +6 -6
  41. package/lib/FontSize.cjs +1 -1
  42. package/lib/FontSize.js +6 -6
  43. package/lib/Heading.cjs +1 -1
  44. package/lib/Heading.js +6 -6
  45. package/lib/Highlight.cjs +1 -1
  46. package/lib/Highlight.js +6 -6
  47. package/lib/History.cjs +1 -1
  48. package/lib/History.js +22 -22
  49. package/lib/HorizontalRule.cjs +1 -1
  50. package/lib/HorizontalRule.js +4 -4
  51. package/lib/{Icon-yqCglrdK.cjs → Icon-CM1Cjn99.cjs} +1 -1
  52. package/lib/{Icon-Ctva8VeB.js → Icon-r62Z3hkc.js} +2 -2
  53. package/lib/{Iframe-C942bNjs.js → Iframe-C3rQAa7b.js} +6 -6
  54. package/lib/{Iframe-BczF8Hex.cjs → Iframe-Cxf_DSBV.cjs} +1 -1
  55. package/lib/Iframe.cjs +1 -1
  56. package/lib/Iframe.js +2 -2
  57. package/lib/Image-CndKNf1r.js +925 -0
  58. package/lib/Image-uX801fbV.cjs +1 -0
  59. package/lib/Image.cjs +1 -1
  60. package/lib/Image.js +5 -828
  61. package/lib/ImageGif.cjs +1 -1
  62. package/lib/ImageGif.js +9 -9
  63. package/lib/ImportWord.cjs +1 -231
  64. package/lib/ImportWord.js +91 -16623
  65. package/lib/{Indent-C_O5WdyR.js → Indent-CRs7DcJ7.js} +4 -4
  66. package/lib/{Indent-CkEC7x36.cjs → Indent-MRKDhN1d.cjs} +1 -1
  67. package/lib/Indent.cjs +1 -1
  68. package/lib/Indent.js +2 -2
  69. package/lib/Italic.cjs +1 -1
  70. package/lib/Italic.js +4 -4
  71. package/lib/{Katex-D3PEWimM.js → Katex-BwVNxYe7.js} +369 -347
  72. package/lib/Katex-Clvcitiy.cjs +4 -0
  73. package/lib/Katex.cjs +1 -1
  74. package/lib/Katex.js +2 -2
  75. package/lib/LineHeight.cjs +1 -1
  76. package/lib/LineHeight.js +7 -7
  77. package/lib/Link.cjs +1 -1
  78. package/lib/Link.js +2 -2
  79. package/lib/{LinkEditBlock-DL1e2ILk.cjs → LinkEditBlock-CWTjZr7s.cjs} +1 -1
  80. package/lib/{LinkEditBlock-h5054QDo.js → LinkEditBlock-wuQ6wF2z.js} +11 -11
  81. package/lib/Mention.cjs +1 -1
  82. package/lib/Mention.js +41 -63
  83. package/lib/Mermaid.cjs +1 -1
  84. package/lib/Mermaid.js +16 -16
  85. package/lib/MoreMark.cjs +1 -1
  86. package/lib/MoreMark.js +7 -7
  87. package/lib/OrderedList.cjs +1 -1
  88. package/lib/OrderedList.js +4 -4
  89. package/lib/SearchAndReplace.cjs +1 -1
  90. package/lib/SearchAndReplace.js +11 -11
  91. package/lib/SlashCommand.cjs +1 -1
  92. package/lib/SlashCommand.js +9 -9
  93. package/lib/{SlashCommandNodeView-DXUqkx82.js → SlashCommandNodeView-B1gtWo_V.js} +61 -66
  94. package/lib/SlashCommandNodeView-R0CQmgNf.cjs +1 -0
  95. package/lib/Strike.cjs +1 -1
  96. package/lib/Strike.js +4 -4
  97. package/lib/{Table-kY0nbqJo.cjs → Table-Bc7tWR2B.cjs} +1 -1
  98. package/lib/{Table-DdrY4jcM.js → Table-CX-KhOti.js} +22 -22
  99. package/lib/Table.cjs +1 -1
  100. package/lib/Table.js +1 -1
  101. package/lib/TaskList.cjs +1 -1
  102. package/lib/TaskList.js +4 -4
  103. package/lib/TextAlign.cjs +1 -1
  104. package/lib/TextAlign.js +7 -7
  105. package/lib/TextDirection.cjs +1 -1
  106. package/lib/TextDirection.js +7 -7
  107. package/lib/TextUnderline.cjs +1 -1
  108. package/lib/TextUnderline.js +4 -4
  109. package/lib/{Twitter-DjZcVa3l.cjs → Twitter-BEELS4WN.cjs} +1 -1
  110. package/lib/{Twitter-B-JQ3ZJ1.js → Twitter-DWxlLtyE.js} +10 -10
  111. package/lib/Twitter.cjs +1 -1
  112. package/lib/Twitter.js +2 -2
  113. package/lib/Video.cjs +1 -1
  114. package/lib/Video.js +9 -9
  115. package/lib/bubble.cjs +1 -1
  116. package/lib/bubble.js +27 -27
  117. package/lib/{button-Uv01FNnd.js → button-BHVEzoNa.js} +2 -2
  118. package/lib/{button-BS3n6_Aq.cjs → button-C_ES-H6-.cjs} +1 -1
  119. package/lib/{checkbox-C8ByRi7-.cjs → checkbox-DerJy3zE.cjs} +1 -1
  120. package/lib/{checkbox-DEFNwGwb.js → checkbox-H16jHmU7.js} +1 -1
  121. package/lib/{clsx-BWSGDJNJ.js → clsx-DSzxBzvL.js} +11 -11
  122. package/lib/{dialog-DwTMZSt6.js → dialog-BIDVvFgj.js} +1 -1
  123. package/lib/{dialog-Bt5zwGYB.cjs → dialog-C6j99nwb.cjs} +1 -1
  124. package/lib/{dropdown-menu-BetI14G6.js → dropdown-menu-BONvj89O.js} +1 -1
  125. package/lib/{dropdown-menu-Bo68IEOT.cjs → dropdown-menu-Bs9HlT_z.cjs} +1 -1
  126. package/lib/extensions/Emoji/Emoji.d.ts +3 -1
  127. package/lib/extensions/Emoji/components/EmojiList/EmojiNodeView.d.ts +9 -1
  128. package/lib/{index-CHKWG6E8.js → index-4bHF5ovf.js} +1 -1
  129. package/lib/index-BCnlmprm.cjs +1 -0
  130. package/lib/{index-Dujzr6bY.js → index-C5aucGFK.js} +69 -73
  131. package/lib/{index-CcoWj0mF.js → index-CL7JP-Xz.js} +1 -1
  132. package/lib/{index-mR8PNv5P.js → index-CpTykZBR.js} +1 -1
  133. package/lib/index-CyToCRcM.cjs +1 -0
  134. package/lib/{index-BDKHXe7R.js → index-D8li6EQ4.js} +1 -1
  135. package/lib/{index-Doks9cbR.cjs → index-D9U_fxh1.cjs} +1 -1
  136. package/lib/{index-DJbmnBzK.js → index-DR5tIdL7.js} +1 -1
  137. package/lib/index-QbkujP_O.js +273 -0
  138. package/lib/{index-DF5ZPtWM.js → index-w1tuwtjd.js} +54 -56
  139. package/lib/index.cjs +2 -2
  140. package/lib/index.js +4 -4
  141. package/lib/{input-DUBdJD3L.js → input-B5KKrCv9.js} +1 -1
  142. package/lib/{input-Dt_BA_9B.cjs → input-BqK_Byqu.cjs} +1 -1
  143. package/lib/{isNumber-CIgubz2e.js → isNumber-ClwLypY2.js} +1 -1
  144. package/lib/{label-JNOksCA-.cjs → label-B4bPSQ9R.cjs} +1 -1
  145. package/lib/{label-topD46-u.js → label-DRlIWK9v.js} +2 -2
  146. package/lib/locale-bundle.cjs +1 -1
  147. package/lib/locale-bundle.js +1 -1
  148. package/lib/locales/index.d.ts +5 -1
  149. package/lib/{popover-LfNBhRyz.js → popover-3G0SoGLu.js} +1 -1
  150. package/lib/{popover-mL-2sX5r.cjs → popover-Dz8-t65R.cjs} +1 -1
  151. package/lib/renderNodeView-CSazLrKF.js +28 -0
  152. package/lib/renderNodeView-DfLmGrgA.cjs +1 -0
  153. package/lib/{select-DctYuHLH.js → select-BsKwU96B.js} +1 -1
  154. package/lib/{select-CwGYPsPq.cjs → select-DAYrMJGw.cjs} +1 -1
  155. package/lib/{separator-Ddfrhn4D.js → separator-D-k3jqSx.js} +5 -5
  156. package/lib/{separator-NoH_SLRW.cjs → separator-DhFsFHrr.cjs} +1 -1
  157. package/lib/store/commandList.d.ts +5 -1
  158. package/lib/store/store.d.ts +7 -6
  159. package/lib/{store-DNpS8vXA.js → store-BqlO_bdQ.js} +1 -1
  160. package/lib/{store-CkjKIgjQ.cjs → store-DkhlVuvE.cjs} +1 -1
  161. package/lib/{tabs-DRSwUeKP.cjs → tabs-Bj_1FHsB.cjs} +1 -1
  162. package/lib/{tabs-BT3AeqQQ.js → tabs-Do-p89DG.js} +1 -1
  163. package/lib/{textarea-DZzMEDfZ.js → textarea-BU9GfWiN.js} +1 -1
  164. package/lib/{textarea-BDO6XQoF.cjs → textarea-DRQRAKDT.cjs} +1 -1
  165. package/lib/theme.cjs +1 -1
  166. package/lib/theme.js +21 -27
  167. package/lib/{throttle-IERhwcLa.js → throttle-D040PfWL.js} +1 -1
  168. package/lib/{toggle-DKHg5sLm.js → toggle-BFJ-X-Zp.js} +4 -4
  169. package/lib/{toggle-BQHMh_Q-.cjs → toggle-Df4nXsom.cjs} +1 -1
  170. package/lib/{tooltip-BYtGp6FM.cjs → tooltip-BCKvrxQJ.cjs} +1 -1
  171. package/lib/{tooltip-DNKq7zgN.js → tooltip-CKN-cdhm.js} +1 -1
  172. package/lib/{updatePosition-Bie75EFq.js → updatePosition-CDK7OR0i.js} +2 -2
  173. package/lib/{useButtonProps-DVP4s_ER.js → useButtonProps-BCNfeziv.js} +5 -5
  174. package/lib/{useButtonProps-DBJkNDS2.cjs → useButtonProps-BgjZY_Mu.cjs} +1 -1
  175. package/lib/utils/renderNodeView.d.ts +6 -0
  176. package/package.json +16 -3
  177. package/lib/Katex-DW_HjgNM.cjs +0 -4
  178. package/lib/SlashCommandNodeView-BqrmHCpu.cjs +0 -1
  179. package/lib/_commonjsHelpers-BItOPCY9.js +0 -28
  180. package/lib/_commonjsHelpers-BTDuMlIz.cjs +0 -1
  181. package/lib/extensions/Emoji/components/EmojiList/emojis.d.ts +0 -4
  182. package/lib/index-D3RLYf-J.cjs +0 -1
  183. package/lib/react-BEoMZB61.cjs +0 -1
  184. package/lib/react-c9FSfB30.js +0 -27
  185. package/lib/use-toast-Bz3QCOtE.cjs +0 -1
  186. package/lib/use-toast-Crf7-q5H.js +0 -98
@@ -1,11 +1,11 @@
1
- import { s as y, E as x } from "./clsx-BWSGDJNJ.js";
1
+ import { s as y, E as x } from "./clsx-DSzxBzvL.js";
2
2
  import { TextSelection as b, AllSelection as I } from "@tiptap/pm/state";
3
3
  import { jsx as u, Fragment as m, jsxs as A } from "react/jsx-runtime";
4
- import { A as p } from "./toggle-DKHg5sLm.js";
4
+ import { A as p } from "./toggle-BFJ-X-Zp.js";
5
5
  import "react";
6
- import "./index-DF5ZPtWM.js";
6
+ import "./index-w1tuwtjd.js";
7
7
  import "./theme.js";
8
- import { u as T, a as K } from "./useButtonProps-DVP4s_ER.js";
8
+ import { u as T, a as K } from "./useButtonProps-BCNfeziv.js";
9
9
  var a = /* @__PURE__ */ ((t) => (t[t.max = 7] = "max", t[t.min = 0] = "min", t[t.more = 1] = "more", t[t.less = -1] = "less", t))(a || {});
10
10
  function g(t, n, e) {
11
11
  return t < n ? n : t > e ? e : t;
@@ -1 +1 @@
1
- "use strict";const h=require("./clsx-CXbNJWDD.cjs"),m=require("@tiptap/pm/state"),c=require("react/jsx-runtime"),l=require("./toggle-BQHMh_Q-.cjs");require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const p=require("./useButtonProps-DBJkNDS2.cjs");var a=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(a||{});function T(t,e,n){return t<e?e:t>n?n:t}function g(t,e,n,o){const{doc:i,selection:r}=t;if(!i||!r||!(r instanceof m.TextSelection||r instanceof m.AllSelection))return t;const{from:s,to:u}=r;return i.nodesBetween(s,u,(d,I)=>{const b=d.type;return n.includes(b.name)?(t=y(t,I,e),!1):!h.isList(d.type.name,o.extensionManager.extensions)}),t}function y(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o)return t;const s=T((o.attrs.indent||0)+n,0,7);if(s===o.attrs.indent)return t;const u={...o.attrs,indent:s};return t.setNodeMarkup(e,o.type,u,o.marks)}function f({delta:t,types:e}){return({state:n,dispatch:o,editor:i})=>{const{selection:r}=n;let{tr:s}=n;return s=s.setSelection(r),s=g(s,t,e,i),s.docChanged?(o&&o(s),!0):!1}}function A(){const t=p.useButtonProps(x.name),{indent:e,outdent:n}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o}=p.useToggleActive(),i=()=>{o||e!=null&&e.action&&(e==null||e.action())},r=()=>{o||n!=null&&n.action&&(n==null||n.action())};return t?c.jsxs(c.Fragment,{children:[c.jsx(l.ActionButton,{action:i,disabled:o,icon:e==null?void 0:e.icon,shortcutKeys:e==null?void 0:e.shortcutKeys,tooltip:e==null?void 0:e.tooltip}),c.jsx(l.ActionButton,{action:r,disabled:o,icon:n==null?void 0:n.icon,shortcutKeys:n==null?void 0:n.shortcutKeys,tooltip:n==null?void 0:n.tooltip})]}):c.jsx(c.Fragment,{})}const x=h.Extension.create({name:"richtextIndentOutdent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:a.min,maxIndent:a.max,button({editor:e,t:n,extension:o}){var i,r;return{componentProps:{indent:{action:()=>{e.commands.indent()},shortcutKeys:((i=o.options.shortcutKeys)==null?void 0:i[0])??["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")},outdent:{action:()=>{e.commands.outdent()},shortcutKeys:((r=o.options.shortcutKeys)==null?void 0:r[1])??["Shift","Tab"],icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>f({delta:a.more,types:this.options.types}),outdent:()=>f({delta:a.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=x;exports.IndentProps=a;exports.RichTextIndent=A;exports.setNodeIndentMarkup=y;
1
+ "use strict";const h=require("./clsx-CXbNJWDD.cjs"),m=require("@tiptap/pm/state"),c=require("react/jsx-runtime"),l=require("./toggle-Df4nXsom.cjs");require("react");require("./index-CyToCRcM.cjs");require("./theme.cjs");const p=require("./useButtonProps-BgjZY_Mu.cjs");var a=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(a||{});function T(t,e,n){return t<e?e:t>n?n:t}function g(t,e,n,o){const{doc:i,selection:r}=t;if(!i||!r||!(r instanceof m.TextSelection||r instanceof m.AllSelection))return t;const{from:s,to:u}=r;return i.nodesBetween(s,u,(d,I)=>{const b=d.type;return n.includes(b.name)?(t=y(t,I,e),!1):!h.isList(d.type.name,o.extensionManager.extensions)}),t}function y(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o)return t;const s=T((o.attrs.indent||0)+n,0,7);if(s===o.attrs.indent)return t;const u={...o.attrs,indent:s};return t.setNodeMarkup(e,o.type,u,o.marks)}function f({delta:t,types:e}){return({state:n,dispatch:o,editor:i})=>{const{selection:r}=n;let{tr:s}=n;return s=s.setSelection(r),s=g(s,t,e,i),s.docChanged?(o&&o(s),!0):!1}}function A(){const t=p.useButtonProps(x.name),{indent:e,outdent:n}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o}=p.useToggleActive(),i=()=>{o||e!=null&&e.action&&(e==null||e.action())},r=()=>{o||n!=null&&n.action&&(n==null||n.action())};return t?c.jsxs(c.Fragment,{children:[c.jsx(l.ActionButton,{action:i,disabled:o,icon:e==null?void 0:e.icon,shortcutKeys:e==null?void 0:e.shortcutKeys,tooltip:e==null?void 0:e.tooltip}),c.jsx(l.ActionButton,{action:r,disabled:o,icon:n==null?void 0:n.icon,shortcutKeys:n==null?void 0:n.shortcutKeys,tooltip:n==null?void 0:n.tooltip})]}):c.jsx(c.Fragment,{})}const x=h.Extension.create({name:"richtextIndentOutdent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:a.min,maxIndent:a.max,button({editor:e,t:n,extension:o}){var i,r;return{componentProps:{indent:{action:()=>{e.commands.indent()},shortcutKeys:((i=o.options.shortcutKeys)==null?void 0:i[0])??["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")},outdent:{action:()=>{e.commands.outdent()},shortcutKeys:((r=o.options.shortcutKeys)==null?void 0:r[1])??["Shift","Tab"],icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>f({delta:a.more,types:this.options.types}),outdent:()=>f({delta:a.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=x;exports.IndentProps=a;exports.RichTextIndent=A;exports.setNodeIndentMarkup=y;
package/lib/Indent.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./Indent-CkEC7x36.cjs");exports.Indent=e.Indent;exports.RichTextIndent=e.RichTextIndent;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./Indent-MRKDhN1d.cjs");exports.Indent=e.Indent;exports.RichTextIndent=e.RichTextIndent;
package/lib/Indent.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./clsx-BWSGDJNJ.js";
2
- import { I as o, R as r } from "./Indent-C_O5WdyR.js";
1
+ import "./clsx-DSzxBzvL.js";
2
+ import { I as o, R as r } from "./Indent-CRs7DcJ7.js";
3
3
  export {
4
4
  o as Indent,
5
5
  r as RichTextIndent
package/lib/Italic.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),y=require("./toggle-BQHMh_Q-.cjs");require("react");require("./index-D3RLYf-J.cjs");require("./theme.cjs");const u=require("./useButtonProps-DBJkNDS2.cjs");var I=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,h=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,v=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,f=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,k=r.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[r.markInputRule({find:I,type:this.type}),r.markInputRule({find:v,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:h,type:this.type}),r.markPasteRule({find:f,type:this.type})]}}),M=k;function R(){const t=u.useButtonProps(c.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:i=void 0,tooltipOptions:l={},action:a=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:p,disabled:o,update:m}=u.useToggleActive(d),g=()=>{o||a&&(a(),m())};return t?s.jsx(y.ActionButton,{action:g,dataState:p,disabled:o,icon:e,shortcutKeys:i,tooltip:n,tooltipOptions:l}):s.jsx(s.Fragment,{})}const c=M.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,t:n,extension:i}){return{componentProps:{action:()=>e.commands.toggleItalic(),isActive:()=>e.isActive("italic")||!1,disabled:!1,shortcutKeys:i.options.shortcutKeys??["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=c;exports.RichTextItalic=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./clsx-CXbNJWDD.cjs"),s=require("react/jsx-runtime"),y=require("./toggle-Df4nXsom.cjs");require("react");require("./index-CyToCRcM.cjs");require("./theme.cjs");const u=require("./useButtonProps-BgjZY_Mu.cjs");var I=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,h=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,v=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,f=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,k=r.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[r.markInputRule({find:I,type:this.type}),r.markInputRule({find:v,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:h,type:this.type}),r.markPasteRule({find:f,type:this.type})]}}),M=k;function R(){const t=u.useButtonProps(c.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:i=void 0,tooltipOptions:l={},action:a=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:p,disabled:o,update:m}=u.useToggleActive(d),g=()=>{o||a&&(a(),m())};return t?s.jsx(y.ActionButton,{action:g,dataState:p,disabled:o,icon:e,shortcutKeys:i,tooltip:n,tooltipOptions:l}):s.jsx(s.Fragment,{})}const c=M.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,t:n,extension:i}){return{componentProps:{action:()=>e.commands.toggleItalic(),isActive:()=>e.isActive("italic")||!1,disabled:!1,shortcutKeys:i.options.shortcutKeys??["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=c;exports.RichTextItalic=R;
package/lib/Italic.js CHANGED
@@ -1,10 +1,10 @@
1
- import { M as g, e as n, f as o, m as y } from "./clsx-BWSGDJNJ.js";
1
+ import { M as g, e as n, f as o, m as y } from "./clsx-DSzxBzvL.js";
2
2
  import { jsx as d, Fragment as f } from "react/jsx-runtime";
3
- import { A as h } from "./toggle-DKHg5sLm.js";
3
+ import { A as h } from "./toggle-BFJ-X-Zp.js";
4
4
  import "react";
5
- import "./index-DF5ZPtWM.js";
5
+ import "./index-w1tuwtjd.js";
6
6
  import "./theme.js";
7
- import { u as I, a as v } from "./useButtonProps-DVP4s_ER.js";
7
+ import { u as I, a as v } from "./useButtonProps-BCNfeziv.js";
8
8
  var M = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, k = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, A = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, _ = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, x = g.create({
9
9
  name: "italic",
10
10
  addOptions() {