📚 Documentação inicial do ALETHEIA
- MANUAL-PRODUTO.md: Manual do usuário final - MANUAL-VENDAS.md: Estratégia comercial e vendas - MANUAL-TECNICO.md: Infraestrutura e deploy - README.md: Visão geral do projeto
This commit is contained in:
50
frontend/node_modules/framer-motion/dist/es/gestures/pan/index.mjs
generated
vendored
Normal file
50
frontend/node_modules/framer-motion/dist/es/gestures/pan/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
import { PanSession } from './PanSession.mjs';
|
||||
import { addPointerEvent } from '../../events/add-pointer-event.mjs';
|
||||
import { Feature } from '../../motion/features/Feature.mjs';
|
||||
import { noop } from 'motion-utils';
|
||||
import { getContextWindow } from '../../utils/get-context-window.mjs';
|
||||
import { frame } from '../../frameloop/frame.mjs';
|
||||
|
||||
const asyncHandler = (handler) => (event, info) => {
|
||||
if (handler) {
|
||||
frame.postRender(() => handler(event, info));
|
||||
}
|
||||
};
|
||||
class PanGesture extends Feature {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.removePointerDownListener = noop;
|
||||
}
|
||||
onPointerDown(pointerDownEvent) {
|
||||
this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
|
||||
transformPagePoint: this.node.getTransformPagePoint(),
|
||||
contextWindow: getContextWindow(this.node),
|
||||
});
|
||||
}
|
||||
createPanHandlers() {
|
||||
const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();
|
||||
return {
|
||||
onSessionStart: asyncHandler(onPanSessionStart),
|
||||
onStart: asyncHandler(onPanStart),
|
||||
onMove: onPan,
|
||||
onEnd: (event, info) => {
|
||||
delete this.session;
|
||||
if (onPanEnd) {
|
||||
frame.postRender(() => onPanEnd(event, info));
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
mount() {
|
||||
this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event));
|
||||
}
|
||||
update() {
|
||||
this.session && this.session.updateHandlers(this.createPanHandlers());
|
||||
}
|
||||
unmount() {
|
||||
this.removePointerDownListener();
|
||||
this.session && this.session.end();
|
||||
}
|
||||
}
|
||||
|
||||
export { PanGesture };
|
||||
Reference in New Issue
Block a user