fuma 1.0.14 → 1.0.16

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.
@@ -25,6 +25,11 @@
25
25
  }
26
26
  })
27
27
 
28
+ export function setImage(image: { src: string; alt: string }) {
29
+ if (!editor) return false
30
+ return editor.commands.setImage(image)
31
+ }
32
+
28
33
  function initEditor() {
29
34
  const valueAsHtml = !value.startsWith('{') && value !== 'null'
30
35
  editor = new Editor({
@@ -55,7 +60,7 @@
55
60
  <FormControl {...$$restProps} let:key>
56
61
  <div class="bordered relative rounded-lg border">
57
62
  {#if editor}
58
- <ToolsBar {editor} class={classToolbar} />
63
+ <ToolsBar {editor} class={classToolbar} on:insertMedia />
59
64
  {/if}
60
65
  <div bind:this={element} class="min-h-[20rem] p-4 pb-10" />
61
66
  </div>
@@ -1,6 +1,11 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
+ setImage?: ((image: {
5
+ src: string;
6
+ alt: string;
7
+ }) => boolean) | undefined;
8
+ } & {
4
9
  class?: string | undefined;
5
10
  classLabel?: string | undefined;
6
11
  key?: string | undefined;
@@ -19,6 +24,7 @@ declare const __propDef: {
19
24
  classToolbar?: string | undefined;
20
25
  };
21
26
  events: {
27
+ insertMedia: CustomEvent<void>;
22
28
  change: CustomEvent<void>;
23
29
  } & {
24
30
  [evt: string]: CustomEvent<any>;
@@ -29,5 +35,9 @@ export type InputTextRichProps = typeof __propDef.props;
29
35
  export type InputTextRichEvents = typeof __propDef.events;
30
36
  export type InputTextRichSlots = typeof __propDef.slots;
31
37
  export default class InputTextRich extends SvelteComponent<InputTextRichProps, InputTextRichEvents, InputTextRichSlots> {
38
+ get setImage(): (image: {
39
+ src: string;
40
+ alt: string;
41
+ }) => boolean;
32
42
  }
33
43
  export {};
@@ -56,9 +56,6 @@
56
56
 
57
57
  <div class="mx-1 my-auto h-6 border border-y-0 border-l-0" />
58
58
 
59
- <ToolMenuInsert
60
- {editor}
61
- on:insertMedia={() => toast.warning('TODO: import SelectMedia like benev.io')}
62
- />
59
+ <ToolMenuInsert {editor} on:insertMedia />
63
60
  </div>
64
61
  </div>
@@ -6,6 +6,8 @@ declare const __propDef: {
6
6
  class?: string | undefined;
7
7
  };
8
8
  events: {
9
+ insertMedia: CustomEvent<void>;
10
+ } & {
9
11
  [evt: string]: CustomEvent<any>;
10
12
  };
11
13
  slots: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",