@nativescript/core 8.5.0-alpha.3 → 8.5.0-alpha.5

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.
@@ -0,0 +1,429 @@
1
+ import { getPageStartDefaultsForType, getRectFromProps, getSpringFromProps, SharedTransition, SharedTransitionAnimationType } from './shared-transition';
2
+ import { isNumber } from '../../utils/types';
3
+ import { Screen } from '../../platform';
4
+ import { iOSNativeHelper } from '../../utils/native-helper';
5
+ export class SharedTransitionHelper {
6
+ static animate(state, transitionContext, type) {
7
+ const transition = state.instance;
8
+ setTimeout(() => {
9
+ // Run on next tick
10
+ // ensures that existing UI state finishes before snapshotting
11
+ // (eg, button touch up state)
12
+ switch (state.activeType) {
13
+ case SharedTransitionAnimationType.present: {
14
+ // console.log('-- Transition present --');
15
+ SharedTransition.events().notify({
16
+ eventName: SharedTransition.startedEvent,
17
+ });
18
+ if (type === 'modal') {
19
+ transitionContext.containerView.addSubview(transition.presented.view);
20
+ }
21
+ else if (type === 'page') {
22
+ transitionContext.containerView.insertSubviewAboveSubview(transition.presented.view, transition.presenting.view);
23
+ }
24
+ transition.presented.view.layoutIfNeeded();
25
+ const { sharedElements, presented, presenting } = SharedTransition.getSharedElements(state.page, state.toPage);
26
+ if (SharedTransition.DEBUG) {
27
+ console.log(' ModalTransition: Present');
28
+ console.log(`1. Found sharedTransitionTags to animate:`, sharedElements.map((v) => v.sharedTransitionTag));
29
+ console.log(`2. Take snapshots of shared elements and position them based on presenting view:`);
30
+ }
31
+ const pageStart = state.pageStart;
32
+ const startFrame = getRectFromProps(pageStart, getPageStartDefaultsForType(type));
33
+ const pageEnd = state.pageEnd;
34
+ const pageEndIndependentTags = Object.keys(pageEnd?.sharedTransitionTags || {});
35
+ // console.log('pageEndIndependentTags:', pageEndIndependentTags);
36
+ for (const presentingView of sharedElements) {
37
+ if (!transition.sharedElements) {
38
+ transition.sharedElements = {
39
+ presented: [],
40
+ presenting: [],
41
+ independent: [],
42
+ };
43
+ }
44
+ const presentingSharedElement = presentingView.ios;
45
+ // console.log('fromTarget instanceof UIImageView:', fromTarget instanceof UIImageView)
46
+ // TODO: discuss whether we should check if UIImage/UIImageView type to always snapshot images or if other view types could be duped/added vs. snapshotted
47
+ // Note: snapshot may be most efficient/simple
48
+ // console.log('---> ', presentingView.sharedTransitionTag, ': ', presentingSharedElement)
49
+ const presentedView = presented.find((v) => v.sharedTransitionTag === presentingView.sharedTransitionTag);
50
+ const presentedSharedElement = presentedView.ios;
51
+ const snapshot = UIImageView.alloc().init();
52
+ // treat images differently...
53
+ if (presentedSharedElement instanceof UIImageView) {
54
+ // in case the image is loaded async, we need to update the snapshot when it changes
55
+ // todo: remove listener on transition end
56
+ presentedView.on('imageSourceChange', () => {
57
+ snapshot.image = iOSNativeHelper.snapshotView(presentedSharedElement, Screen.mainScreen.scale);
58
+ snapshot.tintColor = presentedSharedElement.tintColor;
59
+ });
60
+ snapshot.tintColor = presentedSharedElement.tintColor;
61
+ snapshot.contentMode = presentedSharedElement.contentMode;
62
+ }
63
+ iOSNativeHelper.copyLayerProperties(snapshot, presentingSharedElement);
64
+ snapshot.clipsToBounds = true;
65
+ // console.log('---> snapshot: ', snapshot);
66
+ const startFrame = presentingSharedElement.convertRectToView(presentingSharedElement.bounds, transitionContext.containerView);
67
+ const endFrame = presentedSharedElement.convertRectToView(presentedSharedElement.bounds, transitionContext.containerView);
68
+ snapshot.frame = startFrame;
69
+ if (SharedTransition.DEBUG) {
70
+ console.log('---> ', presentingView.sharedTransitionTag, ' frame:', iOSNativeHelper.printCGRect(snapshot.frame));
71
+ }
72
+ transition.sharedElements.presenting.push({
73
+ view: presentingView,
74
+ startFrame,
75
+ endFrame,
76
+ snapshot,
77
+ startOpacity: presentingView.opacity,
78
+ endOpacity: presentedView.opacity,
79
+ });
80
+ transition.sharedElements.presented.push({
81
+ view: presentedView,
82
+ startFrame: endFrame,
83
+ endFrame: startFrame,
84
+ startOpacity: presentedView.opacity,
85
+ endOpacity: presentingView.opacity,
86
+ });
87
+ // set initial opacity to match the source view opacity
88
+ snapshot.alpha = presentingView.opacity;
89
+ // hide both while animating within the transition context
90
+ presentingView.opacity = 0;
91
+ presentedView.opacity = 0;
92
+ // add snapshot to animate
93
+ transitionContext.containerView.addSubview(snapshot);
94
+ }
95
+ for (const tag of pageEndIndependentTags) {
96
+ // only consider start when there's a matching end
97
+ const pageStartIndependentProps = pageStart?.sharedTransitionTags[tag];
98
+ console.log('start:', tag, pageStartIndependentProps);
99
+ const pageEndIndependentProps = pageEnd?.sharedTransitionTags[tag];
100
+ let independentView = presenting.find((v) => v.sharedTransitionTag === tag);
101
+ let isPresented = false;
102
+ if (!independentView) {
103
+ independentView = presented.find((v) => v.sharedTransitionTag === tag);
104
+ if (!independentView) {
105
+ break;
106
+ }
107
+ isPresented = true;
108
+ }
109
+ const independentSharedElement = independentView.ios;
110
+ let snapshot;
111
+ // if (isPresented) {
112
+ // snapshot = UIImageView.alloc().init();
113
+ // } else {
114
+ snapshot = UIImageView.alloc().initWithImage(iOSNativeHelper.snapshotView(independentSharedElement, Screen.mainScreen.scale));
115
+ // }
116
+ if (independentSharedElement instanceof UIImageView) {
117
+ // in case the image is loaded async, we need to update the snapshot when it changes
118
+ // todo: remove listener on transition end
119
+ // if (isPresented) {
120
+ // independentView.on('imageSourceChange', () => {
121
+ // snapshot.image = iOSNativeHelper.snapshotView(independentSharedElement, Screen.mainScreen.scale);
122
+ // snapshot.tintColor = independentSharedElement.tintColor;
123
+ // });
124
+ // }
125
+ snapshot.tintColor = independentSharedElement.tintColor;
126
+ snapshot.contentMode = independentSharedElement.contentMode;
127
+ }
128
+ snapshot.clipsToBounds = true;
129
+ const startFrame = independentSharedElement.convertRectToView(independentSharedElement.bounds, transitionContext.containerView);
130
+ const startFrameRect = getRectFromProps(pageStartIndependentProps);
131
+ // adjust for any specified start positions
132
+ const startFrameAdjusted = CGRectMake(startFrame.origin.x + startFrameRect.x, startFrame.origin.y + startFrameRect.y, startFrame.size.width, startFrame.size.height);
133
+ console.log('startFrameAdjusted:', tag, iOSNativeHelper.printCGRect(startFrameAdjusted));
134
+ // if (pageStartIndependentProps?.scale) {
135
+ // snapshot.transform = CGAffineTransformConcat(CGAffineTransformMakeTranslation(startFrameAdjusted.origin.x, startFrameAdjusted.origin.y), CGAffineTransformMakeScale(pageStartIndependentProps.scale.x, pageStartIndependentProps.scale.y))
136
+ // } else {
137
+ snapshot.frame = startFrame; //startFrameAdjusted;
138
+ // }
139
+ if (SharedTransition.DEBUG) {
140
+ console.log('---> ', independentView.sharedTransitionTag, ' frame:', iOSNativeHelper.printCGRect(snapshot.frame));
141
+ }
142
+ const endFrameRect = getRectFromProps(pageEndIndependentProps);
143
+ const endFrame = CGRectMake(startFrame.origin.x + endFrameRect.x, startFrame.origin.y + endFrameRect.y, startFrame.size.width, startFrame.size.height);
144
+ console.log('endFrame:', tag, iOSNativeHelper.printCGRect(endFrame));
145
+ transition.sharedElements.independent.push({
146
+ view: independentView,
147
+ isPresented,
148
+ startFrame,
149
+ snapshot,
150
+ endFrame,
151
+ startTransform: independentSharedElement.transform,
152
+ scale: pageEndIndependentProps.scale,
153
+ startOpacity: independentView.opacity,
154
+ endOpacity: isNumber(pageEndIndependentProps.opacity) ? pageEndIndependentProps.opacity : 0,
155
+ });
156
+ independentView.opacity = 0;
157
+ // add snapshot to animate
158
+ transitionContext.containerView.addSubview(snapshot);
159
+ }
160
+ // Important: always set after above shared element positions have had their start positions set
161
+ transition.presented.view.alpha = isNumber(pageStart?.opacity) ? pageStart?.opacity : 0;
162
+ transition.presented.view.frame = CGRectMake(startFrame.x, startFrame.y, startFrame.width, startFrame.height);
163
+ const cleanupPresent = () => {
164
+ for (const presented of transition.sharedElements.presented) {
165
+ presented.view.opacity = presented.startOpacity;
166
+ }
167
+ for (const presenting of transition.sharedElements.presenting) {
168
+ presenting.snapshot.removeFromSuperview();
169
+ }
170
+ for (const independent of transition.sharedElements.independent) {
171
+ independent.snapshot.removeFromSuperview();
172
+ if (independent.isPresented) {
173
+ independent.view.opacity = independent.startOpacity;
174
+ }
175
+ }
176
+ SharedTransition.updateState(transition.id, {
177
+ activeType: SharedTransitionAnimationType.dismiss,
178
+ });
179
+ if (type === 'page') {
180
+ transition.presenting.view.removeFromSuperview();
181
+ }
182
+ transitionContext.completeTransition(true);
183
+ SharedTransition.events().notify({
184
+ eventName: SharedTransition.finishedEvent,
185
+ });
186
+ };
187
+ const animateProperties = () => {
188
+ if (SharedTransition.DEBUG) {
189
+ console.log('3. Animating shared elements:');
190
+ }
191
+ transition.presented.view.alpha = isNumber(pageEnd?.opacity) ? pageEnd?.opacity : 1;
192
+ const endFrame = getRectFromProps(pageEnd);
193
+ transition.presented.view.frame = CGRectMake(endFrame.x, endFrame.y, endFrame.width, endFrame.height);
194
+ // animate page properties to the following:
195
+ // https://stackoverflow.com/a/27997678/1418981
196
+ // In order to have proper layout. Seems mostly needed when presenting.
197
+ // For instance during presentation, destination view doesn't account navigation bar height.
198
+ // Not sure if best to leave all the time?
199
+ // owner.presented.view.setNeedsLayout();
200
+ // owner.presented.view.layoutIfNeeded();
201
+ for (const presented of transition.sharedElements.presented) {
202
+ const presentingMatch = transition.sharedElements.presenting.find((v) => v.view.sharedTransitionTag === presented.view.sharedTransitionTag);
203
+ // Workaround wrong origin due ongoing layout process.
204
+ const updatedEndFrame = presented.view.ios.convertRectToView(presented.view.ios.bounds, transitionContext.containerView);
205
+ const correctedEndFrame = CGRectMake(updatedEndFrame.origin.x, updatedEndFrame.origin.y, presentingMatch.endFrame.size.width, presentingMatch.endFrame.size.height);
206
+ presentingMatch.snapshot.frame = correctedEndFrame;
207
+ // apply view and layer properties to the snapshot view to match the source/presented view
208
+ iOSNativeHelper.copyLayerProperties(presentingMatch.snapshot, presented.view.ios);
209
+ // create a snapshot of the presented view
210
+ presentingMatch.snapshot.image = iOSNativeHelper.snapshotView(presented.view.ios, Screen.mainScreen.scale);
211
+ // apply correct alpha
212
+ presentingMatch.snapshot.alpha = presentingMatch.endOpacity;
213
+ if (SharedTransition.DEBUG) {
214
+ console.log(`---> ${presentingMatch.view.sharedTransitionTag} animate to: `, iOSNativeHelper.printCGRect(correctedEndFrame));
215
+ }
216
+ }
217
+ for (const independent of transition.sharedElements.independent) {
218
+ let endFrame = independent.endFrame;
219
+ // if (independent.isPresented) {
220
+ // const updatedEndFrame = independent.view.ios.convertRectToView(independent.view.ios.bounds, transitionContext.containerView);
221
+ // endFrame = CGRectMake(updatedEndFrame.origin.x, updatedEndFrame.origin.y, independent.endFrame.size.width, independent.endFrame.size.height);
222
+ // }
223
+ if (independent.scale) {
224
+ independent.snapshot.transform = CGAffineTransformConcat(CGAffineTransformMakeTranslation(endFrame.origin.x, endFrame.origin.y), CGAffineTransformMakeScale(independent.scale.x, independent.scale.y));
225
+ }
226
+ else {
227
+ independent.snapshot.frame = endFrame;
228
+ }
229
+ independent.snapshot.alpha = independent.endOpacity;
230
+ if (SharedTransition.DEBUG) {
231
+ console.log(`---> ${independent.view.sharedTransitionTag} animate to: `, iOSNativeHelper.printCGRect(independent.endFrame));
232
+ }
233
+ }
234
+ };
235
+ if (isNumber(pageEnd?.duration)) {
236
+ // override spring and use only linear animation
237
+ UIView.animateWithDurationAnimationsCompletion(pageEnd?.duration / 1000, () => {
238
+ animateProperties();
239
+ }, () => {
240
+ cleanupPresent();
241
+ });
242
+ }
243
+ else {
244
+ iOSNativeHelper.animateWithSpring({
245
+ ...getSpringFromProps(pageEnd?.spring),
246
+ animations: () => {
247
+ animateProperties();
248
+ },
249
+ completion: () => {
250
+ cleanupPresent();
251
+ },
252
+ });
253
+ }
254
+ break;
255
+ }
256
+ case SharedTransitionAnimationType.dismiss: {
257
+ // console.log('-- Transition dismiss --');
258
+ SharedTransition.events().notify({
259
+ eventName: SharedTransition.startedEvent,
260
+ });
261
+ if (type === 'page') {
262
+ transitionContext.containerView.insertSubviewBelowSubview(transition.presenting.view, transition.presented.view);
263
+ }
264
+ // console.log('transitionContext.containerView.subviews.count:', transitionContext.containerView.subviews.count);
265
+ if (SharedTransition.DEBUG) {
266
+ console.log(' ModalTransition: Dismiss');
267
+ console.log(`1. Dismiss sharedTransitionTags to animate:`, transition.sharedElements.presented.map((p) => p.view.sharedTransitionTag));
268
+ console.log(`2. Add back previously stored sharedElements to dismiss:`);
269
+ }
270
+ for (const p of transition.sharedElements.presented) {
271
+ p.view.opacity = 0;
272
+ }
273
+ for (const p of transition.sharedElements.presenting) {
274
+ p.snapshot.alpha = p.endOpacity;
275
+ transitionContext.containerView.addSubview(p.snapshot);
276
+ }
277
+ for (const independent of transition.sharedElements.independent) {
278
+ independent.snapshot.alpha = independent.endOpacity;
279
+ transitionContext.containerView.addSubview(independent.snapshot);
280
+ }
281
+ const pageReturn = state.pageReturn;
282
+ const cleanupDismiss = () => {
283
+ for (const presenting of transition.sharedElements.presenting) {
284
+ presenting.view.opacity = presenting.startOpacity;
285
+ presenting.snapshot.removeFromSuperview();
286
+ }
287
+ for (const independent of transition.sharedElements.independent) {
288
+ independent.view.opacity = independent.startOpacity;
289
+ independent.snapshot.removeFromSuperview();
290
+ }
291
+ SharedTransition.finishState(transition.id);
292
+ transition.sharedElements = null;
293
+ transitionContext.completeTransition(true);
294
+ SharedTransition.events().notify({
295
+ eventName: SharedTransition.finishedEvent,
296
+ });
297
+ };
298
+ const animateProperties = () => {
299
+ if (SharedTransition.DEBUG) {
300
+ console.log('3. Dismissing shared elements:');
301
+ }
302
+ transition.presented.view.alpha = isNumber(pageReturn?.opacity) ? pageReturn?.opacity : 0;
303
+ const endFrame = getRectFromProps(pageReturn, getPageStartDefaultsForType(type));
304
+ transition.presented.view.frame = CGRectMake(endFrame.x, endFrame.y, endFrame.width, endFrame.height);
305
+ for (const presenting of transition.sharedElements.presenting) {
306
+ iOSNativeHelper.copyLayerProperties(presenting.snapshot, presenting.view.ios);
307
+ presenting.snapshot.frame = presenting.startFrame;
308
+ presenting.snapshot.alpha = presenting.startOpacity;
309
+ if (SharedTransition.DEBUG) {
310
+ console.log(`---> ${presenting.view.sharedTransitionTag} animate to: `, iOSNativeHelper.printCGRect(presenting.startFrame));
311
+ }
312
+ }
313
+ for (const independent of transition.sharedElements.independent) {
314
+ independent.snapshot.alpha = independent.startOpacity;
315
+ if (independent.scale) {
316
+ independent.snapshot.transform = independent.startTransform;
317
+ }
318
+ else {
319
+ independent.snapshot.frame = independent.startFrame;
320
+ }
321
+ if (SharedTransition.DEBUG) {
322
+ console.log(`---> ${independent.view.sharedTransitionTag} animate to: `, iOSNativeHelper.printCGRect(independent.startFrame));
323
+ }
324
+ }
325
+ };
326
+ if (isNumber(pageReturn?.duration)) {
327
+ // override spring and use only linear animation
328
+ UIView.animateWithDurationAnimationsCompletion(pageReturn?.duration / 1000, () => {
329
+ animateProperties();
330
+ }, () => {
331
+ cleanupDismiss();
332
+ });
333
+ }
334
+ else {
335
+ iOSNativeHelper.animateWithSpring({
336
+ ...getSpringFromProps(pageReturn?.spring),
337
+ animations: () => {
338
+ animateProperties();
339
+ },
340
+ completion: () => {
341
+ cleanupDismiss();
342
+ },
343
+ });
344
+ }
345
+ break;
346
+ }
347
+ }
348
+ });
349
+ }
350
+ static interactiveStart(state, interactiveState, type) {
351
+ SharedTransition.events().notify({
352
+ eventName: SharedTransition.startedEvent,
353
+ });
354
+ switch (type) {
355
+ case 'page':
356
+ interactiveState.transitionContext.containerView.insertSubviewBelowSubview(state.instance.presenting.view, state.instance.presented.view);
357
+ break;
358
+ }
359
+ }
360
+ static interactiveUpdate(state, interactiveState, type, percent) {
361
+ if (!interactiveState.added) {
362
+ interactiveState.added = true;
363
+ for (const p of state.instance.sharedElements.presented) {
364
+ p.view.opacity = 0;
365
+ }
366
+ for (const p of state.instance.sharedElements.presenting) {
367
+ p.snapshot.alpha = p.endOpacity;
368
+ interactiveState.transitionContext.containerView.addSubview(p.snapshot);
369
+ }
370
+ const pageStart = state.pageStart;
371
+ const startFrame = getRectFromProps(pageStart, getPageStartDefaultsForType(type));
372
+ interactiveState.propertyAnimator = UIViewPropertyAnimator.alloc().initWithDurationDampingRatioAnimations(1, 1, () => {
373
+ for (const p of state.instance.sharedElements.presenting) {
374
+ p.snapshot.frame = p.startFrame;
375
+ iOSNativeHelper.copyLayerProperties(p.snapshot, p.view.ios);
376
+ p.snapshot.alpha = 1;
377
+ }
378
+ state.instance.presented.view.alpha = isNumber(state.pageReturn?.opacity) ? state.pageReturn?.opacity : 0;
379
+ state.instance.presented.view.frame = CGRectMake(startFrame.x, startFrame.y, state.instance.presented.view.bounds.size.width, state.instance.presented.view.bounds.size.height);
380
+ });
381
+ }
382
+ interactiveState.propertyAnimator.fractionComplete = percent;
383
+ }
384
+ static interactiveCancel(state, interactiveState, type) {
385
+ if (state.instance && interactiveState.added && interactiveState.propertyAnimator) {
386
+ interactiveState.propertyAnimator.reversed = true;
387
+ const duration = isNumber(state.pageStart?.duration) ? state.pageStart?.duration / 1000 : 0.35;
388
+ interactiveState.propertyAnimator.continueAnimationWithTimingParametersDurationFactor(null, duration);
389
+ setTimeout(() => {
390
+ for (const p of state.instance.sharedElements.presented) {
391
+ p.view.opacity = 1;
392
+ }
393
+ for (const p of state.instance.sharedElements.presenting) {
394
+ p.snapshot.removeFromSuperview();
395
+ }
396
+ state.instance.presented.view.alpha = 1;
397
+ interactiveState.propertyAnimator = null;
398
+ interactiveState.added = false;
399
+ interactiveState.transitionContext.cancelInteractiveTransition();
400
+ interactiveState.transitionContext.completeTransition(false);
401
+ SharedTransition.events().notify({
402
+ eventName: SharedTransition.cancelledEvent,
403
+ });
404
+ }, duration * 1000);
405
+ }
406
+ }
407
+ static interactiveFinish(state, interactiveState, type) {
408
+ if (state.instance && interactiveState.added && interactiveState.propertyAnimator) {
409
+ interactiveState.propertyAnimator.reversed = false;
410
+ const duration = isNumber(state.pageReturn?.duration) ? state.pageReturn?.duration / 1000 : 0.35;
411
+ interactiveState.propertyAnimator.continueAnimationWithTimingParametersDurationFactor(null, duration);
412
+ setTimeout(() => {
413
+ for (const presenting of state.instance.sharedElements.presenting) {
414
+ presenting.view.opacity = presenting.startOpacity;
415
+ presenting.snapshot.removeFromSuperview();
416
+ }
417
+ SharedTransition.finishState(state.instance.id);
418
+ interactiveState.propertyAnimator = null;
419
+ interactiveState.added = false;
420
+ interactiveState.transitionContext.finishInteractiveTransition();
421
+ interactiveState.transitionContext.completeTransition(true);
422
+ SharedTransition.events().notify({
423
+ eventName: SharedTransition.finishedEvent,
424
+ });
425
+ }, duration * 1000);
426
+ }
427
+ }
428
+ }
429
+ //# sourceMappingURL=shared-transition-helper.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-transition-helper.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/shared-transition-helper.ios.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,6BAA6B,EAAyB,MAAM,qBAAqB,CAAC;AAChL,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAK5D,MAAM,OAAO,sBAAsB;IAClC,MAAM,CAAC,OAAO,CAAC,KAA4B,EAAE,iBAAuD,EAAE,IAA0B;QAC/H,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC;QAClC,UAAU,CAAC,GAAG,EAAE;YACf,mBAAmB;YACnB,8DAA8D;YAC9D,8BAA8B;YAC9B,QAAQ,KAAK,CAAC,UAAU,EAAE;gBACzB,KAAK,6BAA6B,CAAC,OAAO,CAAC,CAAC;oBAC3C,2CAA2C;oBAC3C,gBAAgB,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC;wBAChC,SAAS,EAAE,gBAAgB,CAAC,YAAY;qBACxC,CAAC,CAAC;oBAEH,IAAI,IAAI,KAAK,OAAO,EAAE;wBACrB,iBAAiB,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU,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CAAC,MAAM,EAAE,CAAC,MAAM,CAAC;oBAChC,SAAS,EAAE,gBAAgB,CAAC,aAAa;iBACzC,CAAC,CAAC;YACJ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC,CAAC;SACpB;IACF,CAAC;CACD"}
@@ -1,4 +1,5 @@
1
1
  import type { Transition } from '.';
2
+ import { Observable } from '../../data/observable';
2
3
  import { ViewBase } from '../core/view-base';
3
4
  import type { View } from '../core/view';
4
5
  import type { PanGestureEventData } from '../gestures';
@@ -6,6 +7,9 @@ export declare const DEFAULT_DURATION = 0.35;
6
7
  export declare const DEFAULT_SPRING: {
7
8
  tension: number;
8
9
  friction: number;
10
+ mass: number;
11
+ velocity: number;
12
+ delay: number;
9
13
  };
10
14
  export declare enum SharedTransitionAnimationType {
11
15
  present = 0,
@@ -27,10 +31,6 @@ export interface SharedTransitionInteractiveOptions {
27
31
  percentFormula?: (eventData: PanGestureEventData) => number;
28
32
  }
29
33
  export interface SharedTransitionConfig {
30
- /**
31
- * Page which will start the transition.
32
- */
33
- page?: ViewBase;
34
34
  /**
35
35
  * Preconfigured transition or your own custom configured one.
36
36
  */
@@ -48,45 +48,61 @@ export interface SharedTransitionConfig {
48
48
  /**
49
49
  * View settings to start your transition.
50
50
  */
51
- toPageStart?: SharedTransitionPageProperties;
51
+ pageStart?: SharedTransitionPageProperties;
52
52
  /**
53
53
  * View settings to end your transition.
54
54
  */
55
- toPageEnd?: SharedTransitionPageProperties;
55
+ pageEnd?: SharedTransitionPageProperties;
56
56
  /**
57
57
  * View settings to end your transition for the 'from' (aka outgoing or dismissed) page.
58
58
  */
59
- fromPageEnd?: SharedTransitionPageProperties;
59
+ pageReturn?: SharedTransitionPageProperties;
60
60
  }
61
61
  export interface SharedTransitionState extends SharedTransitionConfig {
62
+ /**
63
+ * Page which will start the transition.
64
+ */
65
+ page?: ViewBase;
62
66
  activeType?: SharedTransitionAnimationType;
63
67
  toPage?: ViewBase;
64
68
  interactiveBegan?: boolean;
65
69
  interactiveCancelled?: boolean;
66
70
  }
67
- type SharedTransitionPageProperties = {
71
+ export type SharedRect = {
68
72
  x?: number;
69
73
  y?: number;
70
74
  width?: number;
71
75
  height?: number;
76
+ };
77
+ export type SharedProperties = SharedRect & {
72
78
  opacity?: number;
79
+ scale?: {
80
+ x?: number;
81
+ y?: number;
82
+ };
83
+ };
84
+ export type SharedSpringProperties = {
85
+ tension?: number;
86
+ friction?: number;
87
+ mass?: number;
88
+ delay?: number;
89
+ velocity?: number;
90
+ animateOptions?: any;
91
+ };
92
+ type SharedTransitionPageProperties = SharedProperties & {
73
93
  /**
74
94
  * Linear duration in milliseconds
75
95
  * Note: When this is defined, it will override spring options and use only linear animation.
76
96
  */
77
97
  duration?: number;
98
+ sharedTransitionTags?: {
99
+ [key: string]: SharedProperties;
100
+ };
78
101
  /**
79
102
  * Spring animation settings.
80
103
  * Defaults to 140 tension with 10 friction.
81
104
  */
82
- spring?: {
83
- tension?: number;
84
- friction?: number;
85
- mass?: number;
86
- delay?: number;
87
- velocity?: number;
88
- animateOptions?: any;
89
- };
105
+ spring?: SharedSpringProperties;
90
106
  };
91
107
  /**
92
108
  * Shared Element Transitions (preview)
@@ -103,6 +119,10 @@ export declare class SharedTransition {
103
119
  static custom(transition: Transition, options?: SharedTransitionConfig): {
104
120
  instance: Transition;
105
121
  };
122
+ static events(): Observable;
123
+ static startedEvent: string;
124
+ static finishedEvent: string;
125
+ static cancelledEvent: string;
106
126
  /**
107
127
  * Enable to see various console logging output of Shared Element Transition behavior.
108
128
  */
@@ -135,4 +155,18 @@ export declare class SharedTransition {
135
155
  presenting: Array<View>;
136
156
  };
137
157
  }
158
+ export declare function getRectFromProps(props: SharedTransitionPageProperties, defaults?: SharedRect): SharedRect;
159
+ export declare function getSpringFromProps(props: SharedSpringProperties): {
160
+ tension: number;
161
+ friction: number;
162
+ mass: number;
163
+ velocity: number;
164
+ delay: number;
165
+ };
166
+ export declare function getPageStartDefaultsForType(type: 'page' | 'modal'): {
167
+ x: number;
168
+ y: number;
169
+ width: number;
170
+ height: number;
171
+ };
138
172
  export {};