File size: 1,945 Bytes
0d31e31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<script context="module" lang="ts">
    export { default as BaseModel4DGS } from "./shared/Model4DGS.svelte";
    export { default as BaseExample } from "./Example.svelte";
</script>

<script lang="ts">
    import type { FileData } from "@gradio/client";
    import Model4DGS from "./shared/Model4DGS.svelte";
    import { BlockLabel, Block, Empty } from "@gradio/atoms";
    import { File } from "@gradio/icons";
    import { StatusTracker } from "@gradio/statustracker";
    import type { LoadingStatus } from "@gradio/statustracker";
    import type { Gradio } from "@gradio/utils";

    export let elem_id = "";
    export let elem_classes: string[] = [];
    export let visible = true;
    export let value: null | { files: FileData[]; } = null;
    export let root: string;
    export let proxy_url: null | string;
    export let loading_status: LoadingStatus;
    export let label: string;
    export let show_label: boolean;
    export let container = true;
    export let scale: number | null = null;
    export let min_width: number | undefined = undefined;
    export let gradio: Gradio;
    export let height: number | undefined = undefined;

    let dragging = false;
</script>

<Block
    {visible}
    variant={value === null ? "dashed" : "solid"}
    border_mode={dragging ? "focus" : "base"}
    padding={false}
    {elem_id}
    {elem_classes}
    {container}
    {scale}
    {min_width}
    {height}
>
    <StatusTracker autoscroll={gradio.autoscroll} i18n={gradio.i18n} {...loading_status} />

    {#if value}
        <BlockLabel {show_label} Icon={File} label={label || "Splat"} />
        <Model4DGS
            bind:value
            i18n={gradio.i18n}
            {label}
            {show_label}
            {root}
            {proxy_url}
        />
    {:else}
        <BlockLabel {show_label} Icon={File} label={label || "Splat"} />

        <Empty unpadded_box={true} size="large"><File /></Empty>
    {/if}
</Block>