reactjs-tiptap-editor 0.3.11 → 0.3.13

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 (233) hide show
  1. package/lib/{ActionMenuButton-BQ2ojtpo.js → ActionMenuButton-BfH5nAGi.js} +1 -1
  2. package/lib/{ActionMenuButton-OfnmanTP.cjs → ActionMenuButton-Cbbnqd-L.cjs} +1 -1
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.d.cts +17 -17
  5. package/lib/Attachment.d.ts +17 -17
  6. package/lib/Attachment.js +5 -5
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +17 -17
  9. package/lib/Blockquote.d.ts +17 -17
  10. package/lib/Blockquote.js +2 -2
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +17 -17
  13. package/lib/Bold.d.ts +17 -17
  14. package/lib/Bold.js +2 -2
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +17 -17
  17. package/lib/BulletList.d.ts +17 -17
  18. package/lib/BulletList.js +2 -2
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +17 -17
  21. package/lib/Clear.d.ts +17 -17
  22. package/lib/Clear.js +2 -2
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +17 -17
  25. package/lib/Code.d.ts +17 -17
  26. package/lib/Code.js +2 -2
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +17 -17
  29. package/lib/CodeBlock.d.ts +17 -17
  30. package/lib/CodeBlock.js +3 -3
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +17 -17
  33. package/lib/CodeView.d.ts +17 -17
  34. package/lib/CodeView.js +2 -2
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +17 -17
  37. package/lib/Color.d.ts +17 -17
  38. package/lib/Color.js +3 -3
  39. package/lib/Document.d.cts +17 -17
  40. package/lib/Document.d.ts +17 -17
  41. package/lib/Document.js +1 -1
  42. package/lib/{Drawer-9QMJnenp.js → Drawer-DUXFBfgE.js} +3 -3
  43. package/lib/{Drawer-BN8H4Zb2.cjs → Drawer-jPHImfyr.cjs} +1 -1
  44. package/lib/Drawer.cjs +1 -1
  45. package/lib/Drawer.d.cts +17 -17
  46. package/lib/Drawer.d.ts +17 -17
  47. package/lib/Drawer.js +4 -4
  48. package/lib/Emoji.cjs +1 -1
  49. package/lib/Emoji.d.cts +17 -17
  50. package/lib/Emoji.d.ts +17 -17
  51. package/lib/Emoji.js +4 -4
  52. package/lib/{Excalidraw-B95hkXm5.js → Excalidraw-BBOIIhij.js} +3 -3
  53. package/lib/{Excalidraw-iG1WleD5.cjs → Excalidraw-CwZ3g3p-.cjs} +1 -1
  54. package/lib/Excalidraw.cjs +1 -1
  55. package/lib/Excalidraw.d.cts +17 -17
  56. package/lib/Excalidraw.d.ts +17 -17
  57. package/lib/Excalidraw.js +3 -3
  58. package/lib/ExportPdf.cjs +1 -1
  59. package/lib/ExportPdf.d.cts +17 -17
  60. package/lib/ExportPdf.d.ts +17 -17
  61. package/lib/ExportPdf.js +2 -2
  62. package/lib/ExportWord.cjs +1 -1
  63. package/lib/ExportWord.d.cts +17 -17
  64. package/lib/ExportWord.d.ts +17 -17
  65. package/lib/ExportWord.js +2 -2
  66. package/lib/FontFamily.cjs +1 -1
  67. package/lib/FontFamily.d.cts +17 -17
  68. package/lib/FontFamily.d.ts +17 -17
  69. package/lib/FontFamily.js +4 -4
  70. package/lib/FontSize.cjs +1 -1
  71. package/lib/FontSize.d.cts +17 -17
  72. package/lib/FontSize.d.ts +17 -17
  73. package/lib/FontSize.js +3 -3
  74. package/lib/FormatPainter.cjs +1 -1
  75. package/lib/FormatPainter.d.cts +17 -17
  76. package/lib/FormatPainter.d.ts +17 -17
  77. package/lib/FormatPainter.js +2 -2
  78. package/lib/Heading.cjs +1 -1
  79. package/lib/Heading.d.cts +17 -17
  80. package/lib/Heading.d.ts +17 -17
  81. package/lib/Heading.js +3 -3
  82. package/lib/Highlight.cjs +1 -1
  83. package/lib/Highlight.d.cts +17 -17
  84. package/lib/Highlight.d.ts +17 -17
  85. package/lib/Highlight.js +2 -2
  86. package/lib/History.cjs +1 -1
  87. package/lib/History.d.cts +17 -17
  88. package/lib/History.d.ts +17 -17
  89. package/lib/History.js +2 -2
  90. package/lib/HorizontalRule.cjs +1 -1
  91. package/lib/HorizontalRule.d.cts +17 -17
  92. package/lib/HorizontalRule.d.ts +17 -17
  93. package/lib/HorizontalRule.js +2 -2
  94. package/lib/Iframe.cjs +1 -1
  95. package/lib/Iframe.d.cts +17 -17
  96. package/lib/Iframe.d.ts +17 -17
  97. package/lib/Iframe.js +3 -3
  98. package/lib/Image.cjs +1 -1
  99. package/lib/Image.d.cts +17 -17
  100. package/lib/Image.d.ts +17 -17
  101. package/lib/Image.js +3 -3
  102. package/lib/ImageGif.cjs +1 -1
  103. package/lib/ImageGif.d.cts +17 -17
  104. package/lib/ImageGif.d.ts +17 -17
  105. package/lib/ImageGif.js +3 -3
  106. package/lib/ImportWord.cjs +1 -1
  107. package/lib/ImportWord.d.cts +17 -17
  108. package/lib/ImportWord.d.ts +17 -17
  109. package/lib/ImportWord.js +2 -2
  110. package/lib/Indent.cjs +1 -1
  111. package/lib/Indent.d.cts +17 -17
  112. package/lib/Indent.d.ts +17 -17
  113. package/lib/Indent.js +2 -2
  114. package/lib/Italic.cjs +1 -1
  115. package/lib/Italic.d.cts +17 -17
  116. package/lib/Italic.d.ts +17 -17
  117. package/lib/Italic.js +2 -2
  118. package/lib/Katex.cjs +1 -1
  119. package/lib/Katex.d.cts +17 -17
  120. package/lib/Katex.d.ts +17 -17
  121. package/lib/Katex.js +4 -4
  122. package/lib/LineHeight.cjs +1 -1
  123. package/lib/LineHeight.d.cts +17 -17
  124. package/lib/LineHeight.d.ts +17 -17
  125. package/lib/LineHeight.js +2 -2
  126. package/lib/Link.cjs +1 -5
  127. package/lib/Link.d.cts +20 -18
  128. package/lib/Link.d.ts +20 -18
  129. package/lib/Link.js +4 -1048
  130. package/lib/ListItem.d.cts +17 -17
  131. package/lib/ListItem.d.ts +17 -17
  132. package/lib/ListItem.js +1 -1
  133. package/lib/Mention.d.cts +17 -17
  134. package/lib/Mention.d.ts +17 -17
  135. package/lib/Mention.js +3 -3
  136. package/lib/Mermaid.cjs +2 -2
  137. package/lib/Mermaid.d.cts +17 -17
  138. package/lib/Mermaid.d.ts +17 -17
  139. package/lib/Mermaid.js +4 -4
  140. package/lib/MoreMark.cjs +1 -1
  141. package/lib/MoreMark.d.cts +17 -17
  142. package/lib/MoreMark.d.ts +17 -17
  143. package/lib/MoreMark.js +3 -3
  144. package/lib/MultiColumn.cjs +1 -1
  145. package/lib/MultiColumn.d.cts +17 -17
  146. package/lib/MultiColumn.d.ts +17 -17
  147. package/lib/MultiColumn.js +2 -2
  148. package/lib/OrderedList.cjs +1 -1
  149. package/lib/OrderedList.d.cts +17 -17
  150. package/lib/OrderedList.d.ts +17 -17
  151. package/lib/OrderedList.js +2 -2
  152. package/lib/RichTextEditor-C3sK_Ys3.cjs +141 -0
  153. package/lib/{RichTextEditor-CFwUKN9i.js → RichTextEditor-OW4s40FH.js} +4817 -3766
  154. package/lib/SearchAndReplace.cjs +1 -1
  155. package/lib/SearchAndReplace.d.cts +17 -17
  156. package/lib/SearchAndReplace.d.ts +17 -17
  157. package/lib/SearchAndReplace.js +2 -2
  158. package/lib/Selection.d.cts +17 -17
  159. package/lib/Selection.d.ts +17 -17
  160. package/lib/Selection.js +1 -1
  161. package/lib/SlashCommand.cjs +1 -1
  162. package/lib/SlashCommand.d.cts +17 -17
  163. package/lib/SlashCommand.d.ts +17 -17
  164. package/lib/SlashCommand.js +18 -18
  165. package/lib/Strike.cjs +1 -1
  166. package/lib/Strike.d.cts +17 -17
  167. package/lib/Strike.d.ts +17 -17
  168. package/lib/Strike.js +2 -2
  169. package/lib/SubAndSuperScript.cjs +1 -1
  170. package/lib/SubAndSuperScript.d.cts +17 -17
  171. package/lib/SubAndSuperScript.d.ts +17 -17
  172. package/lib/SubAndSuperScript.js +3 -3
  173. package/lib/Table.cjs +2 -2
  174. package/lib/Table.d.cts +17 -17
  175. package/lib/Table.d.ts +17 -17
  176. package/lib/Table.js +16 -16
  177. package/lib/TableOfContent.cjs +1 -1
  178. package/lib/TableOfContent.d.cts +17 -17
  179. package/lib/TableOfContent.d.ts +17 -17
  180. package/lib/TableOfContent.js +5 -5
  181. package/lib/TaskList.cjs +1 -1
  182. package/lib/TaskList.d.cts +17 -17
  183. package/lib/TaskList.d.ts +17 -17
  184. package/lib/TaskList.js +2 -2
  185. package/lib/TextAlign.cjs +1 -1
  186. package/lib/TextAlign.d.cts +17 -17
  187. package/lib/TextAlign.d.ts +17 -17
  188. package/lib/TextAlign.js +2 -2
  189. package/lib/TextBubble.cjs +1 -1
  190. package/lib/TextBubble.d.cts +17 -17
  191. package/lib/TextBubble.d.ts +17 -17
  192. package/lib/TextBubble.js +2 -2
  193. package/lib/TextDirection.cjs +1 -1
  194. package/lib/TextDirection.d.cts +17 -17
  195. package/lib/TextDirection.d.ts +17 -17
  196. package/lib/TextDirection.js +2 -2
  197. package/lib/TextUnderline.cjs +1 -1
  198. package/lib/TextUnderline.d.cts +17 -17
  199. package/lib/TextUnderline.d.ts +17 -17
  200. package/lib/TextUnderline.js +2 -2
  201. package/lib/TrailingNode.d.cts +17 -17
  202. package/lib/TrailingNode.d.ts +17 -17
  203. package/lib/TrailingNode.js +1 -1
  204. package/lib/{Twitter-ChRmdJB0.js → Twitter-2LOf4hFb.js} +44 -44
  205. package/lib/{Twitter-DbokWMq-.cjs → Twitter-Cg58uzB-.cjs} +3 -3
  206. package/lib/Twitter.cjs +1 -1
  207. package/lib/Twitter.d.cts +17 -17
  208. package/lib/Twitter.d.ts +17 -17
  209. package/lib/Twitter.js +3 -3
  210. package/lib/Video.cjs +1 -1
  211. package/lib/Video.d.cts +17 -17
  212. package/lib/Video.d.ts +17 -17
  213. package/lib/Video.js +2 -2
  214. package/lib/bubble-extra.cjs +2 -2
  215. package/lib/bubble-extra.d.cts +17 -17
  216. package/lib/bubble-extra.d.ts +17 -17
  217. package/lib/bubble-extra.js +6 -6
  218. package/lib/{dom-dataset-2RXYq9wp.js → dom-dataset-CHDbKz5J.js} +1 -1
  219. package/lib/{index-CXIIg9Sq.js → index-BWx1Mchx.js} +21 -21
  220. package/lib/{index-BGwJ0NfQ.js → index-DEFQHExY.js} +1 -1
  221. package/lib/{index-BkoojfPK.js → index-DIPntess.js} +1 -1
  222. package/lib/{index-fKx6CYUM.js → index-oQutU45z.js} +1 -1
  223. package/lib/index.cjs +1 -1
  224. package/lib/index.d.cts +19 -17
  225. package/lib/index.d.ts +19 -17
  226. package/lib/index.js +43 -43
  227. package/lib/locale-bundle.d.cts +17 -17
  228. package/lib/locale-bundle.d.ts +17 -17
  229. package/lib/style.css +1 -1
  230. package/lib/{textarea-D5VHsW3K.js → textarea-DM-_io94.js} +1 -1
  231. package/lib/{textarea-BfhvC1nW.cjs → textarea-DNz8Tnud.cjs} +1 -1
  232. package/package.json +1 -1
  233. package/lib/RichTextEditor-COwI-b24.cjs +0 -137
package/lib/ImportWord.js CHANGED
@@ -1,7 +1,7 @@
1
- import { E as Ts } from "./index-CXIIg9Sq.js";
1
+ import { E as Ts } from "./index-BWx1Mchx.js";
2
2
  import { jsxs as ws, jsx as ba } from "react/jsx-runtime";
3
3
  import { useState as Es, useRef as As } from "react";
4
- import { aa as Cs, ab as un, ac as Fs, ad as Ss, A as Bs, ae as ks } from "./RichTextEditor-CFwUKN9i.js";
4
+ import { a9 as Cs, aa as un, ab as Fs, ac as Ss, A as Bs, ad as ks } from "./RichTextEditor-OW4s40FH.js";
5
5
  import { u as Ws } from "./index-D-DR0FPY.js";
6
6
  var ze = {}, Ei = "1.13.7", ya = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || Function("return this")() || {}, Ht = Array.prototype, Ai = Object.prototype, Da = typeof Symbol < "u" ? Symbol.prototype : null, Rs = Ht.push, rt = Ht.slice, Kn = Ai.toString, Ns = Ai.hasOwnProperty, Mc = typeof ArrayBuffer < "u", Os = typeof DataView < "u", Is = Array.isArray, va = Object.keys, xa = Object.create, _a = Mc && ArrayBuffer.isView, Ls = isNaN, Ms = isFinite, qc = !{ toString: null }.propertyIsEnumerable("toString"), Ua = [
7
7
  "valueOf",
package/lib/Indent.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-CSvnpArE.cjs"),t=require("./RichTextEditor-COwI-b24.cjs"),r=d.Extension.create({name:"indent",addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),types:["paragraph","heading","blockquote"],minIndent:t.IndentProps.min,maxIndent:t.IndentProps.max,button({editor:e,t:o}){return[{component:t.ActionButton,componentProps:{action:()=>{e.commands.indent()},shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:o("editor.indent.tooltip")}},{component:t.ActionButton,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:["Shift","Tab"],icon:"IndentDecrease",tooltip:o("editor.outdent.tooltip")}}]}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:n=>{const e=n.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:n=>n.indent?{"data-indent":n.indent}:{}}}}]},addCommands(){return{indent:()=>t.createIndentCommand({delta:t.IndentProps.more,types:this.options.types}),outdent:()=>t.createIndentCommand({delta:t.IndentProps.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-CSvnpArE.cjs"),t=require("./RichTextEditor-C3sK_Ys3.cjs"),r=d.Extension.create({name:"indent",addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),types:["paragraph","heading","blockquote"],minIndent:t.IndentProps.min,maxIndent:t.IndentProps.max,button({editor:e,t:o}){return[{component:t.ActionButton,componentProps:{action:()=>{e.commands.indent()},shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:o("editor.indent.tooltip")}},{component:t.ActionButton,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:["Shift","Tab"],icon:"IndentDecrease",tooltip:o("editor.outdent.tooltip")}}]}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:n=>{const e=n.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:n=>n.indent?{"data-indent":n.indent}:{}}}}]},addCommands(){return{indent:()=>t.createIndentCommand({delta:t.IndentProps.more,types:this.options.types}),outdent:()=>t.createIndentCommand({delta:t.IndentProps.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=r;
package/lib/Indent.d.cts CHANGED
@@ -111,11 +111,9 @@ declare module '@tiptap/core' {
111
111
 
112
112
  declare module '@tiptap/core' {
113
113
  interface Commands<ReturnType> {
114
- emoji: {
115
- setEmoji: (emoji: {
116
- name: string;
117
- emoji: string;
118
- }) => ReturnType;
114
+ drawer: {
115
+ setDrawer: (options: any, replace?: any) => ReturnType;
116
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
119
117
  };
120
118
  }
121
119
  }
@@ -123,9 +121,11 @@ declare module '@tiptap/core' {
123
121
 
124
122
  declare module '@tiptap/core' {
125
123
  interface Commands<ReturnType> {
126
- drawer: {
127
- setDrawer: (options: any, replace?: any) => ReturnType;
128
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
124
+ emoji: {
125
+ setEmoji: (emoji: {
126
+ name: string;
127
+ emoji: string;
128
+ }) => ReturnType;
129
129
  };
130
130
  }
131
131
  }
@@ -149,15 +149,6 @@ declare module '@tiptap/core' {
149
149
  }
150
150
 
151
151
 
152
- declare module '@tiptap/core' {
153
- interface Commands<ReturnType> {
154
- painter: {
155
- setPainter: (marks: Mark[]) => ReturnType;
156
- };
157
- }
158
- }
159
-
160
-
161
152
  declare module '@tiptap/core' {
162
153
  interface Commands<ReturnType> {
163
154
  fontSize: {
@@ -176,6 +167,15 @@ declare module '@tiptap/core' {
176
167
  }
177
168
 
178
169
 
170
+ declare module '@tiptap/core' {
171
+ interface Commands<ReturnType> {
172
+ painter: {
173
+ setPainter: (marks: Mark[]) => ReturnType;
174
+ };
175
+ }
176
+ }
177
+
178
+
179
179
  declare module '@tiptap/core' {
180
180
  interface Commands<ReturnType> {
181
181
  iframe: {
package/lib/Indent.d.ts CHANGED
@@ -111,11 +111,9 @@ declare module '@tiptap/core' {
111
111
 
112
112
  declare module '@tiptap/core' {
113
113
  interface Commands<ReturnType> {
114
- emoji: {
115
- setEmoji: (emoji: {
116
- name: string;
117
- emoji: string;
118
- }) => ReturnType;
114
+ drawer: {
115
+ setDrawer: (options: any, replace?: any) => ReturnType;
116
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
119
117
  };
120
118
  }
121
119
  }
@@ -123,9 +121,11 @@ declare module '@tiptap/core' {
123
121
 
124
122
  declare module '@tiptap/core' {
125
123
  interface Commands<ReturnType> {
126
- drawer: {
127
- setDrawer: (options: any, replace?: any) => ReturnType;
128
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
124
+ emoji: {
125
+ setEmoji: (emoji: {
126
+ name: string;
127
+ emoji: string;
128
+ }) => ReturnType;
129
129
  };
130
130
  }
131
131
  }
@@ -149,15 +149,6 @@ declare module '@tiptap/core' {
149
149
  }
150
150
 
151
151
 
152
- declare module '@tiptap/core' {
153
- interface Commands<ReturnType> {
154
- painter: {
155
- setPainter: (marks: Mark[]) => ReturnType;
156
- };
157
- }
158
- }
159
-
160
-
161
152
  declare module '@tiptap/core' {
162
153
  interface Commands<ReturnType> {
163
154
  fontSize: {
@@ -176,6 +167,15 @@ declare module '@tiptap/core' {
176
167
  }
177
168
 
178
169
 
170
+ declare module '@tiptap/core' {
171
+ interface Commands<ReturnType> {
172
+ painter: {
173
+ setPainter: (marks: Mark[]) => ReturnType;
174
+ };
175
+ }
176
+ }
177
+
178
+
179
179
  declare module '@tiptap/core' {
180
180
  interface Commands<ReturnType> {
181
181
  iframe: {
package/lib/Indent.js CHANGED
@@ -1,5 +1,5 @@
1
- import { E as s } from "./index-CXIIg9Sq.js";
2
- import { c as d, I as e, A as r } from "./RichTextEditor-CFwUKN9i.js";
1
+ import { E as s } from "./index-BWx1Mchx.js";
2
+ import { c as d, I as e, A as r } from "./RichTextEditor-OW4s40FH.js";
3
3
  const p = /* @__PURE__ */ s.create({
4
4
  name: "indent",
5
5
  addOptions() {
package/lib/Italic.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSvnpArE.cjs"),r=require("./RichTextEditor-COwI-b24.cjs"),a=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,i=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,o=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,l=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,c=e.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",e.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)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[e.markInputRule({find:a,type:this.type}),e.markInputRule({find:o,type:this.type})]},addPasteRules(){return[e.markPasteRule({find:i,type:this.type}),e.markPasteRule({find:l,type:this.type})]}}),u=c.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:s,t:n}){return{component:r.ActionButton,componentProps:{action:()=>s.commands.toggleItalic(),isActive:()=>s.isActive("italic")||!1,disabled:!1,shortcutKeys:["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSvnpArE.cjs"),r=require("./RichTextEditor-C3sK_Ys3.cjs"),a=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,i=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,o=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,l=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,c=e.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",e.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)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[e.markInputRule({find:a,type:this.type}),e.markInputRule({find:o,type:this.type})]},addPasteRules(){return[e.markPasteRule({find:i,type:this.type}),e.markPasteRule({find:l,type:this.type})]}}),u=c.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:s,t:n}){return{component:r.ActionButton,componentProps:{action:()=>s.commands.toggleItalic(),isActive:()=>s.isActive("italic")||!1,disabled:!1,shortcutKeys:["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=u;
package/lib/Italic.d.cts CHANGED
@@ -110,11 +110,9 @@ declare module '@tiptap/core' {
110
110
 
111
111
  declare module '@tiptap/core' {
112
112
  interface Commands<ReturnType> {
113
- emoji: {
114
- setEmoji: (emoji: {
115
- name: string;
116
- emoji: string;
117
- }) => ReturnType;
113
+ drawer: {
114
+ setDrawer: (options: any, replace?: any) => ReturnType;
115
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
118
116
  };
119
117
  }
120
118
  }
@@ -122,9 +120,11 @@ declare module '@tiptap/core' {
122
120
 
123
121
  declare module '@tiptap/core' {
124
122
  interface Commands<ReturnType> {
125
- drawer: {
126
- setDrawer: (options: any, replace?: any) => ReturnType;
127
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
123
+ emoji: {
124
+ setEmoji: (emoji: {
125
+ name: string;
126
+ emoji: string;
127
+ }) => ReturnType;
128
128
  };
129
129
  }
130
130
  }
@@ -148,15 +148,6 @@ declare module '@tiptap/core' {
148
148
  }
149
149
 
150
150
 
151
- declare module '@tiptap/core' {
152
- interface Commands<ReturnType> {
153
- painter: {
154
- setPainter: (marks: Mark[]) => ReturnType;
155
- };
156
- }
157
- }
158
-
159
-
160
151
  declare module '@tiptap/core' {
161
152
  interface Commands<ReturnType> {
162
153
  fontSize: {
@@ -175,6 +166,15 @@ declare module '@tiptap/core' {
175
166
  }
176
167
 
177
168
 
169
+ declare module '@tiptap/core' {
170
+ interface Commands<ReturnType> {
171
+ painter: {
172
+ setPainter: (marks: Mark[]) => ReturnType;
173
+ };
174
+ }
175
+ }
176
+
177
+
178
178
  declare module '@tiptap/core' {
179
179
  interface Commands<ReturnType> {
180
180
  iframe: {
package/lib/Italic.d.ts CHANGED
@@ -110,11 +110,9 @@ declare module '@tiptap/core' {
110
110
 
111
111
  declare module '@tiptap/core' {
112
112
  interface Commands<ReturnType> {
113
- emoji: {
114
- setEmoji: (emoji: {
115
- name: string;
116
- emoji: string;
117
- }) => ReturnType;
113
+ drawer: {
114
+ setDrawer: (options: any, replace?: any) => ReturnType;
115
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
118
116
  };
119
117
  }
120
118
  }
@@ -122,9 +120,11 @@ declare module '@tiptap/core' {
122
120
 
123
121
  declare module '@tiptap/core' {
124
122
  interface Commands<ReturnType> {
125
- drawer: {
126
- setDrawer: (options: any, replace?: any) => ReturnType;
127
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
123
+ emoji: {
124
+ setEmoji: (emoji: {
125
+ name: string;
126
+ emoji: string;
127
+ }) => ReturnType;
128
128
  };
129
129
  }
130
130
  }
@@ -148,15 +148,6 @@ declare module '@tiptap/core' {
148
148
  }
149
149
 
150
150
 
151
- declare module '@tiptap/core' {
152
- interface Commands<ReturnType> {
153
- painter: {
154
- setPainter: (marks: Mark[]) => ReturnType;
155
- };
156
- }
157
- }
158
-
159
-
160
151
  declare module '@tiptap/core' {
161
152
  interface Commands<ReturnType> {
162
153
  fontSize: {
@@ -175,6 +166,15 @@ declare module '@tiptap/core' {
175
166
  }
176
167
 
177
168
 
169
+ declare module '@tiptap/core' {
170
+ interface Commands<ReturnType> {
171
+ painter: {
172
+ setPainter: (marks: Mark[]) => ReturnType;
173
+ };
174
+ }
175
+ }
176
+
177
+
178
178
  declare module '@tiptap/core' {
179
179
  interface Commands<ReturnType> {
180
180
  iframe: {
package/lib/Italic.js CHANGED
@@ -1,5 +1,5 @@
1
- import { M as a, c as s, d as n, m as i } from "./index-CXIIg9Sq.js";
2
- import { A as o } from "./RichTextEditor-CFwUKN9i.js";
1
+ import { M as a, c as s, d as n, m as i } from "./index-BWx1Mchx.js";
2
+ import { A as o } from "./RichTextEditor-OW4s40FH.js";
3
3
  const l = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, c = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, d = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, u = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, m = a.create({
4
4
  name: "italic",
5
5
  addOptions() {
package/lib/Katex.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CSvnpArE.cjs"),f=require("./dom-dataset-Cuy-pIfj.cjs"),n=require("react/jsx-runtime"),c=require("react"),b=require("katex"),j=require("lucide-react"),u=require("./RichTextEditor-COwI-b24.cjs"),w=require("./textarea-BfhvC1nW.cjs"),k=require("./index-Dz3YxLE7.cjs");function $({editor:e,...t}){const{t:s}=k.useLocale(),o=u.useAttributes(e,x.name,{text:"",defaultShowPicker:!1}),{text:i,defaultShowPicker:r}=o,[a,d]=c.useState(""),g=c.useCallback(()=>{e.chain().focus().setKatex({text:a}).run(),d("")},[e,a]);c.useEffect(()=>{r&&e.chain().updateAttributes(x.name,{defaultShowPicker:!1}).focus().run()},[e,r]);const h=c.useMemo(()=>{try{return b.renderToString(`${a}`)}catch{return a}},[a]),m=c.useMemo(()=>`${a}`.trim()?n.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:h||""}}):null,[a,h]);return n.jsxs(u.Popover,{modal:!0,children:[n.jsx(u.PopoverTrigger,{asChild:!0,children:n.jsx(u.ActionButton,{icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip})}),n.jsxs(u.PopoverContent,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:[n.jsx(u.Label,{className:"richtext-mb-[6px]",children:s("editor.formula.dialog.text")}),n.jsx("div",{className:"richtext-mb-[16px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm",children:n.jsx(w.Textarea,{autoFocus:!0,className:"richtext-w-full",defaultValue:i,onChange:p=>d(p.target.value),placeholder:"Text",required:!0,rows:3,value:a})})}),m&&n.jsx("div",{className:"richtext-my-[10px] richtext-max-w-[286px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]",children:m}),n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[n.jsx(u.Button,{className:"richtext-flex-1",onClick:g,children:"Submit"}),n.jsx("a",{href:"https://katex.org/docs/supported",rel:"noreferrer noopener",target:"_blank",children:n.jsx(j.HelpCircle,{size:16})})]})]})]})}function T(e,t=1){let s=0,o=0,i=0;if(e.startsWith("rgb")){const r=e.replace(/\s/g,"").match(/rgb\((.*)\)$/)[1].split(",");s=+r[0],o=+r[1],i=+r[2]}else if(e.startsWith("#")){let r=e.replace("#","");r.length===3&&(r=`${r[0]}${r[0]}${r[1]}${r[1]}${r[2]}${r[2]}`),s=Number.parseInt(r.substring(0,2),16),o=Number.parseInt(r.substring(2,4),16),i=Number.parseInt(r.substring(4,6),16)}else return e;return t>1&&t<=100&&(t=t/100),`rgba(${s},${o},${i},${t})`}function v({node:e}){const t=u.useTheme(),{text:s}=e.attrs,o=c.useMemo(()=>{const a="rgb(254, 242, 237)";return t==="dark"?T(a,.75):a},[t]),i=c.useMemo(()=>{try{return b.renderToString(`${s}`)}catch{return s}},[s]),r=c.useMemo(()=>s.trim()?n.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:i}}):n.jsx("span",{contentEditable:!1,children:"Not enter a formula"}),[s,i]);return n.jsx(f.NodeViewWrapper,{style:{display:"inline-block",backgroundColor:o},as:"span",children:r})}function N(e){return t=>t.getAttribute(e)}const x=l.Node.create({name:"katex",group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){return{HTMLAttributes:{class:"katex"},button:({editor:e,t})=>({component:$,componentProps:{editor:e,action:()=>!0,isActive:()=>!1,disabled:!1,icon:"KatexIcon",tooltip:t("editor.katex.tooltip")}})}},addAttributes(){return{text:{default:"",parseHTML:N("text")},defaultShowPicker:{default:!1}}},parseHTML(){return[{tag:"span.katex"}]},renderHTML({HTMLAttributes:e}){return["span",l.mergeAttributes(this.options&&this.options.HTMLAttributes||{},e)]},addCommands(){return{setKatex:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[l.nodeInputRule({find:/^\$katex\$$/,type:this.type,getAttributes:()=>({defaultShowPicker:!0})})]},addNodeView(){return f.ReactNodeViewRenderer(v)}});exports.Katex=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CSvnpArE.cjs"),f=require("./dom-dataset-Cuy-pIfj.cjs"),n=require("react/jsx-runtime"),c=require("react"),b=require("katex"),j=require("lucide-react"),u=require("./RichTextEditor-C3sK_Ys3.cjs"),w=require("./textarea-DNz8Tnud.cjs"),k=require("./index-Dz3YxLE7.cjs");function $({editor:e,...t}){const{t:s}=k.useLocale(),o=u.useAttributes(e,x.name,{text:"",defaultShowPicker:!1}),{text:i,defaultShowPicker:r}=o,[a,d]=c.useState(""),p=c.useCallback(()=>{e.chain().focus().setKatex({text:a}).run(),d("")},[e,a]);c.useEffect(()=>{r&&e.chain().updateAttributes(x.name,{defaultShowPicker:!1}).focus().run()},[e,r]);const h=c.useMemo(()=>{try{return b.renderToString(`${a}`)}catch{return a}},[a]),m=c.useMemo(()=>`${a}`.trim()?n.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:h||""}}):null,[a,h]);return n.jsxs(u.Popover,{modal:!0,children:[n.jsx(u.PopoverTrigger,{asChild:!0,children:n.jsx(u.ActionButton,{icon:t==null?void 0:t.icon,tooltip:t==null?void 0:t.tooltip})}),n.jsxs(u.PopoverContent,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:[n.jsx(u.Label,{className:"richtext-mb-[6px]",children:s("editor.formula.dialog.text")}),n.jsx("div",{className:"richtext-mb-[16px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm",children:n.jsx(w.Textarea,{autoFocus:!0,className:"richtext-w-full",defaultValue:i,onChange:g=>d(g.target.value),placeholder:"Text",required:!0,rows:3,value:a})})}),m&&n.jsx("div",{className:"richtext-my-[10px] richtext-max-w-[286px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]",children:m}),n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[n.jsx(u.Button,{className:"richtext-flex-1",onClick:p,children:"Submit"}),n.jsx("a",{href:"https://katex.org/docs/supported",rel:"noreferrer noopener",target:"_blank",children:n.jsx(j.HelpCircle,{size:16})})]})]})]})}function T(e,t=1){let s=0,o=0,i=0;if(e.startsWith("rgb")){const r=e.replace(/\s/g,"").match(/rgb\((.*)\)$/)[1].split(",");s=+r[0],o=+r[1],i=+r[2]}else if(e.startsWith("#")){let r=e.replace("#","");r.length===3&&(r=`${r[0]}${r[0]}${r[1]}${r[1]}${r[2]}${r[2]}`),s=Number.parseInt(r.substring(0,2),16),o=Number.parseInt(r.substring(2,4),16),i=Number.parseInt(r.substring(4,6),16)}else return e;return t>1&&t<=100&&(t=t/100),`rgba(${s},${o},${i},${t})`}function v({node:e}){const t=u.useTheme(),{text:s}=e.attrs,o=c.useMemo(()=>{const a="rgb(254, 242, 237)";return t==="dark"?T(a,.75):a},[t]),i=c.useMemo(()=>{try{return b.renderToString(`${s}`)}catch{return s}},[s]),r=c.useMemo(()=>s.trim()?n.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:i}}):n.jsx("span",{contentEditable:!1,children:"Not enter a formula"}),[s,i]);return n.jsx(f.NodeViewWrapper,{style:{display:"inline-block",backgroundColor:o},as:"span",children:r})}function N(e){return t=>t.getAttribute(e)}const x=l.Node.create({name:"katex",group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){return{HTMLAttributes:{class:"katex"},button:({editor:e,t})=>({component:$,componentProps:{editor:e,action:()=>!0,isActive:()=>!1,disabled:!1,icon:"KatexIcon",tooltip:t("editor.katex.tooltip")}})}},addAttributes(){return{text:{default:"",parseHTML:N("text")},defaultShowPicker:{default:!1}}},parseHTML(){return[{tag:"span.katex"}]},renderHTML({HTMLAttributes:e}){return["span",l.mergeAttributes(this.options&&this.options.HTMLAttributes||{},e)]},addCommands(){return{setKatex:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[l.nodeInputRule({find:/^\$katex\$$/,type:this.type,getAttributes:()=>({defaultShowPicker:!0})})]},addNodeView(){return f.ReactNodeViewRenderer(v)}});exports.Katex=x;
package/lib/Katex.d.cts CHANGED
@@ -46,11 +46,9 @@ declare module '@tiptap/core' {
46
46
 
47
47
  declare module '@tiptap/core' {
48
48
  interface Commands<ReturnType> {
49
- emoji: {
50
- setEmoji: (emoji: {
51
- name: string;
52
- emoji: string;
53
- }) => ReturnType;
49
+ drawer: {
50
+ setDrawer: (options: any, replace?: any) => ReturnType;
51
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
54
52
  };
55
53
  }
56
54
  }
@@ -58,9 +56,11 @@ declare module '@tiptap/core' {
58
56
 
59
57
  declare module '@tiptap/core' {
60
58
  interface Commands<ReturnType> {
61
- drawer: {
62
- setDrawer: (options: any, replace?: any) => ReturnType;
63
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
59
+ emoji: {
60
+ setEmoji: (emoji: {
61
+ name: string;
62
+ emoji: string;
63
+ }) => ReturnType;
64
64
  };
65
65
  }
66
66
  }
@@ -84,15 +84,6 @@ declare module '@tiptap/core' {
84
84
  }
85
85
 
86
86
 
87
- declare module '@tiptap/core' {
88
- interface Commands<ReturnType> {
89
- painter: {
90
- setPainter: (marks: Mark[]) => ReturnType;
91
- };
92
- }
93
- }
94
-
95
-
96
87
  declare module '@tiptap/core' {
97
88
  interface Commands<ReturnType> {
98
89
  fontSize: {
@@ -111,6 +102,15 @@ declare module '@tiptap/core' {
111
102
  }
112
103
 
113
104
 
105
+ declare module '@tiptap/core' {
106
+ interface Commands<ReturnType> {
107
+ painter: {
108
+ setPainter: (marks: Mark[]) => ReturnType;
109
+ };
110
+ }
111
+ }
112
+
113
+
114
114
  declare module '@tiptap/core' {
115
115
  interface Commands<ReturnType> {
116
116
  iframe: {
package/lib/Katex.d.ts CHANGED
@@ -46,11 +46,9 @@ declare module '@tiptap/core' {
46
46
 
47
47
  declare module '@tiptap/core' {
48
48
  interface Commands<ReturnType> {
49
- emoji: {
50
- setEmoji: (emoji: {
51
- name: string;
52
- emoji: string;
53
- }) => ReturnType;
49
+ drawer: {
50
+ setDrawer: (options: any, replace?: any) => ReturnType;
51
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
54
52
  };
55
53
  }
56
54
  }
@@ -58,9 +56,11 @@ declare module '@tiptap/core' {
58
56
 
59
57
  declare module '@tiptap/core' {
60
58
  interface Commands<ReturnType> {
61
- drawer: {
62
- setDrawer: (options: any, replace?: any) => ReturnType;
63
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
59
+ emoji: {
60
+ setEmoji: (emoji: {
61
+ name: string;
62
+ emoji: string;
63
+ }) => ReturnType;
64
64
  };
65
65
  }
66
66
  }
@@ -84,15 +84,6 @@ declare module '@tiptap/core' {
84
84
  }
85
85
 
86
86
 
87
- declare module '@tiptap/core' {
88
- interface Commands<ReturnType> {
89
- painter: {
90
- setPainter: (marks: Mark[]) => ReturnType;
91
- };
92
- }
93
- }
94
-
95
-
96
87
  declare module '@tiptap/core' {
97
88
  interface Commands<ReturnType> {
98
89
  fontSize: {
@@ -111,6 +102,15 @@ declare module '@tiptap/core' {
111
102
  }
112
103
 
113
104
 
105
+ declare module '@tiptap/core' {
106
+ interface Commands<ReturnType> {
107
+ painter: {
108
+ setPainter: (marks: Mark[]) => ReturnType;
109
+ };
110
+ }
111
+ }
112
+
113
+
114
114
  declare module '@tiptap/core' {
115
115
  interface Commands<ReturnType> {
116
116
  iframe: {
package/lib/Katex.js CHANGED
@@ -1,11 +1,11 @@
1
- import { N as b, n as g, m as w } from "./index-CXIIg9Sq.js";
2
- import { N as k, R as N } from "./dom-dataset-2RXYq9wp.js";
1
+ import { N as b, n as g, m as w } from "./index-BWx1Mchx.js";
2
+ import { N as k, R as N } from "./dom-dataset-CHDbKz5J.js";
3
3
  import { jsx as n, jsxs as u } from "react/jsx-runtime";
4
4
  import { useState as T, useCallback as $, useEffect as v, useMemo as c } from "react";
5
5
  import x from "katex";
6
6
  import { HelpCircle as A } from "lucide-react";
7
- import { O as S, P as L, m as P, A as C, n as H, L as I, B as M, Q as y } from "./RichTextEditor-CFwUKN9i.js";
8
- import { T as K } from "./textarea-D5VHsW3K.js";
7
+ import { O as S, P as L, m as P, A as C, n as H, L as I, B as M, Q as y } from "./RichTextEditor-OW4s40FH.js";
8
+ import { T as K } from "./textarea-DM-_io94.js";
9
9
  import { u as R } from "./index-D-DR0FPY.js";
10
10
  function V({ editor: t, ...e }) {
11
11
  const { t: a } = R(), o = S(t, h.name, {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-CSvnpArE.cjs"),g=require("./index-Dz3YxLE7.cjs"),c=require("react/jsx-runtime"),L=require("react"),u=require("./RichTextEditor-COwI-b24.cjs");function T(e){return Number.parseFloat(e.replace("%",""))/100}function x(e){const{t}=g.useLocale(),[n,r]=L.useState("default");function o(i){i==="default"?e.editor.commands.unsetLineHeight():e.editor.commands.setLineHeight(i),r(i)}const d=L.useMemo(()=>{const s=e.editor.extensionManager.extensions.find(l=>l.name==="lineHeight").options.lineHeights.map(l=>({label:T(l),value:l}));return s.unshift({label:t("editor.default"),value:"default"}),s},[e]);return c.jsxs(u.DropdownMenu,{children:[c.jsx(u.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:c.jsx(u.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:e==null?void 0:e.disabled,icon:"LineHeight",tooltip:e==null?void 0:e.tooltip,children:c.jsx(u.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),c.jsx(u.DropdownMenuContent,{className:"richtext-min-w-24",children:d==null?void 0:d.map((i,h)=>c.jsx(u.DropdownMenuCheckboxItem,{checked:i.value===n,onClick:()=>o(i.value),children:i.label},`lineHeight-${h}`))})]})}const _=["paragraph","heading","list_item","todo_item"];function E(e,t){const{selection:n,doc:r}=e;if(!n||!r||!(n instanceof m.TextSelection||n instanceof m.AllSelection))return e;const{from:o,to:d}=n,i=[],h=t&&t!==g.DEFAULT_LINE_HEIGHT?t:null;if(r.nodesBetween(o,d,(s,l)=>{const a=s.type;return _.includes(a.name)?((s.attrs.lineHeight||null)!==h&&i.push({node:s,pos:l,nodeType:a}),a.name!=="list_item"&&a.name!=="todo_item"):!0}),i.length===0)return e;for(const s of i){const{node:l,pos:a,nodeType:f}=s;let{attrs:H}=l;H={...H,lineHeight:h},e=e.setNodeMarkup(a,f,H,l.marks)}return e}function I(e){return({state:t,dispatch:n})=>{const{selection:r}=t;let{tr:o}=t;return o=o.setSelection(r),o=E(o,e),o.docChanged?(n&&n(o),!0):!1}}const b=m.Extension.create({name:"lineHeight",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:g.DEFAULT_LINE_HEIGHT_LIST,defaultHeight:g.DEFAULT_LINE_HEIGHT,button({editor:t,t:n}){return{component:x,componentProps:{editor:t,tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight||this.options.defaultHeight,renderHTML:e=>e.lineHeight===this.options.defaultHeight||!e.lineHeight?{}:{style:`line-height: ${e.lineHeight}`}}}}]},addCommands(){return{setLineHeight:e=>I(e),unsetLineHeight:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"lineHeight"))}}});exports.DEFAULT_LINE_HEIGHT_LIST=g.DEFAULT_LINE_HEIGHT_LIST;exports.LineHeight=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-CSvnpArE.cjs"),g=require("./index-Dz3YxLE7.cjs"),c=require("react/jsx-runtime"),L=require("react"),u=require("./RichTextEditor-C3sK_Ys3.cjs");function T(e){return Number.parseFloat(e.replace("%",""))/100}function x(e){const{t}=g.useLocale(),[n,r]=L.useState("default");function o(i){i==="default"?e.editor.commands.unsetLineHeight():e.editor.commands.setLineHeight(i),r(i)}const d=L.useMemo(()=>{const s=e.editor.extensionManager.extensions.find(l=>l.name==="lineHeight").options.lineHeights.map(l=>({label:T(l),value:l}));return s.unshift({label:t("editor.default"),value:"default"}),s},[e]);return c.jsxs(u.DropdownMenu,{children:[c.jsx(u.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:c.jsx(u.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:e==null?void 0:e.disabled,icon:"LineHeight",tooltip:e==null?void 0:e.tooltip,children:c.jsx(u.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),c.jsx(u.DropdownMenuContent,{className:"richtext-min-w-24",children:d==null?void 0:d.map((i,h)=>c.jsx(u.DropdownMenuCheckboxItem,{checked:i.value===n,onClick:()=>o(i.value),children:i.label},`lineHeight-${h}`))})]})}const _=["paragraph","heading","list_item","todo_item"];function E(e,t){const{selection:n,doc:r}=e;if(!n||!r||!(n instanceof m.TextSelection||n instanceof m.AllSelection))return e;const{from:o,to:d}=n,i=[],h=t&&t!==g.DEFAULT_LINE_HEIGHT?t:null;if(r.nodesBetween(o,d,(s,l)=>{const a=s.type;return _.includes(a.name)?((s.attrs.lineHeight||null)!==h&&i.push({node:s,pos:l,nodeType:a}),a.name!=="list_item"&&a.name!=="todo_item"):!0}),i.length===0)return e;for(const s of i){const{node:l,pos:a,nodeType:f}=s;let{attrs:H}=l;H={...H,lineHeight:h},e=e.setNodeMarkup(a,f,H,l.marks)}return e}function b(e){return({state:t,dispatch:n})=>{const{selection:r}=t;let{tr:o}=t;return o=o.setSelection(r),o=E(o,e),o.docChanged?(n&&n(o),!0):!1}}const I=m.Extension.create({name:"lineHeight",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:g.DEFAULT_LINE_HEIGHT_LIST,defaultHeight:g.DEFAULT_LINE_HEIGHT,button({editor:t,t:n}){return{component:x,componentProps:{editor:t,tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight||this.options.defaultHeight,renderHTML:e=>e.lineHeight===this.options.defaultHeight||!e.lineHeight?{}:{style:`line-height: ${e.lineHeight}`}}}}]},addCommands(){return{setLineHeight:e=>b(e),unsetLineHeight:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"lineHeight"))}}});exports.DEFAULT_LINE_HEIGHT_LIST=g.DEFAULT_LINE_HEIGHT_LIST;exports.LineHeight=I;
@@ -114,11 +114,9 @@ declare module '@tiptap/core' {
114
114
 
115
115
  declare module '@tiptap/core' {
116
116
  interface Commands<ReturnType> {
117
- emoji: {
118
- setEmoji: (emoji: {
119
- name: string;
120
- emoji: string;
121
- }) => ReturnType;
117
+ drawer: {
118
+ setDrawer: (options: any, replace?: any) => ReturnType;
119
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
122
120
  };
123
121
  }
124
122
  }
@@ -126,9 +124,11 @@ declare module '@tiptap/core' {
126
124
 
127
125
  declare module '@tiptap/core' {
128
126
  interface Commands<ReturnType> {
129
- drawer: {
130
- setDrawer: (options: any, replace?: any) => ReturnType;
131
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
127
+ emoji: {
128
+ setEmoji: (emoji: {
129
+ name: string;
130
+ emoji: string;
131
+ }) => ReturnType;
132
132
  };
133
133
  }
134
134
  }
@@ -152,15 +152,6 @@ declare module '@tiptap/core' {
152
152
  }
153
153
 
154
154
 
155
- declare module '@tiptap/core' {
156
- interface Commands<ReturnType> {
157
- painter: {
158
- setPainter: (marks: Mark[]) => ReturnType;
159
- };
160
- }
161
- }
162
-
163
-
164
155
  declare module '@tiptap/core' {
165
156
  interface Commands<ReturnType> {
166
157
  fontSize: {
@@ -179,6 +170,15 @@ declare module '@tiptap/core' {
179
170
  }
180
171
 
181
172
 
173
+ declare module '@tiptap/core' {
174
+ interface Commands<ReturnType> {
175
+ painter: {
176
+ setPainter: (marks: Mark[]) => ReturnType;
177
+ };
178
+ }
179
+ }
180
+
181
+
182
182
  declare module '@tiptap/core' {
183
183
  interface Commands<ReturnType> {
184
184
  iframe: {
@@ -114,11 +114,9 @@ declare module '@tiptap/core' {
114
114
 
115
115
  declare module '@tiptap/core' {
116
116
  interface Commands<ReturnType> {
117
- emoji: {
118
- setEmoji: (emoji: {
119
- name: string;
120
- emoji: string;
121
- }) => ReturnType;
117
+ drawer: {
118
+ setDrawer: (options: any, replace?: any) => ReturnType;
119
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
122
120
  };
123
121
  }
124
122
  }
@@ -126,9 +124,11 @@ declare module '@tiptap/core' {
126
124
 
127
125
  declare module '@tiptap/core' {
128
126
  interface Commands<ReturnType> {
129
- drawer: {
130
- setDrawer: (options: any, replace?: any) => ReturnType;
131
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
127
+ emoji: {
128
+ setEmoji: (emoji: {
129
+ name: string;
130
+ emoji: string;
131
+ }) => ReturnType;
132
132
  };
133
133
  }
134
134
  }
@@ -152,15 +152,6 @@ declare module '@tiptap/core' {
152
152
  }
153
153
 
154
154
 
155
- declare module '@tiptap/core' {
156
- interface Commands<ReturnType> {
157
- painter: {
158
- setPainter: (marks: Mark[]) => ReturnType;
159
- };
160
- }
161
- }
162
-
163
-
164
155
  declare module '@tiptap/core' {
165
156
  interface Commands<ReturnType> {
166
157
  fontSize: {
@@ -179,6 +170,15 @@ declare module '@tiptap/core' {
179
170
  }
180
171
 
181
172
 
173
+ declare module '@tiptap/core' {
174
+ interface Commands<ReturnType> {
175
+ painter: {
176
+ setPainter: (marks: Mark[]) => ReturnType;
177
+ };
178
+ }
179
+ }
180
+
181
+
182
182
  declare module '@tiptap/core' {
183
183
  interface Commands<ReturnType> {
184
184
  iframe: {
package/lib/LineHeight.js CHANGED
@@ -1,8 +1,8 @@
1
- import { T as f, A as H, E as L } from "./index-CXIIg9Sq.js";
1
+ import { T as f, A as H, E as L } from "./index-BWx1Mchx.js";
2
2
  import { u as x, j as m, k as T } from "./index-D-DR0FPY.js";
3
3
  import { jsxs as b, jsx as h } from "react/jsx-runtime";
4
4
  import { useState as p, useMemo as _ } from "react";
5
- import { D, e as E, A as M, k as w, f as A, h as C } from "./RichTextEditor-CFwUKN9i.js";
5
+ import { D, e as E, A as M, k as w, f as A, h as C } from "./RichTextEditor-OW4s40FH.js";
6
6
  function y(e) {
7
7
  return Number.parseFloat(e.replace("%", "")) / 100;
8
8
  }