@seorii/tiptap 0.3.0-next.3 → 0.3.0-next.4
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any>;
|
|
1
|
+
declare const _default: (crossorigin?: string) => import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any>;
|
|
2
2
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Image from '@tiptap/extension-image';
|
|
2
2
|
import { mergeAttributes } from '@tiptap/core';
|
|
3
3
|
import { dropImagePlugin } from './dragdrop';
|
|
4
|
-
export default Image.extend({
|
|
4
|
+
export default (crossorigin = 'anonymous') => Image.extend({
|
|
5
5
|
addOptions() {
|
|
6
6
|
return {
|
|
7
7
|
...this.parent?.(),
|
|
@@ -20,4 +20,4 @@ export default Image.extend({
|
|
|
20
20
|
addProseMirrorPlugins() {
|
|
21
21
|
return [dropImagePlugin()];
|
|
22
22
|
}
|
|
23
|
-
}).configure({ HTMLAttributes: { crossorigin
|
|
23
|
+
}).configure({ HTMLAttributes: { crossorigin } });
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
colors?: string[];
|
|
27
27
|
bubble?: any;
|
|
28
28
|
preloader?: any;
|
|
29
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
let {
|
|
@@ -51,7 +52,8 @@
|
|
|
51
52
|
'#ab47bc' //purple
|
|
52
53
|
],
|
|
53
54
|
bubble = null,
|
|
54
|
-
preloader
|
|
55
|
+
preloader,
|
|
56
|
+
crossorigin = 'anonymous',
|
|
55
57
|
}: Props = $props();
|
|
56
58
|
|
|
57
59
|
const san = (body: string) =>
|
|
@@ -111,6 +113,7 @@
|
|
|
111
113
|
placeholder,
|
|
112
114
|
editable,
|
|
113
115
|
onTransaction: () => (tiptap.v = ref = tiptap.v),
|
|
116
|
+
crossorigin,
|
|
114
117
|
...options
|
|
115
118
|
});
|
|
116
119
|
tiptap.v.on('update', ({ editor: tiptap }: any) => {
|
package/dist/tiptap/tiptap.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/core';
|
|
2
|
-
declare const _default: (element: Element, content: string, { placeholder, plugins, ...props }?: any) => Editor;
|
|
2
|
+
declare const _default: (element: Element, content: string, { placeholder, plugins, crossorigin, ...props }?: any) => Editor;
|
|
3
3
|
export default _default;
|
package/dist/tiptap/tiptap.js
CHANGED
|
@@ -50,7 +50,7 @@ const lowlight = () => {
|
|
|
50
50
|
lowlight.register('rust', rust);
|
|
51
51
|
return lowlight;
|
|
52
52
|
};
|
|
53
|
-
const extensions = (placeholder, plugins) => [
|
|
53
|
+
const extensions = (placeholder, plugins, crossorigin) => [
|
|
54
54
|
CodeBlockLowlight.extend({
|
|
55
55
|
addKeyboardShortcuts() {
|
|
56
56
|
return {
|
|
@@ -64,7 +64,7 @@ const extensions = (placeholder, plugins) => [
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
}).configure({ lowlight: lowlight() }),
|
|
67
|
-
Image,
|
|
67
|
+
Image(crossorigin),
|
|
68
68
|
Youtube,
|
|
69
69
|
StarterKit,
|
|
70
70
|
Underline,
|
|
@@ -104,12 +104,12 @@ const extensions = (placeholder, plugins) => [
|
|
|
104
104
|
Placeholder.configure({ placeholder }),
|
|
105
105
|
...plugins
|
|
106
106
|
];
|
|
107
|
-
export default (element, content, { placeholder = i18n('placeholder'), plugins = [], ...props } = {}) => {
|
|
107
|
+
export default (element, content, { placeholder = i18n('placeholder'), plugins = [], crossorigin, ...props } = {}) => {
|
|
108
108
|
const tt = new Editor({
|
|
109
109
|
element,
|
|
110
110
|
content,
|
|
111
111
|
...props,
|
|
112
|
-
extensions: extensions(placeholder, plugins)
|
|
112
|
+
extensions: extensions(placeholder, plugins, crossorigin)
|
|
113
113
|
});
|
|
114
114
|
tt.registerPlugin(emoji(tt));
|
|
115
115
|
tt.registerPlugin(command(tt));
|