@nativescript/core 8.5.0-alpha.2 → 8.5.0-alpha.3
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 +2 -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 +9 -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 +6 -1
- package/ui/transition/modal-transition.ios.js +287 -79
- 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 +21 -1
- package/ui/transition/page-transition.ios.js +471 -181
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition.d.ts +80 -7
- package/ui/transition/shared-transition.js +37 -8
- 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 +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.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AAgB,EAAE,IAAI;wBACtB,oBAAoB,EAAE,KAAK;qBAC3B,CAAC,CAAC;oBACH,IAAI,IAAI,CAAC,yBAAyB,EAAE;wBACnC,IAAI,CAAC,yBAAyB,EAAE,CAAC;qBACjC;oBACD,MAAM;gBACP,KAAK,iBAAiB,CAAC,OAAO;oBAC7B,IAAI,OAAO,GAAG,CAAC,EAAE;wBAChB,IAAI,IAAI,CAAC,qBAAqB,EAAE;4BAC/B,IAAI,CAAC,qBAAqB,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;yBAChE;qBACD;oBACD,MAAM;gBACP,KAAK,iBAAiB,CAAC,SAAS,CAAC;gBACjC,KAAK,iBAAiB,CAAC,KAAK;oBAC3B,IAAI,IAAI,CAAC,qBAAqB,EAAE;wBAC/B,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC;wBAChI,IAAI,OAAO,GAAG,eAAe,EAAE;4BAC9B,IAAI,IAAI,CAAC,2BAA2B,EAAE;gCACrC,IAAI,CAAC,2BAA2B,EAAE,CAAC;gCACnC,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAC;6BACxC;4BACD,IAAI,CAAC,qBAAqB,CAAC,2BAA2B,EAAE,CAAC;yBACzD;6BAAM;4BACN,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,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"}
|
|
@@ -1,20 +1,50 @@
|
|
|
1
1
|
import type { Transition } from '.';
|
|
2
2
|
import { ViewBase } from '../core/view-base';
|
|
3
3
|
import type { View } from '../core/view';
|
|
4
|
+
import type { PanGestureEventData } from '../gestures';
|
|
4
5
|
export declare const DEFAULT_DURATION = 0.35;
|
|
6
|
+
export declare const DEFAULT_SPRING: {
|
|
7
|
+
tension: number;
|
|
8
|
+
friction: number;
|
|
9
|
+
};
|
|
5
10
|
export declare enum SharedTransitionAnimationType {
|
|
6
11
|
present = 0,
|
|
7
12
|
dismiss = 1
|
|
8
13
|
}
|
|
14
|
+
export interface SharedTransitionInteractiveOptions {
|
|
15
|
+
/**
|
|
16
|
+
* When the pan exceeds this percentage and you let go, finish the transition.
|
|
17
|
+
* Default 0.5
|
|
18
|
+
*/
|
|
19
|
+
finishThreshold?: number;
|
|
20
|
+
/**
|
|
21
|
+
* You can create your own percent formula used for determing the interactive value.
|
|
22
|
+
* By default, we handle this via a formula like this for an interactive page back transition:
|
|
23
|
+
* - return eventData.deltaX / (eventData.ios.view.bounds.size.width / 2);
|
|
24
|
+
* @param eventData PanGestureEventData
|
|
25
|
+
* @returns The percentage value to be used as the finish/cancel threshold
|
|
26
|
+
*/
|
|
27
|
+
percentFormula?: (eventData: PanGestureEventData) => number;
|
|
28
|
+
}
|
|
9
29
|
export interface SharedTransitionConfig {
|
|
10
30
|
/**
|
|
11
|
-
* Page which will start the transition
|
|
31
|
+
* Page which will start the transition.
|
|
12
32
|
*/
|
|
13
33
|
page?: ViewBase;
|
|
14
34
|
/**
|
|
15
|
-
* Preconfigured transition or your own custom configured one
|
|
35
|
+
* Preconfigured transition or your own custom configured one.
|
|
16
36
|
*/
|
|
17
37
|
instance?: Transition;
|
|
38
|
+
/**
|
|
39
|
+
* Interactive transition settings. (iOS only at the moment)
|
|
40
|
+
*/
|
|
41
|
+
interactive?: {
|
|
42
|
+
/**
|
|
43
|
+
* Whether you want to allow interactive dismissal.
|
|
44
|
+
* Defaults to using 'pan' gesture for dismissal however you can customize your own.
|
|
45
|
+
*/
|
|
46
|
+
dismiss?: SharedTransitionInteractiveOptions;
|
|
47
|
+
};
|
|
18
48
|
/**
|
|
19
49
|
* View settings to start your transition.
|
|
20
50
|
*/
|
|
@@ -31,6 +61,8 @@ export interface SharedTransitionConfig {
|
|
|
31
61
|
export interface SharedTransitionState extends SharedTransitionConfig {
|
|
32
62
|
activeType?: SharedTransitionAnimationType;
|
|
33
63
|
toPage?: ViewBase;
|
|
64
|
+
interactiveBegan?: boolean;
|
|
65
|
+
interactiveCancelled?: boolean;
|
|
34
66
|
}
|
|
35
67
|
type SharedTransitionPageProperties = {
|
|
36
68
|
x?: number;
|
|
@@ -39,23 +71,64 @@ type SharedTransitionPageProperties = {
|
|
|
39
71
|
height?: number;
|
|
40
72
|
opacity?: number;
|
|
41
73
|
/**
|
|
42
|
-
*
|
|
74
|
+
* Linear duration in milliseconds
|
|
75
|
+
* Note: When this is defined, it will override spring options and use only linear animation.
|
|
43
76
|
*/
|
|
44
77
|
duration?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Spring animation settings.
|
|
80
|
+
* Defaults to 140 tension with 10 friction.
|
|
81
|
+
*/
|
|
82
|
+
spring?: {
|
|
83
|
+
tension?: number;
|
|
84
|
+
friction?: number;
|
|
85
|
+
mass?: number;
|
|
86
|
+
delay?: number;
|
|
87
|
+
velocity?: number;
|
|
88
|
+
animateOptions?: any;
|
|
89
|
+
};
|
|
45
90
|
};
|
|
46
91
|
/**
|
|
47
|
-
* Shared Element Transitions (
|
|
48
|
-
*
|
|
49
|
-
*
|
|
92
|
+
* Shared Element Transitions (preview)
|
|
93
|
+
* Allows you to auto animate between shared elements on two different screesn to create smooth navigational experiences.
|
|
94
|
+
* View components can define sharedTransitionTag="name" alone with a transition through this API.
|
|
50
95
|
*/
|
|
51
96
|
export declare class SharedTransition {
|
|
52
|
-
|
|
97
|
+
/**
|
|
98
|
+
* Configure a custom transition with presentation/dismissal options.
|
|
99
|
+
* @param transition The custom Transition instance.
|
|
100
|
+
* @param options
|
|
101
|
+
* @returns a configured SharedTransition instance for use with navigational APIs.
|
|
102
|
+
*/
|
|
103
|
+
static custom(transition: Transition, options?: SharedTransitionConfig): {
|
|
53
104
|
instance: Transition;
|
|
54
105
|
};
|
|
106
|
+
/**
|
|
107
|
+
* Enable to see various console logging output of Shared Element Transition behavior.
|
|
108
|
+
*/
|
|
109
|
+
static DEBUG: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* @private
|
|
112
|
+
*/
|
|
55
113
|
static currentStack: Array<SharedTransitionState>;
|
|
114
|
+
/**
|
|
115
|
+
* @private
|
|
116
|
+
*/
|
|
56
117
|
static updateState(id: number, state: SharedTransitionState): void;
|
|
118
|
+
/**
|
|
119
|
+
* @private
|
|
120
|
+
*/
|
|
57
121
|
static getState(id: number): SharedTransitionState;
|
|
122
|
+
/**
|
|
123
|
+
* @private
|
|
124
|
+
*/
|
|
58
125
|
static finishState(id: number): void;
|
|
126
|
+
/**
|
|
127
|
+
* Gather view collections based on sharedTransitionTag details.
|
|
128
|
+
* @param fromPage Page moving away from
|
|
129
|
+
* @param toPage Page moving to
|
|
130
|
+
* @returns Collections of views pertaining to shared elements or particular pages
|
|
131
|
+
*/
|
|
59
132
|
static getSharedElements(fromPage: ViewBase, toPage: ViewBase): {
|
|
60
133
|
sharedElements: Array<View>;
|
|
61
134
|
presented: Array<View>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { querySelectorAll } from '../core/view-base';
|
|
2
2
|
export const DEFAULT_DURATION = 0.35;
|
|
3
|
+
export const DEFAULT_SPRING = {
|
|
4
|
+
tension: 140,
|
|
5
|
+
friction: 10,
|
|
6
|
+
};
|
|
3
7
|
// always increment when adding new transitions to be able to track their state
|
|
4
8
|
export var SharedTransitionAnimationType;
|
|
5
9
|
(function (SharedTransitionAnimationType) {
|
|
@@ -7,19 +11,28 @@ export var SharedTransitionAnimationType;
|
|
|
7
11
|
SharedTransitionAnimationType[SharedTransitionAnimationType["dismiss"] = 1] = "dismiss";
|
|
8
12
|
})(SharedTransitionAnimationType || (SharedTransitionAnimationType = {}));
|
|
9
13
|
/**
|
|
10
|
-
* Shared Element Transitions (
|
|
11
|
-
*
|
|
12
|
-
*
|
|
14
|
+
* Shared Element Transitions (preview)
|
|
15
|
+
* Allows you to auto animate between shared elements on two different screesn to create smooth navigational experiences.
|
|
16
|
+
* View components can define sharedTransitionTag="name" alone with a transition through this API.
|
|
13
17
|
*/
|
|
14
18
|
export class SharedTransition {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Configure a custom transition with presentation/dismissal options.
|
|
21
|
+
* @param transition The custom Transition instance.
|
|
22
|
+
* @param options
|
|
23
|
+
* @returns a configured SharedTransition instance for use with navigational APIs.
|
|
24
|
+
*/
|
|
25
|
+
static custom(transition, options) {
|
|
26
|
+
SharedTransition.updateState(transition.id, {
|
|
27
|
+
...(options || {}),
|
|
28
|
+
instance: transition,
|
|
19
29
|
activeType: SharedTransitionAnimationType.present,
|
|
20
30
|
});
|
|
21
|
-
return { instance };
|
|
31
|
+
return { instance: transition };
|
|
22
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
23
36
|
static updateState(id, state) {
|
|
24
37
|
if (!SharedTransition.currentStack) {
|
|
25
38
|
SharedTransition.currentStack = [];
|
|
@@ -36,15 +49,27 @@ export class SharedTransition {
|
|
|
36
49
|
SharedTransition.currentStack.push(state);
|
|
37
50
|
}
|
|
38
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* @private
|
|
54
|
+
*/
|
|
39
55
|
static getState(id) {
|
|
40
56
|
return SharedTransition.currentStack.find((t) => t.instance.id === id);
|
|
41
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
42
61
|
static finishState(id) {
|
|
43
62
|
const index = SharedTransition.currentStack.findIndex((t) => t.instance.id === id);
|
|
44
63
|
if (index > -1) {
|
|
45
64
|
SharedTransition.currentStack.splice(index, 1);
|
|
46
65
|
}
|
|
47
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Gather view collections based on sharedTransitionTag details.
|
|
69
|
+
* @param fromPage Page moving away from
|
|
70
|
+
* @param toPage Page moving to
|
|
71
|
+
* @returns Collections of views pertaining to shared elements or particular pages
|
|
72
|
+
*/
|
|
48
73
|
static getSharedElements(fromPage, toPage) {
|
|
49
74
|
// 1. Presented view: gather all sharedTransitionTag views
|
|
50
75
|
const presentedSharedElements = querySelectorAll(toPage, 'sharedTransitionTag');
|
|
@@ -61,4 +86,8 @@ export class SharedTransition {
|
|
|
61
86
|
};
|
|
62
87
|
}
|
|
63
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Enable to see various console logging output of Shared Element Transition behavior.
|
|
91
|
+
*/
|
|
92
|
+
SharedTransition.DEBUG = false;
|
|
64
93
|
//# sourceMappingURL=shared-transition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-transition.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/shared-transition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAY,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"shared-transition.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/shared-transition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAY,MAAM,mBAAmB,CAAC;AAI/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,EAAE;CACZ,CAAC;AACF,+EAA+E;AAC/E,MAAM,CAAN,IAAY,6BAGX;AAHD,WAAY,6BAA6B;IACxC,uFAAO,CAAA;IACP,uFAAO,CAAA;AACR,CAAC,EAHW,6BAA6B,KAA7B,6BAA6B,QAGxC;AA+ED;;;;GAIG;AACH,MAAM,OAAO,gBAAgB;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,UAAsB,EAAE,OAAgC;QACrE,gBAAgB,CAAC,WAAW,CAA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ACD;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CACvB,QAAkB,EAClB,MAAgB;QAMhB,0DAA0D;QAC1D,MAAM,uBAAuB,GAAgB,gBAAgB,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;QAC7F,uFAAuF;QAEvF,2DAA2D;QAC3D,MAAM,wBAAwB,GAAgB,gBAAgB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;QAChG,yFAAyF;QAEzF,yEAAyE;QACzE,MAAM,aAAa,GAAG,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAChF,OAAO;YACN,cAAc,EAAE,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC;YACrG,SAAS,EAAE,uBAAuB;YAClC,UAAU,EAAE,wBAAwB;SACpC,CAAC;IACH,CAAC;;AAtED;;GAEG;AACI,sBAAK,GAAG,KAAK,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Transition } from '.';
|
|
2
2
|
export declare class SlideTransition extends Transition {
|
|
3
3
|
private _direction;
|
|
4
|
-
constructor(direction: string, duration
|
|
4
|
+
constructor(direction: string, duration?: number, curve?: any);
|
|
5
5
|
createAndroidAnimator(transitionType: string): android.animation.Animator;
|
|
6
6
|
toString(): string;
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ import lazy from '../../utils/lazy';
|
|
|
4
4
|
const screenWidth = lazy(() => Screen.mainScreen.widthPixels);
|
|
5
5
|
const screenHeight = lazy(() => Screen.mainScreen.heightPixels);
|
|
6
6
|
export class SlideTransition extends Transition {
|
|
7
|
-
constructor(direction, duration, curve) {
|
|
7
|
+
constructor(direction, duration = 350, curve) {
|
|
8
8
|
super(duration, curve);
|
|
9
9
|
this._direction = direction;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slide-transition.android.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/slide-transition.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAEpC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC9D,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAEhE,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAG9C,YAAY,SAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"slide-transition.android.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/slide-transition.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAEpC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC9D,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AAEhE,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAG9C,YAAY,SAAiB,EAAE,WAAmB,GAAG,EAAE,KAAW;QACjE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,qBAAqB,CAAC,cAAsB;QAClD,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,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OAAO,WAAW,CAAC;IACpB,CAAC;IAEM,QAAQ;QACd,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;IACjD,CAAC;CACD"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { Transition } from '.';
|
|
2
2
|
export declare class SlideTransition extends Transition {
|
|
3
|
-
|
|
3
|
+
transitionController: SlideTransitionController;
|
|
4
|
+
presented: UIViewController;
|
|
5
|
+
presenting: UIViewController;
|
|
6
|
+
operation: number;
|
|
7
|
+
direction: string;
|
|
4
8
|
constructor(direction: string, duration: number, curve: any);
|
|
5
|
-
|
|
9
|
+
iosNavigatedController(navigationController: UINavigationController, operation: number, fromVC: UIViewController, toVC: UIViewController): UIViewControllerAnimatedTransitioning;
|
|
10
|
+
}
|
|
11
|
+
export declare class SlideTransitionController extends NSObject implements UIViewControllerAnimatedTransitioning {
|
|
12
|
+
static ObjCProtocols: {
|
|
13
|
+
prototype: UIViewControllerAnimatedTransitioning;
|
|
14
|
+
}[];
|
|
15
|
+
owner: WeakRef<SlideTransition>;
|
|
16
|
+
static initWithOwner(owner: WeakRef<SlideTransition>): SlideTransitionController;
|
|
17
|
+
transitionDuration(transitionContext: UIViewControllerContextTransitioning): number;
|
|
18
|
+
animateTransition(transitionContext: UIViewControllerContextTransitioning): void;
|
|
6
19
|
}
|
|
@@ -1,61 +1,95 @@
|
|
|
1
1
|
import { Transition } from '.';
|
|
2
2
|
import { Screen } from '../../platform';
|
|
3
|
-
|
|
4
|
-
const rightEdge = CGAffineTransformMakeTranslation(Screen.mainScreen.widthDIPs, 0);
|
|
5
|
-
const topEdge = CGAffineTransformMakeTranslation(0, -Screen.mainScreen.heightDIPs);
|
|
6
|
-
const bottomEdge = CGAffineTransformMakeTranslation(0, Screen.mainScreen.heightDIPs);
|
|
3
|
+
import { DEFAULT_DURATION } from './shared-transition';
|
|
7
4
|
export class SlideTransition extends Transition {
|
|
8
5
|
constructor(direction, duration, curve) {
|
|
9
6
|
super(duration, curve);
|
|
10
|
-
this.
|
|
7
|
+
this.direction = direction;
|
|
11
8
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const push = operation === 1 /* UINavigationControllerOperation.Push */;
|
|
20
|
-
switch (this._direction) {
|
|
21
|
-
case 'left':
|
|
22
|
-
toViewBeginTransform = push ? rightEdge : leftEdge;
|
|
23
|
-
fromViewEndTransform = push ? leftEdge : rightEdge;
|
|
24
|
-
break;
|
|
25
|
-
case 'right':
|
|
26
|
-
toViewBeginTransform = push ? leftEdge : rightEdge;
|
|
27
|
-
fromViewEndTransform = push ? rightEdge : leftEdge;
|
|
28
|
-
break;
|
|
29
|
-
case 'top':
|
|
30
|
-
toViewBeginTransform = push ? bottomEdge : topEdge;
|
|
31
|
-
fromViewEndTransform = push ? topEdge : bottomEdge;
|
|
32
|
-
break;
|
|
33
|
-
case 'bottom':
|
|
34
|
-
toViewBeginTransform = push ? topEdge : bottomEdge;
|
|
35
|
-
fromViewEndTransform = push ? bottomEdge : topEdge;
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
toView.transform = toViewBeginTransform;
|
|
39
|
-
fromView.transform = CGAffineTransformIdentity;
|
|
40
|
-
switch (operation) {
|
|
41
|
-
case 1 /* UINavigationControllerOperation.Push */:
|
|
42
|
-
transitionContext.containerView.insertSubviewAboveSubview(toView, fromView);
|
|
43
|
-
break;
|
|
44
|
-
case 2 /* UINavigationControllerOperation.Pop */:
|
|
45
|
-
transitionContext.containerView.insertSubviewBelowSubview(toView, fromView);
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
const duration = this.getDuration();
|
|
49
|
-
const curve = this.getCurve();
|
|
50
|
-
UIView.animateWithDurationAnimationsCompletion(duration, () => {
|
|
51
|
-
UIView.setAnimationCurve(curve);
|
|
52
|
-
toView.transform = CGAffineTransformIdentity;
|
|
53
|
-
fromView.transform = fromViewEndTransform;
|
|
54
|
-
}, (finished) => {
|
|
55
|
-
toView.transform = originalToViewTransform;
|
|
56
|
-
fromView.transform = originalFromViewTransform;
|
|
57
|
-
transitionContext.completeTransition(finished);
|
|
58
|
-
});
|
|
9
|
+
iosNavigatedController(navigationController, operation, fromVC, toVC) {
|
|
10
|
+
this.transitionController = SlideTransitionController.initWithOwner(new WeakRef(this));
|
|
11
|
+
this.presented = toVC;
|
|
12
|
+
this.presenting = fromVC;
|
|
13
|
+
this.operation = operation;
|
|
14
|
+
// console.log('presenting:', presenting)
|
|
15
|
+
return this.transitionController;
|
|
59
16
|
}
|
|
60
17
|
}
|
|
18
|
+
var SlideTransitionController = /** @class */ (function (_super) {
|
|
19
|
+
__extends(SlideTransitionController, _super);
|
|
20
|
+
function SlideTransitionController() {
|
|
21
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
+
}
|
|
23
|
+
SlideTransitionController.initWithOwner = function (owner) {
|
|
24
|
+
var ctrl = SlideTransitionController.new();
|
|
25
|
+
ctrl.owner = owner;
|
|
26
|
+
return ctrl;
|
|
27
|
+
};
|
|
28
|
+
SlideTransitionController.prototype.transitionDuration = function (transitionContext) {
|
|
29
|
+
var owner = this.owner.deref();
|
|
30
|
+
if (owner) {
|
|
31
|
+
return owner.getDuration();
|
|
32
|
+
}
|
|
33
|
+
return DEFAULT_DURATION;
|
|
34
|
+
};
|
|
35
|
+
SlideTransitionController.prototype.animateTransition = function (transitionContext) {
|
|
36
|
+
// console.log('SlideTransitionController animateTransition');
|
|
37
|
+
var owner = this.owner.deref();
|
|
38
|
+
if (owner) {
|
|
39
|
+
var toView_1 = owner.presented.view;
|
|
40
|
+
var originalToViewTransform_1 = toView_1.transform;
|
|
41
|
+
var fromView_1 = owner.presenting.view;
|
|
42
|
+
var originalFromViewTransform_1 = fromView_1.transform;
|
|
43
|
+
var fromViewEndTransform_1;
|
|
44
|
+
var toViewBeginTransform = void 0;
|
|
45
|
+
var push = owner.operation === UINavigationControllerOperation.Push;
|
|
46
|
+
var leftEdge = CGAffineTransformMakeTranslation(-Screen.mainScreen.widthDIPs, 0);
|
|
47
|
+
var rightEdge = CGAffineTransformMakeTranslation(Screen.mainScreen.widthDIPs, 0);
|
|
48
|
+
var topEdge = CGAffineTransformMakeTranslation(0, -Screen.mainScreen.heightDIPs);
|
|
49
|
+
var bottomEdge = CGAffineTransformMakeTranslation(0, Screen.mainScreen.heightDIPs);
|
|
50
|
+
switch (owner.direction) {
|
|
51
|
+
case 'left':
|
|
52
|
+
toViewBeginTransform = push ? rightEdge : leftEdge;
|
|
53
|
+
fromViewEndTransform_1 = push ? leftEdge : rightEdge;
|
|
54
|
+
break;
|
|
55
|
+
case 'right':
|
|
56
|
+
toViewBeginTransform = push ? leftEdge : rightEdge;
|
|
57
|
+
fromViewEndTransform_1 = push ? rightEdge : leftEdge;
|
|
58
|
+
break;
|
|
59
|
+
case 'top':
|
|
60
|
+
toViewBeginTransform = push ? bottomEdge : topEdge;
|
|
61
|
+
fromViewEndTransform_1 = push ? topEdge : bottomEdge;
|
|
62
|
+
break;
|
|
63
|
+
case 'bottom':
|
|
64
|
+
toViewBeginTransform = push ? topEdge : bottomEdge;
|
|
65
|
+
fromViewEndTransform_1 = push ? bottomEdge : topEdge;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
toView_1.transform = toViewBeginTransform;
|
|
69
|
+
fromView_1.transform = CGAffineTransformIdentity;
|
|
70
|
+
switch (owner.operation) {
|
|
71
|
+
case UINavigationControllerOperation.Push:
|
|
72
|
+
transitionContext.containerView.insertSubviewAboveSubview(toView_1, fromView_1);
|
|
73
|
+
break;
|
|
74
|
+
case UINavigationControllerOperation.Pop:
|
|
75
|
+
transitionContext.containerView.insertSubviewBelowSubview(toView_1, fromView_1);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
var duration = owner.getDuration();
|
|
79
|
+
var curve_1 = owner.getCurve();
|
|
80
|
+
UIView.animateWithDurationAnimationsCompletion(duration, function () {
|
|
81
|
+
UIView.setAnimationCurve(curve_1);
|
|
82
|
+
toView_1.transform = CGAffineTransformIdentity;
|
|
83
|
+
fromView_1.transform = fromViewEndTransform_1;
|
|
84
|
+
}, function (finished) {
|
|
85
|
+
toView_1.transform = originalToViewTransform_1;
|
|
86
|
+
fromView_1.transform = originalFromViewTransform_1;
|
|
87
|
+
transitionContext.completeTransition(finished);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
SlideTransitionController.ObjCProtocols = [UIViewControllerAnimatedTransitioning];
|
|
92
|
+
return SlideTransitionController;
|
|
93
|
+
}(NSObject));
|
|
94
|
+
export { SlideTransitionController };
|
|
61
95
|
//# sourceMappingURL=slide-transition.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slide-transition.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/slide-transition.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"slide-transition.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/transition/slide-transition.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAO9C,YAAY,SAAiB,EAAE,QAAgB,EAAE,KAAU;QAC1D,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,sBAAsB,CAAC,oBAA4C,EAAE,SAAiB,EAAE,MAAwB,EAAE,IAAsB;QACvI,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,yCAAyC;QACzC,OAAO,IAAI,CAAC,oBAAoB,CAAC;IAClC,CAAC;CACD"}
|
package/utils/native-helper.d.ts
CHANGED
|
@@ -231,4 +231,39 @@ export namespace iOSNativeHelper {
|
|
|
231
231
|
* Checks whether the application is running on real device and not on simulator.
|
|
232
232
|
*/
|
|
233
233
|
export function isRealDevice(): boolean;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Debug utility to insert CGRect values into logging output.
|
|
237
|
+
* Note: when printing a CGRect directly it will print blank so this helps show the values.
|
|
238
|
+
* @param rect CGRect
|
|
239
|
+
*/
|
|
240
|
+
export function printCGRect(rect: CGRect): void;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Take a snapshot of a View on screen.
|
|
244
|
+
* @param view view to snapshot
|
|
245
|
+
* @param scale screen scale
|
|
246
|
+
*/
|
|
247
|
+
export function snapshotView(view: UIView, scale: number): UIImage;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Copy layer properties from one view to another.
|
|
251
|
+
* @param view a view to copy layer properties to
|
|
252
|
+
* @param toView a view to copy later properties from
|
|
253
|
+
*/
|
|
254
|
+
export function copyLayerProperties(view: UIView, toView: UIView): void;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Animate views with a configurable spring effect
|
|
258
|
+
* @param options various animation settings for the spring
|
|
259
|
+
* - tension: number
|
|
260
|
+
* - friction: number
|
|
261
|
+
* - mass: number
|
|
262
|
+
* - delay: number
|
|
263
|
+
* - velocity: number
|
|
264
|
+
* - animateOptions: UIViewAnimationOptions
|
|
265
|
+
* - animations: () => void, Callback containing the property changes you want animated
|
|
266
|
+
* - completion: (finished: boolean) => void, Callback when animation is finished
|
|
267
|
+
*/
|
|
268
|
+
export function animateWithSpring(options?: { tension?: number; friction?: number; mass?: number; delay?: number; velocity?: number; animateOptions?: UIViewAnimationOptions; animations?: () => void; completion?: (finished?: boolean) => void });
|
|
234
269
|
}
|
|
@@ -21,4 +21,17 @@ export declare namespace iOSNativeHelper {
|
|
|
21
21
|
function getShadowLayer(nativeView: UIView, name?: string, create?: boolean): CALayer;
|
|
22
22
|
function createUIDocumentInteractionControllerDelegate(): NSObject;
|
|
23
23
|
function isRealDevice(): true | NSArray<string>;
|
|
24
|
+
function printCGRect(rect: CGRect): string;
|
|
25
|
+
function snapshotView(view: UIView, scale: number): UIImage;
|
|
26
|
+
function copyLayerProperties(view: UIView, toView: UIView): void;
|
|
27
|
+
function animateWithSpring(options?: {
|
|
28
|
+
tension?: number;
|
|
29
|
+
friction?: number;
|
|
30
|
+
mass?: number;
|
|
31
|
+
delay?: number;
|
|
32
|
+
velocity?: number;
|
|
33
|
+
animateOptions?: UIViewAnimationOptions;
|
|
34
|
+
animations?: () => void;
|
|
35
|
+
completion?: (finished?: boolean) => void;
|
|
36
|
+
}): void;
|
|
24
37
|
}
|
|
@@ -315,5 +315,78 @@ export var iOSNativeHelper;
|
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
iOSNativeHelper.isRealDevice = isRealDevice;
|
|
318
|
+
function printCGRect(rect) {
|
|
319
|
+
if (rect) {
|
|
320
|
+
return `CGRect(${rect.origin.x} ${rect.origin.y} ${rect.size.width} ${rect.size.height})`;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
iOSNativeHelper.printCGRect = printCGRect;
|
|
324
|
+
function snapshotView(view, scale) {
|
|
325
|
+
if (view instanceof UIImageView) {
|
|
326
|
+
return view.image;
|
|
327
|
+
}
|
|
328
|
+
// console.log('snapshotView view.frame:', printRect(view.frame));
|
|
329
|
+
UIGraphicsBeginImageContextWithOptions(CGSizeMake(view.frame.size.width, view.frame.size.height), false, scale);
|
|
330
|
+
view.layer.renderInContext(UIGraphicsGetCurrentContext());
|
|
331
|
+
const image = UIGraphicsGetImageFromCurrentImageContext();
|
|
332
|
+
UIGraphicsEndImageContext();
|
|
333
|
+
return image;
|
|
334
|
+
}
|
|
335
|
+
iOSNativeHelper.snapshotView = snapshotView;
|
|
336
|
+
function copyLayerProperties(view, toView) {
|
|
337
|
+
const viewPropertiesToMatch = ['backgroundColor'];
|
|
338
|
+
const layerPropertiesToMatch = ['cornerRadius', 'borderWidth', 'borderColor'];
|
|
339
|
+
viewPropertiesToMatch.forEach((property) => {
|
|
340
|
+
if (view[property] !== toView[property]) {
|
|
341
|
+
// console.log('| -- matching view property:', property);
|
|
342
|
+
view[property] = toView[property];
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
layerPropertiesToMatch.forEach((property) => {
|
|
346
|
+
if (view.layer[property] !== toView.layer[property]) {
|
|
347
|
+
// console.log('| -- matching layer property:', property);
|
|
348
|
+
view.layer[property] = toView.layer[property];
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
iOSNativeHelper.copyLayerProperties = copyLayerProperties;
|
|
353
|
+
function animateWithSpring(options) {
|
|
354
|
+
const opt = {
|
|
355
|
+
tension: 140,
|
|
356
|
+
friction: 10,
|
|
357
|
+
mass: 1.0,
|
|
358
|
+
delay: 0,
|
|
359
|
+
velocity: 0,
|
|
360
|
+
animateOptions: null,
|
|
361
|
+
animations: null,
|
|
362
|
+
completion: null,
|
|
363
|
+
...(options || {}),
|
|
364
|
+
};
|
|
365
|
+
// console.log('createSpringAnimator', opt);
|
|
366
|
+
const damping = opt.friction / Math.sqrt(2 * opt.tension);
|
|
367
|
+
const undampedFrequency = Math.sqrt(opt.tension / opt.mass);
|
|
368
|
+
// console.log({
|
|
369
|
+
// damping,
|
|
370
|
+
// undampedFrequency
|
|
371
|
+
// })
|
|
372
|
+
const epsilon = 0.001;
|
|
373
|
+
let duration = 0;
|
|
374
|
+
if (damping < 1) {
|
|
375
|
+
// console.log('damping < 1');
|
|
376
|
+
const a = Math.sqrt(1 - Math.pow(damping, 2));
|
|
377
|
+
const b = opt.velocity / (a * undampedFrequency);
|
|
378
|
+
const c = damping / a;
|
|
379
|
+
const d = -((b - c) / epsilon);
|
|
380
|
+
if (d > 0) {
|
|
381
|
+
duration = Math.log(d) / (damping * undampedFrequency);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (duration === 0) {
|
|
385
|
+
UIView.animateWithDurationAnimationsCompletion(0, opt.animations, opt.completion);
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
UIView.animateWithDurationDelayUsingSpringWithDampingInitialSpringVelocityOptionsAnimationsCompletion(duration, opt.delay, damping, opt.velocity, opt.animateOptions, opt.animations, opt.completion);
|
|
389
|
+
}
|
|
390
|
+
iOSNativeHelper.animateWithSpring = animateWithSpring;
|
|
318
391
|
})(iOSNativeHelper || (iOSNativeHelper = {}));
|
|
319
392
|
//# sourceMappingURL=native-helper.ios.js.map
|