mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-11 05:58:56 +08:00
feat(mobile): swipe to open menu for explorer (#8953)
close AF-1803 - bump theme - extract `SwipeHelper` and add `speed`, `direction` detection support - new mobile `SwipeMenu` component - integrate `SwipeMenu` to open a menu in Explorer - New `Haptics` module for mobile, implemented in `ios` and `mobile`(`navigator.vibrate()`) 
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { AffineContext } from '@affine/core/components/context';
|
||||
import { AppFallback } from '@affine/core/mobile/components/app-fallback';
|
||||
import { configureMobileModules } from '@affine/core/mobile/modules';
|
||||
import { HapticProvider } from '@affine/core/mobile/modules/haptics';
|
||||
import { NavigationGestureProvider } from '@affine/core/mobile/modules/navigation-gesture';
|
||||
import { VirtualKeyboardProvider } from '@affine/core/mobile/modules/virtual-keyboard';
|
||||
import { router } from '@affine/core/mobile/router';
|
||||
@@ -22,6 +23,7 @@ import {
|
||||
} from '@affine/core/modules/workspace-engine';
|
||||
import { App as CapacitorApp } from '@capacitor/app';
|
||||
import { Browser } from '@capacitor/browser';
|
||||
import { Haptics } from '@capacitor/haptics';
|
||||
import { Keyboard } from '@capacitor/keyboard';
|
||||
import {
|
||||
Framework,
|
||||
@@ -94,6 +96,14 @@ framework.impl(NavigationGestureProvider, {
|
||||
enable: () => NavigationGesture.enable(),
|
||||
disable: () => NavigationGesture.disable(),
|
||||
});
|
||||
framework.impl(HapticProvider, {
|
||||
impact: options => Haptics.impact(options as any),
|
||||
vibrate: options => Haptics.vibrate(options as any),
|
||||
notification: options => Haptics.notification(options as any),
|
||||
selectionStart: () => Haptics.selectionStart(),
|
||||
selectionChanged: () => Haptics.selectionChanged(),
|
||||
selectionEnd: () => Haptics.selectionEnd(),
|
||||
});
|
||||
const frameworkProvider = framework.provider();
|
||||
|
||||
// setup application lifecycle events, and emit application start event
|
||||
|
||||
Reference in New Issue
Block a user