reactjs-tiptap-editor 0.2.29 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/lib/ActionMenuButton-BllDdN2-.js +33 -0
  2. package/lib/ActionMenuButton-tLPdHfCT.cjs +1 -0
  3. package/lib/Attachment.cjs +19 -0
  4. package/lib/Attachment.d.cts +344 -0
  5. package/lib/Attachment.d.ts +344 -0
  6. package/lib/Attachment.js +259 -0
  7. package/lib/Blockquote.cjs +1 -0
  8. package/lib/Blockquote.d.cts +343 -0
  9. package/lib/Blockquote.d.ts +343 -0
  10. package/lib/Blockquote.js +65 -0
  11. package/lib/Bold.cjs +1 -0
  12. package/lib/Bold.d.cts +343 -0
  13. package/lib/Bold.d.ts +343 -0
  14. package/lib/Bold.js +90 -0
  15. package/lib/BulletList.cjs +1 -0
  16. package/lib/BulletList.d.cts +343 -0
  17. package/lib/BulletList.d.ts +343 -0
  18. package/lib/BulletList.js +72 -0
  19. package/lib/Clear.cjs +1 -0
  20. package/lib/Clear.d.cts +342 -0
  21. package/lib/Clear.d.ts +342 -0
  22. package/lib/Clear.js +23 -0
  23. package/lib/Code.cjs +1 -0
  24. package/lib/Code.d.cts +343 -0
  25. package/lib/Code.d.ts +343 -0
  26. package/lib/Code.js +70 -0
  27. package/lib/CodeBlock.cjs +44 -0
  28. package/lib/CodeBlock.d.cts +352 -0
  29. package/lib/CodeBlock.d.ts +352 -0
  30. package/lib/CodeBlock.js +4189 -0
  31. package/lib/Color.cjs +1 -0
  32. package/lib/Color.d.cts +350 -0
  33. package/lib/Color.d.ts +350 -0
  34. package/lib/Color.js +141 -0
  35. package/lib/Document.cjs +1 -0
  36. package/lib/Document.d.cts +272 -0
  37. package/lib/Document.d.ts +272 -0
  38. package/lib/Document.js +13 -0
  39. package/lib/Drawer-BBmEHEAp.cjs +1 -0
  40. package/lib/Drawer-hyBIiEP6.js +1367 -0
  41. package/lib/Drawer.cjs +1 -0
  42. package/lib/Drawer.d.cts +344 -0
  43. package/lib/Drawer.d.ts +344 -0
  44. package/lib/Drawer.js +7 -0
  45. package/lib/Emoji.cjs +1 -0
  46. package/lib/Emoji.d.cts +277 -0
  47. package/lib/Emoji.d.ts +277 -0
  48. package/lib/Emoji.js +2168 -0
  49. package/lib/Excalidraw-BQ2PeAoa.js +651 -0
  50. package/lib/Excalidraw-Cd01zFJl.cjs +1 -0
  51. package/lib/Excalidraw.cjs +1 -0
  52. package/lib/Excalidraw.d.cts +278 -0
  53. package/lib/Excalidraw.d.ts +278 -0
  54. package/lib/Excalidraw.js +6 -0
  55. package/lib/ExportPdf.cjs +15 -0
  56. package/lib/ExportPdf.d.cts +270 -0
  57. package/lib/ExportPdf.d.ts +270 -0
  58. package/lib/ExportPdf.js +67 -0
  59. package/lib/ExportWord.cjs +1 -0
  60. package/lib/ExportWord.d.cts +341 -0
  61. package/lib/ExportWord.d.ts +341 -0
  62. package/lib/ExportWord.js +72 -0
  63. package/lib/FontFamily.cjs +1 -0
  64. package/lib/FontFamily.d.cts +354 -0
  65. package/lib/FontFamily.d.ts +354 -0
  66. package/lib/FontFamily.js +136 -0
  67. package/lib/FontSize.cjs +1 -0
  68. package/lib/FontSize.d.cts +359 -0
  69. package/lib/FontSize.d.ts +359 -0
  70. package/lib/FontSize.js +110 -0
  71. package/lib/FormatPainter.cjs +1 -0
  72. package/lib/FormatPainter.d.cts +353 -0
  73. package/lib/FormatPainter.d.ts +353 -0
  74. package/lib/FormatPainter.js +74 -0
  75. package/lib/Heading.cjs +1 -0
  76. package/lib/Heading.d.cts +343 -0
  77. package/lib/Heading.d.ts +343 -0
  78. package/lib/Heading.js +147 -0
  79. package/lib/Highlight.cjs +1 -0
  80. package/lib/Highlight.d.cts +344 -0
  81. package/lib/Highlight.d.ts +344 -0
  82. package/lib/Highlight.js +85 -0
  83. package/lib/History.cjs +1 -0
  84. package/lib/History.d.cts +343 -0
  85. package/lib/History.d.ts +343 -0
  86. package/lib/History.js +431 -0
  87. package/lib/HorizontalRule.cjs +1 -0
  88. package/lib/HorizontalRule.d.cts +343 -0
  89. package/lib/HorizontalRule.d.ts +343 -0
  90. package/lib/HorizontalRule.js +87 -0
  91. package/lib/Iframe.cjs +1 -0
  92. package/lib/Iframe.d.cts +277 -0
  93. package/lib/Iframe.d.ts +277 -0
  94. package/lib/Iframe.js +6 -0
  95. package/lib/Image.cjs +1 -0
  96. package/lib/Image.d.cts +370 -0
  97. package/lib/Image.d.ts +370 -0
  98. package/lib/Image.js +7 -0
  99. package/lib/ImageGif.cjs +1 -0
  100. package/lib/ImageGif.d.cts +292 -0
  101. package/lib/ImageGif.d.ts +292 -0
  102. package/lib/ImageGif.js +7 -0
  103. package/lib/ImportWord.cjs +231 -0
  104. package/lib/ImportWord.d.cts +353 -0
  105. package/lib/ImportWord.d.ts +353 -0
  106. package/lib/ImportWord.js +16620 -0
  107. package/lib/Indent.cjs +1 -0
  108. package/lib/Indent.d.cts +344 -0
  109. package/lib/Indent.d.ts +344 -0
  110. package/lib/Indent.js +78 -0
  111. package/lib/Italic.cjs +1 -0
  112. package/lib/Italic.d.cts +343 -0
  113. package/lib/Italic.d.ts +343 -0
  114. package/lib/Italic.js +91 -0
  115. package/lib/Katex.cjs +1 -0
  116. package/lib/Katex.d.cts +279 -0
  117. package/lib/Katex.d.ts +279 -0
  118. package/lib/Katex.js +197 -0
  119. package/lib/LineHeight.cjs +1 -0
  120. package/lib/LineHeight.d.cts +347 -0
  121. package/lib/LineHeight.d.ts +347 -0
  122. package/lib/LineHeight.js +137 -0
  123. package/lib/Link.cjs +5 -0
  124. package/lib/Link.d.cts +343 -0
  125. package/lib/Link.d.ts +343 -0
  126. package/lib/Link.js +1048 -0
  127. package/lib/ListItem.cjs +1 -0
  128. package/lib/ListItem.d.cts +269 -0
  129. package/lib/ListItem.d.ts +269 -0
  130. package/lib/ListItem.js +33 -0
  131. package/lib/Mention.cjs +1 -0
  132. package/lib/Mention.d.cts +272 -0
  133. package/lib/Mention.d.ts +272 -0
  134. package/lib/Mention.js +233 -0
  135. package/lib/Mermaid.cjs +2 -0
  136. package/lib/Mermaid.d.cts +344 -0
  137. package/lib/Mermaid.d.ts +344 -0
  138. package/lib/Mermaid.js +390 -0
  139. package/lib/MoreMark.cjs +1 -0
  140. package/lib/MoreMark.d.cts +355 -0
  141. package/lib/MoreMark.d.ts +355 -0
  142. package/lib/MoreMark.js +95 -0
  143. package/lib/MultiColumn.cjs +1 -0
  144. package/lib/MultiColumn.d.cts +277 -0
  145. package/lib/MultiColumn.d.ts +277 -0
  146. package/lib/MultiColumn.js +8 -0
  147. package/lib/OrderedList.cjs +1 -0
  148. package/lib/OrderedList.d.cts +343 -0
  149. package/lib/OrderedList.d.ts +343 -0
  150. package/lib/OrderedList.js +90 -0
  151. package/lib/RichTextEditor-CM-Xq9RS.cjs +137 -0
  152. package/lib/RichTextEditor-DvrUVNK2.js +11417 -0
  153. package/lib/SearchAndReplace.cjs +1 -0
  154. package/lib/SearchAndReplace.d.cts +358 -0
  155. package/lib/SearchAndReplace.d.ts +358 -0
  156. package/lib/SearchAndReplace.js +339 -0
  157. package/lib/Selection.cjs +1 -0
  158. package/lib/Selection.d.cts +272 -0
  159. package/lib/Selection.d.ts +272 -0
  160. package/lib/Selection.js +25 -0
  161. package/lib/SlashCommand.cjs +1 -0
  162. package/lib/SlashCommand.d.cts +299 -0
  163. package/lib/SlashCommand.d.ts +299 -0
  164. package/lib/SlashCommand.js +369 -0
  165. package/lib/Strike.cjs +1 -0
  166. package/lib/Strike.d.cts +343 -0
  167. package/lib/Strike.d.ts +343 -0
  168. package/lib/Strike.js +80 -0
  169. package/lib/SubAndSuperScript.cjs +1 -0
  170. package/lib/SubAndSuperScript.d.cts +358 -0
  171. package/lib/SubAndSuperScript.d.ts +358 -0
  172. package/lib/SubAndSuperScript.js +41 -0
  173. package/lib/Table.cjs +1 -0
  174. package/lib/Table.d.cts +366 -0
  175. package/lib/Table.d.ts +366 -0
  176. package/lib/Table.js +2165 -0
  177. package/lib/TableOfContent.cjs +1 -0
  178. package/lib/TableOfContent.d.cts +274 -0
  179. package/lib/TableOfContent.d.ts +274 -0
  180. package/lib/TableOfContent.js +184 -0
  181. package/lib/TaskList.cjs +1 -0
  182. package/lib/TaskList.d.cts +349 -0
  183. package/lib/TaskList.d.ts +349 -0
  184. package/lib/TaskList.js +175 -0
  185. package/lib/TextAlign.cjs +1 -0
  186. package/lib/TextAlign.d.cts +353 -0
  187. package/lib/TextAlign.d.ts +353 -0
  188. package/lib/TextAlign.js +165 -0
  189. package/lib/TextBubble.cjs +1 -0
  190. package/lib/TextBubble.d.cts +343 -0
  191. package/lib/TextBubble.d.ts +343 -0
  192. package/lib/TextBubble.js +131 -0
  193. package/lib/TextDirection.cjs +1 -0
  194. package/lib/TextDirection.d.cts +270 -0
  195. package/lib/TextDirection.d.ts +270 -0
  196. package/lib/TextDirection.js +142 -0
  197. package/lib/TextUnderline.cjs +1 -0
  198. package/lib/TextUnderline.d.cts +343 -0
  199. package/lib/TextUnderline.d.ts +343 -0
  200. package/lib/TextUnderline.js +61 -0
  201. package/lib/TrailingNode.cjs +1 -0
  202. package/lib/TrailingNode.d.cts +280 -0
  203. package/lib/TrailingNode.d.ts +280 -0
  204. package/lib/TrailingNode.js +41 -0
  205. package/lib/Twitter-BuMkJKBq.cjs +17 -0
  206. package/lib/Twitter-BvdxYuDK.js +1743 -0
  207. package/lib/Twitter.cjs +1 -0
  208. package/lib/Twitter.d.cts +295 -0
  209. package/lib/Twitter.d.ts +295 -0
  210. package/lib/Twitter.js +6 -0
  211. package/lib/Video.cjs +1 -0
  212. package/lib/Video.d.cts +371 -0
  213. package/lib/Video.d.ts +371 -0
  214. package/lib/Video.js +6 -0
  215. package/lib/bubble-extra.cjs +2 -0
  216. package/lib/bubble-extra.d.cts +294 -0
  217. package/lib/bubble-extra.d.ts +294 -0
  218. package/lib/bubble-extra.js +623 -0
  219. package/lib/dom-dataset-CAXnsjYE.cjs +33 -0
  220. package/lib/dom-dataset-CJ7GyQ2E.js +999 -0
  221. package/lib/index-COecBbaE.cjs +89 -0
  222. package/lib/index-ClFtfQ0J.cjs +1 -0
  223. package/lib/index-CvYIX2-x.js +129 -0
  224. package/lib/index-CySbCeQd.cjs +1 -0
  225. package/lib/{index-CO-iymkb.js → index-D9llIWB5.js} +442 -101
  226. package/lib/index-DXBa3JBo.js +46 -0
  227. package/lib/index-DjP7Onch.cjs +1 -0
  228. package/lib/index-Drmyqk9P.js +12322 -0
  229. package/lib/index-DuhDIOel.js +76 -0
  230. package/lib/index-LbrE7K9i.cjs +1 -0
  231. package/lib/index.cjs +2 -1
  232. package/lib/index.d.cts +290 -108
  233. package/lib/index.d.ts +290 -108
  234. package/lib/index.js +587 -13
  235. package/lib/locale-bundle.cjs +1 -1
  236. package/lib/locale-bundle.d.cts +108 -108
  237. package/lib/locale-bundle.d.ts +108 -108
  238. package/lib/locale-bundle.js +1 -1
  239. package/lib/shortId-Bfj8TyNr.cjs +2 -0
  240. package/lib/shortId-WJVkrvml.js +30 -0
  241. package/lib/style.css +1 -1
  242. package/lib/textarea-B172kMgC.js +20 -0
  243. package/lib/textarea-CapyElEP.cjs +1 -0
  244. package/package.json +678 -15
  245. package/lib/RichTextEditor-Ce2IeNE6.js +0 -8265
  246. package/lib/RichTextEditor-hDDApaDD.cjs +0 -136
  247. package/lib/extension-bundle.cjs +0 -33
  248. package/lib/extension-bundle.d.cts +0 -951
  249. package/lib/extension-bundle.d.ts +0 -951
  250. package/lib/extension-bundle.js +0 -5982
  251. package/lib/index-CJ6Hb9MN.cjs +0 -1
  252. package/lib/tiptap-DOP8lVCQ.js +0 -5950
  253. package/lib/tiptap-Dq62HiQ9.cjs +0 -113
  254. package/lib/vendor-BbgkyoD-.js +0 -40297
  255. package/lib/vendor-DdwtMmSr.cjs +0 -302
@@ -0,0 +1,184 @@
1
+ import { N as b, m as v } from "./index-Drmyqk9P.js";
2
+ import { N as C, c as g, R as N } from "./dom-dataset-CJ7GyQ2E.js";
3
+ import { jsx as l, jsxs as T } from "react/jsx-runtime";
4
+ import { useState as p, useCallback as m, useEffect as d } from "react";
5
+ import { u as O } from "./index-D9llIWB5.js";
6
+ import { _, A as y } from "./RichTextEditor-DvrUVNK2.js";
7
+ const x = "_toc_aag8a_1", A = "_visible_aag8a_7", w = "_list_aag8a_11", E = "_item_aag8a_16", f = {
8
+ toc: x,
9
+ visible: A,
10
+ list: w,
11
+ item: E
12
+ };
13
+ function k(t) {
14
+ const o = [], a = [o];
15
+ return t.forEach((n) => {
16
+ let e = -1, s = a[n.level + e];
17
+ for (; !s; )
18
+ e -= 1, s = a[n.level + e];
19
+ s.push({ ...n, children: a[n.level] = [] });
20
+ }), o;
21
+ }
22
+ function M({ editor: t }) {
23
+ const o = _(), [a, n] = p([]), { t: e } = O(), s = m(() => {
24
+ const i = [], r = t.state.tr;
25
+ t.state.doc.descendants((c, h) => {
26
+ if (c.type.name === "heading") {
27
+ const u = `heading-${i.length + 1}`;
28
+ c.attrs.id !== u && r.setNodeMarkup(h, void 0, {
29
+ ...c.attrs,
30
+ id: u
31
+ }), i.push({
32
+ level: c.attrs.level,
33
+ text: c.textContent,
34
+ id: u
35
+ });
36
+ }
37
+ }), r.setMeta("addToHistory", !1), r.setMeta("preventUpdate", !0), t.view.dispatch(r), n(i), t.eventEmitter && t.eventEmitter.emit("TableOfContents", k(i));
38
+ }, [t]);
39
+ return d(() => {
40
+ if (t) {
41
+ if (!t.options.editable) {
42
+ s();
43
+ return;
44
+ }
45
+ return t.on("update", s), () => {
46
+ t.off("update", s);
47
+ };
48
+ }
49
+ }, [t, s]), d(() => {
50
+ s();
51
+ }, []), /* @__PURE__ */ l(C, { className: g("tableOfContent", f.toc, o && f.visible), children: o ? /* @__PURE__ */ T("div", { style: { position: "relative" }, children: [
52
+ /* @__PURE__ */ l("p", { className: "text-[20px] richtext-mb-[8px] richtext-font-semibold", children: e("editor.table_of_content") }),
53
+ /* @__PURE__ */ l("ul", { className: f.list, children: a.map((i, r) => /* @__PURE__ */ l(
54
+ "li",
55
+ {
56
+ className: f.item,
57
+ style: { paddingLeft: `${i.level - 1}rem` },
58
+ children: /* @__PURE__ */ l("a", { href: `#${i.id}`, children: i.text })
59
+ },
60
+ `table-of-content-${r}`
61
+ )) })
62
+ ] }) : null });
63
+ }
64
+ function B(t, ...o) {
65
+ const [a, n] = p(!1);
66
+ return d(() => {
67
+ const e = () => {
68
+ n(t.isActive.apply(t, o));
69
+ };
70
+ return t.on("selectionUpdate", e), t.on("transaction", e), () => {
71
+ t.off("selectionUpdate", e), t.off("transaction", e);
72
+ };
73
+ }, [t, o, n]), a;
74
+ }
75
+ function H({ editor: t, icon: o, tooltip: a }) {
76
+ const n = B(t, z.name), e = m(() => {
77
+ if (n) {
78
+ t.chain().focus().removeTableOfContents().run();
79
+ return;
80
+ }
81
+ t.chain().focus().setTableOfContents().run();
82
+ }, [t, n]);
83
+ return /* @__PURE__ */ l(
84
+ y,
85
+ {
86
+ action: e,
87
+ isActive: () => n || !1,
88
+ icon: o,
89
+ tooltip: a
90
+ }
91
+ );
92
+ }
93
+ function L(t) {
94
+ return t && t.type.name === "title";
95
+ }
96
+ function S(t, o) {
97
+ const n = [t.getJSON()], e = [];
98
+ for (; n.length > 0; ) {
99
+ const s = n.shift();
100
+ s.type === o && e.push(s), s.content && s.content.length > 0 && n.push(...s.content);
101
+ }
102
+ return e;
103
+ }
104
+ const z = /* @__PURE__ */ b.create({
105
+ name: "tableOfContents",
106
+ group: "block",
107
+ atom: !0,
108
+ addOptions() {
109
+ var t;
110
+ return {
111
+ ...(t = this.parent) == null ? void 0 : t.call(this),
112
+ onHasOneBeforeInsert: () => {
113
+ },
114
+ resizable: !0,
115
+ lastColumnResizable: !0,
116
+ allowTableNodeSelection: !1,
117
+ button: ({ editor: o, t: a }) => ({
118
+ component: H,
119
+ componentProps: {
120
+ disabled: !1,
121
+ icon: "BookMarked",
122
+ tooltip: a("editor.table.tooltip"),
123
+ editor: o
124
+ }
125
+ })
126
+ };
127
+ },
128
+ parseHTML() {
129
+ return [
130
+ {
131
+ tag: "toc"
132
+ }
133
+ ];
134
+ },
135
+ renderHTML({ HTMLAttributes: t }) {
136
+ return ["toc", v(t)];
137
+ },
138
+ addNodeView() {
139
+ return N(M);
140
+ },
141
+ // @ts-expect-error
142
+ addCommands() {
143
+ return {
144
+ setTableOfContents: () => ({ commands: t, editor: o, view: a }) => {
145
+ if (S(o, this.name).length > 0) {
146
+ this.options.onHasOneBeforeInsert();
147
+ return;
148
+ }
149
+ const e = a.props.state.doc.content.firstChild;
150
+ if (L(e)) {
151
+ const s = (e.firstChild && e.firstChild.nodeSize || 0) + 1;
152
+ return t.insertContentAt(s, { type: this.name });
153
+ }
154
+ return t.insertContent({
155
+ type: this.name
156
+ });
157
+ },
158
+ removeTableOfContents: () => ({ state: t, dispatch: o }) => {
159
+ const { tr: a } = t, n = t.schema.nodes.tableOfContents;
160
+ return t.doc.descendants((e, s) => {
161
+ if (e.type === n) {
162
+ const i = s, r = s + e.nodeSize;
163
+ a.delete(i, r);
164
+ }
165
+ }), a.docChanged ? (o(a), !0) : !1;
166
+ }
167
+ };
168
+ },
169
+ addGlobalAttributes() {
170
+ return [
171
+ {
172
+ types: ["heading"],
173
+ attributes: {
174
+ id: {
175
+ default: null
176
+ }
177
+ }
178
+ }
179
+ ];
180
+ }
181
+ });
182
+ export {
183
+ z as TableOfContents
184
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-COecBbaE.cjs"),k=require("./RichTextEditor-CM-Xq9RS.cjs"),b=/^\s*(\[([( |x])?\])\s$/,f=a.Node.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const n=t.getAttribute("data-checked");return n===""||n==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:n}){return["li",a.mergeAttributes(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:n,getPos:c,editor:o})=>{const i=document.createElement("li"),d=document.createElement("label"),m=document.createElement("span"),s=document.createElement("input"),p=document.createElement("div");return d.contentEditable="false",s.type="checkbox",s.addEventListener("mousedown",e=>e.preventDefault()),s.addEventListener("change",e=>{if(!o.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}const{checked:r}=e.target;o.isEditable&&typeof c=="function"&&o.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:l})=>{const u=c();if(typeof u!="number")return!1;const h=l.doc.nodeAt(u);return l.setNodeMarkup(u,void 0,{...h==null?void 0:h.attrs,checked:r}),!0}).run(),!o.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,r)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,r])=>{i.setAttribute(e,r)}),i.dataset.checked=t.attrs.checked,s.checked=t.attrs.checked,d.append(s,m),i.append(d,p),Object.entries(n).forEach(([e,r])=>{i.setAttribute(e,r)}),{dom:i,contentDOM:p,update:e=>e.type!==this.type?!1:(i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,!0)}}},addInputRules(){return[a.wrappingInputRule({find:b,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),L=a.Node.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",a.mergeAttributes(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),T=L.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"task-list"},taskItem:{HTMLAttributes:{class:"task-list-item"}},button:({editor:n,t:c})=>({component:k.ActionButton,componentProps:{action:()=>n.commands.toggleTaskList(),isActive:()=>n.isActive("taskList")||!1,disabled:!1,icon:"ListTodo",shortcutKeys:["shift","mod","9"],tooltip:c("editor.tasklist.tooltip")}})}},addExtensions(){return[f.configure(this.options.taskItem)]}});exports.TaskList=T;
@@ -0,0 +1,349 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { Extension } from '@tiptap/core';
3
+ import { Node as Node_2 } from '@tiptap/core';
4
+ import { TaskItemOptions } from '@tiptap/extension-task-item';
5
+ import { TaskListOptions as TaskListOptions_2 } from '@tiptap/extension-task-list';
6
+
7
+ /**
8
+ * Represents the ButtonView function.
9
+ */
10
+ declare type ButtonView<T = any> = (options: ButtonViewParams<T>) => ButtonViewReturn | ButtonViewReturn[];
11
+
12
+ /**
13
+ * Represents the parameters for the ButtonView function.
14
+ */
15
+ declare interface ButtonViewParams<T = any> {
16
+ /** Editor object */
17
+ editor: Editor;
18
+ /** Extension object */
19
+ extension: Extension<T>;
20
+ /** Translation function */
21
+ t: (path: string) => string;
22
+ }
23
+
24
+ /**
25
+ * Represents the return value for the ButtonView component.
26
+ */
27
+ declare interface ButtonViewReturn {
28
+ /** Component */
29
+ component: unknown;
30
+ /** Component props */
31
+ componentProps: ButtonViewReturnComponentProps;
32
+ /** Component slots */
33
+ componentSlots?: ButtonViewReturnComponentSlots;
34
+ }
35
+
36
+ /**
37
+ * Represents the props for the ButtonView component.
38
+ */
39
+ declare interface ButtonViewReturnComponentProps {
40
+ /** Method triggered when action is performed */
41
+ action?: (value?: any) => void;
42
+ /** Whether it is in the active state */
43
+ isActive?: () => boolean;
44
+ /** Button icon */
45
+ icon?: any;
46
+ /** Text displayed on hover */
47
+ tooltip?: string;
48
+ [x: string]: any;
49
+ }
50
+
51
+ /**
52
+ * Represents the slots for the ButtonView component.
53
+ */
54
+ declare interface ButtonViewReturnComponentSlots {
55
+ /** Dialog slot */
56
+ dialog: () => any;
57
+ [x: string]: () => any;
58
+ }
59
+
60
+ /**
61
+ * Represents the general options for Tiptap extensions.
62
+ */
63
+ declare interface GeneralOptions<T> {
64
+ /** Enabled divider */
65
+ divider: boolean;
66
+ /** Enabled spacer */
67
+ spacer: boolean;
68
+ /** Button view function */
69
+ button: ButtonView<T>;
70
+ /** Show on Toolbar */
71
+ toolbar?: boolean;
72
+ }
73
+
74
+ export declare const TaskList: Node_2<TaskListOptions, any>;
75
+
76
+ /**
77
+ * Represents the interface for task list options, extending TiptapTaskListOptions and GeneralOptions.
78
+ */
79
+ export declare interface TaskListOptions extends TaskListOptions_2, GeneralOptions<TaskListOptions> {
80
+ /** options for task items */
81
+ taskItem: Partial<TaskItemOptions>;
82
+ }
83
+
84
+ export { }
85
+
86
+
87
+ declare module '@tiptap/core' {
88
+ interface Commands<ReturnType> {
89
+ attachment: {
90
+ setAttachment: (attrs?: unknown) => ReturnType;
91
+ };
92
+ }
93
+ }
94
+
95
+
96
+ declare module '@tiptap/core' {
97
+ interface Commands<ReturnType> {
98
+ setCodeBlock: {
99
+ setCodeBlock: (options?: any) => ReturnType;
100
+ };
101
+ }
102
+ }
103
+
104
+
105
+ declare module '@tiptap/core' {
106
+ interface Commands<ReturnType> {
107
+ drawer: {
108
+ setDrawer: (options: any, replace?: any) => ReturnType;
109
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
110
+ };
111
+ }
112
+ }
113
+
114
+
115
+ declare module '@tiptap/core' {
116
+ interface Commands<ReturnType> {
117
+ emoji: {
118
+ setEmoji: (emoji: {
119
+ name: string;
120
+ emoji: string;
121
+ }) => ReturnType;
122
+ };
123
+ }
124
+ }
125
+
126
+
127
+ declare module '@tiptap/core' {
128
+ interface Commands<ReturnType> {
129
+ excalidraw: {
130
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
131
+ };
132
+ }
133
+ }
134
+
135
+
136
+ declare module '@tiptap/core' {
137
+ interface Commands<ReturnType> {
138
+ exportWord: {
139
+ exportToWord: () => ReturnType;
140
+ };
141
+ }
142
+ }
143
+
144
+
145
+ declare module '@tiptap/core' {
146
+ interface Commands<ReturnType> {
147
+ fontSize: {
148
+ /**
149
+ * Set the text font size. ex: "12px", "2em", or "small". Must be a valid
150
+ * CSS font-size
151
+ * (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
152
+ */
153
+ setFontSize: (fontSize: string) => ReturnType;
154
+ /**
155
+ * Unset the font size
156
+ */
157
+ unsetFontSize: () => ReturnType;
158
+ };
159
+ }
160
+ }
161
+
162
+
163
+ declare module '@tiptap/core' {
164
+ interface Commands<ReturnType> {
165
+ painter: {
166
+ setPainter: (marks: Mark[]) => ReturnType;
167
+ };
168
+ }
169
+ }
170
+
171
+
172
+ declare module '@tiptap/core' {
173
+ interface Commands<ReturnType> {
174
+ iframe: {
175
+ /**
176
+ * Add an iframe
177
+ */
178
+ setIframe: (options: {
179
+ src: string;
180
+ service: string;
181
+ }) => ReturnType;
182
+ };
183
+ }
184
+ }
185
+
186
+
187
+ declare module '@tiptap/core' {
188
+ interface Commands<ReturnType> {
189
+ imageUpload: {
190
+ /**
191
+ * Add an image
192
+ */
193
+ setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
194
+ /**
195
+ * Update an image
196
+ */
197
+ updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
198
+ /**
199
+ * Set image alignment
200
+ */
201
+ setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
202
+ };
203
+ }
204
+ }
205
+
206
+
207
+ declare module '@tiptap/core' {
208
+ interface Commands<ReturnType> {
209
+ imageGifUpload: {
210
+ /**
211
+ * Add an image gif
212
+ */
213
+ setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
214
+ /**
215
+ * Update an image gif
216
+ */
217
+ updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
218
+ /**
219
+ * Set image alignment
220
+ */
221
+ setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
222
+ };
223
+ }
224
+ }
225
+
226
+
227
+ declare module '@tiptap/core' {
228
+ interface Commands<ReturnType> {
229
+ indent: {
230
+ /**
231
+ * Set the indent attribute
232
+ */
233
+ indent: () => ReturnType;
234
+ /**
235
+ * Set the outdent attribute
236
+ */
237
+ outdent: () => ReturnType;
238
+ };
239
+ }
240
+ }
241
+
242
+
243
+ declare module '@tiptap/core' {
244
+ interface Commands<ReturnType> {
245
+ katex: {
246
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
247
+ };
248
+ }
249
+ }
250
+
251
+
252
+ declare module '@tiptap/core' {
253
+ interface Commands<ReturnType> {
254
+ lineHeight: {
255
+ setLineHeight: (lineHeight: string) => ReturnType;
256
+ unsetLineHeight: () => ReturnType;
257
+ };
258
+ }
259
+ }
260
+
261
+
262
+ declare module '@tiptap/core' {
263
+ interface Commands<ReturnType> {
264
+ mermaid: {
265
+ setMermaid: (options: any, replace?: any) => ReturnType;
266
+ setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
267
+ };
268
+ }
269
+ }
270
+
271
+
272
+ declare module '@tiptap/core' {
273
+ interface Commands<ReturnType> {
274
+ columns: {
275
+ insertColumns: (attrs?: {
276
+ cols: number;
277
+ }) => ReturnType;
278
+ addColBefore: () => ReturnType;
279
+ addColAfter: () => ReturnType;
280
+ deleteCol: () => ReturnType;
281
+ };
282
+ }
283
+ }
284
+
285
+
286
+ declare module '@tiptap/core' {
287
+ interface Commands<ReturnType> {
288
+ search: {
289
+ setSearchTerm: (searchTerm: string) => ReturnType;
290
+ setReplaceTerm: (replaceTerm: string) => ReturnType;
291
+ replace: () => ReturnType;
292
+ replaceAll: () => ReturnType;
293
+ goToPrevSearchResult: () => void;
294
+ goToNextSearchResult: () => void;
295
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
296
+ };
297
+ }
298
+ }
299
+
300
+
301
+ declare module '@tiptap/core' {
302
+ interface Commands<ReturnType> {
303
+ tableOfContents: {
304
+ setTableOfContents: () => ReturnType;
305
+ removeTableOfContents: () => ReturnType;
306
+ };
307
+ }
308
+ }
309
+
310
+
311
+ declare module '@tiptap/core' {
312
+ interface Commands<ReturnType> {
313
+ twitter: {
314
+ /**
315
+ * Insert a tweet
316
+ * @param options The tweet attributes
317
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
318
+ */
319
+ setTweet: (options: SetTweetOptions) => ReturnType;
320
+ updateTweet: (options: SetTweetOptions) => ReturnType;
321
+ };
322
+ }
323
+ }
324
+
325
+
326
+ declare module '@tiptap/core' {
327
+ interface Commands<ReturnType> {
328
+ video: {
329
+ /**
330
+ * Add an video
331
+ */
332
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
333
+ /**
334
+ * Update an video
335
+ */
336
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
337
+ };
338
+ }
339
+ }
340
+
341
+
342
+ declare module '@tiptap/core' {
343
+ interface Commands<ReturnType> {
344
+ tableCellBackground: {
345
+ setTableCellBackground: (color: string) => ReturnType;
346
+ unsetTableCellBackground: () => ReturnType;
347
+ };
348
+ }
349
+ }