react-native-screen-transitions 4.0.0-alpha.4 → 4.0.0-alpha.6
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/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +17 -9
- package/lib/commonjs/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +4 -15
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +22 -24
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +3 -36
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/commonjs/components/boundary/utils/destination-signals.js +7 -1
- package/lib/commonjs/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/commonjs/providers/screen/styles/helpers/create-interpolator-scope.js +40 -0
- package/lib/commonjs/providers/screen/styles/helpers/create-interpolator-scope.js.map +1 -0
- package/lib/commonjs/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js +15 -14
- package/lib/commonjs/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js.map +1 -1
- package/lib/commonjs/providers/screen/styles/hooks/use-interpolated-style-maps.js +22 -27
- package/lib/commonjs/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/stores/bounds/internals/entries.js +13 -3
- package/lib/commonjs/stores/bounds/internals/entries.js.map +1 -1
- package/lib/module/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +18 -10
- package/lib/module/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +4 -15
- package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +22 -24
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +3 -36
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +2 -2
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/module/components/boundary/utils/destination-signals.js +7 -1
- package/lib/module/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/module/providers/screen/styles/helpers/create-interpolator-scope.js +35 -0
- package/lib/module/providers/screen/styles/helpers/create-interpolator-scope.js.map +1 -0
- package/lib/module/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js +15 -14
- package/lib/module/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js.map +1 -1
- package/lib/module/providers/screen/styles/hooks/use-interpolated-style-maps.js +22 -27
- package/lib/module/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/stores/bounds/internals/entries.js +13 -3
- package/lib/module/stores/bounds/internals/entries.js.map +1 -1
- package/lib/typescript/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +1 -5
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +0 -2
- package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
- package/lib/typescript/components/boundary/utils/destination-signals.d.ts +1 -1
- package/lib/typescript/components/boundary/utils/destination-signals.d.ts.map +1 -1
- package/lib/typescript/navigators/react-navigation/index.d.ts +1 -1
- package/lib/typescript/providers/screen/styles/helpers/create-interpolator-scope.d.ts +9 -0
- package/lib/typescript/providers/screen/styles/helpers/create-interpolator-scope.d.ts.map +1 -0
- package/lib/typescript/providers/screen/styles/helpers/resolve-interpolator-style-handoff.d.ts +1 -3
- package/lib/typescript/providers/screen/styles/helpers/resolve-interpolator-style-handoff.d.ts.map +1 -1
- package/lib/typescript/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +4 -4
- package/lib/typescript/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/stores/bounds/internals/entries.d.ts +1 -1
- package/lib/typescript/stores/bounds/internals/entries.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +34 -13
- package/src/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +4 -20
- package/src/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +27 -37
- package/src/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +10 -57
- package/src/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.ts +1 -8
- package/src/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +0 -3
- package/src/components/boundary/utils/destination-signals.ts +6 -2
- package/src/providers/screen/styles/helpers/create-interpolator-scope.ts +45 -0
- package/src/providers/screen/styles/helpers/resolve-interpolator-style-handoff.ts +16 -16
- package/src/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +28 -35
- package/src/stores/bounds/internals/entries.ts +12 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js +0 -18
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +0 -1
- package/lib/commonjs/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.js +0 -21
- package/lib/commonjs/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js +0 -13
- package/lib/module/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +0 -1
- package/lib/module/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.js +0 -16
- package/lib/module/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.js.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts +0 -3
- package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts.map +0 -1
- package/lib/typescript/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.d.ts +0 -2
- package/lib/typescript/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.d.ts.map +0 -1
- package/src/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.ts +0 -16
- package/src/providers/screen/animation/helpers/accessors/use-build-bounds-accessor.tsx +0 -15
|
@@ -50,16 +50,16 @@ const mergeSlots = (frozen, live) => {
|
|
|
50
50
|
}
|
|
51
51
|
return merged;
|
|
52
52
|
};
|
|
53
|
-
const
|
|
53
|
+
const composeCurrentAndNextStyles = (current, next) => {
|
|
54
54
|
"worklet";
|
|
55
55
|
|
|
56
56
|
const composed = {
|
|
57
|
-
...
|
|
57
|
+
...current
|
|
58
58
|
};
|
|
59
|
-
for (const slotId in
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
composed[slotId] = mergeSlots(
|
|
59
|
+
for (const slotId in next) {
|
|
60
|
+
const nextSlot = next[slotId];
|
|
61
|
+
if (nextSlot) {
|
|
62
|
+
composed[slotId] = mergeSlots(current[slotId], nextSlot);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return composed;
|
|
@@ -67,26 +67,27 @@ const composeFrozenAndLiveStyles = (frozen, live) => {
|
|
|
67
67
|
const resolveInterpolatorStyleHandoff = ({
|
|
68
68
|
currentOwnsInterpolator,
|
|
69
69
|
currentStylesMap,
|
|
70
|
-
nextStylesMap
|
|
71
|
-
frozenCurrentStylesMap
|
|
70
|
+
nextStylesMap
|
|
72
71
|
}) => {
|
|
73
72
|
"worklet";
|
|
74
73
|
|
|
75
74
|
if (currentOwnsInterpolator) {
|
|
76
75
|
return {
|
|
77
|
-
localStylesMaps: currentStylesMap ? [currentStylesMap] : []
|
|
78
|
-
nextFrozenCurrentStylesMap: currentStylesMap ?? frozenCurrentStylesMap
|
|
76
|
+
localStylesMaps: currentStylesMap ? [currentStylesMap] : []
|
|
79
77
|
};
|
|
80
78
|
}
|
|
81
79
|
if (!nextStylesMap) {
|
|
82
80
|
return {
|
|
83
|
-
localStylesMaps:
|
|
84
|
-
|
|
81
|
+
localStylesMaps: currentStylesMap ? [currentStylesMap] : []
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (!currentStylesMap) {
|
|
85
|
+
return {
|
|
86
|
+
localStylesMaps: [nextStylesMap]
|
|
85
87
|
};
|
|
86
88
|
}
|
|
87
89
|
return {
|
|
88
|
-
localStylesMaps: [
|
|
89
|
-
nextFrozenCurrentStylesMap: frozenCurrentStylesMap
|
|
90
|
+
localStylesMaps: [composeCurrentAndNextStyles(currentStylesMap, nextStylesMap)]
|
|
90
91
|
};
|
|
91
92
|
};
|
|
92
93
|
exports.resolveInterpolatorStyleHandoff = resolveInterpolatorStyleHandoff;
|
package/lib/commonjs/providers/screen/styles/helpers/resolve-interpolator-style-handoff.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["mergeBuckets","frozen","live","composeTransforms","merged","key","liveValue","undefined","frozenValue","Array","isArray","mergeSlots","style","props","boundsLocalTransform","
|
|
1
|
+
{"version":3,"names":["mergeBuckets","frozen","live","composeTransforms","merged","key","liveValue","undefined","frozenValue","Array","isArray","mergeSlots","style","props","boundsLocalTransform","composeCurrentAndNextStyles","current","next","composed","slotId","nextSlot","resolveInterpolatorStyleHandoff","currentOwnsInterpolator","currentStylesMap","nextStylesMap","localStylesMaps","exports"],"sourceRoot":"../../../../../../src","sources":["providers/screen/styles/helpers/resolve-interpolator-style-handoff.ts"],"mappings":";;;;;;AAMA,MAAMA,YAAY,GAAGA,CACpBC,MAA2C,EAC3CC,IAAyC,EACzCC,iBAA0B,KACtB;EACJ,SAAS;;EAET,IAAI,CAACF,MAAM,EAAE;IACZ,OAAOC,IAAI;EACZ;EAEA,IAAI,CAACA,IAAI,EAAE;IACV,OAAOD,MAAM;EACd;EAEA,MAAMG,MAA+B,GAAG;IAAE,GAAGH;EAAO,CAAC;EAErD,KAAK,MAAMI,GAAG,IAAIH,IAAI,EAAE;IACvB,MAAMI,SAAS,GAAGJ,IAAI,CAACG,GAAG,CAAC;IAE3B,IAAIC,SAAS,KAAKC,SAAS,IAAID,SAAS,KAAK,IAAI,EAAE;MAClD;IACD;IAEA,MAAME,WAAW,GAAGP,MAAM,CAACI,GAAG,CAAC;IAE/B,IACCF,iBAAiB,IACjBE,GAAG,KAAK,WAAW,IACnBI,KAAK,CAACC,OAAO,CAACF,WAAW,CAAC,IAC1BC,KAAK,CA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,EAAEC,QAAQ,CAAC;IACzD;EACD;EAEA,OAAOF,QAAQ;AAChB,CAAC;AAEM,MAAMG,+BAA+B,GAAGA,CAAC;EAC/CC,uBAAuB;EACvBC,gBAAgB;EAChBC;AAKD,CAAC,KAEI;EACJ,SAAS;;EAET,IAAIF,uBAAuB,EAAE;IAC5B,OAAO;MACNG,eAAe,EAAEF,gBAAgB,GAAG,CAACA,gBAAgB,CAAC,GAAG;IAC1D,CAAC;EACF;EAEA,IAAI,CAACC,aAAa,EAAE;IACnB,OAAO;MACNC,eAAe,EAAEF,gBAAgB,GAAG,CAACA,gBAAgB,CAAC,GAAG;IAC1D,CAAC;EACF;EAEA,IAAI,CAACA,gBAAgB,EAAE;IACtB,OAAO;MACNE,eAAe,EAAE,CAACD,aAAa;IAChC,CAAC;EACF;EAEA,OAAO;IACNC,eAAe,EAAE,CAChBV,2BAA2B,CAACQ,gBAAgB,EAAEC,aAAa,CAAC;EAE9D,CAAC;AACF,CAAC;AAACE,OAAA,CAAAL,+BAAA,GAAAA,+BAAA","ignoreList":[]}
|
|
@@ -11,13 +11,13 @@ var _animation = require("../../../../stores/animation.store");
|
|
|
11
11
|
var _system = require("../../../../stores/system.store");
|
|
12
12
|
var _logger = require("../../../../utils/logger");
|
|
13
13
|
var _animation2 = require("../../animation");
|
|
14
|
-
var _useBuildBoundsAccessor = require("../../animation/helpers/accessors/use-build-bounds-accessor");
|
|
15
14
|
var _useBuildTransitionAccessor = require("../../animation/helpers/accessors/use-build-transition-accessor");
|
|
16
15
|
var _readScreenAnimationRevisions = require("../../animation/helpers/read-screen-animation-revisions");
|
|
17
16
|
var _selectedInterpolatorOptions = require("../../animation/helpers/selected-interpolator-options");
|
|
18
17
|
var _descriptors = require("../../descriptors");
|
|
19
18
|
var _options = require("../../options");
|
|
20
19
|
var _collectInterpolatorSharedValues = require("../helpers/collect-interpolator-shared-values");
|
|
20
|
+
var _createInterpolatorScope = require("../helpers/create-interpolator-scope");
|
|
21
21
|
var _normalizeSlots = require("../helpers/normalize-slots");
|
|
22
22
|
var _resolveInterpolatorStyleHandoff = require("../helpers/resolve-interpolator-style-handoff");
|
|
23
23
|
var _selectInterpolatorFrame = require("../helpers/select-interpolator-frame");
|
|
@@ -38,7 +38,6 @@ const runInterpolator = ({
|
|
|
38
38
|
interpolator,
|
|
39
39
|
props,
|
|
40
40
|
selectedFrame,
|
|
41
|
-
bounds,
|
|
42
41
|
transition
|
|
43
42
|
}) => {
|
|
44
43
|
"worklet";
|
|
@@ -47,12 +46,11 @@ const runInterpolator = ({
|
|
|
47
46
|
return undefined;
|
|
48
47
|
}
|
|
49
48
|
try {
|
|
50
|
-
const raw = interpolator({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
bounds,
|
|
49
|
+
const raw = interpolator((0, _createInterpolatorScope.createInterpolatorScope)({
|
|
50
|
+
frame: props,
|
|
51
|
+
selectedFrame,
|
|
54
52
|
transition
|
|
55
|
-
});
|
|
53
|
+
}));
|
|
56
54
|
const rawStyleMap = typeof raw === "object" && raw != null ? raw : undefined;
|
|
57
55
|
return {
|
|
58
56
|
rawStyleMap,
|
|
@@ -82,10 +80,10 @@ const runInterpolator = ({
|
|
|
82
80
|
* normal interpolator selection once the gesture-driven close is no longer in
|
|
83
81
|
* play.
|
|
84
82
|
*
|
|
85
|
-
* At an ownership handoff, the
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
83
|
+
* At an ownership handoff, the current interpolator remains live but is
|
|
84
|
+
* evaluated without the next-screen relationship. The next owner replaces
|
|
85
|
+
* matching scalar keys and composes its live transforms after the current
|
|
86
|
+
* screen's self-owned transforms.
|
|
89
87
|
*/
|
|
90
88
|
const useInterpolatedStylesMap = ({
|
|
91
89
|
enabled,
|
|
@@ -104,7 +102,6 @@ const useInterpolatedStylesMap = ({
|
|
|
104
102
|
ancestorScreenAnimationSources,
|
|
105
103
|
descendantScreenAnimationSources
|
|
106
104
|
} = (0, _animation2.useScreenAnimationStore)();
|
|
107
|
-
const boundsAccessor = (0, _useBuildBoundsAccessor.useBuildBoundsAccessor)();
|
|
108
105
|
const transition = (0, _useBuildTransitionAccessor.useBuildTransitionAccessor)();
|
|
109
106
|
const nextInterpolatorReady = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
110
107
|
|
|
@@ -123,7 +120,6 @@ const useInterpolatedStylesMap = ({
|
|
|
123
120
|
} = _system.SystemStore.getBag(activeScreenKey);
|
|
124
121
|
const isGesturingDuringCloseAnimation = (0, _reactNativeReanimated.useSharedValue)(false);
|
|
125
122
|
const initialDestinationStylesReady = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
126
|
-
const frozenCurrentStylesMap = (0, _reactNativeReanimated.useSharedValue)(_constants.NO_STYLES);
|
|
127
123
|
const shouldPrepareInitialDestinationStyles = enabled && !!destinationPairKey && !nextScreenKey && !!currentInterpolator;
|
|
128
124
|
(0, _reactNativeReanimated.useAnimatedReaction)(() => {
|
|
129
125
|
"worklet";
|
|
@@ -184,14 +180,18 @@ const useInterpolatedStylesMap = ({
|
|
|
184
180
|
const nextReady = currentOwnsInterpolator ? 0 : 1;
|
|
185
181
|
nextInterpolatorReady.set(nextReady);
|
|
186
182
|
const interpolatorOptionsOwner = currentOwnsInterpolator ? "current" : "next";
|
|
187
|
-
|
|
188
|
-
|
|
183
|
+
|
|
184
|
+
// Once the next interpolator owns the relationship, the current
|
|
185
|
+
// interpolator remains responsible only for its own live presentation.
|
|
186
|
+
// This preserves snap-point transforms without letting current-screen
|
|
187
|
+
// unfocus rules compete with the next screen's outgoing transition.
|
|
188
|
+
const currentSelectedFrame = (0, _selectInterpolatorFrame.selectInterpolatorFrame)(props, isInGestureMode || !!nextInterpolator);
|
|
189
|
+
const currentResult = runInterpolator({
|
|
189
190
|
interpolator: currentInterpolator,
|
|
190
191
|
props,
|
|
191
|
-
selectedFrame,
|
|
192
|
-
bounds: boundsAccessor,
|
|
192
|
+
selectedFrame: currentSelectedFrame,
|
|
193
193
|
transition
|
|
194
|
-
})
|
|
194
|
+
});
|
|
195
195
|
const initialDestinationStyleGate = (0, _visibilityGate.resolveInitialDestinationStyleGate)({
|
|
196
196
|
shouldPrepareStyles: shouldPrepareInitialDestinationStyles,
|
|
197
197
|
isVisibilityBlocked: visibilityBlocked.get(),
|
|
@@ -206,19 +206,15 @@ const useInterpolatedStylesMap = ({
|
|
|
206
206
|
const handoff = (0, _resolveInterpolatorStyleHandoff.resolveInterpolatorStyleHandoff)({
|
|
207
207
|
currentOwnsInterpolator: true,
|
|
208
208
|
currentStylesMap: currentResult?.stylesMap,
|
|
209
|
-
nextStylesMap: undefined
|
|
210
|
-
frozenCurrentStylesMap: frozenCurrentStylesMap.get()
|
|
209
|
+
nextStylesMap: undefined
|
|
211
210
|
});
|
|
212
|
-
if (handoff.nextFrozenCurrentStylesMap !== frozenCurrentStylesMap.get()) {
|
|
213
|
-
frozenCurrentStylesMap.set(handoff.nextFrozenCurrentStylesMap);
|
|
214
|
-
}
|
|
215
211
|
return handoff.localStylesMaps.length ? handoff.localStylesMaps : NO_STYLE_LAYERS;
|
|
216
212
|
}
|
|
213
|
+
const nextSelectedFrame = (0, _selectInterpolatorFrame.selectInterpolatorFrame)(props, false);
|
|
217
214
|
const nextResult = runInterpolator({
|
|
218
215
|
interpolator: nextInterpolator,
|
|
219
216
|
props,
|
|
220
|
-
selectedFrame,
|
|
221
|
-
bounds: boundsAccessor,
|
|
217
|
+
selectedFrame: nextSelectedFrame,
|
|
222
218
|
transition
|
|
223
219
|
});
|
|
224
220
|
(0, _selectedInterpolatorOptions.syncSelectedInterpolatorOptions)(selectedInterpolatorOptions, "next", nextResult?.rawStyleMap?.options);
|
|
@@ -226,8 +222,7 @@ const useInterpolatedStylesMap = ({
|
|
|
226
222
|
const handoff = (0, _resolveInterpolatorStyleHandoff.resolveInterpolatorStyleHandoff)({
|
|
227
223
|
currentOwnsInterpolator: false,
|
|
228
224
|
currentStylesMap: currentResult?.stylesMap,
|
|
229
|
-
nextStylesMap: nextResult?.stylesMap
|
|
230
|
-
frozenCurrentStylesMap: frozenCurrentStylesMap.get()
|
|
225
|
+
nextStylesMap: nextResult?.stylesMap
|
|
231
226
|
});
|
|
232
227
|
return handoff.localStylesMaps.length ? handoff.localStylesMaps : NO_STYLE_LAYERS;
|
|
233
228
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNativeReanimated","_constants","_animation","_system","_logger","_animation2","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNativeReanimated","_constants","_animation","_system","_logger","_animation2","_useBuildTransitionAccessor","_readScreenAnimationRevisions","_selectedInterpolatorOptions","_descriptors","_options","_collectInterpolatorSharedValues","_createInterpolatorScope","_normalizeSlots","_resolveInterpolatorStyleHandoff","_selectInterpolatorFrame","_stripInterpolatorOptions","_transitionVisualState","_visibilityGate","NO_STYLE_LAYERS","normalizeRawStyleMap","rawStyleMap","NO_STYLES","stylesMap","normalizeSlots","stripInterpolatorOptions","runInterpolator","interpolator","props","selectedFrame","transition","undefined","raw","createInterpolatorScope","frame","_","__DEV__","logger","warn","useInterpolatedStylesMap","enabled","visibilityBlocked","currentScreenKey","useDescriptorsStore","s","derivations","nextScreenKey","destinationPairKey","screenOptions","useScreenOptionsStore","screenInterpolatorProps","screenInterpolatorPropsRevision","selectedInterpolatorOptions","nextInterpolator","currentInterpolator","ancestorScreenAnimationSources","descendantScreenAnimationSources","useScreenAnimationStore","useBuildTransitionAccessor","nextInterpolatorReady","useSharedValue","interpolatorSharedValues","useMemo","collectInterpolatorSharedValues","activeScreenKey","closing","activeClosing","entering","activeEntering","AnimationStore","getBag","animationProgress","activeAnimationProgress","pendingLifecycleRequestKind","activePendingLifecycleRequestKind","pendingLifecycleStartBlockCount","activePendingLifecycleStartBlockCount","SystemStore","isGesturingDuringCloseAnimation","initialDestinationStylesReady","shouldPrepareInitialDestinationStyles","useAnimatedReaction","get","isVisibilityBlocked","styleGate","resolveInitialDestinationStyleGate","shouldPrepareStyles","stylesReady","shouldMarkStylesReady","set","localStylesMaps","useDerivedValue","readScreenAnimationRevisions","current","next","isDragging","gesture","dragging","isNextClosing","isInGestureMode","isPendingOpen","LifecycleTransitionRequestKind","Open","activeOpening","isOpeningBlocked","isOpenTransitionBlocked","opening","hasCloseFinished","hasCloseTransitionFinished","currentOwnsInterpolator","nextReady","interpolatorOptionsOwner","currentSelectedFrame","selectInterpolatorFrame","currentResult","initialDestinationStyleGate","shouldWithholdStyles","syncSelectedInterpolatorOptions","options","syncScreenOptionsOverrides","handoff","resolveInterpolatorStyleHandoff","currentStylesMap","nextStylesMap","length","nextSelectedFrame","nextResult","exports"],"sourceRoot":"../../../../../../src","sources":["providers/screen/styles/hooks/use-interpolated-style-maps.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAMA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AASA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,2BAAA,GAAAP,OAAA;AAEA,IAAAQ,6BAAA,GAAAR,OAAA;AACA,IAAAS,4BAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AAIA,IAAAY,gCAAA,GAAAZ,OAAA;AACA,IAAAa,wBAAA,GAAAb,OAAA;AACA,IAAAc,eAAA,GAAAd,OAAA;AACA,IAAAe,gCAAA,GAAAf,OAAA;AAEA,IAAAgB,wBAAA,GAAAhB,OAAA;AAIA,IAAAiB,yBAAA,GAAAjB,OAAA;AACA,IAAAkB,sBAAA,GAAAlB,OAAA;AAIA,IAAAmB,eAAA,GAAAnB,OAAA;AAEA,MAAMoB,eAAiC,GAAG,EAAE;AAc5C,MAAMC,oBAAoB,GACzBC,WAAoD,IAChD;EACJ,SAAS;;EAET,IAAI,CAACA,WAAW,EAAE;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key] ?? null;
|
|
63
63
|
}
|
|
64
|
-
function getMatchingSourceScreenKey(tag, destinationScreenKey, preferredScreenKey) {
|
|
64
|
+
function getMatchingSourceScreenKey(tag, destinationScreenKey, preferredScreenKey, excludedScreenKeys) {
|
|
65
65
|
"worklet";
|
|
66
66
|
|
|
67
67
|
const screens = _state.boundaryRegistry.get()[tag]?.screens;
|
|
68
68
|
if (!screens) return null;
|
|
69
|
-
|
|
69
|
+
const isExcluded = screenKey => {
|
|
70
|
+
"worklet";
|
|
71
|
+
|
|
72
|
+
for (let index = 0; index < (excludedScreenKeys?.length ?? 0); index++) {
|
|
73
|
+
if (excludedScreenKeys?.[index] === screenKey) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
};
|
|
79
|
+
if (preferredScreenKey && preferredScreenKey !== destinationScreenKey && !isExcluded(preferredScreenKey) && screens[preferredScreenKey]) {
|
|
70
80
|
return preferredScreenKey;
|
|
71
81
|
}
|
|
72
82
|
let latestScreenKey = null;
|
|
73
83
|
for (const screenKey in screens) {
|
|
74
|
-
if (screenKey !== destinationScreenKey) {
|
|
84
|
+
if (screenKey !== destinationScreenKey && !isExcluded(screenKey)) {
|
|
75
85
|
latestScreenKey = screenKey;
|
|
76
86
|
}
|
|
77
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_keys","require","_state","ensureBoundaryState","state","tag","screens","ensureScreenEntry","screenKey","tagState","bounds","styles","applyEntryPatch","entry","patch","undefined","boundaryConfig","handoff","escapeClipping","getEntry","key","boundaryRegistry","get","getMatchingSourceScreenKey","destinationScreenKey","preferredScreenKey","latestScreenKey","setEntry","modify","removeEntry","hasAnyKeys"],"sourceRoot":"../../../../../src","sources":["stores/bounds/internals/entries.ts"],"mappings":";;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,MAAME,mBAAmB,GAAGA,CAACC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ACG,OAAO,KAAKF,SAAS,EAAE;IACvCF,KAAK,CAACI,OAAO,GAAGH,KAAK,CAACG,OAAO;EAC9B;EAEA,IAAIH,KAAK,CAACI,cAAc,KAAK,IAAI,EAAE;IAClC,OAAOL,KAAK,CAACK,cAAc;EAC5B,CAAC,MAAM,IAAIJ,KAAK,CAACI,cAAc,KAAKH,SAAS,EAAE;IAC9CF,KAAK,CAACK,cAAc,GAAGJ,KAAK,CAACI,cAAc;EAC5C;AACD,CAAC;AAED,SAASC,QAAQA,CAACd,GAAU,EAAEe,GAAc,EAAgB;EAC3D,SAAS;;EACT,OAAOC,uBAAgB,CAACC,GAAG,CAAC,CAAC,CAACjB,GAAG,CAAC,EAAEC,OAAO,CAACc,GAAG,CAAC,IAAI,IAAI;AACzD;AAEA,SAASG,0BAA0BA,CAClClB,GAAU,EACVmB,oBAA+B,EAC/BC,kBAA8B,
|
|
1
|
+
{"version":3,"names":["_keys","require","_state","ensureBoundaryState","state","tag","screens","ensureScreenEntry","screenKey","tagState","bounds","styles","applyEntryPatch","entry","patch","undefined","boundaryConfig","handoff","escapeClipping","getEntry","key","boundaryRegistry","get","getMatchingSourceScreenKey","destinationScreenKey","preferredScreenKey","excludedScreenKeys","isExcluded","index","length","latestScreenKey","setEntry","modify","removeEntry","hasAnyKeys"],"sourceRoot":"../../../../../src","sources":["stores/bounds/internals/entries.ts"],"mappings":";;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,MAAME,mBAAmB,GAAGA,CAACC,KAA2B,EAAEC,GAAU,KAAK;EACxE,SAAS;;EACT,IAAI,CAACD,KAAK,CAACC,GAAG,CAAC,EAAE;IAChBD,KAAK,CAACC,GAAG,CAAC,GAAG;MACZC,OAAO,EAAE,CAAC;IACX,CAAC;EACF;EACA,OAAOF,KAAK,CAACC,GAAG,CAAC;AAClB,CAAC;AAED,MAAME,iBAAiB,GAAGA,CACzBH,KAA2B,EAC3BC,GAAU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,CAACW,MAAM,CAAkC5B,KAAQ,IAAQ;IACxE,SAAS;;IACT,MAAMS,KAAK,GAAGN,iBAAiB,CAACH,KAAK,EAAEC,GAAG,EAAEG,SAAS,CAAC;IACtDI,eAAe,CAACC,KAAK,EAAEC,KAAK,CAAC;IAC7B,OAAOV,KAAK;EACb,CAAC,CAAC;AACH;AAEA,SAAS6B,WAAWA,CAAC5B,GAAU,EAAEG,SAAoB,EAAE;EACtD,SAAS;;EACTa,uBAAgB,CAACW,MAAM,CAAkC5B,KAAQ,IAAQ;IACxE,SAAS;;IACT,MAAMK,QAAQ,GAAGL,KAAK,CAACC,GAAG,CAAC;IAC3B,IAAI,CAACI,QAAQ,EAAEH,OAAO,CAACE,SAAS,CAAC,EAAE;MAClC,OAAOJ,KAAK;IACb;IAEA,OAAOK,QAAQ,CAACH,OAAO,CAACE,SAAS,CAAC;IAClC,IAAI,CAAC,IAAA0B,gBAAU,EAACzB,QAAQ,CAACH,OAAO,CAAC,EAAE;MAClC,OAAOF,KAAK,CAACC,GAAG,CAAC;IAClB;IAEA,OAAOD,KAAK;EACb,CAAC,CAAC;AACH","ignoreList":[]}
|
package/lib/module/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useCallback, useLayoutEffect } from "react";
|
|
3
|
+
import { useCallback, useLayoutEffect, useMemo } from "react";
|
|
4
4
|
import { cancelAnimation, useAnimatedReaction, useSharedValue, withDelay, withTiming } from "react-native-reanimated";
|
|
5
5
|
import { scheduleOnUI } from "react-native-worklets";
|
|
6
|
+
import { useStack } from "../../../../hooks/navigation/use-stack";
|
|
6
7
|
import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
|
|
7
8
|
import { AnimationStore } from "../../../../stores/animation.store";
|
|
8
9
|
import { createScreenPairKey, getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
@@ -39,6 +40,10 @@ export const useInitialDestinationMeasurement = ({
|
|
|
39
40
|
const destinationEnabled = enabled && !nextScreenKey;
|
|
40
41
|
const canReceiveDestination = destinationEnabled && !!destinationPairKey;
|
|
41
42
|
const preferredSourceScreenKey = destinationPairKey ? getSourceScreenKeyFromPairKey(destinationPairKey) : undefined;
|
|
43
|
+
const stackScenes = useStack(store => store.scenes);
|
|
44
|
+
// A retained closing screen can still have registered boundaries, but it
|
|
45
|
+
// cannot own a new transition link.
|
|
46
|
+
const closingSourceScreenKeys = useMemo(() => stackScenes.filter(scene => scene.activity === "closing").map(scene => scene.route.key), [stackScenes]);
|
|
42
47
|
const progress = AnimationStore.getValue(currentScreenKey, "transitionProgress");
|
|
43
48
|
const {
|
|
44
49
|
actions: {
|
|
@@ -50,6 +55,7 @@ export const useInitialDestinationMeasurement = ({
|
|
|
50
55
|
const retryToken = useSharedValue(0);
|
|
51
56
|
const handshakeRetries = useSharedValue(0);
|
|
52
57
|
const hasGivenUp = useSharedValue(0);
|
|
58
|
+
const hasFinishedInitialMeasurement = useSharedValue(0);
|
|
53
59
|
const releaseLifecycleStartBlock = useCallback(() => {
|
|
54
60
|
"worklet";
|
|
55
61
|
|
|
@@ -57,13 +63,14 @@ export const useInitialDestinationMeasurement = ({
|
|
|
57
63
|
if (!isBlockingLifecycleStart.get()) {
|
|
58
64
|
return;
|
|
59
65
|
}
|
|
66
|
+
hasFinishedInitialMeasurement.set(1);
|
|
60
67
|
isBlockingLifecycleStart.set(0);
|
|
61
68
|
unblockLifecycleStart();
|
|
62
|
-
}, [isBlockingLifecycleStart, retryToken, unblockLifecycleStart]);
|
|
69
|
+
}, [hasFinishedInitialMeasurement, isBlockingLifecycleStart, retryToken, unblockLifecycleStart]);
|
|
63
70
|
const claimLifecycleStartBlock = useCallback(() => {
|
|
64
71
|
"worklet";
|
|
65
72
|
|
|
66
|
-
if (!canReceiveDestination || !getMatchingSourceScreenKey(tag, currentScreenKey
|
|
73
|
+
if (!canReceiveDestination || hasFinishedInitialMeasurement.get() || !getMatchingSourceScreenKey(tag, currentScreenKey)) {
|
|
67
74
|
return;
|
|
68
75
|
}
|
|
69
76
|
|
|
@@ -75,7 +82,7 @@ export const useInitialDestinationMeasurement = ({
|
|
|
75
82
|
}
|
|
76
83
|
blockLifecycleStart();
|
|
77
84
|
isBlockingLifecycleStart.set(1);
|
|
78
|
-
}, [blockLifecycleStart, canReceiveDestination, currentScreenKey, isBlockingLifecycleStart, progress,
|
|
85
|
+
}, [blockLifecycleStart, canReceiveDestination, currentScreenKey, hasFinishedInitialMeasurement, isBlockingLifecycleStart, progress, tag]);
|
|
79
86
|
useLayoutEffect(() => {
|
|
80
87
|
if (!canReceiveDestination) {
|
|
81
88
|
return;
|
|
@@ -95,14 +102,14 @@ export const useInitialDestinationMeasurement = ({
|
|
|
95
102
|
useAnimatedReaction(() => {
|
|
96
103
|
"worklet";
|
|
97
104
|
|
|
98
|
-
if (!canReceiveDestination || isBlockingLifecycleStart.get() <= 0) {
|
|
105
|
+
if (!canReceiveDestination || hasFinishedInitialMeasurement.get() || isBlockingLifecycleStart.get() <= 0) {
|
|
99
106
|
return null;
|
|
100
107
|
}
|
|
101
108
|
if (progress.get() > 0) {
|
|
102
109
|
return null;
|
|
103
110
|
}
|
|
104
111
|
const retryTick = retryToken.get();
|
|
105
|
-
const sourceScreenKey = getMatchingSourceScreenKey(tag, currentScreenKey, preferredSourceScreenKey);
|
|
112
|
+
const sourceScreenKey = getMatchingSourceScreenKey(tag, currentScreenKey, preferredSourceScreenKey, closingSourceScreenKeys);
|
|
106
113
|
const pairKey = sourceScreenKey ? createScreenPairKey(sourceScreenKey, currentScreenKey) : undefined;
|
|
107
114
|
const signal = getInitialDestinationMeasurementSignal({
|
|
108
115
|
enabled: destinationEnabled,
|
|
@@ -117,11 +124,11 @@ export const useInitialDestinationMeasurement = ({
|
|
|
117
124
|
}, (next, previous) => {
|
|
118
125
|
"worklet";
|
|
119
126
|
|
|
120
|
-
if (!next) {
|
|
127
|
+
if (!next || hasFinishedInitialMeasurement.get()) {
|
|
121
128
|
return;
|
|
122
129
|
}
|
|
123
130
|
const [measurePairKey, action, retryTick] = next;
|
|
124
|
-
if (!
|
|
131
|
+
if (!action) {
|
|
125
132
|
return;
|
|
126
133
|
}
|
|
127
134
|
const previousMeasurePairKey = previous?.[0];
|
|
@@ -139,17 +146,18 @@ export const useInitialDestinationMeasurement = ({
|
|
|
139
146
|
handshakeRetries.set(0);
|
|
140
147
|
return;
|
|
141
148
|
}
|
|
142
|
-
if (action === "measure") {
|
|
149
|
+
if (action === "measure" && measurePairKey) {
|
|
143
150
|
measureBoundary({
|
|
144
151
|
type: "destination",
|
|
145
152
|
pairKey: measurePairKey
|
|
146
153
|
});
|
|
147
154
|
}
|
|
148
|
-
const link = getLink(measurePairKey, linkKey);
|
|
155
|
+
const link = measurePairKey ? getLink(measurePairKey, linkKey) : null;
|
|
149
156
|
const linkComplete = !!link?.source && !!link.destination;
|
|
150
157
|
if (linkComplete || action === "complete") {
|
|
151
158
|
cancelAnimation(retryToken);
|
|
152
159
|
handshakeRetries.set(0);
|
|
160
|
+
hasFinishedInitialMeasurement.set(1);
|
|
153
161
|
if (escapeClipping) {
|
|
154
162
|
// Screen-level escape has a second readiness phase after destination
|
|
155
163
|
// matching: the host must commit before the transition starts, or
|
package/lib/module/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useLayoutEffect","cancelAnimation","useAnimatedReaction","useSharedValue","withDelay","withTiming","scheduleOnUI","useDescriptorsStore","AnimationStore","createScreenPairKey","getSourceScreenKeyFromPairKey","getEntry","getMatchingSourceScreenKey","getLink","pairs","SystemStore","logger","getInitialDestinationMeasurementSignal","HANDSHAKE_RETRY_DELAY_MS","MAX_HANDSHAKE_RETRIES","useInitialDestinationMeasurement","boundTag","enabled","escapeClipping","measureBoundary","tag","linkKey","group","currentScreenKey","s","derivations","nextScreenKey","destinationPairKey","destinationEnabled","canReceiveDestination","preferredSourceScreenKey","undefined","progress","getValue","actions","blockLifecycleStart","unblockLifecycleStart","getBag","isBlockingLifecycleStart","retryToken","handshakeRetries","hasGivenUp","releaseLifecycleStartBlock","get","set","claimLifecycleStartBlock","retryTick","sourceScreenKey","pairKey","signal","linkId","destinationPresent","sourcePresent","linkState","action","next","previous","measurePairKey","previousMeasurePairKey","previousAction","previousRetryTick","shouldHandleSignal","type","link","linkComplete","source","destination","warn","duration"],"sourceRoot":"../../../../../../src","sources":["components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,eAAe,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"names":["useCallback","useLayoutEffect","useMemo","cancelAnimation","useAnimatedReaction","useSharedValue","withDelay","withTiming","scheduleOnUI","useStack","useDescriptorsStore","AnimationStore","createScreenPairKey","getSourceScreenKeyFromPairKey","getEntry","getMatchingSourceScreenKey","getLink","pairs","SystemStore","logger","getInitialDestinationMeasurementSignal","HANDSHAKE_RETRY_DELAY_MS","MAX_HANDSHAKE_RETRIES","useInitialDestinationMeasurement","boundTag","enabled","escapeClipping","measureBoundary","tag","linkKey","group","currentScreenKey","s","derivations","nextScreenKey","destinationPairKey","destinationEnabled","canReceiveDestination","preferredSourceScreenKey","undefined","stackScenes","store","scenes","closingSourceScreenKeys","filter","scene","activity","map","route","key","progress","getValue","actions","blockLifecycleStart","unblockLifecycleStart","getBag","isBlockingLifecycleStart","retryToken","handshakeRetries","hasGivenUp","hasFinishedInitialMeasurement","releaseLifecycleStartBlock","get","set","claimLifecycleStartBlock","retryTick","sourceScreenKey","pairKey","signal","linkId","destinationPresent","sourcePresent","linkState","action","next","previous","measurePairKey","previousMeasurePairKey","previousAction","previousRetryTick","shouldHandleSignal","type","link","linkComplete","source","destination","warn","duration"],"sourceRoot":"../../../../../../src","sources":["components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts"],"mappings":";;AAAA,SAASA,WAAW,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;EACF,CACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -8,7 +8,6 @@ import { composeSlotStyleWithLocalTransform } from "../../../../../../providers/
|
|
|
8
8
|
import { getLink } from "../../../../../../stores/bounds/internals/links";
|
|
9
9
|
import { SystemStore } from "../../../../../../stores/system.store";
|
|
10
10
|
import { NativePortalHost, PORTAL_POINTER_EVENTS } from "../../../teleport";
|
|
11
|
-
import { hasLocalSlot } from "../helpers/has-local-slot";
|
|
12
11
|
import { resolvePortalOffsetStyle } from "../helpers/offset-style";
|
|
13
12
|
import { getPortalHostBounds } from "../stores/host-bounds.store";
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -28,7 +27,10 @@ export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost(
|
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
29
|
const link = getLink(host.pairKey, host.boundaryId);
|
|
31
|
-
const
|
|
30
|
+
const hasSource = !!link?.source;
|
|
31
|
+
const hasHostBounds = getPortalHostBounds(host.hostKey) !== null;
|
|
32
|
+
const hasSlot = host.slotsMap.get()[host.boundaryId] !== undefined;
|
|
33
|
+
const hasGeometry = hasSource && hasHostBounds && hasSlot;
|
|
32
34
|
if (!hasGeometry) {
|
|
33
35
|
geometryReadyFrames.set(0);
|
|
34
36
|
return;
|
|
@@ -76,19 +78,6 @@ export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost(
|
|
|
76
78
|
const slotStyle = useAnimatedStyle(() => {
|
|
77
79
|
"worklet";
|
|
78
80
|
|
|
79
|
-
// `slotsMap` is the resolved map: it may contain real interpolator output,
|
|
80
|
-
// inherited styles, or resolver-created reset patches for slots that just
|
|
81
|
-
// disappeared. Normal components need those reset patches so stale styles
|
|
82
|
-
// clear correctly.
|
|
83
|
-
//
|
|
84
|
-
// A screen-level portal host is different. It is only the temporary visual
|
|
85
|
-
// receiver for teleported content, not the original component that needs a
|
|
86
|
-
// cleanup frame. If the current local interpolator layers did not emit this
|
|
87
|
-
// boundary id, any resolved style here is cleanup/stale residue and should
|
|
88
|
-
// not be drawn by the host.
|
|
89
|
-
if (!hasLocalSlot(host.localStylesMaps.get(), host.boundaryId)) {
|
|
90
|
-
return NO_STYLES;
|
|
91
|
-
}
|
|
92
81
|
const slot = host.slotsMap.get()[host.boundaryId];
|
|
93
82
|
return composeSlotStyleWithLocalTransform(slot?.style ?? NO_STYLES, undefined, slot?.boundsLocalTransform);
|
|
94
83
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","useCallback","I18nManager","StyleSheet","Animated","useAnimatedStyle","useFrameCallback","useSharedValue","NO_STYLES","composeSlotStyleWithLocalTransform","getLink","SystemStore","NativePortalHost","PORTAL_POINTER_EVENTS","
|
|
1
|
+
{"version":3,"names":["memo","useCallback","I18nManager","StyleSheet","Animated","useAnimatedStyle","useFrameCallback","useSharedValue","NO_STYLES","composeSlotStyleWithLocalTransform","getLink","SystemStore","NativePortalHost","PORTAL_POINTER_EVENTS","resolvePortalOffsetStyle","getPortalHostBounds","jsx","_jsx","AnimatedPortalBoundaryHost","createAnimatedComponent","PortalBoundaryHost","host","style","geometryReadyFrames","unblockLifecycleStart","getBag","screenKey","actions","handleFrame","portalHostReady","get","link","pairKey","boundaryId","hasSource","source","hasHostBounds","hostKey","hasSlot","slotsMap","undefined","hasGeometry","set","hostStyle","sourceBounds","bounds","isCrossScreenPortal","placement","contentFrameStyle","height","width","slotStyle","slot","boundsLocalTransform","View","pointerEvents","collapsable","children","name","portalHostName","styles","content","create","isRTL","end","position","top","left"],"sourceRoot":"../../../../../../../../src","sources":["components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,WAAW,QAAQ,OAAO;AACzC,SACCC,WAAW,EAEXC,UAAU,QAEJ,cAAc;AACrB,OAAOC,QAAQ,IACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,QACR,yBAAyB;AAChC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, useState } from "react";
|
|
4
4
|
import { useAnimatedReaction } from "react-native-reanimated";
|
|
5
5
|
import { scheduleOnRN } from "react-native-worklets";
|
|
6
|
-
import {
|
|
6
|
+
import { getPairKeyForSource } from "../../../../../../stores/bounds/internals/links";
|
|
7
7
|
import { createBoundaryPortalHostName } from "../../../utils/naming";
|
|
8
|
-
import { hasActiveBoundaryPortalLink } from "../helpers/active-pair";
|
|
9
8
|
import { mountPortalBoundaryHost, unmountPortalBoundaryHostByName } from "../stores/portal-boundary-host.store";
|
|
10
9
|
export const useActivePortalBoundaryHost = ({
|
|
11
10
|
boundaryId,
|
|
12
11
|
currentScreenKey,
|
|
13
12
|
escapeHostKey,
|
|
14
|
-
localStylesMaps,
|
|
15
13
|
portalHostName,
|
|
16
14
|
portalHostReady,
|
|
17
|
-
slotsMap
|
|
18
|
-
sourcePairKey
|
|
15
|
+
slotsMap
|
|
19
16
|
}) => {
|
|
20
|
-
const [
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (sourcePairKeyRef.current !== observedSourcePairKey) {
|
|
17
|
+
const [activePortal, setActivePortal] = useState(null);
|
|
18
|
+
const activePairKeyRef = useRef(null);
|
|
19
|
+
const updateActivePortal = useCallback(pairKey => {
|
|
20
|
+
if (activePairKeyRef.current === pairKey) {
|
|
25
21
|
return;
|
|
26
22
|
}
|
|
27
|
-
|
|
23
|
+
activePairKeyRef.current = pairKey;
|
|
24
|
+
setActivePortal(pairKey ? {
|
|
25
|
+
pairKey
|
|
26
|
+
} : null);
|
|
28
27
|
}, []);
|
|
29
28
|
useAnimatedReaction(() => {
|
|
30
29
|
"worklet";
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, (
|
|
31
|
+
const isBoundaryAnimating = slotsMap.get()[boundaryId] !== undefined;
|
|
32
|
+
if (!isBoundaryAnimating) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return getPairKeyForSource(boundaryId, currentScreenKey);
|
|
36
|
+
}, (pairKey, previousPairKey) => {
|
|
38
37
|
"worklet";
|
|
39
38
|
|
|
40
|
-
if (
|
|
39
|
+
if (pairKey === previousPairKey) {
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
43
|
-
scheduleOnRN(
|
|
42
|
+
scheduleOnRN(updateActivePortal, pairKey);
|
|
44
43
|
});
|
|
45
44
|
useLayoutEffect(() => {
|
|
46
|
-
if (!
|
|
45
|
+
if (!activePortal || !escapeHostKey) {
|
|
47
46
|
portalHostName.set(null);
|
|
48
47
|
portalHostReady.set(false);
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
51
|
-
const nextPortalHostName = createBoundaryPortalHostName(escapeHostKey, boundaryId,
|
|
50
|
+
const nextPortalHostName = createBoundaryPortalHostName(escapeHostKey, boundaryId, activePortal.pairKey);
|
|
52
51
|
mountPortalBoundaryHost({
|
|
53
52
|
boundaryId,
|
|
54
53
|
hostKey: escapeHostKey,
|
|
55
|
-
|
|
56
|
-
pairKey: sourcePairKey,
|
|
54
|
+
pairKey: activePortal.pairKey,
|
|
57
55
|
portalHostName: nextPortalHostName,
|
|
58
56
|
portalHostReady,
|
|
59
57
|
screenKey: currentScreenKey,
|
|
@@ -65,6 +63,6 @@ export const useActivePortalBoundaryHost = ({
|
|
|
65
63
|
portalHostReady.set(false);
|
|
66
64
|
unmountPortalBoundaryHostByName(nextPortalHostName);
|
|
67
65
|
};
|
|
68
|
-
}, [boundaryId, currentScreenKey, escapeHostKey,
|
|
66
|
+
}, [activePortal, boundaryId, currentScreenKey, escapeHostKey, portalHostName, portalHostReady, slotsMap]);
|
|
69
67
|
};
|
|
70
68
|
//# sourceMappingURL=use-active-portal-boundary-host.js.map
|