Update 1.18.0 (#108)
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "RisuAI",
|
"productName": "RisuAI",
|
||||||
"version": "1.17.2"
|
"version": "1.18.0"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
|||||||
@@ -51,13 +51,19 @@ export const languageEnglish = {
|
|||||||
+ "\n- if the key starts with **$**, the key's value will more likely to change."
|
+ "\n- if the key starts with **$**, the key's value will more likely to change."
|
||||||
+ "\n\nwhen the image is first generated, you can only change it by modifying 'Current Image Generation Data' in below.",
|
+ "\n\nwhen the image is first generated, you can only change it by modifying 'Current Image Generation Data' in below.",
|
||||||
|
|
||||||
regexScript: "Regex Script is a custom script that replaces string that matches IN to OUT.\n\nThere are three type options."
|
regexScript: "Regex Script is a custom script that replaces string that matches IN to OUT.\n\nThere four type options."
|
||||||
+ "- **Modify Input** modifys user's input"
|
+ "\n\n- **Modify Input** modifys user's input"
|
||||||
+ "- **Modify Output** modifys character's output"
|
+ "\n\n- **Modify Output** modifys character's output"
|
||||||
+ "- **Modify Request Data** modifys current chat data when sent.\n\nIN must be a regex without flags and without slashes in start and end.\n\nOUT is a normal string."
|
+ "\n\n- **Modify Request Data** modifys current chat data when sent."
|
||||||
+ "\n\n If OUT has {{data}} in string, it replaces to matched string."
|
+ "\n\n- **Modify Display** just modifies the text when shown without modifying chat data."
|
||||||
+ "\n\n If OUT starts with **@@**, it doesn't replaces the string, but instead does a special effect if matching string founds."
|
+ "\n\nIN must be a regex without flags and without slashes in start and end.\n\nOUT is a string which can include replacement patterns. these are the patterns:"
|
||||||
+ "\n\n- @@emo (emotion name)\n\n if character is Emotion Images mode, sets (emotion name) as emotion and prevents default.",
|
+ "\n\n- $$\n\n - inserts $"
|
||||||
|
+ "\n\n- $&\n\n - inserts the matched substring."
|
||||||
|
+ "\n\n- $`\n\n - inserts the portion of the string that precedes the matched substring."
|
||||||
|
+ "\n\n- $1\n\n - inserts the first matching group. works with other number like 2, 3..."
|
||||||
|
+ "\n\n- $(name)\n\n - inserts the named group"
|
||||||
|
+ "\n\nIf OUT starts with **@@**, it doesn't replaces the string, but instead does a special effect if matching string founds."
|
||||||
|
+ "\n\n- @@emo (emotion name)\n\n - if character is Emotion Images mode, sets (emotion name) as emotion and prevents default.",
|
||||||
experimental: "This is a experimental setting. it might be unstable.",
|
experimental: "This is a experimental setting. it might be unstable.",
|
||||||
oogaboogaURL: "If your WebUI supports older version of api, your url should look *like https:.../run/textgen*\n\n"
|
oogaboogaURL: "If your WebUI supports older version of api, your url should look *like https:.../run/textgen*\n\n"
|
||||||
+ "If your WebUI supports newVersion of api, your url should look like *https://.../api/v1/generate* and use the api server as host, and add --api to arguments.",
|
+ "If your WebUI supports newVersion of api, your url should look like *https://.../api/v1/generate* and use the api server as host, and add --api to arguments.",
|
||||||
@@ -224,9 +230,9 @@ export const languageEnglish = {
|
|||||||
sayNothing:"Input 'say nothing' when no string inputed",
|
sayNothing:"Input 'say nothing' when no string inputed",
|
||||||
regexScript: "Regex Script",
|
regexScript: "Regex Script",
|
||||||
type: "Type",
|
type: "Type",
|
||||||
editInput: "Modfiy Input",
|
editInput: "Modify Input",
|
||||||
editOutput: "Modfiy Output",
|
editOutput: "Modify Output",
|
||||||
editProcess: "Modfiy Request Data",
|
editProcess: "Modify Request Data",
|
||||||
loadLatest: "Load Latest Backup",
|
loadLatest: "Load Latest Backup",
|
||||||
loadOthers: "Load Other Backups",
|
loadOthers: "Load Other Backups",
|
||||||
exampleMessage: "Example Message",
|
exampleMessage: "Example Message",
|
||||||
@@ -271,6 +277,8 @@ export const languageEnglish = {
|
|||||||
replaceGlobalNote: "Global Note Replacement",
|
replaceGlobalNote: "Global Note Replacement",
|
||||||
charLoreBook: 'Character Lorebook',
|
charLoreBook: 'Character Lorebook',
|
||||||
globalLoreBook: 'Global Lorebook',
|
globalLoreBook: 'Global Lorebook',
|
||||||
globalRegexScript: "Regex Script",
|
globalRegexScript: "Global Regex",
|
||||||
|
accessibility: "Accessibility",
|
||||||
|
sendWithEnter: "Send with Enter Key",
|
||||||
|
clickToEdit: "Click Text to Edit"
|
||||||
}
|
}
|
||||||
@@ -180,13 +180,19 @@ export const languageKorean = {
|
|||||||
+ "\n- 키의 이름이 **$** 로 시작할 시, 값은 더 자주 변합니다."
|
+ "\n- 키의 이름이 **$** 로 시작할 시, 값은 더 자주 변합니다."
|
||||||
+ "\n\n이미지가 처음 생성된 이후부터는 '현재 이미지 생성 데이터'를 수정하여 변경할 수 있습니다.",
|
+ "\n\n이미지가 처음 생성된 이후부터는 '현재 이미지 생성 데이터'를 수정하여 변경할 수 있습니다.",
|
||||||
experimental: "실험적 기능입니다. 불안정할 수 있습니다.",
|
experimental: "실험적 기능입니다. 불안정할 수 있습니다.",
|
||||||
regexScript: "정규식 스크립트는 IN의 조건에 맞는 문자열을 OUT으로 변경합니다.\n\n타입은 세가지가 있습니다."
|
regexScript: "정규식 스크립트는 IN에 매칭되는 텍스트를 OUT으로 변경하는 스크립트입니다.\n\n네가지 옵션이 있습니다."
|
||||||
+ "- **입력문 수정** 유저의 입력문을 수정합니다"
|
+ "\n\n- **입력문 수정** 유저의 입력을 수정합니다"
|
||||||
+ "- **출력문 수정** 캐릭터의 출력문을 수정합니다"
|
+ "\n\n- **출력문 수정** 캐릭터의 출력을 수정합니다"
|
||||||
+ "- **리퀘스트 데이터 수정** 리퀘스트를 보낼 때 채팅 데이터를 수정합니다.\n\nIN은 flag가 없고, 양끝에 슬레시가 없는 Regex여야 합니다.\n\nOUT은 일반 문자열입니다."
|
+ "\n\n- **리퀘스트 데이터 수정** 리퀘스트 시 데이터를 수정합니다"
|
||||||
+ "\n\n 만약 OUT 문자열에 {{data}}가 있으면, 매칭된 문자열로 바뀝니다."
|
+ "\n\n- **디스플레이 수정** 실제 데이터를 건들지 않고, 표시되는 것만 수정합니다."
|
||||||
+ "\n\n 만약 OUT이 @@로 시작된다면, 특수한 효과를 냅니다"
|
+ "\n\nIN은 슬래시와 플레그가 없는 정규식이여야 합니다.\n\nOUT은 특수한 패턴이 포함될수 있는 문자열입니다. 패턴은 다음과 같습니다:"
|
||||||
+ "\n\n- @@emo (emotion name)\n\n 감정 이미지 모드일 시 (emotion name)을 감정으로 정하고 감정 처리를 하지 않습니다.",
|
+ "\n\n- $$\n\n - inserts $"
|
||||||
|
+ "\n\n- $&\n\n - inserts the matched substring."
|
||||||
|
+ "\n\n- $`\n\n - inserts the portion of the string that precedes the matched substring."
|
||||||
|
+ "\n\n- $1\n\n - inserts the first matching group. works with other number like 2, 3..."
|
||||||
|
+ "\n\n- $(name)\n\n - inserts the named group"
|
||||||
|
+ "\n\nOUT이 **@@**로 시작 시, 문자열을 교체하지 않고, 특수한 효과를 냅니다. 효과는 다음과 같습니다:"
|
||||||
|
+ "\n\n- @@emo (emotion name)\n\n - 캐릭터가 감정 이미지 모드일시, 감정을 (emotion name)으로 정하고 감정을 더이상 교체하지 않습니다.",
|
||||||
},
|
},
|
||||||
setup: {
|
setup: {
|
||||||
chooseProvider: "AI 제공자를 선택해 주세요",
|
chooseProvider: "AI 제공자를 선택해 주세요",
|
||||||
@@ -250,5 +256,8 @@ export const languageKorean = {
|
|||||||
replaceGlobalNote: "글로벌 노트 덮어쓰기",
|
replaceGlobalNote: "글로벌 노트 덮어쓰기",
|
||||||
charLoreBook: '캐릭터 로어북',
|
charLoreBook: '캐릭터 로어북',
|
||||||
globalLoreBook: '글로벌 로어북',
|
globalLoreBook: '글로벌 로어북',
|
||||||
globalRegexScript: "글로별 정규식 스크립트",
|
globalRegexScript: "글로별 정규식",
|
||||||
|
accessibility: "접근성",
|
||||||
|
sendWithEnter: "엔터키로 메세지 보내기",
|
||||||
|
clickToEdit: "클릭해서 수정하기"
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,12 @@
|
|||||||
<AutoresizeArea bind:value={message} />
|
<AutoresizeArea bind:value={message} />
|
||||||
{:else}
|
{:else}
|
||||||
{#await ParseMarkdown(msgDisplay, character) then md}
|
{#await ParseMarkdown(msgDisplay, character) then md}
|
||||||
<span class="text chat chattext prose prose-invert minw-0"
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
|
<span class="text chat chattext prose prose-invert minw-0" on:click={() => {
|
||||||
|
if($DataBase.clickToEdit){
|
||||||
|
editMode = true
|
||||||
|
}
|
||||||
|
}}
|
||||||
style:font-size="{0.875 * ($DataBase.zoomsize / 100)}rem"
|
style:font-size="{0.875 * ($DataBase.zoomsize / 100)}rem"
|
||||||
style:line-height="{1.25 * ($DataBase.zoomsize / 100)}rem"
|
style:line-height="{1.25 * ($DataBase.zoomsize / 100)}rem"
|
||||||
>{@html md}</span>
|
>{@html md}</span>
|
||||||
|
|||||||
@@ -205,8 +205,10 @@
|
|||||||
bind:this={inputEle}
|
bind:this={inputEle}
|
||||||
on:keydown={(e) => {
|
on:keydown={(e) => {
|
||||||
if(e.key.toLocaleLowerCase() === "enter" && (!e.shiftKey)){
|
if(e.key.toLocaleLowerCase() === "enter" && (!e.shiftKey)){
|
||||||
send()
|
if($DataBase.sendWithEnter){
|
||||||
e.preventDefault()
|
send()
|
||||||
|
e.preventDefault()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(e.key.toLocaleLowerCase() === "m" && (e.ctrlKey)){
|
if(e.key.toLocaleLowerCase() === "m" && (e.ctrlKey)){
|
||||||
reroll()
|
reroll()
|
||||||
|
|||||||
32
src/lib/Setting/Pages/AccessibilitySettings.svelte
Normal file
32
src/lib/Setting/Pages/AccessibilitySettings.svelte
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import Check from "src/lib/Others/Check.svelte";
|
||||||
|
import { language } from "src/lang";
|
||||||
|
import { DataBase } from "src/ts/database";
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<h2 class="mb-2 text-2xl font-bold mt-2">{language.accessibility}</h2>
|
||||||
|
|
||||||
|
<div class="flex items-center mt-2">
|
||||||
|
<Check bind:check={$DataBase.askRemoval}/>
|
||||||
|
<span>{language.askRemoval}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center mt-2">
|
||||||
|
<Check bind:check={$DataBase.swipe}/>
|
||||||
|
<span>{language.SwipeRegenerate}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center mt-2">
|
||||||
|
<Check bind:check={$DataBase.instantRemove}/>
|
||||||
|
<span>{language.instantRemove}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center mt-2">
|
||||||
|
<Check bind:check={$DataBase.sendWithEnter}/>
|
||||||
|
<span>{language.sendWithEnter}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center mt-2">
|
||||||
|
<Check bind:check={$DataBase.clickToEdit}/>
|
||||||
|
<span>{language.clickToEdit}</span>
|
||||||
|
</div>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { changeLanguage, language } from "src/lang";
|
import { language } from "src/lang";
|
||||||
import { DataBase, saveImage, updateTextTheme } from "src/ts/database";
|
import { DataBase, saveImage, updateTextTheme } from "src/ts/database";
|
||||||
import { changeFullscreen, selectSingleFile, sleep } from "src/ts/util";
|
import { changeFullscreen, selectSingleFile, sleep } from "src/ts/util";
|
||||||
import Check from "src/lib/Others/Check.svelte";
|
import Check from "src/lib/Others/Check.svelte";
|
||||||
@@ -7,14 +7,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h2 class="mb-2 text-2xl font-bold mt-2">{language.display}</h2>
|
<h2 class="mb-2 text-2xl font-bold mt-2">{language.display}</h2>
|
||||||
<span class="text-neutral-200 mt-4">{language.UiLanguage}</span>
|
|
||||||
<select class="bg-transparent input-text mt-2 text-gray-200 appearance-none text-sm" bind:value={$DataBase.language} on:change={async () => {
|
|
||||||
await sleep(10)
|
|
||||||
changeLanguage($DataBase.language)
|
|
||||||
}}>
|
|
||||||
<option value="en" class="bg-darkbg appearance-none">English</option>
|
|
||||||
<option value="ko" class="bg-darkbg appearance-none">한국어</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<span class="text-neutral-200 mt-4">{language.theme}</span>
|
<span class="text-neutral-200 mt-4">{language.theme}</span>
|
||||||
<select class="bg-transparent input-text mt-2 text-gray-200 appearance-none text-sm" bind:value={$DataBase.theme}>
|
<select class="bg-transparent input-text mt-2 text-gray-200 appearance-none text-sm" bind:value={$DataBase.theme}>
|
||||||
@@ -22,7 +14,6 @@
|
|||||||
<option value="waifu" class="bg-darkbg appearance-none">Waifulike</option>
|
<option value="waifu" class="bg-darkbg appearance-none">Waifulike</option>
|
||||||
<option value="waifuMobile" class="bg-darkbg appearance-none">WaifuCut</option>
|
<option value="waifuMobile" class="bg-darkbg appearance-none">WaifuCut</option>
|
||||||
<!-- <option value="free" class="bg-darkbg appearance-none">Freestyle</option> -->
|
<!-- <option value="free" class="bg-darkbg appearance-none">Freestyle</option> -->
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
@@ -62,12 +53,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
<span class="text-neutral-200 mt-4">{language.translator}</span>
|
|
||||||
<select class="bg-transparent input-text mt-2 mb-4 text-gray-200 appearance-none text-sm" bind:value={$DataBase.translator}>
|
|
||||||
<option value="" class="bg-darkbg appearance-none">{language.disabled}</option>
|
|
||||||
<option value="ko" class="bg-darkbg appearance-none">한국어</option>
|
|
||||||
</select>
|
|
||||||
<span class="text-neutral-200">{language.UISize}</span>
|
<span class="text-neutral-200">{language.UISize}</span>
|
||||||
<input class="text-neutral-200 p-2 bg-transparent input-text focus:bg-selected" type="range" min="50" max="200" bind:value={$DataBase.zoomsize}>
|
<input class="text-neutral-200 p-2 bg-transparent input-text focus:bg-selected" type="range" min="50" max="200" bind:value={$DataBase.zoomsize}>
|
||||||
<span class="text-gray-400 mb-6 text-sm">{($DataBase.zoomsize)}%</span>
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.zoomsize)}%</span>
|
||||||
@@ -76,10 +61,6 @@
|
|||||||
<input class="text-neutral-200 p-2 bg-transparent input-text focus:bg-selected" type="range" min="50" max="200" bind:value={$DataBase.iconsize}>
|
<input class="text-neutral-200 p-2 bg-transparent input-text focus:bg-selected" type="range" min="50" max="200" bind:value={$DataBase.iconsize}>
|
||||||
<span class="text-gray-400 mb-6 text-sm">{($DataBase.iconsize)}%</span>
|
<span class="text-gray-400 mb-6 text-sm">{($DataBase.iconsize)}%</span>
|
||||||
|
|
||||||
<div class="flex items-center mt-2">
|
|
||||||
<Check bind:check={$DataBase.autoTranslate} />
|
|
||||||
<span>{language.autoTranslation}</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center mt-2">
|
<div class="flex items-center mt-2">
|
||||||
<Check bind:check={$DataBase.fullScreen} onChange={changeFullscreen}/>
|
<Check bind:check={$DataBase.fullScreen} onChange={changeFullscreen}/>
|
||||||
<span>{language.fullscreen}</span>
|
<span>{language.fullscreen}</span>
|
||||||
@@ -114,27 +95,11 @@
|
|||||||
<span>{language.playMessage} <Help key="msgSound"/></span>
|
<span>{language.playMessage} <Help key="msgSound"/></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center mt-2">
|
|
||||||
<Check bind:check={$DataBase.swipe}/>
|
|
||||||
<span>{language.SwipeRegenerate}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex items-center mt-2">
|
|
||||||
<Check bind:check={$DataBase.askRemoval}/>
|
|
||||||
<span>{language.askRemoval}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex items-center mt-2">
|
<div class="flex items-center mt-2">
|
||||||
<Check bind:check={$DataBase.roundIcons}/>
|
<Check bind:check={$DataBase.roundIcons}/>
|
||||||
<span>{language.roundIcons}</span>
|
<span>{language.roundIcons}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center mt-2">
|
|
||||||
<Check bind:check={$DataBase.instantRemove}/>
|
|
||||||
<span>{language.instantRemove}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{#if $DataBase.textScreenColor}
|
{#if $DataBase.textScreenColor}
|
||||||
<div class="flex items-center mt-2">
|
<div class="flex items-center mt-2">
|
||||||
<Check check={true} onChange={() => {
|
<Check check={true} onChange={() => {
|
||||||
|
|||||||
38
src/lib/Setting/Pages/LanguageSettings.svelte
Normal file
38
src/lib/Setting/Pages/LanguageSettings.svelte
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import Check from "src/lib/Others/Check.svelte";
|
||||||
|
import { changeLanguage, language } from "src/lang";
|
||||||
|
import { DataBase } from "src/ts/database";
|
||||||
|
import { sleep } from "src/ts/util";
|
||||||
|
let langChanged = false
|
||||||
|
</script>
|
||||||
|
<h2 class="mb-2 text-2xl font-bold mt-2">{language.language}</h2>
|
||||||
|
|
||||||
|
<span class="text-neutral-200 mt-4">{language.UiLanguage}</span>
|
||||||
|
<select class="bg-transparent input-text mt-2 text-gray-200 appearance-none text-sm" bind:value={$DataBase.language} on:change={async () => {
|
||||||
|
await sleep(10)
|
||||||
|
changeLanguage($DataBase.language)
|
||||||
|
langChanged = true
|
||||||
|
}}>
|
||||||
|
<option value="en" class="bg-darkbg appearance-none">English</option>
|
||||||
|
<option value="ko" class="bg-darkbg appearance-none">Korean</option>
|
||||||
|
</select>
|
||||||
|
{#if langChanged}
|
||||||
|
<span class="bg-red-500 text-sm">Close the settings to take effect</span>
|
||||||
|
{/if}
|
||||||
|
<span class="text-neutral-200 mt-4">{language.translator}</span>
|
||||||
|
<select class="bg-transparent input-text mt-2 mb-4 text-gray-200 appearance-none text-sm" bind:value={$DataBase.translator}>
|
||||||
|
<option value="" class="bg-darkbg appearance-none">{language.disabled}</option>
|
||||||
|
<option value="ko" class="bg-darkbg appearance-none">Korean</option>
|
||||||
|
<option value="ru" class="bg-darkbg appearance-none">Russian</option>
|
||||||
|
<option value="zh" class="bg-darkbg appearance-none">Chinese</option>
|
||||||
|
<option value="ja" class="bg-darkbg appearance-none">Japanese</option>
|
||||||
|
<option value="fr" class="bg-darkbg appearance-none">French</option>
|
||||||
|
<option value="es" class="bg-darkbg appearance-none">Spanish</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
{#if $DataBase.translator}
|
||||||
|
<div class="flex items-center mt-2">
|
||||||
|
<Check bind:check={$DataBase.autoTranslate} />
|
||||||
|
<span>{language.autoTranslation}</span>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ActivityIcon, AlignLeft, BookIcon, BotIcon, BoxIcon, CodeIcon, DiamondIcon, FolderIcon, MonitorIcon, Sailboat, UserIcon, XCircleIcon } from "lucide-svelte";
|
import { AccessibilityIcon, ActivityIcon, AlignLeft, BookIcon, BotIcon, BoxIcon, CodeIcon, DiamondIcon, FolderIcon, LanguagesIcon, MonitorIcon, Sailboat, UserIcon, XCircleIcon } from "lucide-svelte";
|
||||||
import { language } from "src/lang";
|
import { language } from "src/lang";
|
||||||
import DisplaySettings from "./Pages/DisplaySettings.svelte";
|
import DisplaySettings from "./Pages/DisplaySettings.svelte";
|
||||||
import UserSettings from "./Pages/UserSettings.svelte";
|
import UserSettings from "./Pages/UserSettings.svelte";
|
||||||
@@ -14,6 +14,8 @@
|
|||||||
import GlobalLoreBookSettings from "./Pages/GlobalLoreBookSettings.svelte";
|
import GlobalLoreBookSettings from "./Pages/GlobalLoreBookSettings.svelte";
|
||||||
import Lorepreset from "./lorepreset.svelte";
|
import Lorepreset from "./lorepreset.svelte";
|
||||||
import GlobalRegex from "./Pages/GlobalRegex.svelte";
|
import GlobalRegex from "./Pages/GlobalRegex.svelte";
|
||||||
|
import LanguageSettings from "./Pages/LanguageSettings.svelte";
|
||||||
|
import AccessibilitySettings from "./Pages/AccessibilitySettings.svelte";
|
||||||
let selected = -1
|
let selected = -1
|
||||||
let openPresetList = false
|
let openPresetList = false
|
||||||
let openLoreList = false
|
let openLoreList = false
|
||||||
@@ -51,6 +53,18 @@
|
|||||||
<MonitorIcon />
|
<MonitorIcon />
|
||||||
<span>{language.display}</span>
|
<span>{language.display}</span>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="text-gray-400 flex gap-2 items-center hover:text-gray-200" class:text-white={selected === 10} on:click={() => {
|
||||||
|
selected = 10
|
||||||
|
}}>
|
||||||
|
<LanguagesIcon />
|
||||||
|
<span>{language.language}</span>
|
||||||
|
</button>
|
||||||
|
<button class="text-gray-400 flex gap-2 items-center hover:text-gray-200" class:text-white={selected === 11} on:click={() => {
|
||||||
|
selected = 11
|
||||||
|
}}>
|
||||||
|
<AccessibilityIcon />
|
||||||
|
<span>{language.accessibility}</span>
|
||||||
|
</button>
|
||||||
<button class="text-gray-400 flex gap-2 items-center hover:text-gray-200" class:text-white={selected === 8} on:click={() => {
|
<button class="text-gray-400 flex gap-2 items-center hover:text-gray-200" class:text-white={selected === 8} on:click={() => {
|
||||||
selected = 8
|
selected = 8
|
||||||
}}>
|
}}>
|
||||||
@@ -116,6 +130,10 @@
|
|||||||
<GlobalLoreBookSettings bind:openLoreList />
|
<GlobalLoreBookSettings bind:openLoreList />
|
||||||
{:else if selected === 9}
|
{:else if selected === 9}
|
||||||
<GlobalRegex/>
|
<GlobalRegex/>
|
||||||
|
{:else if selected === 10}
|
||||||
|
<LanguageSettings/>
|
||||||
|
{:else if selected === 11}
|
||||||
|
<AccessibilitySettings/>
|
||||||
{/if}
|
{/if}
|
||||||
<button class="absolute top-2 right-2 hover:text-green-500" on:click={() => {
|
<button class="absolute top-2 right-2 hover:text-green-500" on:click={() => {
|
||||||
if(window.innerWidth >= 700){
|
if(window.innerWidth >= 700){
|
||||||
|
|||||||
23
src/main.ts
23
src/main.ts
@@ -5,14 +5,23 @@ import { loadData } from "./ts/globalApi";
|
|||||||
import { ReadableStream, WritableStream, TransformStream } from "web-streams-polyfill/ponyfill/es2018";
|
import { ReadableStream, WritableStream, TransformStream } from "web-streams-polyfill/ponyfill/es2018";
|
||||||
import { Buffer as BufferPolyfill } from 'buffer'
|
import { Buffer as BufferPolyfill } from 'buffer'
|
||||||
import { initHotkey } from "./ts/hotkey";
|
import { initHotkey } from "./ts/hotkey";
|
||||||
import {polyfill as dragDropPolyfil} from "mobile-drag-drop";
|
|
||||||
import {scrollBehaviourDragImageTranslateOverride} from "mobile-drag-drop/scroll-behaviour";
|
|
||||||
|
|
||||||
dragDropPolyfil({
|
const testDom = document.createElement('div');
|
||||||
// use this to make use of the scroll behaviour
|
const supports = ('draggable' in testDom) || ('ondragstart' in testDom && 'ondrop' in testDom);
|
||||||
dragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride,
|
const isIos = navigator.userAgent ? (!!navigator.userAgent.match('iPhone OS') || !!navigator.userAgent.match('iPad')) : false
|
||||||
holdToDrag: 400
|
testDom.remove()
|
||||||
});
|
|
||||||
|
if((!supports) || isIos){
|
||||||
|
const dragDrop = await import("mobile-drag-drop")
|
||||||
|
const dragDropBehavior = await import("mobile-drag-drop/scroll-behaviour")
|
||||||
|
|
||||||
|
dragDrop.polyfill({
|
||||||
|
// use this to make use of the scroll behaviour
|
||||||
|
dragImageTranslateOverride: dragDropBehavior.scrollBehaviourDragImageTranslateOverride,
|
||||||
|
holdToDrag: 400,
|
||||||
|
forceApply: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//Polyfills
|
//Polyfills
|
||||||
declare var Buffer: typeof BufferPolyfill;
|
declare var Buffer: typeof BufferPolyfill;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { cloneDeep } from 'lodash';
|
|||||||
|
|
||||||
export const DataBase = writable({} as any as Database)
|
export const DataBase = writable({} as any as Database)
|
||||||
export const loadedStore = writable(false)
|
export const loadedStore = writable(false)
|
||||||
export let appVer = '1.17.2'
|
export let appVer = '1.18.0'
|
||||||
|
|
||||||
|
|
||||||
export function setDatabase(data:Database){
|
export function setDatabase(data:Database){
|
||||||
@@ -251,6 +251,9 @@ export function setDatabase(data:Database){
|
|||||||
if(checkNullish(data.globalscript)){
|
if(checkNullish(data.globalscript)){
|
||||||
data.globalscript = []
|
data.globalscript = []
|
||||||
}
|
}
|
||||||
|
if(checkNullish(data.sendWithEnter)){
|
||||||
|
data.sendWithEnter = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
changeLanguage(data.language)
|
changeLanguage(data.language)
|
||||||
@@ -481,6 +484,8 @@ export interface Database{
|
|||||||
model:string
|
model:string
|
||||||
}
|
}
|
||||||
globalscript: customscript[]
|
globalscript: customscript[]
|
||||||
|
sendWithEnter:boolean
|
||||||
|
clickToEdit: boolean
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { CharEmotion, selectedCharID } from "../stores";
|
|||||||
import { DataBase, type character } from "../database";
|
import { DataBase, type character } from "../database";
|
||||||
|
|
||||||
const dreg = /{{data}}/g
|
const dreg = /{{data}}/g
|
||||||
|
const randomness = /\|\|\|/g
|
||||||
|
|
||||||
type ScriptMode = 'editinput'|'editoutput'|'editprocess'|'editdisplay'
|
type ScriptMode = 'editinput'|'editoutput'|'editprocess'|'editdisplay'
|
||||||
|
|
||||||
@@ -17,15 +18,9 @@ export function processScriptFull(char:character, data:string, mode:ScriptMode){
|
|||||||
for (const script of scripts){
|
for (const script of scripts){
|
||||||
if(script.type === mode){
|
if(script.type === mode){
|
||||||
const reg = new RegExp(script.in,'g')
|
const reg = new RegExp(script.in,'g')
|
||||||
data = data.replace(reg, (v) => {
|
const outScript = script.out
|
||||||
const outScript = script.out.replace(dreg, v)
|
if(outScript.startsWith('@@') && reg.test(data)){
|
||||||
if(outScript.startsWith('@@emo ')){
|
if(outScript.startsWith('@@emo ')){
|
||||||
if(char.viewScreen !== 'emotion'){
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
if(emoChanged){
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
const emoName = script.out.substring(6).trim()
|
const emoName = script.out.substring(6).trim()
|
||||||
let charemotions = get(CharEmotion)
|
let charemotions = get(CharEmotion)
|
||||||
let tempEmotion = charemotions[char.chaId]
|
let tempEmotion = charemotions[char.chaId]
|
||||||
@@ -45,10 +40,15 @@ export function processScriptFull(char:character, data:string, mode:ScriptMode){
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return v
|
|
||||||
}
|
}
|
||||||
return outScript
|
}
|
||||||
})
|
else{
|
||||||
|
if(randomness.test(data)){
|
||||||
|
const list = data.split('|||')
|
||||||
|
data = list[Math.floor(Math.random()*list.length)];
|
||||||
|
}
|
||||||
|
data = data.replace(reg, outScript.replace(dreg, "$&"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {data, emoChanged}
|
return {data, emoChanged}
|
||||||
|
|||||||
@@ -173,6 +173,9 @@ export async function supaMemory(chats:OpenAIChat[],currentTokens:number,maxCont
|
|||||||
}
|
}
|
||||||
const tokens = await tokenize(cont.content) + 1
|
const tokens = await tokenize(cont.content) + 1
|
||||||
if((chunkSize + tokens) > maxChunkSize){
|
if((chunkSize + tokens) > maxChunkSize){
|
||||||
|
if(stringlizedChat === ''){
|
||||||
|
stringlizedChat += `${cont.role === 'assistant' ? char.type === 'group' ? '' : char.name : db.username}: ${cont.content}\n\n`
|
||||||
|
}
|
||||||
lastId = cont.memo
|
lastId = cont.memo
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -193,6 +196,25 @@ export async function supaMemory(chats:OpenAIChat[],currentTokens:number,maxCont
|
|||||||
const tokenz = await tokenize(result + '\n\n') + 5
|
const tokenz = await tokenize(result + '\n\n') + 5
|
||||||
currentTokens += tokenz
|
currentTokens += tokenz
|
||||||
supaMemory += result.replace(/\n+/g,'\n') + '\n\n'
|
supaMemory += result.replace(/\n+/g,'\n') + '\n\n'
|
||||||
|
|
||||||
|
let SupaMemoryList = supaMemory.split('\n\n')
|
||||||
|
if(SupaMemoryList.length >= 5){
|
||||||
|
const oldSupaMemory = supaMemory
|
||||||
|
let modifies = []
|
||||||
|
for(let i=0;i<3;i++){
|
||||||
|
modifies.push(SupaMemoryList.shift())
|
||||||
|
}
|
||||||
|
const result = await summarize(supaMemory)
|
||||||
|
if(typeof(result) !== 'string'){
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
modifies.unshift(result.replace(/\n+/g,'\n'))
|
||||||
|
supaMemory = modifies.join('\n\n') + '\n\n'
|
||||||
|
|
||||||
|
currentTokens -= await tokenize(oldSupaMemory)
|
||||||
|
currentTokens += await tokenize(supaMemory)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
import { get } from "svelte/store"
|
||||||
import { translatorPlugin } from "../process/plugins"
|
import { translatorPlugin } from "../process/plugins"
|
||||||
|
import { DataBase } from "../database"
|
||||||
|
|
||||||
let cache={
|
let cache={
|
||||||
origin: [''],
|
origin: [''],
|
||||||
@@ -8,7 +10,8 @@ let cache={
|
|||||||
let waitTrans = 0
|
let waitTrans = 0
|
||||||
|
|
||||||
export async function translate(text:string, reverse:boolean) {
|
export async function translate(text:string, reverse:boolean) {
|
||||||
const plug = await translatorPlugin(text, reverse ? 'ko' : 'en', reverse ? 'en' : 'ko')
|
let db = get(DataBase)
|
||||||
|
const plug = await translatorPlugin(text, reverse ? db.translator: 'en', reverse ? 'en' : db.translator)
|
||||||
if(plug){
|
if(plug){
|
||||||
return plug.content
|
return plug.content
|
||||||
}
|
}
|
||||||
@@ -29,12 +32,12 @@ export async function translate(text:string, reverse:boolean) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function googleTrans(text:string, reverse:boolean) {
|
async function googleTrans(text:string, reverse:boolean) {
|
||||||
|
let db = get(DataBase)
|
||||||
const arg = {
|
const arg = {
|
||||||
|
|
||||||
from: reverse ? 'ko' : 'en',
|
from: reverse ? db.translator : 'en',
|
||||||
|
|
||||||
to: reverse ? 'en' : 'ko',
|
to: reverse ? 'en' : db.translator,
|
||||||
|
|
||||||
host: 'translate.googleapis.com',
|
host: 'translate.googleapis.com',
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":"1.17.2"}
|
{"version":"1.18.0"}
|
||||||
Reference in New Issue
Block a user