Update to 1.17.2 (#107)

This commit is contained in:
kwaroran
2023-05-26 00:19:31 +09:00
committed by GitHub
7 changed files with 29 additions and 13 deletions

View File

@@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "RisuAI", "productName": "RisuAI",
"version": "1.17.1" "version": "1.17.2"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {

View File

@@ -199,8 +199,8 @@
loadPages += 30 loadPages += 30
} }
}}> }}>
<div class="flex items-end mt-2 mb-2"> <div class="flex items-end mt-2 mb-2 w-full">
<textarea class="text-neutral-200 p-2 bg-transparent input-text text-xl flex-grow ml-4 mr-2 border-gray-700 resize-none focus:bg-selected maxw overflow-y-hidden overflow-x-hidden max-w-full" <textarea class="text-neutral-200 p-2 min-w-0 bg-transparent input-text text-xl flex-grow ml-4 mr-2 border-gray-700 resize-none focus:bg-selected overflow-y-hidden overflow-x-hidden max-w-full"
bind:value={messageInput} bind:value={messageInput}
bind:this={inputEle} bind:this={inputEle}
on:keydown={(e) => { on:keydown={(e) => {
@@ -374,9 +374,6 @@
{/if} {/if}
</div> </div>
<style> <style>
.maxw{
max-width: calc(100vw - 10rem);
}
.loadmove { .loadmove {
animation: spin 1s linear infinite; animation: spin 1s linear infinite;
border-radius: 50%; border-radius: 50%;

View File

@@ -35,7 +35,7 @@
import { language } from "../../lang"; import { language } from "../../lang";
import Botpreset from "../Setting/botpreset.svelte"; import Botpreset from "../Setting/botpreset.svelte";
import { onDestroy } from "svelte"; import { onDestroy } from "svelte";
import { isEqual } from "lodash"; import { cloneDeep, isEqual } from "lodash";
import SidebarAvatar from "./SidebarAvatar.svelte"; import SidebarAvatar from "./SidebarAvatar.svelte";
import BaseRoundedButton from "../UI/BaseRoundedButton.svelte"; import BaseRoundedButton from "../UI/BaseRoundedButton.svelte";
import { get } from "svelte/store"; import { get } from "svelte/store";
@@ -138,6 +138,7 @@
let mainFolderIndex = mainIndex.folder ? getFolderIndex(mainIndex.folder) : null let mainFolderIndex = mainIndex.folder ? getFolderIndex(mainIndex.folder) : null
let targetFolderIndex = targetIndex.folder ? getFolderIndex(targetIndex.folder) : null let targetFolderIndex = targetIndex.folder ? getFolderIndex(targetIndex.folder) : null
let mainFolderId = mainIndex.folder ? (db.characterOrder[mainFolderIndex] as folder).id : '' let mainFolderId = mainIndex.folder ? (db.characterOrder[mainFolderIndex] as folder).id : ''
let movingFolder:folder|false = false
let mainId = '' let mainId = ''
if(mainIndex.folder){ if(mainIndex.folder){
mainId = (db.characterOrder[mainFolderIndex] as folder).data[mainIndex.index] mainId = (db.characterOrder[mainFolderIndex] as folder).data[mainIndex.index]
@@ -145,15 +146,24 @@
else{ else{
const da = db.characterOrder[mainIndex.index] const da = db.characterOrder[mainIndex.index]
if(typeof(da) !== 'string'){ if(typeof(da) !== 'string'){
return mainId = da.id
movingFolder = cloneDeep(da)
if(targetIndex.folder){
return
}
}
else{
mainId = da
} }
mainId = da
} }
if(targetIndex.folder){ if(targetIndex.folder){
const folder = db.characterOrder[targetFolderIndex] as folder const folder = db.characterOrder[targetFolderIndex] as folder
folder.data.splice(targetIndex.index,0,mainId) folder.data.splice(targetIndex.index,0,mainId)
db.characterOrder[targetFolderIndex] = folder db.characterOrder[targetFolderIndex] = folder
} }
else if(movingFolder){
db.characterOrder.splice(targetIndex.index,0,movingFolder)
}
else{ else{
db.characterOrder.splice(targetIndex.index,0,mainId) db.characterOrder.splice(targetIndex.index,0,mainId)
} }
@@ -180,6 +190,16 @@
console.log('folder not found') console.log('folder not found')
} }
} }
else if(movingFolder){
let idList:string[] = []
for(const ord of db.characterOrder){
idList.push(typeof(ord) === 'string' ? ord : ord.id)
}
const ind = mainIndex.index > targetIndex.index ? idList.lastIndexOf(mainId) : idList.indexOf(mainId)
if(ind !== -1){
db.characterOrder.splice(ind, 1)
}
}
else{ else{
const ind = mainIndex.index > targetIndex.index ? db.characterOrder.lastIndexOf(mainId) : db.characterOrder.indexOf(mainId) const ind = mainIndex.index > targetIndex.index ? db.characterOrder.lastIndexOf(mainId) : db.characterOrder.indexOf(mainId)
if(ind !== -1){ if(ind !== -1){

View File

@@ -11,7 +11,6 @@ import {scrollBehaviourDragImageTranslateOverride} from "mobile-drag-drop/scroll
dragDropPolyfil({ dragDropPolyfil({
// use this to make use of the scroll behaviour // use this to make use of the scroll behaviour
dragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride, dragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride,
forceApply: navigator.maxTouchPoints > 0,
holdToDrag: 400 holdToDrag: 400
}); });

View File

@@ -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.1' export let appVer = '1.17.2'
export function setDatabase(data:Database){ export function setDatabase(data:Database){

View File

@@ -14,7 +14,7 @@ export function processScriptFull(char:character, data:string, mode:ScriptMode){
let db = get(DataBase) let db = get(DataBase)
let emoChanged = false let emoChanged = false
const scripts = char.customscript.concat(db.globalscript ?? []) const scripts = char.customscript.concat(db.globalscript ?? [])
for (const script of char.customscript){ 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) => { data = data.replace(reg, (v) => {

View File

@@ -1 +1 @@
{"version":"1.17.1"} {"version":"1.17.2"}