@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.
Files changed (49) hide show
  1. package/dist/i18n/en-us/index.js +1 -1
  2. package/dist/i18n/index.js +2 -3
  3. package/dist/i18n/ko-kr/index.js +1 -1
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.js +3 -3
  6. package/dist/plugin/command/emoji.d.ts +2 -2
  7. package/dist/plugin/command/emoji.js +7 -3
  8. package/dist/plugin/command/stores.d.ts +0 -1
  9. package/dist/plugin/command/suggest.d.ts +2 -2
  10. package/dist/plugin/command/suggest.js +85 -26
  11. package/dist/plugin/embed.js +15 -9
  12. package/dist/plugin/iframe.js +19 -10
  13. package/dist/plugin/image/dragdrop.js +10 -12
  14. package/dist/plugin/image/index.d.ts +1 -1
  15. package/dist/plugin/image/index.js +12 -8
  16. package/dist/plugin/indent.js +16 -14
  17. package/dist/plugin/orderedlist/index.js +55 -23
  18. package/dist/plugin/orderedlist/korean.scss +12 -13
  19. package/dist/plugin/orderedlist/toggleList.js +7 -7
  20. package/dist/plugin/table/deleteTable.d.ts +1 -1
  21. package/dist/plugin/table/deleteTable.js +2 -2
  22. package/dist/plugin/table/index.js +10 -6
  23. package/dist/plugin/table/style/cell.scss +14 -13
  24. package/dist/plugin/table/style/grip.scss +61 -59
  25. package/dist/plugin/table/style/resize.scss +21 -23
  26. package/dist/plugin/table/style/table.scss +72 -69
  27. package/dist/plugin/table/tableCell/index.js +6 -6
  28. package/dist/plugin/table/tableHeader/index.js +6 -6
  29. package/dist/plugin/table/tableRow/index.js +1 -1
  30. package/dist/plugin/table/util.d.ts +2 -2
  31. package/dist/plugin/table/util.js +9 -9
  32. package/dist/plugin/youtube.d.ts +2 -2
  33. package/dist/plugin/youtube.js +35 -26
  34. package/dist/tiptap/Bubble.svelte +199 -95
  35. package/dist/tiptap/Bubble.svelte.d.ts +7 -21
  36. package/dist/tiptap/Command.svelte +125 -59
  37. package/dist/tiptap/Command.svelte.d.ts +4 -16
  38. package/dist/tiptap/Floating.svelte +67 -41
  39. package/dist/tiptap/Floating.svelte.d.ts +2 -14
  40. package/dist/tiptap/TipTap.svelte +210 -132
  41. package/dist/tiptap/TipTap.svelte.d.ts +18 -34
  42. package/dist/tiptap/ToolbarButton.svelte +33 -21
  43. package/dist/tiptap/ToolbarButton.svelte.d.ts +10 -25
  44. package/dist/tiptap/index.d.ts +1 -1
  45. package/dist/tiptap/index.js +2 -2
  46. package/dist/tiptap/setMath.js +5 -2
  47. package/dist/tiptap/tiptap.d.ts +2 -2
  48. package/dist/tiptap/tiptap.js +87 -76
  49. package/package.json +109 -102
@@ -1,33 +1,33 @@
1
- import { Editor, mergeAttributes } from "@tiptap/core";
2
- import { CodeBlockLowlight } from "@tiptap/extension-code-block-lowlight";
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 "@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";
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 "@tiptap/extension-subscript";
19
- import { Indent } from "../plugin/indent";
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 "../plugin/iframe";
23
- import Embed from "../plugin/embed";
22
+ import Iframe from '../plugin/iframe';
23
+ import Embed from '../plugin/embed';
24
24
  // @ts-ignore
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";
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
- export default (element, content, { placeholder = i18n('placeholder'), plugins = [], ...props } = {}) => {
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
- const tt = new Editor({
52
- element, content, ...props,
53
- extensions: [
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;
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
- Placeholder.configure({ placeholder }),
100
- ...plugins,
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
- "name": "@seorii/tiptap",
3
- "version": "0.2.22",
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
- "deploy": "svelte-kit sync && svelte-package && npm publish --access public",
13
- "page": "npm run build-page && node gh-pages.js"
14
- },
15
- "devDependencies": {
16
- "@sveltejs/adapter-auto": "^3.1.1",
17
- "@sveltejs/adapter-static": "^3.0.1",
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",
26
- "eslint-config-prettier": "^9.1.0",
27
- "eslint-plugin-svelte3": "^4.0.0",
28
- "gh-pages": "^6.1.1",
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",
35
- "svelte-preprocess": "^5.1.3",
36
- "tslib": "^2.6.2",
37
- "typescript": "^5.4.2",
38
- "vite": "^5.2.2"
39
- },
40
- "type": "module",
41
- "dependencies": {
42
- "@justinribeiro/lite-youtube": "^1.5.0",
43
- "@seorii/prosemirror-math": "^0.4.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",
66
- "emojis-keywords": "2.0.0",
67
- "emojis-list": "3.0.0",
68
- "flourite": "^1.3.0",
69
- "lowlight": "^3.1.0",
70
- "nunui": "^0.0.118",
71
- "prosemirror-commands": "^1.5.2",
72
- "prosemirror-model": "^1.19.4",
73
- "prosemirror-state": "^1.4.3",
74
- "prosemirror-tables": "^1.3.7",
75
- "prosemirror-transform": "^1.8.0",
76
- "prosemirror-view": "^1.33.1",
77
- "sanitize-html": "^2.12.1",
78
- "shiki": "^1.12.0",
79
- "svelte-awesome-color-picker": "^3.1.0",
80
- "svelte-tiptap": "^1.1.2",
81
- "tippy.js": "^6.3.7"
82
- },
83
- "exports": {
84
- ".": {
85
- "require": "./dist/index.js",
86
- "import": "./dist/index.js",
87
- "types": "./dist/index.d.ts",
88
- "svelte": "./dist/index.js"
89
- }
90
- },
91
- "license": "MIT",
92
- "files": [
93
- "dist",
94
- "package.json",
95
- "README.md"
96
- ],
97
- "publishConfig": {
98
- "access": "public"
99
- },
100
- "repository": {
101
- "type": "git",
102
- "url": "https://github.com/seorii/tiptap.git"
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
  }