fuma 1.0.13 → 1.0.15
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.
- package/dist/ui/button/ButtonCopy.svelte +4 -1
- package/dist/ui/button/ButtonCopy.svelte.d.ts +2 -0
- package/dist/ui/input/textRich/InputTextRich.svelte +1 -1
- package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +1 -0
- package/dist/ui/input/textRich/ToolsBar.svelte +1 -4
- package/dist/ui/input/textRich/ToolsBar.svelte.d.ts +2 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { mdiClipboardTextOutline } from '@mdi/js'
|
|
3
3
|
import { toast } from 'svelte-sonner'
|
|
4
4
|
import { Icon } from '../icon/index.js'
|
|
5
|
+
import { createEventDispatcher } from 'svelte'
|
|
5
6
|
let valueOrGetValue: string | (() => Promise<string>)
|
|
6
7
|
export { valueOrGetValue as value }
|
|
7
8
|
export let title = ''
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
export { klass as class }
|
|
13
14
|
|
|
14
15
|
let isLoading = false
|
|
16
|
+
const disptach = createEventDispatcher<{ success: void }>()
|
|
15
17
|
|
|
16
18
|
async function loadValue(): Promise<string> {
|
|
17
19
|
if (typeof valueOrGetValue === 'string') return valueOrGetValue
|
|
@@ -27,6 +29,7 @@
|
|
|
27
29
|
.writeText(value)
|
|
28
30
|
.then(() => {
|
|
29
31
|
toast.success(successMessage)
|
|
32
|
+
disptach('success')
|
|
30
33
|
})
|
|
31
34
|
.catch((error) => {
|
|
32
35
|
toast.error(error)
|
|
@@ -36,7 +39,7 @@
|
|
|
36
39
|
|
|
37
40
|
<div class="relative">
|
|
38
41
|
{#if isLoading}
|
|
39
|
-
<span class="loading loading-spinner absolute left-1 top-1 scale-125 opacity-25"
|
|
42
|
+
<span class="loading loading-spinner absolute left-1 top-1 scale-125 opacity-25"></span>
|
|
40
43
|
{/if}
|
|
41
44
|
<button
|
|
42
45
|
class={klass ? klass : `btn btn-sm ${label ? '' : ' btn-square'}`}
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<FormControl {...$$restProps} let:key>
|
|
56
56
|
<div class="bordered relative rounded-lg border">
|
|
57
57
|
{#if editor}
|
|
58
|
-
<ToolsBar {editor} class={classToolbar} />
|
|
58
|
+
<ToolsBar {editor} class={classToolbar} on:insertMedia />
|
|
59
59
|
{/if}
|
|
60
60
|
<div bind:this={element} class="min-h-[20rem] p-4 pb-10" />
|
|
61
61
|
</div>
|