@seorii/tiptap 0.2.10 → 0.2.12
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.d.ts +1 -0
- package/dist/i18n/en-us/index.js +1 -0
- package/dist/i18n/ko-kr/index.d.ts +1 -0
- package/dist/i18n/ko-kr/index.js +1 -0
- package/dist/tiptap/Bubble.svelte +18 -2
- package/dist/tiptap/Bubble.svelte.d.ts +3 -1
- package/dist/tiptap/Floating.svelte +9 -6
- package/dist/tiptap/TipTap.svelte +12 -2
- package/dist/tiptap/TipTap.svelte.d.ts +1 -0
- package/package.json +43 -43
package/dist/i18n/en-us/index.js
CHANGED
package/dist/i18n/ko-kr/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import deleteTable from "../plugin/table/deleteTable";
|
|
|
7
7
|
import setMath from "./setMath";
|
|
8
8
|
import { Button, Icon, IconButton, Input, List, OneLine, Tooltip } from "nunui";
|
|
9
9
|
import i18n from "../i18n";
|
|
10
|
+
export let colors = [];
|
|
10
11
|
const tiptap = getContext('editor');
|
|
11
12
|
let link = false, href = '', sel = '', _sel = '';
|
|
12
13
|
$: selection = $tiptap?.state?.selection;
|
|
@@ -17,7 +18,7 @@ $: if ($tiptap && sel !== _sel) {
|
|
|
17
18
|
link = false;
|
|
18
19
|
href = $tiptap.getAttributes('link').href;
|
|
19
20
|
}
|
|
20
|
-
$: if ($tiptap) {
|
|
21
|
+
$: if ($tiptap && link) {
|
|
21
22
|
if (href)
|
|
22
23
|
$tiptap.chain().setLink({ href }).run();
|
|
23
24
|
else if ($tiptap.getAttributes('link').href)
|
|
@@ -25,7 +26,6 @@ $: if ($tiptap) {
|
|
|
25
26
|
}
|
|
26
27
|
</script>
|
|
27
28
|
|
|
28
|
-
|
|
29
29
|
{#if $tiptap}
|
|
30
30
|
<BubbleMenu editor={$tiptap} updateDelay={50}
|
|
31
31
|
tippyOptions={{moveTransition: 'transform 0.2s cubic-bezier(1,.5,0,.85)', animation:'shift-away-subtle', duration: [200, 50]}}>
|
|
@@ -93,6 +93,22 @@ $: if ($tiptap) {
|
|
|
93
93
|
<ToolbarButton icon="superscript" prop="superscript"/>
|
|
94
94
|
<ToolbarButton icon="subscript" prop="subscript"/>
|
|
95
95
|
<ToolbarButton icon="functions" handler={() => setMath($tiptap)}/>
|
|
96
|
+
<Tooltip bottom left xstack>
|
|
97
|
+
<IconButton size="1.2em" icon="palette" slot="target"/>
|
|
98
|
+
<div style="font-size: 0.6em">
|
|
99
|
+
<List>
|
|
100
|
+
<Button small outlined on:click={() => $tiptap.chain().focus().unsetColor().run()}>{i18n('default')}
|
|
101
|
+
</Button>
|
|
102
|
+
{#each colors as color}
|
|
103
|
+
<Button small outlined
|
|
104
|
+
on:click={() => $tiptap.chain().focus().setColor(color).run()}
|
|
105
|
+
style="margin-right:4px">
|
|
106
|
+
<span style="width: 20px; height: 16px; background: {color}; border-radius: 4px;display: inline-block;margin-bottom: -2px"></span>
|
|
107
|
+
</Button>
|
|
108
|
+
{/each}
|
|
109
|
+
</List>
|
|
110
|
+
</div>
|
|
111
|
+
</Tooltip>
|
|
96
112
|
<ToolbarButton icon="code" prop="code"/>
|
|
97
113
|
<ToolbarButton icon="link" prop="link" handler={() => link = true}/>
|
|
98
114
|
{/if}
|
|
@@ -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>
|
|
@@ -26,6 +26,16 @@ const san = (body) => sanitizeHtml(body, {
|
|
|
26
26
|
export let body = '', editable = false, ref = null, options = {}, loaded = false;
|
|
27
27
|
export let imageUpload = fallbackUpload, style = '';
|
|
28
28
|
export let blocks = [], placeholder = i18n('placeholder');
|
|
29
|
+
export let colors = [
|
|
30
|
+
'#ef5350',
|
|
31
|
+
'#ec407a',
|
|
32
|
+
'#ff7043',
|
|
33
|
+
'#daca3b',
|
|
34
|
+
'#8bc34a',
|
|
35
|
+
'#2196f3',
|
|
36
|
+
'#3f51b5',
|
|
37
|
+
'#ab47bc', //purple
|
|
38
|
+
];
|
|
29
39
|
const tiptap = setContext('editor', writable(null));
|
|
30
40
|
let element, fullscreen = false, mounted = false, last = '';
|
|
31
41
|
$: $tiptap && $tiptap.setEditable(editable);
|
|
@@ -113,11 +123,11 @@ function selectItem(index) {
|
|
|
113
123
|
<Command {selectedIndex}/>
|
|
114
124
|
<Floating/>
|
|
115
125
|
{#if $$slots.bubble}
|
|
116
|
-
<Bubble>
|
|
126
|
+
<Bubble {colors}>
|
|
117
127
|
<slot name="bubble"/>
|
|
118
128
|
</Bubble>
|
|
119
129
|
{:else}
|
|
120
|
-
<Bubble/>
|
|
130
|
+
<Bubble {colors}/>
|
|
121
131
|
{/if}
|
|
122
132
|
{/if}
|
|
123
133
|
</main>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seorii/tiptap",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "svelte-kit sync && svelte-package",
|
|
@@ -13,63 +13,63 @@
|
|
|
13
13
|
"page": "npm run build-page && node gh-pages.js"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@sveltejs/adapter-auto": "^2.1.
|
|
16
|
+
"@sveltejs/adapter-auto": "^2.1.0",
|
|
17
17
|
"@sveltejs/adapter-static": "^2.0.3",
|
|
18
|
-
"@sveltejs/kit": "^1.
|
|
19
|
-
"@sveltejs/package": "^2.2.
|
|
20
|
-
"@types/sanitize-html": "^2.9.
|
|
21
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
22
|
-
"@typescript-eslint/parser": "^6.
|
|
23
|
-
"eslint": "^8.
|
|
18
|
+
"@sveltejs/kit": "^1.22.5",
|
|
19
|
+
"@sveltejs/package": "^2.2.1",
|
|
20
|
+
"@types/sanitize-html": "^2.9.0",
|
|
21
|
+
"@typescript-eslint/eslint-plugin": "^6.3.0",
|
|
22
|
+
"@typescript-eslint/parser": "^6.3.0",
|
|
23
|
+
"eslint": "^8.47.0",
|
|
24
24
|
"eslint-config-prettier": "^9.0.0",
|
|
25
25
|
"eslint-plugin-svelte3": "^4.0.0",
|
|
26
|
-
"gh-pages": "^6.
|
|
27
|
-
"prettier": "^3.1
|
|
28
|
-
"prettier-plugin-svelte": "^3.
|
|
29
|
-
"sass": "^1.
|
|
30
|
-
"svelte": "^4.2.
|
|
31
|
-
"svelte-check": "^3.
|
|
32
|
-
"svelte-preprocess": "^5.
|
|
33
|
-
"tslib": "^2.6.
|
|
34
|
-
"typescript": "^5.
|
|
35
|
-
"vite": "^4.
|
|
26
|
+
"gh-pages": "^6.0.0",
|
|
27
|
+
"prettier": "^3.0.1",
|
|
28
|
+
"prettier-plugin-svelte": "^3.0.3",
|
|
29
|
+
"sass": "^1.65.1",
|
|
30
|
+
"svelte": "^4.2.0",
|
|
31
|
+
"svelte-check": "^3.5.0",
|
|
32
|
+
"svelte-preprocess": "^5.0.4",
|
|
33
|
+
"tslib": "^2.6.1",
|
|
34
|
+
"typescript": "^5.1.6",
|
|
35
|
+
"vite": "^4.4.9"
|
|
36
36
|
},
|
|
37
37
|
"type": "module",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@justinribeiro/lite-youtube": "^1.5.0",
|
|
40
40
|
"@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.
|
|
41
|
+
"@tiptap/core": "^2.0.4",
|
|
42
|
+
"@tiptap/extension-code": "^2.0.4",
|
|
43
|
+
"@tiptap/extension-code-block-lowlight": "^2.0.4",
|
|
44
|
+
"@tiptap/extension-color": "^2.0.4",
|
|
45
|
+
"@tiptap/extension-dropcursor": "^2.0.4",
|
|
46
|
+
"@tiptap/extension-highlight": "^2.0.4",
|
|
47
|
+
"@tiptap/extension-image": "^2.0.4",
|
|
48
|
+
"@tiptap/extension-link": "^2.0.4",
|
|
49
|
+
"@tiptap/extension-ordered-list": "^2.0.4",
|
|
50
|
+
"@tiptap/extension-placeholder": "^2.0.4",
|
|
51
|
+
"@tiptap/extension-subscript": "^2.0.4",
|
|
52
|
+
"@tiptap/extension-superscript": "^2.0.4",
|
|
53
|
+
"@tiptap/extension-table": "^2.0.4",
|
|
54
|
+
"@tiptap/extension-table-cell": "^2.0.4",
|
|
55
|
+
"@tiptap/extension-table-header": "^2.0.4",
|
|
56
|
+
"@tiptap/extension-table-row": "^2.0.4",
|
|
57
|
+
"@tiptap/extension-text-align": "^2.0.4",
|
|
58
|
+
"@tiptap/extension-text-style": "^2.0.4",
|
|
59
|
+
"@tiptap/extension-underline": "^2.0.4",
|
|
60
|
+
"@tiptap/pm": "^2.0.4",
|
|
61
|
+
"@tiptap/starter-kit": "^2.0.4",
|
|
62
|
+
"@tiptap/suggestion": "^2.0.4",
|
|
63
63
|
"emojis-keywords": "2.0.0",
|
|
64
64
|
"emojis-list": "3.0.0",
|
|
65
65
|
"lowlight": "^2.9.0",
|
|
66
|
-
"nunui": "^0.0.
|
|
66
|
+
"nunui": "^0.0.101",
|
|
67
67
|
"prosemirror-commands": "^1.5.2",
|
|
68
68
|
"prosemirror-model": "^1.19.3",
|
|
69
69
|
"prosemirror-state": "^1.4.3",
|
|
70
70
|
"prosemirror-tables": "^1.3.4",
|
|
71
|
-
"prosemirror-transform": "^1.
|
|
72
|
-
"prosemirror-view": "^1.
|
|
71
|
+
"prosemirror-transform": "^1.7.4",
|
|
72
|
+
"prosemirror-view": "^1.31.7",
|
|
73
73
|
"sanitize-html": "^2.11.0",
|
|
74
74
|
"svelte-tiptap": "^1.1.2",
|
|
75
75
|
"tippy.js": "^6.3.7"
|