react-native-screen-transitions 3.11.0 → 3.11.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/boundary/hooks/lifecycles/use-initial-destination-measurement.js +27 -15
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js +3 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +3 -5
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +5 -4
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +4 -15
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +22 -24
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +3 -36
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +8 -4
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +2 -4
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +3 -7
- package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +1 -3
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +3 -20
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js +15 -14
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +17 -17
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/entries.js +27 -0
- package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js +25 -0
- package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +2 -12
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +2 -2
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +30 -18
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js +3 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +3 -5
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +5 -4
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +4 -15
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +22 -24
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +3 -36
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +2 -2
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/destination-signals.js +8 -4
- package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/refresh-signals.js +2 -4
- package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +4 -8
- package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +1 -3
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +3 -19
- package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js +15 -14
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +17 -17
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/entries.js +27 -1
- package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js +25 -2
- package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +3 -13
- package/lib/module/shared/stores/bounds/internals/resolver.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/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +1 -5
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +0 -2
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +2 -3
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts +0 -2
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +1 -3
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts +0 -8
- package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.d.ts +1 -3
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +4 -4
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/entries.d.ts +2 -1
- package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts +3 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +67 -24
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.ts +6 -1
- package/src/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.ts +8 -9
- package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +5 -4
- package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +1 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +4 -20
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +27 -37
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +10 -57
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.ts +1 -8
- package/src/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +0 -3
- package/src/shared/components/boundary/utils/destination-signals.ts +8 -8
- package/src/shared/components/boundary/utils/refresh-signals.ts +2 -10
- package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +4 -11
- package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +0 -4
- package/src/shared/providers/screen/descriptors/helpers/get-ancestor-keys.ts +3 -30
- package/src/shared/providers/screen/styles/helpers/resolve-interpolator-style-handoff.ts +16 -16
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +21 -24
- package/src/shared/stores/bounds/internals/entries.ts +38 -1
- package/src/shared/stores/bounds/internals/links.ts +36 -0
- package/src/shared/stores/bounds/internals/resolver.ts +7 -21
- package/src/shared/utils/bounds/helpers/create-link-accessor.ts +9 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js +0 -18
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js +0 -13
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts +0 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts.map +0 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.ts +0 -16
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useInitialDestinationMeasurement = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNativeReanimated = require("react-native-reanimated");
|
|
9
|
+
var _useStack = require("../../../../hooks/navigation/use-stack");
|
|
9
10
|
var _descriptors = require("../../../../providers/screen/descriptors");
|
|
10
11
|
var _animation = require("../../../../stores/animation.store");
|
|
11
12
|
var _linkPairs = require("../../../../stores/bounds/helpers/link-pairs.helpers");
|
|
@@ -38,9 +39,13 @@ const useInitialDestinationMeasurement = ({
|
|
|
38
39
|
const currentScreenKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.currentScreenKey);
|
|
39
40
|
const nextScreenKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.nextScreenKey);
|
|
40
41
|
const destinationPairKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.destinationPairKey);
|
|
41
|
-
const ancestorDestinationPairKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.ancestorDestinationPairKey);
|
|
42
42
|
const destinationEnabled = enabled && !nextScreenKey;
|
|
43
|
-
const
|
|
43
|
+
const canReceiveDestination = destinationEnabled && !!destinationPairKey;
|
|
44
|
+
const preferredSourceScreenKey = destinationPairKey ? (0, _linkPairs.getSourceScreenKeyFromPairKey)(destinationPairKey) : undefined;
|
|
45
|
+
const stackScenes = (0, _useStack.useStack)(store => store.scenes);
|
|
46
|
+
// A retained closing screen can still have registered boundaries, but it
|
|
47
|
+
// cannot own a new transition link.
|
|
48
|
+
const closingSourceScreenKeys = (0, _react.useMemo)(() => stackScenes.filter(scene => scene.activity === "closing").map(scene => scene.route.key), [stackScenes]);
|
|
44
49
|
const progress = _animation.AnimationStore.getValue(currentScreenKey, "transitionProgress");
|
|
45
50
|
const {
|
|
46
51
|
actions: {
|
|
@@ -52,6 +57,7 @@ const useInitialDestinationMeasurement = ({
|
|
|
52
57
|
const retryToken = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
53
58
|
const handshakeRetries = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
54
59
|
const hasGivenUp = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
60
|
+
const hasFinishedInitialMeasurement = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
55
61
|
const releaseLifecycleStartBlock = (0, _react.useCallback)(() => {
|
|
56
62
|
"worklet";
|
|
57
63
|
|
|
@@ -59,12 +65,17 @@ const useInitialDestinationMeasurement = ({
|
|
|
59
65
|
if (!isBlockingLifecycleStart.get()) {
|
|
60
66
|
return;
|
|
61
67
|
}
|
|
68
|
+
hasFinishedInitialMeasurement.set(1);
|
|
62
69
|
isBlockingLifecycleStart.set(0);
|
|
63
70
|
unblockLifecycleStart();
|
|
64
|
-
}, [isBlockingLifecycleStart, retryToken, unblockLifecycleStart]);
|
|
71
|
+
}, [hasFinishedInitialMeasurement, isBlockingLifecycleStart, retryToken, unblockLifecycleStart]);
|
|
65
72
|
const claimLifecycleStartBlock = (0, _react.useCallback)(() => {
|
|
66
73
|
"worklet";
|
|
67
74
|
|
|
75
|
+
if (!canReceiveDestination || hasFinishedInitialMeasurement.get() || !(0, _entries.getMatchingSourceScreenKey)(tag, currentScreenKey)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
68
79
|
// The progress check and block claim must share one UI-thread operation.
|
|
69
80
|
// Otherwise a JS-thread layout effect can observe zero, enqueue the block,
|
|
70
81
|
// and let the opening animation start before that block reaches the UI thread.
|
|
@@ -73,9 +84,9 @@ const useInitialDestinationMeasurement = ({
|
|
|
73
84
|
}
|
|
74
85
|
blockLifecycleStart();
|
|
75
86
|
isBlockingLifecycleStart.set(1);
|
|
76
|
-
}, [blockLifecycleStart, isBlockingLifecycleStart, progress]);
|
|
87
|
+
}, [blockLifecycleStart, canReceiveDestination, currentScreenKey, hasFinishedInitialMeasurement, isBlockingLifecycleStart, progress, tag]);
|
|
77
88
|
(0, _react.useLayoutEffect)(() => {
|
|
78
|
-
if (!
|
|
89
|
+
if (!canReceiveDestination) {
|
|
79
90
|
return;
|
|
80
91
|
}
|
|
81
92
|
(0, _reactNativeReanimated.runOnUI)(claimLifecycleStartBlock)();
|
|
@@ -89,37 +100,37 @@ const useInitialDestinationMeasurement = ({
|
|
|
89
100
|
// runtime so it serializes with the handshake's guarded release.
|
|
90
101
|
(0, _reactNativeReanimated.runOnUI)(releaseLifecycleStartBlock)();
|
|
91
102
|
};
|
|
92
|
-
}, [claimLifecycleStartBlock,
|
|
103
|
+
}, [claimLifecycleStartBlock, escapeClipping, canReceiveDestination, releaseLifecycleStartBlock]);
|
|
93
104
|
(0, _reactNativeReanimated.useAnimatedReaction)(() => {
|
|
94
105
|
"worklet";
|
|
95
106
|
|
|
96
|
-
if (!
|
|
107
|
+
if (!canReceiveDestination || hasFinishedInitialMeasurement.get() || isBlockingLifecycleStart.get() <= 0) {
|
|
97
108
|
return null;
|
|
98
109
|
}
|
|
99
110
|
if (progress.get() > 0) {
|
|
100
111
|
return null;
|
|
101
112
|
}
|
|
102
113
|
const retryTick = retryToken.get();
|
|
103
|
-
const sourceScreenKey = (0,
|
|
114
|
+
const sourceScreenKey = (0, _entries.getMatchingSourceScreenKey)(tag, currentScreenKey, preferredSourceScreenKey, closingSourceScreenKeys);
|
|
115
|
+
const pairKey = sourceScreenKey ? (0, _linkPairs.createScreenPairKey)(sourceScreenKey, currentScreenKey) : undefined;
|
|
104
116
|
const signal = (0, _destinationSignals.getInitialDestinationMeasurementSignal)({
|
|
105
117
|
enabled: destinationEnabled,
|
|
106
|
-
|
|
107
|
-
ancestorDestinationPairKey,
|
|
118
|
+
pairKey,
|
|
108
119
|
linkId: linkKey,
|
|
109
120
|
group,
|
|
110
121
|
destinationPresent: (0, _entries.getEntry)(tag, currentScreenKey) !== null,
|
|
111
|
-
sourcePresent:
|
|
122
|
+
sourcePresent: sourceScreenKey !== null,
|
|
112
123
|
linkState: _state.pairs.get()
|
|
113
124
|
});
|
|
114
125
|
return [signal?.pairKey ?? null, signal?.action ?? null, retryTick];
|
|
115
126
|
}, (next, previous) => {
|
|
116
127
|
"worklet";
|
|
117
128
|
|
|
118
|
-
if (!next) {
|
|
129
|
+
if (!next || hasFinishedInitialMeasurement.get()) {
|
|
119
130
|
return;
|
|
120
131
|
}
|
|
121
132
|
const [measurePairKey, action, retryTick] = next;
|
|
122
|
-
if (!
|
|
133
|
+
if (!action) {
|
|
123
134
|
return;
|
|
124
135
|
}
|
|
125
136
|
const previousMeasurePairKey = previous?.[0];
|
|
@@ -137,17 +148,18 @@ const useInitialDestinationMeasurement = ({
|
|
|
137
148
|
handshakeRetries.set(0);
|
|
138
149
|
return;
|
|
139
150
|
}
|
|
140
|
-
if (action === "measure") {
|
|
151
|
+
if (action === "measure" && measurePairKey) {
|
|
141
152
|
measureBoundary({
|
|
142
153
|
type: "destination",
|
|
143
154
|
pairKey: measurePairKey
|
|
144
155
|
});
|
|
145
156
|
}
|
|
146
|
-
const link = (0, _links.getLink)(measurePairKey, linkKey);
|
|
157
|
+
const link = measurePairKey ? (0, _links.getLink)(measurePairKey, linkKey) : null;
|
|
147
158
|
const linkComplete = !!link?.source && !!link.destination;
|
|
148
159
|
if (linkComplete || action === "complete") {
|
|
149
160
|
(0, _reactNativeReanimated.cancelAnimation)(retryToken);
|
|
150
161
|
handshakeRetries.set(0);
|
|
162
|
+
hasFinishedInitialMeasurement.set(1);
|
|
151
163
|
if (escapeClipping) {
|
|
152
164
|
// Screen-level escape has a second readiness phase after destination
|
|
153
165
|
// matching: the host must commit before the transition starts, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNativeReanimated","_descriptors","_animation","_linkPairs","_entries","_links","_state","_system","_logger","_destinationSignals","HANDSHAKE_RETRY_DELAY_MS","MAX_HANDSHAKE_RETRIES","useInitialDestinationMeasurement","boundTag","enabled","escapeClipping","measureBoundary","tag","linkKey","group","currentScreenKey","useDescriptorsStore","s","derivations","nextScreenKey","destinationPairKey","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNativeReanimated","_useStack","_descriptors","_animation","_linkPairs","_entries","_links","_state","_system","_logger","_destinationSignals","HANDSHAKE_RETRY_DELAY_MS","MAX_HANDSHAKE_RETRIES","useInitialDestinationMeasurement","boundTag","enabled","escapeClipping","measureBoundary","tag","linkKey","group","currentScreenKey","useDescriptorsStore","s","derivations","nextScreenKey","destinationPairKey","destinationEnabled","canReceiveDestination","preferredSourceScreenKey","getSourceScreenKeyFromPairKey","undefined","stackScenes","useStack","store","scenes","closingSourceScreenKeys","useMemo","filter","scene","activity","map","route","key","progress","AnimationStore","getValue","actions","blockLifecycleStart","unblockLifecycleStart","SystemStore","getBag","isBlockingLifecycleStart","useSharedValue","retryToken","handshakeRetries","hasGivenUp","hasFinishedInitialMeasurement","releaseLifecycleStartBlock","useCallback","cancelAnimation","get","set","claimLifecycleStartBlock","getMatchingSourceScreenKey","useLayoutEffect","runOnUI","useAnimatedReaction","retryTick","sourceScreenKey","pairKey","createScreenPairKey","signal","getInitialDestinationMeasurementSignal","linkId","destinationPresent","getEntry","sourcePresent","linkState","pairs","action","next","previous","measurePairKey","previousMeasurePairKey","previousAction","previousRetryTick","shouldHandleSignal","type","link","getLink","linkComplete","source","destination","logger","warn","withDelay","withTiming","duration","exports"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts"],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C,EAAE;MAAEqC,QAAQ,EAAE;IAAE,CAAC,CACjD,CACD,CAAC;EACF,CACD,CAAC;AACF,CAAC;AAACC,OAAA,CAAAtF,gCAAA,GAAAA,gCAAA","ignoreList":[]}
|
package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useInitialSourceMeasurement = void 0;
|
|
7
7
|
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
8
|
var _descriptors = require("../../../../providers/screen/descriptors");
|
|
9
|
+
var _links = require("../../../../stores/bounds/internals/links");
|
|
9
10
|
var _state = require("../../../../stores/bounds/internals/state");
|
|
10
11
|
var _sourceSignals = require("../../utils/source-signals");
|
|
11
12
|
const useInitialSourceMeasurement = params => {
|
|
@@ -14,11 +15,12 @@ const useInitialSourceMeasurement = params => {
|
|
|
14
15
|
measureBoundary,
|
|
15
16
|
boundTag
|
|
16
17
|
} = params;
|
|
17
|
-
const
|
|
18
|
+
const currentScreenKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.currentScreenKey);
|
|
18
19
|
const lastSourceCaptureSignal = (0, _reactNativeReanimated.useSharedValue)(null);
|
|
19
20
|
(0, _reactNativeReanimated.useAnimatedReaction)(() => {
|
|
20
21
|
"worklet";
|
|
21
22
|
|
|
23
|
+
const sourcePairKey = (0, _links.getPairKeyForSource)(boundTag.tag, currentScreenKey) ?? undefined;
|
|
22
24
|
return (0, _sourceSignals.getInitialSourceCaptureSignal)({
|
|
23
25
|
enabled,
|
|
24
26
|
sourcePairKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeReanimated","require","_descriptors","_state","_sourceSignals","useInitialSourceMeasurement","params","enabled","measureBoundary","boundTag","
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","_descriptors","_links","_state","_sourceSignals","useInitialSourceMeasurement","params","enabled","measureBoundary","boundTag","currentScreenKey","useDescriptorsStore","s","derivations","lastSourceCaptureSignal","useSharedValue","useAnimatedReaction","sourcePairKey","getPairKeyForSource","tag","undefined","getInitialSourceCaptureSignal","linkId","linkKey","group","linkState","pairs","get","captureSignal","set","signal","type","pairKey","exports"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAGA,IAAAI,cAAA,GAAAJ,OAAA;AAEO,MAAMK,2BAA2B,GAAIC,MAI3C,IAAK;EACL,MAAM;IAAEC,OAAO;IAAEC,eAAe;IAAEC;EAAS,CAAC,GAAGH,MAAM;EACrD,MAAMI,gBAAgB,GAAG,IAAAC,gCAAmB,EAC1CC,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACH,gBACtB,CAAC;EACD,MAAMI,uBAAuB,GAAG,IAAAC,qCAAc,EAAgB,IAAI,CAAC;EAEnE,IAAAC,0CAAmB,EAClB,MAAM;IACL,SAAS;;IACT,MAAMC,aAAa,GAClB,IAAAC,0BAAmB,EAACT,QAAQ,CAACU,GAAG,EAAET,gBAAgB,CAAC,IAAIU,SAAS;IACjE,OAAO,IAAAC,4CAA6B,EAAC;MACpCd,OAAO;MACPU,aAAa;MACbK,MAAM,EAAEb,QAAQ,CAACc,OAAO;MACxBC,KAAK,EAAEf,QAAQ,CAACe,KAAK;MACrBC,SAAS,EAAER,aAAa,GAAGS,YAAK,CAACC,GAAG,CAAC,CAAC,GAAGP;IAC1C,CAAC,CAAC;EACH,CAAC,EACAQ,aAAa,IAAK;IAClB,SAAS;;IACT,IAAI,CAACrB,OAAO,IAAI,CAACqB,aAAa,EAAE;MAC/Bd,uBAAuB,CAACe,GAAG,CAAC,IAAI,CAAC;MACjC;IACD;IAEA,IAAIf,uBAAuB,CAACa,GAAG,CAAC,CAAC,KAAKC,aAAa,CAACE,MAAM,EAAE;MAC3D;IACD;IAEAhB,uBAAuB,CAACe,GAAG,CAACD,aAAa,CAACE,MAAM,CAAC;IACjDtB,eAAe,CAAC;MACfuB,IAAI,EAAE,QAAQ;MACdC,OAAO,EAAEJ,aAAa,CAACI;IACxB,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC;AAACC,OAAA,CAAA5B,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ exports.useRefreshBoundary = void 0;
|
|
|
7
7
|
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
8
|
var _descriptors = require("../../../../providers/screen/descriptors");
|
|
9
9
|
var _animation = require("../../../../stores/animation.store");
|
|
10
|
+
var _links = require("../../../../stores/bounds/internals/links");
|
|
10
11
|
var _state = require("../../../../stores/bounds/internals/state");
|
|
11
12
|
var _refreshSignals = require("../../utils/refresh-signals");
|
|
12
13
|
const useRefreshBoundary = ({
|
|
@@ -20,9 +21,6 @@ const useRefreshBoundary = ({
|
|
|
20
21
|
} = boundTag;
|
|
21
22
|
const currentScreenKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.currentScreenKey);
|
|
22
23
|
const nextScreenKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.nextScreenKey);
|
|
23
|
-
const sourcePairKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.sourcePairKey);
|
|
24
|
-
const destinationPairKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.destinationPairKey);
|
|
25
|
-
const ancestorDestinationPairKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.ancestorDestinationPairKey);
|
|
26
24
|
// Source-side boundaries refresh from the next screen's lifecycle pulse.
|
|
27
25
|
// Destination-side boundaries have no next screen, so they refresh from self.
|
|
28
26
|
const refreshScreenKey = nextScreenKey ?? currentScreenKey;
|
|
@@ -35,13 +33,13 @@ const useRefreshBoundary = ({
|
|
|
35
33
|
if (!shouldRefresh) {
|
|
36
34
|
return null;
|
|
37
35
|
}
|
|
36
|
+
const sourcePairKey = (0, _links.getPairKeyForSource)(boundTag.tag, currentScreenKey) ?? undefined;
|
|
37
|
+
const destinationPairKey = (0, _links.getPairKeyForDestination)(boundTag.tag, currentScreenKey) ?? undefined;
|
|
38
38
|
return (0, _refreshSignals.getRefreshBoundarySignal)({
|
|
39
39
|
enabled,
|
|
40
40
|
currentScreenKey,
|
|
41
41
|
sourcePairKey,
|
|
42
42
|
destinationPairKey,
|
|
43
|
-
ancestorDestinationPairKey,
|
|
44
|
-
nextScreenKey,
|
|
45
43
|
linkId: linkKey,
|
|
46
44
|
group,
|
|
47
45
|
shouldRefresh,
|
package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeReanimated","require","_descriptors","_animation","_state","_refreshSignals","useRefreshBoundary","enabled","boundTag","measureBoundary","linkKey","group","currentScreenKey","useDescriptorsStore","s","derivations","nextScreenKey","
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","_descriptors","_animation","_links","_state","_refreshSignals","useRefreshBoundary","enabled","boundTag","measureBoundary","linkKey","group","currentScreenKey","useDescriptorsStore","s","derivations","nextScreenKey","refreshScreenKey","refreshWillAnimate","AnimationStore","getValue","refreshClosing","useAnimatedReaction","shouldRefresh","get","sourcePairKey","getPairKeyForSource","tag","undefined","destinationPairKey","getPairKeyForDestination","getRefreshBoundarySignal","linkId","closing","linkState","pairs","refreshSignal","prevRefreshSignal","signal","type","pairKey","exports"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/hooks/lifecycles/use-refresh-boundary.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAIA,IAAAI,MAAA,GAAAJ,OAAA;AAGA,IA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CAAC;IACtB,CAAC,CAAC;EACH,CAAC,EACD,CAACY,aAAa,EAAEC,iBAAiB,KAAK;IACrC,SAAS;;IAET,IACC,CAACD,aAAa,IACdA,aAAa,CAACE,MAAM,KAAKD,iBAAiB,EAAEC,MAAM,EACjD;MACD;IACD;IAEA7B,eAAe,CAAC;MACf8B,IAAI,EAAEH,aAAa,CAACG,IAAI;MACxBC,OAAO,EAAEJ,aAAa,CAACI;IACxB,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC;AAACC,OAAA,CAAAnC,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -50,10 +50,11 @@ const useBoundaryMeasurement = ({
|
|
|
50
50
|
escapeClipping
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
//
|
|
54
|
-
//
|
|
53
|
+
// Presence and source capture must not depend on this screen owning an
|
|
54
|
+
// interpolator: a nested source can participate in a transition owned by a
|
|
55
|
+
// different navigator.
|
|
55
56
|
(0, _useBoundaryPresence.useBoundaryPresence)({
|
|
56
|
-
enabled
|
|
57
|
+
enabled,
|
|
57
58
|
boundTag,
|
|
58
59
|
currentScreenKey,
|
|
59
60
|
boundaryConfig,
|
|
@@ -61,7 +62,7 @@ const useBoundaryMeasurement = ({
|
|
|
61
62
|
escapeClipping
|
|
62
63
|
});
|
|
63
64
|
(0, _useInitialSourceMeasurement.useInitialSourceMeasurement)({
|
|
64
|
-
enabled
|
|
65
|
+
enabled,
|
|
65
66
|
measureBoundary,
|
|
66
67
|
boundTag
|
|
67
68
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_styles","_useBoundaryPresence","_useInitialDestinationMeasurement","_useInitialSourceMeasurement","_useRefreshBoundary","_useMeasurer","useBoundaryMeasurement","boundTag","enabled","runtimeEnabled","currentScreenKey","measuredRef","style","handoff","escapeClipping","config","anchor","scaleMode","target","method","boundaryConfig","useMemo","preparedStyles","prepareStyleForBounds","measureBoundary","useMeasurer","measuredAnimatedRef","useBoundaryPresence","useInitialSourceMeasurement","useInitialDestinationMeasurement","useRefreshBoundary","exports"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/hooks/use-boundary-measurement.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,oBAAA,GAAAF,OAAA;AACA,IAAAG,iCAAA,GAAAH,OAAA;AACA,IAAAI,4BAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAkBA;AACA;AACA;AACA;AACA;AACO,MAAMO,sBAAsB,GAAGA,CAAC;EACtCC,QAAQ;EACRC,OAAO;EACPC,cAAc;EACdC,gBAAgB;EAChBC,WAAW;EACXC,KAAK;EACLC,OAAO;EACPC,cAAc;EACdC;AAC6B,CAAC,KAAK;EACnC,MAAM;IAAEC,MAAM;IAAEC,SAAS;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGJ,MAAM;EACpD,MAAMK,cAAc,GAAG,IAAAC,cAAO,EAC7B,OAAO;IAAEL,MAAM;IAAEC,SAAS;IAAEC,MAAM;IAAEC;EAAO,CAAC,CAAC,EAC7C,CAACH,MAAM,EAAEC,SAAS,EAAEC,MAAM,EAAEC,MAAM,CACnC,CAAC;EAED,MAAMG,cAAc,GAAG,IAAAD,cAAO,EAAC,MAAM,IAAAE,6BAAqB,EAACX,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAE3E,MAAMY,eAAe,GAAG,IAAAC,wBAAW,EAAC;IACnCjB,OAAO;IACPD,QAAQ;IACRG,gBAAgB;IAChBY,cAAc;IACdI,mBAAmB,EAAEf,WAAW;IAChCE,OAAO;IACPC;EACD,CAAC,CAAC;;EAEF;EACA;EACA,IAAAa,wCAAmB,EAAC;IACnBnB,OAAO
|
|
1
|
+
{"version":3,"names":["_react","require","_styles","_useBoundaryPresence","_useInitialDestinationMeasurement","_useInitialSourceMeasurement","_useRefreshBoundary","_useMeasurer","useBoundaryMeasurement","boundTag","enabled","runtimeEnabled","currentScreenKey","measuredRef","style","handoff","escapeClipping","config","anchor","scaleMode","target","method","boundaryConfig","useMemo","preparedStyles","prepareStyleForBounds","measureBoundary","useMeasurer","measuredAnimatedRef","useBoundaryPresence","useInitialSourceMeasurement","useInitialDestinationMeasurement","useRefreshBoundary","exports"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/hooks/use-boundary-measurement.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,oBAAA,GAAAF,OAAA;AACA,IAAAG,iCAAA,GAAAH,OAAA;AACA,IAAAI,4BAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAkBA;AACA;AACA;AACA;AACA;AACO,MAAMO,sBAAsB,GAAGA,CAAC;EACtCC,QAAQ;EACRC,OAAO;EACPC,cAAc;EACdC,gBAAgB;EAChBC,WAAW;EACXC,KAAK;EACLC,OAAO;EACPC,cAAc;EACdC;AAC6B,CAAC,KAAK;EACnC,MAAM;IAAEC,MAAM;IAAEC,SAAS;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGJ,MAAM;EACpD,MAAMK,cAAc,GAAG,IAAAC,cAAO,EAC7B,OAAO;IAAEL,MAAM;IAAEC,SAAS;IAAEC,MAAM;IAAEC;EAAO,CAAC,CAAC,EAC7C,CAACH,MAAM,EAAEC,SAAS,EAAEC,MAAM,EAAEC,MAAM,CACnC,CAAC;EAED,MAAMG,cAAc,GAAG,IAAAD,cAAO,EAAC,MAAM,IAAAE,6BAAqB,EAACX,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAE3E,MAAMY,eAAe,GAAG,IAAAC,wBAAW,EAAC;IACnCjB,OAAO;IACPD,QAAQ;IACRG,gBAAgB;IAChBY,cAAc;IACdI,mBAAmB,EAAEf,WAAW;IAChCE,OAAO;IACPC;EACD,CAAC,CAAC;;EAEF;EACA;EACA;EACA,IAAAa,wCAAmB,EAAC;IACnBnB,OAAO;IACPD,QAAQ;IACRG,gBAAgB;IAChBU,cAAc;IACdP,OAAO;IACPC;EACD,CAAC,CAAC;EAEF,IAAAc,wDAA2B,EAAC;IAC3BpB,OAAO;IACPgB,eAAe;IACfjB;EACD,CAAC,CAAC;EAEF,IAAAsB,kEAAgC,EAAC;IAChCtB,QAAQ;IACRC,OAAO,EAAEC,cAAc;IACvBK,cAAc;IACdU;EACD,CAAC,CAAC;EAEF,IAAAM,sCAAkB,EAAC;IAClBtB,OAAO,EAAEC,cAAc;IACvBF,QAAQ;IACRiB;EACD,CAAC,CAAC;AACH,CAAC;AAACO,OAAA,CAAAzB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -34,7 +34,7 @@ const BoundaryContentPortalHost = exports.BoundaryContentPortalHost = /*#__PURE_
|
|
|
34
34
|
});
|
|
35
35
|
const styles = _reactNative.StyleSheet.create({
|
|
36
36
|
host: {
|
|
37
|
-
..._reactNative.StyleSheet.
|
|
37
|
+
..._reactNative.StyleSheet.flatten(_reactNative.StyleSheet.absoluteFill),
|
|
38
38
|
overflow: "visible"
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_interopRequireDefault","_teleport","_hostName","_jsxRuntime","e","__esModule","default","AnimatedPortalHost","NativePortalHost","Animated","createAnimatedComponent","BoundaryContentPortalHost","exports","memo","boundaryId","children","enabled","screenKey","jsx","Fragment","portalHostName","createBoundaryContentPortalHostName","jsxs","name","pointerEvents","PORTAL_POINTER_EVENTS","style","styles","host","StyleSheet","create","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_interopRequireDefault","_teleport","_hostName","_jsxRuntime","e","__esModule","default","AnimatedPortalHost","NativePortalHost","Animated","createAnimatedComponent","BoundaryContentPortalHost","exports","memo","boundaryId","children","enabled","screenKey","jsx","Fragment","portalHostName","createBoundaryContentPortalHostName","jsxs","name","pointerEvents","PORTAL_POINTER_EVENTS","style","styles","host","StyleSheet","create","flatten","absoluteFill","overflow"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAA2E,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE3E,MAAMG,kBAAkB,GAAGC,0BAAgB,GACxCC,8BAAQ,CAACC,uBAAuB,CAACF,0BAAgB,CAAC,GAClD,IAAI;AASA,MAAMG,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,gBAAG,IAAAE,WAAI,EAC5C,SAASF,yBAAyBA,CAAC;EAClCG,UAAU;EACVC,QAAQ;EACRC,OAAO;EACPC;AAC+B,CAAC,EAAE;EAClC,IAAI,CAACD,OAAO,IAAI,CAACT,kBAAkB,EAAE;IACpC,oBAAO,IAAAJ,WAAA,CAAAe,GAAA,EAAAf,WAAA,CAAAgB,QAAA;MAAAJ,QAAA,EAAGA;IAAQ,CAAG,CAAC;EACvB;EAEA,MAAMK,cAAc,GAAG,IAAAC,6CAAmC,EACzDJ,SAAS,EACTH,UACD,CAAC;EAED,oBACC,IAAAX,WAAA,CAAAmB,IAAA,EAAAnB,WAAA,CAAAgB,QAAA;IAAAJ,QAAA,GACEA,QAAQ,eACT,IAAAZ,WAAA,CAAAe,GAAA,EAACX,kBAAkB;MAClBgB,IAAI,EAAEH,cAAe;MACrBI,aAAa,EAAEC,+BAAsB;MACrCC,KAAK,EAAEC,MAAM,CAACC;IAAK,CACnB,CAAC;EAAA,CACD,CAAC;AAEL,CACD,CAAC;AAED,MAAMD,MAAM,GAAGE,uBAAU,CAACC,MAAM,CAAC;EAChCF,IAAI,EAAE;IACL,GAAGC,uBAAU,CAACE,OAAO,CAACF,uBAAU,CAACG,YAAY,CAAC;IAC9CC,QAAQ,EAAE;EACX;AACD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -12,7 +12,6 @@ var _composeSlotStyle = require("../../../../../../providers/screen/styles/helpe
|
|
|
12
12
|
var _links = require("../../../../../../stores/bounds/internals/links");
|
|
13
13
|
var _system = require("../../../../../../stores/system.store");
|
|
14
14
|
var _teleport = require("../../../teleport");
|
|
15
|
-
var _hasLocalSlot = require("../helpers/has-local-slot");
|
|
16
15
|
var _offsetStyle = require("../helpers/offset-style");
|
|
17
16
|
var _hostBounds = require("../stores/host-bounds.store");
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -33,7 +32,10 @@ const PortalBoundaryHost = exports.PortalBoundaryHost = /*#__PURE__*/(0, _react.
|
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
34
|
const link = (0, _links.getLink)(host.pairKey, host.boundaryId);
|
|
36
|
-
const
|
|
35
|
+
const hasSource = !!link?.source;
|
|
36
|
+
const hasHostBounds = (0, _hostBounds.getPortalHostBounds)(host.hostKey) !== null;
|
|
37
|
+
const hasSlot = host.slotsMap.get()[host.boundaryId] !== undefined;
|
|
38
|
+
const hasGeometry = hasSource && hasHostBounds && hasSlot;
|
|
37
39
|
if (!hasGeometry) {
|
|
38
40
|
geometryReadyFrames.set(0);
|
|
39
41
|
return;
|
|
@@ -81,19 +83,6 @@ const PortalBoundaryHost = exports.PortalBoundaryHost = /*#__PURE__*/(0, _react.
|
|
|
81
83
|
const slotStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
|
|
82
84
|
"worklet";
|
|
83
85
|
|
|
84
|
-
// `slotsMap` is the resolved map: it may contain real interpolator output,
|
|
85
|
-
// inherited styles, or resolver-created reset patches for slots that just
|
|
86
|
-
// disappeared. Normal components need those reset patches so stale styles
|
|
87
|
-
// clear correctly.
|
|
88
|
-
//
|
|
89
|
-
// A screen-level portal host is different. It is only the temporary visual
|
|
90
|
-
// receiver for teleported content, not the original component that needs a
|
|
91
|
-
// cleanup frame. If the current local interpolator layers did not emit this
|
|
92
|
-
// boundary id, any resolved style here is cleanup/stale residue and should
|
|
93
|
-
// not be drawn by the host.
|
|
94
|
-
if (!(0, _hasLocalSlot.hasLocalSlot)(host.localStylesMaps.get(), host.boundaryId)) {
|
|
95
|
-
return _constants.NO_STYLES;
|
|
96
|
-
}
|
|
97
86
|
const slot = host.slotsMap.get()[host.boundaryId];
|
|
98
87
|
return (0, _composeSlotStyle.composeSlotStyleWithLocalTransform)(slot?.style ?? _constants.NO_STYLES, undefined, slot?.boundsLocalTransform);
|
|
99
88
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_interopRequireWildcard","_constants","_composeSlotStyle","_links","_system","_teleport","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_interopRequireWildcard","_constants","_composeSlotStyle","_links","_system","_teleport","_offsetStyle","_hostBounds","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AnimatedPortalBoundaryHost","NativePortalHost","Animated","createAnimatedComponent","PortalBoundaryHost","exports","memo","host","style","geometryReadyFrames","useSharedValue","unblockLifecycleStart","SystemStore","getBag","screenKey","actions","handleFrame","useCallback","portalHostReady","link","getLink","pairKey","boundaryId","hasSource","source","hasHostBounds","getPortalHostBounds","hostKey","hasSlot","slotsMap","undefined","hasGeometry","useFrameCallback","hostStyle","useAnimatedStyle","NO_STYLES","sourceBounds","bounds","isCrossScreenPortal","resolvePortalOffsetStyle","placement","contentFrameStyle","height","width","slotStyle","slot","composeSlotStyleWithLocalTransform","boundsLocalTransform","jsx","View","pointerEvents","PORTAL_POINTER_EVENTS","collapsable","children","name","portalHostName","styles","content","StyleSheet","create","I18nManager","isRTL","end","position","top","left"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,sBAAA,GAAAC,uBAAA,CAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAEA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAAkE,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAG,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAA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,EAAE,UAAU;IACpBC,GAAG,EAAE;EACN,CAAC,GACA;IACAC,IAAI,EAAE,CAAC;IACPF,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE;EACN;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,57 +6,55 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useActivePortalBoundaryHost = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNativeReanimated = require("react-native-reanimated");
|
|
9
|
-
var
|
|
9
|
+
var _links = require("../../../../../../stores/bounds/internals/links");
|
|
10
10
|
var _naming = require("../../../utils/naming");
|
|
11
|
-
var _activePair = require("../helpers/active-pair");
|
|
12
11
|
var _portalBoundaryHost = require("../stores/portal-boundary-host.store");
|
|
13
12
|
const useActivePortalBoundaryHost = ({
|
|
14
13
|
boundaryId,
|
|
15
14
|
currentScreenKey,
|
|
16
15
|
escapeHostKey,
|
|
17
|
-
localStylesMaps,
|
|
18
16
|
portalHostName,
|
|
19
17
|
portalHostReady,
|
|
20
|
-
slotsMap
|
|
21
|
-
sourcePairKey
|
|
18
|
+
slotsMap
|
|
22
19
|
}) => {
|
|
23
|
-
const [
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (sourcePairKeyRef.current !== observedSourcePairKey) {
|
|
20
|
+
const [activePortal, setActivePortal] = (0, _react.useState)(null);
|
|
21
|
+
const activePairKeyRef = (0, _react.useRef)(null);
|
|
22
|
+
const updateActivePortal = (0, _react.useCallback)(pairKey => {
|
|
23
|
+
if (activePairKeyRef.current === pairKey) {
|
|
28
24
|
return;
|
|
29
25
|
}
|
|
30
|
-
|
|
26
|
+
activePairKeyRef.current = pairKey;
|
|
27
|
+
setActivePortal(pairKey ? {
|
|
28
|
+
pairKey
|
|
29
|
+
} : null);
|
|
31
30
|
}, []);
|
|
32
31
|
(0, _reactNativeReanimated.useAnimatedReaction)(() => {
|
|
33
32
|
"worklet";
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, (
|
|
34
|
+
const isBoundaryAnimating = slotsMap.get()[boundaryId] !== undefined;
|
|
35
|
+
if (!isBoundaryAnimating) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return (0, _links.getPairKeyForSource)(boundaryId, currentScreenKey);
|
|
39
|
+
}, (pairKey, previousPairKey) => {
|
|
41
40
|
"worklet";
|
|
42
41
|
|
|
43
|
-
if (
|
|
42
|
+
if (pairKey === previousPairKey) {
|
|
44
43
|
return;
|
|
45
44
|
}
|
|
46
|
-
(0, _reactNativeReanimated.runOnJS)(
|
|
45
|
+
(0, _reactNativeReanimated.runOnJS)(updateActivePortal)(pairKey);
|
|
47
46
|
});
|
|
48
47
|
(0, _react.useLayoutEffect)(() => {
|
|
49
|
-
if (!
|
|
48
|
+
if (!activePortal || !escapeHostKey) {
|
|
50
49
|
portalHostName.set(null);
|
|
51
50
|
portalHostReady.set(false);
|
|
52
51
|
return;
|
|
53
52
|
}
|
|
54
|
-
const nextPortalHostName = (0, _naming.createBoundaryPortalHostName)(escapeHostKey, boundaryId,
|
|
53
|
+
const nextPortalHostName = (0, _naming.createBoundaryPortalHostName)(escapeHostKey, boundaryId, activePortal.pairKey);
|
|
55
54
|
(0, _portalBoundaryHost.mountPortalBoundaryHost)({
|
|
56
55
|
boundaryId,
|
|
57
56
|
hostKey: escapeHostKey,
|
|
58
|
-
|
|
59
|
-
pairKey: sourcePairKey,
|
|
57
|
+
pairKey: activePortal.pairKey,
|
|
60
58
|
portalHostName: nextPortalHostName,
|
|
61
59
|
portalHostReady,
|
|
62
60
|
screenKey: currentScreenKey,
|
|
@@ -68,7 +66,7 @@ const useActivePortalBoundaryHost = ({
|
|
|
68
66
|
portalHostReady.set(false);
|
|
69
67
|
(0, _portalBoundaryHost.unmountPortalBoundaryHostByName)(nextPortalHostName);
|
|
70
68
|
};
|
|
71
|
-
}, [boundaryId, currentScreenKey, escapeHostKey,
|
|
69
|
+
}, [activePortal, boundaryId, currentScreenKey, escapeHostKey, portalHostName, portalHostReady, slotsMap]);
|
|
72
70
|
};
|
|
73
71
|
exports.useActivePortalBoundaryHost = useActivePortalBoundaryHost;
|
|
74
72
|
//# sourceMappingURL=use-active-portal-boundary-host.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNativeReanimated","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNativeReanimated","_links","_naming","_portalBoundaryHost","useActivePortalBoundaryHost","boundaryId","currentScreenKey","escapeHostKey","portalHostName","portalHostReady","slotsMap","activePortal","setActivePortal","useState","activePairKeyRef","useRef","updateActivePortal","useCallback","pairKey","current","useAnimatedReaction","isBoundaryAnimating","get","undefined","getPairKeyForSource","previousPairKey","runOnJS","useLayoutEffect","set","nextPortalHostName","createBoundaryPortalHostName","mountPortalBoundaryHost","hostKey","screenKey","unmountPortalBoundaryHostByName","exports"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AAGA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AAkBO,MAAMK,2BAA2B,GAAGA,CAAC;EAC3CC,UAAU;EACVC,gBAAgB;EAChBC,aAAa;EACbC,cAAc;EACdC,eAAe;EACfC;AACkC,CAAC,KAAK;EACxC,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAG,IAAAC,eAAQ,EAAsB,IAAI,CAAC;EAC3E,MAAMC,gBAAgB,GAAG,IAAAC,aAAM,EAAuB,IAAI,CAAC;EAE3D,MAAMC,kBAAkB,GAAG,IAAAC,kBAAW,EAAEC,OAA6B,IAAK;IACzE,IAAIJ,gBAAgB,CAACK,OAAO,K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AACmB,GAAG,CAAC,KAAK,CAAC;MAC1B,IAAAM,mDAA+B,EAACL,kBAAkB,CAAC;IACpD,CAAC;EACF,CAAC,EAAE,CACFlB,YAAY,EACZN,UAAU,EACVC,gBAAgB,EAChBC,aAAa,EACbC,cAAc,EACdC,eAAe,EACfC,QAAQ,CACR,CAAC;AACH,CAAC;AAACyB,OAAA,CAAA/B,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -7,40 +7,26 @@ exports.useBoundaryPortalAttachment = void 0;
|
|
|
7
7
|
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
8
|
var _descriptors = require("../../../../../../providers/screen/descriptors");
|
|
9
9
|
var _styles = require("../../../../../../providers/screen/styles");
|
|
10
|
-
var _transitionVisualState = require("../../../../../../providers/screen/styles/helpers/transition-visual-state");
|
|
11
|
-
var _animation = require("../../../../../../stores/animation.store");
|
|
12
|
-
var _state = require("../../../../../../stores/bounds/internals/state");
|
|
13
|
-
var _system = require("../../../../../../stores/system.store");
|
|
14
10
|
var _naming = require("../../../utils/naming");
|
|
15
11
|
var _teleportControl = require("../../../utils/teleport-control");
|
|
16
|
-
var _activePair = require("../helpers/active-pair");
|
|
17
12
|
var _hostRegistry = require("../stores/host-registry.store");
|
|
18
13
|
var _useActivePortalBoundaryHost = require("./use-active-portal-boundary-host");
|
|
19
14
|
const useBoundaryPortalAttachment = ({
|
|
20
15
|
boundaryId
|
|
21
16
|
}) => {
|
|
22
|
-
const sourcePairKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.sourcePairKey);
|
|
23
17
|
const currentScreenKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.currentScreenKey);
|
|
24
|
-
const nextScreenKey = (0, _descriptors.useDescriptorsStore)(s => s.derivations.nextScreenKey);
|
|
25
|
-
const destinationScreenKey = nextScreenKey ?? currentScreenKey;
|
|
26
|
-
const destinationAnimationProgress = _system.SystemStore.getValue(destinationScreenKey, "animationProgress");
|
|
27
|
-
const destinationClosing = _animation.AnimationStore.getValue(destinationScreenKey, "closing");
|
|
28
18
|
const {
|
|
29
|
-
localStylesMaps,
|
|
30
19
|
slotsMap
|
|
31
20
|
} = (0, _styles.useScreenSlots)();
|
|
32
21
|
const portalHostName = (0, _reactNativeReanimated.useSharedValue)(null);
|
|
33
22
|
const portalHostReady = (0, _reactNativeReanimated.useSharedValue)(false);
|
|
34
|
-
const attachedDestination = (0, _reactNativeReanimated.useSharedValue)(null);
|
|
35
23
|
const escapeHostKey = (0, _hostRegistry.useActiveHostKey)(currentScreenKey);
|
|
36
24
|
(0, _useActivePortalBoundaryHost.useActivePortalBoundaryHost)({
|
|
37
25
|
boundaryId,
|
|
38
26
|
currentScreenKey,
|
|
39
27
|
escapeHostKey,
|
|
40
|
-
localStylesMaps,
|
|
41
28
|
portalHostName,
|
|
42
29
|
portalHostReady,
|
|
43
|
-
sourcePairKey,
|
|
44
30
|
slotsMap
|
|
45
31
|
});
|
|
46
32
|
const teleportProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
|
|
@@ -52,30 +38,11 @@ const useBoundaryPortalAttachment = ({
|
|
|
52
38
|
teleport,
|
|
53
39
|
...slotProps
|
|
54
40
|
} = slot?.props ?? {};
|
|
55
|
-
const
|
|
56
|
-
const hostName = portalHostName.get();
|
|
57
|
-
const hasActiveLink = (0, _activePair.hasActiveBoundaryPortalLink)({
|
|
58
|
-
boundaryId,
|
|
59
|
-
pairsState: _state.pairs.get(),
|
|
60
|
-
sourcePairKey
|
|
61
|
-
});
|
|
62
|
-
const hasAttachableHost = shouldTeleport && hasActiveLink && portalHostReady.get() && hostName;
|
|
63
|
-
if (hasAttachableHost) {
|
|
64
|
-
attachedDestination.set({
|
|
65
|
-
animationProgress: destinationAnimationProgress,
|
|
66
|
-
closing: destinationClosing
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
const attached = attachedDestination.get();
|
|
70
|
-
const hasAttachedCloseFinished = attached !== null && (0, _transitionVisualState.hasCloseTransitionFinished)({
|
|
71
|
-
animationProgress: attached.animationProgress.get(),
|
|
72
|
-
closing: attached.closing.get()
|
|
73
|
-
});
|
|
74
|
-
const canAttach = hasAttachableHost && !hasAttachedCloseFinished;
|
|
75
|
-
const targetHostName = canAttach ? hostName : _naming.PORTAL_HOST_NAME_RESET_VALUE;
|
|
41
|
+
const shouldAttach = slot !== undefined && (0, _teleportControl.isTeleportEnabled)(teleport) && portalHostReady.get();
|
|
42
|
+
const hostName = shouldAttach ? portalHostName.get() : _naming.PORTAL_HOST_NAME_RESET_VALUE;
|
|
76
43
|
return {
|
|
77
44
|
...slotProps,
|
|
78
|
-
hostName
|
|
45
|
+
hostName
|
|
79
46
|
};
|
|
80
47
|
});
|
|
81
48
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeReanimated","require","_descriptors","_styles","
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","_descriptors","_styles","_naming","_teleportControl","_hostRegistry","_useActivePortalBoundaryHost","useBoundaryPortalAttachment","boundaryId","currentScreenKey","useDescriptorsStore","s","derivations","slotsMap","useScreenSlots","portalHostName","useSharedValue","portalHostReady","escapeHostKey","useActiveHostKey","useActivePortalBoundaryHost","teleportProps","useAnimatedProps","slot","get","pointerEvents","_pointerEvents","teleport","slotProps","props","shouldAttach","undefined","isTeleportEnabled","hostName","PORTAL_HOST_NAME_RESET_VALUE","exports"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,4BAAA,GAAAN,OAAA;AAMO,MAAMO,2BAA2B,GAAGA,CAAC;EAC3CC;AACkC,CAA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