From 78545e7e3cae840c1bbf6e815ab06092d6b5f81c Mon Sep 17 00:00:00 2001 From: kwaroran Date: Tue, 23 May 2023 17:37:05 +0900 Subject: [PATCH] [feat] mobile polyfill override and hold --- src-tauri/tauri.conf.json | 2 +- src/main.ts | 10 ++++++++-- src/ts/database.ts | 2 +- version.json | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index eef90976..5a32a9c4 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "RisuAI", - "version": "1.15.3" + "version": "1.15.4" }, "tauri": { "allowlist": { diff --git a/src/main.ts b/src/main.ts index 3b201f2b..f6cfa7a7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,8 +5,15 @@ import { loadData } from "./ts/globalApi"; import { ReadableStream, WritableStream, TransformStream } from "web-streams-polyfill/ponyfill/es2018"; import { Buffer as BufferPolyfill } from 'buffer' import { initHotkey } from "./ts/hotkey"; -import {polyfill} from "mobile-drag-drop"; +import {polyfill as dragDropPolyfil} from "mobile-drag-drop"; +import {scrollBehaviourDragImageTranslateOverride} from "mobile-drag-drop/scroll-behaviour"; +dragDropPolyfil({ + // use this to make use of the scroll behaviour + dragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride, + forceApply: navigator.maxTouchPoints > 0, + holdToDrag: 400 +}); //Polyfills declare var Buffer: typeof BufferPolyfill; globalThis.Buffer = BufferPolyfill @@ -14,7 +21,6 @@ globalThis.Buffer = BufferPolyfill globalThis.WritableStream = globalThis.WritableStream ?? WritableStream globalThis.ReadableStream = globalThis.ReadableStream ?? ReadableStream globalThis.TransformStream = globalThis.TransformStream ?? TransformStream -polyfill() const app = new App({ target: document.getElementById("app"), diff --git a/src/ts/database.ts b/src/ts/database.ts index fdba507c..9ac3397e 100644 --- a/src/ts/database.ts +++ b/src/ts/database.ts @@ -7,7 +7,7 @@ import { cloneDeep } from 'lodash'; export const DataBase = writable({} as any as Database) export const loadedStore = writable(false) -export let appVer = '1.15.3' +export let appVer = '1.15.4' export function setDatabase(data:Database){ diff --git a/version.json b/version.json index 1ad5a201..e19d8328 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{"version":"1.15.3"} \ No newline at end of file +{"version":"1.15.4"} \ No newline at end of file