@seorii/tiptap 0.2.11 → 0.2.13
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/tiptap/Bubble.svelte +1 -1
- package/dist/tiptap/Floating.svelte +9 -6
- package/dist/tiptap/tiptap.js +20 -1
- package/package.json +45 -42
|
@@ -7,8 +7,7 @@ const tiptap = getContext('editor');
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
{#if $tiptap}
|
|
10
|
-
<FloatingMenu editor={$tiptap}
|
|
11
|
-
tippyOptions={{animation:'fade', duration: [200, 50]}}>
|
|
10
|
+
<FloatingMenu editor={$tiptap} tippyOptions={{animation:'fade', duration: [200, 50]}}>
|
|
12
11
|
<main on:mousedown={() => setTimeout(() => $tiptap.commands.focus())}>
|
|
13
12
|
<span>
|
|
14
13
|
{i18n('newLineInfo')}
|
|
@@ -17,10 +16,14 @@ const tiptap = getContext('editor');
|
|
|
17
16
|
<IconButton size="1.2em" icon="text_fields" slot="target"/>
|
|
18
17
|
<div style="margin: -6px">
|
|
19
18
|
<List>
|
|
20
|
-
<OneLine icon="counter_1" title="{i18n('title')} 1"
|
|
21
|
-
|
|
22
|
-
<OneLine icon="
|
|
23
|
-
|
|
19
|
+
<OneLine icon="counter_1" title="{i18n('title')} 1"
|
|
20
|
+
on:click={() => $tiptap.commands.setHeading({level: 1})}/>
|
|
21
|
+
<OneLine icon="counter_2" title="{i18n('title')} 2"
|
|
22
|
+
on:click={() => $tiptap.commands.setHeading({level: 2})}/>
|
|
23
|
+
<OneLine icon="counter_3" title="{i18n('title')} 3"
|
|
24
|
+
on:click={() => $tiptap.commands.setHeading({level: 3})}/>
|
|
25
|
+
<OneLine icon="segment" title={i18n('paragraph')}
|
|
26
|
+
on:click={() => $tiptap.commands.setParagraph()}/>
|
|
24
27
|
</List>
|
|
25
28
|
</div>
|
|
26
29
|
</Tooltip>
|
package/dist/tiptap/tiptap.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Editor, mergeAttributes } from "@tiptap/core";
|
|
2
2
|
import { CodeBlockLowlight } from "@tiptap/extension-code-block-lowlight";
|
|
3
|
-
import {
|
|
3
|
+
import { all, createLowlight } from 'lowlight';
|
|
4
4
|
import Code from "@tiptap/extension-code";
|
|
5
5
|
import Image from "../plugin/image";
|
|
6
6
|
import StarterKit from "@tiptap/starter-kit";
|
|
@@ -28,7 +28,26 @@ import Placeholder from "@tiptap/extension-placeholder";
|
|
|
28
28
|
import command from "../plugin/command/suggest";
|
|
29
29
|
import emoji from "../plugin/command/emoji";
|
|
30
30
|
import i18n from "../i18n";
|
|
31
|
+
import js from 'highlight.js/lib/languages/javascript';
|
|
32
|
+
import ts from 'highlight.js/lib/languages/typescript';
|
|
33
|
+
import python from 'highlight.js/lib/languages/python';
|
|
34
|
+
import cpp from 'highlight.js/lib/languages/cpp';
|
|
35
|
+
import java from 'highlight.js/lib/languages/java';
|
|
36
|
+
import kotlin from 'highlight.js/lib/languages/kotlin';
|
|
37
|
+
import go from 'highlight.js/lib/languages/go';
|
|
38
|
+
import csharp from 'highlight.js/lib/languages/csharp';
|
|
39
|
+
import rust from 'highlight.js/lib/languages/rust';
|
|
31
40
|
export default (element, content, { placeholder = i18n('placeholder'), plugins = [], ...props } = {}) => {
|
|
41
|
+
const lowlight = createLowlight(all);
|
|
42
|
+
lowlight.register('js', js);
|
|
43
|
+
lowlight.register('ts', ts);
|
|
44
|
+
lowlight.register('python', python);
|
|
45
|
+
lowlight.register('cpp', cpp);
|
|
46
|
+
lowlight.register('java', java);
|
|
47
|
+
lowlight.register('kotlin', kotlin);
|
|
48
|
+
lowlight.register('go', go);
|
|
49
|
+
lowlight.register('csharp', csharp);
|
|
50
|
+
lowlight.register('rust', rust);
|
|
32
51
|
const tt = new Editor({
|
|
33
52
|
element, content, ...props,
|
|
34
53
|
extensions: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seorii/tiptap",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "svelte-kit sync && svelte-package",
|
|
@@ -13,64 +13,67 @@
|
|
|
13
13
|
"page": "npm run build-page && node gh-pages.js"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@sveltejs/adapter-auto": "^3.
|
|
16
|
+
"@sveltejs/adapter-auto": "^3.1.1",
|
|
17
17
|
"@sveltejs/adapter-static": "^3.0.1",
|
|
18
|
-
"@sveltejs/kit": "^2.
|
|
19
|
-
"@sveltejs/package": "^2.
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
22
|
-
"@
|
|
23
|
-
"eslint": "^
|
|
18
|
+
"@sveltejs/kit": "^2.5.4",
|
|
19
|
+
"@sveltejs/package": "^2.3.0",
|
|
20
|
+
"@sveltejs/vite-plugin-svelte": "^3.0.2",
|
|
21
|
+
"@tiptap/extension-code-block": "^2.2.4",
|
|
22
|
+
"@types/sanitize-html": "^2.11.0",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^7.3.1",
|
|
24
|
+
"@typescript-eslint/parser": "^7.3.1",
|
|
25
|
+
"eslint": "^8.57.0",
|
|
24
26
|
"eslint-config-prettier": "^9.1.0",
|
|
25
27
|
"eslint-plugin-svelte3": "^4.0.0",
|
|
26
28
|
"gh-pages": "^6.1.1",
|
|
27
|
-
"
|
|
28
|
-
"prettier
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"svelte
|
|
29
|
+
"highlight.js": "^11.9.0",
|
|
30
|
+
"prettier": "^3.2.5",
|
|
31
|
+
"prettier-plugin-svelte": "^3.2.2",
|
|
32
|
+
"sass": "^1.72.0",
|
|
33
|
+
"svelte": "^4.2.12",
|
|
34
|
+
"svelte-check": "^3.6.8",
|
|
32
35
|
"svelte-preprocess": "^5.1.3",
|
|
33
36
|
"tslib": "^2.6.2",
|
|
34
|
-
"typescript": "^5.
|
|
35
|
-
"vite": "^5.
|
|
37
|
+
"typescript": "^5.4.2",
|
|
38
|
+
"vite": "^5.2.2"
|
|
36
39
|
},
|
|
37
40
|
"type": "module",
|
|
38
41
|
"dependencies": {
|
|
39
42
|
"@justinribeiro/lite-youtube": "^1.5.0",
|
|
40
43
|
"@seorii/prosemirror-math": "^0.4.2",
|
|
41
|
-
"@tiptap/core": "^2.
|
|
42
|
-
"@tiptap/extension-code": "^2.
|
|
43
|
-
"@tiptap/extension-code-block-lowlight": "^2.
|
|
44
|
-
"@tiptap/extension-color": "^2.
|
|
45
|
-
"@tiptap/extension-dropcursor": "^2.
|
|
46
|
-
"@tiptap/extension-highlight": "^2.
|
|
47
|
-
"@tiptap/extension-image": "^2.
|
|
48
|
-
"@tiptap/extension-link": "^2.
|
|
49
|
-
"@tiptap/extension-ordered-list": "^2.
|
|
50
|
-
"@tiptap/extension-placeholder": "^2.
|
|
51
|
-
"@tiptap/extension-subscript": "^2.
|
|
52
|
-
"@tiptap/extension-superscript": "^2.
|
|
53
|
-
"@tiptap/extension-table": "^2.
|
|
54
|
-
"@tiptap/extension-table-cell": "^2.
|
|
55
|
-
"@tiptap/extension-table-header": "^2.
|
|
56
|
-
"@tiptap/extension-table-row": "^2.
|
|
57
|
-
"@tiptap/extension-text-align": "^2.
|
|
58
|
-
"@tiptap/extension-text-style": "^2.
|
|
59
|
-
"@tiptap/extension-underline": "^2.
|
|
60
|
-
"@tiptap/pm": "^2.
|
|
61
|
-
"@tiptap/starter-kit": "^2.
|
|
62
|
-
"@tiptap/suggestion": "^2.
|
|
44
|
+
"@tiptap/core": "^2.2.4",
|
|
45
|
+
"@tiptap/extension-code": "^2.2.4",
|
|
46
|
+
"@tiptap/extension-code-block-lowlight": "^2.2.4",
|
|
47
|
+
"@tiptap/extension-color": "^2.2.4",
|
|
48
|
+
"@tiptap/extension-dropcursor": "^2.2.4",
|
|
49
|
+
"@tiptap/extension-highlight": "^2.2.4",
|
|
50
|
+
"@tiptap/extension-image": "^2.2.4",
|
|
51
|
+
"@tiptap/extension-link": "^2.2.4",
|
|
52
|
+
"@tiptap/extension-ordered-list": "^2.2.4",
|
|
53
|
+
"@tiptap/extension-placeholder": "^2.2.4",
|
|
54
|
+
"@tiptap/extension-subscript": "^2.2.4",
|
|
55
|
+
"@tiptap/extension-superscript": "^2.2.4",
|
|
56
|
+
"@tiptap/extension-table": "^2.2.4",
|
|
57
|
+
"@tiptap/extension-table-cell": "^2.2.4",
|
|
58
|
+
"@tiptap/extension-table-header": "^2.2.4",
|
|
59
|
+
"@tiptap/extension-table-row": "^2.2.4",
|
|
60
|
+
"@tiptap/extension-text-align": "^2.2.4",
|
|
61
|
+
"@tiptap/extension-text-style": "^2.2.4",
|
|
62
|
+
"@tiptap/extension-underline": "^2.2.4",
|
|
63
|
+
"@tiptap/pm": "^2.2.4",
|
|
64
|
+
"@tiptap/starter-kit": "^2.2.4",
|
|
65
|
+
"@tiptap/suggestion": "^2.2.4",
|
|
63
66
|
"emojis-keywords": "2.0.0",
|
|
64
67
|
"emojis-list": "3.0.0",
|
|
65
|
-
"lowlight": "^
|
|
66
|
-
"nunui": "^0.0.
|
|
68
|
+
"lowlight": "^3.1.0",
|
|
69
|
+
"nunui": "^0.0.118",
|
|
67
70
|
"prosemirror-commands": "^1.5.2",
|
|
68
71
|
"prosemirror-model": "^1.19.4",
|
|
69
72
|
"prosemirror-state": "^1.4.3",
|
|
70
|
-
"prosemirror-tables": "^1.3.
|
|
73
|
+
"prosemirror-tables": "^1.3.7",
|
|
71
74
|
"prosemirror-transform": "^1.8.0",
|
|
72
|
-
"prosemirror-view": "^1.
|
|
73
|
-
"sanitize-html": "^2.
|
|
75
|
+
"prosemirror-view": "^1.33.1",
|
|
76
|
+
"sanitize-html": "^2.12.1",
|
|
74
77
|
"svelte-tiptap": "^1.1.2",
|
|
75
78
|
"tippy.js": "^6.3.7"
|
|
76
79
|
},
|