react-native-screen-transitions 3.5.0 → 3.5.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.
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +2 -2
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +3 -3
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js +3 -3
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.js +7 -6
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-capture-source-boundary.js +2 -2
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-capture-source-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js +8 -8
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +6 -5
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.js +4 -4
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.js.map +1 -1
- package/lib/commonjs/shared/providers/register-bounds.provider.js +8 -8
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/components/maybe-floating-container.js +1 -1
- package/lib/commonjs/shared/providers/screen/styles/components/maybe-floating-container.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/helpers/apply-measured-bounds-writes.js +6 -6
- package/lib/commonjs/shared/stores/bounds/helpers/apply-measured-bounds-writes.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/index.js +85 -1
- package/lib/commonjs/shared/stores/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/registry.js +7 -0
- package/lib/commonjs/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +3 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js +3 -3
- package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +3 -3
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +5 -4
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +2 -2
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +4 -3
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +2 -2
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +3 -3
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js +3 -3
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.js +7 -6
- package/lib/module/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-capture-source-boundary.js +2 -2
- package/lib/module/shared/components/create-boundary-component/hooks/use-capture-source-boundary.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js +8 -8
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +6 -5
- package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.js +4 -4
- package/lib/module/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.js.map +1 -1
- package/lib/module/shared/providers/register-bounds.provider.js +8 -8
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/components/maybe-floating-container.js +1 -1
- package/lib/module/shared/providers/screen/styles/components/maybe-floating-container.js.map +1 -1
- package/lib/module/shared/stores/bounds/helpers/apply-measured-bounds-writes.js +6 -6
- package/lib/module/shared/stores/bounds/helpers/apply-measured-bounds-writes.js.map +1 -1
- package/lib/module/shared/stores/bounds/index.js +85 -1
- package/lib/module/shared/stores/bounds/index.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/registry.js +7 -0
- package/lib/module/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +3 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-interpolators.js +3 -3
- package/lib/module/shared/utils/bounds/helpers/create-interpolators.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +3 -3
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +5 -4
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js +2 -2
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/build.js +4 -3
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts +207 -4
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-capture-source-boundary.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +208 -4
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts +6 -5
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +2 -2
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +918 -656
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -2
- package/lib/typescript/shared/stores/bounds/index.d.ts +25 -0
- package/lib/typescript/shared/stores/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/registry.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +3 -0
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/shared/components/create-boundary-component/create-boundary-component.tsx +2 -2
- package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +7 -4
- package/src/shared/components/create-boundary-component/hooks/use-boundary-presence.ts +6 -3
- package/src/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.ts +12 -7
- package/src/shared/components/create-boundary-component/hooks/use-capture-source-boundary.ts +2 -4
- package/src/shared/components/create-boundary-component/hooks/use-measurer.ts +14 -12
- package/src/shared/components/create-boundary-component/hooks/use-refresh-boundary.ts +6 -12
- package/src/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.ts +8 -4
- package/src/shared/providers/register-bounds.provider.tsx +13 -16
- package/src/shared/providers/screen/styles/components/maybe-floating-container.tsx +1 -1
- package/src/shared/stores/bounds/helpers/apply-measured-bounds-writes.ts +6 -6
- package/src/shared/stores/bounds/index.ts +182 -0
- package/src/shared/stores/bounds/internals/registry.ts +8 -0
- package/src/shared/stores/bounds/internals/resolver.ts +2 -0
- package/src/shared/stores/bounds/types.ts +3 -0
- package/src/shared/utils/bounds/helpers/create-interpolators.ts +3 -6
- package/src/shared/utils/bounds/helpers/create-link-accessor.ts +7 -6
- package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +8 -8
- package/src/shared/utils/bounds/helpers/styles/compute.ts +3 -5
- package/src/shared/utils/bounds/zoom/build.ts +5 -6
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
|
|
1
2
|
import { clear, clearByAncestor, clearByBranch } from "./internals/clear";
|
|
2
3
|
import { getGroupActiveId, setGroupActiveId } from "./internals/groups";
|
|
3
4
|
import {
|
|
@@ -14,6 +15,13 @@ import {
|
|
|
14
15
|
setSource,
|
|
15
16
|
} from "./internals/registry";
|
|
16
17
|
import { resolveTransitionPair } from "./internals/resolver";
|
|
18
|
+
import type {
|
|
19
|
+
BoundaryConfig,
|
|
20
|
+
MeasuredEntry,
|
|
21
|
+
NavigatorKey,
|
|
22
|
+
ScreenKey,
|
|
23
|
+
TagID,
|
|
24
|
+
} from "./types";
|
|
17
25
|
|
|
18
26
|
export type {
|
|
19
27
|
BoundaryConfig,
|
|
@@ -24,6 +32,154 @@ export type {
|
|
|
24
32
|
ResolveTransitionContext,
|
|
25
33
|
} from "./types";
|
|
26
34
|
|
|
35
|
+
export type Snapshot = MeasuredEntry;
|
|
36
|
+
|
|
37
|
+
const registerSnapshot = (
|
|
38
|
+
tag: TagID,
|
|
39
|
+
screenKey: ScreenKey,
|
|
40
|
+
bounds: MeasuredDimensions,
|
|
41
|
+
styles: StyleProps = {},
|
|
42
|
+
ancestorKeys?: ScreenKey[],
|
|
43
|
+
navigatorKey?: NavigatorKey,
|
|
44
|
+
ancestorNavigatorKeys?: NavigatorKey[],
|
|
45
|
+
) => {
|
|
46
|
+
"worklet";
|
|
47
|
+
setEntry(tag, screenKey, {
|
|
48
|
+
bounds,
|
|
49
|
+
styles,
|
|
50
|
+
ancestorKeys,
|
|
51
|
+
navigatorKey,
|
|
52
|
+
ancestorNavigatorKeys,
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const registerBoundaryPresence = (
|
|
57
|
+
tag: TagID,
|
|
58
|
+
screenKey: ScreenKey,
|
|
59
|
+
ancestorKeys?: ScreenKey[],
|
|
60
|
+
boundaryConfig?: BoundaryConfig,
|
|
61
|
+
navigatorKey?: NavigatorKey,
|
|
62
|
+
ancestorNavigatorKeys?: NavigatorKey[],
|
|
63
|
+
) => {
|
|
64
|
+
"worklet";
|
|
65
|
+
const currentPresenceCount = getEntry(tag, screenKey)?.presenceCount ?? 0;
|
|
66
|
+
setEntry(tag, screenKey, {
|
|
67
|
+
ancestorKeys,
|
|
68
|
+
boundaryConfig,
|
|
69
|
+
navigatorKey,
|
|
70
|
+
ancestorNavigatorKeys,
|
|
71
|
+
presenceCount: currentPresenceCount + 1,
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const unregisterBoundaryPresence = (tag: TagID, screenKey: ScreenKey) => {
|
|
76
|
+
"worklet";
|
|
77
|
+
const currentPresenceCount = getEntry(tag, screenKey)?.presenceCount ?? 0;
|
|
78
|
+
if (currentPresenceCount > 1) {
|
|
79
|
+
setEntry(tag, screenKey, { presenceCount: currentPresenceCount - 1 });
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
removeEntry(tag, screenKey);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const getLatestPendingSourceScreenKey = (tag: TagID): ScreenKey | null => {
|
|
87
|
+
"worklet";
|
|
88
|
+
return getPendingLink(tag)?.source.screenKey ?? null;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const setLinkSource = (
|
|
92
|
+
tag: TagID,
|
|
93
|
+
screenKey: ScreenKey,
|
|
94
|
+
bounds: MeasuredDimensions,
|
|
95
|
+
styles?: StyleProps,
|
|
96
|
+
ancestorKeys?: ScreenKey[],
|
|
97
|
+
navigatorKey?: NavigatorKey,
|
|
98
|
+
ancestorNavigatorKeys?: NavigatorKey[],
|
|
99
|
+
) => {
|
|
100
|
+
"worklet";
|
|
101
|
+
setSource(
|
|
102
|
+
"capture",
|
|
103
|
+
tag,
|
|
104
|
+
screenKey,
|
|
105
|
+
bounds,
|
|
106
|
+
styles,
|
|
107
|
+
ancestorKeys,
|
|
108
|
+
navigatorKey,
|
|
109
|
+
ancestorNavigatorKeys,
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const updateLinkSource = (
|
|
114
|
+
tag: TagID,
|
|
115
|
+
screenKey: ScreenKey,
|
|
116
|
+
bounds: MeasuredDimensions,
|
|
117
|
+
styles?: StyleProps,
|
|
118
|
+
ancestorKeys?: ScreenKey[],
|
|
119
|
+
navigatorKey?: NavigatorKey,
|
|
120
|
+
ancestorNavigatorKeys?: NavigatorKey[],
|
|
121
|
+
) => {
|
|
122
|
+
"worklet";
|
|
123
|
+
setSource(
|
|
124
|
+
"refresh",
|
|
125
|
+
tag,
|
|
126
|
+
screenKey,
|
|
127
|
+
bounds,
|
|
128
|
+
styles,
|
|
129
|
+
ancestorKeys,
|
|
130
|
+
navigatorKey,
|
|
131
|
+
ancestorNavigatorKeys,
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const setLinkDestination = (
|
|
136
|
+
tag: TagID,
|
|
137
|
+
screenKey: ScreenKey,
|
|
138
|
+
bounds: MeasuredDimensions,
|
|
139
|
+
styles?: StyleProps,
|
|
140
|
+
ancestorKeys?: ScreenKey[],
|
|
141
|
+
expectedSourceScreenKey?: ScreenKey,
|
|
142
|
+
navigatorKey?: NavigatorKey,
|
|
143
|
+
ancestorNavigatorKeys?: NavigatorKey[],
|
|
144
|
+
) => {
|
|
145
|
+
"worklet";
|
|
146
|
+
setDestination(
|
|
147
|
+
"attach",
|
|
148
|
+
tag,
|
|
149
|
+
screenKey,
|
|
150
|
+
bounds,
|
|
151
|
+
styles,
|
|
152
|
+
ancestorKeys,
|
|
153
|
+
expectedSourceScreenKey,
|
|
154
|
+
navigatorKey,
|
|
155
|
+
ancestorNavigatorKeys,
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const updateLinkDestination = (
|
|
160
|
+
tag: TagID,
|
|
161
|
+
screenKey: ScreenKey,
|
|
162
|
+
bounds: MeasuredDimensions,
|
|
163
|
+
styles?: StyleProps,
|
|
164
|
+
ancestorKeys?: ScreenKey[],
|
|
165
|
+
expectedSourceScreenKey?: ScreenKey,
|
|
166
|
+
navigatorKey?: NavigatorKey,
|
|
167
|
+
ancestorNavigatorKeys?: NavigatorKey[],
|
|
168
|
+
) => {
|
|
169
|
+
"worklet";
|
|
170
|
+
setDestination(
|
|
171
|
+
"refresh",
|
|
172
|
+
tag,
|
|
173
|
+
screenKey,
|
|
174
|
+
bounds,
|
|
175
|
+
styles,
|
|
176
|
+
ancestorKeys,
|
|
177
|
+
expectedSourceScreenKey,
|
|
178
|
+
navigatorKey,
|
|
179
|
+
ancestorNavigatorKeys,
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
|
|
27
183
|
export const BoundStore = {
|
|
28
184
|
entry: {
|
|
29
185
|
set: setEntry,
|
|
@@ -50,4 +206,30 @@ export const BoundStore = {
|
|
|
50
206
|
byAncestor: clearByAncestor,
|
|
51
207
|
byBranch: clearByBranch,
|
|
52
208
|
},
|
|
209
|
+
// Legacy flat aliases used by the v3 tests and older internals. New code should
|
|
210
|
+
// prefer the explicit entry/link/group/cleanup namespaces above.
|
|
211
|
+
registerSnapshot,
|
|
212
|
+
getSnapshot: getMeasuredEntry,
|
|
213
|
+
setLinkSource,
|
|
214
|
+
updateLinkSource,
|
|
215
|
+
setLinkDestination,
|
|
216
|
+
updateLinkDestination,
|
|
217
|
+
getActiveLink,
|
|
218
|
+
resolveTransitionPair,
|
|
219
|
+
hasPendingLink: (tag: TagID) => getPendingLink(tag) !== null,
|
|
220
|
+
hasPendingLinkFromSource: (tag: TagID, sourceScreenKey: ScreenKey) =>
|
|
221
|
+
getPendingLink(tag, sourceScreenKey) !== null,
|
|
222
|
+
getLatestPendingSourceScreenKey,
|
|
223
|
+
hasSourceLink,
|
|
224
|
+
hasDestinationLink,
|
|
225
|
+
registerBoundaryPresence,
|
|
226
|
+
unregisterBoundaryPresence,
|
|
227
|
+
hasBoundaryPresence: (tag: TagID, screenKey: ScreenKey) =>
|
|
228
|
+
(getEntry(tag, screenKey)?.presenceCount ?? 0) > 0,
|
|
229
|
+
getBoundaryConfig: getEntryConfig,
|
|
230
|
+
setGroupActiveId,
|
|
231
|
+
getGroupActiveId,
|
|
232
|
+
clear,
|
|
233
|
+
clearByAncestor,
|
|
234
|
+
clearByBranch,
|
|
53
235
|
};
|
|
@@ -102,6 +102,14 @@ const applyEntryPatch = (entry: ScreenEntry, patch: EntryPatch) => {
|
|
|
102
102
|
entry.ancestorNavigatorKeys = patch.ancestorNavigatorKeys;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
+
|
|
106
|
+
if (patch.presenceCount !== undefined) {
|
|
107
|
+
if (patch.presenceCount === null) {
|
|
108
|
+
delete entry.presenceCount;
|
|
109
|
+
} else {
|
|
110
|
+
entry.presenceCount = patch.presenceCount;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
105
113
|
};
|
|
106
114
|
|
|
107
115
|
const findMatchingScreenEntry = (
|
|
@@ -130,6 +130,7 @@ function resolveTransitionPair(
|
|
|
130
130
|
const destinationStyles = matchedLink?.destination?.styles ?? null;
|
|
131
131
|
const sourceScreenKey = matchedLink?.source?.screenKey ?? null;
|
|
132
132
|
const destinationScreenKey = matchedLink?.destination?.screenKey ?? null;
|
|
133
|
+
const usedPending = matchedLink ? matchedLink.destination === null : false;
|
|
133
134
|
|
|
134
135
|
return {
|
|
135
136
|
sourceBounds,
|
|
@@ -138,6 +139,7 @@ function resolveTransitionPair(
|
|
|
138
139
|
destinationStyles,
|
|
139
140
|
sourceScreenKey,
|
|
140
141
|
destinationScreenKey,
|
|
142
|
+
usedPending,
|
|
141
143
|
};
|
|
142
144
|
}
|
|
143
145
|
|
|
@@ -23,6 +23,7 @@ export type Entry = {
|
|
|
23
23
|
ancestorKeys?: ScreenKey[];
|
|
24
24
|
navigatorKey?: NavigatorKey;
|
|
25
25
|
ancestorNavigatorKeys?: NavigatorKey[];
|
|
26
|
+
presenceCount?: number;
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export type MeasuredEntry = Entry & {
|
|
@@ -36,6 +37,7 @@ export type EntryPatch = {
|
|
|
36
37
|
ancestorKeys?: ScreenKey[] | null;
|
|
37
38
|
navigatorKey?: NavigatorKey | null;
|
|
38
39
|
ancestorNavigatorKeys?: NavigatorKey[] | null;
|
|
40
|
+
presenceCount?: number | null;
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
export type ScreenIdentifier = {
|
|
@@ -64,6 +66,7 @@ export type ResolvedTransitionPair = {
|
|
|
64
66
|
destinationStyles: StyleProps | null;
|
|
65
67
|
sourceScreenKey: ScreenKey | null;
|
|
66
68
|
destinationScreenKey: ScreenKey | null;
|
|
69
|
+
usedPending: boolean;
|
|
67
70
|
};
|
|
68
71
|
|
|
69
72
|
export type ScreenEntry = Entry;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type MeasuredDimensions,
|
|
5
5
|
} from "react-native-reanimated";
|
|
6
6
|
import { ENTER_RANGE, EXIT_RANGE } from "../../../constants";
|
|
7
|
-
import {
|
|
7
|
+
import { getMeasuredEntry } from "../../../stores/bounds/internals/registry";
|
|
8
8
|
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
9
9
|
import type { BoundId } from "../types/options";
|
|
10
10
|
import type { LinkAccessor } from "./create-link-accessor";
|
|
@@ -51,12 +51,9 @@ export const createInterpolators = ({
|
|
|
51
51
|
const normalizedTag = String(tag);
|
|
52
52
|
|
|
53
53
|
const currentMeasuredEntry = currentKey
|
|
54
|
-
?
|
|
54
|
+
? getMeasuredEntry(normalizedTag, currentKey)
|
|
55
55
|
: null;
|
|
56
|
-
const targetMeasuredEntry =
|
|
57
|
-
normalizedTag,
|
|
58
|
-
targetKey,
|
|
59
|
-
);
|
|
56
|
+
const targetMeasuredEntry = getMeasuredEntry(normalizedTag, targetKey);
|
|
60
57
|
|
|
61
58
|
const currentValue = currentMeasuredEntry?.bounds?.[property] ?? fb;
|
|
62
59
|
const targetValue = targetMeasuredEntry?.bounds?.[property] ?? fb;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getActiveLink,
|
|
3
|
+
getMeasuredEntry,
|
|
4
|
+
} from "../../../stores/bounds/internals/registry";
|
|
5
|
+
import type { MeasuredEntry } from "../../../stores/bounds/types";
|
|
2
6
|
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
3
7
|
import type { BoundsLink } from "../../../types/bounds.types";
|
|
4
8
|
import type { BoundId } from "../types/options";
|
|
@@ -17,7 +21,7 @@ export const createLinkAccessor = (getProps: GetProps): LinkAccessor => {
|
|
|
17
21
|
const getMeasured = (tag: BoundId, key?: string): MeasuredEntry | null => {
|
|
18
22
|
"worklet";
|
|
19
23
|
if (!key) return null;
|
|
20
|
-
return
|
|
24
|
+
return getMeasuredEntry(String(tag), key);
|
|
21
25
|
};
|
|
22
26
|
|
|
23
27
|
const getSnapshot = (tag: BoundId, key?: string): MeasuredEntry | null => {
|
|
@@ -28,10 +32,7 @@ export const createLinkAccessor = (getProps: GetProps): LinkAccessor => {
|
|
|
28
32
|
const getLink = (tag: BoundId): BoundsLink | null => {
|
|
29
33
|
"worklet";
|
|
30
34
|
const props = getProps();
|
|
31
|
-
const link =
|
|
32
|
-
String(tag),
|
|
33
|
-
props.current?.route.key,
|
|
34
|
-
);
|
|
35
|
+
const link = getActiveLink(String(tag), props.current?.route.key);
|
|
35
36
|
if (!link) return null;
|
|
36
37
|
return {
|
|
37
38
|
source: link.source
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "../../../stores/bounds";
|
|
2
|
+
getGroupActiveId,
|
|
3
|
+
setGroupActiveId,
|
|
4
|
+
} from "../../../stores/bounds/internals/groups";
|
|
5
|
+
import { getEntryConfig } from "../../../stores/bounds/internals/registry";
|
|
6
|
+
import type { ResolvedTransitionPair } from "../../../stores/bounds/types";
|
|
5
7
|
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
6
8
|
import { DEFAULT_BOUNDS_OPTIONS } from "../constants";
|
|
7
9
|
import type {
|
|
@@ -40,9 +42,7 @@ export const buildBoundsOptions = ({
|
|
|
40
42
|
const currentScreenKey = props.current?.route.key;
|
|
41
43
|
|
|
42
44
|
const boundaryConfig =
|
|
43
|
-
tag && currentScreenKey
|
|
44
|
-
? BoundStore.entry.getConfig(tag, currentScreenKey)
|
|
45
|
-
: null;
|
|
45
|
+
tag && currentScreenKey ? getEntryConfig(tag, currentScreenKey) : null;
|
|
46
46
|
|
|
47
47
|
const resolved = {
|
|
48
48
|
...DEFAULT_BOUNDS_OPTIONS,
|
|
@@ -61,9 +61,9 @@ const syncGroupActiveMember = (group?: string, id?: BoundId) => {
|
|
|
61
61
|
|
|
62
62
|
const normalizedId = String(id);
|
|
63
63
|
|
|
64
|
-
if (
|
|
64
|
+
if (getGroupActiveId(group) === normalizedId) return;
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
setGroupActiveId(group, normalizedId);
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
export const prepareBoundStyles = <T extends BoundsOptions>({
|
|
@@ -5,10 +5,8 @@ import {
|
|
|
5
5
|
FULLSCREEN_DIMENSIONS,
|
|
6
6
|
NO_STYLES,
|
|
7
7
|
} from "../../../../constants";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
type ResolvedTransitionPair,
|
|
11
|
-
} from "../../../../stores/bounds";
|
|
8
|
+
import { resolveTransitionPair } from "../../../../stores/bounds/internals/resolver";
|
|
9
|
+
import type { ResolvedTransitionPair } from "../../../../stores/bounds/types";
|
|
12
10
|
import type { ScreenTransitionState } from "../../../../types/animation.types";
|
|
13
11
|
import type { Layout } from "../../../../types/screen.types";
|
|
14
12
|
import type {
|
|
@@ -54,7 +52,7 @@ const resolveStartEnd = (params: {
|
|
|
54
52
|
|
|
55
53
|
const resolvedPair =
|
|
56
54
|
params.resolvedPair ??
|
|
57
|
-
|
|
55
|
+
resolveTransitionPair(String(params.id), {
|
|
58
56
|
currentScreenKey,
|
|
59
57
|
previousScreenKey,
|
|
60
58
|
nextScreenKey,
|
|
@@ -5,10 +5,9 @@ import {
|
|
|
5
5
|
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
6
6
|
VISIBLE_STYLE,
|
|
7
7
|
} from "../../../constants";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from "../../../stores/bounds";
|
|
8
|
+
import { getGroupActiveId } from "../../../stores/bounds/internals/groups";
|
|
9
|
+
import { resolveTransitionPair } from "../../../stores/bounds/internals/resolver";
|
|
10
|
+
import type { ResolvedTransitionPair } from "../../../stores/bounds/types";
|
|
12
11
|
import type { TransitionInterpolatedStyle } from "../../../types/animation.types";
|
|
13
12
|
import type { Layout } from "../../../types/screen.types";
|
|
14
13
|
import { prepareBoundStyles } from "../helpers/prepare-bound-styles";
|
|
@@ -176,7 +175,7 @@ export function buildZoomStyles({
|
|
|
176
175
|
let buildEffectiveTag = tag;
|
|
177
176
|
if (isGroup) {
|
|
178
177
|
const group = tag.split(":")[0];
|
|
179
|
-
const groupActiveTag =
|
|
178
|
+
const groupActiveTag = getGroupActiveId(group)?.split(":")[0];
|
|
180
179
|
buildEffectiveTag = `${group}:${groupActiveTag ?? tag.split(":")[1]}`;
|
|
181
180
|
}
|
|
182
181
|
|
|
@@ -201,7 +200,7 @@ export function buildZoomStyles({
|
|
|
201
200
|
scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
|
|
202
201
|
} as const;
|
|
203
202
|
|
|
204
|
-
const linkPair =
|
|
203
|
+
const linkPair = resolveTransitionPair(buildEffectiveTag, {
|
|
205
204
|
currentScreenKey: currentRouteKey,
|
|
206
205
|
previousScreenKey: previousRouteKey,
|
|
207
206
|
nextScreenKey: nextRouteKey,
|