@seorii/tiptap 0.2.9 → 0.2.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.
@@ -23,7 +23,7 @@ const san = (body) => sanitizeHtml(body, {
23
23
  embed: ['src', 'type', 'frameborder', 'allowfullscreen']
24
24
  },
25
25
  });
26
- export let body = '', editable = false, ref = null, options = {};
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
29
  const tiptap = setContext('editor', writable(null));
@@ -50,6 +50,7 @@ if (browser) {
50
50
  content = null;
51
51
  body = last = content;
52
52
  });
53
+ loaded = true;
53
54
  });
54
55
  return () => {
55
56
  mounted = false;
@@ -101,7 +102,11 @@ function selectItem(index) {
101
102
  <div class="wrapper">
102
103
  <div bind:this={element} class="target" on:keydown|capture={handleKeydown}></div>
103
104
  {#if !$tiptap}
104
- {i18n('loading')}
105
+ {#if $$slots.preloader}
106
+ <slot name="preloader"/>
107
+ {:else}
108
+ {i18n('loading')}
109
+ {/if}
105
110
  {/if}
106
111
  </div>
107
112
  {#if editable}
@@ -7,6 +7,7 @@ declare const __propDef: {
7
7
  editable?: boolean | undefined;
8
8
  ref?: null | undefined;
9
9
  options?: {} | undefined;
10
+ loaded?: boolean | undefined;
10
11
  imageUpload?: UploadFn | undefined;
11
12
  style?: string | undefined;
12
13
  blocks?: any[] | undefined;
@@ -16,6 +17,7 @@ declare const __propDef: {
16
17
  [evt: string]: CustomEvent<any>;
17
18
  };
18
19
  slots: {
20
+ preloader: {};
19
21
  bubble: {};
20
22
  };
21
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seorii/tiptap",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "svelte-kit sync && svelte-package",