Migrate to svelte 5

This commit is contained in:
kwaroran
2024-10-23 02:31:37 +09:00
parent e434c7ab96
commit c7330719ad
120 changed files with 2398 additions and 2033 deletions

View File

@@ -3,10 +3,14 @@
import { DataBase } from "../../../ts/storage/database";
import { longpress } from 'src/ts/gui/longtouch';
let textarea;
let textarea:HTMLElement = $state();
let previousScrollHeight = 0;
export let value = ''
export let handleLongPress = (e:MouseEvent) => {};
interface Props {
value?: string;
handleLongPress?: any;
}
let { value = $bindable(''), handleLongPress = (e:MouseEvent) => {} }: Props = $props();
function resize() {
textarea.style.height = '0px'; // Reset the textarea height
@@ -27,10 +31,10 @@
<textarea
bind:this={textarea}
on:input={handleInput}
oninput={handleInput}
use:longpress={handleLongPress}
bind:value={value}
class="rounded-md p-2 text-textcolor bg-transparent resize-none overflow-y-hidden border border-darkborderc"
style:font-size="{0.875 * ($DataBase.zoomsize / 100)}rem"
style:line-height="{($DataBase.lineHeight ?? 1.25) * ($DataBase.zoomsize / 100)}rem"
/>
></textarea>