react-native-screen-transitions 3.13.0-beta.1 → 3.13.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.
Files changed (32) hide show
  1. package/README.md +14 -0
  2. package/lib/commonjs/shared/components/boundary/create-boundary-component.js +5 -1
  3. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
  4. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +8 -0
  5. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
  6. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +1 -0
  7. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  8. package/lib/commonjs/shared/components/boundary/portal/teleport.js +1 -13
  9. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
  10. package/lib/module/shared/components/boundary/create-boundary-component.js +6 -2
  11. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  12. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +8 -0
  13. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
  14. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +1 -0
  15. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  16. package/lib/module/shared/components/boundary/portal/teleport.js +1 -14
  17. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
  18. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  19. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts +2 -1
  20. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts.map +1 -1
  21. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
  22. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -1
  23. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
  24. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +5 -6
  25. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  26. package/lib/typescript/shared/index.d.ts +645 -703
  27. package/lib/typescript/shared/index.d.ts.map +1 -1
  28. package/package.json +2 -2
  29. package/src/shared/components/boundary/create-boundary-component.tsx +10 -2
  30. package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.ts +22 -0
  31. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +1 -0
  32. package/src/shared/components/boundary/portal/teleport.ts +2 -23
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAY,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,UAAU,MAAM,0BAA0B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAAkB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,KAAK,mBAAmB,EACxB,gBAAgB,GAChB,MAAM,sDAAsD,CAAC;AAE9D,YAAY,EACX,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,6BAA6B,EAC7B,2BAA2B,EAC3B,gCAAgC,EAChC,+BAA+B,EAC/B,gCAAgC,EAChC,iCAAiC,EACjC,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,GACd,MAAM,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-screen-transitions",
3
- "version": "3.13.0-beta.1",
3
+ "version": "3.13.0",
4
4
  "description": "Easy screen transitions for React Native and Expo",
5
5
  "author": "Ed",
6
6
  "license": "MIT",
@@ -85,7 +85,7 @@
85
85
  "react-native-reanimated": ">=3.16.0 || >=4.0.0-",
86
86
  "react-native-safe-area-context": "*",
87
87
  "react-native-screens": ">=4.4.0",
88
- "react-native-teleport": ">=1.1.0 <1.1.11"
88
+ "react-native-teleport": ">=1.2.0"
89
89
  },
90
90
  "peerDependenciesMeta": {
91
91
  "react-native-teleport": {
@@ -10,7 +10,10 @@ import {
10
10
  BOUNDARY_TARGET_ACTIVE_PROP,
11
11
  BoundaryTarget,
12
12
  } from "./components/boundary-target";
13
- import { BoundaryContentPortalHost } from "./portal/components/boundary-content-portal";
13
+ import {
14
+ BoundaryContentPortal,
15
+ BoundaryContentPortalHost,
16
+ } from "./portal/components/boundary-content-portal";
14
17
  import { BoundaryPortal } from "./portal/components/boundary-portal";
15
18
  import { BoundaryRootProvider } from "./providers/boundary-root.provider";
16
19
  import type { BoundaryComponentProps } from "./types";
@@ -91,7 +94,12 @@ export function createBoundaryComponent<P extends object>(
91
94
  enabled={root.shouldRenderHandoffHost}
92
95
  screenKey={root.currentScreenKey}
93
96
  >
94
- {targetResolution.children}
97
+ <BoundaryContentPortal
98
+ boundaryId={root.boundTag.tag}
99
+ enabled={root.shouldRenderHandoffHost}
100
+ >
101
+ {targetResolution.children}
102
+ </BoundaryContentPortal>
95
103
  </BoundaryContentPortalHost>
96
104
  </AnimatedComponent>
97
105
  </BoundaryPortal>
@@ -74,6 +74,7 @@ export const resolveHandoffAttachmentCandidate = ({
74
74
  interpolatorReady,
75
75
  pairChangedDuringClose = false,
76
76
  pairDestinationScreenKey,
77
+ pairHasBoundaryLink,
77
78
  previousReceiverScreenKey,
78
79
  }: {
79
80
  activeReceiverClosing: boolean;
@@ -83,9 +84,20 @@ export const resolveHandoffAttachmentCandidate = ({
83
84
  interpolatorReady: boolean;
84
85
  pairChangedDuringClose?: boolean;
85
86
  pairDestinationScreenKey: string | null;
87
+ pairHasBoundaryLink?: boolean;
86
88
  previousReceiverScreenKey: string | null;
87
89
  }) => {
88
90
  "worklet";
91
+ const currentPairHasBoundaryLink =
92
+ pairHasBoundaryLink ?? pairDestinationScreenKey !== null;
93
+
94
+ if (
95
+ activeReceiverClosing &&
96
+ attachedReceiverScreenKey !== activeReceiverScreenKey &&
97
+ !currentPairHasBoundaryLink
98
+ ) {
99
+ return attachedReceiverScreenKey;
100
+ }
89
101
 
90
102
  if (
91
103
  activeReceiverClosing &&
@@ -96,6 +108,16 @@ export const resolveHandoffAttachmentCandidate = ({
96
108
  return pairDestinationScreenKey;
97
109
  }
98
110
 
111
+ if (
112
+ activeReceiverClosing &&
113
+ pairChangedDuringClose &&
114
+ !currentPairHasBoundaryLink
115
+ ) {
116
+ return hasActiveCloseFinished
117
+ ? previousReceiverScreenKey
118
+ : attachedReceiverScreenKey;
119
+ }
120
+
99
121
  if (
100
122
  hasActiveCloseFinished &&
101
123
  attachedReceiverScreenKey === activeReceiverScreenKey
@@ -149,6 +149,7 @@ export const useBoundaryContentPortalAttachment = ({
149
149
  interpolatorReady: !!isInterpolatorReady,
150
150
  pairChangedDuringClose,
151
151
  pairDestinationScreenKey: pairDestination,
152
+ pairHasBoundaryLink: link !== undefined,
152
153
  previousReceiverScreenKey,
153
154
  });
154
155
 
@@ -1,4 +1,4 @@
1
- import { type ComponentType, createElement, type ReactNode } from "react";
1
+ import type { ComponentType, ReactNode } from "react";
2
2
 
3
3
  /**
4
4
  * `react-native-teleport` is an optional peer dependency. The require sits in a
@@ -9,33 +9,12 @@ import { type ComponentType, createElement, type ReactNode } from "react";
9
9
  * inline rendering; everything else keeps working.
10
10
  */
11
11
  let mod: any = null;
12
- let managerMod: any = null;
13
- let providerViewMod: any = null;
14
12
  try {
15
13
  mod = require("react-native-teleport");
16
- managerMod = require("react-native-teleport/lib/module/contexts/PortalManager");
17
- providerViewMod = require("react-native-teleport/lib/module/views/PortalProvider");
18
14
  } catch {}
19
15
 
20
- const NativePortalProviderView: ComponentType<{ children: ReactNode }> | null =
21
- providerViewMod?.default ?? null;
22
- const PortalManagerProvider: ComponentType<{ children: ReactNode }> | null =
23
- managerMod?.PortalManagerProvider ?? null;
24
-
25
16
  const SafeNativePortalProvider: ComponentType<{ children: ReactNode }> | null =
26
- PortalManagerProvider
27
- ? ({ children }: { children: ReactNode }) => {
28
- const managedChildren = createElement(
29
- PortalManagerProvider,
30
- null,
31
- children,
32
- );
33
-
34
- return NativePortalProviderView
35
- ? createElement(NativePortalProviderView, null, managedChildren)
36
- : managedChildren;
37
- }
38
- : null;
17
+ mod?.PortalProvider ?? null;
39
18
 
40
19
  export const isTeleportAvailable =
41
20
  mod !== null && SafeNativePortalProvider !== null;