@nativescript/core 8.5.0-alpha.2 → 8.5.0-alpha.4
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/file-system/file-system-access.android.d.ts +13 -0
- package/file-system/file-system-access.android.js +141 -0
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.d.ts +12 -0
- package/file-system/file-system-access.ios.d.ts +7 -0
- package/file-system/file-system-access.ios.js +56 -0
- package/file-system/file-system-access.ios.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/widgets-release.aar +0 -0
- package/ui/core/view/index.android.js +1 -22
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.ios.js +28 -12
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +4 -0
- package/ui/core/view/view-common.js +26 -12
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.d.ts +10 -0
- package/ui/core/view/view-helper/index.ios.js +99 -40
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/frame/fragment.transitions.d.ts +0 -4
- package/ui/frame/frame-common.d.ts +2 -2
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/index.android.js +2 -4
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.ios.js +58 -9
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/index.d.ts +3 -0
- package/ui/index.js +2 -0
- package/ui/index.js.map +1 -1
- package/ui/page/index.ios.d.ts +4 -1
- package/ui/page/index.ios.js +81 -56
- package/ui/page/index.ios.js.map +1 -1
- package/ui/styling/background.ios.js +3 -0
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/transition/fade-transition.d.ts +1 -3
- package/ui/transition/fade-transition.ios.d.ts +14 -1
- package/ui/transition/fade-transition.ios.js +60 -26
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/index.android.d.ts +0 -3
- package/ui/transition/index.android.js +0 -5
- package/ui/transition/index.android.js.map +1 -1
- package/ui/transition/index.d.ts +28 -9
- package/ui/transition/index.ios.d.ts +0 -3
- package/ui/transition/index.ios.js +0 -33
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.android.d.ts +3 -4
- package/ui/transition/modal-transition.android.js +4 -51
- package/ui/transition/modal-transition.android.js.map +1 -1
- package/ui/transition/modal-transition.ios.d.ts +11 -17
- package/ui/transition/modal-transition.ios.js +116 -206
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.d.ts +4 -4
- package/ui/transition/page-transition.android.js +44 -33
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.d.ts +26 -17
- package/ui/transition/page-transition.ios.js +169 -187
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.android.d.ts +4 -0
- package/ui/transition/shared-transition-helper.android.js +6 -0
- package/ui/transition/shared-transition-helper.android.js.map +1 -0
- package/ui/transition/shared-transition-helper.d.ts +10 -0
- package/ui/transition/shared-transition-helper.ios.d.ts +9 -0
- package/ui/transition/shared-transition-helper.ios.js +429 -0
- package/ui/transition/shared-transition-helper.ios.js.map +1 -0
- package/ui/transition/shared-transition.d.ts +120 -13
- package/ui/transition/shared-transition.js +91 -11
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.android.d.ts +1 -1
- package/ui/transition/slide-transition.android.js +1 -1
- package/ui/transition/slide-transition.android.js.map +1 -1
- package/ui/transition/slide-transition.d.ts +1 -1
- package/ui/transition/slide-transition.ios.d.ts +15 -2
- package/ui/transition/slide-transition.ios.js +86 -52
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/utils/native-helper.d.ts +35 -0
- package/utils/native-helper.ios.d.ts +13 -0
- package/utils/native-helper.ios.js +73 -0
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/number-utils.d.ts +10 -0
- package/utils/number-utils.js +12 -0
- package/utils/number-utils.js.map +1 -1
- package/ui/frame/fragment.transitions.ios.d.ts +0 -2
- package/ui/frame/fragment.transitions.ios.js +0 -71
- package/ui/frame/fragment.transitions.ios.js.map +0 -1
|
@@ -1,199 +1,181 @@
|
|
|
1
|
-
import { Transition
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Transition } from '.';
|
|
2
|
+
import { isNumber } from '../../utils/types';
|
|
3
|
+
import { GestureStateTypes } from '../gestures';
|
|
4
|
+
import { SharedTransition, DEFAULT_DURATION } from './shared-transition';
|
|
5
|
+
import { SharedTransitionHelper } from './shared-transition-helper';
|
|
4
6
|
export class PageTransition extends Transition {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const state = SharedTransition.getState(this.id);
|
|
11
|
-
if (!state) {
|
|
12
|
-
return;
|
|
7
|
+
iosNavigatedController(navigationController, operation, fromVC, toVC) {
|
|
8
|
+
this.navigationController = navigationController;
|
|
9
|
+
if (!this.transitionController) {
|
|
10
|
+
this.presented = toVC;
|
|
11
|
+
this.presenting = fromVC;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
console.log('
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
sharedElementSnapshot.tintColor = presentedSharedElement.tintColor;
|
|
52
|
-
sharedElementSnapshot.contentMode = presentedSharedElement.contentMode;
|
|
53
|
-
}
|
|
54
|
-
iosMatchLayerProperties(sharedElementSnapshot, presentingSharedElement);
|
|
55
|
-
sharedElementSnapshot.clipsToBounds = true;
|
|
56
|
-
// console.log('---> snapshot: ', sharedElementSnapshot);
|
|
57
|
-
const startFrame = presentingSharedElement.convertRectToView(presentingSharedElement.bounds, transitionContext.containerView);
|
|
58
|
-
const endFrame = presentedSharedElement.convertRectToView(presentedSharedElement.bounds, transitionContext.containerView);
|
|
59
|
-
sharedElementSnapshot.frame = startFrame;
|
|
60
|
-
console.log('---> ', presentingView.sharedTransitionTag, ' frame:', iosPrintRect(sharedElementSnapshot.frame));
|
|
61
|
-
this.sharedElements.presenting.push({
|
|
62
|
-
view: presentingView,
|
|
63
|
-
startFrame,
|
|
64
|
-
endFrame,
|
|
65
|
-
snapshot: sharedElementSnapshot,
|
|
66
|
-
startOpacity: presentingView.opacity,
|
|
67
|
-
endOpacity: presentedView.opacity,
|
|
68
|
-
});
|
|
69
|
-
this.sharedElements.presented.push({
|
|
70
|
-
view: presentedView,
|
|
71
|
-
startFrame: endFrame,
|
|
72
|
-
endFrame: startFrame,
|
|
73
|
-
startOpacity: presentedView.opacity,
|
|
74
|
-
endOpacity: presentingView.opacity,
|
|
75
|
-
});
|
|
76
|
-
// set initial opacity to match the source view opacity
|
|
77
|
-
sharedElementSnapshot.alpha = presentingView.opacity;
|
|
78
|
-
// hide both while animating within the transition context
|
|
79
|
-
presentingView.opacity = 0;
|
|
80
|
-
presentedView.opacity = 0;
|
|
81
|
-
// add snapshot to animate
|
|
82
|
-
transitionContext.containerView.addSubview(sharedElementSnapshot);
|
|
13
|
+
this.transitionController = PageTransitionController.initWithOwner(new WeakRef(this));
|
|
14
|
+
// console.log('iosNavigatedController presenting:', this.presenting);
|
|
15
|
+
this.operation = operation;
|
|
16
|
+
return this.transitionController;
|
|
17
|
+
}
|
|
18
|
+
iosInteractionDismiss(animator) {
|
|
19
|
+
// console.log('-- iosInteractionDismiss --');
|
|
20
|
+
this.interactiveController = PercentInteractiveController.initWithOwner(new WeakRef(this));
|
|
21
|
+
return this.interactiveController;
|
|
22
|
+
}
|
|
23
|
+
setupInteractiveGesture(startCallback, view) {
|
|
24
|
+
// console.log(' -- setupInteractiveGesture --');
|
|
25
|
+
this._interactiveStartCallback = startCallback;
|
|
26
|
+
if (!this._interactiveDismissGesture) {
|
|
27
|
+
// console.log('setup but tearing down first!');
|
|
28
|
+
view.off('pan', this._interactiveDismissGesture);
|
|
29
|
+
this._interactiveDismissGesture = this._interactiveDismissGestureHandler.bind(this);
|
|
30
|
+
}
|
|
31
|
+
view.on('pan', this._interactiveDismissGesture);
|
|
32
|
+
this._interactiveGestureTeardown = () => {
|
|
33
|
+
// console.log(`-- TEARDOWN setupInteractiveGesture --`);
|
|
34
|
+
if (view) {
|
|
35
|
+
view.off('pan', this._interactiveDismissGesture);
|
|
36
|
+
}
|
|
37
|
+
this._interactiveDismissGesture = null;
|
|
38
|
+
};
|
|
39
|
+
return this._interactiveGestureTeardown;
|
|
40
|
+
}
|
|
41
|
+
_interactiveDismissGestureHandler(args) {
|
|
42
|
+
if (args?.ios?.view) {
|
|
43
|
+
// console.log('this.id:', this.id);
|
|
44
|
+
const state = SharedTransition.getState(this.id);
|
|
45
|
+
if (!state) {
|
|
46
|
+
// cleanup and exit, already shutdown
|
|
47
|
+
if (this._interactiveGestureTeardown) {
|
|
48
|
+
this._interactiveGestureTeardown();
|
|
49
|
+
this._interactiveGestureTeardown = null;
|
|
83
50
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}, () => {
|
|
96
|
-
for (const presenting of this.sharedElements.presenting) {
|
|
97
|
-
presenting.snapshot.removeFromSuperview();
|
|
98
|
-
}
|
|
99
|
-
SharedTransition.updateState(this.id, {
|
|
100
|
-
activeType: SharedTransitionAnimationType.dismiss,
|
|
101
|
-
});
|
|
102
|
-
transitionContext.completeTransition(true);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const percent = state.interactive?.dismiss?.percentFormula ? state.interactive.dismiss.percentFormula(args) : args.deltaX / (args.ios.view.bounds.size.width / 2);
|
|
54
|
+
if (SharedTransition.DEBUG) {
|
|
55
|
+
console.log('Interactive dismissal percentage:', percent);
|
|
56
|
+
}
|
|
57
|
+
switch (args.state) {
|
|
58
|
+
case GestureStateTypes.began:
|
|
59
|
+
SharedTransition.updateState(this.id, {
|
|
60
|
+
interactiveBegan: true,
|
|
61
|
+
interactiveCancelled: false,
|
|
103
62
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// https://stackoverflow.com/a/27997678/1418981
|
|
107
|
-
// In order to have proper layout. Seems mostly needed when presenting.
|
|
108
|
-
// For instance during presentation, destination view doesn't account navigation bar height.
|
|
109
|
-
// Not sure if best to leave all the time?
|
|
110
|
-
// owner.presented.view.setNeedsLayout();
|
|
111
|
-
// owner.presented.view.layoutIfNeeded();
|
|
112
|
-
console.log('3. Animating shared elements:');
|
|
113
|
-
for (const presented of this.sharedElements.presented) {
|
|
114
|
-
const presentingMatch = this.sharedElements.presenting.find((v) => v.view.sharedTransitionTag === presented.view.sharedTransitionTag);
|
|
115
|
-
// Workaround wrong origin due ongoing layout process.
|
|
116
|
-
const updatedEndFrame = presented.view.ios.convertRectToView(presented.view.ios.bounds, transitionContext.containerView);
|
|
117
|
-
const correctedEndFrame = CGRectMake(updatedEndFrame.origin.x, updatedEndFrame.origin.y, presentingMatch.endFrame.size.width, presentingMatch.endFrame.size.height);
|
|
118
|
-
presentingMatch.snapshot.frame = correctedEndFrame;
|
|
119
|
-
// apply view and layer properties to the snapshot view to match the source/presented view
|
|
120
|
-
iosMatchLayerProperties(presentingMatch.snapshot, presented.view.ios);
|
|
121
|
-
// create a snapshot of the presented view
|
|
122
|
-
presentingMatch.snapshot.image = iosSnapshotView(presented.view.ios);
|
|
123
|
-
// apply correct alpha
|
|
124
|
-
presentingMatch.snapshot.alpha = presentingMatch.endOpacity;
|
|
125
|
-
console.log(`---> ${presentingMatch.view.sharedTransitionTag} animate to: `, iosPrintRect(correctedEndFrame));
|
|
63
|
+
if (this._interactiveStartCallback) {
|
|
64
|
+
this._interactiveStartCallback();
|
|
126
65
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const startWidth = typeof state.toPageStart?.width === 'number' ? state.toPageStart?.width : Screen.mainScreen.widthDIPs;
|
|
134
|
-
const startHeight = typeof state.toPageStart?.height === 'number' ? state.toPageStart?.height : Screen.mainScreen.heightDIPs;
|
|
135
|
-
this.presented.view.frame = CGRectMake(startX, startY, startWidth, startHeight);
|
|
136
|
-
UIView.animateWithDurationDelayUsingSpringWithDampingInitialSpringVelocityOptionsAnimationsCompletion(typeof state.toPageStart?.duration === 'number' ? state.toPageStart?.duration / 1000 : DEFAULT_DURATION, 0, 0.5, 3, 0 /* UIViewAnimationOptions.CurveEaseInOut */, () => {
|
|
137
|
-
// animate page properties to the following:
|
|
138
|
-
this.presented.view.alpha = typeof state.toPageEnd?.opacity === 'number' ? state.toPageEnd?.opacity : 1;
|
|
139
|
-
const endX = typeof state.toPageEnd?.x === 'number' ? state.toPageEnd?.x : 0;
|
|
140
|
-
const endY = typeof state.toPageEnd?.y === 'number' ? state.toPageEnd?.y : 0;
|
|
141
|
-
const endWidth = typeof state.toPageEnd?.width === 'number' ? state.toPageEnd?.width : Screen.mainScreen.widthDIPs;
|
|
142
|
-
const endHeight = typeof state.toPageEnd?.height === 'number' ? state.toPageEnd?.height : Screen.mainScreen.heightDIPs;
|
|
143
|
-
this.presented.view.frame = CGRectMake(endX, endY, endWidth, endHeight);
|
|
144
|
-
updateFramePresent();
|
|
145
|
-
}, () => {
|
|
146
|
-
cleanupPresent();
|
|
147
|
-
});
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
case 2 /* UINavigationControllerOperation.Pop */: {
|
|
151
|
-
// this.presented = fromViewCtrl;
|
|
152
|
-
console.log('-- Transition dismiss --', this.presented);
|
|
153
|
-
transitionContext.containerView.insertSubviewBelowSubview(toViewCtrl.view, fromViewCtrl.view);
|
|
154
|
-
// console.log('transitionContext.containerView.subviews.count:', transitionContext.containerView.subviews.count);
|
|
155
|
-
console.log(' ');
|
|
156
|
-
console.log(`1. Dismiss sharedTransitionTags to animate:`, this.sharedElements.presented.map((p) => p.view.sharedTransitionTag));
|
|
157
|
-
console.log(`2. Add back previously stored sharedElements to dismiss:`);
|
|
158
|
-
for (const p of this.sharedElements.presented) {
|
|
159
|
-
p.view.opacity = 0;
|
|
160
|
-
}
|
|
161
|
-
for (const p of this.sharedElements.presenting) {
|
|
162
|
-
p.snapshot.alpha = p.endOpacity;
|
|
163
|
-
transitionContext.containerView.addSubview(p.snapshot);
|
|
164
|
-
}
|
|
165
|
-
const cleanupDismiss = () => {
|
|
166
|
-
for (const presenting of this.sharedElements.presenting) {
|
|
167
|
-
presenting.view.opacity = presenting.startOpacity;
|
|
168
|
-
presenting.snapshot.removeFromSuperview();
|
|
66
|
+
break;
|
|
67
|
+
case GestureStateTypes.changed:
|
|
68
|
+
if (percent < 1) {
|
|
69
|
+
if (this.interactiveController) {
|
|
70
|
+
this.interactiveController.updateInteractiveTransition(percent);
|
|
71
|
+
}
|
|
169
72
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
73
|
+
break;
|
|
74
|
+
case GestureStateTypes.cancelled:
|
|
75
|
+
case GestureStateTypes.ended:
|
|
76
|
+
if (this.interactiveController) {
|
|
77
|
+
const finishThreshold = isNumber(state.interactive?.dismiss?.finishThreshold) ? state.interactive.dismiss.finishThreshold : 0.5;
|
|
78
|
+
if (percent > finishThreshold) {
|
|
79
|
+
if (this._interactiveGestureTeardown) {
|
|
80
|
+
this._interactiveGestureTeardown();
|
|
81
|
+
this._interactiveGestureTeardown = null;
|
|
82
|
+
}
|
|
83
|
+
this.interactiveController.finishInteractiveTransition();
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
SharedTransition.updateState(this.id, {
|
|
87
|
+
interactiveCancelled: true,
|
|
88
|
+
});
|
|
89
|
+
this.interactiveController.cancelInteractiveTransition();
|
|
90
|
+
}
|
|
180
91
|
}
|
|
181
|
-
|
|
182
|
-
};
|
|
183
|
-
UIView.animateWithDurationDelayUsingSpringWithDampingInitialSpringVelocityOptionsAnimationsCompletion(typeof state.fromPageEnd?.duration === 'number' ? state.fromPageEnd?.duration / 1000 : DEFAULT_DURATION, 0, 0.5, 3, 0 /* UIViewAnimationOptions.CurveEaseInOut */, () => {
|
|
184
|
-
this.presented.view.alpha = typeof state.fromPageEnd?.opacity === 'number' ? state.fromPageEnd?.opacity : 0;
|
|
185
|
-
const endX = typeof state.fromPageEnd?.x === 'number' ? state.fromPageEnd?.x : Screen.mainScreen.widthDIPs;
|
|
186
|
-
const endY = typeof state.fromPageEnd?.y === 'number' ? state.fromPageEnd?.y : 0;
|
|
187
|
-
const endWidth = typeof state.fromPageEnd?.width === 'number' ? state.fromPageEnd?.width : Screen.mainScreen.widthDIPs;
|
|
188
|
-
const endHeight = typeof state.fromPageEnd?.height === 'number' ? state.fromPageEnd?.height : Screen.mainScreen.heightDIPs;
|
|
189
|
-
this.presented.view.frame = CGRectMake(endX, endY, endWidth, endHeight);
|
|
190
|
-
updateFrameDismiss();
|
|
191
|
-
}, () => {
|
|
192
|
-
cleanupDismiss();
|
|
193
|
-
});
|
|
194
|
-
break;
|
|
92
|
+
break;
|
|
195
93
|
}
|
|
196
94
|
}
|
|
197
95
|
}
|
|
198
96
|
}
|
|
97
|
+
var PercentInteractiveController = /** @class */ (function (_super) {
|
|
98
|
+
__extends(PercentInteractiveController, _super);
|
|
99
|
+
function PercentInteractiveController() {
|
|
100
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
101
|
+
}
|
|
102
|
+
PercentInteractiveController.initWithOwner = function (owner) {
|
|
103
|
+
var ctrl = PercentInteractiveController.new();
|
|
104
|
+
ctrl.owner = owner;
|
|
105
|
+
return ctrl;
|
|
106
|
+
};
|
|
107
|
+
PercentInteractiveController.prototype.startInteractiveTransition = function (transitionContext) {
|
|
108
|
+
var _a;
|
|
109
|
+
// console.log('startInteractiveTransition');
|
|
110
|
+
if (!this.interactiveState) {
|
|
111
|
+
this.interactiveState = {
|
|
112
|
+
transitionContext: transitionContext,
|
|
113
|
+
};
|
|
114
|
+
var owner = (_a = this.owner) === null || _a === void 0 ? void 0 : _a.deref();
|
|
115
|
+
if (owner) {
|
|
116
|
+
var state = SharedTransition.getState(owner.id);
|
|
117
|
+
SharedTransitionHelper.interactiveStart(state, this.interactiveState, 'page');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
PercentInteractiveController.prototype.updateInteractiveTransition = function (percentComplete) {
|
|
122
|
+
var _a;
|
|
123
|
+
var owner = (_a = this.owner) === null || _a === void 0 ? void 0 : _a.deref();
|
|
124
|
+
if (owner) {
|
|
125
|
+
var state = SharedTransition.getState(owner.id);
|
|
126
|
+
SharedTransitionHelper.interactiveUpdate(state, this.interactiveState, 'page', percentComplete);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
PercentInteractiveController.prototype.cancelInteractiveTransition = function () {
|
|
130
|
+
var _a;
|
|
131
|
+
// console.log('cancelInteractiveTransition');
|
|
132
|
+
var owner = (_a = this.owner) === null || _a === void 0 ? void 0 : _a.deref();
|
|
133
|
+
if (owner) {
|
|
134
|
+
var state = SharedTransition.getState(owner.id);
|
|
135
|
+
SharedTransitionHelper.interactiveCancel(state, this.interactiveState, 'page');
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
PercentInteractiveController.prototype.finishInteractiveTransition = function () {
|
|
139
|
+
var _a;
|
|
140
|
+
// console.log('finishInteractiveTransition');
|
|
141
|
+
var owner = (_a = this.owner) === null || _a === void 0 ? void 0 : _a.deref();
|
|
142
|
+
if (owner) {
|
|
143
|
+
var state = SharedTransition.getState(owner.id);
|
|
144
|
+
SharedTransitionHelper.interactiveFinish(state, this.interactiveState, 'page');
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
PercentInteractiveController.ObjCProtocols = [UIViewControllerInteractiveTransitioning];
|
|
148
|
+
return PercentInteractiveController;
|
|
149
|
+
}(UIPercentDrivenInteractiveTransition));
|
|
150
|
+
var PageTransitionController = /** @class */ (function (_super) {
|
|
151
|
+
__extends(PageTransitionController, _super);
|
|
152
|
+
function PageTransitionController() {
|
|
153
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
154
|
+
}
|
|
155
|
+
PageTransitionController.initWithOwner = function (owner) {
|
|
156
|
+
var ctrl = PageTransitionController.new();
|
|
157
|
+
ctrl.owner = owner;
|
|
158
|
+
return ctrl;
|
|
159
|
+
};
|
|
160
|
+
PageTransitionController.prototype.transitionDuration = function (transitionContext) {
|
|
161
|
+
var owner = this.owner.deref();
|
|
162
|
+
if (owner) {
|
|
163
|
+
return owner.getDuration();
|
|
164
|
+
}
|
|
165
|
+
return DEFAULT_DURATION;
|
|
166
|
+
};
|
|
167
|
+
PageTransitionController.prototype.animateTransition = function (transitionContext) {
|
|
168
|
+
var owner = this.owner.deref();
|
|
169
|
+
if (owner) {
|
|
170
|
+
// console.log('--- PageTransitionController animateTransition');
|
|
171
|
+
var state = SharedTransition.getState(owner.id);
|
|
172
|
+
if (!state) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
SharedTransitionHelper.animate(state, transitionContext, 'page');
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
PageTransitionController.ObjCProtocols = [UIViewControllerAnimatedTransitioning];
|
|
179
|
+
return PageTransitionController;
|
|
180
|
+
}(NSObject));
|
|
199
181
|
//# sourceMappingURL=page-transition.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-transition.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/page-transition.ios.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page-transition.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/page-transition.ios.ts"],"names":[],"mappings":"AACA,OAAO,EAAiD,UAAU,EAAE,MAAM,GAAG,CAAC;AAG9E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAuB,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAiC,gBAAgB,EAAiE,MAAM,qBAAqB,CAAC;AACvK,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,MAAM,OAAO,cAAe,SAAQ,UAAU;IAiB7C,sBAAsB,CAAC,oBAA4C,EAAE,SAAiB,EAAE,MAAwB,EAAE,IAAsB;QACvI,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;SACzB;QACD,IAAI,CAAC,oBAAoB,GAAG,wBAAwB,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACtF,sEAAsE;QAEtE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IAClC,CAAC;IAED,qBAAqB,CAAC,QAA+C;QACpE,8CAA8C;QAC9C,IAAI,CAAC,qBAAqB,GAAG,4BAA4B,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3F,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACnC,CAAC;IAED,uBAAuB,CAAC,aAAyB,EAAE,IAAU;QAC5D,iDA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,EAAE,EAAE;gCACrC,oBAAoB,EAAE,IAAI;6BAC1B,CAAC,CAAC;4BACH,IAAI,CAAC,qBAAqB,CAAC,2BAA2B,EAAE,CAAC;yBACzD;qBACD;oBACD,MAAM;aACP;SACD;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-transition-helper.android.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/shared-transition-helper.android.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,sBAAsB;IAClC,MAAM,CAAC,OAAO,CAAC,KAA4B,EAAE,iBAAsB,EAAE,IAAsB;QAC1F,6DAA6D;IAC9D,CAAC;CACD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SharedTransitionType, SharedInteractiveState } from '.';
|
|
2
|
+
import type { SharedTransitionState } from './shared-transition';
|
|
3
|
+
|
|
4
|
+
export declare class SharedTransitionHelper {
|
|
5
|
+
static animate(state: SharedTransitionState, transitionContext: any /* iOS: UIViewControllerContextTransitioning */, type: SharedTransitionType): void;
|
|
6
|
+
static interactiveStart(state: SharedTransitionState, interactiveState: SharedInteractiveState, type: SharedTransitionType): void;
|
|
7
|
+
static interactiveUpdate(state: SharedTransitionState, interactiveState: SharedInteractiveState, type: SharedTransitionType, percent: number): void;
|
|
8
|
+
static interactiveCancel(state: SharedTransitionState, interactiveState: SharedInteractiveState, type: SharedTransitionType): void;
|
|
9
|
+
static interactiveFinish(state: SharedTransitionState, interactiveState: SharedInteractiveState, type: SharedTransitionType): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SharedInteractiveState, SharedTransitionType } from '.';
|
|
2
|
+
import { SharedTransitionState } from './shared-transition';
|
|
3
|
+
export declare class SharedTransitionHelper {
|
|
4
|
+
static animate(state: SharedTransitionState, transitionContext: UIViewControllerContextTransitioning, type: SharedTransitionType): void;
|
|
5
|
+
static interactiveStart(state: SharedTransitionState, interactiveState: SharedInteractiveState, type: SharedTransitionType): void;
|
|
6
|
+
static interactiveUpdate(state: SharedTransitionState, interactiveState: SharedInteractiveState, type: SharedTransitionType, percent: number): void;
|
|
7
|
+
static interactiveCancel(state: SharedTransitionState, interactiveState: SharedInteractiveState, type: SharedTransitionType): void;
|
|
8
|
+
static interactiveFinish(state: SharedTransitionState, interactiveState: SharedInteractiveState, type: SharedTransitionType): void;
|
|
9
|
+
}
|