@seorii/tiptap 0.2.21 → 0.2.22
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.
|
@@ -12,7 +12,7 @@ import { fallbackUpload } from '../plugin/image/dragdrop';
|
|
|
12
12
|
export let body = '', editable = false, mark = false, ref = null, options = {}, loaded = false;
|
|
13
13
|
export let imageUpload = fallbackUpload, style = '';
|
|
14
14
|
export let blocks = [], placeholder = i18n('placeholder');
|
|
15
|
-
export let
|
|
15
|
+
export let sanitize = {};
|
|
16
16
|
export let colors = [
|
|
17
17
|
'#ef5350', //red
|
|
18
18
|
'#ec407a', //pink
|
|
@@ -25,7 +25,8 @@ export let colors = [
|
|
|
25
25
|
];
|
|
26
26
|
export let bubbleOverride = false;
|
|
27
27
|
const san = (body) => sanitizeHtml(body, {
|
|
28
|
-
|
|
28
|
+
...sanitize,
|
|
29
|
+
allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img', 'math-inline', 'math-node', 'iframe', 'lite-youtube', 'blockquote', 'embed', 'mark', 'code', ...sanitize.allowedTags]),
|
|
29
30
|
allowedStyles: '*', allowedAttributes: {
|
|
30
31
|
'*': ['style', 'class'],
|
|
31
32
|
a: ['href', 'name', 'target'],
|
|
@@ -37,7 +38,7 @@ const san = (body) => sanitizeHtml(body, {
|
|
|
37
38
|
embed: ['src', 'type', 'frameborder', 'allowfullscreen'],
|
|
38
39
|
mark: ['style', 'data-color'],
|
|
39
40
|
code: ['class'],
|
|
40
|
-
...allowedAttributes
|
|
41
|
+
...sanitize.allowedAttributes
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
44
|
const tiptap = setContext('editor', writable(null));
|
|
@@ -13,8 +13,7 @@ declare const __propDef: {
|
|
|
13
13
|
style?: string | undefined;
|
|
14
14
|
blocks?: any[] | undefined;
|
|
15
15
|
placeholder?: any;
|
|
16
|
-
|
|
17
|
-
allowedAttributes?: any;
|
|
16
|
+
sanitize?: any;
|
|
18
17
|
colors?: string[] | undefined;
|
|
19
18
|
bubbleOverride?: boolean | undefined;
|
|
20
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seorii/tiptap",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "svelte-kit sync && svelte-package",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"@tiptap/suggestion": "^2.2.4",
|
|
66
66
|
"emojis-keywords": "2.0.0",
|
|
67
67
|
"emojis-list": "3.0.0",
|
|
68
|
+
"flourite": "^1.3.0",
|
|
68
69
|
"lowlight": "^3.1.0",
|
|
69
70
|
"nunui": "^0.0.118",
|
|
70
71
|
"prosemirror-commands": "^1.5.2",
|
|
@@ -74,6 +75,7 @@
|
|
|
74
75
|
"prosemirror-transform": "^1.8.0",
|
|
75
76
|
"prosemirror-view": "^1.33.1",
|
|
76
77
|
"sanitize-html": "^2.12.1",
|
|
78
|
+
"shiki": "^1.12.0",
|
|
77
79
|
"svelte-awesome-color-picker": "^3.1.0",
|
|
78
80
|
"svelte-tiptap": "^1.1.2",
|
|
79
81
|
"tippy.js": "^6.3.7"
|