[feat] mobile polyfill override and hold
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "RisuAI",
|
"productName": "RisuAI",
|
||||||
"version": "1.15.3"
|
"version": "1.15.4"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
|||||||
10
src/main.ts
10
src/main.ts
@@ -5,8 +5,15 @@ 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} 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
|
//Polyfills
|
||||||
declare var Buffer: typeof BufferPolyfill;
|
declare var Buffer: typeof BufferPolyfill;
|
||||||
globalThis.Buffer = BufferPolyfill
|
globalThis.Buffer = BufferPolyfill
|
||||||
@@ -14,7 +21,6 @@ globalThis.Buffer = BufferPolyfill
|
|||||||
globalThis.WritableStream = globalThis.WritableStream ?? WritableStream
|
globalThis.WritableStream = globalThis.WritableStream ?? WritableStream
|
||||||
globalThis.ReadableStream = globalThis.ReadableStream ?? ReadableStream
|
globalThis.ReadableStream = globalThis.ReadableStream ?? ReadableStream
|
||||||
globalThis.TransformStream = globalThis.TransformStream ?? TransformStream
|
globalThis.TransformStream = globalThis.TransformStream ?? TransformStream
|
||||||
polyfill()
|
|
||||||
|
|
||||||
const app = new App({
|
const app = new App({
|
||||||
target: document.getElementById("app"),
|
target: document.getElementById("app"),
|
||||||
|
|||||||
@@ -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.15.3'
|
export let appVer = '1.15.4'
|
||||||
|
|
||||||
|
|
||||||
export function setDatabase(data:Database){
|
export function setDatabase(data:Database){
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":"1.15.3"}
|
{"version":"1.15.4"}
|
||||||
Reference in New Issue
Block a user