@gradio/core 0.29.2 → 1.0.0-dev.3
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/CHANGELOG.md +103 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/src/Blocks.svelte +518 -999
- package/dist/src/Blocks.svelte.d.ts +31 -46
- package/dist/src/Embed.svelte +82 -55
- package/dist/src/Embed.svelte.d.ts +39 -30
- package/dist/src/Login.svelte +33 -29
- package/dist/src/Login.svelte.d.ts +21 -19
- package/dist/src/MountComponents.svelte +19 -25
- package/dist/src/MountComponents.svelte.d.ts +5 -28
- package/dist/src/{init.d.ts → _init.d.ts} +5 -4
- package/dist/src/{init.js → _init.js} +31 -108
- package/dist/src/api_docs/ApiBanner.svelte +12 -8
- package/dist/src/api_docs/ApiBanner.svelte.d.ts +22 -20
- package/dist/src/api_docs/ApiDocs.svelte +338 -246
- package/dist/src/api_docs/ApiDocs.svelte.d.ts +26 -24
- package/dist/src/api_docs/ApiRecorder.svelte +9 -3
- package/dist/src/api_docs/ApiRecorder.svelte.d.ts +19 -17
- package/dist/src/api_docs/CodeSnippet.svelte +60 -30
- package/dist/src/api_docs/CodeSnippet.svelte.d.ts +27 -24
- package/dist/src/api_docs/CopyButton.svelte +69 -13
- package/dist/src/api_docs/CopyButton.svelte.d.ts +18 -16
- package/dist/src/api_docs/CopyMarkdown.svelte +734 -0
- package/dist/src/api_docs/CopyMarkdown.svelte.d.ts +37 -0
- package/dist/src/api_docs/EndpointDetail.svelte +8 -6
- package/dist/src/api_docs/EndpointDetail.svelte.d.ts +20 -18
- package/dist/src/api_docs/IconArrowUpRight.svelte +34 -0
- package/dist/src/api_docs/IconArrowUpRight.svelte.d.ts +20 -0
- package/dist/src/api_docs/IconCaret.svelte +39 -0
- package/dist/src/api_docs/IconCaret.svelte.d.ts +20 -0
- package/dist/src/api_docs/IconHuggingChat.svelte +62 -0
- package/dist/src/api_docs/IconHuggingChat.svelte.d.ts +20 -0
- package/dist/src/api_docs/InputPayload.svelte +17 -11
- package/dist/src/api_docs/InputPayload.svelte.d.ts +25 -23
- package/dist/src/api_docs/InstallSnippet.svelte +9 -6
- package/dist/src/api_docs/InstallSnippet.svelte.d.ts +18 -16
- package/dist/src/api_docs/MCPSnippet.svelte +119 -99
- package/dist/src/api_docs/MCPSnippet.svelte.d.ts +59 -58
- package/dist/src/api_docs/NoApi.svelte +8 -5
- package/dist/src/api_docs/NoApi.svelte.d.ts +20 -18
- package/dist/src/api_docs/ParametersSnippet.svelte +8 -6
- package/dist/src/api_docs/ParametersSnippet.svelte.d.ts +21 -19
- package/dist/src/api_docs/RecordingSnippet.svelte +124 -110
- package/dist/src/api_docs/RecordingSnippet.svelte.d.ts +24 -22
- package/dist/src/api_docs/ResponseSnippet.svelte +7 -5
- package/dist/src/api_docs/ResponseSnippet.svelte.d.ts +21 -19
- package/dist/src/api_docs/Settings.svelte +73 -62
- package/dist/src/api_docs/Settings.svelte.d.ts +25 -23
- package/dist/src/api_docs/SettingsBanner.svelte +11 -8
- package/dist/src/api_docs/SettingsBanner.svelte.d.ts +20 -18
- package/dist/src/api_docs/TryButton.svelte +5 -3
- package/dist/src/api_docs/TryButton.svelte.d.ts +19 -17
- package/dist/src/api_docs/img/IconCheck.svelte +33 -0
- package/dist/src/api_docs/img/IconCheck.svelte.d.ts +26 -0
- package/dist/src/api_docs/img/IconCopy.svelte +40 -0
- package/dist/src/api_docs/img/IconCopy.svelte.d.ts +26 -0
- package/dist/src/api_docs/img/clear.svelte.d.ts +22 -21
- package/dist/src/dependency.d.ts +142 -0
- package/dist/src/dependency.js +653 -0
- package/dist/src/init.svelte.d.ts +78 -0
- package/dist/src/init.svelte.js +469 -0
- package/dist/src/init_utils.d.ts +32 -0
- package/dist/src/init_utils.js +73 -0
- package/dist/src/lang/en.json +10 -1
- package/dist/src/lang/get_lang_names.js +0 -3
- package/dist/src/lang/ru.json +10 -1
- package/dist/src/stores.d.ts +0 -21
- package/dist/src/stories/I18nMultiLanguageTestComponent.svelte +5 -3
- package/dist/src/stories/I18nMultiLanguageTestComponent.svelte.d.ts +16 -14
- package/dist/src/stories/I18nTestSetup.svelte +14 -10
- package/dist/src/stories/I18nTestSetup.svelte.d.ts +18 -16
- package/dist/src/types.d.ts +29 -25
- package/index.ts +1 -1
- package/package.json +59 -59
- package/src/Blocks.svelte +344 -1059
- package/src/MountComponents.svelte +17 -27
- package/src/{init.ts → _init.ts} +49 -126
- package/src/api_docs/ApiDocs.svelte +67 -62
- package/src/api_docs/ApiRecorder.svelte +3 -0
- package/src/api_docs/CodeSnippet.svelte +20 -5
- package/src/api_docs/CopyButton.svelte +61 -7
- package/src/api_docs/CopyMarkdown.svelte +734 -0
- package/src/api_docs/IconArrowUpRight.svelte +34 -0
- package/src/api_docs/IconCaret.svelte +39 -0
- package/src/api_docs/IconHuggingChat.svelte +62 -0
- package/src/api_docs/MCPSnippet.svelte +24 -46
- package/src/api_docs/NoApi.svelte +1 -1
- package/src/api_docs/ParametersSnippet.svelte +1 -1
- package/src/api_docs/ResponseSnippet.svelte +1 -1
- package/src/api_docs/Settings.svelte +11 -11
- package/src/api_docs/img/IconCheck.svelte +33 -0
- package/src/api_docs/img/IconCopy.svelte +40 -0
- package/src/dependency.ts +880 -0
- package/src/init.svelte.ts +717 -0
- package/src/init_utils.ts +99 -0
- package/src/lang/en.json +10 -1
- package/src/lang/get_lang_names.js +0 -3
- package/src/lang/ru.json +10 -1
- package/src/stores.ts +22 -22
- package/src/types.ts +54 -43
- package/dist/src/Render.svelte +0 -105
- package/dist/src/Render.svelte.d.ts +0 -31
- package/dist/src/RenderComponent.svelte +0 -72
- package/dist/src/RenderComponent.svelte.d.ts +0 -33
- package/src/Render.svelte +0 -126
- package/src/RenderComponent.svelte +0 -91
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { ComponentMeta, Dependency } from "../types";
|
|
3
2
|
import type { Client } from "@gradio/client";
|
|
4
3
|
import type { Payload } from "../types";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
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> {
|
|
5
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
6
|
+
$$bindings?: Bindings;
|
|
7
|
+
} & Exports;
|
|
8
|
+
(internal: unknown, props: Props & {
|
|
9
|
+
$$events?: Events;
|
|
10
|
+
$$slots?: Slots;
|
|
11
|
+
}): Exports & {
|
|
12
|
+
$set?: any;
|
|
13
|
+
$on?: any;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
close: CustomEvent<any>;
|
|
17
|
-
} & {
|
|
18
|
-
[evt: string]: CustomEvent<any>;
|
|
19
|
-
};
|
|
20
|
-
slots: {};
|
|
21
|
-
exports?: {} | undefined;
|
|
22
|
-
bindings?: string | undefined;
|
|
23
|
-
};
|
|
24
|
-
export type ApiDocsProps = typeof __propDef.props;
|
|
25
|
-
export type ApiDocsEvents = typeof __propDef.events;
|
|
26
|
-
export type ApiDocsSlots = typeof __propDef.slots;
|
|
27
|
-
export default class ApiDocs extends SvelteComponent<ApiDocsProps, ApiDocsEvents, ApiDocsSlots> {
|
|
15
|
+
z_$$bindings?: Bindings;
|
|
28
16
|
}
|
|
29
|
-
|
|
17
|
+
declare const ApiDocs: $$__sveltets_2_IsomorphicComponent<{
|
|
18
|
+
dependencies: Dependency[];
|
|
19
|
+
root: string;
|
|
20
|
+
app: Awaited<ReturnType<typeof Client.connect>>;
|
|
21
|
+
space_id: string | null;
|
|
22
|
+
root_node: ComponentMeta;
|
|
23
|
+
username: string | null;
|
|
24
|
+
api_calls?: Payload[];
|
|
25
|
+
}, {
|
|
26
|
+
close: CustomEvent<any>;
|
|
27
|
+
} & {
|
|
28
|
+
[evt: string]: CustomEvent<any>;
|
|
29
|
+
}, {}, {}, string>;
|
|
30
|
+
type ApiDocs = InstanceType<typeof ApiDocs>;
|
|
31
|
+
export default ApiDocs;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Payload, Dependency } from "../types";
|
|
3
|
+
import { BaseButton as Button } from "@gradio/button";
|
|
4
|
+
|
|
5
|
+
export let api_calls: Payload[] = [];
|
|
6
|
+
export let dependencies: Dependency[];
|
|
7
|
+
|
|
8
|
+
$: console.log("API CALLS UPDATED:", api_calls);
|
|
9
|
+
$: console.log("DEPENDENCIES:", dependencies);
|
|
4
10
|
</script>
|
|
5
11
|
|
|
6
12
|
<div id="api-recorder">
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Payload, Dependency } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
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> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
7
12
|
};
|
|
8
|
-
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
exports?: {} | undefined;
|
|
13
|
-
bindings?: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
export type ApiRecorderProps = typeof __propDef.props;
|
|
16
|
-
export type ApiRecorderEvents = typeof __propDef.events;
|
|
17
|
-
export type ApiRecorderSlots = typeof __propDef.slots;
|
|
18
|
-
export default class ApiRecorder extends SvelteComponent<ApiRecorderProps, ApiRecorderEvents, ApiRecorderSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
19
14
|
}
|
|
20
|
-
|
|
15
|
+
declare const ApiRecorder: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
api_calls?: Payload[];
|
|
17
|
+
dependencies: Dependency[];
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type ApiRecorder = InstanceType<typeof ApiRecorder>;
|
|
22
|
+
export default ApiRecorder;
|
|
@@ -1,29 +1,53 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ComponentMeta, Dependency } from "../types";
|
|
3
|
+
import CopyButton from "./CopyButton.svelte";
|
|
4
|
+
import { represent_value, is_potentially_nested_file_data } from "./utils";
|
|
5
|
+
import { Block } from "@gradio/atoms";
|
|
6
|
+
import EndpointDetail from "./EndpointDetail.svelte";
|
|
7
|
+
|
|
8
|
+
interface EndpointParameter {
|
|
9
|
+
label: string;
|
|
10
|
+
type: string;
|
|
11
|
+
python_type: { type: string };
|
|
12
|
+
component: string;
|
|
13
|
+
example_input: string;
|
|
14
|
+
serializer: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export let dependency: Dependency;
|
|
18
|
+
export let root: string;
|
|
19
|
+
export let api_prefix: string;
|
|
20
|
+
export let space_id: string | null;
|
|
21
|
+
export let endpoint_parameters: any;
|
|
22
|
+
export let username: string | null;
|
|
23
|
+
export let current_language: "python" | "javascript" | "bash" | "mcp";
|
|
24
|
+
export let api_description: string | null = null;
|
|
25
|
+
export let analytics: Record<string, any>;
|
|
26
|
+
export let markdown_code_snippets: Record<string, Record<string, string>>;
|
|
27
|
+
|
|
28
|
+
let python_code: HTMLElement;
|
|
29
|
+
let js_code: HTMLElement;
|
|
30
|
+
let bash_post_code: HTMLElement;
|
|
31
|
+
let bash_get_code: HTMLElement;
|
|
32
|
+
|
|
33
|
+
let has_file_path = endpoint_parameters.some((param: EndpointParameter) =>
|
|
34
|
+
is_potentially_nested_file_data(param.example_input)
|
|
35
|
+
);
|
|
36
|
+
let blob_components = ["Audio", "File", "Image", "Video"];
|
|
37
|
+
let blob_examples: any[] = endpoint_parameters.filter(
|
|
38
|
+
(param: EndpointParameter) => blob_components.includes(param.component)
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
$: normalised_api_prefix = api_prefix ? api_prefix : "/";
|
|
42
|
+
$: normalised_root = root.replace(/\/$/, "");
|
|
43
|
+
|
|
44
|
+
$: markdown_code_snippets[
|
|
45
|
+
dependency.api_name as keyof typeof markdown_code_snippets
|
|
46
|
+
] = {
|
|
47
|
+
python: python_code?.innerText || "",
|
|
48
|
+
javascript: js_code?.innerText || "",
|
|
49
|
+
bash: bash_post_code?.innerText || ""
|
|
50
|
+
};
|
|
27
51
|
</script>
|
|
28
52
|
|
|
29
53
|
<div class="container">
|
|
@@ -32,7 +56,7 @@ $: normalised_root = root.replace(/\/$/, "");
|
|
|
32
56
|
description={api_description}
|
|
33
57
|
{analytics}
|
|
34
58
|
/>
|
|
35
|
-
{
|
|
59
|
+
<div class:hidden={current_language !== "python"}>
|
|
36
60
|
<Block>
|
|
37
61
|
<code>
|
|
38
62
|
<div class="copy">
|
|
@@ -67,7 +91,8 @@ result = client.<span class="highlight">predict</span
|
|
|
67
91
|
</div>
|
|
68
92
|
</code>
|
|
69
93
|
</Block>
|
|
70
|
-
|
|
94
|
+
</div>
|
|
95
|
+
<div class:hidden={current_language !== "javascript"}>
|
|
71
96
|
<Block>
|
|
72
97
|
<code>
|
|
73
98
|
<div class="copy">
|
|
@@ -116,7 +141,8 @@ result = client.<span class="highlight">predict</span
|
|
|
116
141
|
</div>
|
|
117
142
|
</code>
|
|
118
143
|
</Block>
|
|
119
|
-
|
|
144
|
+
</div>
|
|
145
|
+
<div class:hidden={current_language !== "bash"}>
|
|
120
146
|
<Block>
|
|
121
147
|
<code>
|
|
122
148
|
<div class="copy">
|
|
@@ -140,7 +166,7 @@ result = client.<span class="highlight">predict</span
|
|
|
140
166
|
</div>
|
|
141
167
|
</code>
|
|
142
168
|
</Block>
|
|
143
|
-
|
|
169
|
+
</div>
|
|
144
170
|
</div>
|
|
145
171
|
|
|
146
172
|
<style>
|
|
@@ -184,4 +210,8 @@ result = client.<span class="highlight">predict</span
|
|
|
184
210
|
.api-name {
|
|
185
211
|
color: var(--color-accent);
|
|
186
212
|
}
|
|
213
|
+
|
|
214
|
+
.hidden {
|
|
215
|
+
display: none;
|
|
216
|
+
}
|
|
187
217
|
</style>
|
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Dependency } from "../types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
analytics: Record<string, any>;
|
|
2
|
+
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> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {};
|
|
19
|
-
exports?: {} | undefined;
|
|
20
|
-
bindings?: string | undefined;
|
|
21
|
-
};
|
|
22
|
-
export type CodeSnippetProps = typeof __propDef.props;
|
|
23
|
-
export type CodeSnippetEvents = typeof __propDef.events;
|
|
24
|
-
export type CodeSnippetSlots = typeof __propDef.slots;
|
|
25
|
-
export default class CodeSnippet extends SvelteComponent<CodeSnippetProps, CodeSnippetEvents, CodeSnippetSlots> {
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
26
14
|
}
|
|
27
|
-
|
|
15
|
+
declare const CodeSnippet: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
dependency: Dependency;
|
|
17
|
+
root: string;
|
|
18
|
+
api_prefix: string;
|
|
19
|
+
space_id: string | null;
|
|
20
|
+
endpoint_parameters: any;
|
|
21
|
+
username: string | null;
|
|
22
|
+
current_language: "python" | "javascript" | "bash" | "mcp";
|
|
23
|
+
api_description?: string | null;
|
|
24
|
+
analytics: Record<string, any>;
|
|
25
|
+
markdown_code_snippets: Record<string, Record<string, string>>;
|
|
26
|
+
}, {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
}, {}, {}, string>;
|
|
29
|
+
type CodeSnippet = InstanceType<typeof CodeSnippet>;
|
|
30
|
+
export default CodeSnippet;
|
|
@@ -1,15 +1,71 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import IconCopy from "./img/IconCopy.svelte";
|
|
3
|
+
import IconCheck from "./img/IconCheck.svelte";
|
|
4
|
+
|
|
5
|
+
export let code: string;
|
|
6
|
+
|
|
7
|
+
let copied = false;
|
|
8
|
+
|
|
9
|
+
function copy(): void {
|
|
10
|
+
navigator.clipboard.writeText(code);
|
|
11
|
+
copied = true;
|
|
12
|
+
setTimeout(() => {
|
|
13
|
+
copied = false;
|
|
14
|
+
}, 1500);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
$: copied;
|
|
11
18
|
</script>
|
|
12
19
|
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
<button on:click={copy} class="copy-button" aria-live="polite">
|
|
21
|
+
<span
|
|
22
|
+
class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0"
|
|
23
|
+
>
|
|
24
|
+
{#if copied}
|
|
25
|
+
<IconCheck classNames="w-3 h-3 max-sm:w-2.5 max-sm:h-2.5" />
|
|
26
|
+
{:else}
|
|
27
|
+
<IconCopy classNames="w-3 h-3 max-sm:w-2.5 max-sm:h-2.5" />
|
|
28
|
+
{/if}
|
|
29
|
+
</span>
|
|
30
|
+
</button>
|
|
31
|
+
|
|
32
|
+
<style>
|
|
33
|
+
.copy-button {
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 4px;
|
|
37
|
+
height: 24px;
|
|
38
|
+
padding-left: 8px;
|
|
39
|
+
padding-right: 8px;
|
|
40
|
+
font-size: 11px;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
color: rgb(31, 41, 55);
|
|
43
|
+
border: 1px solid rgb(229, 231, 235);
|
|
44
|
+
border-radius: 6px;
|
|
45
|
+
background-color: white;
|
|
46
|
+
|
|
47
|
+
@media (max-width: 640px) {
|
|
48
|
+
gap: 2px;
|
|
49
|
+
height: 20px;
|
|
50
|
+
padding-left: 6px;
|
|
51
|
+
padding-right: 6px;
|
|
52
|
+
font-size: 9px;
|
|
53
|
+
border-top-left-radius: 4px;
|
|
54
|
+
border-bottom-left-radius: 4px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:hover {
|
|
58
|
+
box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@media (prefers-color-scheme: dark) {
|
|
62
|
+
border-color: rgb(38, 38, 38);
|
|
63
|
+
background-color: rgb(10, 10, 10);
|
|
64
|
+
color: rgb(229, 231, 235);
|
|
65
|
+
|
|
66
|
+
&:hover {
|
|
67
|
+
background-color: rgb(38, 38, 38);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
exports?: {} | undefined;
|
|
11
|
-
bindings?: string | undefined;
|
|
12
|
-
};
|
|
13
|
-
export type CopyButtonProps = typeof __propDef.props;
|
|
14
|
-
export type CopyButtonEvents = typeof __propDef.events;
|
|
15
|
-
export type CopyButtonSlots = typeof __propDef.slots;
|
|
16
|
-
export default class CopyButton extends SvelteComponent<CopyButtonProps, CopyButtonEvents, CopyButtonSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
17
13
|
}
|
|
18
|
-
|
|
14
|
+
declare const CopyButton: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
code: string;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type CopyButton = InstanceType<typeof CopyButton>;
|
|
20
|
+
export default CopyButton;
|