feat: add image translation feature and enhance regex list functionality

This commit is contained in:
Kwaroran
2024-12-27 15:51:29 +09:00
parent c5f5786af7
commit 191be6d5c1
12 changed files with 376 additions and 69 deletions

View File

@@ -4,7 +4,8 @@
import Sortable from "sortablejs";
import { sleep, sortableOptions } from "src/ts/util";
import { onDestroy, onMount } from "svelte";
import { PlusIcon } from "lucide-svelte";
import { DownloadIcon, FolderUpIcon, PlusIcon } from "lucide-svelte";
import { exportRegex, importRegex } from "src/ts/process/scripts";
interface Props {
value?: customscript[];
buttons?: boolean
@@ -78,14 +79,22 @@
</div>
{/key}
{#if buttons}
<button class="w-full mt-2 rounded-md text-textcolor2 hover:text-textcolor focus-within:text-textcolor" onclick={() => {
value.push({
comment: "",
in: "",
out: "",
type: "editinput"
})
}}>
<PlusIcon />
</button>
<div class="flex gap-2 mt-2">
<button class="rounded-md text-textcolor2 hover:text-textcolor focus-within:text-textcolor" onclick={() => {
value.push({
comment: "",
in: "",
out: "",
type: "editinput"
})
}}>
<PlusIcon />
</button>
<button class="rounded-md text-textcolor2 hover:text-textcolor focus-within:text-textcolor" onclick={() => {
exportRegex(value)
}}><DownloadIcon /></button>
<button class="rounded-md text-textcolor2 hover:text-textcolor focus-within:text-textcolor" onclick={async () => {
value = await importRegex(value)
}}><FolderUpIcon /></button>
</div>
{/if}