From 8bde766a64d8aebc81c0fa6ecbea5d9e59bab99b Mon Sep 17 00:00:00 2001 From: Fernando Rojo Date: Sun, 28 Mar 2021 16:42:27 -0400 Subject: [PATCH 1/2] fix: animate presence callback --- packages/core/src/use-map-animate-to-style.ts | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/core/src/use-map-animate-to-style.ts b/packages/core/src/use-map-animate-to-style.ts index e4e1a80..14b5b7e 100644 --- a/packages/core/src/use-map-animate-to-style.ts +++ b/packages/core/src/use-map-animate-to-style.ts @@ -266,7 +266,11 @@ export default function useMapAnimateToStyle({ debug('here') - Object.keys(mergedStyles).forEach((key, index) => { + const exitingStyleProps: Record = Object.keys( + exitStyle || {} + ).reduce((obj, styleKey) => ({ ...obj, [styleKey]: true }), {}) + + Object.keys(mergedStyles).forEach((key) => { const initialValue = initialStyle[key] const value = mergedStyles[key] @@ -278,18 +282,22 @@ export default function useMapAnimateToStyle({ repeatReverse, } = animationConfig(key, transition) - const callback: (canceled: boolean, value?: any) => void = ( - canceled, + const callback: (completed: boolean, value?: any) => void = ( + completed, recentValue ) => { if (onDidAnimate) { - runOnJS(reanimatedOnDidAnimated)(key as any, canceled, recentValue) + runOnJS(reanimatedOnDidAnimated)(key as any, completed, recentValue) } if (isExiting) { + exitingStyleProps[key] = false + const areStylesExiting = Object.values(exitingStyleProps).some( + Boolean + ) // // if this is true, then we've finished our exit animations - const isLastStyleKeyToAnimate = - index + 1 === Object.keys(mergedStyles || {}).length - if (isLastStyleKeyToAnimate) { + // const isLastStyleKeyToAnimate = + // index + 1 === Object.keys(mergedStyles || {}).length + if (!areStylesExiting) { runOnJS(reanimatedSafeToUnmount)() } } From 48c285e3bedcc0e27b083fdf2b09b92edcb37f97 Mon Sep 17 00:00:00 2001 From: Fernando Rojo Date: Sun, 28 Mar 2021 16:43:44 -0400 Subject: [PATCH 2/2] chore: publish --- CHANGELOG.md | 11 +++++++++++ examples/with-expo/CHANGELOG.md | 8 ++++++++ examples/with-expo/package.json | 4 ++-- examples/with-next/CHANGELOG.md | 8 ++++++++ examples/with-next/package.json | 2 +- lerna.json | 2 +- packages/components/CHANGELOG.md | 8 ++++++++ packages/components/package.json | 4 ++-- packages/core/CHANGELOG.md | 11 +++++++++++ packages/core/package.json | 2 +- packages/moti/CHANGELOG.md | 8 ++++++++ packages/moti/package.json | 6 +++--- packages/skeleton/CHANGELOG.md | 8 ++++++++ packages/skeleton/package.json | 6 +++--- 14 files changed, 75 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65fef94..d80f083 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.2](https://github.com/nandorojo/moti/compare/v0.7.1...v0.7.2) (2021-03-28) + + +### Bug Fixes + +* animate presence callback ([8bde766](https://github.com/nandorojo/moti/commit/8bde766a64d8aebc81c0fa6ecbea5d9e59bab99b)) + + + + + ## [0.7.1](https://github.com/nandorojo/moti/compare/v0.7.0...v0.7.1) (2021-03-23) diff --git a/examples/with-expo/CHANGELOG.md b/examples/with-expo/CHANGELOG.md index e11bb34..7b2562d 100644 --- a/examples/with-expo/CHANGELOG.md +++ b/examples/with-expo/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.2](https://github.com/nandorojo/moti/compare/v0.7.1...v0.7.2) (2021-03-28) + +**Note:** Version bump only for package with-expo + + + + + ## [0.7.1](https://github.com/nandorojo/moti/compare/v0.7.0...v0.7.1) (2021-03-23) diff --git a/examples/with-expo/package.json b/examples/with-expo/package.json index becf1e7..ce0cb3c 100644 --- a/examples/with-expo/package.json +++ b/examples/with-expo/package.json @@ -1,7 +1,7 @@ { "name": "with-expo", "description": "Example app for moti", - "version": "0.7.1", + "version": "0.7.2", "private": true, "main": "__generated__/AppEntry.js", "scripts": { @@ -13,7 +13,7 @@ "postinstall": "expo-yarn-workspaces postinstall" }, "dependencies": { - "@motify/skeleton": "^0.7.1", + "@motify/skeleton": "^0.7.2", "expo": "^40.0.0-beta.5", "expo-splash-screen": "~0.8.1", "expo-status-bar": "~1.0.3", diff --git a/examples/with-next/CHANGELOG.md b/examples/with-next/CHANGELOG.md index 9ee801f..f78668f 100644 --- a/examples/with-next/CHANGELOG.md +++ b/examples/with-next/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.2](https://github.com/nandorojo/moti/compare/v0.7.1...v0.7.2) (2021-03-28) + +**Note:** Version bump only for package next-dripsy-example + + + + + ## [0.7.1](https://github.com/nandorojo/moti/compare/v0.7.0...v0.7.1) (2021-03-23) **Note:** Version bump only for package next-dripsy-example diff --git a/examples/with-next/package.json b/examples/with-next/package.json index c7cc4c9..f2ae1af 100644 --- a/examples/with-next/package.json +++ b/examples/with-next/package.json @@ -1,6 +1,6 @@ { "name": "next-dripsy-example", - "version": "0.7.1", + "version": "0.7.2", "main": "__generated__/AppEntry.js", "dependencies": { "expo": "^40.0.0", diff --git a/lerna.json b/lerna.json index 4c304ff..0beb6b6 100644 --- a/lerna.json +++ b/lerna.json @@ -5,7 +5,7 @@ ], "npmClient": "npm", "useWorkspaces": true, - "version": "0.7.1", + "version": "0.7.2", "command": { "publish": { "allowBranch": "master", diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index f8be8c5..109bcef 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.2](https://github.com/nandorojo/moti/compare/v0.7.1...v0.7.2) (2021-03-28) + +**Note:** Version bump only for package @motify/components + + + + + ## [0.7.1](https://github.com/nandorojo/moti/compare/v0.7.0...v0.7.1) (2021-03-23) **Note:** Version bump only for package @motify/components diff --git a/packages/components/package.json b/packages/components/package.json index 4f8465b..420f6ef 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,7 +1,7 @@ { "name": "@motify/components", "private": false, - "version": "0.7.1", + "version": "0.7.2", "keywords": [ "react-native", "ios", @@ -37,7 +37,7 @@ "clean": "del lib" }, "dependencies": { - "@motify/core": "^0.7.1" + "@motify/core": "^0.7.2" }, "devDependencies": { "typescript": "^4.0.3" diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 9516b91..3a44528 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.2](https://github.com/nandorojo/moti/compare/v0.7.1...v0.7.2) (2021-03-28) + + +### Bug Fixes + +* animate presence callback ([8bde766](https://github.com/nandorojo/moti/commit/8bde766a64d8aebc81c0fa6ecbea5d9e59bab99b)) + + + + + ## [0.7.1](https://github.com/nandorojo/moti/compare/v0.7.0...v0.7.1) (2021-03-23) diff --git a/packages/core/package.json b/packages/core/package.json index 7f925b2..09ed726 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@motify/core", - "version": "0.7.1", + "version": "0.7.2", "private": false, "license": "MIT", "keywords": [ diff --git a/packages/moti/CHANGELOG.md b/packages/moti/CHANGELOG.md index d523e9d..91eaaa9 100644 --- a/packages/moti/CHANGELOG.md +++ b/packages/moti/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.2](https://github.com/nandorojo/moti/compare/v0.7.1...v0.7.2) (2021-03-28) + +**Note:** Version bump only for package moti + + + + + ## [0.7.1](https://github.com/nandorojo/moti/compare/v0.7.0...v0.7.1) (2021-03-23) **Note:** Version bump only for package moti diff --git a/packages/moti/package.json b/packages/moti/package.json index 63cf5ea..b8d0740 100644 --- a/packages/moti/package.json +++ b/packages/moti/package.json @@ -1,7 +1,7 @@ { "name": "moti", "private": false, - "version": "0.7.1", + "version": "0.7.2", "keywords": [ "react-native", "ios", @@ -37,8 +37,8 @@ "clean": "del lib" }, "dependencies": { - "@motify/components": "^0.7.1", - "@motify/core": "^0.7.1" + "@motify/components": "^0.7.2", + "@motify/core": "^0.7.2" }, "devDependencies": { "typescript": "^4.0.3" diff --git a/packages/skeleton/CHANGELOG.md b/packages/skeleton/CHANGELOG.md index 098b437..4dfe21e 100644 --- a/packages/skeleton/CHANGELOG.md +++ b/packages/skeleton/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.7.2](https://github.com/nandorojo/moti/compare/v0.7.1...v0.7.2) (2021-03-28) + +**Note:** Version bump only for package @motify/skeleton + + + + + ## [0.7.1](https://github.com/nandorojo/moti/compare/v0.7.0...v0.7.1) (2021-03-23) diff --git a/packages/skeleton/package.json b/packages/skeleton/package.json index 2a35f3f..e2e7432 100644 --- a/packages/skeleton/package.json +++ b/packages/skeleton/package.json @@ -1,7 +1,7 @@ { "name": "@motify/skeleton", "private": false, - "version": "0.7.1", + "version": "0.7.2", "keywords": [ "react-native", "ios", @@ -37,8 +37,8 @@ "clean": "del lib" }, "dependencies": { - "@motify/components": "^0.7.1", - "@motify/core": "^0.7.1" + "@motify/components": "^0.7.2", + "@motify/core": "^0.7.2" }, "devDependencies": { "expo-linear-gradient": "^9.0.0",