@tamagui/animations-motion 3.0.0-beta.924.1 → 3.0.1

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.
@@ -95,8 +95,8 @@ function createAnimations(animations) {
95
95
  if (isHydratingGlobal === void 0 && !(0, import_web.getConfig)().settings.disableSSR) {
96
96
  isHydratingGlobal = true;
97
97
  }
98
- const { props, style, componentState, stateRef, useStyleEmitter, presence, onTransition, styleProps } = animationProps;
99
- const animationKey = Array.isArray(props.transition) ? props.transition[0] : props.transition;
98
+ const { props, style, componentState, stateRef, useStyleEmitter, presence, onTransition, styleProps, styleState } = animationProps;
99
+ const effectiveTransition = styleState?.effectiveTransition ?? props.transition;
100
100
  const isComponentHydrating = componentState.unmounted === true;
101
101
  const isMounting = componentState.unmounted === "should-enter";
102
102
  const isEntering = !!componentState.unmounted;
@@ -144,7 +144,7 @@ function createAnimations(animations) {
144
144
  refs.current.wasEntering = isEntering;
145
145
  });
146
146
  const animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default";
147
- const disableAnimation = isComponentHydrating || isMounting || !animationKey;
147
+ const disableAnimation = isComponentHydrating || isMounting || !effectiveTransition;
148
148
  const [scope] = useAnimateSSRSafe();
149
149
  refs.current.isExiting = isExiting;
150
150
  refs.current.sendExitComplete = sendExitComplete;
@@ -167,7 +167,7 @@ function createAnimations(animations) {
167
167
  emit("end", "exit", false);
168
168
  }
169
169
  }, [justStoppedExiting]);
170
- const { dontAnimate = {}, doAnimate, animationOptions } = getMotionAnimatedProps(props, style, disableAnimation, animationState);
170
+ const { dontAnimate = {}, doAnimate, animationOptions } = getMotionAnimatedProps(props, style, disableAnimation, animationState, effectiveTransition);
171
171
  const [firstRenderStyle] = (0, import_react2.useState)(style);
172
172
  if (refs.current.isFirstRender) {
173
173
  refs.current.lastDontAnimate = firstRenderStyle;
@@ -192,7 +192,7 @@ function createAnimations(animations) {
192
192
  if (isCurrentlyExiting && refs.current.frozenExitTarget) {
193
193
  doAnimate2 = refs.current.frozenExitTarget;
194
194
  }
195
- const animationOptions2 = isCurrentlyExiting && currentSendExitComplete ? getAnimationOptions(props.transition ?? null, "exit") : passedOptions;
195
+ const animationOptions2 = isCurrentlyExiting && currentSendExitComplete ? getAnimationOptions((0, import_animation_helpers.forAnimationState)((0, import_animation_helpers.resolveTransition)(effectiveTransition ?? null, { animations }), "exit")) : passedOptions;
196
196
  try {
197
197
  const node = stateRef.current.host;
198
198
  if (refs.current.isFirstRender) {
@@ -301,7 +301,7 @@ function createAnimations(animations) {
301
301
  } catch {}
302
302
  }
303
303
  const opts = animationOptions2;
304
- const positionTransition = opts.transform ?? opts.default ?? animationOptions2;
304
+ const positionTransition = opts.x ?? opts.transform ?? opts.default ?? animationOptions2;
305
305
  const cx = (0, import_react.animate)(entry.x, target.x, positionTransition);
306
306
  const cy = (0, import_react.animate)(entry.y, target.y, positionTransition);
307
307
  entry.stop = () => {
@@ -427,8 +427,8 @@ function createAnimations(animations) {
427
427
  }
428
428
  }
429
429
  };
430
- useStyleEmitter?.((nextStyle, effectiveTransition) => {
431
- const animationProps2 = getMotionAnimatedProps(props, nextStyle, disableAnimation, refs.current.animationState, effectiveTransition);
430
+ useStyleEmitter?.((nextStyle, emittedTransition) => {
431
+ const animationProps2 = getMotionAnimatedProps(props, nextStyle, disableAnimation, refs.current.animationState, emittedTransition ?? effectiveTransition);
432
432
  flushAnimation(animationProps2);
433
433
  });
434
434
  (0, import_web.useIsomorphicLayoutEffect)(() => {
@@ -571,13 +571,13 @@ function createAnimations(animations) {
571
571
  if (disable) {
572
572
  return { dontAnimate: style };
573
573
  }
574
- const animationOptions = getAnimationOptions(transitionOverride ?? props.transition ?? null, animationState);
574
+ const resolved = (0, import_animation_helpers.forAnimationState)((0, import_animation_helpers.resolveTransition)(transitionOverride ?? props.transition ?? null, { animations }), animationState);
575
+ const animationOptions = getAnimationOptions(resolved);
575
576
  let dontAnimate;
576
577
  let doAnimate;
577
- const animateOnly = props.animateOnly;
578
578
  for (const key in style) {
579
579
  const value = style[key];
580
- if (disableAnimationProps.has(key) || animateOnly && !animateOnly.includes(key)) {
580
+ if (disableAnimationProps.has(key) || !(0, import_animation_helpers.getTransitionForKey)(resolved, key)) {
581
581
  dontAnimate ||= {};
582
582
  dontAnimate[key] = value;
583
583
  } else {
@@ -591,79 +591,48 @@ function createAnimations(animations) {
591
591
  animationOptions
592
592
  };
593
593
  }
594
- function getAnimationOptions(transitionProp, animationState = "default") {
595
- const normalized = (0, import_animation_helpers.normalizeTransition)(transitionProp);
596
- let effectiveKey = (0, import_animation_helpers.getEffectiveAnimation)(normalized, animationState);
597
- if (!effectiveKey && animationState === "default") {
598
- effectiveKey = normalized.enter || normalized.exit || null;
599
- }
600
- const globalConfigOverride = normalized.config ? { ...normalized.config } : void 0;
601
- if (!effectiveKey && Object.keys(normalized.properties).length === 0 && !globalConfigOverride) {
602
- return {};
603
- }
604
- const defaultConfig = effectiveKey ? withInferredType(animations[effectiveKey]) : null;
605
- const delay = normalized.delay;
594
+ function getAnimationOptions(resolved) {
595
+ if (!(0, import_animation_helpers.hasTransition)(resolved)) return {};
606
596
  const result = {};
607
- if (defaultConfig) {
608
- Object.assign(result, defaultConfig);
609
- }
610
- if (globalConfigOverride) {
611
- Object.assign(result, globalConfigOverride);
612
- if (result.type === void 0 && result.duration !== void 0 && result.damping === void 0 && result.stiffness === void 0 && result.mass === void 0) {
613
- result.type = "tween";
614
- }
597
+ if (resolved.all) {
598
+ const base = entryToMotion(resolved.all);
599
+ Object.assign(result, base);
600
+ result.default = { ...base };
615
601
  }
616
- if (delay) {
617
- result.delay = delay;
618
- }
619
- if (defaultConfig || globalConfigOverride || delay) {
620
- result.default = {
621
- ...defaultConfig,
622
- ...globalConfigOverride,
623
- ...delay ? { delay } : null
624
- };
625
- }
626
- for (const [propName, animationNameOrConfig] of Object.entries(normalized.properties)) {
627
- if (typeof animationNameOrConfig === "string") {
628
- result[propName] = withInferredType(animations[animationNameOrConfig]);
629
- } else if (animationNameOrConfig && typeof animationNameOrConfig === "object") {
630
- const baseConfig = animationNameOrConfig.type ? withInferredType(animations[animationNameOrConfig.type]) : defaultConfig;
631
- result[propName] = {
632
- ...baseConfig,
633
- ...animationNameOrConfig
634
- };
635
- }
636
- }
637
- convertMsToS(result);
638
- convertMsToS(result.default);
639
- for (const key in result) {
640
- if (key !== "default" && typeof result[key] === "object") {
641
- convertMsToS(result[key]);
602
+ for (const entry of resolved.entries) {
603
+ if (entry.property === "all") continue;
604
+ const config = entryToMotion(entry);
605
+ for (const key of (0, import_animation_helpers.styleKeysForProperty)(entry.property)) {
606
+ result[key] = { ...config };
642
607
  }
643
608
  }
644
609
  return result;
645
610
  }
646
611
  }
647
- function withInferredType(config) {
648
- if (!config) {
649
- return { type: "spring" };
612
+ function entryToMotion(entry) {
613
+ const delay = entry.delayMs ? { delay: entry.delayMs / 1e3 } : null;
614
+ if (entry.timing.kind === "spring") {
615
+ return {
616
+ type: "spring",
617
+ stiffness: entry.timing.stiffness,
618
+ damping: entry.timing.damping,
619
+ mass: entry.timing.mass,
620
+ ...delay
621
+ };
650
622
  }
651
- const isTimingBased = config.duration !== void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;
623
+ const bezier = (0, import_animation_helpers.easingToBezier)(entry.timing.easing);
652
624
  return {
653
- type: isTimingBased ? "tween" : "spring",
654
- ...config
625
+ type: "tween",
626
+ duration: entry.timing.durationMs / 1e3,
627
+ ...bezier ? { ease: [
628
+ bezier[0],
629
+ bezier[1],
630
+ bezier[2],
631
+ bezier[3]
632
+ ] } : null,
633
+ ...delay
655
634
  };
656
635
  }
657
- function convertMsToS(config) {
658
- if (!config) return;
659
- if (typeof config.delay === "number") config.delay = config.delay / 1e3;
660
- if (typeof config.duration === "number") {
661
- const isTimingBased = config.type === "tween" || config.type === void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;
662
- if (isTimingBased) {
663
- config.duration = config.duration / 1e3;
664
- }
665
- }
666
- }
667
636
  function removeRemovedStyles(prev, next, node, dontClearIfIn) {
668
637
  for (const key in prev) {
669
638
  if (!(key in next)) {
@@ -39,17 +39,6 @@ var import_web = require("@tamagui/web");
39
39
  var import_internal_runtime = require("@tamagui/web/internal-runtime");
40
40
  var import_react = require("motion/react");
41
41
  var import_react2 = __toESM(require("react"), 1);
42
- function _instanceof(left, right) {
43
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
44
- return !!right[Symbol.hasInstance](left);
45
- } else {
46
- return left instanceof right;
47
- }
48
- }
49
- function _type_of(obj) {
50
- "@swc/helpers - typeof";
51
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
52
- }
53
42
  var isServer = typeof window === "undefined";
54
43
  function useAnimateSSRSafe() {
55
44
  if (isServer) {
@@ -58,7 +47,7 @@ function useAnimateSSRSafe() {
58
47
  return (0, import_react.useAnimate)();
59
48
  }
60
49
  var asStyleRecord = function(style) {
61
- return style && (typeof style === "undefined" ? "undefined" : _type_of(style)) === "object" && !Array.isArray(style) ? style : {};
50
+ return style && typeof style === "object" && !Array.isArray(style) ? style : {};
62
51
  };
63
52
  function assignInlineStyles(node, styles) {
64
53
  for (var key in styles) {
@@ -116,8 +105,9 @@ function createAnimations(animations) {
116
105
  if (isHydratingGlobal === void 0 && !(0, import_web.getConfig)().settings.disableSSR) {
117
106
  isHydratingGlobal = true;
118
107
  }
119
- var { props, style, componentState, stateRef, useStyleEmitter, presence, onTransition, styleProps } = animationProps;
120
- var animationKey = Array.isArray(props.transition) ? props.transition[0] : props.transition;
108
+ var { props, style, componentState, stateRef, useStyleEmitter, presence, onTransition, styleProps, styleState } = animationProps;
109
+ var _styleState_effectiveTransition;
110
+ var effectiveTransition = (_styleState_effectiveTransition = styleState === null || styleState === void 0 ? void 0 : styleState.effectiveTransition) !== null && _styleState_effectiveTransition !== void 0 ? _styleState_effectiveTransition : props.transition;
121
111
  var isComponentHydrating = componentState.unmounted === true;
122
112
  var isMounting = componentState.unmounted === "should-enter";
123
113
  var isEntering = !!componentState.unmounted;
@@ -166,7 +156,7 @@ function createAnimations(animations) {
166
156
  refs.current.wasEntering = isEntering;
167
157
  });
168
158
  var animationState = isExiting ? "exit" : isMounting || justFinishedEntering ? "enter" : "default";
169
- var disableAnimation = isComponentHydrating || isMounting || !animationKey;
159
+ var disableAnimation = isComponentHydrating || isMounting || !effectiveTransition;
170
160
  var [scope] = useAnimateSSRSafe();
171
161
  refs.current.isExiting = isExiting;
172
162
  refs.current.sendExitComplete = sendExitComplete;
@@ -189,7 +179,7 @@ function createAnimations(animations) {
189
179
  emit("end", "exit", false);
190
180
  }
191
181
  }, [justStoppedExiting]);
192
- var { dontAnimate = {}, doAnimate, animationOptions } = getMotionAnimatedProps(props, style, disableAnimation, animationState);
182
+ var { dontAnimate = {}, doAnimate, animationOptions } = getMotionAnimatedProps(props, style, disableAnimation, animationState, effectiveTransition);
193
183
  var [firstRenderStyle] = (0, import_react2.useState)(style);
194
184
  if (refs.current.isFirstRender) {
195
185
  refs.current.lastDontAnimate = firstRenderStyle;
@@ -215,8 +205,7 @@ function createAnimations(animations) {
215
205
  if (isCurrentlyExiting && refs.current.frozenExitTarget) {
216
206
  doAnimate2 = refs.current.frozenExitTarget;
217
207
  }
218
- var _props_transition;
219
- var animationOptions2 = isCurrentlyExiting && currentSendExitComplete ? getAnimationOptions((_props_transition = props.transition) !== null && _props_transition !== void 0 ? _props_transition : null, "exit") : passedOptions;
208
+ var animationOptions2 = isCurrentlyExiting && currentSendExitComplete ? getAnimationOptions((0, import_animation_helpers.forAnimationState)((0, import_animation_helpers.resolveTransition)(effectiveTransition !== null && effectiveTransition !== void 0 ? effectiveTransition : null, { animations }), "exit")) : passedOptions;
220
209
  try {
221
210
  var node = stateRef.current.host;
222
211
  if (refs.current.isFirstRender) {
@@ -245,7 +234,7 @@ function createAnimations(animations) {
245
234
  console.groupEnd();
246
235
  }
247
236
  }
248
- if (!_instanceof(node, HTMLElement)) {
237
+ if (!(node instanceof HTMLElement)) {
249
238
  return;
250
239
  }
251
240
  var prevDont = refs.current.lastDontAnimate;
@@ -346,8 +335,8 @@ function createAnimations(animations) {
346
335
  }
347
336
  }
348
337
  var opts = animationOptions2;
349
- var _opts_transform, _ref;
350
- var positionTransition = (_ref = (_opts_transform = opts.transform) !== null && _opts_transform !== void 0 ? _opts_transform : opts.default) !== null && _ref !== void 0 ? _ref : animationOptions2;
338
+ var _opts_x, _ref, _ref1;
339
+ var positionTransition = (_ref1 = (_ref = (_opts_x = opts.x) !== null && _opts_x !== void 0 ? _opts_x : opts.transform) !== null && _ref !== void 0 ? _ref : opts.default) !== null && _ref1 !== void 0 ? _ref1 : animationOptions2;
351
340
  var cx = (0, import_react.animate)(entry.x, target.x, positionTransition);
352
341
  var cy = (0, import_react.animate)(entry.y, target.y, positionTransition);
353
342
  entry.stop = function() {
@@ -507,8 +496,8 @@ function createAnimations(animations) {
507
496
  }
508
497
  }
509
498
  };
510
- useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function(nextStyle, effectiveTransition) {
511
- var _$animationProps = getMotionAnimatedProps(props, nextStyle, disableAnimation, refs.current.animationState, effectiveTransition);
499
+ useStyleEmitter === null || useStyleEmitter === void 0 ? void 0 : useStyleEmitter(function(nextStyle, emittedTransition) {
500
+ var _$animationProps = getMotionAnimatedProps(props, nextStyle, disableAnimation, refs.current.animationState, emittedTransition !== null && emittedTransition !== void 0 ? emittedTransition : effectiveTransition);
512
501
  flushAnimation(_$animationProps);
513
502
  });
514
503
  (0, import_web.useIsomorphicLayoutEffect)(function() {
@@ -535,7 +524,7 @@ function createAnimations(animations) {
535
524
  refs.current.wasNoClass = !!styleProps.noClass;
536
525
  if ((justEnabled || justStrippedClasses) && animationState !== "enter") {
537
526
  var node = stateRef.current.host;
538
- if (_instanceof(node, HTMLElement)) {
527
+ if (node instanceof HTMLElement) {
539
528
  if (dontAnimate) assignInlineStyles(node, dontAnimate);
540
529
  if (doAnimate) assignInlineStyles(node, doAnimate);
541
530
  var entry = PopperPositionAnims.get(node);
@@ -666,13 +655,13 @@ function createAnimations(animations) {
666
655
  return { dontAnimate: style };
667
656
  }
668
657
  var _ref;
669
- var animationOptions = getAnimationOptions((_ref = transitionOverride !== null && transitionOverride !== void 0 ? transitionOverride : props.transition) !== null && _ref !== void 0 ? _ref : null, animationState);
658
+ var resolved = (0, import_animation_helpers.forAnimationState)((0, import_animation_helpers.resolveTransition)((_ref = transitionOverride !== null && transitionOverride !== void 0 ? transitionOverride : props.transition) !== null && _ref !== void 0 ? _ref : null, { animations }), animationState);
659
+ var animationOptions = getAnimationOptions(resolved);
670
660
  var dontAnimate;
671
661
  var doAnimate;
672
- var animateOnly = props.animateOnly;
673
662
  for (var key in style) {
674
663
  var value = style[key];
675
- if (disableAnimationProps.has(key) || animateOnly && !animateOnly.includes(key)) {
664
+ if (disableAnimationProps.has(key) || !(0, import_animation_helpers.getTransitionForKey)(resolved, key)) {
676
665
  dontAnimate || (dontAnimate = {});
677
666
  dontAnimate[key] = value;
678
667
  } else {
@@ -686,51 +675,39 @@ function createAnimations(animations) {
686
675
  animationOptions
687
676
  };
688
677
  }
689
- function getAnimationOptions(transitionProp) {
690
- var animationState = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default";
691
- var normalized = (0, import_animation_helpers.normalizeTransition)(transitionProp);
692
- var effectiveKey = (0, import_animation_helpers.getEffectiveAnimation)(normalized, animationState);
693
- if (!effectiveKey && animationState === "default") {
694
- effectiveKey = normalized.enter || normalized.exit || null;
695
- }
696
- var globalConfigOverride = normalized.config ? { ...normalized.config } : void 0;
697
- if (!effectiveKey && Object.keys(normalized.properties).length === 0 && !globalConfigOverride) {
698
- return {};
699
- }
700
- var defaultConfig = effectiveKey ? withInferredType(animations[effectiveKey]) : null;
701
- var delay = normalized.delay;
678
+ function getAnimationOptions(resolved) {
679
+ if (!(0, import_animation_helpers.hasTransition)(resolved)) return {};
702
680
  var result = {};
703
- if (defaultConfig) {
704
- Object.assign(result, defaultConfig);
705
- }
706
- if (globalConfigOverride) {
707
- Object.assign(result, globalConfigOverride);
708
- if (result.type === void 0 && result.duration !== void 0 && result.damping === void 0 && result.stiffness === void 0 && result.mass === void 0) {
709
- result.type = "tween";
710
- }
711
- }
712
- if (delay) {
713
- result.delay = delay;
714
- }
715
- if (defaultConfig || globalConfigOverride || delay) {
716
- result.default = {
717
- ...defaultConfig,
718
- ...globalConfigOverride,
719
- ...delay ? { delay } : null
720
- };
681
+ if (resolved.all) {
682
+ var base = entryToMotion(resolved.all);
683
+ Object.assign(result, base);
684
+ result.default = { ...base };
721
685
  }
722
686
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
723
687
  try {
724
- for (var _iterator = Object.entries(normalized.properties)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
725
- var [propName, animationNameOrConfig] = _step.value;
726
- if (typeof animationNameOrConfig === "string") {
727
- result[propName] = withInferredType(animations[animationNameOrConfig]);
728
- } else if (animationNameOrConfig && (typeof animationNameOrConfig === "undefined" ? "undefined" : _type_of(animationNameOrConfig)) === "object") {
729
- var baseConfig = animationNameOrConfig.type ? withInferredType(animations[animationNameOrConfig.type]) : defaultConfig;
730
- result[propName] = {
731
- ...baseConfig,
732
- ...animationNameOrConfig
733
- };
688
+ for (var _iterator = resolved.entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
689
+ var entry = _step.value;
690
+ if (entry.property === "all") continue;
691
+ var config = entryToMotion(entry);
692
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
693
+ try {
694
+ for (var _iterator1 = (0, import_animation_helpers.styleKeysForProperty)(entry.property)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
695
+ var key = _step1.value;
696
+ result[key] = { ...config };
697
+ }
698
+ } catch (err) {
699
+ _didIteratorError1 = true;
700
+ _iteratorError1 = err;
701
+ } finally {
702
+ try {
703
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
704
+ _iterator1.return();
705
+ }
706
+ } finally {
707
+ if (_didIteratorError1) {
708
+ throw _iteratorError1;
709
+ }
710
+ }
734
711
  }
735
712
  }
736
713
  } catch (err) {
@@ -747,36 +724,33 @@ function createAnimations(animations) {
747
724
  }
748
725
  }
749
726
  }
750
- convertMsToS(result);
751
- convertMsToS(result.default);
752
- for (var key in result) {
753
- if (key !== "default" && _type_of(result[key]) === "object") {
754
- convertMsToS(result[key]);
755
- }
756
- }
757
727
  return result;
758
728
  }
759
729
  }
760
- function withInferredType(config) {
761
- if (!config) {
762
- return { type: "spring" };
730
+ function entryToMotion(entry) {
731
+ var delay = entry.delayMs ? { delay: entry.delayMs / 1e3 } : null;
732
+ if (entry.timing.kind === "spring") {
733
+ return {
734
+ type: "spring",
735
+ stiffness: entry.timing.stiffness,
736
+ damping: entry.timing.damping,
737
+ mass: entry.timing.mass,
738
+ ...delay
739
+ };
763
740
  }
764
- var isTimingBased = config.duration !== void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;
741
+ var bezier = (0, import_animation_helpers.easingToBezier)(entry.timing.easing);
765
742
  return {
766
- type: isTimingBased ? "tween" : "spring",
767
- ...config
743
+ type: "tween",
744
+ duration: entry.timing.durationMs / 1e3,
745
+ ...bezier ? { ease: [
746
+ bezier[0],
747
+ bezier[1],
748
+ bezier[2],
749
+ bezier[3]
750
+ ] } : null,
751
+ ...delay
768
752
  };
769
753
  }
770
- function convertMsToS(config) {
771
- if (!config) return;
772
- if (typeof config.delay === "number") config.delay = config.delay / 1e3;
773
- if (typeof config.duration === "number") {
774
- var isTimingBased = config.type === "tween" || config.type === void 0 && config.damping === void 0 && config.stiffness === void 0 && config.mass === void 0;
775
- if (isTimingBased) {
776
- config.duration = config.duration / 1e3;
777
- }
778
- }
779
- }
780
754
  function removeRemovedStyles(prev, next, node, dontClearIfIn) {
781
755
  for (var key in prev) {
782
756
  if (!(key in next)) {
@@ -1002,7 +976,7 @@ function createMotionView(defaultTag) {
1002
976
  (0, import_web.useIsomorphicLayoutEffect)(function() {
1003
977
  if (!animatedStyle) return;
1004
978
  var node = hostRef.current;
1005
- if (_instanceof(node, HTMLElement) && seededNode.current !== node) {
979
+ if (node instanceof HTMLElement && seededNode.current !== node) {
1006
980
  var currentStyle = animatedStyle.motionValues ? animatedStyle.getStyle(...animatedStyle.motionValues.map(function(value) {
1007
981
  return value.get();
1008
982
  })) : animatedStyle.motionValue ? animatedStyle.getStyle(animatedStyle.motionValue.get()) : null;
@@ -1029,7 +1003,7 @@ function createMotionView(defaultTag) {
1029
1003
  };
1030
1004
  };
1031
1005
  var animateNodeTo = function(nextStyle, transition, motionValue3) {
1032
- if (!_instanceof(node, HTMLElement) || hostRef.current !== node) return;
1006
+ if (!(node instanceof HTMLElement) || hostRef.current !== node) return;
1033
1007
  var webStyle2 = resolvedAnimatedStyle === null || resolvedAnimatedStyle === void 0 ? void 0 : resolvedAnimatedStyle.resolve(nextStyle);
1034
1008
  if (!webStyle2) return;
1035
1009
  settlePendingMotionOnFinish(motionValue3, animate(node, webStyle2, transition));