@svadmin/editor 0.7.19 → 0.7.21

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.
@@ -11,9 +11,9 @@
11
11
 
12
12
  const bubbleMenuKey = new PluginKey('svadminBubbleMenu');
13
13
 
14
- let { editor } = $props<{
14
+ let { editor }: {
15
15
  editor: Editor;
16
- }>();
16
+ } = $props();
17
17
 
18
18
  let menuElement: HTMLDivElement | undefined = $state();
19
19
 
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">
2
- let { onselect, onclose } = $props<{
2
+ let { onselect, onclose }: {
3
3
  onselect: (color: string) => void;
4
4
  onclose?: () => void;
5
- }>();
5
+ } = $props();
6
6
 
7
7
  const colors = [
8
8
  // Row 1: Reds
@@ -12,9 +12,9 @@
12
12
 
13
13
  const floatingMenuKey = new PluginKey('svadminFloatingMenu');
14
14
 
15
- let { editor } = $props<{
15
+ let { editor }: {
16
16
  editor: Editor;
17
- }>();
17
+ } = $props();
18
18
 
19
19
  let menuElement: HTMLDivElement | undefined = $state();
20
20
 
@@ -3,11 +3,11 @@
3
3
  import { ImageIcon, Upload, Link as LinkIcon, RotateCw } from '@lucide/svelte';
4
4
  import { t } from '@svadmin/core';
5
5
 
6
- let { editor, onUpload, onclose } = $props<{
6
+ let { editor, onUpload, onclose }: {
7
7
  editor: Editor;
8
- onUpload?: (file: File) => Promise<string>;
9
- onclose?: () => void;
10
- }>();
8
+ onUpload?: ((file: File) => Promise<string>) | undefined;
9
+ onclose?: (() => void) | undefined;
10
+ } = $props();
11
11
 
12
12
  let mode: 'url' | 'upload' = $state('url');
13
13
  let url = $state('');
@@ -61,7 +61,7 @@
61
61
  function insertByUrl() {
62
62
  if (!url.trim()) return;
63
63
  if (disposed || editor.isDestroyed || !editor.isEditable) return;
64
- editor.chain().focus().setImage({ src: url, alt: alt || undefined }).run();
64
+ editor.chain().focus().setImage({ src: url, ...(alt ? { alt } : {}) }).run();
65
65
  url = '';
66
66
  alt = '';
67
67
  close();
@@ -1,8 +1,8 @@
1
1
  import type { Editor } from '@tiptap/core';
2
2
  type $$ComponentProps = {
3
3
  editor: Editor;
4
- onUpload?: (file: File) => Promise<string>;
5
- onclose?: () => void;
4
+ onUpload?: ((file: File) => Promise<string>) | undefined;
5
+ onclose?: (() => void) | undefined;
6
6
  };
7
7
  declare const ImageUpload: import("svelte").Component<$$ComponentProps, {}, "">;
8
8
  type ImageUpload = ReturnType<typeof ImageUpload>;
@@ -3,10 +3,10 @@
3
3
  import { ExternalLink, Unlink, Check } from '@lucide/svelte';
4
4
  import { t } from '@svadmin/core';
5
5
 
6
- let { editor, onclose } = $props<{
6
+ let { editor, onclose }: {
7
7
  editor: Editor;
8
8
  onclose?: () => void;
9
- }>();
9
+ } = $props();
10
10
 
11
11
  let url = $state('');
12
12
  let openInNewTab = $state(true);
@@ -14,8 +14,8 @@
14
14
  // Initialize from current link
15
15
  $effect(() => {
16
16
  const attrs = editor.getAttributes('link');
17
- url = (attrs.href as string) ?? '';
18
- openInNewTab = attrs.target === '_blank';
17
+ url = (attrs['href'] as string) ?? '';
18
+ openInNewTab = attrs['target'] === '_blank';
19
19
  });
20
20
 
21
21
  function applyLink() {
@@ -8,10 +8,10 @@
8
8
  import ToolbarButton from './ToolbarButton.svelte';
9
9
  import { t } from '@svadmin/core';
10
10
 
11
- let { editor, onclose } = $props<{
11
+ let { editor, onclose }: {
12
12
  editor: Editor;
13
13
  onclose?: () => void;
14
- }>();
14
+ } = $props();
15
15
 
16
16
  const isInTable = $derived(editor.isActive('table'));
17
17
 
@@ -19,11 +19,11 @@
19
19
  } from '@lucide/svelte';
20
20
  import { t } from '@svadmin/core';
21
21
 
22
- let { editor, onUpload, preset = 'full' } = $props<{
22
+ let { editor, onUpload, preset = 'full' }: {
23
23
  editor: Editor;
24
24
  onUpload?: (file: File) => Promise<string>;
25
25
  preset?: 'full' | 'minimal' | 'prose';
26
- }>();
26
+ } = $props();
27
27
 
28
28
  // ─── Reactive state: re-read on every transaction ────────────
29
29
  let txn = $state(0);
@@ -1,13 +1,13 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
 
4
- let { active = false, disabled = false, title = '', onclick, children } = $props<{
4
+ let { active = false, disabled = false, title = '', onclick, children }: {
5
5
  active?: boolean;
6
6
  disabled?: boolean;
7
7
  title?: string;
8
8
  onclick?: () => void;
9
9
  children: Snippet;
10
- }>();
10
+ } = $props();
11
11
  </script>
12
12
 
13
13
  <button
@@ -1,9 +1,9 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
 
4
- let { children } = $props<{
4
+ let { children }: {
5
5
  children: Snippet;
6
- }>();
6
+ } = $props();
7
7
  </script>
8
8
 
9
9
  <div class="svadmin-toolbar-group">
@@ -1,10 +1,10 @@
1
1
  <script lang="ts">
2
- let { value = '', options = [], title = '', onchange } = $props<{
2
+ let { value = '', options = [], title = '', onchange }: {
3
3
  value?: string;
4
4
  options: Array<{ value: string; label: string }>;
5
5
  title?: string;
6
6
  onchange?: (value: string) => void;
7
- }>();
7
+ } = $props();
8
8
  </script>
9
9
 
10
10
  <select
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/editor",
3
- "version": "0.7.19",
3
+ "version": "0.7.21",
4
4
  "description": "Modern Tiptap-based rich text editor for Svelte 5 — headless, modular, production-ready",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -37,35 +37,35 @@
37
37
  },
38
38
  "peerDependencies": {
39
39
  "svelte": "^5.56.10",
40
- "@svadmin/core": "^0.78.0"
40
+ "@svadmin/core": "^0.80.0"
41
41
  },
42
42
  "dependencies": {
43
- "@lucide/svelte": "^1.35.0",
44
- "@tiptap/core": "^3.30.5",
45
- "@tiptap/extension-bubble-menu": "^3.30.5",
46
- "@tiptap/extension-character-count": "^3.30.5",
47
- "@tiptap/extension-code-block-lowlight": "^3.30.5",
48
- "@tiptap/extension-color": "^3.30.5",
49
- "@tiptap/extension-floating-menu": "^3.30.5",
50
- "@tiptap/extension-highlight": "^3.30.5",
51
- "@tiptap/extension-image": "^3.30.5",
52
- "@tiptap/extension-link": "^3.30.5",
53
- "@tiptap/extension-placeholder": "^3.30.5",
54
- "@tiptap/extension-subscript": "^3.30.5",
55
- "@tiptap/extension-superscript": "^3.30.5",
56
- "@tiptap/extension-table": "^3.30.5",
57
- "@tiptap/extension-table-cell": "^3.30.5",
58
- "@tiptap/extension-table-header": "^3.30.5",
59
- "@tiptap/extension-table-row": "^3.30.5",
60
- "@tiptap/extension-task-item": "^3.30.5",
61
- "@tiptap/extension-task-list": "^3.30.5",
62
- "@tiptap/extension-text-align": "^3.30.5",
63
- "@tiptap/extension-text-style": "^3.30.5",
64
- "@tiptap/extension-typography": "^3.30.5",
65
- "@tiptap/extension-underline": "^3.30.5",
66
- "@tiptap/pm": "^3.30.5",
67
- "@tiptap/starter-kit": "^3.30.5",
68
- "@tiptap/suggestion": "^3.30.5",
43
+ "@lucide/svelte": "^1.71.0",
44
+ "@tiptap/core": "^3.33.0",
45
+ "@tiptap/extension-bubble-menu": "^3.33.0",
46
+ "@tiptap/extension-character-count": "^3.33.0",
47
+ "@tiptap/extension-code-block-lowlight": "^3.33.0",
48
+ "@tiptap/extension-color": "^3.33.0",
49
+ "@tiptap/extension-floating-menu": "^3.33.0",
50
+ "@tiptap/extension-highlight": "^3.33.0",
51
+ "@tiptap/extension-image": "^3.33.0",
52
+ "@tiptap/extension-link": "^3.33.0",
53
+ "@tiptap/extension-placeholder": "^3.33.0",
54
+ "@tiptap/extension-subscript": "^3.33.0",
55
+ "@tiptap/extension-superscript": "^3.33.0",
56
+ "@tiptap/extension-table": "^3.33.0",
57
+ "@tiptap/extension-table-cell": "^3.33.0",
58
+ "@tiptap/extension-table-header": "^3.33.0",
59
+ "@tiptap/extension-table-row": "^3.33.0",
60
+ "@tiptap/extension-task-item": "^3.33.0",
61
+ "@tiptap/extension-task-list": "^3.33.0",
62
+ "@tiptap/extension-text-align": "^3.33.0",
63
+ "@tiptap/extension-text-style": "^3.33.0",
64
+ "@tiptap/extension-typography": "^3.33.0",
65
+ "@tiptap/extension-underline": "^3.33.0",
66
+ "@tiptap/pm": "^3.33.0",
67
+ "@tiptap/starter-kit": "^3.33.0",
68
+ "@tiptap/suggestion": "^3.33.0",
69
69
  "lowlight": "^3.3.0"
70
70
  },
71
71
  "scripts": {