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,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createBoundaryComponent = createBoundaryComponent;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
9
|
+
var _constants = require("../../constants");
|
|
10
|
+
var _descriptors = require("../../providers/screen/descriptors");
|
|
11
|
+
var _styles = require("../../providers/screen/styles");
|
|
12
|
+
var _animation = require("../../stores/animation.store");
|
|
13
|
+
var _bounds = require("../../stores/bounds");
|
|
14
|
+
var _styles2 = require("../../utils/bounds/helpers/styles");
|
|
15
|
+
var _useAutoSourceMeasurement = require("./hooks/use-auto-source-measurement");
|
|
16
|
+
var _useBoundaryMeasureAndStore = require("./hooks/use-boundary-measure-and-store");
|
|
17
|
+
var _useBoundaryPresence = require("./hooks/use-boundary-presence");
|
|
18
|
+
var _useGroupActiveMeasurement = require("./hooks/use-group-active-measurement");
|
|
19
|
+
var _useGroupActiveSourceMeasurement = require("./hooks/use-group-active-source-measurement");
|
|
20
|
+
var _useInitialLayoutHandler = require("./hooks/use-initial-layout-handler");
|
|
21
|
+
var _usePendingDestinationMeasurement = require("./hooks/use-pending-destination-measurement");
|
|
22
|
+
var _usePendingDestinationRetryMeasurement = require("./hooks/use-pending-destination-retry-measurement");
|
|
23
|
+
var _useScrollSettledMeasurement = require("./hooks/use-scroll-settled-measurement");
|
|
24
|
+
var _boundaryOwner = require("./providers/boundary-owner.provider");
|
|
25
|
+
var _buildBoundaryMatchKey = require("./utils/build-boundary-match-key");
|
|
26
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
28
|
+
function createBoundaryComponent(Wrapped, options = {}) {
|
|
29
|
+
const {
|
|
30
|
+
alreadyAnimated = false
|
|
31
|
+
} = options;
|
|
32
|
+
const AnimatedComponent = alreadyAnimated ? Wrapped : _reactNativeReanimated.default.createAnimatedComponent(Wrapped);
|
|
33
|
+
const Inner = /*#__PURE__*/(0, _react.forwardRef)((props, _ref) => {
|
|
34
|
+
const ownerRef = (0, _reactNativeReanimated.useAnimatedRef)();
|
|
35
|
+
const {
|
|
36
|
+
enabled = true,
|
|
37
|
+
group,
|
|
38
|
+
id,
|
|
39
|
+
anchor,
|
|
40
|
+
scaleMode,
|
|
41
|
+
target,
|
|
42
|
+
method,
|
|
43
|
+
style,
|
|
44
|
+
onPress,
|
|
45
|
+
...rest
|
|
46
|
+
} = props;
|
|
47
|
+
const sharedBoundTag = (0, _buildBoundaryMatchKey.buildBoundaryMatchKey)({
|
|
48
|
+
group,
|
|
49
|
+
id
|
|
50
|
+
});
|
|
51
|
+
const {
|
|
52
|
+
previousScreenKey: preferredSourceScreenKey,
|
|
53
|
+
currentScreenKey,
|
|
54
|
+
nextScreenKey,
|
|
55
|
+
ancestorKeys,
|
|
56
|
+
navigatorKey,
|
|
57
|
+
ancestorNavigatorKeys,
|
|
58
|
+
hasConfiguredInterpolator
|
|
59
|
+
} = (0, _descriptors.useDescriptorDerivations)();
|
|
60
|
+
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
61
|
+
const hasNextScreen = !!nextScreenKey;
|
|
62
|
+
const shouldUpdateDestination = !hasNextScreen;
|
|
63
|
+
const boundaryConfig = (0, _react.useMemo)(() => {
|
|
64
|
+
if (anchor === undefined && scaleMode === undefined && target === undefined && method === undefined) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
anchor,
|
|
69
|
+
scaleMode,
|
|
70
|
+
target,
|
|
71
|
+
method
|
|
72
|
+
};
|
|
73
|
+
}, [anchor, scaleMode, target, method]);
|
|
74
|
+
const isAnimating = _animation.AnimationStore.getValue(currentScreenKey, "animating");
|
|
75
|
+
const preparedStyles = (0, _react.useMemo)(() => (0, _styles2.prepareStyleForBounds)(style), [style]);
|
|
76
|
+
const {
|
|
77
|
+
elementStylesMap
|
|
78
|
+
} = (0, _styles.useScreenStyles)();
|
|
79
|
+
const associatedStyles = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
|
|
80
|
+
"worklet";
|
|
81
|
+
|
|
82
|
+
const baseStyle = elementStylesMap.value[sharedBoundTag]?.style ?? _constants.NO_STYLES;
|
|
83
|
+
if ("opacity" in baseStyle) {
|
|
84
|
+
return baseStyle;
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
...baseStyle,
|
|
88
|
+
opacity: 1
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
const associatedStackingStyles = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
|
|
92
|
+
"worklet";
|
|
93
|
+
|
|
94
|
+
const baseStyle = elementStylesMap.value[sharedBoundTag]?.style ?? _constants.NO_STYLES;
|
|
95
|
+
return {
|
|
96
|
+
zIndex: baseStyle.zIndex ?? 0,
|
|
97
|
+
elevation: baseStyle.elevation ?? 0
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
const {
|
|
101
|
+
contextValue,
|
|
102
|
+
measuredRef,
|
|
103
|
+
hasActiveTarget
|
|
104
|
+
} = (0, _boundaryOwner.useBoundaryOwner)({
|
|
105
|
+
ownerRef,
|
|
106
|
+
associatedTargetStyles: enabled ? associatedStyles : undefined
|
|
107
|
+
});
|
|
108
|
+
const maybeMeasureAndStore = (0, _useBoundaryMeasureAndStore.useBoundaryMeasureAndStore)({
|
|
109
|
+
enabled,
|
|
110
|
+
sharedBoundTag,
|
|
111
|
+
preferredSourceScreenKey,
|
|
112
|
+
currentScreenKey,
|
|
113
|
+
ancestorKeys,
|
|
114
|
+
navigatorKey,
|
|
115
|
+
ancestorNavigatorKeys,
|
|
116
|
+
isAnimating,
|
|
117
|
+
preparedStyles,
|
|
118
|
+
measuredAnimatedRef: measuredRef
|
|
119
|
+
});
|
|
120
|
+
const shouldRunDestinationEffects = runtimeEnabled && !hasNextScreen;
|
|
121
|
+
|
|
122
|
+
// Register/unregister this boundary in the presence map so source/destination
|
|
123
|
+
// matching can resolve across screens (including ancestor relationships).
|
|
124
|
+
(0, _useBoundaryPresence.useBoundaryPresence)({
|
|
125
|
+
enabled: runtimeEnabled,
|
|
126
|
+
sharedBoundTag,
|
|
127
|
+
currentScreenKey,
|
|
128
|
+
ancestorKeys,
|
|
129
|
+
navigatorKey,
|
|
130
|
+
ancestorNavigatorKeys,
|
|
131
|
+
boundaryConfig
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// On the source screen, capture source bounds when a matching destination
|
|
135
|
+
// appears on the next screen.
|
|
136
|
+
(0, _useAutoSourceMeasurement.useAutoSourceMeasurement)({
|
|
137
|
+
enabled: runtimeEnabled,
|
|
138
|
+
sharedBoundTag,
|
|
139
|
+
nextScreenKey,
|
|
140
|
+
maybeMeasureAndStore
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// Primary destination capture: once a pending source link exists for this tag,
|
|
144
|
+
// measure destination bounds and complete the pair.
|
|
145
|
+
(0, _usePendingDestinationMeasurement.usePendingDestinationMeasurement)({
|
|
146
|
+
sharedBoundTag,
|
|
147
|
+
enabled: shouldRunDestinationEffects,
|
|
148
|
+
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
149
|
+
maybeMeasureAndStore
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// Reliability fallback: retry destination capture during transition progress
|
|
153
|
+
// when the initial pending-destination attempt happens before layout is ready.
|
|
154
|
+
(0, _usePendingDestinationRetryMeasurement.usePendingDestinationRetryMeasurement)({
|
|
155
|
+
sharedBoundTag,
|
|
156
|
+
enabled: shouldRunDestinationEffects,
|
|
157
|
+
currentScreenKey,
|
|
158
|
+
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
159
|
+
animating: isAnimating,
|
|
160
|
+
maybeMeasureAndStore
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// Grouped boundaries (e.g. paged/detail UIs): re-measure when this boundary
|
|
164
|
+
// becomes the active member so destination bounds stay accurate.
|
|
165
|
+
(0, _useGroupActiveMeasurement.useGroupActiveMeasurement)({
|
|
166
|
+
enabled: runtimeEnabled,
|
|
167
|
+
group,
|
|
168
|
+
id,
|
|
169
|
+
currentScreenKey,
|
|
170
|
+
shouldUpdateDestination,
|
|
171
|
+
maybeMeasureAndStore
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// Source-side grouped retargeting: when an unfocused/source boundary
|
|
175
|
+
// becomes the active member, refresh its snapshot and source link so
|
|
176
|
+
// close transitions do not use stale pre-scroll geometry.
|
|
177
|
+
(0, _useGroupActiveSourceMeasurement.useGroupActiveSourceMeasurement)({
|
|
178
|
+
enabled: runtimeEnabled,
|
|
179
|
+
group,
|
|
180
|
+
id,
|
|
181
|
+
hasNextScreen,
|
|
182
|
+
isAnimating,
|
|
183
|
+
maybeMeasureAndStore
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// While idle on source screens, re-measure after scroll settles so a later
|
|
187
|
+
// close transition starts from up-to-date source geometry.
|
|
188
|
+
(0, _useScrollSettledMeasurement.useScrollSettledMeasurement)({
|
|
189
|
+
enabled: runtimeEnabled,
|
|
190
|
+
group,
|
|
191
|
+
hasNextScreen,
|
|
192
|
+
isAnimating,
|
|
193
|
+
maybeMeasureAndStore
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
// Destination mount-time capture path: onLayout schedules a one-time UI-thread
|
|
197
|
+
// initial measurement when transitions are active.
|
|
198
|
+
(0, _useInitialLayoutHandler.useInitialLayoutHandler)({
|
|
199
|
+
enabled: runtimeEnabled,
|
|
200
|
+
sharedBoundTag,
|
|
201
|
+
currentScreenKey,
|
|
202
|
+
ancestorKeys,
|
|
203
|
+
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
204
|
+
maybeMeasureAndStore
|
|
205
|
+
});
|
|
206
|
+
const handlePress = (0, _react.useCallback)((...args) => {
|
|
207
|
+
// Press path has priority: capture source before user onPress/navigation.
|
|
208
|
+
if (group) {
|
|
209
|
+
(0, _reactNativeReanimated.runOnUI)(_bounds.BoundStore.setGroupActiveId)(group, String(id));
|
|
210
|
+
}
|
|
211
|
+
(0, _reactNativeReanimated.runOnUI)(maybeMeasureAndStore)({
|
|
212
|
+
intent: "capture-source"
|
|
213
|
+
});
|
|
214
|
+
if (typeof onPress === "function") {
|
|
215
|
+
onPress(...args);
|
|
216
|
+
}
|
|
217
|
+
}, [group, id, maybeMeasureAndStore, onPress]);
|
|
218
|
+
const resolvedOnPress = typeof onPress === "function" ? handlePress : undefined;
|
|
219
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_boundaryOwner.BoundaryOwnerProvider, {
|
|
220
|
+
value: contextValue,
|
|
221
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedComponent, {
|
|
222
|
+
...rest,
|
|
223
|
+
ref: ownerRef,
|
|
224
|
+
style: [style, enabled ? hasActiveTarget ? associatedStackingStyles : associatedStyles : undefined],
|
|
225
|
+
onPress: resolvedOnPress,
|
|
226
|
+
collapsable: false
|
|
227
|
+
})
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
return /*#__PURE__*/(0, _react.memo)(Inner);
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=create-boundary-component.js.map
|
package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNativeReanimated","_interopRequireWildcard","_constants","_descriptors","_styles","_animation","_bounds","_styles2","_useAutoSourceMeasurement","_useBoundaryMeasureAndStore","_useBoundaryPresence","_useGroupActiveMeasurement","_useGroupActiveSourceMeasurement","_useInitialLayoutHandler","_usePendingDestinationMeasurement","_usePendingDestinationRetryMeasurement","_useScrollSettledMeasurement","_boundaryOwner","_buildBoundaryMatchKey","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","createBoundaryComponent","Wrapped","options","alreadyAnimated","AnimatedComponent","Animated","createAnimatedComponent","Inner","forwardRef","props","_ref","ownerRef","useAnimatedRef","enabled","group","id","anchor","scaleMode","target","method","style","onPress","rest","sharedBoundTag","buildBoundaryMatchKey","previousScreenKey","preferredSourceScreenKey","currentScreenKey","nextScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","hasConfiguredInterpolator","useDescriptorDerivations","runtimeEnabled","hasNextScreen","shouldUpdateDestination","boundaryConfig","useMemo","undefined","isAnimating","AnimationStore","getValue","preparedStyles","prepareStyleForBounds","elementStylesMap","useScreenStyles","associatedStyles","useAnimatedStyle","baseStyle","value","NO_STYLES","opacity","associatedStackingStyles","zIndex","elevation","contextValue","measuredRef","hasActiveTarget","useBoundaryOwner","associatedTargetStyles","maybeMeasureAndStore","useBoundaryMeasureAndStore","measuredAnimatedRef","shouldRunDestinationEffects","useBoundaryPresence","useAutoSourceMeasurement","usePendingDestinationMeasurement","expectedSourceScreenKey","usePendingDestinationRetryMeasurement","animating","useGroupActiveMeasurement","useGroupActiveSourceMeasurement","useScrollSettledMeasurement","useInitialLayoutHandler","handlePress","useCallback","args","runOnUI","BoundStore","setGroupActiveId","String","intent","resolvedOnPress","jsx","BoundaryOwnerProvider","children","ref","collapsable","memo"],"sourceRoot":"../../../../../src","sources":["shared/components/create-boundary-component/create-boundary-component.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,sBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,yBAAA,GAAAT,OAAA;AACA,IAAAU,2BAAA,GAAAV,OAAA;AACA,IAAAW,oBAAA,GAAAX,OAAA;AACA,IAAAY,0BAAA,GAAAZ,OAAA;AACA,IAAAa,gCAAA,GAAAb,OAAA;AACA,IAAAc,wBAAA,GAAAd,OAAA;AACA,IAAAe,iCAAA,GAAAf,OAAA;AACA,IAAAgB,sCAAA,GAAAhB,OAAA;AACA,IA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AAC,GAAGC,IAAe,KAAK;MACvB;MACA,IAAI/D,KAAK,EAAE;QACV,IAAAgE,8BAAO,EAACC,kBAAU,CAACC,gBAAgB,CAAC,CAAClE,KAAK,EAAEmE,MAAM,CAAClE,EAAE,CAAC,CAAC;MACxD;MACA,IAAA+D,8BAAO,EAACjB,oBAAoB,CAAC,CAAC;QAAEqB,MAAM,EAAE;MAAiB,CAAC,CAAC;MAE3D,IAAI,OAAO7D,OAAO,KAAK,UAAU,EAAE;QAClCA,OAAO,CAAC,GAAGwD,IAAI,CAAC;MACjB;IACD,CAAC,EACD,CAAC/D,KAAK,EAAEC,EAAE,EAAE8C,oBAAoB,EAAExC,OAAO,CAC1C,CAAC;IAED,MAAM8D,eAAe,GACpB,OAAO9D,OAAO,KAAK,UAAU,GAAGsD,WAAW,GAAGpC,SAAS;IAExD,oBACC,IAAA3D,WAAA,CAAAwG,GAAA,EAAC1G,cAAA,CAAA2G,qBAAqB;MAACnC,KAAK,EAAEM,YAAa;MAAA8B,QAAA,eAC1C,IAAA1G,WAAA,CAAAwG,GAAA,EAAChF,iBAAiB;QAAA,GACbkB,IAAI;QACRiE,GAAG,EAAE5E,QAAS;QACdS,KAAK,EAAE,CACNA,KAAK,EACLP,OAAO,GACJ6C,eAAe,GACdL,wBAAwB,GACxBN,gBAAgB,GACjBR,SAAS,CACX;QACFlB,OAAO,EAAE8D,eAAgB;QACzBK,WAAW,EAAE;MAAM,CACnB;IAAC,CACoB,CAAC;EAE1B,CAAC,CAAC;EAEF,oBAAO,IAAAC,WAAI,EAAClF,KAAK,CAAC;AAMnB","ignoreList":[]}
|
package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js
CHANGED
|
@@ -138,10 +138,8 @@ const resolveInitialLayoutMeasurementIntent = params => {
|
|
|
138
138
|
} = params;
|
|
139
139
|
if (!enabled) return null;
|
|
140
140
|
if (!hasSharedBoundTag || hasMeasuredOnLayout) return null;
|
|
141
|
-
if (!isAnyAnimating)
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
return hasPendingLinkFromSource ? ["snapshot-only", "complete-destination"] : "snapshot-only";
|
|
141
|
+
if (!isAnyAnimating) return null;
|
|
142
|
+
return hasPendingLinkFromSource ? "complete-destination" : null;
|
|
145
143
|
};
|
|
146
144
|
exports.resolveInitialLayoutMeasurementIntent = resolveInitialLayoutMeasurementIntent;
|
|
147
145
|
const resolveGroupActiveMeasurementAction = params => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getMeasurementIntentFlags","intent","flags","captureSource","completeDestination","refreshSource","refreshDestination","snapshotOnly","intents","Array","isArray","i","length","exports","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":";;;;;;AA8BO,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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AAW;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;AAAC5B,OAAA,CAAAsB,oCAAA,GAAAA,oCAAA;AAEK,MAAMS,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","exports","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":";;;;;;AA8BO,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;AAACW,OAAA,CAAAb,yBAAA,GAAAA,yBAAA;AAEK,MAAMc,2BAA2B,GAAIC,MAK3C,IAA2B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AAM;IACNC;EACD,CAAC,GAAG5C,MAAM;EAEV,IAAI,CAACQ,OAAO,EAAE,OAAO,KAAK;EAC1B,IAAI,CAACgC,KAAK,IAAI,CAACC,aAAa,IAAI,CAACC,gBAAgB,EAAE,OAAO,KAAK;EAC/D,IAAIC,MAAM,KAAK,CAAC,IAAIA,MAAM,KAAKC,cAAc,EAAE,OAAO,KAAK;EAC3D,OAAO,IAAI;AACZ,CAAC;AAAC9C,OAAA,CAAAyC,iCAAA,GAAAA,iCAAA","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useBoundaryMeasureAndStore = void 0;
|
|
7
7
|
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
8
|
var _useStableCallbackValue = _interopRequireDefault(require("../../../hooks/use-stable-callback-value"));
|
|
9
|
+
var _layoutAnchor = require("../../../providers/layout-anchor.provider");
|
|
9
10
|
var _bounds = require("../../../stores/bounds");
|
|
10
11
|
var _applyMeasuredBoundsWrites = require("../../../stores/bounds/helpers/apply-measured-bounds-writes");
|
|
11
12
|
var _resolvePendingSourceKey = require("../helpers/resolve-pending-source-key");
|
|
@@ -28,9 +29,9 @@ const useBoundaryMeasureAndStore = params => {
|
|
|
28
29
|
ancestorNavigatorKeys,
|
|
29
30
|
isAnimating,
|
|
30
31
|
preparedStyles,
|
|
31
|
-
|
|
32
|
-
layoutAnchor
|
|
32
|
+
measuredAnimatedRef
|
|
33
33
|
} = params;
|
|
34
|
+
const layoutAnchor = (0, _layoutAnchor.useLayoutAnchorContext)();
|
|
34
35
|
return (0, _useStableCallbackValue.default)(({
|
|
35
36
|
intent
|
|
36
37
|
} = {}) => {
|
|
@@ -71,7 +72,7 @@ const useBoundaryMeasureAndStore = params => {
|
|
|
71
72
|
if (!writePlan.writesAny) {
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
|
-
const measured = (0, _reactNativeReanimated.measure)(
|
|
75
|
+
const measured = (0, _reactNativeReanimated.measure)(measuredAnimatedRef);
|
|
75
76
|
if (!measured) return;
|
|
76
77
|
const correctedMeasured = layoutAnchor ? layoutAnchor.correctMeasurement(measured) : measured;
|
|
77
78
|
const destinationInViewport = !writePlan.wantsDestinationWrite || !layoutAnchor || !layoutAnchor.isMeasurementInViewport || layoutAnchor.isMeasurementInViewport(correctedMeasured);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeReanimated","require","_useStableCallbackValue","_interopRequireDefault","_bounds","_applyMeasuredBoundsWrites","_resolvePendingSourceKey","_measurementRules","e","__esModule","default","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":["_reactNativeReanimated","require","_useStableCallbackValue","_interopRequireDefault","_layoutAnchor","_bounds","_applyMeasuredBoundsWrites","_resolvePendingSourceKey","_measurementRules","e","__esModule","default","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","useLayoutAnchorContext","useStableCallbackValue","intent","intents","getMeasurementIntentFlags","expectedSourceScreenKey","resolvePendingSourceKey","undefined","captureSource","get","existing","BoundStore","getSnapshot","applyMeasuredBoundsWrites","measured","bounds","shouldSetSource","hasPendingLink","hasPendingLinkFromSource","hasSourceLink","hasDestinationLink","writePlan","resolveMeasurementWritePlan","writesAny","measure","correctedMeasured","correctMeasurement","destinationInViewport","wantsDestinationWrite","isMeasurementInViewport","refreshSource","existingSnapshot","hasSnapshotChanged","shouldWriteSnapshot","registerSnapshot","completeDestination","refreshDestination","shouldRegisterSnapshot","shouldUpdateSource","shouldUpdateDestination","shouldSetDestination","exports"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts"],"mappings":";;;;;;AACA,IAAAA,sBAAA,GAAAC,OAAA;AAOA,IAAAC,uBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,0BAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AAEA,IAAAO,iBAAA,GAAAP,OAAA;AAGqC,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErC,MAAMG,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,IACvCI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACK,CAAC,GAAGJ,CAAC,CAACI,CAAC,CAAC,IAAIP,gBAAgB,IACvCI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACM,KAAK,GAAGL,CAAC,CAACK,KAAK,CAAC,IAAIR,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACO,KAAK,GAAGN,CAAC,CAACM,KAAK,CAAC,IAAIT,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACQ,KAAK,GAAGP,CAAC,CAACO,KAAK,CAAC,IAAIV,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACS,MAAM,GAAGR,CAAC,CAACQ,MAAM,CAAC,IAAIX,gBAAgB;AAEnD,CAAC;AAEM,MAAMY,0BAA0B,GAAIC,MAW1C,IAAK;EAC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EAAEjB,SAAS,CAACS,aAAa,IAAIE,kBAAkB;MACjEO,uBAAuB,EACtBlB,SAAS,CAACe,kBAAkB,IAC5BT,qBAAqB,IACrBK,kBAAkB;MACnBQ,oBAAoB,EACnBnB,SAAS,CAACc,mBAAmB,IAAIR;IACnC,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC;AAACc,OAAA,CAAAtD,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.usePendingDestinationRetryMeasurement = void 0;
|
|
7
7
|
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
|
+
var _animation = require("../../../stores/animation.store");
|
|
8
9
|
var _bounds = require("../../../stores/bounds");
|
|
9
10
|
var _resolvePendingSourceKey = require("../helpers/resolve-pending-source-key");
|
|
10
11
|
var _measurementRules = require("./helpers/measurement-rules");
|
|
@@ -14,10 +15,10 @@ const usePendingDestinationRetryMeasurement = params => {
|
|
|
14
15
|
enabled,
|
|
15
16
|
currentScreenKey,
|
|
16
17
|
expectedSourceScreenKey,
|
|
17
|
-
progress,
|
|
18
18
|
animating,
|
|
19
19
|
maybeMeasureAndStore
|
|
20
20
|
} = params;
|
|
21
|
+
const progress = _animation.AnimationStore.getValue(currentScreenKey, "progress");
|
|
21
22
|
const retryCount = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
22
23
|
const MAX_RETRIES = 4;
|
|
23
24
|
const RETRY_PROGRESS_BUCKETS = 8;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeReanimated","require","_bounds","_resolvePendingSourceKey","_measurementRules","usePendingDestinationRetryMeasurement","params","sharedBoundTag","enabled","currentScreenKey","expectedSourceScreenKey","progress","
|
|
1
|
+
{"version":3,"names":["_reactNativeReanimated","require","_animation","_bounds","_resolvePendingSourceKey","_measurementRules","usePendingDestinationRetryMeasurement","params","sharedBoundTag","enabled","currentScreenKey","expectedSourceScreenKey","animating","maybeMeasureAndStore","progress","AnimationStore","getValue","retryCount","useSharedValue","MAX_RETRIES","RETRY_PROGRESS_BUCKETS","RETRY_PROGRESS_MAX","useAnimatedReaction","resolvedSourceKey","resolvePendingSourceKey","resolvePendingDestinationRetrySignal","get","maxRetries","isAnimating","hasDestinationLink","BoundStore","retryProgressMax","retryProgressBuckets","hasPendingLinkFromSource","captureSignal","set","intent","exports"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAH,OAAA;AAEA,IAAAI,iBAAA,GAAAJ,OAAA;AAEO,MAAMK,qCAAqC,GAAIC,MAOrD,IAAK;EACL,MAAM;IACLC,cAAc;IACdC,OAAO;IACPC,gBAAgB;IAChBC,uBAAuB;IACvBC,SAAS;IACTC;EACD,CAAC,GAAGN,MAAM;EAEV,MAAMO,QAAQ,GAAGC,yBAAc,CAACC,QAAQ,CAACN,gBAAgB,EAAE,UAAU,CAAC;EAEtE,MAAMO,UAAU,GAAG,IAAAC,qCAAc,EAAC,CAAC,CAAC;EACpC,MAAMC,WAAW,GAAG,CAAC;EACrB,MAAMC,sBAAsB,GAAG,CAAC;EAChC,MAAMC,kBAAkB,GAAG,IAAI;EAE/B,IAAAC,0CAAmB,EAClB,MAAM;IACL,SAAS;;IACT,MAAMC,iBAAiB,GAAG,IAAAC,gDAAuB,EAChDhB,cAAc,EACdG,uBACD,CAAC;IACD,OAAO,IAAAc,sDAAoC,EAAC;MAC3ChB,OAAO;MACPQ,UAAU,EAAEA,UAAU,CAACS,GAAG,CAAC,CAAC;MAC5BC,UAAU,EAAER,WAAW;MACvBS,WAAW,EAAE,CAAC,CAAChB,SAAS,CAACc,GAAG,CAAC,CAAC;MAC9BG,kBAAkB,EAAEC,kBAAU,CAACD,kBAAkB,CAChDrB,cAAc,EACdE,gBACD,CAAC;MACDI,QAAQ,EAAEA,QAAQ,CAACY,GAAG,CAAC,CAAC;MACxBK,gBAAgB,EAAEV,kBAAkB;MACpCW,oBAAoB,EAAEZ,sBAAsB;MAC5CG,iBAAiB;MACjBU,wBAAwB,EAAEV,iBAAiB,GACxCO,kBAAU,CAACG,wBAAwB,CACnCzB,cAAc,EACde,iBACD,CAAC,GACA;IACJ,CAAC,CAAC;EACH,CAAC,EACAW,aAAa,IAAK;IAClB,SAAS;;IACT,IAAI,CAACzB,OAAO,EAAE;IACd,IAAI,CAACyB,aAAa,EAAE;MACnBjB,UAAU,CAACkB,GAAG,CAAC,CAAC,CAAC;MACjB;IACD;IAEA,IAAIlB,UAAU,CAACS,GAAG,CAAC,CAAC,IAAIP,WAAW,EAAE;IACrCF,UAAU,CAACkB,GAAG,CAAClB,UAAU,CAACS,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACpCb,oBAAoB,CAAC;MAAEuB,MAAM,EAAE;IAAuB,CAAC,CAAC;EACzD,CAAC,EACD,CACC3B,OAAO,EACPD,cAAc,EACdE,gBAAgB,EAChBC,uBAAuB,EACvBG,QAAQ,EACRF,SAAS,EACTC,oBAAoB,EACpBI,UAAU,CAEZ,CAAC;AACF,CAAC;AAACoB,OAAA,CAAA/B,qCAAA,GAAAA,qCAAA","ignoreList":[]}
|
|
@@ -4,218 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Boundary = void 0;
|
|
7
|
-
exports
|
|
8
|
-
|
|
7
|
+
Object.defineProperty(exports, "createBoundaryComponent", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _createBoundaryComponent.createBoundaryComponent;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
9
13
|
var _reactNative = require("react-native");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _bounds = require("../../stores/bounds");
|
|
16
|
-
var _styles = require("../../utils/bounds/helpers/styles");
|
|
17
|
-
var _useAutoSourceMeasurement = require("./hooks/use-auto-source-measurement");
|
|
18
|
-
var _useBoundaryMeasureAndStore = require("./hooks/use-boundary-measure-and-store");
|
|
19
|
-
var _useBoundaryPresence = require("./hooks/use-boundary-presence");
|
|
20
|
-
var _useGroupActiveMeasurement = require("./hooks/use-group-active-measurement");
|
|
21
|
-
var _useGroupActiveSourceMeasurement = require("./hooks/use-group-active-source-measurement");
|
|
22
|
-
var _useInitialLayoutHandler = require("./hooks/use-initial-layout-handler");
|
|
23
|
-
var _usePendingDestinationMeasurement = require("./hooks/use-pending-destination-measurement");
|
|
24
|
-
var _usePendingDestinationRetryMeasurement = require("./hooks/use-pending-destination-retry-measurement");
|
|
25
|
-
var _useScrollSettledMeasurement = require("./hooks/use-scroll-settled-measurement");
|
|
26
|
-
var _buildBoundaryMatchKey = require("./utils/build-boundary-match-key");
|
|
27
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
29
|
-
const setGroupSelectionOnUI = (group, id) => {
|
|
30
|
-
"worklet";
|
|
31
|
-
|
|
32
|
-
_bounds.BoundStore.setGroupActiveId(group, id);
|
|
33
|
-
};
|
|
34
|
-
function createBoundaryComponent(Wrapped, options = {}) {
|
|
35
|
-
const {
|
|
36
|
-
alreadyAnimated = false
|
|
37
|
-
} = options;
|
|
38
|
-
const AnimatedComponent = alreadyAnimated ? Wrapped : _reactNativeReanimated.default.createAnimatedComponent(Wrapped);
|
|
39
|
-
const Inner = /*#__PURE__*/(0, _react.forwardRef)((props, _ref) => {
|
|
40
|
-
const {
|
|
41
|
-
enabled = true,
|
|
42
|
-
group,
|
|
43
|
-
id,
|
|
44
|
-
anchor,
|
|
45
|
-
scaleMode,
|
|
46
|
-
target,
|
|
47
|
-
method,
|
|
48
|
-
style,
|
|
49
|
-
onPress,
|
|
50
|
-
...rest
|
|
51
|
-
} = props;
|
|
52
|
-
const sharedBoundTag = (0, _buildBoundaryMatchKey.buildBoundaryMatchKey)({
|
|
53
|
-
group,
|
|
54
|
-
id
|
|
55
|
-
});
|
|
56
|
-
const animatedRef = (0, _reactNativeReanimated.useAnimatedRef)();
|
|
57
|
-
const {
|
|
58
|
-
previousScreenKey: preferredSourceScreenKey,
|
|
59
|
-
currentScreenKey,
|
|
60
|
-
nextScreenKey,
|
|
61
|
-
ancestorKeys,
|
|
62
|
-
navigatorKey,
|
|
63
|
-
ancestorNavigatorKeys,
|
|
64
|
-
hasConfiguredInterpolator
|
|
65
|
-
} = (0, _descriptors.useDescriptorDerivations)();
|
|
66
|
-
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
67
|
-
const hasNextScreen = !!nextScreenKey;
|
|
68
|
-
const shouldUpdateDestination = !hasNextScreen;
|
|
69
|
-
const layoutAnchor = (0, _layoutAnchor.useLayoutAnchorContext)();
|
|
70
|
-
const boundaryConfig = (0, _react.useMemo)(() => {
|
|
71
|
-
if (anchor === undefined && scaleMode === undefined && target === undefined && method === undefined) {
|
|
72
|
-
return undefined;
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
anchor,
|
|
76
|
-
scaleMode,
|
|
77
|
-
target,
|
|
78
|
-
method
|
|
79
|
-
};
|
|
80
|
-
}, [anchor, scaleMode, target, method]);
|
|
81
|
-
const isAnimating = _animation.AnimationStore.getValue(currentScreenKey, "animating");
|
|
82
|
-
const progress = _animation.AnimationStore.getValue(currentScreenKey, "progress");
|
|
83
|
-
const preparedStyles = (0, _react.useMemo)(() => (0, _styles.prepareStyleForBounds)(style), [style]);
|
|
84
|
-
const {
|
|
85
|
-
associatedStyles
|
|
86
|
-
} = (0, _useAssociatedStyle.useAssociatedStyles)({
|
|
87
|
-
id: sharedBoundTag,
|
|
88
|
-
resetTransformOnUnset: true
|
|
89
|
-
});
|
|
90
|
-
const maybeMeasureAndStore = (0, _useBoundaryMeasureAndStore.useBoundaryMeasureAndStore)({
|
|
91
|
-
enabled,
|
|
92
|
-
sharedBoundTag,
|
|
93
|
-
preferredSourceScreenKey,
|
|
94
|
-
currentScreenKey,
|
|
95
|
-
ancestorKeys,
|
|
96
|
-
navigatorKey,
|
|
97
|
-
ancestorNavigatorKeys,
|
|
98
|
-
isAnimating,
|
|
99
|
-
preparedStyles,
|
|
100
|
-
animatedRef,
|
|
101
|
-
layoutAnchor
|
|
102
|
-
});
|
|
103
|
-
const shouldRunDestinationEffects = runtimeEnabled && !hasNextScreen;
|
|
104
|
-
|
|
105
|
-
// Register/unregister this boundary in the presence map so source/destination
|
|
106
|
-
// matching can resolve across screens (including ancestor relationships).
|
|
107
|
-
(0, _useBoundaryPresence.useBoundaryPresence)({
|
|
108
|
-
enabled: runtimeEnabled,
|
|
109
|
-
sharedBoundTag,
|
|
110
|
-
currentScreenKey,
|
|
111
|
-
ancestorKeys,
|
|
112
|
-
navigatorKey,
|
|
113
|
-
ancestorNavigatorKeys,
|
|
114
|
-
boundaryConfig
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
// On the source screen, capture source bounds when a matching destination
|
|
118
|
-
// appears on the next screen.
|
|
119
|
-
(0, _useAutoSourceMeasurement.useAutoSourceMeasurement)({
|
|
120
|
-
enabled: runtimeEnabled,
|
|
121
|
-
sharedBoundTag,
|
|
122
|
-
nextScreenKey,
|
|
123
|
-
maybeMeasureAndStore
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
// Primary destination capture: once a pending source link exists for this tag,
|
|
127
|
-
// measure destination bounds and complete the pair.
|
|
128
|
-
(0, _usePendingDestinationMeasurement.usePendingDestinationMeasurement)({
|
|
129
|
-
sharedBoundTag,
|
|
130
|
-
enabled: shouldRunDestinationEffects,
|
|
131
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
132
|
-
maybeMeasureAndStore
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
// Reliability fallback: retry destination capture during transition progress
|
|
136
|
-
// when the initial pending-destination attempt happens before layout is ready.
|
|
137
|
-
(0, _usePendingDestinationRetryMeasurement.usePendingDestinationRetryMeasurement)({
|
|
138
|
-
sharedBoundTag,
|
|
139
|
-
enabled: shouldRunDestinationEffects,
|
|
140
|
-
currentScreenKey,
|
|
141
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
142
|
-
progress,
|
|
143
|
-
animating: isAnimating,
|
|
144
|
-
maybeMeasureAndStore
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// Grouped boundaries (e.g. paged/detail UIs): re-measure when this boundary
|
|
148
|
-
// becomes the active member so destination bounds stay accurate.
|
|
149
|
-
(0, _useGroupActiveMeasurement.useGroupActiveMeasurement)({
|
|
150
|
-
enabled: runtimeEnabled,
|
|
151
|
-
group,
|
|
152
|
-
id,
|
|
153
|
-
currentScreenKey,
|
|
154
|
-
shouldUpdateDestination,
|
|
155
|
-
maybeMeasureAndStore
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
// Source-side grouped retargeting: when an unfocused/source boundary
|
|
159
|
-
// becomes the active member, refresh its snapshot and source link so
|
|
160
|
-
// close transitions do not use stale pre-scroll geometry.
|
|
161
|
-
(0, _useGroupActiveSourceMeasurement.useGroupActiveSourceMeasurement)({
|
|
162
|
-
enabled: runtimeEnabled,
|
|
163
|
-
group,
|
|
164
|
-
id,
|
|
165
|
-
hasNextScreen,
|
|
166
|
-
isAnimating,
|
|
167
|
-
maybeMeasureAndStore
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
// While idle on source screens, re-measure after scroll settles so a later
|
|
171
|
-
// close transition starts from up-to-date source geometry.
|
|
172
|
-
(0, _useScrollSettledMeasurement.useScrollSettledMeasurement)({
|
|
173
|
-
enabled: runtimeEnabled,
|
|
174
|
-
group,
|
|
175
|
-
hasNextScreen,
|
|
176
|
-
isAnimating,
|
|
177
|
-
maybeMeasureAndStore
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
// Destination mount-time capture path: onLayout schedules a one-time UI-thread
|
|
181
|
-
// initial measurement when transitions are active.
|
|
182
|
-
(0, _useInitialLayoutHandler.useInitialLayoutHandler)({
|
|
183
|
-
enabled: runtimeEnabled,
|
|
184
|
-
sharedBoundTag,
|
|
185
|
-
currentScreenKey,
|
|
186
|
-
ancestorKeys,
|
|
187
|
-
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
188
|
-
maybeMeasureAndStore
|
|
189
|
-
});
|
|
190
|
-
const handlePress = (0, _react.useCallback)((...args) => {
|
|
191
|
-
// Press path has priority: capture source before user onPress/navigation.
|
|
192
|
-
if (group) {
|
|
193
|
-
(0, _reactNativeReanimated.runOnUI)(setGroupSelectionOnUI)(group, String(id));
|
|
194
|
-
}
|
|
195
|
-
(0, _reactNativeReanimated.runOnUI)(maybeMeasureAndStore)({
|
|
196
|
-
intent: "capture-source"
|
|
197
|
-
});
|
|
198
|
-
if (typeof onPress === "function") {
|
|
199
|
-
onPress(...args);
|
|
200
|
-
}
|
|
201
|
-
}, [group, id, maybeMeasureAndStore, onPress]);
|
|
202
|
-
const resolvedOnPress = typeof onPress === "function" ? handlePress : undefined;
|
|
203
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedComponent, {
|
|
204
|
-
...rest,
|
|
205
|
-
ref: animatedRef,
|
|
206
|
-
style: [style, enabled ? associatedStyles : undefined],
|
|
207
|
-
onPress: resolvedOnPress,
|
|
208
|
-
collapsable: false
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
return /*#__PURE__*/(0, _react.memo)(Inner);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Pre-built boundary component variants
|
|
215
|
-
const BoundaryView = createBoundaryComponent(_reactNative.View);
|
|
14
|
+
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
15
|
+
var _boundaryTarget = require("./components/boundary-target");
|
|
16
|
+
var _createBoundaryComponent = require("./create-boundary-component");
|
|
17
|
+
const BoundaryView = (0, _createBoundaryComponent.createBoundaryComponent)(_reactNative.View);
|
|
18
|
+
const BoundaryTrigger = (0, _createBoundaryComponent.createBoundaryComponent)(_reactNativeGestureHandler.Pressable);
|
|
216
19
|
BoundaryView.displayName = "Transition.Boundary.View";
|
|
217
|
-
|
|
218
|
-
|
|
20
|
+
BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
|
|
21
|
+
_boundaryTarget.BoundaryTarget.displayName = "Transition.Boundary.Target";
|
|
219
22
|
|
|
220
23
|
/**
|
|
221
24
|
* Shared-boundary components.
|
|
@@ -225,19 +28,22 @@ BoundaryPressable.displayName = "Transition.Boundary.Pressable";
|
|
|
225
28
|
* 2. Destination screen captures bounds for the same tag.
|
|
226
29
|
* 3. The link is updated as layout changes (group-active + scroll-settled paths).
|
|
227
30
|
*
|
|
228
|
-
*
|
|
229
|
-
* - When a boundary has `onPress` (typically `Boundary.
|
|
31
|
+
* Trigger behavior:
|
|
32
|
+
* - When a boundary has `onPress` (typically `Boundary.Trigger`), source
|
|
230
33
|
* measurement runs before the user callback. This gives navigation transitions
|
|
231
34
|
* fresh source geometry on the first frame.
|
|
232
35
|
*
|
|
233
36
|
* Use:
|
|
234
37
|
* - `Boundary.View` for passive/shared elements.
|
|
235
|
-
* - `Boundary.
|
|
38
|
+
* - `Boundary.Trigger` for tappable elements that start navigation.
|
|
39
|
+
* - `Boundary.Target` to measure a nested descendant instead of the owner.
|
|
236
40
|
*/
|
|
237
41
|
const Boundary = exports.Boundary = {
|
|
238
42
|
/** Passive boundary wrapper (no built-in press semantics). */
|
|
239
43
|
View: BoundaryView,
|
|
240
44
|
/** Pressable boundary wrapper with press-priority source capture. */
|
|
241
|
-
|
|
45
|
+
Trigger: BoundaryTrigger,
|
|
46
|
+
/** Optional nested measurement override inside a boundary owner. */
|
|
47
|
+
Target: _boundaryTarget.BoundaryTarget
|
|
242
48
|
};
|
|
243
49
|
//# sourceMappingURL=index.js.map
|