reactjs-tiptap-editor 0.3.27 → 0.3.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{ActionMenuButton-fkh63F_R.cjs → ActionMenuButton-5Y8QcYxD.cjs} +1 -1
- package/lib/{ActionMenuButton-D3nLtawn.js → ActionMenuButton-Cs9DM_16.js} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +6 -4
- package/lib/Attachment.d.ts +6 -4
- package/lib/Attachment.js +1 -1
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +6 -4
- package/lib/Blockquote.d.ts +6 -4
- package/lib/Blockquote.js +10 -10
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +6 -4
- package/lib/Bold.d.ts +6 -4
- package/lib/Bold.js +10 -10
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +6 -4
- package/lib/BulletList.d.ts +6 -4
- package/lib/BulletList.js +10 -10
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +6 -4
- package/lib/Clear.d.ts +6 -4
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +6 -4
- package/lib/Code.d.ts +6 -4
- package/lib/Code.js +21 -21
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +6 -4
- package/lib/CodeBlock.d.ts +6 -4
- package/lib/CodeBlock.js +1 -1
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +6 -4
- package/lib/CodeView.d.ts +6 -4
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +6 -4
- package/lib/Color.d.ts +6 -4
- package/lib/Color.js +1 -1
- package/lib/Document.d.cts +4 -4
- package/lib/Document.d.ts +4 -4
- package/lib/{Drawer-BBVUujX4.js → Drawer-BCmNLh31.js} +1 -1
- package/lib/{Drawer-DetzmUvQ.cjs → Drawer-DCAp7eZF.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +6 -4
- package/lib/Drawer.d.ts +6 -4
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +4 -4
- package/lib/Emoji.d.ts +4 -4
- package/lib/Emoji.js +1 -1
- package/lib/{Excalidraw-DVnwdz-w.cjs → Excalidraw-BI50RQL-.cjs} +1 -1
- package/lib/{Excalidraw-BVdio4hk.js → Excalidraw-CYPcjYZB.js} +1 -1
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +4 -4
- package/lib/Excalidraw.d.ts +4 -4
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +6 -4
- package/lib/ExportPdf.d.ts +6 -4
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +6 -4
- package/lib/ExportWord.d.ts +6 -4
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +6 -4
- package/lib/FontFamily.d.ts +6 -4
- package/lib/FontFamily.js +2 -2
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +6 -4
- package/lib/FontSize.d.ts +6 -4
- package/lib/FontSize.js +2 -2
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +6 -4
- package/lib/FormatPainter.d.ts +6 -4
- package/lib/FormatPainter.js +1 -1
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +6 -4
- package/lib/Heading.d.ts +6 -4
- package/lib/Heading.js +71 -68
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +10 -4
- package/lib/Highlight.d.ts +10 -4
- package/lib/Highlight.js +14 -13
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +6 -4
- package/lib/History.d.ts +6 -4
- package/lib/History.js +163 -160
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +6 -4
- package/lib/HorizontalRule.d.ts +6 -4
- package/lib/HorizontalRule.js +14 -14
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +4 -4
- package/lib/Iframe.d.ts +4 -4
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +6 -4
- package/lib/Image.d.ts +6 -4
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +7 -6
- package/lib/ImageGif.d.ts +7 -6
- package/lib/ImageGif.js +1 -1
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.d.cts +6 -4
- package/lib/ImportWord.d.ts +6 -4
- package/lib/ImportWord.js +2 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +6 -4
- package/lib/Indent.d.ts +6 -4
- package/lib/Indent.js +12 -11
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +6 -4
- package/lib/Italic.d.ts +6 -4
- package/lib/Italic.js +13 -13
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +4 -4
- package/lib/Katex.d.ts +4 -4
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +6 -4
- package/lib/LineHeight.d.ts +6 -4
- package/lib/LineHeight.js +1 -1
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +6 -4
- package/lib/Link.d.ts +6 -4
- package/lib/Link.js +1 -1
- package/lib/ListItem.d.cts +4 -4
- package/lib/ListItem.d.ts +4 -4
- package/lib/Mention.d.cts +4 -4
- package/lib/Mention.d.ts +4 -4
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.d.cts +6 -4
- package/lib/Mermaid.d.ts +6 -4
- package/lib/Mermaid.js +2 -2
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +6 -4
- package/lib/MoreMark.d.ts +6 -4
- package/lib/MoreMark.js +46 -45
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +4 -4
- package/lib/MultiColumn.d.ts +4 -4
- package/lib/MultiColumn.js +1 -1
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +6 -4
- package/lib/OrderedList.d.ts +6 -4
- package/lib/OrderedList.js +9 -9
- package/lib/{RichTextEditor-DoMu_nCj.cjs → RichTextEditor-DsUcQSbm.cjs} +7 -7
- package/lib/{RichTextEditor-BJWhWz4z.js → RichTextEditor-e6q30rbV.js} +1691 -1672
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +6 -4
- package/lib/SearchAndReplace.d.ts +6 -4
- package/lib/SearchAndReplace.js +1 -1
- package/lib/Selection.d.cts +4 -4
- package/lib/Selection.d.ts +4 -4
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +4 -4
- package/lib/SlashCommand.d.ts +4 -4
- package/lib/SlashCommand.js +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +6 -4
- package/lib/Strike.d.ts +6 -4
- package/lib/Strike.js +13 -13
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +6 -4
- package/lib/SubAndSuperScript.d.ts +6 -4
- package/lib/SubAndSuperScript.js +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +6 -4
- package/lib/Table.d.ts +6 -4
- package/lib/Table.js +1 -1
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +4 -4
- package/lib/TableOfContent.d.ts +4 -4
- package/lib/TableOfContent.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +6 -4
- package/lib/TaskList.d.ts +6 -4
- package/lib/TaskList.js +15 -15
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +6 -4
- package/lib/TextAlign.d.ts +6 -4
- package/lib/TextAlign.js +41 -41
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +6 -4
- package/lib/TextBubble.d.ts +6 -4
- package/lib/TextBubble.js +1 -1
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +4 -4
- package/lib/TextDirection.d.ts +4 -4
- package/lib/TextDirection.js +1 -1
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +6 -4
- package/lib/TextUnderline.d.ts +6 -4
- package/lib/TextUnderline.js +8 -8
- package/lib/TrailingNode.d.cts +4 -4
- package/lib/TrailingNode.d.ts +4 -4
- package/lib/{Twitter--OkCPska.cjs → Twitter-D2Osj8qP.cjs} +1 -1
- package/lib/{Twitter-CXwmqolk.js → Twitter-Wb7cD3M-.js} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +4 -4
- package/lib/Twitter.d.ts +4 -4
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +6 -4
- package/lib/Video.d.ts +6 -4
- package/lib/Video.js +1 -1
- package/lib/bubble-extra.cjs +1 -1
- package/lib/bubble-extra.d.cts +4 -4
- package/lib/bubble-extra.d.ts +4 -4
- package/lib/bubble-extra.js +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +23 -17
- package/lib/index.d.ts +23 -17
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +4 -4
- package/lib/locale-bundle.d.ts +4 -4
- package/lib/{textarea-DkVc2MIQ.cjs → textarea-BVbzd9-k.cjs} +1 -1
- package/lib/{textarea-HW9QlrCS.js → textarea-Csmx5x-_.js} +1 -1
- package/package.json +1 -1
package/lib/HorizontalRule.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as f, n as h, f as A, i as H, T as
|
|
2
|
-
import { A as
|
|
1
|
+
import { N as f, n as h, f as A, i as H, T as c, g as y, m as p } from "./index-DI9T3iLd.js";
|
|
2
|
+
import { A as T } from "./RichTextEditor-e6q30rbV.js";
|
|
3
3
|
const M = f.create({
|
|
4
4
|
name: "horizontalRule",
|
|
5
5
|
addOptions() {
|
|
@@ -19,23 +19,23 @@ const M = f.create({
|
|
|
19
19
|
setHorizontalRule: () => ({ chain: o, state: n }) => {
|
|
20
20
|
if (!A(n, n.schema.nodes[this.name]))
|
|
21
21
|
return !1;
|
|
22
|
-
const { selection: s } = n, { $from:
|
|
23
|
-
return
|
|
24
|
-
from: Math.max(
|
|
22
|
+
const { selection: s } = n, { $from: r, $to: l } = s, i = o();
|
|
23
|
+
return r.parentOffset === 0 ? i.insertContentAt({
|
|
24
|
+
from: Math.max(r.pos - 1, 0),
|
|
25
25
|
to: l.pos
|
|
26
26
|
}, {
|
|
27
27
|
type: this.name
|
|
28
|
-
}) : H(s) ?
|
|
28
|
+
}) : H(s) ? i.insertContentAt(l.pos, {
|
|
29
29
|
type: this.name
|
|
30
|
-
}) :
|
|
31
|
-
var
|
|
30
|
+
}) : i.insertContent({ type: this.name }), i.command(({ tr: e, dispatch: m }) => {
|
|
31
|
+
var a;
|
|
32
32
|
if (m) {
|
|
33
33
|
const { $to: t } = e.selection, d = t.end();
|
|
34
34
|
if (t.nodeAfter)
|
|
35
|
-
t.nodeAfter.isTextblock ? e.setSelection(
|
|
35
|
+
t.nodeAfter.isTextblock ? e.setSelection(c.create(e.doc, t.pos + 1)) : t.nodeAfter.isBlock ? e.setSelection(y.create(e.doc, t.pos)) : e.setSelection(c.create(e.doc, t.pos));
|
|
36
36
|
else {
|
|
37
|
-
const u = (
|
|
38
|
-
u && (e.insert(d, u), e.setSelection(
|
|
37
|
+
const u = (a = t.parent.type.contentMatch.defaultType) === null || a === void 0 ? void 0 : a.create();
|
|
38
|
+
u && (e.insert(d, u), e.setSelection(c.create(e.doc, d + 1)));
|
|
39
39
|
}
|
|
40
40
|
e.scrollIntoView();
|
|
41
41
|
}
|
|
@@ -66,13 +66,13 @@ const M = f.create({
|
|
|
66
66
|
var o;
|
|
67
67
|
return {
|
|
68
68
|
...(o = this.parent) == null ? void 0 : o.call(this),
|
|
69
|
-
button: ({ editor: n, t: s }) => ({
|
|
70
|
-
component:
|
|
69
|
+
button: ({ editor: n, t: s, extension: r }) => ({
|
|
70
|
+
component: T,
|
|
71
71
|
componentProps: {
|
|
72
72
|
action: () => n.commands.setHorizontalRule(),
|
|
73
73
|
disabled: !n.can().setHorizontalRule(),
|
|
74
74
|
icon: "Minus",
|
|
75
|
-
shortcutKeys: ["mod", "alt", "S"],
|
|
75
|
+
shortcutKeys: r.options.shortcutKeys ?? ["mod", "alt", "S"],
|
|
76
76
|
tooltip: s("editor.horizontalrule.tooltip")
|
|
77
77
|
}
|
|
78
78
|
})
|
package/lib/Iframe.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-ByRfqzMr.cjs");require("./dom-dataset-Byuf1YmW.cjs");const e=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-ByRfqzMr.cjs");require("./dom-dataset-Byuf1YmW.cjs");const e=require("./RichTextEditor-DsUcQSbm.cjs");exports.Iframe=e.Iframe;
|
package/lib/Iframe.d.cts
CHANGED
|
@@ -66,8 +66,8 @@ declare module '@tiptap/core' {
|
|
|
66
66
|
|
|
67
67
|
declare module '@tiptap/core' {
|
|
68
68
|
interface Commands<ReturnType> {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
exportPdf: {
|
|
70
|
+
exportToPdf: () => ReturnType;
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -75,8 +75,8 @@ declare module '@tiptap/core' {
|
|
|
75
75
|
|
|
76
76
|
declare module '@tiptap/core' {
|
|
77
77
|
interface Commands<ReturnType> {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
excalidraw: {
|
|
79
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
}
|
package/lib/Iframe.d.ts
CHANGED
|
@@ -66,8 +66,8 @@ declare module '@tiptap/core' {
|
|
|
66
66
|
|
|
67
67
|
declare module '@tiptap/core' {
|
|
68
68
|
interface Commands<ReturnType> {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
exportPdf: {
|
|
70
|
+
exportToPdf: () => ReturnType;
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -75,8 +75,8 @@ declare module '@tiptap/core' {
|
|
|
75
75
|
|
|
76
76
|
declare module '@tiptap/core' {
|
|
77
77
|
interface Commands<ReturnType> {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
excalidraw: {
|
|
79
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
}
|
package/lib/Iframe.js
CHANGED
package/lib/Image.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-ByRfqzMr.cjs");const e=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-ByRfqzMr.cjs");const e=require("./RichTextEditor-DsUcQSbm.cjs");require("./dom-dataset-Byuf1YmW.cjs");exports.Image=e.Image$1;exports.default=e.Image$1;
|
package/lib/Image.d.cts
CHANGED
|
@@ -67,6 +67,8 @@ declare interface GeneralOptions<T> {
|
|
|
67
67
|
button: ButtonView<T>;
|
|
68
68
|
/** Show on Toolbar */
|
|
69
69
|
toolbar?: boolean;
|
|
70
|
+
/** Shortcut keys override */
|
|
71
|
+
shortcutKeys?: string[] | string[][];
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
export declare interface IImageOptions extends GeneralOptions<IImageOptions> {
|
|
@@ -167,8 +169,8 @@ declare module '@tiptap/core' {
|
|
|
167
169
|
|
|
168
170
|
declare module '@tiptap/core' {
|
|
169
171
|
interface Commands<ReturnType> {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
exportPdf: {
|
|
173
|
+
exportToPdf: () => ReturnType;
|
|
172
174
|
};
|
|
173
175
|
}
|
|
174
176
|
}
|
|
@@ -176,8 +178,8 @@ declare module '@tiptap/core' {
|
|
|
176
178
|
|
|
177
179
|
declare module '@tiptap/core' {
|
|
178
180
|
interface Commands<ReturnType> {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
+
excalidraw: {
|
|
182
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
181
183
|
};
|
|
182
184
|
}
|
|
183
185
|
}
|
package/lib/Image.d.ts
CHANGED
|
@@ -67,6 +67,8 @@ declare interface GeneralOptions<T> {
|
|
|
67
67
|
button: ButtonView<T>;
|
|
68
68
|
/** Show on Toolbar */
|
|
69
69
|
toolbar?: boolean;
|
|
70
|
+
/** Shortcut keys override */
|
|
71
|
+
shortcutKeys?: string[] | string[][];
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
export declare interface IImageOptions extends GeneralOptions<IImageOptions> {
|
|
@@ -167,8 +169,8 @@ declare module '@tiptap/core' {
|
|
|
167
169
|
|
|
168
170
|
declare module '@tiptap/core' {
|
|
169
171
|
interface Commands<ReturnType> {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
exportPdf: {
|
|
173
|
+
exportToPdf: () => ReturnType;
|
|
172
174
|
};
|
|
173
175
|
}
|
|
174
176
|
}
|
|
@@ -176,8 +178,8 @@ declare module '@tiptap/core' {
|
|
|
176
178
|
|
|
177
179
|
declare module '@tiptap/core' {
|
|
178
180
|
interface Commands<ReturnType> {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
+
excalidraw: {
|
|
182
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
181
183
|
};
|
|
182
184
|
}
|
|
183
185
|
}
|
package/lib/Image.js
CHANGED
package/lib/ImageGif.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-ByRfqzMr.cjs");const e=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-ByRfqzMr.cjs");const e=require("./RichTextEditor-DsUcQSbm.cjs");require("./dom-dataset-Byuf1YmW.cjs");exports.ImageGif=e.ImageGif;exports.default=e.ImageGif;
|
package/lib/ImageGif.d.cts
CHANGED
|
@@ -6,10 +6,11 @@ export { ImageGif }
|
|
|
6
6
|
export default ImageGif;
|
|
7
7
|
|
|
8
8
|
declare interface ImageGifOptions extends ImageOptions {
|
|
9
|
+
provider: 'giphy' | 'tenor';
|
|
9
10
|
/**
|
|
10
|
-
* The key for the gif https://giphy.com/
|
|
11
|
+
* The key for the gif https://giphy.com/ or https://tenor.com/
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
API_KEY: string;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export declare interface SetImageAttrsOptions {
|
|
@@ -81,8 +82,8 @@ declare module '@tiptap/core' {
|
|
|
81
82
|
|
|
82
83
|
declare module '@tiptap/core' {
|
|
83
84
|
interface Commands<ReturnType> {
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
exportPdf: {
|
|
86
|
+
exportToPdf: () => ReturnType;
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
89
|
}
|
|
@@ -90,8 +91,8 @@ declare module '@tiptap/core' {
|
|
|
90
91
|
|
|
91
92
|
declare module '@tiptap/core' {
|
|
92
93
|
interface Commands<ReturnType> {
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
excalidraw: {
|
|
95
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
}
|
package/lib/ImageGif.d.ts
CHANGED
|
@@ -6,10 +6,11 @@ export { ImageGif }
|
|
|
6
6
|
export default ImageGif;
|
|
7
7
|
|
|
8
8
|
declare interface ImageGifOptions extends ImageOptions {
|
|
9
|
+
provider: 'giphy' | 'tenor';
|
|
9
10
|
/**
|
|
10
|
-
* The key for the gif https://giphy.com/
|
|
11
|
+
* The key for the gif https://giphy.com/ or https://tenor.com/
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
API_KEY: string;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export declare interface SetImageAttrsOptions {
|
|
@@ -81,8 +82,8 @@ declare module '@tiptap/core' {
|
|
|
81
82
|
|
|
82
83
|
declare module '@tiptap/core' {
|
|
83
84
|
interface Commands<ReturnType> {
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
exportPdf: {
|
|
86
|
+
exportToPdf: () => ReturnType;
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
89
|
}
|
|
@@ -90,8 +91,8 @@ declare module '@tiptap/core' {
|
|
|
90
91
|
|
|
91
92
|
declare module '@tiptap/core' {
|
|
92
93
|
interface Commands<ReturnType> {
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
excalidraw: {
|
|
95
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
}
|
package/lib/ImageGif.js
CHANGED
package/lib/ImportWord.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Es=require("./index-ByRfqzMr.cjs"),br=require("react/jsx-runtime"),ya=require("react"),je=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Es=require("./index-ByRfqzMr.cjs"),br=require("react/jsx-runtime"),ya=require("react"),je=require("./RichTextEditor-DsUcQSbm.cjs"),As=require("./index-D_A0TBRA.cjs");var Ve={},Ai="1.13.7",Da=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Ht=Array.prototype,Fi=Object.prototype,va=typeof Symbol<"u"?Symbol.prototype:null,Fs=Ht.push,it=Ht.slice,Qn=Fi.toString,Cs=Fi.hasOwnProperty,qc=typeof ArrayBuffer<"u",Ss=typeof DataView<"u",Bs=Array.isArray,xa=Object.keys,_a=Object.create,Ua=qc&&ArrayBuffer.isView,ks=isNaN,Ws=isFinite,Pc=!{toString:null}.propertyIsEnumerable("toString"),Ta=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Rs=Math.pow(2,53)-1;function Le(e,n){return n=n==null?e.length-1:+n,function(){for(var t=Math.max(arguments.length-n,0),r=Array(t),c=0;c<t;c++)r[c]=arguments[c+n];switch(n){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var i=Array(n+1);for(c=0;c<n;c++)i[c]=arguments[c];return i[n]=r,e.apply(this,i)}}function hn(e){var n=typeof e;return n==="function"||n==="object"&&!!e}function zc(e){return e===null}function Ci(e){return e===void 0}function Si(e){return e===!0||e===!1||Qn.call(e)==="[object Boolean]"}function jc(e){return!!(e&&e.nodeType===1)}function Ie(e){var n="[object "+e+"]";return function(t){return Qn.call(t)===n}}const Gt=Ie("String"),Bi=Ie("Number"),Xc=Ie("Date"),Vc=Ie("RegExp"),Hc=Ie("Error"),ki=Ie("Symbol"),Wi=Ie("ArrayBuffer");var Gc=Ie("Function"),Ns=Da.document&&Da.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof Ns!="function"&&(Gc=function(e){return typeof e=="function"||!1});const Oe=Gc,Zc=Ie("Object");var $c=Ss&&(!/\[native code\]/.test(String(DataView))||Zc(new DataView(new ArrayBuffer(8)))),Ri=typeof Map<"u"&&Zc(new Map),Os=Ie("DataView");function Is(e){return e!=null&&Oe(e.getInt8)&&Wi(e.buffer)}const Jn=$c?Is:Os,pn=Bs||Ie("Array");function gn(e,n){return e!=null&&Cs.call(e,n)}var Ti=Ie("Arguments");(function(){Ti(arguments)||(Ti=function(e){return gn(e,"callee")})})();const Zt=Ti;function Yc(e){return!ki(e)&&Ws(e)&&!isNaN(parseFloat(e))}function Ni(e){return Bi(e)&&ks(e)}function Oi(e){return function(){return e}}function Kc(e){return function(n){var t=e(n);return typeof t=="number"&&t>=0&&t<=Rs}}function Qc(e){return function(n){return n==null?void 0:n[e]}}const Pt=Qc("byteLength"),Ls=Kc(Pt);var Ms=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function qs(e){return Ua?Ua(e)&&!Jn(e):Ls(e)&&Ms.test(Qn.call(e))}const Ii=qc?qs:Oi(!1),qe=Qc("length");function Ps(e){for(var n={},t=e.length,r=0;r<t;++r)n[e[r]]=!0;return{contains:function(c){return n[c]===!0},push:function(c){return n[c]=!0,e.push(c)}}}function Jc(e,n){n=Ps(n);var t=Ta.length,r=e.constructor,c=Oe(r)&&r.prototype||Fi,i="constructor";for(gn(e,i)&&!n.contains(i)&&n.push(i);t--;)i=Ta[t],i in e&&e[i]!==c[i]&&!n.contains(i)&&n.push(i)}function ke(e){if(!hn(e))return[];if(xa)return xa(e);var n=[];for(var t in e)gn(e,t)&&n.push(t);return Pc&&Jc(e,n),n}function eu(e){if(e==null)return!0;var n=qe(e);return typeof n=="number"&&(pn(e)||Gt(e)||Zt(e))?n===0:qe(ke(e))===0}function Li(e,n){var t=ke(n),r=t.length;if(e==null)return!r;for(var c=Object(e),i=0;i<r;i++){var a=t[i];if(n[a]!==c[a]||!(a in c))return!1}return!0}function Ee(e){if(e instanceof Ee)return e;if(!(this instanceof Ee))return new Ee(e);this._wrapped=e}Ee.VERSION=Ai;Ee.prototype.value=function(){return this._wrapped};Ee.prototype.valueOf=Ee.prototype.toJSON=Ee.prototype.value;Ee.prototype.toString=function(){return String(this._wrapped)};function wa(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Pt(e))}var Ea="[object DataView]";function wi(e,n,t,r){if(e===n)return e!==0||1/e===1/n;if(e==null||n==null)return!1;if(e!==e)return n!==n;var c=typeof e;return c!=="function"&&c!=="object"&&typeof n!="object"?!1:nu(e,n,t,r)}function nu(e,n,t,r){e instanceof Ee&&(e=e._wrapped),n instanceof Ee&&(n=n._wrapped);var c=Qn.call(e);if(c!==Qn.call(n))return!1;if($c&&c=="[object Object]"&&Jn(e)){if(!Jn(n))return!1;c=Ea}switch(c){case"[object RegExp]":case"[object String]":return""+e==""+n;case"[object Number]":return+e!=+e?+n!=+n:+e==0?1/+e===1/n:+e==+n;case"[object Date]":case"[object Boolean]":return+e==+n;case"[object Symbol]":return va.valueOf.call(e)===va.valueOf.call(n);case"[object ArrayBuffer]":case Ea:return nu(wa(e),wa(n),t,r)}var i=c==="[object Array]";if(!i&&Ii(e)){var a=Pt(e);if(a!==Pt(n))return!1;if(e.buffer===n.buffer&&e.byteOffset===n.byteOffset)return!0;i=!0}if(!i){if(typeof e!="object"||typeof n!="object")return!1;var o=e.constructor,u=n.constructor;if(o!==u&&!(Oe(o)&&o instanceof o&&Oe(u)&&u instanceof u)&&"constructor"in e&&"constructor"in n)return!1}t=t||[],r=r||[];for(var l=t.length;l--;)if(t[l]===e)return r[l]===n;if(t.push(e),r.push(n),i){if(l=e.length,l!==n.length)return!1;for(;l--;)if(!wi(e[l],n[l],t,r))return!1}else{var b=ke(e),m;if(l=b.length,ke(n).length!==l)return!1;for(;l--;)if(m=b[l],!(gn(n,m)&&wi(e[m],n[m],t,r)))return!1}return t.pop(),r.pop(),!0}function tu(e,n){return wi(e,n)}function Mn(e){if(!hn(e))return[];var n=[];for(var t in e)n.push(t);return Pc&&Jc(e,n),n}function Mi(e){var n=qe(e);return function(t){if(t==null)return!1;var r=Mn(t);if(qe(r))return!1;for(var c=0;c<n;c++)if(!Oe(t[e[c]]))return!1;return e!==au||!Oe(t[qi])}}var qi="forEach",ru="has",Pi=["clear","delete"],iu=["get",ru,"set"],zs=Pi.concat(qi,iu),au=Pi.concat(iu),js=["add"].concat(Pi,qi,ru);const ou=Ri?Mi(zs):Ie("Map"),cu=Ri?Mi(au):Ie("WeakMap"),uu=Ri?Mi(js):Ie("Set"),su=Ie("WeakSet");function An(e){for(var n=ke(e),t=n.length,r=Array(t),c=0;c<t;c++)r[c]=e[n[c]];return r}function du(e){for(var n=ke(e),t=n.length,r=Array(t),c=0;c<t;c++)r[c]=[n[c],e[n[c]]];return r}function zi(e){for(var n={},t=ke(e),r=0,c=t.length;r<c;r++)n[e[t[r]]]=t[r];return n}function et(e){var n=[];for(var t in e)Oe(e[t])&&n.push(t);return n.sort()}function ji(e,n){return function(t){var r=arguments.length;if(n&&(t=Object(t)),r<2||t==null)return t;for(var c=1;c<r;c++)for(var i=arguments[c],a=e(i),o=a.length,u=0;u<o;u++){var l=a[u];(!n||t[l]===void 0)&&(t[l]=i[l])}return t}}const Xi=ji(Mn),In=ji(ke),Vi=ji(Mn,!0);function Xs(){return function(){}}function lu(e){if(!hn(e))return{};if(_a)return _a(e);var n=Xs();n.prototype=e;var t=new n;return n.prototype=null,t}function fu(e,n){var t=lu(e);return n&&In(t,n),t}function hu(e){return hn(e)?pn(e)?e.slice():Xi({},e):e}function pu(e,n){return n(e),e}function Hi(e){return pn(e)?e:[e]}Ee.toPath=Hi;function at(e){return Ee.toPath(e)}function Gi(e,n){for(var t=n.length,r=0;r<t;r++){if(e==null)return;e=e[n[r]]}return t?e:void 0}function Zi(e,n,t){var r=Gi(e,at(n));return Ci(r)?t:r}function gu(e,n){n=at(n);for(var t=n.length,r=0;r<t;r++){var c=n[r];if(!gn(e,c))return!1;e=e[c]}return!!t}function $t(e){return e}function En(e){return e=In({},e),function(n){return Li(n,e)}}function Yt(e){return e=at(e),function(n){return Gi(n,e)}}function ot(e,n,t){if(n===void 0)return e;switch(t??3){case 1:return function(r){return e.call(n,r)};case 3:return function(r,c,i){return e.call(n,r,c,i)};case 4:return function(r,c,i,a){return e.call(n,r,c,i,a)}}return function(){return e.apply(n,arguments)}}function mu(e,n,t){return e==null?$t:Oe(e)?ot(e,n,t):hn(e)&&!pn(e)?En(e):Yt(e)}function Kt(e,n){return mu(e,n,1/0)}Ee.iteratee=Kt;function Pe(e,n,t){return Ee.iteratee!==Kt?Ee.iteratee(e,n):mu(e,n,t)}function bu(e,n,t){n=Pe(n,t);for(var r=ke(e),c=r.length,i={},a=0;a<c;a++){var o=r[a];i[o]=n(e[o],o,e)}return i}function $i(){}function yu(e){return e==null?$i:function(n){return Zi(e,n)}}function Du(e,n,t){var r=Array(Math.max(0,e));n=ot(n,t,1);for(var c=0;c<e;c++)r[c]=n(c);return r}function zt(e,n){return n==null&&(n=e,e=0),e+Math.floor(Math.random()*(n-e+1))}const Ln=Date.now||function(){return new Date().getTime()};function vu(e){var n=function(i){return e[i]},t="(?:"+ke(e).join("|")+")",r=RegExp(t),c=RegExp(t,"g");return function(i){return i=i==null?"":""+i,r.test(i)?i.replace(c,n):i}}const xu={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},_u=vu(xu),Vs=zi(xu),Uu=vu(Vs),Tu=Ee.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var yr=/(.)^/,Hs={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Gs=/\\|'|\r|\n|\u2028|\u2029/g;function Zs(e){return"\\"+Hs[e]}var $s=/^\s*(\w|\$)+\s*$/;function wu(e,n,t){!n&&t&&(n=t),n=Vi({},n,Ee.templateSettings);var r=RegExp([(n.escape||yr).source,(n.interpolate||yr).source,(n.evaluate||yr).source].join("|")+"|$","g"),c=0,i="__p+='";e.replace(r,function(l,b,m,g,h){return i+=e.slice(c,h).replace(Gs,Zs),c=h+l.length,b?i+=`'+
|
|
2
2
|
((__t=(`+b+`))==null?'':_.escape(__t))+
|
|
3
3
|
'`:m?i+=`'+
|
|
4
4
|
((__t=(`+m+`))==null?'':__t)+
|
|
@@ -228,4 +228,4 @@ Character number: `+n.characterNumber},e.prototype.lineNumber=function(){return
|
|
|
228
228
|
`,r:"\r",t:" "};function s(S){return S.replace(/\\(.)/g,function(A,I){return f[I]||I})}var p=n.rules.sequence(n.rules.tokenOfType("open-square-bracket"),n.rules.sequence.cut(),n.rules.sequence.capture(g),n.rules.tokenOfType("equals"),n.rules.sequence.capture(y),n.rules.tokenOfType("close-square-bracket")).map(function(S,A){return{name:S,value:A,append:!1}}),d=n.rules.sequence(n.rules.tokenOfType("dot"),n.rules.sequence.cut(),n.rules.sequence.capture(g)).map(function(S){return{name:"class",value:S,append:!0}}),D=n.rules.firstOf("attribute or class",p,d);function w(S,A){var I=c(A),Z=n.Parser(),T=Z.parseTokens(S,I);return T.isSuccess()?i.success(T.value()):new i.Result(null,[i.warning(_(A,T))])}function _(S,A){return"Did not understand this style mapping, so ignored it: "+S+`
|
|
229
229
|
`+A.errors().map(U).join(`
|
|
230
230
|
`)}function U(S){return"Error was at character number "+S.characterNumber()+": Expected "+S.expected+" but got "+S.actual}var E=o();return Yn}var Kn={},Oc;function zl(){if(Oc)return Kn;Oc=1,Kn.readOptions=r;var e=Be,n=Kn._defaultStyleMap=["p.Heading1 => h1:fresh","p.Heading2 => h2:fresh","p.Heading3 => h3:fresh","p.Heading4 => h4:fresh","p.Heading5 => h5:fresh","p.Heading6 => h6:fresh","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='heading 1'] => h1:fresh","p[style-name='heading 2'] => h2:fresh","p[style-name='heading 3'] => h3:fresh","p[style-name='heading 4'] => h4:fresh","p[style-name='heading 5'] => h5:fresh","p[style-name='heading 6'] => h6:fresh","p.Heading => h1:fresh","p[style-name='Heading'] => h1:fresh","r[style-name='Strong'] => strong","p[style-name='footnote text'] => p:fresh","r[style-name='footnote reference'] =>","p[style-name='endnote text'] => p:fresh","r[style-name='endnote reference'] =>","p[style-name='annotation text'] => p:fresh","r[style-name='annotation reference'] =>","p[style-name='Footnote'] => p:fresh","r[style-name='Footnote anchor'] =>","p[style-name='Endnote'] => p:fresh","r[style-name='Endnote anchor'] =>","p:unordered-list(1) => ul > li:fresh","p:unordered-list(2) => ul|ol > li > ul > li:fresh","p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:ordered-list(1) => ol > li:fresh","p:ordered-list(2) => ul|ol > li > ol > li:fresh","p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","r[style-name='Hyperlink'] =>","p[style-name='Normal'] => p:fresh","p.Body => p:fresh","p[style-name='Body'] => p:fresh"],t=Kn._standardOptions={transformDocument:i,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function r(a){return a=a||{},e.extend({},t,a,{customStyleMap:c(a.styleMap),readStyleMap:function(){var o=this.customStyleMap;return this.includeEmbeddedStyleMap&&(o=o.concat(c(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(o=o.concat(n)),o}})}function c(a){return a?e.isString(a)?a.split(`
|
|
231
|
-
`).map(function(o){return o.trim()}).filter(function(o){return o!==""&&o.charAt(0)!=="#"}):a:[]}function i(a){return a}return Kn}var _i={},Ic;function jl(){if(Ic)return _i;Ic=1;var e=mn(),n=hs();_i.openZip=t;function t(r){return r.arrayBuffer?e.resolve(n.openArrayBuffer(r.arrayBuffer)):e.reject(new Error("Could not find file in options"))}return _i}var Ui={},Lc;function Xl(){if(Lc)return Ui;Lc=1;var e=mr(),n=gr();Ui.element=t;function t(r){return function(c){return n.elementWithTag(e.element(r),[c])}}return Ui}var Mc;function Vl(){if(Mc)return Ve;Mc=1;var e=Be,n=wl(),t=El(),r=Bl().DocumentConverter,c=kl().convertElementToRawText,i=Pl().readStyle,a=zl().readOptions,o=jl(),u=on().Result;Ve.convertToHtml=l,Ve.convertToMarkdown=b,Ve.convert=m,Ve.extractRawText=f,Ve.images=vs(),Ve.transforms=ys(),Ve.underline=Xl(),Ve.embedStyleMap=s,Ve.readEmbeddedStyleMap=g;function l(p,d){return m(p,d)}function b(p,d){var D=Object.create(d||{});return D.outputFormat="markdown",m(p,D)}function m(p,d){return d=a(d),o.openZip(p).tap(function(D){return t.readStyleMap(D).then(function(w){d.embeddedStyleMap=w})}).then(function(D){return n.read(D,p).then(function(w){return w.map(d.transformDocument)}).then(function(w){return h(w,d)})})}function g(p){return o.openZip(p).then(t.readStyleMap)}function h(p,d){var D=y(d.readStyleMap()),w=e.extend({},d,{styleMap:D.value}),_=new r(w);return p.flatMapThen(function(U){return D.flatMapThen(function(E){return _.convertToHtml(U)})})}function y(p){return u.combine((p||[]).map(i)).map(function(d){return d.filter(function(D){return!!D})})}function f(p){return o.openZip(p).then(n.read).then(function(d){return d.map(c)})}function s(p,d){return o.openZip(p).tap(function(D){return t.writeStyleMap(D,d)}).then(function(D){return D.toArrayBuffer()}).then(function(D){return{toArrayBuffer:function(){return D},toBuffer:function(){return Buffer.from(D)}}})}return Ve.styleMapping=function(){throw new Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)},Ve}var Hl=Vl();const Gl=je.getDefaultExportFromCjs(Hl);function Zl(e,n){const t=atob(e.split(",")[1]),r=Array.from({length:t.length});for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);const c=new Uint8Array(r);return new Blob([c],{type:n})}function $l(e,n){return new File([e],n,{type:e.type})}function Yl(e){const{toast:n}=je.useToast(),{t}=As.useLocale(),[r,c]=ya.useState(!1),i=ya.useRef(null);function a(){var m;(m=i.current)==null||m.click()}function o(m){const g=m.target.files[0];if(g){if(g.size>e.limit){n({variant:"destructive",title:t("editor.importWord.limitSize")});return}l(g)}}async function u(m){var s;const h=new DOMParser().parseFromString(m,"text/html"),y=h.querySelectorAll("img");if(y.length===0)return h.body.innerHTML;if(je.hasExtension(e.editor,"image")){const p=(s=e.editor.extensionManager.extensions.find(d=>d.name==="importWord"))==null?void 0:s.options;if(p&&typeof p.upload=="function"){const d=[];for(const w of y){const _=w.getAttribute("src"),U=Zl(_,"image/jpeg"),E=$l(U,"image.jpeg");d.push(E)}const D=await p.upload(d);for(const[w,_]of y.entries()){_.setAttribute("src",D[w].src);const U=_.parentElement;(U==null?void 0:U.tagName)==="P"&&(U.insertAdjacentElement("beforebegin",_),!U.hasChildNodes()&&U.textContent===""&&U.remove())}return h.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),h.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),h.body.innerHTML}async function l(m){c(!0);try{if(e.convert){const g=await e.convert(m);b(g)}else{const g=await m.arrayBuffer(),{value:h}=await Gl.convertToHtml({arrayBuffer:g},e==null?void 0:e.mammothOptions);b(h)}}finally{c(!1)}}async function b(m){const g=await u(m);e.editor.chain().setContent(g,!0).run()}return br.jsxs("div",{children:[br.jsx(je.ActionButton,{action:a,disabled:e==null?void 0:e.disabled,icon:e==null?void 0:e.icon,loading:r,tooltip:e==null?void 0:e.tooltip}),br.jsx("input",{accept:".docx",onChange:o,ref:i,type:"file",style:{display:"none"}})]})}const Kl=Es.Extension.create({name:"importWord",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({editor:n,extension:t,t:r})=>{const{convert:c,limit:i,mammothOptions:a}=t.options;return{component:Yl,componentProps:{editor:n,convert:c,limit:i,mammothOptions:a,action:()=>n.commands.setHorizontalRule(),disabled:!n.can().setHorizontalRule(),icon:"Word",shortcutKeys:["alt","mod","S"],tooltip:r("editor.importWord.tooltip")}}}}}});exports.ImportWord=Kl;
|
|
231
|
+
`).map(function(o){return o.trim()}).filter(function(o){return o!==""&&o.charAt(0)!=="#"}):a:[]}function i(a){return a}return Kn}var _i={},Ic;function jl(){if(Ic)return _i;Ic=1;var e=mn(),n=hs();_i.openZip=t;function t(r){return r.arrayBuffer?e.resolve(n.openArrayBuffer(r.arrayBuffer)):e.reject(new Error("Could not find file in options"))}return _i}var Ui={},Lc;function Xl(){if(Lc)return Ui;Lc=1;var e=mr(),n=gr();Ui.element=t;function t(r){return function(c){return n.elementWithTag(e.element(r),[c])}}return Ui}var Mc;function Vl(){if(Mc)return Ve;Mc=1;var e=Be,n=wl(),t=El(),r=Bl().DocumentConverter,c=kl().convertElementToRawText,i=Pl().readStyle,a=zl().readOptions,o=jl(),u=on().Result;Ve.convertToHtml=l,Ve.convertToMarkdown=b,Ve.convert=m,Ve.extractRawText=f,Ve.images=vs(),Ve.transforms=ys(),Ve.underline=Xl(),Ve.embedStyleMap=s,Ve.readEmbeddedStyleMap=g;function l(p,d){return m(p,d)}function b(p,d){var D=Object.create(d||{});return D.outputFormat="markdown",m(p,D)}function m(p,d){return d=a(d),o.openZip(p).tap(function(D){return t.readStyleMap(D).then(function(w){d.embeddedStyleMap=w})}).then(function(D){return n.read(D,p).then(function(w){return w.map(d.transformDocument)}).then(function(w){return h(w,d)})})}function g(p){return o.openZip(p).then(t.readStyleMap)}function h(p,d){var D=y(d.readStyleMap()),w=e.extend({},d,{styleMap:D.value}),_=new r(w);return p.flatMapThen(function(U){return D.flatMapThen(function(E){return _.convertToHtml(U)})})}function y(p){return u.combine((p||[]).map(i)).map(function(d){return d.filter(function(D){return!!D})})}function f(p){return o.openZip(p).then(n.read).then(function(d){return d.map(c)})}function s(p,d){return o.openZip(p).tap(function(D){return t.writeStyleMap(D,d)}).then(function(D){return D.toArrayBuffer()}).then(function(D){return{toArrayBuffer:function(){return D},toBuffer:function(){return Buffer.from(D)}}})}return Ve.styleMapping=function(){throw new Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)},Ve}var Hl=Vl();const Gl=je.getDefaultExportFromCjs(Hl);function Zl(e,n){const t=atob(e.split(",")[1]),r=Array.from({length:t.length});for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);const c=new Uint8Array(r);return new Blob([c],{type:n})}function $l(e,n){return new File([e],n,{type:e.type})}function Yl(e){const{toast:n}=je.useToast(),{t}=As.useLocale(),[r,c]=ya.useState(!1),i=ya.useRef(null);function a(){var m;(m=i.current)==null||m.click()}function o(m){const g=m.target.files[0];if(g){if(g.size>e.limit){n({variant:"destructive",title:t("editor.importWord.limitSize")});return}l(g)}}async function u(m){var s;const h=new DOMParser().parseFromString(m,"text/html"),y=h.querySelectorAll("img");if(y.length===0)return h.body.innerHTML;if(je.hasExtension(e.editor,"image")){const p=(s=e.editor.extensionManager.extensions.find(d=>d.name==="importWord"))==null?void 0:s.options;if(p&&typeof p.upload=="function"){const d=[];for(const w of y){const _=w.getAttribute("src"),U=Zl(_,"image/jpeg"),E=$l(U,"image.jpeg");d.push(E)}const D=await p.upload(d);for(const[w,_]of y.entries()){_.setAttribute("src",D[w].src);const U=_.parentElement;(U==null?void 0:U.tagName)==="P"&&(U.insertAdjacentElement("beforebegin",_),!U.hasChildNodes()&&U.textContent===""&&U.remove())}return h.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),h.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),h.body.innerHTML}async function l(m){c(!0);try{if(e.convert){const g=await e.convert(m);b(g)}else{const g=await m.arrayBuffer(),{value:h}=await Gl.convertToHtml({arrayBuffer:g},e==null?void 0:e.mammothOptions);b(h)}}finally{c(!1)}}async function b(m){const g=await u(m);e.editor.chain().setContent(g,!0).run()}return br.jsxs("div",{children:[br.jsx(je.ActionButton,{action:a,disabled:e==null?void 0:e.disabled,icon:e==null?void 0:e.icon,loading:r,tooltip:e==null?void 0:e.tooltip}),br.jsx("input",{accept:".docx",onChange:o,ref:i,type:"file",style:{display:"none"}})]})}const Kl=Es.Extension.create({name:"importWord",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({editor:n,extension:t,t:r})=>{const{convert:c,limit:i,mammothOptions:a}=t.options;return{component:Yl,componentProps:{editor:n,convert:c,limit:i,mammothOptions:a,action:()=>n.commands.setHorizontalRule(),disabled:!n.can().setHorizontalRule(),icon:"Word",shortcutKeys:t.options.shortcutKeys??["alt","mod","S"],tooltip:r("editor.importWord.tooltip")}}}}}});exports.ImportWord=Kl;
|
package/lib/ImportWord.d.cts
CHANGED
|
@@ -67,6 +67,8 @@ declare interface GeneralOptions<T> {
|
|
|
67
67
|
button: ButtonView<T>;
|
|
68
68
|
/** Show on Toolbar */
|
|
69
69
|
toolbar?: boolean;
|
|
70
|
+
/** Shortcut keys override */
|
|
71
|
+
shortcutKeys?: string[] | string[][];
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
export declare const ImportWord: Extension<ImportWordOptions, any>;
|
|
@@ -142,8 +144,8 @@ declare module '@tiptap/core' {
|
|
|
142
144
|
|
|
143
145
|
declare module '@tiptap/core' {
|
|
144
146
|
interface Commands<ReturnType> {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
exportPdf: {
|
|
148
|
+
exportToPdf: () => ReturnType;
|
|
147
149
|
};
|
|
148
150
|
}
|
|
149
151
|
}
|
|
@@ -151,8 +153,8 @@ declare module '@tiptap/core' {
|
|
|
151
153
|
|
|
152
154
|
declare module '@tiptap/core' {
|
|
153
155
|
interface Commands<ReturnType> {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
excalidraw: {
|
|
157
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
156
158
|
};
|
|
157
159
|
}
|
|
158
160
|
}
|
package/lib/ImportWord.d.ts
CHANGED
|
@@ -67,6 +67,8 @@ declare interface GeneralOptions<T> {
|
|
|
67
67
|
button: ButtonView<T>;
|
|
68
68
|
/** Show on Toolbar */
|
|
69
69
|
toolbar?: boolean;
|
|
70
|
+
/** Shortcut keys override */
|
|
71
|
+
shortcutKeys?: string[] | string[][];
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
export declare const ImportWord: Extension<ImportWordOptions, any>;
|
|
@@ -142,8 +144,8 @@ declare module '@tiptap/core' {
|
|
|
142
144
|
|
|
143
145
|
declare module '@tiptap/core' {
|
|
144
146
|
interface Commands<ReturnType> {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
exportPdf: {
|
|
148
|
+
exportToPdf: () => ReturnType;
|
|
147
149
|
};
|
|
148
150
|
}
|
|
149
151
|
}
|
|
@@ -151,8 +153,8 @@ declare module '@tiptap/core' {
|
|
|
151
153
|
|
|
152
154
|
declare module '@tiptap/core' {
|
|
153
155
|
interface Commands<ReturnType> {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
excalidraw: {
|
|
157
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
156
158
|
};
|
|
157
159
|
}
|
|
158
160
|
}
|
package/lib/ImportWord.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as ws } from "./index-DI9T3iLd.js";
|
|
2
2
|
import { jsxs as Es, jsx as ba } from "react/jsx-runtime";
|
|
3
3
|
import { useState as As, useRef as Fs } from "react";
|
|
4
|
-
import { a9 as Cs, aa as dn, ab as Ss, ac as Bs, A as ks, ad as Ws } from "./RichTextEditor-
|
|
4
|
+
import { a9 as Cs, aa as dn, ab as Ss, ac as Bs, A as ks, ad as Ws } from "./RichTextEditor-e6q30rbV.js";
|
|
5
5
|
import { u as Rs } from "./index-CsK90iVd.js";
|
|
6
6
|
var Xe = {}, 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, Ns = Ht.push, it = Ht.slice, Qn = Ai.toString, Os = Ai.hasOwnProperty, Mc = typeof ArrayBuffer < "u", Is = typeof DataView < "u", Ls = Array.isArray, va = Object.keys, xa = Object.create, _a = Mc && ArrayBuffer.isView, Ms = isNaN, qs = isFinite, qc = !{ toString: null }.propertyIsEnumerable("toString"), Ua = [
|
|
7
7
|
"valueOf",
|
|
@@ -16624,7 +16624,7 @@ const df = /* @__PURE__ */ ws.create({
|
|
|
16624
16624
|
action: () => n.commands.setHorizontalRule(),
|
|
16625
16625
|
disabled: !n.can().setHorizontalRule(),
|
|
16626
16626
|
icon: "Word",
|
|
16627
|
-
shortcutKeys: ["alt", "mod", "S"],
|
|
16627
|
+
shortcutKeys: t.options.shortcutKeys ?? ["alt", "mod", "S"],
|
|
16628
16628
|
tooltip: r("editor.importWord.tooltip")
|
|
16629
16629
|
}
|
|
16630
16630
|
};
|
package/lib/Indent.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-ByRfqzMr.cjs"),t=require("./RichTextEditor-DsUcQSbm.cjs"),a=i.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,extension:d}){var r,s;return[{component:t.ActionButton,componentProps:{action:()=>{e.commands.indent()},shortcutKeys:((r=d.options.shortcutKeys)==null?void 0:r[0])??["Tab"],icon:"IndentIncrease",tooltip:o("editor.indent.tooltip")}},{component:t.ActionButton,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:((s=d.options.shortcutKeys)==null?void 0:s[1])??["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=a;
|
package/lib/Indent.d.cts
CHANGED
|
@@ -66,6 +66,8 @@ declare interface GeneralOptions<T> {
|
|
|
66
66
|
button: ButtonView<T>;
|
|
67
67
|
/** Show on Toolbar */
|
|
68
68
|
toolbar?: boolean;
|
|
69
|
+
/** Shortcut keys override */
|
|
70
|
+
shortcutKeys?: string[] | string[][];
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
export declare const Indent: Extension<IndentOptions, any>;
|
|
@@ -133,8 +135,8 @@ declare module '@tiptap/core' {
|
|
|
133
135
|
|
|
134
136
|
declare module '@tiptap/core' {
|
|
135
137
|
interface Commands<ReturnType> {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
exportPdf: {
|
|
139
|
+
exportToPdf: () => ReturnType;
|
|
138
140
|
};
|
|
139
141
|
}
|
|
140
142
|
}
|
|
@@ -142,8 +144,8 @@ declare module '@tiptap/core' {
|
|
|
142
144
|
|
|
143
145
|
declare module '@tiptap/core' {
|
|
144
146
|
interface Commands<ReturnType> {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
excalidraw: {
|
|
148
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
147
149
|
};
|
|
148
150
|
}
|
|
149
151
|
}
|
package/lib/Indent.d.ts
CHANGED
|
@@ -66,6 +66,8 @@ declare interface GeneralOptions<T> {
|
|
|
66
66
|
button: ButtonView<T>;
|
|
67
67
|
/** Show on Toolbar */
|
|
68
68
|
toolbar?: boolean;
|
|
69
|
+
/** Shortcut keys override */
|
|
70
|
+
shortcutKeys?: string[] | string[][];
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
export declare const Indent: Extension<IndentOptions, any>;
|
|
@@ -133,8 +135,8 @@ declare module '@tiptap/core' {
|
|
|
133
135
|
|
|
134
136
|
declare module '@tiptap/core' {
|
|
135
137
|
interface Commands<ReturnType> {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
exportPdf: {
|
|
139
|
+
exportToPdf: () => ReturnType;
|
|
138
140
|
};
|
|
139
141
|
}
|
|
140
142
|
}
|
|
@@ -142,8 +144,8 @@ declare module '@tiptap/core' {
|
|
|
142
144
|
|
|
143
145
|
declare module '@tiptap/core' {
|
|
144
146
|
interface Commands<ReturnType> {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
excalidraw: {
|
|
148
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
147
149
|
};
|
|
148
150
|
}
|
|
149
151
|
}
|
package/lib/Indent.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import { c as
|
|
3
|
-
const
|
|
1
|
+
import { E as p } from "./index-DI9T3iLd.js";
|
|
2
|
+
import { c as i, I as e, A as a } from "./RichTextEditor-e6q30rbV.js";
|
|
3
|
+
const u = /* @__PURE__ */ p.create({
|
|
4
4
|
name: "indent",
|
|
5
5
|
addOptions() {
|
|
6
6
|
var t;
|
|
@@ -9,26 +9,27 @@ const p = /* @__PURE__ */ s.create({
|
|
|
9
9
|
types: ["paragraph", "heading", "blockquote"],
|
|
10
10
|
minIndent: e.min,
|
|
11
11
|
maxIndent: e.max,
|
|
12
|
-
button({ editor: n, t: o }) {
|
|
12
|
+
button({ editor: n, t: o, extension: s }) {
|
|
13
|
+
var r, d;
|
|
13
14
|
return [
|
|
14
15
|
{
|
|
15
|
-
component:
|
|
16
|
+
component: a,
|
|
16
17
|
componentProps: {
|
|
17
18
|
action: () => {
|
|
18
19
|
n.commands.indent();
|
|
19
20
|
},
|
|
20
|
-
shortcutKeys: ["Tab"],
|
|
21
|
+
shortcutKeys: ((r = s.options.shortcutKeys) == null ? void 0 : r[0]) ?? ["Tab"],
|
|
21
22
|
icon: "IndentIncrease",
|
|
22
23
|
tooltip: o("editor.indent.tooltip")
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
{
|
|
26
|
-
component:
|
|
27
|
+
component: a,
|
|
27
28
|
componentProps: {
|
|
28
29
|
action: () => {
|
|
29
30
|
n.commands.outdent();
|
|
30
31
|
},
|
|
31
|
-
shortcutKeys: ["Shift", "Tab"],
|
|
32
|
+
shortcutKeys: ((d = s.options.shortcutKeys) == null ? void 0 : d[1]) ?? ["Shift", "Tab"],
|
|
32
33
|
icon: "IndentDecrease",
|
|
33
34
|
tooltip: o("editor.outdent.tooltip")
|
|
34
35
|
}
|
|
@@ -56,11 +57,11 @@ const p = /* @__PURE__ */ s.create({
|
|
|
56
57
|
},
|
|
57
58
|
addCommands() {
|
|
58
59
|
return {
|
|
59
|
-
indent: () =>
|
|
60
|
+
indent: () => i({
|
|
60
61
|
delta: e.more,
|
|
61
62
|
types: this.options.types
|
|
62
63
|
}),
|
|
63
|
-
outdent: () =>
|
|
64
|
+
outdent: () => i({
|
|
64
65
|
delta: e.less,
|
|
65
66
|
types: this.options.types
|
|
66
67
|
})
|
|
@@ -74,5 +75,5 @@ const p = /* @__PURE__ */ s.create({
|
|
|
74
75
|
}
|
|
75
76
|
});
|
|
76
77
|
export {
|
|
77
|
-
|
|
78
|
+
u as Indent
|
|
78
79
|
};
|
package/lib/Italic.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ByRfqzMr.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ByRfqzMr.cjs"),i=require("./RichTextEditor-DsUcQSbm.cjs"),a=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,o=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,l=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,c=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,u=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:l,type:this.type})]},addPasteRules(){return[e.markPasteRule({find:o,type:this.type}),e.markPasteRule({find:c,type:this.type})]}}),d=u.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:s,t:n,extension:r}){return{component:i.ActionButton,componentProps:{action:()=>s.commands.toggleItalic(),isActive:()=>s.isActive("italic")||!1,disabled:!1,shortcutKeys:r.options.shortcutKeys??["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=d;
|
package/lib/Italic.d.cts
CHANGED
|
@@ -68,6 +68,8 @@ declare interface GeneralOptions<T> {
|
|
|
68
68
|
button: ButtonView<T>;
|
|
69
69
|
/** Show on Toolbar */
|
|
70
70
|
toolbar?: boolean;
|
|
71
|
+
/** Shortcut keys override */
|
|
72
|
+
shortcutKeys?: string[] | string[][];
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
export declare const Italic: Mark<ItalicOptions, any>;
|
|
@@ -132,8 +134,8 @@ declare module '@tiptap/core' {
|
|
|
132
134
|
|
|
133
135
|
declare module '@tiptap/core' {
|
|
134
136
|
interface Commands<ReturnType> {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
exportPdf: {
|
|
138
|
+
exportToPdf: () => ReturnType;
|
|
137
139
|
};
|
|
138
140
|
}
|
|
139
141
|
}
|
|
@@ -141,8 +143,8 @@ declare module '@tiptap/core' {
|
|
|
141
143
|
|
|
142
144
|
declare module '@tiptap/core' {
|
|
143
145
|
interface Commands<ReturnType> {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
excalidraw: {
|
|
147
|
+
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
146
148
|
};
|
|
147
149
|
}
|
|
148
150
|
}
|