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 {};
|