@tableslayer/ui 0.2.7 → 0.2.8
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.
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { onMount, onDestroy } from 'svelte';
|
|
3
3
|
import { Editor, type JSONContent } from '@tiptap/core';
|
|
4
4
|
import StarterKit from '@tiptap/starter-kit';
|
|
5
|
-
import { Link } from '@tiptap/extension-link';
|
|
6
5
|
import Typography from '@tiptap/extension-typography';
|
|
7
6
|
import {
|
|
8
7
|
IconBold,
|
|
@@ -114,8 +113,10 @@
|
|
|
114
113
|
|
|
115
114
|
// Only update if content actually changed (avoid infinite loops)
|
|
116
115
|
if (JSON.stringify(currentContent) !== JSON.stringify(content)) {
|
|
117
|
-
//
|
|
118
|
-
editor.commands.setContent(content || { type: 'doc', content: [{ type: 'paragraph' }] }
|
|
116
|
+
// External content is not a user edit, so don't echo it through onUpdate/onChange
|
|
117
|
+
editor.commands.setContent(content || { type: 'doc', content: [{ type: 'paragraph' }] }, {
|
|
118
|
+
emitUpdate: false
|
|
119
|
+
});
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
});
|
|
@@ -158,14 +159,16 @@
|
|
|
158
159
|
editable,
|
|
159
160
|
element: element,
|
|
160
161
|
extensions: [
|
|
161
|
-
StarterKit
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
162
|
+
// StarterKit already bundles Link; registering it twice duplicates its plugins
|
|
163
|
+
StarterKit.configure({
|
|
164
|
+
link: {
|
|
165
|
+
openOnClick: false,
|
|
166
|
+
HTMLAttributes: {
|
|
167
|
+
class: 'editor-link'
|
|
168
|
+
}
|
|
167
169
|
}
|
|
168
|
-
})
|
|
170
|
+
}),
|
|
171
|
+
Typography
|
|
169
172
|
],
|
|
170
173
|
content: initialContent, // Pass content with fallback for null/undefined
|
|
171
174
|
onSelectionUpdate: () => {
|
|
@@ -567,7 +570,7 @@
|
|
|
567
570
|
<div class="editor__toolbarTextOptions">
|
|
568
571
|
<button
|
|
569
572
|
onclick={() => editor?.chain().focus().setParagraph().run()}
|
|
570
|
-
class
|
|
573
|
+
class={['editor__toolbarTextP', isParagraph && 'isActive']}
|
|
571
574
|
>
|
|
572
575
|
Normal
|
|
573
576
|
</button>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tableslayer/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"license": "FSL-1.1-ALv2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -74,7 +74,6 @@
|
|
|
74
74
|
"@floating-ui/dom": "^1.8.0",
|
|
75
75
|
"@tabler/icons-svelte": "^3.48.0",
|
|
76
76
|
"@tiptap/core": "^3.31.3",
|
|
77
|
-
"@tiptap/extension-link": "^3.31.3",
|
|
78
77
|
"@tiptap/extension-typography": "^3.31.3",
|
|
79
78
|
"@tiptap/pm": "^3.31.3",
|
|
80
79
|
"@tiptap/starter-kit": "^3.31.3",
|