Global modal system

This commit is contained in:
space-nuko
2023-05-21 15:48:38 -05:00
parent 7a8be3d1b4
commit 02afbae406
15 changed files with 306 additions and 59 deletions

View File

@@ -8,6 +8,7 @@
import Gallery from "$lib/components/gradio/gallery/Gallery.svelte";
import { ImageViewer } from "$lib/ImageViewer";
import type { Styles } from "@gradio/utils";
import { countNewLines } from "$lib/utils";
const splitLength = 50;
@@ -29,10 +30,6 @@
&& typeof input[1] === "number"
}
function countNewLines(str: string): number {
return str.split(/\r\n|\r|\n/).length
}
function isMultiline(input: any): boolean {
return typeof input === "string" && (input.length > splitLength || countNewLines(input) > 1);
}