motion-v 2.0.0 → 2.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.
@@ -2,7 +2,7 @@ import { provideAnimatePresence } from "./presence.mjs";
2
2
  import { motionGlobalConfig } from "../../config.mjs";
3
3
  import { mountedStates } from "../../state/motion-state.mjs";
4
4
  import { usePopLayout } from "./use-pop-layout.mjs";
5
- import { onMounted, onUnmounted, watch } from "vue";
5
+ import { onMounted, onUnmounted } from "vue";
6
6
  var apId = 0;
7
7
  function usePresenceContainer(props) {
8
8
  const presenceId = String(apId++);
@@ -31,9 +31,6 @@ function usePresenceContainer(props) {
31
31
  presenceId,
32
32
  onMotionExitComplete
33
33
  };
34
- watch(() => props.custom, (v) => {
35
- presenceContext.custom = v;
36
- }, { flush: "pre" });
37
34
  provideAnimatePresence(presenceContext);
38
35
  onMounted(() => {
39
36
  presenceContext.initial = void 0;
@@ -59,6 +56,7 @@ function usePresenceContainer(props) {
59
56
  done();
60
57
  }
61
58
  function exit(el, done) {
59
+ presenceContext.custom = props.custom;
62
60
  const container = el;
63
61
  const states = findMotionStates(container);
64
62
  if (states.length === 0) {
@@ -42,7 +42,7 @@ var MotionState = class {
42
42
  this.visualElement?.update({
43
43
  ...this.options,
44
44
  whileTap: this.options.whilePress
45
- }, null);
45
+ }, this.options.presenceContext ?? null);
46
46
  }
47
47
  mount(element) {
48
48
  invariant(Boolean(element), "Animation state must be mounted with valid Element");
@@ -88,7 +88,7 @@ var MotionState = class {
88
88
  initVisualElement(renderer) {
89
89
  if (this.visualElement) return;
90
90
  this.visualElement = renderer(this.options.as, {
91
- presenceContext: null,
91
+ presenceContext: this.options.presenceContext ?? null,
92
92
  parent: this.parent?.visualElement,
93
93
  props: {
94
94
  ...this.options,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "motion-v",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -37,7 +37,6 @@
37
37
  "typesVersions": {
38
38
  "*": {
39
39
  "*": [
40
- "./dist/*/index.d.ts",
41
40
  "./dist/es/index.d.ts"
42
41
  ],
43
42
  "nuxt": [