@seorii/tiptap 0.3.0-next.9 → 0.4.0

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 (55) hide show
  1. package/dist/i18n/index.d.ts +106 -6
  2. package/dist/i18n/index.js +56 -11
  3. package/dist/index.d.ts +2 -1
  4. package/dist/index.js +2 -1
  5. package/dist/plugin/command/emoji.d.ts +3 -17
  6. package/dist/plugin/command/emoji.js +51 -24
  7. package/dist/plugin/command/stores.svelte.d.ts +52 -0
  8. package/dist/plugin/command/stores.svelte.js +69 -0
  9. package/dist/plugin/command/suggest.d.ts +6 -19
  10. package/dist/plugin/command/suggest.js +149 -49
  11. package/dist/plugin/embed.d.ts +2 -2
  12. package/dist/plugin/embed.js +6 -2
  13. package/dist/plugin/iframe.js +1 -1
  14. package/dist/plugin/image/dragdrop.d.ts +2 -0
  15. package/dist/plugin/image/dragdrop.js +126 -15
  16. package/dist/plugin/image/index.js +4 -3
  17. package/dist/plugin/indent.js +0 -1
  18. package/dist/plugin/orderedlist/index.d.ts +1 -1
  19. package/dist/plugin/orderedlist/index.js +1 -1
  20. package/dist/plugin/orderedlist/{korean.scss → korean.css} +2 -2
  21. package/dist/plugin/resize/index.d.ts +8 -0
  22. package/dist/plugin/resize/index.js +454 -0
  23. package/dist/plugin/table/index.d.ts +1 -1
  24. package/dist/plugin/table/index.js +19 -11
  25. package/dist/plugin/table/style/{cell.scss → cell.css} +6 -5
  26. package/dist/plugin/table/style/{grip.scss → grip.css} +14 -19
  27. package/dist/plugin/table/style/resize.css +28 -0
  28. package/dist/plugin/table/style/{table.scss → table.css} +15 -17
  29. package/dist/plugin/table/style.css +4 -0
  30. package/dist/plugin/table/tableCell/index.js +2 -4
  31. package/dist/plugin/table/tableHeader/index.js +1 -2
  32. package/dist/plugin/upload/skeleton/UploadSkeleton.svelte +97 -0
  33. package/dist/plugin/upload/skeleton/UploadSkeleton.svelte.d.ts +5 -0
  34. package/dist/plugin/upload/skeleton/index.d.ts +30 -0
  35. package/dist/plugin/upload/skeleton/index.js +147 -0
  36. package/dist/plugin/youtube.js +1 -1
  37. package/dist/tiptap/Bubble.svelte +231 -92
  38. package/dist/tiptap/Bubble.svelte.d.ts +9 -6
  39. package/dist/tiptap/Command.svelte +160 -158
  40. package/dist/tiptap/Command.svelte.d.ts +2 -3
  41. package/dist/tiptap/Floating.svelte +51 -24
  42. package/dist/tiptap/Floating.svelte.d.ts +1 -0
  43. package/dist/tiptap/TipTap.svelte +302 -140
  44. package/dist/tiptap/TipTap.svelte.d.ts +10 -3
  45. package/dist/tiptap/ToolbarButton.svelte +30 -10
  46. package/dist/tiptap/ToolbarButton.svelte.d.ts +10 -6
  47. package/dist/tiptap/setMath.d.ts +2 -1
  48. package/dist/tiptap/setMath.js +74 -12
  49. package/dist/tiptap/tiptap.d.ts +9 -1
  50. package/dist/tiptap/tiptap.js +172 -16
  51. package/package.json +63 -57
  52. package/dist/plugin/command/stores.d.ts +0 -13
  53. package/dist/plugin/command/stores.js +0 -7
  54. package/dist/plugin/table/style/resize.scss +0 -26
  55. package/dist/plugin/table/style.scss +0 -4
@@ -1,17 +1,79 @@
1
+ import { NodeSelection } from '@tiptap/pm/state';
2
+ const pushUniqueTarget = (targets, from, to, text) => {
3
+ if (targets.some((target) => target.from === from && target.to === to))
4
+ return;
5
+ targets.push({ from, to, text });
6
+ };
7
+ const collectMathTargets = (state, mathInline) => {
8
+ const targets = [];
9
+ const { selection } = state;
10
+ if (selection instanceof NodeSelection && selection.node.type === mathInline) {
11
+ pushUniqueTarget(targets, selection.from, selection.to, selection.node.textContent);
12
+ }
13
+ if (selection.$from.parent.type === mathInline) {
14
+ const depth = selection.$from.depth;
15
+ const from = selection.$from.before(depth);
16
+ const to = selection.$from.after(depth);
17
+ pushUniqueTarget(targets, from, to, selection.$from.parent.textContent);
18
+ }
19
+ state.doc.nodesBetween(selection.from, selection.to, (node, position) => {
20
+ if (node.type !== mathInline)
21
+ return;
22
+ pushUniqueTarget(targets, position, position + node.nodeSize, node.textContent);
23
+ return false;
24
+ });
25
+ return targets;
26
+ };
27
+ const unwrapMath = ({ state, tr }, mathInline) => {
28
+ const targets = collectMathTargets(state, mathInline);
29
+ if (!targets.length)
30
+ return false;
31
+ for (const { from, to, text } of targets.sort((a, b) => b.from - a.from)) {
32
+ if (!text.length) {
33
+ tr.delete(from, to);
34
+ continue;
35
+ }
36
+ tr.replaceWith(from, to, state.schema.text(text));
37
+ }
38
+ return true;
39
+ };
40
+ const wrapSelectionAsMath = ({ state, tr }, mathInline) => {
41
+ const { selection } = state;
42
+ if (selection.empty)
43
+ return false;
44
+ const targets = [];
45
+ state.doc.nodesBetween(selection.from, selection.to, (node, position) => {
46
+ if (!node.isTextblock)
47
+ return;
48
+ const contentFrom = position + 1;
49
+ const contentTo = position + node.nodeSize - 1;
50
+ const from = Math.max(selection.from, contentFrom);
51
+ const to = Math.min(selection.to, contentTo);
52
+ if (from >= to)
53
+ return;
54
+ const text = state.doc.textBetween(from, to, '');
55
+ if (!text.length)
56
+ return;
57
+ targets.push({ from, to, text });
58
+ });
59
+ if (!targets.length)
60
+ return false;
61
+ for (const { from, to, text } of targets.sort((a, b) => b.from - a.from)) {
62
+ const newNode = mathInline.create(null, state.schema.text(text));
63
+ tr.replaceWith(from, to, newNode);
64
+ }
65
+ return true;
66
+ };
1
67
  export default function setMath(tiptap) {
2
- const { selection } = tiptap.state;
3
68
  tiptap
4
69
  .chain()
5
- .command(({ state, tr }) => state.doc.nodesBetween(selection.from, selection.to, (node, position) => {
6
- if (!node.isTextblock || selection.from === selection.to)
7
- return;
8
- const startPosition = Math.max(position + 1, selection.from);
9
- const endPosition = Math.min(position + node.nodeSize, selection.to);
10
- const substringFrom = Math.max(0, selection.from - position - 1);
11
- const substringTo = Math.max(0, selection.to - position - 1);
12
- const updatedText = node.textContent.substring(substringFrom, substringTo);
13
- const newNode = state.schema.nodes.math_inline.create(null, state.schema.text(updatedText));
14
- tr = tr.replaceWith(startPosition, endPosition, newNode);
15
- }))
70
+ .command((props) => {
71
+ const mathInline = props.state.schema.nodes.math_inline;
72
+ if (!mathInline || props.state.selection.empty)
73
+ return false;
74
+ if (unwrapMath(props, mathInline))
75
+ return true;
76
+ return wrapSelectionAsMath(props, mathInline);
77
+ })
16
78
  .run();
17
79
  }
@@ -1,3 +1,11 @@
1
1
  import { Editor } from '@tiptap/core';
2
- declare const _default: (element: Element, content: string, { placeholder, plugins, crossorigin, ...props }?: any) => Editor;
2
+ type CodeBlockLanguageLabelMap = Record<string, string>;
3
+ type CrossOrigin = 'anonymous' | 'use-credentials' | undefined;
4
+ declare const _default: (element: Element, content: string, { placeholder, plugins, crossorigin, codeBlockLanguageLabels, ...props }?: {
5
+ placeholder?: string;
6
+ plugins?: any[];
7
+ crossorigin?: CrossOrigin;
8
+ codeBlockLanguageLabels?: CodeBlockLanguageLabelMap;
9
+ [key: string]: unknown;
10
+ }) => Editor;
3
11
  export default _default;
@@ -1,4 +1,4 @@
1
- import { Editor, mergeAttributes } from '@tiptap/core';
1
+ import { Editor, Extension, mergeAttributes } from '@tiptap/core';
2
2
  import { CodeBlockLowlight } from '@tiptap/extension-code-block-lowlight';
3
3
  import { all, createLowlight } from 'lowlight';
4
4
  import Code from '@tiptap/extension-code';
@@ -18,15 +18,17 @@ import Superscript from '@tiptap/extension-superscript';
18
18
  import Subscript from '@tiptap/extension-subscript';
19
19
  import { Indent } from '../plugin/indent';
20
20
  import { Color } from '@tiptap/extension-color';
21
- import TextStyle from '@tiptap/extension-text-style';
21
+ import { TextStyle } from '@tiptap/extension-text-style';
22
22
  import Iframe from '../plugin/iframe';
23
23
  import Embed from '../plugin/embed';
24
+ import UploadSkeleton from '../plugin/upload/skeleton';
24
25
  // @ts-ignore
25
26
  import { MathInline, MathBlock } from '@seorii/prosemirror-math/tiptap';
26
27
  import Youtube from '../plugin/youtube';
27
28
  import Placeholder from '@tiptap/extension-placeholder';
28
29
  import command from '../plugin/command/suggest';
29
30
  import emoji from '../plugin/command/emoji';
31
+ import { countSlashItems, moveSlashSelection, runSlashItemAt, slashState } from '../plugin/command/stores.svelte';
30
32
  import i18n from '../i18n';
31
33
  import js from 'highlight.js/lib/languages/javascript';
32
34
  import ts from 'highlight.js/lib/languages/typescript';
@@ -37,6 +39,18 @@ import kotlin from 'highlight.js/lib/languages/kotlin';
37
39
  import go from 'highlight.js/lib/languages/go';
38
40
  import csharp from 'highlight.js/lib/languages/csharp';
39
41
  import rust from 'highlight.js/lib/languages/rust';
42
+ const codeBlockLanguageOptions = [
43
+ { value: 'auto', label: 'auto' },
44
+ { value: 'cpp', label: 'cpp' },
45
+ { value: 'python', label: 'python' },
46
+ { value: 'java', label: 'java' },
47
+ { value: 'js', label: 'js' },
48
+ { value: 'ts', label: 'ts' },
49
+ { value: 'kotlin', label: 'kotlin' },
50
+ { value: 'go', label: 'go' },
51
+ { value: 'csharp', label: 'csharp' },
52
+ { value: 'rust', label: 'rust' }
53
+ ];
40
54
  const lowlight = () => {
41
55
  const lowlight = createLowlight(all);
42
56
  lowlight.register('js', js);
@@ -50,20 +64,160 @@ const lowlight = () => {
50
64
  lowlight.register('rust', rust);
51
65
  return lowlight;
52
66
  };
53
- const extensions = (placeholder, plugins, crossorigin) => [
54
- CodeBlockLowlight.extend({
55
- addKeyboardShortcuts() {
67
+ const normalizeCodeBlockLanguage = (language) => {
68
+ if (typeof language !== 'string')
69
+ return 'auto';
70
+ const normalized = language.trim();
71
+ return normalized.length ? normalized : 'auto';
72
+ };
73
+ const resolveCodeBlockLanguageLabel = (value, labelMap, fallbackLabel = value) => {
74
+ const label = labelMap[value]?.trim();
75
+ return label?.length ? label : fallbackLabel;
76
+ };
77
+ const slashKeymap = Extension.create({
78
+ name: 'slash-keymap',
79
+ priority: 10000,
80
+ addKeyboardShortcuts() {
81
+ return {
82
+ Enter: () => {
83
+ if (!slashState.visible)
84
+ return false;
85
+ return runSlashItemAt(slashState.selectedIndex);
86
+ },
87
+ Tab: () => {
88
+ if (!slashState.visible || countSlashItems() === 0)
89
+ return false;
90
+ moveSlashSelection(1);
91
+ return true;
92
+ },
93
+ 'Shift-Tab': () => {
94
+ if (!slashState.visible || countSlashItems() === 0)
95
+ return false;
96
+ moveSlashSelection(-1);
97
+ return true;
98
+ },
99
+ ArrowUp: () => {
100
+ if (!slashState.visible || countSlashItems() === 0)
101
+ return false;
102
+ moveSlashSelection(-1);
103
+ return true;
104
+ },
105
+ ArrowDown: () => {
106
+ if (!slashState.visible || countSlashItems() === 0)
107
+ return false;
108
+ moveSlashSelection(1);
109
+ return true;
110
+ }
111
+ };
112
+ }
113
+ });
114
+ const CodeBlockWithLanguageSelect = CodeBlockLowlight.extend({
115
+ addOptions() {
116
+ return {
117
+ ...this.parent?.(),
118
+ languageLabelMap: {}
119
+ };
120
+ },
121
+ addKeyboardShortcuts() {
122
+ return {
123
+ ...this.parent?.(),
124
+ Tab: () => {
125
+ if (this.editor.isActive('codeBlock')) {
126
+ return this.editor.commands.insertContent(' ');
127
+ }
128
+ return false;
129
+ }
130
+ };
131
+ },
132
+ addNodeView() {
133
+ return ({ node, getPos, editor }) => {
134
+ let currentNode = node;
135
+ const languageLabelMap = this.options.languageLabelMap || {};
136
+ const dom = document.createElement('div');
137
+ dom.className = 'tiptap-code-block';
138
+ const toolbar = document.createElement('div');
139
+ toolbar.className = 'tiptap-code-block-toolbar';
140
+ const languageSelect = document.createElement('select');
141
+ languageSelect.className = 'tiptap-code-block-language';
142
+ for (const option of codeBlockLanguageOptions) {
143
+ const element = document.createElement('option');
144
+ element.value = option.value;
145
+ element.textContent = resolveCodeBlockLanguageLabel(option.value, languageLabelMap, option.label);
146
+ languageSelect.append(element);
147
+ }
148
+ toolbar.append(languageSelect);
149
+ const pre = document.createElement('pre');
150
+ const contentDOM = document.createElement('code');
151
+ pre.append(contentDOM);
152
+ dom.append(toolbar, pre);
153
+ const ensureLanguageOption = (value) => {
154
+ if ([...languageSelect.options].some((option) => option.value === value))
155
+ return;
156
+ const element = document.createElement('option');
157
+ element.value = value;
158
+ element.textContent = resolveCodeBlockLanguageLabel(value, languageLabelMap);
159
+ languageSelect.append(element);
160
+ };
161
+ const syncLanguageSelection = () => {
162
+ const language = normalizeCodeBlockLanguage(currentNode.attrs.language);
163
+ ensureLanguageOption(language);
164
+ languageSelect.value = language;
165
+ };
166
+ const handleLanguageChange = () => {
167
+ let pos = null;
168
+ try {
169
+ pos = getPos();
170
+ }
171
+ catch {
172
+ pos = null;
173
+ }
174
+ if (typeof pos !== 'number')
175
+ return;
176
+ const selectedLanguage = languageSelect.value;
177
+ const language = selectedLanguage === 'auto' ? null : selectedLanguage;
178
+ const latestNode = editor.state.doc.nodeAt(pos);
179
+ if (!latestNode || latestNode.type.name !== this.name)
180
+ return;
181
+ editor.commands.command(({ tr, dispatch }) => {
182
+ tr.setNodeMarkup(pos, undefined, {
183
+ ...latestNode.attrs,
184
+ language
185
+ });
186
+ dispatch?.(tr);
187
+ return true;
188
+ });
189
+ };
190
+ languageSelect.addEventListener('change', handleLanguageChange);
191
+ syncLanguageSelection();
56
192
  return {
57
- ...this.parent?.(),
58
- Tab: () => {
59
- if (this.editor.isActive('codeBlock')) {
60
- return this.editor.commands.insertContent(' ');
61
- }
193
+ dom,
194
+ contentDOM,
195
+ update: (updatedNode) => {
196
+ if (updatedNode.type !== currentNode.type)
197
+ return false;
198
+ currentNode = updatedNode;
199
+ syncLanguageSelection();
62
200
  return true;
201
+ },
202
+ stopEvent: (event) => {
203
+ const target = event.target;
204
+ if (!(target instanceof HTMLElement))
205
+ return false;
206
+ return Boolean(target.closest('.tiptap-code-block-toolbar'));
207
+ },
208
+ destroy: () => {
209
+ languageSelect.removeEventListener('change', handleLanguageChange);
63
210
  }
64
211
  };
65
- }
66
- }).configure({ lowlight: lowlight() }),
212
+ };
213
+ }
214
+ });
215
+ const extensions = (placeholder, plugins, crossorigin, codeBlockLanguageLabels) => [
216
+ CodeBlockWithLanguageSelect.configure({
217
+ lowlight: lowlight(),
218
+ languageLabelMap: codeBlockLanguageLabels
219
+ }),
220
+ slashKeymap,
67
221
  Image(crossorigin),
68
222
  Youtube,
69
223
  StarterKit,
@@ -94,6 +248,7 @@ const extensions = (placeholder, plugins, crossorigin) => [
94
248
  Indent,
95
249
  Color,
96
250
  TextStyle,
251
+ UploadSkeleton,
97
252
  Iframe,
98
253
  Embed,
99
254
  Code.extend({
@@ -104,14 +259,15 @@ const extensions = (placeholder, plugins, crossorigin) => [
104
259
  Placeholder.configure({ placeholder }),
105
260
  ...plugins
106
261
  ];
107
- export default (element, content, { placeholder = i18n('placeholder'), plugins = [], crossorigin, ...props } = {}) => {
262
+ export default (element, content, { placeholder = i18n('placeholder'), plugins = [], crossorigin, codeBlockLanguageLabels = {}, ...props } = {}) => {
108
263
  const tt = new Editor({
109
264
  element,
110
265
  content,
111
266
  ...props,
112
- extensions: extensions(placeholder, plugins, crossorigin)
267
+ extensions: extensions(placeholder, plugins, crossorigin, codeBlockLanguageLabels)
113
268
  });
114
- tt.registerPlugin(emoji(tt));
115
- tt.registerPlugin(command(tt));
269
+ // Suggestion key handlers must run before default keymap handlers.
270
+ tt.registerPlugin(emoji(tt), (plugin, all) => [plugin, ...all]);
271
+ tt.registerPlugin(command(tt), (plugin, all) => [plugin, ...all]);
116
272
  return tt;
117
273
  };
package/package.json CHANGED
@@ -1,86 +1,88 @@
1
1
  {
2
2
  "name": "@seorii/tiptap",
3
- "version": "0.3.0-next.9",
3
+ "version": "0.4.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "svelte-kit sync && svelte-package",
7
7
  "build-page": "vite build",
8
8
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
9
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 .",
10
+ "lint": "prettier --check . && eslint .",
11
+ "format": "prettier --write .",
12
12
  "package": "svelte-kit sync && svelte-package && publint",
13
13
  "prepublishOnly": "npm run package",
14
14
  "page": "npm run build-page && node gh-pages.js"
15
15
  },
16
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",
17
+ "@eslint/js": "^9.39.3",
18
+ "@sveltejs/adapter-auto": "^7.0.1",
19
+ "@sveltejs/adapter-static": "^3.0.10",
20
+ "@sveltejs/kit": "^2.53.0",
21
+ "@sveltejs/package": "^2.5.7",
22
+ "@sveltejs/vite-plugin-svelte": "6.2.4",
23
+ "@types/sanitize-html": "^2.16.0",
24
+ "@typescript-eslint/eslint-plugin": "^8.56.0",
25
+ "@typescript-eslint/parser": "^8.56.0",
26
+ "eslint": "^9.39.3",
27
+ "eslint-config-prettier": "^10.1.8",
28
+ "eslint-plugin-svelte": "^3.15.0",
28
29
  "gh-pages": "^6.3.0",
30
+ "globals": "^17.3.0",
29
31
  "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",
32
+ "prettier": "^3.8.1",
33
+ "prettier-plugin-svelte": "^3.5.0",
34
+ "publint": "^0.3.17",
35
+ "svelte": "^5.53.2",
36
+ "svelte-check": "^4.4.3",
37
+ "svelte-eslint-parser": "^1.4.1",
36
38
  "tslib": "^2.8.1",
37
- "typescript": "^5.7.3",
38
- "vite": "^5.4.10"
39
+ "typescript": "^5.9.3",
40
+ "vite": "^7.3.1"
39
41
  },
40
42
  "peerDependencies": {
41
43
  "svelte": "^5.0.0"
42
44
  },
43
45
  "type": "module",
44
46
  "dependencies": {
45
- "@justinribeiro/lite-youtube": "^1.7.1",
47
+ "@justinribeiro/lite-youtube": "^1.9.0",
46
48
  "@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",
49
+ "@tiptap/core": "^2",
50
+ "@tiptap/extension-code": "^2",
51
+ "@tiptap/extension-code-block": "^2",
52
+ "@tiptap/extension-code-block-lowlight": "^2",
53
+ "@tiptap/extension-color": "^2",
54
+ "@tiptap/extension-dropcursor": "^2",
55
+ "@tiptap/extension-highlight": "^2",
56
+ "@tiptap/extension-image": "^2",
57
+ "@tiptap/extension-link": "^2",
58
+ "@tiptap/extension-ordered-list": "^2",
59
+ "@tiptap/extension-placeholder": "^2",
60
+ "@tiptap/extension-subscript": "^2",
61
+ "@tiptap/extension-superscript": "^2",
62
+ "@tiptap/extension-table": "^2",
63
+ "@tiptap/extension-table-cell": "^2",
64
+ "@tiptap/extension-table-header": "^2",
65
+ "@tiptap/extension-table-row": "^2",
66
+ "@tiptap/extension-text-align": "^2",
67
+ "@tiptap/extension-text-style": "^2",
68
+ "@tiptap/extension-underline": "^2",
69
+ "@tiptap/html": "^2",
70
+ "@tiptap/pm": "^2",
71
+ "@tiptap/starter-kit": "^2",
72
+ "@tiptap/suggestion": "^2",
71
73
  "emojis-keywords": "2.0.0",
72
74
  "emojis-list": "3.0.0",
73
75
  "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",
76
+ "nunui": "2.0.0-next.51",
77
+ "prosemirror-commands": "^1.7.1",
78
+ "prosemirror-model": "^1.25.4",
79
+ "prosemirror-state": "^1.4.4",
80
+ "prosemirror-tables": "^1.8.5",
81
+ "prosemirror-transform": "^1.11.0",
82
+ "prosemirror-view": "^1.41.6",
83
+ "sanitize-html": "^2.17.1",
84
+ "svelte-awesome-color-picker": "^4.1.1",
85
+ "svelte-tiptap": "^2",
84
86
  "tippy.js": "^6.3.7"
85
87
  },
86
88
  "exports": {
@@ -103,6 +105,10 @@
103
105
  "url": "https://github.com/seorii/tiptap.git"
104
106
  },
105
107
  "pnpm": {
108
+ "overrides": {
109
+ "@tiptap/extension-bubble-menu": "2.6.6",
110
+ "@tiptap/extension-floating-menu": "2.6.6"
111
+ },
106
112
  "onlyBuiltDependencies": [
107
113
  "@parcel/watcher",
108
114
  "esbuild"
@@ -1,13 +0,0 @@
1
- export declare const slashVisible: import("svelte/store").Writable<boolean>;
2
- export declare const slashItems: import("svelte/store").Writable<never[]>;
3
- export declare const slashLocaltion: import("svelte/store").Writable<{
4
- x: number;
5
- y: number;
6
- height: number;
7
- }>;
8
- export declare const slashProps: import("svelte/store").Writable<{
9
- editor: null;
10
- range: null;
11
- }>;
12
- export declare const slashDetail: import("svelte/store").Writable<null>;
13
- export declare const slashSelection: import("svelte/store").Writable<null>;
@@ -1,7 +0,0 @@
1
- import { writable } from 'svelte/store';
2
- export const slashVisible = writable(false);
3
- export const slashItems = writable([]);
4
- export const slashLocaltion = writable({ x: 0, y: 0, height: 0 });
5
- export const slashProps = writable({ editor: null, range: null });
6
- export const slashDetail = writable(null);
7
- export const slashSelection = writable(null);
@@ -1,26 +0,0 @@
1
- .ProseMirror {
2
- table .column-resize-handle {
3
- position: absolute;
4
- top: 0;
5
- right: -2px;
6
- bottom: -2px;
7
- width: 4px;
8
- pointer-events: none;
9
- background-color: var(--primary-light6);
10
- opacity: 0;
11
-
12
- .editable & {
13
- opacity: 1;
14
- }
15
- }
16
-
17
- &.resize-cursor {
18
- pointer-events: none;
19
-
20
- .editable & {
21
- pointer-events: initial;
22
- cursor: ew-resize;
23
- cursor: col-resize; /* stylelint-disable declaration-block-no-duplicate-properties */
24
- }
25
- }
26
- }
@@ -1,4 +0,0 @@
1
- @import './style/grip';
2
- @import './style/table';
3
- @import './style/cell';
4
- @import './style/resize';