motion-v 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +405 -102
- package/dist/es/components/context.d.ts +0 -1
- package/dist/es/components/group.d.ts +0 -1
- package/dist/es/components/group.mjs +1 -5
- package/dist/es/components/index.d.ts +1 -0
- package/dist/es/components/motion/Motion.vue.mjs +4 -0
- package/dist/es/components/reorder/Group.d.ts +71 -0
- package/dist/es/components/reorder/Group.vue.mjs +131 -0
- package/dist/es/components/reorder/Group.vue2.mjs +4 -0
- package/dist/es/components/reorder/Item.d.ts +88 -0
- package/dist/es/components/reorder/Item.vue.mjs +131 -0
- package/dist/es/components/reorder/Item.vue2.mjs +4 -0
- package/dist/es/components/reorder/context.d.ts +8 -0
- package/dist/es/components/reorder/context.mjs +6 -0
- package/dist/es/components/reorder/index.d.ts +13 -0
- package/dist/es/components/reorder/index.mjs +13 -0
- package/dist/es/components/reorder/types.d.ts +5 -0
- package/dist/es/components/reorder/utils.d.ts +6 -0
- package/dist/es/components/reorder/utils.mjs +46 -0
- package/dist/es/constants/index.mjs +3 -1
- package/dist/es/features/layout/layout.d.ts +1 -0
- package/dist/es/features/layout/layout.mjs +8 -7
- package/dist/es/features/layout/projection.mjs +16 -1
- package/dist/es/features/layout/types.d.ts +14 -1
- package/dist/es/index.mjs +4 -0
- package/dist/es/state/motion-state.mjs +5 -10
- package/dist/es/utils/use-in-view.d.ts +1 -1
- package/package.json +3 -2
|
@@ -68,6 +68,9 @@ class MotionState {
|
|
|
68
68
|
// Initialize animation target values
|
|
69
69
|
initTarget(initialVariantSource) {
|
|
70
70
|
this.baseTarget = resolveVariant(this.options[initialVariantSource] || this.context[initialVariantSource], this.options.variants) || {};
|
|
71
|
+
for (const key in this.baseTarget) {
|
|
72
|
+
this.visualElement.setStaticValue(key, this.baseTarget[key]);
|
|
73
|
+
}
|
|
71
74
|
this.target = {};
|
|
72
75
|
}
|
|
73
76
|
// Get initial animation state
|
|
@@ -104,15 +107,6 @@ class MotionState {
|
|
|
104
107
|
}
|
|
105
108
|
this.visualElement.state = this;
|
|
106
109
|
this.updateOptions();
|
|
107
|
-
if (typeof this.initial === "object") {
|
|
108
|
-
for (const key in this.initial) {
|
|
109
|
-
this.visualElement.setStaticValue(key, this.initial[key]);
|
|
110
|
-
}
|
|
111
|
-
} else if (typeof this.initial === "string" && this.options.variants) {
|
|
112
|
-
for (const key in this.options.variants[this.initial]) {
|
|
113
|
-
this.visualElement.setStaticValue(key, this.options.variants[this.initial][key]);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
110
|
this.featureManager.mount();
|
|
117
111
|
if (!notAnimate && this.options.animate) {
|
|
118
112
|
this.animateUpdates();
|
|
@@ -184,7 +178,8 @@ class MotionState {
|
|
|
184
178
|
}
|
|
185
179
|
willUpdate(label) {
|
|
186
180
|
var _a;
|
|
187
|
-
(
|
|
181
|
+
if (this.options.layout || this.options.layoutId)
|
|
182
|
+
(_a = this.visualElement.projection) == null ? void 0 : _a.willUpdate();
|
|
188
183
|
}
|
|
189
184
|
}
|
|
190
185
|
export {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { Options } from '../types/state';
|
|
3
|
-
export declare function useInView<T extends Element = any>(domRef: Ref<T>, options?: Options['inViewOptions'] | Ref<Options['inViewOptions']>): Ref<boolean>;
|
|
3
|
+
export declare function useInView<T extends Element = any>(domRef: Ref<T | null>, options?: Options['inViewOptions'] | Ref<Options['inViewOptions']>): Ref<boolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motion-v",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"@vue/test-utils": "^2.4.5",
|
|
69
69
|
"happy-dom": "^16.0.1",
|
|
70
70
|
"jsdom": "^24.0.0",
|
|
71
|
+
"rimraf": "^6.0.1",
|
|
71
72
|
"vite": "^5.4.8",
|
|
72
73
|
"vite-plugin-dts": "^4.2.4",
|
|
73
74
|
"vitest": "^1.4.0",
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
},
|
|
76
77
|
"scripts": {
|
|
77
78
|
"dev": "vite build --watch",
|
|
78
|
-
"build": "
|
|
79
|
+
"build": "rimraf dist && vite build",
|
|
79
80
|
"test": "vitest --dom",
|
|
80
81
|
"coverage": "vitest run --coverage",
|
|
81
82
|
"pub:release": "pnpm publish --access public"
|