react-native-screen-transitions 3.4.0-alpha.6 → 3.4.0-alpha.7
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/README.md +136 -46
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +27 -45
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js +39 -0
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +232 -0
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +2 -4
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +4 -3
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +2 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/index.js +20 -214
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js +63 -0
- package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +1 -0
- package/lib/commonjs/shared/components/create-transition-aware-component.js +29 -7
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -1
- package/lib/commonjs/shared/components/screen-container/index.js +8 -12
- package/lib/commonjs/shared/components/screen-container/index.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +4 -4
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -4
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -4
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +4 -4
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/commonjs/shared/constants.js +2 -1
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
- package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/build-resolved-style-map.js +144 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/build-resolved-style-map.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js +28 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/split-normalized-style-maps.js +39 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/split-normalized-style-maps.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/index.js +25 -0
- package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/{styles.provider.js → styles/styles.provider.js} +47 -39
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js +21 -10
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +56 -30
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +27 -45
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js +1 -1
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js +34 -0
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +227 -0
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +2 -4
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +4 -3
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +2 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/index.js +16 -213
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js +56 -0
- package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +1 -0
- package/lib/module/shared/components/create-transition-aware-component.js +30 -8
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/module/shared/components/screen-container/index.js +8 -12
- package/lib/module/shared/components/screen-container/index.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +4 -4
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +4 -4
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -4
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/surface-container.js +4 -4
- package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/module/shared/constants.js +2 -1
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/providers/screen/screen-composer.js +1 -1
- package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/build-resolved-style-map.js +139 -0
- package/lib/module/shared/providers/screen/styles/helpers/build-resolved-style-map.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js +23 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/split-normalized-style-maps.js +34 -0
- package/lib/module/shared/providers/screen/styles/helpers/split-normalized-style-maps.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/index.js +4 -0
- package/lib/module/shared/providers/screen/styles/index.js.map +1 -0
- package/lib/module/shared/providers/screen/{styles.provider.js → styles/styles.provider.js} +48 -40
- package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +2 -2
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/style-composers.js +21 -10
- package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/build.js +55 -28
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +9 -15
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +6 -4
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +1 -1
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts +209 -0
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts +8 -0
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +2 -8
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +216 -12
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts +35 -0
- package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +1 -0
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +209 -2
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/build-resolved-style-map.d.ts +11 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/build-resolved-style-map.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.d.ts +7 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/split-normalized-style-maps.d.ts +6 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/split-normalized-style-maps.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/index.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/{styles.provider.d.ts → styles/styles.provider.d.ts} +3 -5
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -0
- package/lib/typescript/shared/types/animation.types.d.ts +3 -9
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +1 -1
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +2 -4
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts +1 -11
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +37 -80
- package/src/blank-stack/types.ts +7 -4
- package/src/component-stack/navigators/create-component-stack-navigator.tsx +1 -1
- package/src/shared/components/create-boundary-component/components/boundary-target.tsx +45 -0
- package/src/shared/components/create-boundary-component/create-boundary-component.tsx +282 -0
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +2 -7
- package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +6 -10
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +3 -2
- package/src/shared/components/create-boundary-component/index.tsx +16 -252
- package/src/shared/components/create-boundary-component/providers/boundary-owner.provider.tsx +109 -0
- package/src/shared/components/create-transition-aware-component.tsx +33 -5
- package/src/shared/components/overlay/variations/float-overlay.tsx +1 -1
- package/src/shared/components/screen-container/index.tsx +10 -13
- package/src/shared/components/screen-container/layers/backdrop.tsx +4 -4
- package/src/shared/components/screen-container/layers/content.tsx +4 -4
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +6 -4
- package/src/shared/components/screen-container/layers/surface-container.tsx +4 -4
- package/src/shared/constants.ts +1 -0
- package/src/shared/index.ts +0 -1
- package/src/shared/providers/screen/screen-composer.tsx +1 -1
- package/src/shared/providers/screen/styles/helpers/build-resolved-style-map.ts +185 -0
- package/src/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.ts +31 -0
- package/src/shared/providers/screen/styles/helpers/split-normalized-style-maps.ts +44 -0
- package/src/shared/providers/screen/styles/index.tsx +5 -0
- package/src/shared/providers/screen/styles/styles.provider.tsx +173 -0
- package/src/shared/types/animation.types.ts +3 -10
- package/src/shared/types/index.ts +0 -1
- package/src/shared/types/screen.types.ts +2 -4
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +2 -1
- package/src/shared/utils/bounds/helpers/style-composers.ts +11 -0
- package/src/shared/utils/bounds/zoom/build.ts +85 -70
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +0 -45
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +0 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +0 -234
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +0 -50
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles.provider.js.map +0 -1
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js +0 -40
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +0 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +0 -229
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +0 -1
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +0 -44
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +0 -1
- package/lib/module/shared/providers/screen/styles.provider.js.map +0 -1
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +0 -14
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +0 -1
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +0 -32
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +0 -14
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +0 -1
- package/src/shared/components/screen-container/deferred-visibility-host.tsx +0 -44
- package/src/shared/hooks/animation/use-associated-style.ts +0 -297
- package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +0 -61
- package/src/shared/providers/screen/styles.provider.tsx +0 -164
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef, memo, useCallback, useMemo } from "react";
|
|
4
|
+
import Animated, { runOnUI, useAnimatedRef, useAnimatedStyle } from "react-native-reanimated";
|
|
5
|
+
import { NO_STYLES } from "../../constants";
|
|
6
|
+
import { useDescriptorDerivations } from "../../providers/screen/descriptors";
|
|
7
|
+
import { useScreenStyles } from "../../providers/screen/styles";
|
|
8
|
+
import { AnimationStore } from "../../stores/animation.store";
|
|
9
|
+
import { BoundStore } from "../../stores/bounds";
|
|
10
|
+
import { prepareStyleForBounds } from "../../utils/bounds/helpers/styles";
|
|
11
|
+
import { useAutoSourceMeasurement } from "./hooks/use-auto-source-measurement";
|
|
12
|
+
import { useBoundaryMeasureAndStore } from "./hooks/use-boundary-measure-and-store";
|
|
13
|
+
import { useBoundaryPresence } from "./hooks/use-boundary-presence";
|
|
14
|
+
import { useGroupActiveMeasurement } from "./hooks/use-group-active-measurement";
|
|
15
|
+
import { useGroupActiveSourceMeasurement } from "./hooks/use-group-active-source-measurement";
|
|
16
|
+
import { useInitialLayoutHandler } from "./hooks/use-initial-layout-handler";
|
|
17
|
+
import { usePendingDestinationMeasurement } from "./hooks/use-pending-destination-measurement";
|
|
18
|
+
import { usePendingDestinationRetryMeasurement } from "./hooks/use-pending-destination-retry-measurement";
|
|
19
|
+
import { useScrollSettledMeasurement } from "./hooks/use-scroll-settled-measurement";
|
|
20
|
+
import { BoundaryOwnerProvider, useBoundaryOwner } from "./providers/boundary-owner.provider";
|
|
21
|
+
import { buildBoundaryMatchKey } from "./utils/build-boundary-match-key";
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
export function createBoundaryComponent(Wrapped, options = {}) {
|
|
24
|
+
const {
|
|
25
|
+
alreadyAnimated = false
|
|
26
|
+
} = options;
|
|
27
|
+
const AnimatedComponent = alreadyAnimated ? Wrapped : Animated.createAnimatedComponent(Wrapped);
|
|
28
|
+
const Inner = /*#__PURE__*/forwardRef((props, _ref) => {
|
|
29
|
+
const ownerRef = useAnimatedRef();
|
|
30
|
+
const {
|
|
31
|
+
enabled = true,
|
|
32
|
+
group,
|
|
33
|
+
id,
|
|
34
|
+
anchor,
|
|
35
|
+
scaleMode,
|
|
36
|
+
target,
|
|
37
|
+
method,
|
|
38
|
+
style,
|
|
39
|
+
onPress,
|
|
40
|
+
...rest
|
|
41
|
+
} = props;
|
|
42
|
+
const sharedBoundTag = buildBoundaryMatchKey({
|
|
43
|
+
group,
|
|
44
|
+
id
|
|
45
|
+
});
|
|
46
|
+
const {
|
|
47
|
+
previousScreenKey: preferredSourceScreenKey,
|
|
48
|
+
currentScreenKey,
|
|
49
|
+
nextScreenKey,
|
|
50
|
+
ancestorKeys,
|
|
51
|
+
navigatorKey,
|
|
52
|
+
ancestorNavigatorKeys,
|
|
53
|
+
hasConfiguredInterpolator
|
|
54
|
+
} = useDescriptorDerivations();
|
|
55
|
+
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
56
|
+
const hasNextScreen = !!nextScreenKey;
|
|
57
|
+
const shouldUpdateDestination = !hasNextScreen;
|
|
58
|
+
const boundaryConfig = useMemo(() => {
|
|
59
|
+
if (anchor === undefined && scaleMode === undefined && target === undefined && method === undefined) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
anchor,
|
|
64
|
+
scaleMode,
|
|
65
|
+
target,
|
|
66
|
+
method
|
|
67
|
+
};
|
|
68
|
+
}, [anchor, scaleMode, target, method]);
|
|
69
|
+
const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
70
|
+
const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
|
|
71
|
+
const {
|
|
72
|
+
elementStylesMap
|
|
73
|
+
} = useScreenStyles();
|
|
74
|
+
const associatedStyles = useAnimatedStyle(() => {
|
|
75
|
+
"worklet";
|
|
76
|
+
|
|
77
|
+
const baseStyle = elementStylesMap.value[sharedBoundTag]?.style ?? NO_STYLES;
|
|
78
|
+
if ("opacity" in baseStyle) {
|
|
79
|
+
return baseStyle;
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
...baseStyle,
|
|
83
|
+
opacity: 1
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
const associatedStackingStyles = useAnimatedStyle(() => {
|
|
87
|
+
"worklet";
|
|
88
|
+
|
|
89
|
+
const baseStyle = elementStylesMap.value[sharedBoundTag]?.style ?? NO_STYLES;
|
|
90
|
+
return {
|
|
91
|
+
zIndex: baseStyle.zIndex ?? 0,
|
|
92
|
+
elevation: baseStyle.elevation ?? 0
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
const {
|
|
96
|
+
contextValue,
|
|
97
|
+
measuredRef,
|
|
98
|
+
hasActiveTarget
|
|
99
|
+
} = useBoundaryOwner({
|
|
100
|
+
ownerRef,
|
|
101
|
+
associatedTargetStyles: enabled ? associatedStyles : undefined
|
|
102
|
+
});
|
|
103
|
+
const maybeMeasureAndStore = useBoundaryMeasureAndStore({
|
|
104
|
+
enabled,
|
|
105
|
+
sharedBoundTag,
|
|
106
|
+
preferredSourceScreenKey,
|
|
107
|
+
currentScreenKey,
|
|
108
|
+
ancestorKeys,
|
|
109
|
+
navigatorKey,
|
|
110
|
+
ancestorNavigatorKeys,
|
|
111
|
+
isAnimating,
|
|
112
|
+
preparedStyles,
|
|
113
|
+
measuredAnimatedRef: measuredRef
|
|
114
|
+
});
|
|
115
|
+
const shouldRunDestinationEffects = runtimeEnabled && !hasNextScreen;
|
|
116
|
+
|
|
117
|
+
// Register/unregister this boundary in the presence map so source/destination
|
|
118
|
+
// matching can resolve across screens (including ancestor relationships).
|
|
119
|
+
useBoundaryPresence({
|
|
120
|
+
enabled: runtimeEnabled,
|
|
121
|
+
sharedBoundTag,
|
|
122
|
+
currentScreenKey,
|
|
123
|
+
ancestorKeys,
|
|
124
|
+
navigatorKey,
|
|
125
|
+
ancestorNavigatorKeys,
|
|
126
|
+
boundaryConfig
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// On the source screen, capture source bounds when a matching destination
|
|
130
|
+
// appears on the next screen.
|
|
131
|
+
useAutoSourceMeasurement({
|
|
132
|
+
enabled: runtimeEnabled,
|
|
133
|
+
sharedBoundTag,
|
|
134
|
+
nextScreenKey,
|
|
135
|
+
maybeMeasureAndStore
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Primary destination capture: once a pending source link exists for this tag,
|
|
139
|
+
// measure destination bounds and complete the pair.
|
|
140
|
+
usePendingDestinationMeasurement({
|
|
141
|
+
sharedBoundTag,
|
|
142
|
+
enabled: shouldRunDestinationEffects,
|
|
143
|
+
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
144
|
+
maybeMeasureAndStore
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// Reliability fallback: retry destination capture during transition progress
|
|
148
|
+
// when the initial pending-destination attempt happens before layout is ready.
|
|
149
|
+
usePendingDestinationRetryMeasurement({
|
|
150
|
+
sharedBoundTag,
|
|
151
|
+
enabled: shouldRunDestinationEffects,
|
|
152
|
+
currentScreenKey,
|
|
153
|
+
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
154
|
+
animating: isAnimating,
|
|
155
|
+
maybeMeasureAndStore
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
// Grouped boundaries (e.g. paged/detail UIs): re-measure when this boundary
|
|
159
|
+
// becomes the active member so destination bounds stay accurate.
|
|
160
|
+
useGroupActiveMeasurement({
|
|
161
|
+
enabled: runtimeEnabled,
|
|
162
|
+
group,
|
|
163
|
+
id,
|
|
164
|
+
currentScreenKey,
|
|
165
|
+
shouldUpdateDestination,
|
|
166
|
+
maybeMeasureAndStore
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// Source-side grouped retargeting: when an unfocused/source boundary
|
|
170
|
+
// becomes the active member, refresh its snapshot and source link so
|
|
171
|
+
// close transitions do not use stale pre-scroll geometry.
|
|
172
|
+
useGroupActiveSourceMeasurement({
|
|
173
|
+
enabled: runtimeEnabled,
|
|
174
|
+
group,
|
|
175
|
+
id,
|
|
176
|
+
hasNextScreen,
|
|
177
|
+
isAnimating,
|
|
178
|
+
maybeMeasureAndStore
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// While idle on source screens, re-measure after scroll settles so a later
|
|
182
|
+
// close transition starts from up-to-date source geometry.
|
|
183
|
+
useScrollSettledMeasurement({
|
|
184
|
+
enabled: runtimeEnabled,
|
|
185
|
+
group,
|
|
186
|
+
hasNextScreen,
|
|
187
|
+
isAnimating,
|
|
188
|
+
maybeMeasureAndStore
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// Destination mount-time capture path: onLayout schedules a one-time UI-thread
|
|
192
|
+
// initial measurement when transitions are active.
|
|
193
|
+
useInitialLayoutHandler({
|
|
194
|
+
enabled: runtimeEnabled,
|
|
195
|
+
sharedBoundTag,
|
|
196
|
+
currentScreenKey,
|
|
197
|
+
ancestorKeys,
|
|
198
|
+
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
199
|
+
maybeMeasureAndStore
|
|
200
|
+
});
|
|
201
|
+
const handlePress = useCallback((...args) => {
|
|
202
|
+
// Press path has priority: capture source before user onPress/navigation.
|
|
203
|
+
if (group) {
|
|
204
|
+
runOnUI(BoundStore.setGroupActiveId)(group, String(id));
|
|
205
|
+
}
|
|
206
|
+
runOnUI(maybeMeasureAndStore)({
|
|
207
|
+
intent: "capture-source"
|
|
208
|
+
});
|
|
209
|
+
if (typeof onPress === "function") {
|
|
210
|
+
onPress(...args);
|
|
211
|
+
}
|
|
212
|
+
}, [group, id, maybeMeasureAndStore, onPress]);
|
|
213
|
+
const resolvedOnPress = typeof onPress === "function" ? handlePress : undefined;
|
|
214
|
+
return /*#__PURE__*/_jsx(BoundaryOwnerProvider, {
|
|
215
|
+
value: contextValue,
|
|
216
|
+
children: /*#__PURE__*/_jsx(AnimatedComponent, {
|
|
217
|
+
...rest,
|
|
218
|
+
ref: ownerRef,
|
|
219
|
+
style: [style, enabled ? hasActiveTarget ? associatedStackingStyles : associatedStyles : undefined],
|
|
220
|
+
onPress: resolvedOnPress,
|
|
221
|
+
collapsable: false
|
|
222
|
+
})
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
return /*#__PURE__*/memo(Inner);
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=create-boundary-component.js.map
|
package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","memo","useCallback","useMemo","Animated","runOnUI","useAnimatedRef","useAnimatedStyle","NO_STYLES","useDescriptorDerivations","useScreenStyles","AnimationStore","BoundStore","prepareStyleForBounds","useAutoSourceMeasurement","useBoundaryMeasureAndStore","useBoundaryPresence","useGroupActiveMeasurement","useGroupActiveSourceMeasurement","useInitialLayoutHandler","usePendingDestinationMeasurement","usePendingDestinationRetryMeasurement","useScrollSettledMeasurement","BoundaryOwnerProvider","useBoundaryOwner","buildBoundaryMatchKey","jsx","_jsx","createBoundaryComponent","Wrapped","options","alreadyAnimated","AnimatedComponent","createAnimatedComponent","Inner","props","_ref","ownerRef","enabled","group","id","anchor","scaleMode","target","method","style","onPress","rest","sharedBoundTag","previousScreenKey","preferredSourceScreenKey","currentScreenKey","nextScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","hasConfiguredInterpolator","runtimeEnabled","hasNextScreen","shouldUpdateDestination","boundaryConfig","undefined","isAnimating","getValue","preparedStyles","elementStylesMap","associatedStyles","baseStyle","value","opacity","associatedStackingStyles","zIndex","elevation","contextValue","measuredRef","hasActiveTarget","associatedTargetStyles","maybeMeasureAndStore","measuredAnimatedRef","shouldRunDestinationEffects","expectedSourceScreenKey","animating","handlePress","args","setGroupActiveId","String","intent","resolvedOnPress","children","ref","collapsable"],"sourceRoot":"../../../../../src","sources":["shared/components/create-boundary-component/create-boundary-component.tsx"],"mappings":";;AAAA,SAECA,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,OAAO,QACD,OAAO;AAEd,OAAOC,QAAQ,IACdC,OAAO,EACPC,cAAc,EACdC,gBAAgB,QACV,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,wBAAwB,QAAQ,oCAAoC;AAC7E,SAASC,eAAe,QAAQ,+BAA+B;AAC/D,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,qBAAqB,QAAQ,mCAAmC;AACzE,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SAASC,0BAA0B,QAAQ,wCAAwC;AACnF,SAASC,mBAAmB,QAAQ,+BAA+B;AACnE,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,SAASC,+BAA+B,QAAQ,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ignoreList":[]}
|
package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js
CHANGED
|
@@ -129,10 +129,8 @@ export const resolveInitialLayoutMeasurementIntent = params => {
|
|
|
129
129
|
} = params;
|
|
130
130
|
if (!enabled) return null;
|
|
131
131
|
if (!hasSharedBoundTag || hasMeasuredOnLayout) return null;
|
|
132
|
-
if (!isAnyAnimating)
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
return hasPendingLinkFromSource ? ["snapshot-only", "complete-destination"] : "snapshot-only";
|
|
132
|
+
if (!isAnyAnimating) return null;
|
|
133
|
+
return hasPendingLinkFromSource ? "complete-destination" : null;
|
|
136
134
|
};
|
|
137
135
|
export const resolveGroupActiveMeasurementAction = params => {
|
|
138
136
|
"worklet";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getMeasurementIntentFlags","intent","flags","captureSource","completeDestination","refreshSource","refreshDestination","snapshotOnly","intents","Array","isArray","i","length","resolveMeasurementWritePlan","params","hasPendingLink","hasSourceLink","hasDestinationLink","registerSnapshot","writesAny","wantsDestinationWrite","resolveAutoSourceCaptureSignal","enabled","nextScreenKey","tagPresence","direct","count","screenKey","entry","ancestorKeys","includes","resolvePendingDestinationCaptureSignal","resolvedSourceKey","hasPendingLinkFromSource","resolvePendingDestinationRetrySignal","retryCount","maxRetries","isAnimating","progress","retryProgressMax","retryProgressBuckets","Math","floor","resolveInitialLayoutMeasurementIntent","hasSharedBoundTag","hasMeasuredOnLayout","isAnyAnimating","resolveGroupActiveMeasurementAction","isEligible","memberId","activeId","previousActiveId","canFlushGroupActiveMeasurement","shouldTriggerScrollSettledRefresh","group","hasNextScreen","hasSettledSignal","signal","previousSignal"],"sourceRoot":"../../../../../../../src","sources":["shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts"],"mappings":";;AA8BA,OAAO,MAAMA,yBAAyB,GACrCC,MAAyD,IAC7B;EAC5B,SAAS;;EACT,MAAMC,KAA6B,GAAG;IACrCC,aAAa,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MAAM;IACLQ,OAAO;IACPa,UAAU;IACVC,UAAU;IACVC,WAAW;IACXpB,kBAAkB;IAClBqB,QAAQ;IACRC,gBAAgB;IAChBC,oBAAoB;IACpBR,iBAAiB;IACjBC;EACD,CAAC,GAAGnB,MAAM;EAEV,IAAI,CAACQ,OAAO,EAAE,OAAO,CAAC;EACtB,IAAIa,UAAU,IAAIC,UAAU,EAAE,OAAO,CAAC;EACtC,IAAI,CAACC,WAAW,EAAE,OAAO,CAAC;EAC1B,IAAIpB,kBAAkB,EAAE,OAAO,CAAC;EAChC,IAAIqB,QAAQ,IAAI,CAAC,IAAIA,QAAQ,IAAIC,gBAAgB,EAAE,OAAO,CAAC;EAC3D,IAAI,CAACP,iBAAiB,EAAE,OAAO,CAAC;EAChC,IAAI,CAACC,wBAAwB,EAAE,OAAO,CAAC;EAEvC,OAAOQ,IAAI,CAACC,KAAK,CAACJ,QAAQ,GAAGE,oBAAoB,CAAC,GAAG,CAAC;AACvD,CAAC;AAED,OAAO,MAAMG,qCAAqC,GAAI7B,MAMrD,IAA8D;EAC9D,SAAS;;EACT,MAAM;IACLQ,OAAO;IACPsB,iBAAiB;IACjBC,mBAAmB;IACnBC,cAAc;IACdb;EACD,CAAC,GAAGnB,MAAM;EAEV,IAAI,CAACQ,OAAO,EAAE,OAAO,IAAI;EACzB,IAAI,CAACsB,iBAAiB,IAAIC,mBAAmB,EAAE,OAAO,IAAI;
|
|
1
|
+
{"version":3,"names":["getMeasurementIntentFlags","intent","flags","captureSource","completeDestination","refreshSource","refreshDestination","snapshotOnly","intents","Array","isArray","i","length","resolveMeasurementWritePlan","params","hasPendingLink","hasSourceLink","hasDestinationLink","registerSnapshot","writesAny","wantsDestinationWrite","resolveAutoSourceCaptureSignal","enabled","nextScreenKey","tagPresence","direct","count","screenKey","entry","ancestorKeys","includes","resolvePendingDestinationCaptureSignal","resolvedSourceKey","hasPendingLinkFromSource","resolvePendingDestinationRetrySignal","retryCount","maxRetries","isAnimating","progress","retryProgressMax","retryProgressBuckets","Math","floor","resolveInitialLayoutMeasurementIntent","hasSharedBoundTag","hasMeasuredOnLayout","isAnyAnimating","resolveGroupActiveMeasurementAction","isEligible","memberId","activeId","previousActiveId","canFlushGroupActiveMeasurement","shouldTriggerScrollSettledRefresh","group","hasNextScreen","hasSettledSignal","signal","previousSignal"],"sourceRoot":"../../../../../../../src","sources":["shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts"],"mappings":";;AA8BA,OAAO,MAAMA,yBAAyB,GACrCC,MAAyD,IAC7B;EAC5B,SAAS;;EACT,MAAMC,KAA6B,GAAG;IACrCC,aAAa,EAAE,KAAK;IACpBC,mBAAmB,EAAE,KAAK;IAC1BC,aAAa,EAAE,KAAK;IACpBC,kBAAkB,EAAE,KAAK;IACzBC,YAAY,EAAE;EACf,CAAC;EAED,IAAI,CAACN,MAAM,EAAE;IACZ,OAAOC,KAAK;EACb;EAEA,MAAMM,OAAO,GAAGC,KAAK,CAACC,OAAO,CAACT,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC;EAEzD,KAAK,IAAIU,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,OAAO,CAACI,MAAM,EAAED,CAAC,EAAE,EAAE;IACxC,QAAQH,OAAO,CAACG,CAAC,CAAC;MACjB,KAAK,gBAAgB;QACpBT,KAAK,CAACC,aAAa,GAAG,IAAI;QAC1B;MACD,KAAK,sBAAsB;QAC1BD,KAAK,CAACE,mBAAmB,GAAG,IAAI;QAChC;MACD,KAAK,gBAAgB;QACpBF,KAAK,CAACG,aAAa,GAAG,IAAI;QAC1B;MACD,KAAK,qBAAqB;QACzBH,KAAK,CAACI,kBAAkB,GAAG,IAAI;QAC/B;MACD,KAAK,eAAe;QACnBJ,KAAK,CAACK,YAAY,GAAG,IAAI;QACzB;IACF;EACD;EAEA,OAAOL,KAAK;AACb,CAAC;AAED,OAAO,MAAMW,2BAA2B,GAAIC,MAK3C,IAA2B;EAC3B,SAAS;;EACT,MAAM;I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2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { measure } from "react-native-reanimated";
|
|
4
4
|
import useStableCallbackValue from "../../../hooks/use-stable-callback-value";
|
|
5
|
+
import { useLayoutAnchorContext } from "../../../providers/layout-anchor.provider";
|
|
5
6
|
import { BoundStore } from "../../../stores/bounds";
|
|
6
7
|
import { applyMeasuredBoundsWrites } from "../../../stores/bounds/helpers/apply-measured-bounds-writes";
|
|
7
8
|
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
@@ -23,9 +24,9 @@ export const useBoundaryMeasureAndStore = params => {
|
|
|
23
24
|
ancestorNavigatorKeys,
|
|
24
25
|
isAnimating,
|
|
25
26
|
preparedStyles,
|
|
26
|
-
|
|
27
|
-
layoutAnchor
|
|
27
|
+
measuredAnimatedRef
|
|
28
28
|
} = params;
|
|
29
|
+
const layoutAnchor = useLayoutAnchorContext();
|
|
29
30
|
return useStableCallbackValue(({
|
|
30
31
|
intent
|
|
31
32
|
} = {}) => {
|
|
@@ -66,7 +67,7 @@ export const useBoundaryMeasureAndStore = params => {
|
|
|
66
67
|
if (!writePlan.writesAny) {
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
|
-
const measured = measure(
|
|
70
|
+
const measured = measure(measuredAnimatedRef);
|
|
70
71
|
if (!measured) return;
|
|
71
72
|
const correctedMeasured = layoutAnchor ? layoutAnchor.correctMeasurement(measured) : measured;
|
|
72
73
|
const destinationInViewport = !writePlan.wantsDestinationWrite || !layoutAnchor || !layoutAnchor.isMeasurementInViewport || layoutAnchor.isMeasurementInViewport(correctedMeasured);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["measure","useStableCallbackValue","BoundStore","applyMeasuredBoundsWrites","resolvePendingSourceKey","getMeasurementIntentFlags","resolveMeasurementWritePlan","SNAPSHOT_EPSILON","areMeasurementsEqual","a","b","Math","abs","x","y","pageX","pageY","width","height","useBoundaryMeasureAndStore","params","enabled","sharedBoundTag","preferredSourceScreenKey","currentScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","isAnimating","preparedStyles","
|
|
1
|
+
{"version":3,"names":["measure","useStableCallbackValue","useLayoutAnchorContext","BoundStore","applyMeasuredBoundsWrites","resolvePendingSourceKey","getMeasurementIntentFlags","resolveMeasurementWritePlan","SNAPSHOT_EPSILON","areMeasurementsEqual","a","b","Math","abs","x","y","pageX","pageY","width","height","useBoundaryMeasureAndStore","params","enabled","sharedBoundTag","preferredSourceScreenKey","currentScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","isAnimating","preparedStyles","measuredAnimatedRef","layoutAnchor","intent","intents","expectedSourceScreenKey","undefined","captureSource","get","existing","getSnapshot","measured","bounds","shouldSetSource","hasPendingLink","hasPendingLinkFromSource","hasSourceLink","hasDestinationLink","writePlan","writesAny","correctedMeasured","correctMeasurement","destinationInViewport","wantsDestinationWrite","isMeasurementInViewport","refreshSource","existingSnapshot","hasSnapshotChanged","shouldWriteSnapshot","registerSnapshot","completeDestination","refreshDestination","shouldRegisterSnapshot","shouldUpdateSource","shouldUpdateDestination","shouldSetDestination"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts"],"mappings":";;AACA,SAGCA,OAAO,QAGD,yBAAyB;AAChC,OAAOC,sBAAsB,MAAM,0CAA0C;AAC7E,SAASC,sBAAsB,QAAQ,2CAA2C;AAClF,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,yBAAyB,QAAQ,6DAA6D;AACvG,SAASC,uBAAuB,QAAQ,uCAAuC;AAE/E,SACCC,yBAAyB,EACzBC,2BAA2B,QACrB,6BAA6B;AAEpC,MAAMC,gBAAgB,GAAG,GAAG;AAE5B,MAAMC,oBAAoB,GAAGA,CAC5BC,CAAqB,EACrBC,CAAqB,KACR;EACb,SAAS;;EAET,OACCC,IAAI,CAACC,GAAG,CAACH,CAAC,CAACI,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC,IAAIN,gBAAgB,IACv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IACjB,CAAC/C,oBAAoB,CAAC+C,gBAAgB,CAACd,MAAM,EAAEQ,iBAAiB,CAAC;IAClE,MAAMQ,mBAAmB,GACxBD,kBAAkB,KACjBT,SAAS,CAACW,gBAAgB,IAC1BX,SAAS,CAACX,aAAa,IACvBW,SAAS,CAACY,mBAAmB,IAC7BZ,SAAS,CAACO,aAAa,IACvBP,SAAS,CAACa,kBAAkB,CAAC;IAE/BzD,yBAAyB,CAAC;MACzBmB,cAAc;MACdE,gBAAgB;MAChBgB,QAAQ,EAAES,iBAAiB;MAC3BpB,cAAc;MACdJ,YAAY;MACZC,YAAY;MACZC,qBAAqB;MACrBO,uBAAuB;MACvB2B,sBAAsB,EAAEJ,mBAAmB;MAC3Cf,eAAe,EAAEK,SAAS,CAACX,aAAa;MACxC0B,kBAAkB,EAAEf,SAAS,CAACO,aAAa,IAAIE,kBAAkB;MACjEO,uBAAuB,EACtBhB,SAAS,CAACa,kBAAkB,IAC5BT,qBAAqB,IACrBK,kBAAkB;MACnBQ,oBAAoB,EACnBjB,SAAS,CAACY,mBAAmB,IAAIR;IACnC,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useAnimatedReaction, useSharedValue } from "react-native-reanimated";
|
|
4
|
+
import { AnimationStore } from "../../../stores/animation.store";
|
|
4
5
|
import { BoundStore } from "../../../stores/bounds";
|
|
5
6
|
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
6
7
|
import { resolvePendingDestinationRetrySignal } from "./helpers/measurement-rules";
|
|
@@ -10,10 +11,10 @@ export const usePendingDestinationRetryMeasurement = params => {
|
|
|
10
11
|
enabled,
|
|
11
12
|
currentScreenKey,
|
|
12
13
|
expectedSourceScreenKey,
|
|
13
|
-
progress,
|
|
14
14
|
animating,
|
|
15
15
|
maybeMeasureAndStore
|
|
16
16
|
} = params;
|
|
17
|
+
const progress = AnimationStore.getValue(currentScreenKey, "progress");
|
|
17
18
|
const retryCount = useSharedValue(0);
|
|
18
19
|
const MAX_RETRIES = 4;
|
|
19
20
|
const RETRY_PROGRESS_BUCKETS = 8;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useAnimatedReaction","useSharedValue","BoundStore","resolvePendingSourceKey","resolvePendingDestinationRetrySignal","usePendingDestinationRetryMeasurement","params","sharedBoundTag","enabled","currentScreenKey","expectedSourceScreenKey","
|
|
1
|
+
{"version":3,"names":["useAnimatedReaction","useSharedValue","AnimationStore","BoundStore","resolvePendingSourceKey","resolvePendingDestinationRetrySignal","usePendingDestinationRetryMeasurement","params","sharedBoundTag","enabled","currentScreenKey","expectedSourceScreenKey","animating","maybeMeasureAndStore","progress","getValue","retryCount","MAX_RETRIES","RETRY_PROGRESS_BUCKETS","RETRY_PROGRESS_MAX","resolvedSourceKey","get","maxRetries","isAnimating","hasDestinationLink","retryProgressMax","retryProgressBuckets","hasPendingLinkFromSource","captureSignal","set","intent"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts"],"mappings":";;AAAA,SAECA,mBAAmB,EACnBC,cAAc,QACR,yBAAyB;AAChC,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,uBAAuB,QAAQ,uCAAuC;AAE/E,SAASC,oCAAoC,QAAQ,6BAA6B;AAElF,OAAO,MAAMC,qCAAqC,GAAIC,MAOrD,IAAK;EACL,MAAM;IACLC,cAAc;IACdC,OAAO;IACPC,gBAAgB;IAChBC,uBAAuB;IACvBC,SAAS;IACTC;EACD,CAAC,GAAGN,MAAM;EAEV,MAAMO,QAAQ,GAAGZ,cAAc,CAACa,QAAQ,CAACL,gBAAgB,EAAE,UAAU,CAAC;EAEtE,MAAMM,UAAU,GAAGf,cAAc,CAAC,CAAC,CAAC;EACpC,MAAMgB,WAAW,GAAG,CAAC;EACr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
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { Pressable
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { BoundStore } from "../../stores/bounds";
|
|
11
|
-
import { prepareStyleForBounds } from "../../utils/bounds/helpers/styles";
|
|
12
|
-
import { useAutoSourceMeasurement } from "./hooks/use-auto-source-measurement";
|
|
13
|
-
import { useBoundaryMeasureAndStore } from "./hooks/use-boundary-measure-and-store";
|
|
14
|
-
import { useBoundaryPresence } from "./hooks/use-boundary-presence";
|
|
15
|
-
import { useGroupActiveMeasurement } from "./hooks/use-group-active-measurement";
|
|
16
|
-
import { useGroupActiveSourceMeasurement } from "./hooks/use-group-active-source-measurement";
|
|
17
|
-
import { useInitialLayoutHandler } from "./hooks/use-initial-layout-handler";
|
|
18
|
-
import { usePendingDestinationMeasurement } from "./hooks/use-pending-destination-measurement";
|
|
19
|
-
import { usePendingDestinationRetryMeasurement } from "./hooks/use-pending-destination-retry-measurement";
|
|
20
|
-
import { useScrollSettledMeasurement } from "./hooks/use-scroll-settled-measurement";
|
|
21
|
-
import { buildBoundaryMatchKey } from "./utils/build-boundary-match-key";
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
const setGroupSelectionOnUI = (group, id) => {
|
|
24
|
-
"worklet";
|
|
25
|
-
|
|
26
|
-
BoundStore.setGroupActiveId(group, id);
|
|
27
|
-
};
|
|
28
|
-
export function createBoundaryComponent(Wrapped, options = {}) {
|
|
29
|
-
const {
|
|
30
|
-
alreadyAnimated = false
|
|
31
|
-
} = options;
|
|
32
|
-
const AnimatedComponent = alreadyAnimated ? Wrapped : Animated.createAnimatedComponent(Wrapped);
|
|
33
|
-
const Inner = /*#__PURE__*/forwardRef((props, _ref) => {
|
|
34
|
-
const {
|
|
35
|
-
enabled = true,
|
|
36
|
-
group,
|
|
37
|
-
id,
|
|
38
|
-
anchor,
|
|
39
|
-
scaleMode,
|
|
40
|
-
target,
|
|
41
|
-
method,
|
|
42
|
-
style,
|
|
43
|
-
onPress,
|
|
44
|
-
...rest
|
|
45
|
-
} = props;
|
|
46
|
-
const sharedBoundTag = buildBoundaryMatchKey({
|
|
47
|
-
group,
|
|
48
|
-
id
|
|
49
|
-
});
|
|
50
|
-
const animatedRef = useAnimatedRef();
|
|
51
|
-
const {
|
|
52
|
-
previousScreenKey: preferredSourceScreenKey,
|
|
53
|
-
currentScreenKey,
|
|
54
|
-
nextScreenKey,
|
|
55
|
-
ancestorKeys,
|
|
56
|
-
navigatorKey,
|
|
57
|
-
ancestorNavigatorKeys,
|
|
58
|
-
hasConfiguredInterpolator
|
|
59
|
-
} = useDescriptorDerivations();
|
|
60
|
-
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
61
|
-
const hasNextScreen = !!nextScreenKey;
|
|
62
|
-
const shouldUpdateDestination = !hasNextScreen;
|
|
63
|
-
const layoutAnchor = useLayoutAnchorContext();
|
|
64
|
-
const boundaryConfig = useMemo(() => {
|
|
65
|
-
if (anchor === undefined && scaleMode === undefined && target === undefined && method === undefined) {
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
return {
|
|
69
|
-
anchor,
|
|
70
|
-
scaleMode,
|
|
71
|
-
target,
|
|
72
|
-
method
|
|
73
|
-
};
|
|
74
|
-
}, [anchor, scaleMode, target, method]);
|
|
75
|
-
const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
76
|
-
const progress = AnimationStore.getValue(currentScreenKey, "progress");
|
|
77
|
-
const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
|
|
78
|
-
const {
|
|
79
|
-
associatedStyles
|
|
80
|
-
} = useAssociatedStyles({
|
|
81
|
-
id: sharedBoundTag,
|
|
82
|
-
resetTransformOnUnset: true
|
|
83
|
-
});
|
|
84
|
-
const maybeMeasureAndStore = useBoundaryMeasureAndStore({
|
|
85
|
-
enabled,
|
|
86
|
-
sharedBoundTag,
|
|
87
|
-
preferredSourceScreenKey,
|
|
88
|
-
currentScreenKey,
|
|
89
|
-
ancestorKeys,
|
|
90
|
-
navigatorKey,
|
|
91
|
-
ancestorNavigatorKeys,
|
|
92
|
-
isAnimating,
|
|
93
|
-
preparedStyles,
|
|
94
|
-
animatedRef,
|
|
95
|
-
layoutAnchor
|
|
96
|
-
});
|
|
97
|
-
const shouldRunDestinationEffects = runtimeEnabled && !hasNextScreen;
|
|
98
|
-
|
|
99
|
-
// Register/unregister this boundary in the presence map so source/destination
|
|
100
|
-
// matching can resolve across screens (including ancestor relationships).
|
|
101
|
-
useBoundaryPresence({
|
|
102
|
-
enabled: runtimeEnabled,
|
|
103
|
-
sharedBoundTag,
|
|
104
|
-
currentScreenKey,
|
|
105
|
-
ancestorKeys,
|
|
106
|
-
navigatorKey,
|
|
107
|
-
ancestorNavigatorKeys,
|
|
108
|
-
boundaryConfig
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// On the source screen, capture source bounds when a matching destination
|
|
112
|
-
// appears on the next screen.
|
|
113
|
-
useAutoSourceMeasurement({
|
|
114
|
-
enabled: runtimeEnabled,
|
|
115
|
-
sharedBoundTag,
|
|
116
|
-
nextScreenKey,
|
|
117
|
-
maybeMeasureAndStore
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
// Primary destination capture: once a pending source link exists for this tag,
|
|
121
|
-
// measure destination bounds and complete the pair.
|
|
122
|
-
usePendingDestinationMeasurement({
|
|
123
|
-
sharedBoundTag,
|
|
124
|
-
enabled: shouldRunDestinationEffects,
|
|
125
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
126
|
-
maybeMeasureAndStore
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
// Reliability fallback: retry destination capture during transition progress
|
|
130
|
-
// when the initial pending-destination attempt happens before layout is ready.
|
|
131
|
-
usePendingDestinationRetryMeasurement({
|
|
132
|
-
sharedBoundTag,
|
|
133
|
-
enabled: shouldRunDestinationEffects,
|
|
134
|
-
currentScreenKey,
|
|
135
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
136
|
-
progress,
|
|
137
|
-
animating: isAnimating,
|
|
138
|
-
maybeMeasureAndStore
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// Grouped boundaries (e.g. paged/detail UIs): re-measure when this boundary
|
|
142
|
-
// becomes the active member so destination bounds stay accurate.
|
|
143
|
-
useGroupActiveMeasurement({
|
|
144
|
-
enabled: runtimeEnabled,
|
|
145
|
-
group,
|
|
146
|
-
id,
|
|
147
|
-
currentScreenKey,
|
|
148
|
-
shouldUpdateDestination,
|
|
149
|
-
maybeMeasureAndStore
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
// Source-side grouped retargeting: when an unfocused/source boundary
|
|
153
|
-
// becomes the active member, refresh its snapshot and source link so
|
|
154
|
-
// close transitions do not use stale pre-scroll geometry.
|
|
155
|
-
useGroupActiveSourceMeasurement({
|
|
156
|
-
enabled: runtimeEnabled,
|
|
157
|
-
group,
|
|
158
|
-
id,
|
|
159
|
-
hasNextScreen,
|
|
160
|
-
isAnimating,
|
|
161
|
-
maybeMeasureAndStore
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
// While idle on source screens, re-measure after scroll settles so a later
|
|
165
|
-
// close transition starts from up-to-date source geometry.
|
|
166
|
-
useScrollSettledMeasurement({
|
|
167
|
-
enabled: runtimeEnabled,
|
|
168
|
-
group,
|
|
169
|
-
hasNextScreen,
|
|
170
|
-
isAnimating,
|
|
171
|
-
maybeMeasureAndStore
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
// Destination mount-time capture path: onLayout schedules a one-time UI-thread
|
|
175
|
-
// initial measurement when transitions are active.
|
|
176
|
-
useInitialLayoutHandler({
|
|
177
|
-
enabled: runtimeEnabled,
|
|
178
|
-
sharedBoundTag,
|
|
179
|
-
currentScreenKey,
|
|
180
|
-
ancestorKeys,
|
|
181
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
182
|
-
maybeMeasureAndStore
|
|
183
|
-
});
|
|
184
|
-
const handlePress = useCallback((...args) => {
|
|
185
|
-
// Press path has priority: capture source before user onPress/navigation.
|
|
186
|
-
if (group) {
|
|
187
|
-
runOnUI(setGroupSelectionOnUI)(group, String(id));
|
|
188
|
-
}
|
|
189
|
-
runOnUI(maybeMeasureAndStore)({
|
|
190
|
-
intent: "capture-source"
|
|
191
|
-
});
|
|
192
|
-
if (typeof onPress === "function") {
|
|
193
|
-
onPress(...args);
|
|
194
|
-
}
|
|
195
|
-
}, [group, id, maybeMeasureAndStore, onPress]);
|
|
196
|
-
const resolvedOnPress = typeof onPress === "function" ? handlePress : undefined;
|
|
197
|
-
return /*#__PURE__*/_jsx(AnimatedComponent, {
|
|
198
|
-
...rest,
|
|
199
|
-
ref: animatedRef,
|
|
200
|
-
style: [style, enabled ? associatedStyles : undefined],
|
|
201
|
-
onPress: resolvedOnPress,
|
|
202
|
-
collapsable: false
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
return /*#__PURE__*/memo(Inner);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// Pre-built boundary component variants
|
|
209
|
-
const BoundaryView = createBoundaryComponent(RNView);
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { Pressable } from "react-native-gesture-handler";
|
|
5
|
+
import { BoundaryTarget } from "./components/boundary-target";
|
|
6
|
+
import { createBoundaryComponent } from "./create-boundary-component";
|
|
7
|
+
export { createBoundaryComponent };
|
|
8
|
+
const BoundaryView = createBoundaryComponent(View);
|
|
9
|
+
const BoundaryTrigger = createBoundaryComponent(Pressable);
|
|
210
10
|
BoundaryView.displayName = "Transition.Boundary.View";
|
|
211
|
-
|
|
212
|
-
|
|
11
|
+
BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
|
|
12
|
+
BoundaryTarget.displayName = "Transition.Boundary.Target";
|
|
213
13
|
|
|
214
14
|
/**
|
|
215
15
|
* Shared-boundary components.
|
|
@@ -219,19 +19,22 @@ BoundaryPressable.displayName = "Transition.Boundary.Pressable";
|
|
|
219
19
|
* 2. Destination screen captures bounds for the same tag.
|
|
220
20
|
* 3. The link is updated as layout changes (group-active + scroll-settled paths).
|
|
221
21
|
*
|
|
222
|
-
*
|
|
223
|
-
* - When a boundary has `onPress` (typically `Boundary.
|
|
22
|
+
* Trigger behavior:
|
|
23
|
+
* - When a boundary has `onPress` (typically `Boundary.Trigger`), source
|
|
224
24
|
* measurement runs before the user callback. This gives navigation transitions
|
|
225
25
|
* fresh source geometry on the first frame.
|
|
226
26
|
*
|
|
227
27
|
* Use:
|
|
228
28
|
* - `Boundary.View` for passive/shared elements.
|
|
229
|
-
* - `Boundary.
|
|
29
|
+
* - `Boundary.Trigger` for tappable elements that start navigation.
|
|
30
|
+
* - `Boundary.Target` to measure a nested descendant instead of the owner.
|
|
230
31
|
*/
|
|
231
32
|
export const Boundary = {
|
|
232
33
|
/** Passive boundary wrapper (no built-in press semantics). */
|
|
233
34
|
View: BoundaryView,
|
|
234
35
|
/** Pressable boundary wrapper with press-priority source capture. */
|
|
235
|
-
|
|
36
|
+
Trigger: BoundaryTrigger,
|
|
37
|
+
/** Optional nested measurement override inside a boundary owner. */
|
|
38
|
+
Target: BoundaryTarget
|
|
236
39
|
};
|
|
237
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["View","Pressable","BoundaryTarget","createBoundaryComponent","BoundaryView","BoundaryTrigger","displayName","Boundary","Trigger","Target"],"sourceRoot":"../../../../../src","sources":["shared/components/create-boundary-component/index.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AACnC,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,uBAAuB,QAAQ,6BAA6B;AAErE,SAASA,uBAAuB;AAEhC,MAAMC,YAAY,GAAGD,uBAAuB,CAACH,IAAI,CAAC;AAClD,MAAMK,eAAe,GAAGF,uBAAuB,CAACF,SAAS,CAAC;AAC1DG,YAAY,CAACE,WAAW,GAAG,0BAA0B;AACrDD,eAAe,CAACC,WAAW,GAAG,6BAA6B;AAC3DJ,cAAc,CAACI,WAAW,GAAG,4BAA4B;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG;EACvB;EACAP,IAAI,EAAEI,YAAY;EAClB;EACAI,OAAO,EAAEH,eAAe;EACxB;EACAI,MAAM,EAAEP;AACT,CAAC","ignoreList":[]}
|