@akylas/nativescript 8.4.9 → 8.5.8
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/accessibility/accessibility-css-helper.js +7 -8
- package/accessibility/accessibility-css-helper.js.map +1 -1
- package/accessibility/accessibility-properties.d.ts +4 -1
- package/accessibility/accessibility-properties.js +21 -0
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/accessibility-service.android.js +23 -23
- package/accessibility/accessibility-service.android.js.map +1 -1
- package/accessibility/accessibility-service.ios.js +1 -1
- package/accessibility/accessibility-service.ios.js.map +1 -1
- package/accessibility/font-scale.android.js +1 -1
- package/accessibility/font-scale.android.js.map +1 -1
- package/accessibility/font-scale.ios.js +1 -1
- package/accessibility/font-scale.ios.js.map +1 -1
- package/accessibility/index.android.js +85 -85
- package/accessibility/index.android.js.map +1 -1
- package/accessibility/index.ios.js +2 -2
- package/accessibility/index.ios.js.map +1 -1
- package/application/application-common.d.ts +202 -41
- package/application/application-common.js +411 -149
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +122 -32
- package/application/application-shims.d.ts +351 -0
- package/application/application-shims.js +353 -0
- package/application/application-shims.js.map +1 -0
- package/application/application.android.d.ts +64 -0
- package/application/application.android.js +438 -0
- package/application/application.android.js.map +1 -0
- package/application/application.d.ts +186 -0
- package/application/application.ios.d.ts +77 -0
- package/application/application.ios.js +363 -0
- package/application/application.ios.js.map +1 -0
- package/application/index.android.d.ts +2 -77
- package/application/index.android.js +2 -460
- package/application/index.android.js.map +1 -1
- package/application/index.d.ts +2 -759
- package/application/index.ios.d.ts +2 -65
- package/application/index.ios.js +2 -506
- package/application/index.ios.js.map +1 -1
- package/application-settings/index.android.js +2 -2
- package/application-settings/index.android.js.map +1 -1
- package/config/config.interface.d.ts +10 -0
- package/connectivity/index.android.js +24 -28
- package/connectivity/index.android.js.map +1 -1
- package/data/observable/index.d.ts +19 -18
- package/data/observable/index.js +9 -0
- package/data/observable/index.js.map +1 -1
- package/file-system/file-system-access.android.d.ts +21 -0
- package/file-system/file-system-access.android.js +235 -4
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.d.ts +99 -0
- package/file-system/file-system-access.ios.d.ts +12 -0
- package/file-system/file-system-access.ios.js +168 -0
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.d.ts +34 -1
- package/file-system/index.js +257 -2
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.ios.js +15 -17
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/global-types.d.ts +13 -5
- package/globals/index.js +2 -0
- package/globals/index.js.map +1 -1
- package/http/http-request/index.ios.js +8 -10
- package/http/http-request/index.ios.js.map +1 -1
- package/image-source/index.android.js +2 -2
- package/image-source/index.android.js.map +1 -1
- package/index.d.ts +12 -139
- package/index.js +15 -155
- package/index.js.map +1 -1
- package/module-name-resolver/index.js +5 -5
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js +2 -2
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/package.json +1 -1
- package/platform/index.android.js +5 -5
- package/platform/index.android.js.map +1 -1
- package/platforms/android/native-api-usage.json +2 -0
- package/platforms/android/widgets-release.aar +0 -0
- package/platforms/ios/TNSWidgets.xcframework/Info.plist +7 -7
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSWidgets.h +1 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSWidgets.h +1 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +4 -4
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSWidgets.h +1 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +4 -4
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +1 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +14 -3
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/timer/index.ios.js +17 -18
- package/timer/index.ios.js.map +1 -1
- package/ui/action-bar/index.android.js +16 -17
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +15 -17
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/animation/animation-common.js +1 -0
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/animation-interfaces.d.ts +2 -0
- package/ui/animation/index.android.js +1 -1
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.ios.d.ts +1 -3
- package/ui/animation/index.ios.js +113 -101
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/builder/component-builder/index.js +1 -1
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.js +1 -1
- package/ui/builder/index.js.map +1 -1
- package/ui/button/index.android.js +12 -13
- package/ui/button/index.android.js.map +1 -1
- package/ui/core/control-state-change/index.ios.js +7 -9
- package/ui/core/control-state-change/index.ios.js.map +1 -1
- package/ui/core/view/index.android.js +157 -158
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +15 -0
- package/ui/core/view/index.ios.d.ts +1 -0
- package/ui/core/view/index.ios.js +96 -17
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +10 -0
- package/ui/core/view/view-common.js +46 -6
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.d.ts +0 -2
- package/ui/core/view/view-helper/index.ios.js +97 -165
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view-base/index.d.ts +219 -1
- package/ui/core/view-base/index.js +170 -5
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/date-picker/index.android.js +30 -31
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/date-picker/index.ios.js +17 -19
- package/ui/date-picker/index.ios.js.map +1 -1
- package/ui/dialogs/index.ios.js +10 -4
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/editable-text-base/editable-text-base-common.d.ts +1 -0
- package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
- package/ui/editable-text-base/index.android.js +26 -28
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.d.ts +7 -1
- package/ui/frame/activity.android.js +2 -2
- package/ui/frame/activity.android.js.map +1 -1
- package/ui/frame/fragment.transitions.android.js +110 -86
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/fragment.transitions.d.ts +0 -4
- package/ui/frame/frame-common.d.ts +3 -3
- package/ui/frame/frame-common.js +14 -1
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/index.android.d.ts +4 -3
- package/ui/frame/index.android.js +67 -89
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.ios.js +180 -151
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/index.android.js +124 -121
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +47 -53
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.js +29 -32
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/image/image-common.d.ts +2 -2
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.js +12 -13
- package/ui/image/index.android.js.map +1 -1
- package/ui/image/index.d.ts +3 -2
- package/ui/image/index.ios.js.map +1 -1
- package/ui/image-cache/index.android.js +14 -13
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +17 -19
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +9 -2
- package/ui/index.js +8 -2
- package/ui/index.js.map +1 -1
- package/ui/layouts/layout-base.ios.js +4 -1
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/root-layout/index.d.ts +1 -1
- package/ui/layouts/root-layout/root-layout-common.d.ts +16 -1
- package/ui/layouts/root-layout/root-layout-common.js +89 -62
- package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
- package/ui/list-picker/index.android.js +21 -23
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-picker/index.ios.js +32 -39
- package/ui/list-picker/index.ios.js.map +1 -1
- package/ui/list-view/index.android.js +105 -105
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.ios.js +100 -116
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/page/index.ios.d.ts +0 -1
- package/ui/page/index.ios.js +150 -163
- package/ui/page/index.ios.js.map +1 -1
- package/ui/scroll-view/index.ios.js +20 -21
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/search-bar/index.android.js +38 -40
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.js +27 -33
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/index.android.js +40 -41
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.ios.js +15 -17
- package/ui/segmented-bar/index.ios.js.map +1 -1
- package/ui/slider/index.android.js +23 -24
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.ios.js +31 -37
- package/ui/slider/index.ios.js.map +1 -1
- package/ui/styling/background.android.js +3 -5
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/style/index.d.ts +4 -1
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.d.ts +4 -4
- package/ui/styling/style-properties.js +7 -7
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.js +6 -6
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.android.js +11 -12
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.js +15 -17
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.js +140 -137
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.js +68 -82
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/text-base/formatted-string.d.ts +6 -0
- package/ui/text-base/formatted-string.js +27 -0
- package/ui/text-base/formatted-string.js.map +1 -1
- package/ui/text-base/index.android.js +59 -59
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.js +73 -51
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/span.d.ts +6 -0
- package/ui/text-base/span.js +18 -0
- package/ui/text-base/span.js.map +1 -1
- package/ui/text-field/index.ios.js +72 -66
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.js +35 -45
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/time-picker/index.android.js +14 -15
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/time-picker/index.ios.js +17 -19
- package/ui/time-picker/index.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 +59 -24
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/index.android.d.ts +6 -4
- package/ui/transition/index.android.js +8 -5
- package/ui/transition/index.android.js.map +1 -1
- package/ui/transition/index.d.ts +58 -8
- package/ui/transition/index.ios.d.ts +6 -4
- package/ui/transition/index.ios.js +11 -6
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.android.d.ts +5 -0
- package/ui/transition/modal-transition.android.js +7 -0
- package/ui/transition/modal-transition.android.js.map +1 -0
- package/ui/transition/modal-transition.d.ts +2 -0
- package/ui/transition/modal-transition.ios.d.ts +34 -0
- package/ui/transition/modal-transition.ios.js +174 -0
- package/ui/transition/modal-transition.ios.js.map +1 -0
- package/ui/transition/page-transition.android.d.ts +7 -0
- package/ui/transition/page-transition.android.js +260 -0
- package/ui/transition/page-transition.android.js.map +1 -0
- package/ui/transition/page-transition.d.ts +2 -0
- package/ui/transition/page-transition.ios.d.ts +35 -0
- package/ui/transition/page-transition.ios.js +191 -0
- package/ui/transition/page-transition.ios.js.map +1 -0
- package/ui/transition/shared-transition-helper.android.d.ts +9 -0
- package/ui/transition/shared-transition-helper.android.js +10 -0
- package/ui/transition/shared-transition-helper.android.js.map +1 -0
- package/ui/transition/shared-transition-helper.d.ts +14 -0
- package/ui/transition/shared-transition-helper.ios.d.ts +14 -0
- package/ui/transition/shared-transition-helper.ios.js +524 -0
- package/ui/transition/shared-transition-helper.ios.js.map +1 -0
- package/ui/transition/shared-transition.d.ts +267 -0
- package/ui/transition/shared-transition.js +214 -0
- package/ui/transition/shared-transition.js.map +1 -0
- 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 +84 -49
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/ui/web-view/index.android.js +57 -60
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.ios.js +64 -79
- package/ui/web-view/index.ios.js.map +1 -1
- package/utils/android/index.d.ts +21 -0
- package/utils/android/index.js +157 -0
- package/utils/android/index.js.map +1 -0
- package/utils/common.d.ts +33 -0
- package/utils/common.js +70 -1
- package/utils/common.js.map +1 -1
- package/utils/index.android.d.ts +8 -3
- package/utils/index.android.js +15 -10
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +7 -7
- package/utils/index.ios.d.ts +8 -3
- package/utils/index.ios.js +13 -8
- package/utils/index.ios.js.map +1 -1
- package/utils/ios/index.d.ts +36 -0
- package/utils/ios/index.js +277 -0
- package/utils/ios/index.js.map +1 -0
- package/utils/layout-helper/index.android.js +3 -3
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/mainthread-helper.android.js +2 -2
- package/utils/mainthread-helper.android.js.map +1 -1
- package/utils/native-helper.android.d.ts +8 -23
- package/utils/native-helper.android.js +10 -169
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.d.ts +272 -219
- package/utils/native-helper.ios.d.ts +8 -22
- package/utils/native-helper.ios.js +10 -238
- 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/utils/platform-check.d.ts +4 -0
- package/utils/platform-check.js +21 -0
- package/utils/platform-check.js.map +1 -0
- package/ui/builder/module-name-sanitizer.d.ts +0 -6
- package/ui/builder/module-name-sanitizer.js +0 -24
- package/ui/builder/module-name-sanitizer.js.map +0 -1
- package/ui/frame/fragment.transitions.ios.d.ts +0 -2
- package/ui/frame/fragment.transitions.ios.js +0 -85
- package/ui/frame/fragment.transitions.ios.js.map +0 -1
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as iOSUtils from './ios';
|
|
2
|
+
import { platformCheck } from './platform-check';
|
|
3
3
|
import { getClass, isNullOrUndefined, numberHasDecimals, numberIs64Bit } from './types';
|
|
4
|
-
const radToDeg = Math.PI / 180;
|
|
5
|
-
function isOrientationLandscape(orientation) {
|
|
6
|
-
return orientation === 3 /* UIDeviceOrientation.LandscapeLeft */ /* 3 */ || orientation === 4 /* UIDeviceOrientation.LandscapeRight */ /* 4 */;
|
|
7
|
-
}
|
|
8
|
-
function openFileAtRootModule(filePath) {
|
|
9
|
-
try {
|
|
10
|
-
const appPath = iOSNativeHelper.getCurrentAppPath();
|
|
11
|
-
const path = iOSNativeHelper.isRealDevice() ? filePath.replace('~', appPath) : filePath;
|
|
12
|
-
const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path));
|
|
13
|
-
controller.delegate = iOSNativeHelper.createUIDocumentInteractionControllerDelegate();
|
|
14
|
-
return controller.presentPreviewAnimated(true);
|
|
15
|
-
}
|
|
16
|
-
catch (e) {
|
|
17
|
-
Trace.write('Error in openFile', Trace.categories.Error, Trace.messageType.error);
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
4
|
export function dataDeserialize(nativeData) {
|
|
22
5
|
if (isNullOrUndefined(nativeData)) {
|
|
23
6
|
// some native values will already be js null values
|
|
@@ -97,223 +80,12 @@ export function dataSerialize(data, wrapPrimitives = false) {
|
|
|
97
80
|
return null;
|
|
98
81
|
}
|
|
99
82
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
else {
|
|
109
|
-
return property;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
iOSNativeHelper.getter = getter;
|
|
113
|
-
let collections;
|
|
114
|
-
(function (collections) {
|
|
115
|
-
function jsArrayToNSArray(str) {
|
|
116
|
-
return NSArray.arrayWithArray(str);
|
|
117
|
-
}
|
|
118
|
-
collections.jsArrayToNSArray = jsArrayToNSArray;
|
|
119
|
-
function nsArrayToJSArray(a) {
|
|
120
|
-
const arr = [];
|
|
121
|
-
if (a !== undefined) {
|
|
122
|
-
const count = a.count;
|
|
123
|
-
for (let i = 0; i < count; i++) {
|
|
124
|
-
arr.push(a.objectAtIndex(i));
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return arr;
|
|
128
|
-
}
|
|
129
|
-
collections.nsArrayToJSArray = nsArrayToJSArray;
|
|
130
|
-
})(collections = iOSNativeHelper.collections || (iOSNativeHelper.collections = {}));
|
|
131
|
-
function getRootViewController() {
|
|
132
|
-
const win = getWindow();
|
|
133
|
-
let vc = win && win.rootViewController;
|
|
134
|
-
while (vc && vc.presentedViewController) {
|
|
135
|
-
vc = vc.presentedViewController;
|
|
136
|
-
}
|
|
137
|
-
return vc;
|
|
138
|
-
}
|
|
139
|
-
iOSNativeHelper.getRootViewController = getRootViewController;
|
|
140
|
-
function getWindow() {
|
|
141
|
-
const app = UIApplication.sharedApplication;
|
|
142
|
-
if (!app) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
return app.keyWindow || (app.windows && app.windows.count > 0 && app.windows.objectAtIndex(0));
|
|
146
|
-
}
|
|
147
|
-
iOSNativeHelper.getWindow = getWindow;
|
|
148
|
-
function setWindowBackgroundColor(value) {
|
|
149
|
-
const win = getWindow();
|
|
150
|
-
if (win) {
|
|
151
|
-
const bgColor = new Color(value);
|
|
152
|
-
win.backgroundColor = bgColor.ios;
|
|
153
|
-
const rootVc = getRootViewController();
|
|
154
|
-
if (rootVc?.view) {
|
|
155
|
-
rootVc.view.backgroundColor = bgColor.ios;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
iOSNativeHelper.setWindowBackgroundColor = setWindowBackgroundColor;
|
|
160
|
-
function isLandscape() {
|
|
161
|
-
console.log('utils.ios.isLandscape() is deprecated; use application.orientation instead');
|
|
162
|
-
const deviceOrientation = UIDevice.currentDevice.orientation;
|
|
163
|
-
const statusBarOrientation = UIApplication.sharedApplication.statusBarOrientation;
|
|
164
|
-
const isDeviceOrientationLandscape = isOrientationLandscape(deviceOrientation);
|
|
165
|
-
const isStatusBarOrientationLandscape = isOrientationLandscape(statusBarOrientation);
|
|
166
|
-
return isDeviceOrientationLandscape || isStatusBarOrientationLandscape;
|
|
167
|
-
}
|
|
168
|
-
iOSNativeHelper.isLandscape = isLandscape;
|
|
169
|
-
iOSNativeHelper.MajorVersion = NSString.stringWithString(UIDevice.currentDevice.systemVersion).intValue;
|
|
170
|
-
function openFile(filePath) {
|
|
171
|
-
console.log('utils.ios.openFile() is deprecated; use utils.openFile() instead');
|
|
172
|
-
return openFileAtRootModule(filePath);
|
|
173
|
-
}
|
|
174
|
-
iOSNativeHelper.openFile = openFile;
|
|
175
|
-
function getCurrentAppPath() {
|
|
176
|
-
const currentDir = __dirname;
|
|
177
|
-
const tnsModulesIndex = currentDir.indexOf('/tns_modules');
|
|
178
|
-
// Module not hosted in ~/tns_modules when bundled. Use current dir.
|
|
179
|
-
let appPath = currentDir;
|
|
180
|
-
if (tnsModulesIndex !== -1) {
|
|
181
|
-
// Strip part after tns_modules to obtain app root
|
|
182
|
-
appPath = currentDir.substring(0, tnsModulesIndex);
|
|
183
|
-
}
|
|
184
|
-
return appPath;
|
|
185
|
-
}
|
|
186
|
-
iOSNativeHelper.getCurrentAppPath = getCurrentAppPath;
|
|
187
|
-
function joinPaths(...paths) {
|
|
188
|
-
if (!paths || paths.length === 0) {
|
|
189
|
-
return '';
|
|
190
|
-
}
|
|
191
|
-
return NSString.stringWithString(NSString.pathWithComponents(paths)).stringByStandardizingPath;
|
|
192
|
-
}
|
|
193
|
-
iOSNativeHelper.joinPaths = joinPaths;
|
|
194
|
-
function getVisibleViewController(rootViewController) {
|
|
195
|
-
let viewController = rootViewController;
|
|
196
|
-
while (viewController && viewController.presentedViewController) {
|
|
197
|
-
viewController = viewController.presentedViewController;
|
|
198
|
-
}
|
|
199
|
-
return viewController;
|
|
200
|
-
}
|
|
201
|
-
iOSNativeHelper.getVisibleViewController = getVisibleViewController;
|
|
202
|
-
function applyRotateTransform(transform, x, y, z) {
|
|
203
|
-
if (x) {
|
|
204
|
-
transform = CATransform3DRotate(transform, x * radToDeg, 1, 0, 0);
|
|
205
|
-
}
|
|
206
|
-
if (y) {
|
|
207
|
-
transform = CATransform3DRotate(transform, y * radToDeg, 0, 1, 0);
|
|
208
|
-
}
|
|
209
|
-
if (z) {
|
|
210
|
-
transform = CATransform3DRotate(transform, z * radToDeg, 0, 0, 1);
|
|
211
|
-
}
|
|
212
|
-
return transform;
|
|
213
|
-
}
|
|
214
|
-
iOSNativeHelper.applyRotateTransform = applyRotateTransform;
|
|
215
|
-
function getShadowLayer(nativeView, name = 'ns-shadow-layer', create = true) {
|
|
216
|
-
return nativeView.layer;
|
|
217
|
-
console.log(`--- ${create ? 'CREATE' : 'READ'}`);
|
|
218
|
-
/**
|
|
219
|
-
* UIView
|
|
220
|
-
* -> Shadow
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* UIView
|
|
224
|
-
* -> UIView
|
|
225
|
-
* -> Shadow
|
|
226
|
-
*/
|
|
227
|
-
if (!nativeView) {
|
|
228
|
-
return null;
|
|
229
|
-
}
|
|
230
|
-
if (!nativeView.layer) {
|
|
231
|
-
// should never hit this?
|
|
232
|
-
console.log('- no layer! -');
|
|
233
|
-
return null;
|
|
234
|
-
}
|
|
235
|
-
// if the nativeView's layer is the shadow layer?
|
|
236
|
-
if (nativeView.layer.name === name) {
|
|
237
|
-
console.log('- found shadow layer - reusing.');
|
|
238
|
-
return nativeView.layer;
|
|
239
|
-
}
|
|
240
|
-
console.log('>> layer :', nativeView.layer);
|
|
241
|
-
if (nativeView.layer.sublayers?.count) {
|
|
242
|
-
const count = nativeView.layer.sublayers.count;
|
|
243
|
-
for (let i = 0; i < count; i++) {
|
|
244
|
-
const subLayer = nativeView.layer.sublayers.objectAtIndex(i);
|
|
245
|
-
console.log(`>> subLayer ${i + 1}/${count} :`, subLayer);
|
|
246
|
-
console.log(`>> subLayer ${i + 1}/${count} name :`, subLayer.name);
|
|
247
|
-
if (subLayer.name === name) {
|
|
248
|
-
console.log('- found shadow sublayer - reusing.');
|
|
249
|
-
return subLayer;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
// if (nativeView instanceof UITextView) {
|
|
253
|
-
// return nativeView.layer.sublayers.objectAtIndex(1);
|
|
254
|
-
// } else {
|
|
255
|
-
// return nativeView.layer.sublayers.objectAtIndex(nativeView.layer.sublayers.count - 1);
|
|
256
|
-
// }
|
|
257
|
-
}
|
|
258
|
-
// else {
|
|
259
|
-
// layer = nativeView.layer;
|
|
260
|
-
// }
|
|
261
|
-
// we're not interested in creating a new layer
|
|
262
|
-
if (!create) {
|
|
263
|
-
return null;
|
|
264
|
-
}
|
|
265
|
-
console.log(`- adding a new layer for - ${name}`);
|
|
266
|
-
const viewLayer = nativeView.layer;
|
|
267
|
-
const newLayer = CALayer.layer();
|
|
268
|
-
newLayer.name = name;
|
|
269
|
-
newLayer.zPosition = 0.0;
|
|
270
|
-
// nativeView.layer.insertSublayerBelow(newLayer, nativeView.layer)
|
|
271
|
-
// newLayer.insertSublayerAtIndex(nativeView.layer, 0)
|
|
272
|
-
// nativeView.layer.zPosition = 1.0;
|
|
273
|
-
// nativeView.layer.addSublayer(newLayer);
|
|
274
|
-
// nativeView.layer = CALayer.layer()
|
|
275
|
-
nativeView.layer.insertSublayerAtIndex(newLayer, 0);
|
|
276
|
-
// nativeView.layer.insertSublayerAtIndex(viewLayer, 1)
|
|
277
|
-
// nativeView.layer.replaceSublayerWith(newLayer, nativeView.layer);
|
|
278
|
-
return newLayer;
|
|
279
|
-
}
|
|
280
|
-
iOSNativeHelper.getShadowLayer = getShadowLayer;
|
|
281
|
-
function createUIDocumentInteractionControllerDelegate() {
|
|
282
|
-
var UIDocumentInteractionControllerDelegateImpl = /** @class */ (function (_super) {
|
|
283
|
-
__extends(UIDocumentInteractionControllerDelegateImpl, _super);
|
|
284
|
-
function UIDocumentInteractionControllerDelegateImpl() {
|
|
285
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
286
|
-
}
|
|
287
|
-
UIDocumentInteractionControllerDelegateImpl.prototype.getViewController = function () {
|
|
288
|
-
var app = UIApplication.sharedApplication;
|
|
289
|
-
return app.keyWindow.rootViewController;
|
|
290
|
-
};
|
|
291
|
-
UIDocumentInteractionControllerDelegateImpl.prototype.documentInteractionControllerViewControllerForPreview = function (controller) {
|
|
292
|
-
return this.getViewController();
|
|
293
|
-
};
|
|
294
|
-
UIDocumentInteractionControllerDelegateImpl.prototype.documentInteractionControllerViewForPreview = function (controller) {
|
|
295
|
-
return this.getViewController().view;
|
|
296
|
-
};
|
|
297
|
-
UIDocumentInteractionControllerDelegateImpl.prototype.documentInteractionControllerRectForPreview = function (controller) {
|
|
298
|
-
return this.getViewController().view.frame;
|
|
299
|
-
};
|
|
300
|
-
UIDocumentInteractionControllerDelegateImpl.ObjCProtocols = [UIDocumentInteractionControllerDelegate];
|
|
301
|
-
return UIDocumentInteractionControllerDelegateImpl;
|
|
302
|
-
}(NSObject));
|
|
303
|
-
return new UIDocumentInteractionControllerDelegateImpl();
|
|
304
|
-
}
|
|
305
|
-
iOSNativeHelper.createUIDocumentInteractionControllerDelegate = createUIDocumentInteractionControllerDelegate;
|
|
306
|
-
function isRealDevice() {
|
|
307
|
-
try {
|
|
308
|
-
// https://stackoverflow.com/a/5093092/4936697
|
|
309
|
-
const sourceType = UIImagePickerControllerSourceType.UIImagePickerControllerSourceTypeCamera;
|
|
310
|
-
const mediaTypes = UIImagePickerController.availableMediaTypesForSourceType(sourceType);
|
|
311
|
-
return mediaTypes;
|
|
312
|
-
}
|
|
313
|
-
catch (e) {
|
|
314
|
-
return true;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
iOSNativeHelper.isRealDevice = isRealDevice;
|
|
318
|
-
})(iOSNativeHelper || (iOSNativeHelper = {}));
|
|
83
|
+
// these don't exist on iOS. Stub them to empty functions.
|
|
84
|
+
export const ad = platformCheck('Utils.ad');
|
|
85
|
+
export const android = platformCheck('Utils.android');
|
|
86
|
+
export var ios = iOSUtils;
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated Use `Utils.ios` instead.
|
|
89
|
+
*/
|
|
90
|
+
export var iOSNativeHelper = iOSUtils;
|
|
319
91
|
//# sourceMappingURL=native-helper.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-helper.ios.js","sourceRoot":"","sources":["../../../../packages/core/utils/native-helper.ios.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"native-helper.ios.js","sourceRoot":"","sources":["../../../../packages/core/utils/native-helper.ios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;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E,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;iBAClE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CACvC,CAAC;YAEF,OAAO,YAAY,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;SACnD;QAED;YACC,OAAO,IAAI,CAAC;KACb;AACF,CAAC;AAED,0DAA0D;AAC1D,MAAM,CAAC,MAAM,EAAE,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAEtD,MAAM,KAAQ,GAAG,GAAG,QAAQ,CAAC;AAE7B;;GAEG;AACH,MAAM,KAAQ,eAAe,GAAG,QAAQ,CAAC"}
|
package/utils/number-utils.d.ts
CHANGED
|
@@ -7,3 +7,13 @@ export declare function greaterThanZero(value: Object): boolean;
|
|
|
7
7
|
export declare function notNegative(value: Object): boolean;
|
|
8
8
|
export declare const radiansToDegrees: (a: number) => number;
|
|
9
9
|
export declare const degreesToRadians: (a: number) => number;
|
|
10
|
+
/**
|
|
11
|
+
* Map value changes across a set of criteria
|
|
12
|
+
* @param val value to map
|
|
13
|
+
* @param in_min minimum
|
|
14
|
+
* @param in_max maximum
|
|
15
|
+
* @param out_min starting value
|
|
16
|
+
* @param out_max ending value
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare function valueMap(val: number, in_min: number, in_max: number, out_min: number, out_max: number): number;
|
package/utils/number-utils.js
CHANGED
|
@@ -22,4 +22,16 @@ export function notNegative(value) {
|
|
|
22
22
|
}
|
|
23
23
|
export const radiansToDegrees = (a) => a * (180 / Math.PI);
|
|
24
24
|
export const degreesToRadians = (a) => a * (Math.PI / 180);
|
|
25
|
+
/**
|
|
26
|
+
* Map value changes across a set of criteria
|
|
27
|
+
* @param val value to map
|
|
28
|
+
* @param in_min minimum
|
|
29
|
+
* @param in_max maximum
|
|
30
|
+
* @param out_min starting value
|
|
31
|
+
* @param out_max ending value
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
export function valueMap(val, in_min, in_max, out_min, out_max) {
|
|
35
|
+
return ((val - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min;
|
|
36
|
+
}
|
|
25
37
|
//# sourceMappingURL=number-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-utils.js","sourceRoot":"","sources":["../../../../packages/core/utils/number-utils.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,IAAI,CAAC;AAErB,MAAM,UAAU,QAAQ,CAAC,MAAc,EAAE,MAAc;IACtD,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,MAAc;IAChE,OAAO,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,MAAc;IACzD,OAAO,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,MAAc,EAAE,MAAc;IACtD,OAAO,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,KAAa;IACnC,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAa;IAC5C,OAAe,KAAK,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa;IACxC,OAAe,KAAK,IAAI,CAAC,CAAC;AAC3B,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C3B,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;AAEnE;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,MAAc,EAAE,MAAc,EAAE,OAAe,EAAE,OAAe;IACrG,OAAO,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal Util used for exporting opposing platform utils and warning the user if they are trying to access them.
|
|
3
|
+
*/
|
|
4
|
+
export function platformCheck(parent) {
|
|
5
|
+
if (__DEV__) {
|
|
6
|
+
return new Proxy({}, {
|
|
7
|
+
get(_, prop) {
|
|
8
|
+
const propPretty = [parent, prop.toString()].join('.');
|
|
9
|
+
const hintPlatformCheck = global.isAndroid ? 'global.isIOS' : 'global.isAndroid';
|
|
10
|
+
// prettier-ignore
|
|
11
|
+
const errorMsg = [
|
|
12
|
+
`Trying to access "${propPretty}" without checking platform first.`,
|
|
13
|
+
`Hint: Use "${hintPlatformCheck}" to check platform before accessing "${propPretty}".`
|
|
14
|
+
].join('\n');
|
|
15
|
+
throw new Error(errorMsg);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=platform-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-check.js","sourceRoot":"","sources":["../../../../packages/core/utils/platform-check.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAe;IAC5C,IAAI,OAAO,EAAE;QACZ,OAAO,IAAI,KAAK,CACf,EAAE,EACF;YACC,GAAG,CAAC,CAAC,EAAE,IAAI;gBACV,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACvD,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,kBAAkB,CAAC;gBAEjF,kBAAkB;gBAClB,MAAM,QAAQ,GAAG;oBAChB,qBAAqB,UAAU,oCAAoC;oBACnE,cAAc,iBAAiB,yCAAyC,UAAU,IAAI;iBACtF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAEb,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC3B,CAAC;SACD,CACD,CAAC;KACF;IAED,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helps sanitize a module name if it is prefixed with '~/', '~' or '/'
|
|
3
|
-
* @param moduleName the name
|
|
4
|
-
* @param removeExtension whether to remove extension
|
|
5
|
-
*/
|
|
6
|
-
export function sanitizeModuleName(moduleName, removeExtension = true) {
|
|
7
|
-
moduleName = moduleName.trim();
|
|
8
|
-
if (moduleName.startsWith('~/')) {
|
|
9
|
-
moduleName = moduleName.substring(2);
|
|
10
|
-
}
|
|
11
|
-
else if (moduleName.startsWith('~')) {
|
|
12
|
-
moduleName = moduleName.substring(1);
|
|
13
|
-
}
|
|
14
|
-
else if (moduleName.startsWith('/')) {
|
|
15
|
-
moduleName = moduleName.substring(1);
|
|
16
|
-
}
|
|
17
|
-
if (removeExtension) {
|
|
18
|
-
const extToRemove = ['js', 'ts', 'xml', 'html', 'css', 'scss'];
|
|
19
|
-
const extensionRegEx = new RegExp(`(.*)\\.(?:${extToRemove.join('|')})`, 'i');
|
|
20
|
-
moduleName = moduleName.replace(extensionRegEx, '$1');
|
|
21
|
-
}
|
|
22
|
-
return moduleName;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=module-name-sanitizer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-name-sanitizer.js","sourceRoot":"","sources":["../../../../../packages/core/ui/builder/module-name-sanitizer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAkB,EAAE,eAAe,GAAG,IAAI;IAC5E,UAAU,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IAE/B,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAChC,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KACrC;SAAM,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACtC,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KACrC;SAAM,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACtC,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KACrC;IAED,IAAI,eAAe,EAAE;QACpB,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC/D,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,aAAa,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC9E,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;KACtD;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { NavigationTransition } from '.';
|
|
2
|
-
export declare function _createIOSAnimatedTransitioning(navigationTransition: NavigationTransition, nativeCurve: UIViewAnimationCurve, operation: UINavigationControllerOperation, fromVC: UIViewController, toVC: UIViewController): UIViewControllerAnimatedTransitioning;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { SlideTransition } from '../transition/slide-transition';
|
|
2
|
-
import { FadeTransition } from '../transition/fade-transition';
|
|
3
|
-
import { Trace } from '../../trace';
|
|
4
|
-
var UIViewControllerAnimatedTransitioningMethods;
|
|
5
|
-
(function (UIViewControllerAnimatedTransitioningMethods) {
|
|
6
|
-
const methodSignature = NSMethodSignature.signatureWithObjCTypes('v@:c');
|
|
7
|
-
const invocation = NSInvocation.invocationWithMethodSignature(methodSignature);
|
|
8
|
-
invocation.selector = 'completeTransition:';
|
|
9
|
-
function completeTransition(didComplete) {
|
|
10
|
-
const didCompleteReference = new interop.Reference(interop.types.bool, didComplete);
|
|
11
|
-
invocation.setArgumentAtIndex(didCompleteReference, 2);
|
|
12
|
-
invocation.invokeWithTarget(this);
|
|
13
|
-
}
|
|
14
|
-
UIViewControllerAnimatedTransitioningMethods.completeTransition = completeTransition;
|
|
15
|
-
})(UIViewControllerAnimatedTransitioningMethods || (UIViewControllerAnimatedTransitioningMethods = {}));
|
|
16
|
-
var AnimatedTransitioning = /** @class */ (function (_super) {
|
|
17
|
-
__extends(AnimatedTransitioning, _super);
|
|
18
|
-
function AnimatedTransitioning() {
|
|
19
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
20
|
-
}
|
|
21
|
-
AnimatedTransitioning.init = function (transition, operation, fromVC, toVC) {
|
|
22
|
-
var impl = AnimatedTransitioning.new();
|
|
23
|
-
impl._transition = transition;
|
|
24
|
-
impl._operation = operation;
|
|
25
|
-
impl._fromVC = fromVC;
|
|
26
|
-
impl._toVC = toVC;
|
|
27
|
-
return impl;
|
|
28
|
-
};
|
|
29
|
-
AnimatedTransitioning.prototype.animateTransition = function (transitionContext) {
|
|
30
|
-
var containerView = transitionContext.valueForKey('containerView');
|
|
31
|
-
var completion = UIViewControllerAnimatedTransitioningMethods.completeTransition.bind(transitionContext);
|
|
32
|
-
switch (this._operation) {
|
|
33
|
-
case UINavigationControllerOperation.Push:
|
|
34
|
-
this._transitionType = 'push';
|
|
35
|
-
break;
|
|
36
|
-
case UINavigationControllerOperation.Pop:
|
|
37
|
-
this._transitionType = 'pop';
|
|
38
|
-
break;
|
|
39
|
-
case UINavigationControllerOperation.None:
|
|
40
|
-
this._transitionType = 'none';
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
if (Trace.isEnabled()) {
|
|
44
|
-
Trace.write("START ".concat(this._transition, " ").concat(this._transitionType), Trace.categories.Transition);
|
|
45
|
-
}
|
|
46
|
-
this._transition.animateIOSTransition(containerView, this._fromVC.view, this._toVC.view, this._operation, completion);
|
|
47
|
-
};
|
|
48
|
-
AnimatedTransitioning.prototype.transitionDuration = function (transitionContext) {
|
|
49
|
-
return this._transition.getDuration();
|
|
50
|
-
};
|
|
51
|
-
AnimatedTransitioning.prototype.animationEnded = function (transitionCompleted) {
|
|
52
|
-
if (transitionCompleted) {
|
|
53
|
-
if (Trace.isEnabled()) {
|
|
54
|
-
Trace.write("END ".concat(this._transition, " ").concat(this._transitionType), Trace.categories.Transition);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
if (Trace.isEnabled()) {
|
|
59
|
-
Trace.write("CANCEL ".concat(this._transition, " ").concat(this._transitionType), Trace.categories.Transition);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
AnimatedTransitioning.ObjCProtocols = [UIViewControllerAnimatedTransitioning];
|
|
64
|
-
return AnimatedTransitioning;
|
|
65
|
-
}(NSObject));
|
|
66
|
-
export function _createIOSAnimatedTransitioning(navigationTransition, nativeCurve, operation, fromVC, toVC) {
|
|
67
|
-
const instance = navigationTransition.instance;
|
|
68
|
-
let transition;
|
|
69
|
-
if (instance) {
|
|
70
|
-
// Instance transition should take precedence even if the given name match existing transition.
|
|
71
|
-
transition = instance;
|
|
72
|
-
}
|
|
73
|
-
else if (navigationTransition.name) {
|
|
74
|
-
const name = navigationTransition.name.toLowerCase();
|
|
75
|
-
if (name.indexOf('slide') === 0) {
|
|
76
|
-
const direction = name.substr('slide'.length) || 'left'; //Extract the direction from the string
|
|
77
|
-
transition = new SlideTransition(direction, navigationTransition.duration, nativeCurve);
|
|
78
|
-
}
|
|
79
|
-
else if (name === 'fade') {
|
|
80
|
-
transition = new FadeTransition(navigationTransition.duration, nativeCurve);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return transition ? AnimatedTransitioning.init(transition, operation, fromVC, toVC) : undefined;
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=fragment.transitions.ios.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fragment.transitions.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/frame/fragment.transitions.ios.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,IAAU,4CAA4C,CAUrD;AAVD,WAAU,4CAA4C;IACrD,MAAM,eAAe,GAAG,iBAAiB,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACzE,MAAM,UAAU,GAAG,YAAY,CAAC,6BAA6B,CAAC,eAAe,CAAC,CAAC;IAC/E,UAAU,CAAC,QAAQ,GAAG,qBAAqB,CAAC;IAE5C,SAAgB,kBAAkB,CAAC,WAAoB;QACtD,MAAM,oBAAoB,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACpF,UAAU,CAAC,kBAAkB,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC;QACvD,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