motion-v 1.7.3 → 1.7.4

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 CHANGED
@@ -9225,22 +9225,26 @@ class MotionState {
9225
9225
  this.featureManager.beforeUnmount();
9226
9226
  }
9227
9227
  unmount(unMountChildren = false) {
9228
- var _a, _b, _c, _d;
9228
+ var _a;
9229
9229
  const shouldDelay = this.options.layoutId && ((_a = this.visualElement.projection) == null ? void 0 : _a.getStack().lead) === this.visualElement.projection && this.visualElement.projection.isProjecting();
9230
+ const unmountState = () => {
9231
+ var _a2, _b, _c;
9232
+ if (unMountChildren) {
9233
+ Array.from(this.children).reverse().forEach(this.unmountChild);
9234
+ }
9235
+ (_b = (_a2 = this.parent) == null ? void 0 : _a2.children) == null ? void 0 : _b.delete(this);
9236
+ mountedStates.delete(this.element);
9237
+ this.featureManager.unmount();
9238
+ (_c = this.visualElement) == null ? void 0 : _c.unmount();
9239
+ this.clearAnimation();
9240
+ };
9230
9241
  if (shouldDelay) {
9231
9242
  Promise.resolve().then(() => {
9232
- this.unmount(unMountChildren);
9243
+ unmountState();
9233
9244
  });
9234
- return;
9235
- }
9236
- if (unMountChildren) {
9237
- Array.from(this.children).reverse().forEach(this.unmountChild);
9245
+ } else {
9246
+ unmountState();
9238
9247
  }
9239
- (_c = (_b = this.parent) == null ? void 0 : _b.children) == null ? void 0 : _c.delete(this);
9240
- mountedStates.delete(this.element);
9241
- this.featureManager.unmount();
9242
- (_d = this.visualElement) == null ? void 0 : _d.unmount();
9243
- this.clearAnimation();
9244
9248
  }
9245
9249
  unmountChild(child) {
9246
9250
  child.unmount(true);
@@ -107,22 +107,26 @@ class MotionState {
107
107
  this.featureManager.beforeUnmount();
108
108
  }
109
109
  unmount(unMountChildren = false) {
110
- var _a, _b, _c, _d;
110
+ var _a;
111
111
  const shouldDelay = this.options.layoutId && ((_a = this.visualElement.projection) == null ? void 0 : _a.getStack().lead) === this.visualElement.projection && this.visualElement.projection.isProjecting();
112
+ const unmountState = () => {
113
+ var _a2, _b, _c;
114
+ if (unMountChildren) {
115
+ Array.from(this.children).reverse().forEach(this.unmountChild);
116
+ }
117
+ (_b = (_a2 = this.parent) == null ? void 0 : _a2.children) == null ? void 0 : _b.delete(this);
118
+ mountedStates.delete(this.element);
119
+ this.featureManager.unmount();
120
+ (_c = this.visualElement) == null ? void 0 : _c.unmount();
121
+ this.clearAnimation();
122
+ };
112
123
  if (shouldDelay) {
113
124
  Promise.resolve().then(() => {
114
- this.unmount(unMountChildren);
125
+ unmountState();
115
126
  });
116
- return;
127
+ } else {
128
+ unmountState();
117
129
  }
118
- if (unMountChildren) {
119
- Array.from(this.children).reverse().forEach(this.unmountChild);
120
- }
121
- (_c = (_b = this.parent) == null ? void 0 : _b.children) == null ? void 0 : _c.delete(this);
122
- mountedStates.delete(this.element);
123
- this.featureManager.unmount();
124
- (_d = this.visualElement) == null ? void 0 : _d.unmount();
125
- this.clearAnimation();
126
130
  }
127
131
  unmountChild(child) {
128
132
  child.unmount(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion-v",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",