@seorii/tiptap 0.2.22 → 0.3.0-next.10
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/dist/i18n/en-us/index.js +1 -1
- package/dist/i18n/index.js +2 -3
- package/dist/i18n/ko-kr/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/plugin/command/emoji.d.ts +2 -2
- package/dist/plugin/command/emoji.js +7 -3
- package/dist/plugin/command/stores.d.ts +0 -1
- package/dist/plugin/command/suggest.d.ts +2 -2
- package/dist/plugin/command/suggest.js +85 -26
- package/dist/plugin/embed.js +15 -9
- package/dist/plugin/iframe.js +19 -10
- package/dist/plugin/image/dragdrop.js +10 -12
- package/dist/plugin/image/index.d.ts +1 -1
- package/dist/plugin/image/index.js +12 -8
- package/dist/plugin/indent.js +16 -14
- package/dist/plugin/orderedlist/index.js +55 -23
- package/dist/plugin/orderedlist/korean.scss +12 -13
- package/dist/plugin/orderedlist/toggleList.js +7 -7
- package/dist/plugin/table/deleteTable.d.ts +1 -1
- package/dist/plugin/table/deleteTable.js +2 -2
- package/dist/plugin/table/index.js +10 -6
- package/dist/plugin/table/style/cell.scss +14 -13
- package/dist/plugin/table/style/grip.scss +61 -59
- package/dist/plugin/table/style/resize.scss +21 -23
- package/dist/plugin/table/style/table.scss +72 -69
- package/dist/plugin/table/tableCell/index.js +6 -6
- package/dist/plugin/table/tableHeader/index.js +6 -6
- package/dist/plugin/table/tableRow/index.js +1 -1
- package/dist/plugin/table/util.d.ts +2 -2
- package/dist/plugin/table/util.js +9 -9
- package/dist/plugin/youtube.d.ts +2 -2
- package/dist/plugin/youtube.js +35 -26
- package/dist/tiptap/Bubble.svelte +199 -95
- package/dist/tiptap/Bubble.svelte.d.ts +7 -21
- package/dist/tiptap/Command.svelte +125 -59
- package/dist/tiptap/Command.svelte.d.ts +4 -16
- package/dist/tiptap/Floating.svelte +67 -41
- package/dist/tiptap/Floating.svelte.d.ts +2 -14
- package/dist/tiptap/TipTap.svelte +210 -132
- package/dist/tiptap/TipTap.svelte.d.ts +18 -34
- package/dist/tiptap/ToolbarButton.svelte +33 -21
- package/dist/tiptap/ToolbarButton.svelte.d.ts +10 -25
- package/dist/tiptap/index.d.ts +1 -1
- package/dist/tiptap/index.js +2 -2
- package/dist/tiptap/setMath.js +5 -2
- package/dist/tiptap/tiptap.d.ts +2 -2
- package/dist/tiptap/tiptap.js +87 -76
- package/package.json +109 -102
package/dist/tiptap/tiptap.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { Editor, mergeAttributes } from
|
|
2
|
-
import { CodeBlockLowlight } from
|
|
1
|
+
import { Editor, mergeAttributes } from '@tiptap/core';
|
|
2
|
+
import { CodeBlockLowlight } from '@tiptap/extension-code-block-lowlight';
|
|
3
3
|
import { all, createLowlight } from 'lowlight';
|
|
4
|
-
import Code from
|
|
5
|
-
import Image from
|
|
6
|
-
import StarterKit from
|
|
7
|
-
import Underline from
|
|
8
|
-
import Highlight from
|
|
9
|
-
import Link from
|
|
10
|
-
import TextAlign from
|
|
11
|
-
import DropCursor from
|
|
12
|
-
import orderedlist from
|
|
13
|
-
import table from
|
|
14
|
-
import tableHeader from
|
|
15
|
-
import tableRow from
|
|
16
|
-
import tableCell from
|
|
4
|
+
import Code from '@tiptap/extension-code';
|
|
5
|
+
import Image from '../plugin/image';
|
|
6
|
+
import StarterKit from '@tiptap/starter-kit';
|
|
7
|
+
import Underline from '@tiptap/extension-underline';
|
|
8
|
+
import Highlight from '@tiptap/extension-highlight';
|
|
9
|
+
import Link from '@tiptap/extension-link';
|
|
10
|
+
import TextAlign from '@tiptap/extension-text-align';
|
|
11
|
+
import DropCursor from '@tiptap/extension-dropcursor';
|
|
12
|
+
import orderedlist from '../plugin/orderedlist';
|
|
13
|
+
import table from '../plugin/table';
|
|
14
|
+
import tableHeader from '../plugin/table/tableHeader';
|
|
15
|
+
import tableRow from '../plugin/table/tableRow';
|
|
16
|
+
import tableCell from '../plugin/table/tableCell';
|
|
17
17
|
import Superscript from '@tiptap/extension-superscript';
|
|
18
|
-
import Subscript from
|
|
19
|
-
import { Indent } from
|
|
18
|
+
import Subscript from '@tiptap/extension-subscript';
|
|
19
|
+
import { Indent } from '../plugin/indent';
|
|
20
20
|
import { Color } from '@tiptap/extension-color';
|
|
21
21
|
import TextStyle from '@tiptap/extension-text-style';
|
|
22
|
-
import Iframe from
|
|
23
|
-
import Embed from
|
|
22
|
+
import Iframe from '../plugin/iframe';
|
|
23
|
+
import Embed from '../plugin/embed';
|
|
24
24
|
// @ts-ignore
|
|
25
|
-
import { MathInline, MathBlock } from
|
|
26
|
-
import Youtube from
|
|
27
|
-
import Placeholder from
|
|
28
|
-
import command from
|
|
29
|
-
import emoji from
|
|
30
|
-
import i18n from
|
|
25
|
+
import { MathInline, MathBlock } from '@seorii/prosemirror-math/tiptap';
|
|
26
|
+
import Youtube from '../plugin/youtube';
|
|
27
|
+
import Placeholder from '@tiptap/extension-placeholder';
|
|
28
|
+
import command from '../plugin/command/suggest';
|
|
29
|
+
import emoji from '../plugin/command/emoji';
|
|
30
|
+
import i18n from '../i18n';
|
|
31
31
|
import js from 'highlight.js/lib/languages/javascript';
|
|
32
32
|
import ts from 'highlight.js/lib/languages/typescript';
|
|
33
33
|
import python from 'highlight.js/lib/languages/python';
|
|
@@ -37,7 +37,7 @@ import kotlin from 'highlight.js/lib/languages/kotlin';
|
|
|
37
37
|
import go from 'highlight.js/lib/languages/go';
|
|
38
38
|
import csharp from 'highlight.js/lib/languages/csharp';
|
|
39
39
|
import rust from 'highlight.js/lib/languages/rust';
|
|
40
|
-
|
|
40
|
+
const lowlight = () => {
|
|
41
41
|
const lowlight = createLowlight(all);
|
|
42
42
|
lowlight.register('js', js);
|
|
43
43
|
lowlight.register('ts', ts);
|
|
@@ -48,57 +48,68 @@ export default (element, content, { placeholder = i18n('placeholder'), plugins =
|
|
|
48
48
|
lowlight.register('go', go);
|
|
49
49
|
lowlight.register('csharp', csharp);
|
|
50
50
|
lowlight.register('rust', rust);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
}).configure({ lowlight }),
|
|
67
|
-
Image,
|
|
68
|
-
Youtube,
|
|
69
|
-
StarterKit,
|
|
70
|
-
Underline,
|
|
71
|
-
Highlight.configure({ multicolor: true }),
|
|
72
|
-
Link.configure({
|
|
73
|
-
openOnClick: true, protocols: ['ftp', 'mailto', {
|
|
74
|
-
scheme: 'tel',
|
|
75
|
-
optionalSlashes: true
|
|
76
|
-
}]
|
|
77
|
-
}),
|
|
78
|
-
TextAlign.configure({ types: ['heading', 'paragraph', 'image'] }),
|
|
79
|
-
DropCursor,
|
|
80
|
-
orderedlist,
|
|
81
|
-
MathInline,
|
|
82
|
-
MathBlock,
|
|
83
|
-
table,
|
|
84
|
-
tableHeader,
|
|
85
|
-
tableRow,
|
|
86
|
-
tableCell,
|
|
87
|
-
Superscript,
|
|
88
|
-
Subscript,
|
|
89
|
-
Indent,
|
|
90
|
-
Color,
|
|
91
|
-
TextStyle,
|
|
92
|
-
Iframe,
|
|
93
|
-
Embed,
|
|
94
|
-
Code.extend({
|
|
95
|
-
renderHTML({ HTMLAttributes }) {
|
|
96
|
-
return ['code', mergeAttributes(HTMLAttributes, { class: 'inline' })];
|
|
51
|
+
return lowlight;
|
|
52
|
+
};
|
|
53
|
+
const extensions = (placeholder, plugins, crossorigin) => [
|
|
54
|
+
CodeBlockLowlight.extend({
|
|
55
|
+
addKeyboardShortcuts() {
|
|
56
|
+
return {
|
|
57
|
+
...this.parent?.(),
|
|
58
|
+
Tab: () => {
|
|
59
|
+
if (this.editor.isActive('codeBlock')) {
|
|
60
|
+
return this.editor.commands.insertContent(' ');
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
97
63
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}).configure({ lowlight: lowlight() }),
|
|
67
|
+
Image(crossorigin),
|
|
68
|
+
Youtube,
|
|
69
|
+
StarterKit,
|
|
70
|
+
Underline,
|
|
71
|
+
Highlight.configure({ multicolor: true }),
|
|
72
|
+
Link.configure({
|
|
73
|
+
openOnClick: true,
|
|
74
|
+
protocols: [
|
|
75
|
+
'ftp',
|
|
76
|
+
'mailto',
|
|
77
|
+
{
|
|
78
|
+
scheme: 'tel',
|
|
79
|
+
optionalSlashes: true
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}),
|
|
83
|
+
TextAlign.configure({ types: ['heading', 'paragraph', 'image'] }),
|
|
84
|
+
DropCursor,
|
|
85
|
+
orderedlist,
|
|
86
|
+
MathInline,
|
|
87
|
+
MathBlock,
|
|
88
|
+
table,
|
|
89
|
+
tableHeader,
|
|
90
|
+
tableRow,
|
|
91
|
+
tableCell,
|
|
92
|
+
Superscript,
|
|
93
|
+
Subscript,
|
|
94
|
+
Indent,
|
|
95
|
+
Color,
|
|
96
|
+
TextStyle,
|
|
97
|
+
Iframe,
|
|
98
|
+
Embed,
|
|
99
|
+
Code.extend({
|
|
100
|
+
renderHTML({ HTMLAttributes }) {
|
|
101
|
+
return ['code', mergeAttributes(HTMLAttributes, { class: 'inline' })];
|
|
102
|
+
}
|
|
103
|
+
}),
|
|
104
|
+
Placeholder.configure({ placeholder }),
|
|
105
|
+
...plugins
|
|
106
|
+
];
|
|
107
|
+
export default (element, content, { placeholder = i18n('placeholder'), plugins = [], crossorigin, ...props } = {}) => {
|
|
108
|
+
const tt = new Editor({
|
|
109
|
+
element,
|
|
110
|
+
content,
|
|
111
|
+
...props,
|
|
112
|
+
extensions: extensions(placeholder, plugins, crossorigin)
|
|
102
113
|
});
|
|
103
114
|
tt.registerPlugin(emoji(tt));
|
|
104
115
|
tt.registerPlugin(command(tt));
|
package/package.json
CHANGED
|
@@ -1,104 +1,111 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
2
|
+
"name": "@seorii/tiptap",
|
|
3
|
+
"version": "0.3.0-next.10",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"dev": "vite dev",
|
|
6
|
+
"build": "svelte-kit sync && svelte-package",
|
|
7
|
+
"build-page": "vite build",
|
|
8
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
9
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
10
|
+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
|
11
|
+
"format": "prettier --plugin-search-dir . --write .",
|
|
12
|
+
"package": "svelte-kit sync && svelte-package && publint",
|
|
13
|
+
"prepublishOnly": "npm run package",
|
|
14
|
+
"page": "npm run build-page && node gh-pages.js"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@sveltejs/adapter-auto": "^4.0.0",
|
|
18
|
+
"@sveltejs/adapter-static": "^3.0.8",
|
|
19
|
+
"@sveltejs/kit": "^2.16.1",
|
|
20
|
+
"@sveltejs/package": "^2.3.7",
|
|
21
|
+
"@sveltejs/vite-plugin-svelte": "4.0.0",
|
|
22
|
+
"@types/sanitize-html": "^2.13.0",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
|
24
|
+
"@typescript-eslint/parser": "^8.21.0",
|
|
25
|
+
"eslint": "^9.19.0",
|
|
26
|
+
"eslint-config-prettier": "^10.0.1",
|
|
27
|
+
"eslint-plugin-svelte3": "^4.0.0",
|
|
28
|
+
"gh-pages": "^6.3.0",
|
|
29
|
+
"highlight.js": "^11.11.1",
|
|
30
|
+
"prettier": "^3.4.2",
|
|
31
|
+
"prettier-plugin-svelte": "^3.3.3",
|
|
32
|
+
"publint": "^0.2.12",
|
|
33
|
+
"sass-embedded": "^1.83.4",
|
|
34
|
+
"svelte": "^5.19.3",
|
|
35
|
+
"svelte-check": "^4.0.5",
|
|
36
|
+
"tslib": "^2.8.1",
|
|
37
|
+
"typescript": "^5.7.3",
|
|
38
|
+
"vite": "^5.4.10"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"svelte": "^5.0.0"
|
|
42
|
+
},
|
|
43
|
+
"type": "module",
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@justinribeiro/lite-youtube": "^1.7.1",
|
|
46
|
+
"@seorii/prosemirror-math": "^0.4.2",
|
|
47
|
+
"@tiptap/core": "^2.11.5",
|
|
48
|
+
"@tiptap/extension-code": "^2.11.5",
|
|
49
|
+
"@tiptap/extension-code-block": "^2.11.5",
|
|
50
|
+
"@tiptap/extension-code-block-lowlight": "^2.11.5",
|
|
51
|
+
"@tiptap/extension-color": "^2.11.5",
|
|
52
|
+
"@tiptap/extension-dropcursor": "^2.11.5",
|
|
53
|
+
"@tiptap/extension-highlight": "^2.11.5",
|
|
54
|
+
"@tiptap/extension-image": "^2.11.5",
|
|
55
|
+
"@tiptap/extension-link": "^2.11.5",
|
|
56
|
+
"@tiptap/extension-ordered-list": "^2.11.5",
|
|
57
|
+
"@tiptap/extension-placeholder": "^2.11.5",
|
|
58
|
+
"@tiptap/extension-subscript": "^2.11.5",
|
|
59
|
+
"@tiptap/extension-superscript": "^2.11.5",
|
|
60
|
+
"@tiptap/extension-table": "^2.11.5",
|
|
61
|
+
"@tiptap/extension-table-cell": "^2.11.5",
|
|
62
|
+
"@tiptap/extension-table-header": "^2.11.5",
|
|
63
|
+
"@tiptap/extension-table-row": "^2.11.5",
|
|
64
|
+
"@tiptap/extension-text-align": "^2.11.5",
|
|
65
|
+
"@tiptap/extension-text-style": "^2.11.5",
|
|
66
|
+
"@tiptap/extension-underline": "^2.11.5",
|
|
67
|
+
"@tiptap/html": "^2.11.5",
|
|
68
|
+
"@tiptap/pm": "^2.11.5",
|
|
69
|
+
"@tiptap/starter-kit": "^2.11.5",
|
|
70
|
+
"@tiptap/suggestion": "^2.11.5",
|
|
71
|
+
"emojis-keywords": "2.0.0",
|
|
72
|
+
"emojis-list": "3.0.0",
|
|
73
|
+
"lowlight": "^3.3.0",
|
|
74
|
+
"nunui": "2.0.0-next.47",
|
|
75
|
+
"prosemirror-commands": "^1.7.0",
|
|
76
|
+
"prosemirror-model": "^1.25.0",
|
|
77
|
+
"prosemirror-state": "^1.4.3",
|
|
78
|
+
"prosemirror-tables": "^1.6.4",
|
|
79
|
+
"prosemirror-transform": "^1.10.3",
|
|
80
|
+
"prosemirror-view": "^1.38.1",
|
|
81
|
+
"sanitize-html": "^2.15.0",
|
|
82
|
+
"svelte-awesome-color-picker": "^4.0.0",
|
|
83
|
+
"svelte-tiptap": "^2.1.0",
|
|
84
|
+
"tippy.js": "^6.3.7"
|
|
85
|
+
},
|
|
86
|
+
"exports": {
|
|
87
|
+
".": {
|
|
88
|
+
"types": "./dist/index.d.ts",
|
|
89
|
+
"svelte": "./dist/index.js"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"license": "MIT",
|
|
93
|
+
"files": [
|
|
94
|
+
"dist",
|
|
95
|
+
"package.json",
|
|
96
|
+
"README.md"
|
|
97
|
+
],
|
|
98
|
+
"publishConfig": {
|
|
99
|
+
"access": "public"
|
|
100
|
+
},
|
|
101
|
+
"repository": {
|
|
102
|
+
"type": "git",
|
|
103
|
+
"url": "https://github.com/seorii/tiptap.git"
|
|
104
|
+
},
|
|
105
|
+
"pnpm": {
|
|
106
|
+
"onlyBuiltDependencies": [
|
|
107
|
+
"@parcel/watcher",
|
|
108
|
+
"esbuild"
|
|
109
|
+
]
|
|
110
|
+
}
|
|
104
111
|
}
|