Skip to content

Commit 1e1706a

Browse files
authored
1.83.0 (#311)
# PR Checklist - [ ] Did you check if it works normally in all models? *ignore this when it dosen't uses models* - [ ] Did you check if it works normally in all of web, local and node hosted versions? if it dosen't, did you blocked it in those versions? - [ ] Did you added a type def? # Description
2 parents f3cd5fc + d6dbceb commit 1e1706a

27 files changed

+224
-84
lines changed

src-tauri/tauri.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"package": {
1010
"productName": "RisuAI",
11-
"version": "1.82.3"
11+
"version": "1.83.0"
1212
},
1313
"tauri": {
1414
"allowlist": {

src/etc/patchNote.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
export const patchNote = {
2-
version: "1.82",
2+
version: "1.83",
33
content:
44
`
5-
# Update 1.82
6-
- Added native fetch handling for local version
7-
- This would make the fetch request faster and more stable
8-
- This would solve many issues with fetch request on local version
9-
- Added Claude-3 streaming
10-
- Force Plain Fetch is now unrecommended
5+
# Update 1.83
6+
- Added multi language support for creator's quote
7+
- Added Network error resolve tips
8+
- Added iPad fullscreen compatibility
9+
- Changed requirements for creator's quote on uploading to RisuRealm
10+
- Fixed inlayed emotion images not displaying properly
1111
`
1212
}
1313

src/lang/en.ts

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export const languageEnglish = {
2525
noUserIcon: "You must set your icon first.",
2626
emptyText: "Text is empty.",
2727
wrongPassword: "Wrong Password",
28+
networkFetch: "This happens when the network is unstable or the server is down.",
29+
networkFetchWeb: "This can be a CORS error. this only happens when using web version dude to limitations of the browser. try using desktop local version, or other version of RisuAI.",
30+
networkFetchPlain: "This can be a plain fetch error. try disabling force plain fetch option in settings.",
2831
},
2932
showHelp: "Show Help",
3033
help:{

src/lib/ChatScreens/CreatorQuote.svelte

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@
55
<XIcon />
66
</button>
77
</h1>
8-
<div class="ml-2 max-w-full break-words text chat chattext prose prose-invert">
9-
{#await ParseMarkdown(quote) then md}
10-
{@html md}
11-
{/await}
12-
</div>
8+
<MultiLangDisplay value={quote} markdown={true} />
139
</div>
1410
</div>
1511
<script lang="ts">
1612
import { XIcon } from "lucide-svelte";
1713
import { language } from "src/lang";
18-
import { ParseMarkdown } from "src/ts/parser";
14+
import MultiLangDisplay from "../UI/GUI/MultiLangDisplay.svelte";
1915
2016
export let onRemove: () => void
2117
export let quote:string

src/lib/ChatScreens/DefaultChatScreen.svelte

-3
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@
229229
230230
function abortChat(){
231231
if(abortController){
232-
console.log('abort')
233232
abortController.abort()
234233
}
235234
}
@@ -290,8 +289,6 @@
290289
const lastMessageInputTranslate = messageInputTranslate
291290
await sleep(1500)
292291
if(lastMessageInputTranslate === messageInputTranslate){
293-
console.log(lastMessageInputTranslate === messageInputTranslate)
294-
console.log(lastMessageInputTranslate, messageInputTranslate)
295292
translate(reverse ? messageInputTranslate : messageInput, reverse).then((translatedMessage) => {
296293
if(translatedMessage){
297294
if(reverse)

src/lib/Others/AlertComp.svelte

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,10 @@
2525
btn.focus()
2626
}
2727
if($alertStore.type !== 'input'){
28-
console.log('reset input')
2928
input = ''
3029
}
3130
3231
})()
33-
34-
alertStore.subscribe(() => {
35-
console.log('alup')
36-
})
3732
</script>
3833

3934
<svelte:window on:message={async (e) => {
@@ -73,6 +68,9 @@
7368
}}>Terms of Service</a> to continue</div>
7469
{:else if $alertStore.type !== 'select'}
7570
<span class="text-gray-300">{$alertStore.msg}</span>
71+
{#if $alertStore.submsg}
72+
<span class="text-gray-500 text-sm">{$alertStore.submsg}</span>
73+
{/if}
7674
{/if}
7775
{#if $alertStore.type === 'ask'}
7876
<div class="flex gap-2 w-full">

src/lib/Setting/Pages/UserSettings.svelte

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<svelte:window on:message={async (e) => {
2323
if(e.origin.startsWith("https://sv.risuai.xyz") || e.origin.startsWith("http://127.0.0.1")){
2424
if(e.data.msg.type === 'drive'){
25-
console.log(e.data.msg)
2625
await loadRisuAccountData()
2726
$DataBase.account.data.refresh_token = e.data.msg.data.refresh_token
2827
$DataBase.account.data.access_token = e.data.msg.data.access_token

src/lib/Setting/botpreset.svelte

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
if(d){
6161
changeToPreset(0)
6262
let botPresets = $DataBase.botPresets
63-
console.log(botPresets)
6463
botPresets.splice(i, 1)
6564
$DataBase.botPresets = botPresets
6665
changeToPreset(0, false)

src/lib/SideBars/CharConfig.svelte

+3-4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import CheckInput from "../UI/GUI/CheckInput.svelte";
3131
import { updateInlayScreen } from "src/ts/process/inlayScreen";
3232
import { registerOnnxModel } from "src/ts/process/embedding/transformers";
33+
import MultiLangInput from "../UI/GUI/MultiLangInput.svelte";
3334
3435
3536
let subMenu = 0
@@ -88,7 +89,6 @@
8889
return
8990
}
9091
if((!currentChar) || (!isEqual(currentChar.data, cha))){
91-
console.log("updated")
9292
if(cha.type === 'character'){
9393
currentChar = {
9494
type: 'character',
@@ -653,9 +653,9 @@
653653
<TextAreaInput margin="both" autocomplete="off" bind:value={currentChar.data.exampleMessage}></TextAreaInput>
654654

655655
<span class="text-textcolor">{language.creatorNotes} <Help key="creatorQuotes"/></span>
656-
<TextAreaInput margin="both" autocomplete="off" bind:value={currentChar.data.creatorNotes} on:input={() => {
656+
<MultiLangInput bind:value={currentChar.data.creatorNotes} className="my-2" onInput={() => {
657657
currentChar.data.removedQuotes = false
658-
}}></TextAreaInput>
658+
}}></MultiLangInput>
659659

660660
<span class="text-textcolor">{language.systemPrompt} <Help key="systemPrompt"/></span>
661661
<TextAreaInput margin="both" autocomplete="off" bind:value={currentChar.data.systemPrompt}></TextAreaInput>
@@ -753,7 +753,6 @@
753753
return
754754
}
755755
for(const f of da){
756-
console.log(f)
757756
const img = f.data
758757
const name = f.name
759758
const extension = name.split('.').pop().toLowerCase()
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<script lang="ts">
2+
import { ParseMarkdown } from "src/ts/parser";
3+
import { parseMultilangString, toLangName } from "src/ts/util";
4+
5+
export let value: string
6+
export let markdown: boolean = false
7+
let valueObject: {[code:string]:string} = parseMultilangString(value)
8+
let selectedLang = "en"
9+
if(valueObject["en"] === undefined){
10+
selectedLang = "xx"
11+
}
12+
</script>
13+
14+
<div class="flex flex-col">
15+
<div class="flex flex-wrap max-w-fit p-1 gap-2">
16+
{#each Object.keys(valueObject) as lang}
17+
{#if lang !== 'xx' || Object.keys(valueObject).length === 1}
18+
<button class="bg-bgcolor py-2 rounded-lg px-4" class:ring-1={selectedLang === lang} on:click|stopPropagation={() => {
19+
selectedLang = lang
20+
}}>{toLangName(lang)}</button>
21+
{/if}
22+
{/each}
23+
</div>
24+
{#if markdown}
25+
<div class="ml-2 max-w-full break-words text chat chattext prose prose-invert">
26+
{#await ParseMarkdown(valueObject[selectedLang]) then md}
27+
{@html md}
28+
{/await}
29+
</div>
30+
{:else}
31+
<div class="ml-2 max-w-full break-words text chat chattext prose prose-invert">
32+
{valueObject[selectedLang]}
33+
</div>
34+
{/if}
35+
</div>

src/lib/UI/GUI/MultiLangInput.svelte

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<script lang="ts">
2+
import { encodeMultilangString, languageCodes, parseMultilangString, toLangName } from "src/ts/util";
3+
import TextAreaInput from "./TextAreaInput.svelte";
4+
export let value: string
5+
let addingLang = false
6+
let valueObject: {[code:string]:string} = parseMultilangString(value)
7+
let selectedLang = "en"
8+
export let className = ""
9+
export let onInput = () => {}
10+
const updateValue = () => {
11+
for(let lang in valueObject){
12+
if(valueObject[lang] === "" && lang !== selectedLang && lang!=="en" ){
13+
delete valueObject[lang]
14+
}
15+
}
16+
if(valueObject.xx){
17+
delete valueObject.xx
18+
}
19+
valueObject = valueObject // force update
20+
value = encodeMultilangString(valueObject)
21+
}
22+
if(valueObject["en"] === undefined){
23+
valueObject["en"] = valueObject["xx"]
24+
delete valueObject["xx"]
25+
updateValue()
26+
}
27+
</script>
28+
29+
<div class="flex flex-wrap max-w-fit p-1 gap-2">
30+
{#each Object.keys(valueObject) as lang}
31+
{#if lang !== 'xx'}
32+
<button class="bg-bgcolor py-2 rounded-lg px-4" class:ring-1={selectedLang === lang} on:click={() => {
33+
selectedLang = lang
34+
updateValue()
35+
}}>{toLangName(lang)}</button>
36+
{/if}
37+
{/each}
38+
<button class="text-nowrap bg-bgcolor py-2 rounded-lg px-4" class:ring-1={addingLang} on:click={() => {addingLang = !addingLang}}>+</button>
39+
</div>
40+
{#if addingLang}
41+
<div class="m-1 p-1 g-2 flex max-w-fit rounded-md border-t-bgcolor flex-wrap gap-1">
42+
{#each languageCodes as lang}
43+
<button class="bg-bgcolor py-2 rounded-lg px-4 text-nowrap" on:click={() => {
44+
valueObject[lang] = ""
45+
selectedLang = lang
46+
addingLang = false
47+
}}>{toLangName(lang)}</button>
48+
{/each}
49+
</div>
50+
{/if}
51+
<TextAreaInput autocomplete="off" bind:value={valueObject[selectedLang]} height={"20"} onInput={() => {
52+
updateValue()
53+
onInput()
54+
}} additionalClass={className} />

src/lib/UI/Realm/RealmHubIcon.svelte

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22
import { BookIcon, ImageIcon, SmileIcon } from "lucide-svelte";
33
import { alertNormal } from "src/ts/alert";
44
import { hubURL, type hubType } from "src/ts/characterCards";
5+
import { trimNonLatin } from "src/ts/storage/globalApi";
6+
import { parseMultilangString } from "src/ts/util";
57
68
export let onClick = () => {}
79
export let chara:hubType
810
911
</script>
1012

1113

12-
<button class="bg-darkbg rounded-lg p-4 flex flex-col hover:bg-selected transition-colors relative lg:w-96 w-full items-start" on:click={onClick}> <div class="flex gap-2 w-full">
14+
<button class="bg-darkbg rounded-lg p-4 flex flex-col hover:bg-selected transition-colors relative lg:w-96 w-full items-start" on:click={onClick}>
15+
<div class="flex gap-2 w-full">
1316
<img class="w-20 min-w-20 h-20 sm:h-28 sm:w-28 rounded-md object-top object-cover" alt={chara.name} src={`${hubURL}/resource/` + chara.img}>
1417
<div class="flex flex-col flex-grow min-w-0">
1518
<span class="text-textcolor text-lg min-w-0 max-w-full text-ellipsis whitespace-nowrap overflow-hidden text-start">{chara.name}</span>
16-
<span class="text-textcolor2 text-xs min-w-0 max-w-full text-ellipsis break-words max-h-8 whitespace-nowrap overflow-hidden text-start">{chara.desc}</span>
19+
<span class="text-textcolor2 text-xs min-w-0 max-w-full text-ellipsis break-words max-h-8 whitespace-nowrap overflow-hidden text-start">{parseMultilangString(chara.desc).en ?? parseMultilangString(chara.desc).xx}</span>
1720
<div class="flex flex-wrap">
1821
{#each chara.tags as tag, i}
1922
{#if i < 4}

src/lib/UI/Realm/RealmPopUp.svelte

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { parseMarkdownSafe } from "src/ts/parser";
77
import { DataBase } from "src/ts/storage/database";
88
import RealmLicense from "./RealmLicense.svelte";
9-
import { characterFormatUpdate } from "src/ts/characters";
9+
import MultiLangDisplay from "../GUI/MultiLangDisplay.svelte";
1010
1111
export let openedData:hubType
1212
@@ -25,9 +25,7 @@
2525
{/if}
2626
<div class="flex justify-start gap-4 mt-4">
2727
<img class="h-36 w-36 rounded-md object-top object-cover" alt={openedData.name} src={`${hubURL}/resource/` + openedData.img}>
28-
<span class="text-textcolor2 break-words text-base chattext prose prose-invert">
29-
{@html parseMarkdownSafe(openedData.desc)}
30-
</span>
28+
<MultiLangDisplay value={openedData.desc} markdown={true} />
3129
</div>
3230
<RealmLicense license={openedData.license}/>
3331

src/lib/UI/Realm/RealmUpload.svelte

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- svelte-ignore a11y-click-events-have-key-events -->
22
<div class="fixed top-0 left-0 h-full w-full bg-black bg-opacity-50 flex flex-col z-50 items-center justify-center" on:click={close}>
3-
<div class="bg-darkbg rounded-md p-4 max-w-full flex flex-col w-2xl" on:click|stopPropagation>
3+
<div class="bg-darkbg rounded-md p-4 max-w-full flex flex-col w-2xl max-h-full overflow-y-auto" on:click|stopPropagation>
44

55
{#if !$DataBase.account}
66
<span class="font-bold text-2xl w-full">You must login to Risu Account upload to RisuRealm</span>
@@ -22,7 +22,7 @@
2222
<span class="text-textcolor">{language.creatorNotes}</span>
2323
<span class="text-textcolor2 text-sm">A description that displays when you search and when you first open a bot.</span>
2424
<span class="text-textcolor2 text-sm">More than 20 characters.</span>
25-
<TextAreaInput autocomplete="off" bind:value={char.creatorNotes} height={"20"} />
25+
<MultiLangInput bind:value={char.creatorNotes} />
2626
<span class="text-textcolor">{language.tags}</span>
2727
<span class="text-textcolor2 text-sm">Tags to search your character easily. latin alphabets only. seperate by comma.</span>
2828
<TextInput placeholder="" bind:value={tags} on:input={() => {
@@ -53,18 +53,21 @@
5353
<span class="text-textcolor2 text-sm">Grotesque Contents and non-adult characters with NSFW would be banned.</span>
5454
{/if}
5555
<Button on:click={async () => {
56-
if(char.creatorNotes.length < 20){
57-
alertError("Creator Notes must be longer than 20 characters")
56+
const enNotes = creatorNotes.en
57+
const latin1 = /^[\x00-\xFF]*$/
58+
if(enNotes.length < 10){
59+
alertError("English version of creator notes must be longer than 10 characters")
5860
}
59-
else{
60-
shareRisuHub(char, {
61-
anon: privateMode,
62-
nsfw: nsfwMode,
63-
tag: tags,
64-
license: license
65-
})
66-
close()
61+
if(!latin1.test(enNotes)){
62+
alertError("English version of creator notes must contain only Latin-1 characters")
6763
}
64+
shareRisuHub(char, {
65+
anon: privateMode,
66+
nsfw: nsfwMode,
67+
tag: tags,
68+
license: license
69+
})
70+
close()
6871
}} className="mt-2" size="lg">{language.shareCloud}</Button>
6972
{/if}
7073

@@ -79,16 +82,18 @@
7982
import { shareRisuHub } from "src/ts/characterCards";
8083
import { DataBase, type character } from "src/ts/storage/database";
8184
import TextInput from "../GUI/TextInput.svelte";
82-
import TextAreaInput from "../GUI/TextAreaInput.svelte";
8385
import Button from "../GUI/Button.svelte";
8486
import SelectInput from "../GUI/SelectInput.svelte";
8587
import { CCLicenseData } from "src/ts/creation/license";
8688
import OptionInput from "../GUI/OptionInput.svelte";
89+
import { parseMultilangString } from "src/ts/util";
90+
import MultiLangInput from "../GUI/MultiLangInput.svelte";
8791
export let close = () => {}
8892
export let char:character
8993
let tags=""
9094
let privateMode = false
9195
let nsfwMode = false
9296
let license = ""
97+
let creatorNotes: {[code:string]:string} = parseMultilangString(char.creatorNotes)
9398
9499
</script>

0 commit comments

Comments
 (0)