From 3156a1a21c59654c316db0165538076eaafb15a9 Mon Sep 17 00:00:00 2001 From: Persephone Flores <34418758+hp0844182@users.noreply.github.com> Date: Sun, 17 Nov 2024 23:13:27 +0800 Subject: [PATCH 1/4] feat(motion): drag init --- package.json | 2 +- packages/motion/src/components/Motion.vue | 4 +- packages/motion/src/state/features/feature.ts | 3 +- .../src/state/features/gestures/drag.ts | 115 ++++++++++++++++++ .../src/state/features/gestures/index.ts | 1 + .../src/state/features/gestures/types.ts | 22 ++++ packages/motion/src/state/motion-state.ts | 6 +- packages/motion/src/state/types.ts | 13 ++ packages/motion/src/state/utils.ts | 6 +- packages/motion/src/types/index.ts | 15 +-- packages/motion/src/utils/events.ts | 2 +- playground/nuxt/app.vue | 12 +- 12 files changed, 173 insertions(+), 28 deletions(-) create mode 100644 packages/motion/src/state/features/gestures/drag.ts diff --git a/package.json b/package.json index 52d2e73..7210c00 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "main": "index.js", "scripts": { "dev:play": "pnpm --filter './playground/nuxt' dev", - "dev": "pnpm --filter './packages/vue' dev", + "dev": "pnpm --filter './packages/motion' dev", "build": "pnpm --filter './packages/**' build", "test": "pnpm --filter './packages/motion' test", "prepare": "pnpm simple-git-hooks", diff --git a/packages/motion/src/components/Motion.vue b/packages/motion/src/components/Motion.vue index ed9765f..d63554a 100644 --- a/packages/motion/src/components/Motion.vue +++ b/packages/motion/src/components/Motion.vue @@ -2,13 +2,13 @@ import type { CSSProperties, IntrinsicElementAttributes } from 'vue' import { Primitive } from './Primitive' import { isSvgTag } from './utils' -import { MotionState, mountedStates } from '@/state/motion-state' +import { MotionState } from '@/state/motion-state' type ElementType = keyof IntrinsicElementAttributes