@functionalcms/svelte-components 4.36.3 → 4.36.5
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.
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
|
|
4
|
+
export let text: string;
|
|
5
|
+
|
|
6
|
+
const dispatch = createEventDispatcher<{ copy: string; fail: never }>();
|
|
7
|
+
|
|
8
|
+
const copy = () => {
|
|
9
|
+
navigator.clipboard.writeText(text).then(
|
|
10
|
+
() => dispatch("copy", text),
|
|
11
|
+
(e) => dispatch("fail")
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<slot {copy} />
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
+
default: any;
|
|
16
|
+
} ? Props extends Record<string, never> ? any : {
|
|
17
|
+
children?: any;
|
|
18
|
+
} : {});
|
|
19
|
+
declare const CopyToClipboard: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
+
text: string;
|
|
21
|
+
}, {
|
|
22
|
+
default: {
|
|
23
|
+
copy: () => void;
|
|
24
|
+
};
|
|
25
|
+
}>, {
|
|
26
|
+
copy: CustomEvent<string>;
|
|
27
|
+
fail: CustomEvent<never>;
|
|
28
|
+
} & {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {
|
|
31
|
+
default: {
|
|
32
|
+
copy: () => void;
|
|
33
|
+
};
|
|
34
|
+
}, {}, string>;
|
|
35
|
+
type CopyToClipboard = InstanceType<typeof CopyToClipboard>;
|
|
36
|
+
export default CopyToClipboard;
|