motion-v 2.0.0-beta.4 → 2.0.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.
|
@@ -89,9 +89,10 @@ function useMotionState(props, renderer) {
|
|
|
89
89
|
});
|
|
90
90
|
onBeforeUpdate(() => {
|
|
91
91
|
state.beforeUpdate();
|
|
92
|
+
state.updateOptions(getMotionProps());
|
|
92
93
|
});
|
|
93
94
|
onUpdated(() => {
|
|
94
|
-
state.update(
|
|
95
|
+
state.update();
|
|
95
96
|
});
|
|
96
97
|
return {
|
|
97
98
|
getProps,
|
|
@@ -111,7 +111,6 @@ function createMotionDirective(featureBundle, defaultOptions) {
|
|
|
111
111
|
created(el, binding, vnode) {
|
|
112
112
|
const provides = resolveProvides(vnode, binding);
|
|
113
113
|
const { options, parentState } = buildMotionOptions(mergeMotionProps(vnode, binding.value), provides, resolveTag(el));
|
|
114
|
-
console.log("options", options);
|
|
115
114
|
const state = new MotionState(options, parentState);
|
|
116
115
|
state.initVisualElement(renderer);
|
|
117
116
|
mountedStates.set(el, state);
|
|
@@ -124,18 +123,19 @@ function createMotionDirective(featureBundle, defaultOptions) {
|
|
|
124
123
|
state.mount(el);
|
|
125
124
|
state.updateFeatures();
|
|
126
125
|
},
|
|
127
|
-
beforeUpdate(el) {
|
|
126
|
+
beforeUpdate(el, binding, vnode) {
|
|
128
127
|
const state = mountedStates.get(el);
|
|
129
128
|
if (!state) return;
|
|
129
|
+
const provides = resolveProvides(vnode, binding);
|
|
130
|
+
const { options } = buildMotionOptions(mergeMotionProps(vnode, binding.value), provides, resolveTag(el));
|
|
130
131
|
state.beforeUpdate();
|
|
132
|
+
state.updateOptions(options);
|
|
131
133
|
},
|
|
132
134
|
updated(el, binding, vnode) {
|
|
133
135
|
const state = mountedStates.get(el);
|
|
134
136
|
if (!state) return;
|
|
135
137
|
cleanVNodeProps(el, vnode.props);
|
|
136
|
-
|
|
137
|
-
const { options } = buildMotionOptions(mergeMotionProps(vnode, binding.value), provides, resolveTag(el));
|
|
138
|
-
state.update(options);
|
|
138
|
+
state.update();
|
|
139
139
|
},
|
|
140
140
|
beforeUnmount(el) {
|
|
141
141
|
const state = mountedStates.get(el);
|
|
@@ -34,7 +34,7 @@ export declare class MotionState {
|
|
|
34
34
|
beforeUnmount(): void;
|
|
35
35
|
unmount(): void;
|
|
36
36
|
beforeUpdate(): void;
|
|
37
|
-
update(
|
|
37
|
+
update(): void;
|
|
38
38
|
tryExitComplete(): void;
|
|
39
39
|
setActive(name: StateType, isActive: boolean): void;
|
|
40
40
|
isMounted(): boolean;
|