feat: add syntax highlighting

This commit is contained in:
kwaroran
2024-05-26 08:15:45 +09:00
parent 9e9f23b209
commit 93cba968b5
12 changed files with 402 additions and 58 deletions

View File

@@ -5,6 +5,7 @@
import type { customscript } from "src/ts/storage/database";
import Check from "../../UI/GUI/CheckInput.svelte";
import TextInput from "../../UI/GUI/TextInput.svelte";
import TextAreaInput from "../../UI/GUI/TextAreaInput.svelte";
import SelectInput from "../../UI/GUI/SelectInput.svelte";
import OptionInput from "../../UI/GUI/OptionInput.svelte";
@@ -57,7 +58,7 @@
<span class="text-textcolor mt-6">IN:</span>
<TextInput size="sm" bind:value={value.in} />
<span class="text-textcolor mt-6">OUT:</span>
<TextInput size="sm" bind:value={value.out} />
<TextAreaInput highlight autocomplete="off" size="sm" bind:value={value.out} />
{#if value.ableFlag}
<span class="text-textcolor mt-6">FLAG:</span>
<TextInput size="sm" bind:value={value.flag} />

View File

@@ -122,7 +122,7 @@
<OptionInput value="regex">{language.triggerMatchRegex}</OptionInput>
</SelectInput>
<span class="text-textcolor2 text-sm">{language.value}</span>
<TextInput size="sm" bind:value={cond.value} />
<TextAreaInput highlight bind:value={cond.value} />
<span class="text-textcolor2 text-sm">{language.searchDepth}</span>
<NumberInput size="sm" bind:value={cond.depth} />
@@ -133,7 +133,7 @@
<TextInput size="sm" bind:value={cond.var} />
{/if}
{#if cond.type === 'value'}
<TextInput size="sm" bind:value={cond.var} />
<TextAreaInput highlight size="sm" bind:value={cond.var} />
{/if}
<span class="text-textcolor2 text-sm">{language.value}</span>
<SelectInput bind:value={cond.operator} size="sm">
@@ -147,7 +147,7 @@
</SelectInput>
{#if cond.operator !== 'null'}
<TextInput size="sm" bind:value={cond.value} />
<TextAreaInput highlight size="sm" bind:value={cond.value} />
{/if}
{/if}
{/each}
@@ -255,7 +255,7 @@
<OptionInput value="promptend">{language.promptend}</OptionInput>
</SelectInput>
<span class="text-textcolor2 text-sm">{language.value}</span>
<TextAreaInput bind:value={effect.value} />
<TextAreaInput highlight bind:value={effect.value} />
{/if}
{#if effect.type === 'setvar'}
<span class="text-textcolor2 text-sm">{language.varableName}</span>
@@ -269,7 +269,7 @@
<OptionInput value="/=">{language.TriggerDivToVar}</OptionInput>
</SelectInput>
<span class="text-textcolor2 text-sm">{language.value}</span>
<TextInput bind:value={effect.value} />
<TextAreaInput highlight bind:value={effect.value} />
{/if}
{#if effect.type === 'runtrigger'}
@@ -278,7 +278,7 @@
{/if}
{#if effect.type === 'command'}
<span class="text-textcolor2 text-sm">{language.value}</span>
<TextAreaInput bind:value={effect.value} />
<TextAreaInput highlight bind:value={effect.value} />
{/if}
{#if effect.type === 'impersonate'}
<span class="text-textcolor2 text-sm">{language.role}</span>
@@ -287,7 +287,7 @@
<OptionInput value="char">{language.character}</OptionInput>
</SelectInput>
<span class="text-textcolor2 text-sm">{language.value}</span>
<TextAreaInput bind:value={effect.value} />
<TextAreaInput highlight bind:value={effect.value} />
{/if}
{/each}
</div>