@nativescript/core 9.1.0-dev.0 → 9.1.0-next.0
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-common.d.ts +8 -0
- package/accessibility/accessibility-common.js +28 -0
- package/accessibility/accessibility-common.js.map +1 -1
- package/application/application-common.d.ts +188 -6
- package/application/application-common.js +402 -98
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +59 -1
- package/application/application.android.d.ts +38 -1
- package/application/application.android.js +195 -12
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +121 -75
- package/application/application.ios.d.ts +106 -28
- package/application/application.ios.js +619 -343
- package/application/application.ios.js.map +1 -1
- package/application/helpers-common.d.ts +5 -0
- package/application/helpers-common.js +23 -1
- package/application/helpers-common.js.map +1 -1
- package/application/scene-delegate-bridge.d.ts +55 -0
- package/application/scene-delegate-bridge.js +122 -0
- package/application/scene-delegate-bridge.js.map +1 -0
- package/color/index.d.ts +0 -5
- package/config/config.interface.d.ts +44 -2
- package/core-types/index.d.ts +9 -2
- package/core-types/index.js +7 -0
- package/core-types/index.js.map +1 -1
- package/css/CSS3Parser.js +3 -2
- package/css/CSS3Parser.js.map +1 -1
- package/css/system-classes.d.ts +9 -0
- package/css/system-classes.js +23 -0
- package/css/system-classes.js.map +1 -1
- package/data/observable/index.d.ts +5 -0
- package/data/observable/index.js +46 -9
- package/data/observable/index.js.map +1 -1
- package/debugger/dom-types.js +31 -1
- package/debugger/dom-types.js.map +1 -1
- package/fetch/index.mjs +2 -2
- package/file-system/file-system-access.ios.js +18 -10
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.d.ts +3 -3
- package/global-types.d.ts +39 -34
- package/globals/global-utils.d.ts +6 -1
- package/globals/global-utils.js +10 -5
- package/globals/global-utils.js.map +1 -1
- package/globals/index.js +18 -5
- package/globals/index.js.map +1 -1
- package/globals/polyfills/utils.js +2 -0
- package/globals/polyfills/utils.js.map +1 -1
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.ios.js.map +1 -1
- package/http/http-request-internal/index.android.d.ts +7 -1
- package/http/http-request-internal/index.android.js.map +1 -1
- package/http/http-request-internal/index.ios.d.ts +7 -1
- package/http/http-request-internal/index.ios.js.map +1 -1
- package/image-source/index.android.d.ts +0 -1
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.d.ts +0 -5
- package/image-source/index.ios.d.ts +0 -1
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/inspector_modules.js +1 -1
- package/inspector_modules.js.map +1 -1
- package/native-window/index.d.ts +426 -0
- package/native-window/index.js +4 -0
- package/native-window/index.js.map +1 -0
- package/native-window/native-window-common.d.ts +153 -0
- package/native-window/native-window-common.js +340 -0
- package/native-window/native-window-common.js.map +1 -0
- package/native-window/native-window-interfaces.d.ts +186 -0
- package/native-window/native-window-interfaces.js +90 -0
- package/native-window/native-window-interfaces.js.map +1 -0
- package/native-window/native-window.android.d.ts +59 -0
- package/native-window/native-window.android.js +175 -0
- package/native-window/native-window.android.js.map +1 -0
- package/native-window/native-window.ios.d.ts +57 -0
- package/native-window/native-window.ios.js +208 -0
- package/native-window/native-window.ios.js.map +1 -0
- package/native-window/window-base.d.ts +103 -0
- package/native-window/window-base.js +78 -0
- package/native-window/window-base.js.map +1 -0
- package/package.json +4 -6
- package/platform/common.d.ts +0 -2
- package/platform/common.js +0 -2
- package/platform/common.js.map +1 -1
- package/platforms/android/widgets-release.aar +0 -0
- package/platforms/ios/TNSWidgets.xcframework/Info.plist +14 -14
- 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/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +7 -7
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +7 -7
- 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/Resources/Info.plist +7 -7
- 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-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +78 -78
- 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 +1 -1
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +1 -1
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +78 -78
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +78 -78
- package/platforms/ios/src/NativeScriptMainWindow.swift +72 -39
- package/references.d.ts +0 -4
- package/trace/index.d.ts +2 -2
- package/ui/action-bar/action-bar-common.js +0 -1
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.ios.js +0 -1
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +1 -1
- package/ui/builder/index.d.ts +0 -1
- package/ui/builder/index.js +10 -3
- package/ui/builder/index.js.map +1 -1
- package/ui/button/index.android.d.ts +2 -9
- package/ui/button/index.android.js +7 -24
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.d.ts +2 -9
- package/ui/button/index.ios.js +17 -72
- package/ui/button/index.ios.js.map +1 -1
- package/ui/core/bindable/index.js +2 -1
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/properties/index.d.ts +24 -1
- package/ui/core/properties/index.js +96 -10
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/properties/property-shared.js +11 -2
- package/ui/core/properties/property-shared.js.map +1 -1
- package/ui/core/view/index.android.d.ts +1 -0
- package/ui/core/view/index.android.js +42 -11
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +58 -1
- package/ui/core/view/index.ios.d.ts +1 -0
- package/ui/core/view/index.ios.js +28 -6
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +37 -2
- package/ui/core/view/view-common.js +82 -6
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.d.ts +1 -0
- package/ui/core/view/view-helper/index.ios.d.ts +10 -0
- package/ui/core/view/view-helper/index.ios.js +33 -5
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +21 -3
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.d.ts +37 -18
- package/ui/core/view-base/index.js +104 -65
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/frame/fragment.transitions.android.d.ts +13 -13
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +16 -3
- package/ui/frame/frame-common.js +19 -7
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-constants.d.ts +9 -0
- package/ui/frame/frame-constants.js +10 -0
- package/ui/frame/frame-constants.js.map +1 -0
- package/ui/frame/frame-helper-for-android.d.ts +6 -6
- package/ui/frame/frame-helper-for-android.js +31 -13
- package/ui/frame/frame-helper-for-android.js.map +1 -1
- package/ui/frame/frame-interfaces.d.ts +1 -1
- package/ui/frame/frame-stack.d.ts +17 -1
- package/ui/frame/frame-stack.js +32 -5
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.d.ts +7 -12
- package/ui/frame/index.android.js +157 -97
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +27 -26
- package/ui/frame/index.ios.d.ts +2 -2
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/image/image-common.js +1 -1
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.js +13 -1
- package/ui/image/index.android.js.map +1 -1
- package/ui/label/index.ios.d.ts +2 -5
- package/ui/label/index.ios.js +12 -44
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/index.ios.js +3 -0
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/dock-layout/index.ios.js +3 -0
- package/ui/layouts/dock-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.d.ts +9 -17
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +11 -64
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.d.ts +5 -0
- package/ui/layouts/flexbox-layout/index.android.js +15 -0
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.d.ts +19 -1
- package/ui/layouts/flexbox-layout/index.ios.d.ts +2 -0
- package/ui/layouts/flexbox-layout/index.ios.js +244 -193
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/grid-layout/index.ios.js +3 -0
- package/ui/layouts/grid-layout/index.ios.js.map +1 -1
- package/ui/layouts/layout-base-common.d.ts +1 -0
- package/ui/layouts/layout-base-common.js +21 -0
- package/ui/layouts/layout-base-common.js.map +1 -1
- package/ui/layouts/layout-base.android.d.ts +3 -10
- package/ui/layouts/layout-base.android.js +7 -24
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +3 -0
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/index.ios.js +3 -0
- package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
- package/ui/list-view/index.android.js +3 -2
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +13 -1
- package/ui/list-view/index.ios.d.ts +5 -3
- package/ui/list-view/index.ios.js +63 -27
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.d.ts +15 -0
- package/ui/list-view/list-view-common.js +19 -0
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.android.d.ts +1 -0
- package/ui/page/index.android.js +4 -0
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.d.ts +1 -1
- package/ui/page/index.ios.d.ts +3 -1
- package/ui/page/index.ios.js +23 -6
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +5 -2
- package/ui/page/page-common.js.map +1 -1
- package/ui/repeater/index.d.ts +2 -1
- package/ui/repeater/index.js.map +1 -1
- package/ui/scroll-view/index.d.ts +11 -0
- package/ui/scroll-view/index.ios.d.ts +3 -1
- package/ui/scroll-view/index.ios.js +28 -8
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.d.ts +6 -0
- package/ui/scroll-view/scroll-view-common.js +8 -0
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/segmented-bar/segmented-bar-common.d.ts +5 -1
- package/ui/segmented-bar/segmented-bar-common.js +6 -1
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
- package/ui/styling/background-common.d.ts +2 -0
- package/ui/styling/background-common.js +9 -0
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.ios.js +2 -0
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/css-selector.d.ts +57 -13
- package/ui/styling/css-selector.js +280 -51
- package/ui/styling/css-selector.js.map +1 -1
- package/ui/styling/css-utils.d.ts +16 -0
- package/ui/styling/css-utils.js +121 -7
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font.d.ts +0 -4
- package/ui/styling/style/index.d.ts +12 -0
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.d.ts +6 -0
- package/ui/styling/style-properties.js +175 -106
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +15 -3
- package/ui/styling/style-scope.js +300 -65
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.ios.js +2 -1
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.d.ts +3 -1
- package/ui/tab-view/index.android.js +56 -46
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.d.ts +10 -1
- package/ui/tab-view/index.ios.js +22 -4
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.d.ts +6 -1
- package/ui/tab-view/tab-view-common.js +16 -3
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/index.android.d.ts +3 -10
- package/ui/text-base/index.android.js +15 -32
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.js +5 -3
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-field/index.ios.d.ts +2 -9
- package/ui/text-field/index.ios.js +2 -23
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.d.ts +2 -9
- package/ui/text-view/index.ios.js +20 -72
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/transition/index.d.ts +2 -1
- package/ui/transition/modal-transition.ios.js +33 -5
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.ios.d.ts +5 -0
- package/ui/transition/page-transition.ios.js +296 -33
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.android.d.ts +3 -0
- package/ui/transition/shared-transition-helper.android.js +9 -0
- package/ui/transition/shared-transition-helper.android.js.map +1 -1
- package/ui/transition/shared-transition-helper.d.ts +7 -0
- package/ui/transition/shared-transition-helper.ios.d.ts +36 -0
- package/ui/transition/shared-transition-helper.ios.js +765 -89
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.d.ts +67 -0
- package/ui/transition/shared-transition.js +62 -2
- package/ui/transition/shared-transition.js.map +1 -1
- package/utils/debug-source.js +0 -3
- package/utils/debug-source.js.map +1 -1
- package/utils/layout-helper/index.ios.js +11 -3
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/native-helper.android.d.ts +66 -2
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.d.ts +2 -2
- package/utils/native-helper.ios.d.ts +105 -2
- package/utils/native-helper.ios.js +15 -4
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/native-helper.types.d.ts +2 -0
- package/utils/platform-check.d.ts +1 -1
- package/utils/platform-check.js.map +1 -1
- package/animation-frame/animation-native.windows.d.ts +0 -1
- package/animation-frame/animation-native.windows.js +0 -4
- package/animation-frame/animation-native.windows.js.map +0 -1
- package/application/application.windows.d.ts +0 -27
- package/application/application.windows.js +0 -331
- package/application/application.windows.js.map +0 -1
- package/application/helpers.windows.d.ts +0 -8
- package/application/helpers.windows.js +0 -12
- package/application/helpers.windows.js.map +0 -1
- package/application/index.windows.d.ts +0 -2
- package/application/index.windows.js +0 -3
- package/application/index.windows.js.map +0 -1
- package/application/window-helper.windows.d.ts +0 -29
- package/application/window-helper.windows.js +0 -159
- package/application/window-helper.windows.js.map +0 -1
- package/application-settings/index.windows.d.ts +0 -11
- package/application-settings/index.windows.js +0 -93
- package/application-settings/index.windows.js.map +0 -1
- package/color/index.windows.d.ts +0 -8
- package/color/index.windows.js +0 -19
- package/color/index.windows.js.map +0 -1
- package/connectivity/index.windows.d.ts +0 -11
- package/connectivity/index.windows.js +0 -50
- package/connectivity/index.windows.js.map +0 -1
- package/debugger/webinspector-network.windows.d.ts +0 -79
- package/debugger/webinspector-network.windows.js +0 -307
- package/debugger/webinspector-network.windows.js.map +0 -1
- package/file-system/file-system-access.windows.d.ts +0 -76
- package/file-system/file-system-access.windows.js +0 -476
- package/file-system/file-system-access.windows.js.map +0 -1
- package/fps-meter/fps-native.windows.d.ts +0 -8
- package/fps-meter/fps-native.windows.js +0 -40
- package/fps-meter/fps-native.windows.js.map +0 -1
- package/http/http-request/index.windows.d.ts +0 -2
- package/http/http-request/index.windows.js +0 -41
- package/http/http-request/index.windows.js.map +0 -1
- package/http/http-request-internal/index.windows.d.ts +0 -4
- package/http/http-request-internal/index.windows.js +0 -134
- package/http/http-request-internal/index.windows.js.map +0 -1
- package/image-asset/index.windows.d.ts +0 -9
- package/image-asset/index.windows.js +0 -34
- package/image-asset/index.windows.js.map +0 -1
- package/image-source/index.windows.d.ts +0 -52
- package/image-source/index.windows.js +0 -498
- package/image-source/index.windows.js.map +0 -1
- package/platform/device/index.windows.d.ts +0 -18
- package/platform/device/index.windows.js +0 -94
- package/platform/device/index.windows.js.map +0 -1
- package/platform/screen/index.windows.d.ts +0 -13
- package/platform/screen/index.windows.js +0 -25
- package/platform/screen/index.windows.js.map +0 -1
- package/platforms/windows/arm64/NativeScript.Widgets.dll +0 -0
- package/platforms/windows/arm64/NativeScript.Widgets.winmd +0 -0
- package/platforms/windows/x64/NativeScript.Widgets.dll +0 -0
- package/platforms/windows/x64/NativeScript.Widgets.winmd +0 -0
- package/plugin.props +0 -12
- package/plugin.targets +0 -71
- package/text/index.windows.d.ts +0 -9
- package/text/index.windows.js +0 -12
- package/text/index.windows.js.map +0 -1
- package/timer/index.windows.d.ts +0 -4
- package/timer/index.windows.js +0 -14
- package/timer/index.windows.js.map +0 -1
- package/ui/action-bar/index.windows.d.ts +0 -12
- package/ui/action-bar/index.windows.js +0 -36
- package/ui/action-bar/index.windows.js.map +0 -1
- package/ui/activity-indicator/index.windows.d.ts +0 -15
- package/ui/activity-indicator/index.windows.js +0 -65
- package/ui/activity-indicator/index.windows.js.map +0 -1
- package/ui/animation/index.windows.d.ts +0 -19
- package/ui/animation/index.windows.js +0 -603
- package/ui/animation/index.windows.js.map +0 -1
- package/ui/button/index.windows.d.ts +0 -13
- package/ui/button/index.windows.js +0 -73
- package/ui/button/index.windows.js.map +0 -1
- package/ui/core/control-state-change/index.windows.d.ts +0 -4
- package/ui/core/control-state-change/index.windows.js +0 -6
- package/ui/core/control-state-change/index.windows.js.map +0 -1
- package/ui/core/view/index.windows.d.ts +0 -120
- package/ui/core/view/index.windows.js +0 -2178
- package/ui/core/view/index.windows.js.map +0 -1
- package/ui/core/view/view-helper/index.windows.d.ts +0 -3
- package/ui/core/view/view-helper/index.windows.js +0 -4
- package/ui/core/view/view-helper/index.windows.js.map +0 -1
- package/ui/date-picker/index.windows.d.ts +0 -22
- package/ui/date-picker/index.windows.js +0 -97
- package/ui/date-picker/index.windows.js.map +0 -1
- package/ui/dialogs/index.windows.d.ts +0 -17
- package/ui/dialogs/index.windows.js +0 -471
- package/ui/dialogs/index.windows.js.map +0 -1
- package/ui/editable-text-base/index.windows.d.ts +0 -27
- package/ui/editable-text-base/index.windows.js +0 -165
- package/ui/editable-text-base/index.windows.js.map +0 -1
- package/ui/embedding/index.windows.d.ts +0 -1
- package/ui/embedding/index.windows.js +0 -4
- package/ui/embedding/index.windows.js.map +0 -1
- package/ui/frame/index.windows.d.ts +0 -52
- package/ui/frame/index.windows.js +0 -778
- package/ui/frame/index.windows.js.map +0 -1
- package/ui/gestures/index.windows.d.ts +0 -35
- package/ui/gestures/index.windows.js +0 -483
- package/ui/gestures/index.windows.js.map +0 -1
- package/ui/html-view/index.windows.d.ts +0 -18
- package/ui/html-view/index.windows.js +0 -191
- package/ui/html-view/index.windows.js.map +0 -1
- package/ui/image/index.windows.d.ts +0 -17
- package/ui/image/index.windows.js +0 -132
- package/ui/image/index.windows.js.map +0 -1
- package/ui/image/symbol-effects.windows.d.ts +0 -5
- package/ui/image/symbol-effects.windows.js +0 -8
- package/ui/image/symbol-effects.windows.js.map +0 -1
- package/ui/image-cache/index.windows.d.ts +0 -11
- package/ui/image-cache/index.windows.js +0 -48
- package/ui/image-cache/index.windows.js.map +0 -1
- package/ui/label/index.windows.d.ts +0 -15
- package/ui/label/index.windows.js +0 -66
- package/ui/label/index.windows.js.map +0 -1
- package/ui/layouts/absolute-layout/index.windows.d.ts +0 -8
- package/ui/layouts/absolute-layout/index.windows.js +0 -47
- package/ui/layouts/absolute-layout/index.windows.js.map +0 -1
- package/ui/layouts/dock-layout/index.windows.d.ts +0 -19
- package/ui/layouts/dock-layout/index.windows.js +0 -202
- package/ui/layouts/dock-layout/index.windows.js.map +0 -1
- package/ui/layouts/flexbox-layout/index.windows.d.ts +0 -27
- package/ui/layouts/flexbox-layout/index.windows.js +0 -188
- package/ui/layouts/flexbox-layout/index.windows.js.map +0 -1
- package/ui/layouts/grid-layout/index.windows.d.ts +0 -20
- package/ui/layouts/grid-layout/index.windows.js +0 -130
- package/ui/layouts/grid-layout/index.windows.js.map +0 -1
- package/ui/layouts/layout-base.windows.d.ts +0 -4
- package/ui/layouts/layout-base.windows.js +0 -5
- package/ui/layouts/layout-base.windows.js.map +0 -1
- package/ui/layouts/liquid-glass/index.windows.d.ts +0 -4
- package/ui/layouts/liquid-glass/index.windows.js +0 -5
- package/ui/layouts/liquid-glass/index.windows.js.map +0 -1
- package/ui/layouts/liquid-glass-container/index.windows.d.ts +0 -4
- package/ui/layouts/liquid-glass-container/index.windows.js +0 -5
- package/ui/layouts/liquid-glass-container/index.windows.js.map +0 -1
- package/ui/layouts/root-layout/index.windows.d.ts +0 -13
- package/ui/layouts/root-layout/index.windows.js +0 -160
- package/ui/layouts/root-layout/index.windows.js.map +0 -1
- package/ui/layouts/stack-layout/index.windows.d.ts +0 -13
- package/ui/layouts/stack-layout/index.windows.js +0 -63
- package/ui/layouts/stack-layout/index.windows.js.map +0 -1
- package/ui/layouts/wrap-layout/index.windows.d.ts +0 -20
- package/ui/layouts/wrap-layout/index.windows.js +0 -182
- package/ui/layouts/wrap-layout/index.windows.js.map +0 -1
- package/ui/list-picker/index.windows.d.ts +0 -19
- package/ui/list-picker/index.windows.js +0 -75
- package/ui/list-picker/index.windows.js.map +0 -1
- package/ui/list-view/index.windows.d.ts +0 -60
- package/ui/list-view/index.windows.js +0 -842
- package/ui/list-view/index.windows.js.map +0 -1
- package/ui/page/index.windows.d.ts +0 -12
- package/ui/page/index.windows.js +0 -42
- package/ui/page/index.windows.js.map +0 -1
- package/ui/progress/index.windows.d.ts +0 -20
- package/ui/progress/index.windows.js +0 -65
- package/ui/progress/index.windows.js.map +0 -1
- package/ui/scroll-view/index.windows.d.ts +0 -29
- package/ui/scroll-view/index.windows.js +0 -192
- package/ui/scroll-view/index.windows.js.map +0 -1
- package/ui/search-bar/index.windows.d.ts +0 -19
- package/ui/search-bar/index.windows.js +0 -91
- package/ui/search-bar/index.windows.js.map +0 -1
- package/ui/segmented-bar/index.windows.d.ts +0 -23
- package/ui/segmented-bar/index.windows.js +0 -117
- package/ui/segmented-bar/index.windows.js.map +0 -1
- package/ui/slider/index.windows.d.ts +0 -25
- package/ui/slider/index.windows.js +0 -134
- package/ui/slider/index.windows.js.map +0 -1
- package/ui/split-view/index.windows.d.ts +0 -49
- package/ui/split-view/index.windows.js +0 -549
- package/ui/split-view/index.windows.js.map +0 -1
- package/ui/styling/background.windows.d.ts +0 -2
- package/ui/styling/background.windows.js +0 -2
- package/ui/styling/background.windows.js.map +0 -1
- package/ui/styling/font.windows.d.ts +0 -25
- package/ui/styling/font.windows.js +0 -213
- package/ui/styling/font.windows.js.map +0 -1
- package/ui/switch/index.windows.d.ts +0 -20
- package/ui/switch/index.windows.js +0 -97
- package/ui/switch/index.windows.js.map +0 -1
- package/ui/tab-view/index.windows.d.ts +0 -29
- package/ui/tab-view/index.windows.js +0 -268
- package/ui/tab-view/index.windows.js.map +0 -1
- package/ui/text-base/index.windows.d.ts +0 -47
- package/ui/text-base/index.windows.js +0 -639
- package/ui/text-base/index.windows.js.map +0 -1
- package/ui/text-field/index.windows.d.ts +0 -23
- package/ui/text-field/index.windows.js +0 -186
- package/ui/text-field/index.windows.js.map +0 -1
- package/ui/text-view/index.windows.d.ts +0 -12
- package/ui/text-view/index.windows.js +0 -47
- package/ui/text-view/index.windows.js.map +0 -1
- package/ui/time-picker/index.windows.d.ts +0 -18
- package/ui/time-picker/index.windows.js +0 -77
- package/ui/time-picker/index.windows.js.map +0 -1
- package/ui/transition/fade-transition.windows.d.ts +0 -3
- package/ui/transition/fade-transition.windows.js +0 -4
- package/ui/transition/fade-transition.windows.js.map +0 -1
- package/ui/transition/index.windows.d.ts +0 -20
- package/ui/transition/index.windows.js +0 -30
- package/ui/transition/index.windows.js.map +0 -1
- package/ui/transition/modal-transition.windows.d.ts +0 -3
- package/ui/transition/modal-transition.windows.js +0 -4
- package/ui/transition/modal-transition.windows.js.map +0 -1
- package/ui/transition/page-transition.windows.d.ts +0 -3
- package/ui/transition/page-transition.windows.js +0 -4
- package/ui/transition/page-transition.windows.js.map +0 -1
- package/ui/transition/shared-transition-helper.windows.d.ts +0 -30
- package/ui/transition/shared-transition-helper.windows.js +0 -155
- package/ui/transition/shared-transition-helper.windows.js.map +0 -1
- package/ui/transition/slide-transition.windows.d.ts +0 -3
- package/ui/transition/slide-transition.windows.js +0 -4
- package/ui/transition/slide-transition.windows.js.map +0 -1
- package/ui/utils.windows.d.ts +0 -9
- package/ui/utils.windows.js +0 -21
- package/ui/utils.windows.js.map +0 -1
- package/ui/web-view/index.windows.d.ts +0 -23
- package/ui/web-view/index.windows.js +0 -115
- package/ui/web-view/index.windows.js.map +0 -1
- package/utils/constants.windows.d.ts +0 -2
- package/utils/constants.windows.js +0 -5
- package/utils/constants.windows.js.map +0 -1
- package/utils/index.windows.d.ts +0 -20
- package/utils/index.windows.js +0 -94
- package/utils/index.windows.js.map +0 -1
- package/utils/layout-helper/index.windows.d.ts +0 -25
- package/utils/layout-helper/index.windows.js +0 -74
- package/utils/layout-helper/index.windows.js.map +0 -1
- package/utils/mainthread-helper.windows.d.ts +0 -3
- package/utils/mainthread-helper.windows.js +0 -18
- package/utils/mainthread-helper.windows.js.map +0 -1
- package/utils/native-helper.windows.d.ts +0 -8
- package/utils/native-helper.windows.js +0 -101
- package/utils/native-helper.windows.js.map +0 -1
|
@@ -3,10 +3,14 @@ import { isEmbedded } from '../ui/embedding';
|
|
|
3
3
|
import { IOSHelper } from '../ui/core/view/view-helper';
|
|
4
4
|
import { getWindow } from '../utils/native-helper';
|
|
5
5
|
import { SDK_VERSION } from '../utils/constants';
|
|
6
|
-
import { ios as iosUtils, dataSerialize } from '../utils/native-helper';
|
|
7
|
-
import { ApplicationCommon
|
|
6
|
+
import { ios as iosUtils, dataSerialize, dataDeserialize } from '../utils/native-helper';
|
|
7
|
+
import { ApplicationCommon } from './application-common';
|
|
8
|
+
import { deliverShortcutItem, forwardContinueUserActivity, forwardOpenURLContexts, oneShotCompletion } from './scene-delegate-bridge';
|
|
8
9
|
import { Observable } from '../data/observable';
|
|
9
10
|
import { Trace } from '../trace';
|
|
11
|
+
import { IOSNativeWindow } from '../native-window/native-window.ios';
|
|
12
|
+
import { NativeWindow } from '../native-window/native-window-common';
|
|
13
|
+
import { NativeWindowEvents } from '../native-window/native-window-interfaces';
|
|
10
14
|
import { AccessibilityServiceEnabledPropName, CommonA11YServiceEnabledObservable, SharedA11YObservable, a11yServiceClasses, a11yServiceDisabledClass, a11yServiceEnabledClass, fontScaleCategoryClasses, fontScaleExtraLargeCategoryClass, fontScaleExtraSmallCategoryClass, fontScaleMediumCategoryClass, getCurrentA11YServiceClass, getCurrentFontScaleCategory, getCurrentFontScaleClass, getFontScaleCssClasses, setCurrentA11YServiceClass, setCurrentFontScaleCategory, setCurrentFontScaleClass, setFontScaleCssClasses, FontScaleCategory, getClosestValidFontScale, VALID_FONT_SCALES, setFontScale, getFontScale, setInitFontScale, getFontScaleCategory, setInitAccessibilityCssHelper, notifyAccessibilityFocusState, AccessibilityLiveRegion, AccessibilityRole, AccessibilityState, AccessibilityTrait, isA11yEnabled, setA11yEnabled, enforceArray, } from '../accessibility/accessibility-common';
|
|
11
15
|
import { CoreTypes } from '../core-types';
|
|
12
16
|
import { getiOSWindow, setA11yUpdatePropertiesCallback, setApplicationPropertiesCallback, setAppMainEntry, setiOSWindow, setRootView, setToggleApplicationEventListenersCallback } from './helpers-common';
|
|
@@ -39,6 +43,7 @@ var CADisplayLinkTarget = (function (_super) {
|
|
|
39
43
|
return target;
|
|
40
44
|
};
|
|
41
45
|
CADisplayLinkTarget.prototype.onDisplayed = function (link) {
|
|
46
|
+
var _a;
|
|
42
47
|
link.invalidate();
|
|
43
48
|
var owner = this._owner.deref();
|
|
44
49
|
if (!owner) {
|
|
@@ -50,6 +55,7 @@ var CADisplayLinkTarget = (function (_super) {
|
|
|
50
55
|
object: owner,
|
|
51
56
|
ios: UIApplication.sharedApplication,
|
|
52
57
|
});
|
|
58
|
+
(_a = owner.primaryWindow) === null || _a === void 0 ? void 0 : _a._notifyEvent(NativeWindowEvents.displayed);
|
|
53
59
|
owner.displayedLinkTarget = null;
|
|
54
60
|
owner.displayedLink = null;
|
|
55
61
|
};
|
|
@@ -80,6 +86,15 @@ function supportsMultipleScenes() {
|
|
|
80
86
|
}
|
|
81
87
|
return UIApplication.sharedApplication?.supportsMultipleScenes;
|
|
82
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Number of times the JS runtime has been soft-rebooted in this process via
|
|
91
|
+
* NativeScriptRuntime.reloadApplication / restartWithConfig. 0 on first boot.
|
|
92
|
+
* Provided as a global by the iOS runtime (v9+); older runtimes report 0.
|
|
93
|
+
*/
|
|
94
|
+
function getRuntimeReloadCount() {
|
|
95
|
+
const runtime = globalThis.NativeScriptRuntime;
|
|
96
|
+
return runtime && typeof runtime.reloadCount === 'number' ? runtime.reloadCount : 0;
|
|
97
|
+
}
|
|
83
98
|
var Responder = (function (_super) {
|
|
84
99
|
__extends(Responder, _super);
|
|
85
100
|
function Responder() {
|
|
@@ -104,8 +119,28 @@ if (supportsScenes()) {
|
|
|
104
119
|
* Detected by the Info.plist existence 'UIApplicationSceneManifest'.
|
|
105
120
|
* If this method is implemented when there is no manifest defined,
|
|
106
121
|
* the app will boot to a white screen.
|
|
122
|
+
*
|
|
123
|
+
* Since we configure the delegate dynamically here, UISceneConfigurations
|
|
124
|
+
* does NOT need to be present in Info.plist — only UIApplicationSceneManifest is required.
|
|
125
|
+
*
|
|
126
|
+
* NativeScript only handles UIWindowSceneSessionRoleApplication by default.
|
|
127
|
+
* Other scene types (CarPlay, external displays, etc.) are ignored unless
|
|
128
|
+
* the user provides an `onSceneConfiguration` callback.
|
|
107
129
|
*/
|
|
108
130
|
Responder.prototype.applicationConfigurationForConnectingSceneSessionOptions = function (application, connectingSceneSession, options) {
|
|
131
|
+
// Let the user intercept scene configuration for any/all scenes
|
|
132
|
+
const userHandler = Application.ios._onSceneConfiguration;
|
|
133
|
+
if (userHandler) {
|
|
134
|
+
const userConfig = userHandler(application, connectingSceneSession, options);
|
|
135
|
+
if (userConfig) {
|
|
136
|
+
return userConfig;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// Only handle the standard window scene role — skip CarPlay, external displays, etc.
|
|
140
|
+
if (connectingSceneSession.role !== UIWindowSceneSessionRoleApplication) {
|
|
141
|
+
// Return a bare configuration so iOS doesn't crash, but NativeScript won't manage it
|
|
142
|
+
return UISceneConfiguration.configurationWithNameSessionRole('Unmanaged', connectingSceneSession.role);
|
|
143
|
+
}
|
|
109
144
|
const config = UISceneConfiguration.configurationWithNameSessionRole('Default Configuration', connectingSceneSession.role);
|
|
110
145
|
config.sceneClass = UIWindowScene;
|
|
111
146
|
config.delegateClass = SceneDelegate;
|
|
@@ -113,10 +148,20 @@ if (supportsScenes()) {
|
|
|
113
148
|
};
|
|
114
149
|
// scene session destruction handling
|
|
115
150
|
Responder.prototype.applicationDidDiscardSceneSessions = function (application, sceneSessions) {
|
|
116
|
-
|
|
117
|
-
// console.log('Scene sessions discarded:', sceneSessions.count);
|
|
151
|
+
Application.ios._onSceneSessionsDiscarded(sceneSessions);
|
|
118
152
|
};
|
|
119
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Reads the payload `openWindow()` put on the activating NSUserActivity.
|
|
156
|
+
*/
|
|
157
|
+
function getSceneConnectionData(connectionOptions) {
|
|
158
|
+
const activities = connectionOptions?.userActivities;
|
|
159
|
+
if (!activities || activities.count === 0) {
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
const activity = activities.allObjects.objectAtIndex(0);
|
|
163
|
+
return activity?.userInfo ? dataDeserialize(activity.userInfo) : undefined;
|
|
164
|
+
}
|
|
120
165
|
var SceneDelegate = (function (_super) {
|
|
121
166
|
__extends(SceneDelegate, _super);
|
|
122
167
|
function SceneDelegate() {
|
|
@@ -139,48 +184,234 @@ var SceneDelegate = (function (_super) {
|
|
|
139
184
|
if (!(scene instanceof UIWindowScene)) {
|
|
140
185
|
return;
|
|
141
186
|
}
|
|
142
|
-
var
|
|
143
|
-
|
|
144
|
-
this.
|
|
145
|
-
|
|
146
|
-
|
|
187
|
+
var windowScene = scene;
|
|
188
|
+
var isFirstScene = Application.ios._getWindows().length === 0;
|
|
189
|
+
this._scene = windowScene;
|
|
190
|
+
this._window = UIWindow.alloc().initWithWindowScene(windowScene);
|
|
191
|
+
if (!__VISIONOS__) {
|
|
192
|
+
this._window.backgroundColor = SDK_VERSION <= 12 || !UIColor.systemBackgroundColor ? UIColor.whiteColor : UIColor.systemBackgroundColor;
|
|
193
|
+
}
|
|
194
|
+
var nativeWindowId = IOSNativeWindow.getSceneId(windowScene);
|
|
195
|
+
var knownWindow = nativeWindowId ? Application.ios.getWindowById(nativeWindowId) : undefined;
|
|
196
|
+
var nativeWindow;
|
|
197
|
+
if ((knownWindow === null || knownWindow === void 0 ? void 0 : knownWindow.state) === "detached") {
|
|
198
|
+
nativeWindow = knownWindow;
|
|
199
|
+
nativeWindow._reattach(windowScene, this._window);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
var isPrimary_1 = isFirstScene || !Application.ios.primaryWindow;
|
|
203
|
+
nativeWindow = new IOSNativeWindow(windowScene, this._window, nativeWindowId, isPrimary_1);
|
|
204
|
+
Application.ios._registerWindow(nativeWindow);
|
|
205
|
+
}
|
|
206
|
+
var isPrimary = nativeWindow.isPrimary;
|
|
207
|
+
nativeWindow._notifyEvent(NativeWindowEvents.attached);
|
|
208
|
+
if (isPrimary) {
|
|
209
|
+
setiOSWindow(this._window);
|
|
210
|
+
}
|
|
211
|
+
nativeWindow.notify({
|
|
212
|
+
eventName: NativeWindowEvents.sceneWillConnect,
|
|
213
|
+
object: nativeWindow,
|
|
214
|
+
window: nativeWindow,
|
|
215
|
+
scene: windowScene,
|
|
216
|
+
uiWindow: this._window,
|
|
217
|
+
connectionOptions: connectionOptions,
|
|
218
|
+
});
|
|
147
219
|
Application.ios.notify({
|
|
148
|
-
eventName:
|
|
220
|
+
eventName: NativeWindowEvents.sceneWillConnect,
|
|
149
221
|
object: Application.ios,
|
|
150
|
-
|
|
151
|
-
|
|
222
|
+
window: nativeWindow,
|
|
223
|
+
scene: windowScene,
|
|
224
|
+
uiWindow: this._window,
|
|
152
225
|
connectionOptions: connectionOptions,
|
|
153
226
|
});
|
|
154
|
-
if (
|
|
227
|
+
if (isPrimary) {
|
|
155
228
|
this._window.makeKeyAndVisible();
|
|
156
229
|
}
|
|
157
|
-
|
|
158
|
-
Application.ios.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
connectionOptions: connectionOptions,
|
|
230
|
+
if (nativeWindow.role === "application") {
|
|
231
|
+
Application.ios._resolveWindowContent(nativeWindow, {
|
|
232
|
+
window: nativeWindow,
|
|
233
|
+
isPrimary: isPrimary,
|
|
234
|
+
data: getSceneConnectionData(connectionOptions),
|
|
235
|
+
ios: { connectionOptions: connectionOptions },
|
|
164
236
|
});
|
|
165
237
|
}
|
|
166
|
-
if (isFirstScene) {
|
|
167
|
-
Application.ios._notifySceneAppStarted();
|
|
168
|
-
}
|
|
169
238
|
};
|
|
170
239
|
SceneDelegate.prototype.sceneDidBecomeActive = function (scene) {
|
|
240
|
+
var windowScene = scene;
|
|
241
|
+
var nativeWindow = Application.ios._getWindowForScene(windowScene);
|
|
242
|
+
if (nativeWindow) {
|
|
243
|
+
nativeWindow._notifyEvent(NativeWindowEvents.activate);
|
|
244
|
+
nativeWindow.notify({
|
|
245
|
+
eventName: NativeWindowEvents.sceneDidActivate,
|
|
246
|
+
object: nativeWindow,
|
|
247
|
+
window: nativeWindow,
|
|
248
|
+
scene: windowScene,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
Application.ios.notify({
|
|
252
|
+
eventName: NativeWindowEvents.sceneDidActivate,
|
|
253
|
+
object: Application.ios,
|
|
254
|
+
window: nativeWindow,
|
|
255
|
+
scene: windowScene,
|
|
256
|
+
});
|
|
257
|
+
var rootView = nativeWindow === null || nativeWindow === void 0 ? void 0 : nativeWindow.rootView;
|
|
258
|
+
if (rootView && !rootView.isLoaded) {
|
|
259
|
+
rootView.callLoaded();
|
|
260
|
+
}
|
|
171
261
|
};
|
|
172
262
|
SceneDelegate.prototype.sceneWillResignActive = function (scene) {
|
|
263
|
+
var windowScene = scene;
|
|
264
|
+
var nativeWindow = Application.ios._getWindowForScene(windowScene);
|
|
265
|
+
if (nativeWindow) {
|
|
266
|
+
nativeWindow._notifyEvent(NativeWindowEvents.deactivate);
|
|
267
|
+
nativeWindow.notify({
|
|
268
|
+
eventName: NativeWindowEvents.sceneWillResignActive,
|
|
269
|
+
object: nativeWindow,
|
|
270
|
+
window: nativeWindow,
|
|
271
|
+
scene: windowScene,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
173
274
|
Application.ios.notify({
|
|
174
|
-
eventName:
|
|
275
|
+
eventName: NativeWindowEvents.sceneWillResignActive,
|
|
175
276
|
object: Application.ios,
|
|
176
|
-
|
|
277
|
+
window: nativeWindow,
|
|
278
|
+
scene: windowScene,
|
|
177
279
|
});
|
|
178
280
|
};
|
|
179
281
|
SceneDelegate.prototype.sceneWillEnterForeground = function (scene) {
|
|
282
|
+
var windowScene = scene;
|
|
283
|
+
var nativeWindow = Application.ios._getWindowForScene(windowScene);
|
|
284
|
+
if (nativeWindow) {
|
|
285
|
+
nativeWindow._notifyEvent(NativeWindowEvents.foreground);
|
|
286
|
+
nativeWindow.notify({
|
|
287
|
+
eventName: NativeWindowEvents.sceneWillEnterForeground,
|
|
288
|
+
object: nativeWindow,
|
|
289
|
+
window: nativeWindow,
|
|
290
|
+
scene: windowScene,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
Application.ios.notify({
|
|
294
|
+
eventName: NativeWindowEvents.sceneWillEnterForeground,
|
|
295
|
+
object: Application.ios,
|
|
296
|
+
window: nativeWindow,
|
|
297
|
+
scene: windowScene,
|
|
298
|
+
});
|
|
180
299
|
};
|
|
181
300
|
SceneDelegate.prototype.sceneDidEnterBackground = function (scene) {
|
|
301
|
+
var windowScene = scene;
|
|
302
|
+
var nativeWindow = Application.ios._getWindowForScene(windowScene);
|
|
303
|
+
if (nativeWindow) {
|
|
304
|
+
nativeWindow._notifyEvent(NativeWindowEvents.background);
|
|
305
|
+
nativeWindow.notify({
|
|
306
|
+
eventName: NativeWindowEvents.sceneDidEnterBackground,
|
|
307
|
+
object: nativeWindow,
|
|
308
|
+
window: nativeWindow,
|
|
309
|
+
scene: windowScene,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
Application.ios.notify({
|
|
313
|
+
eventName: NativeWindowEvents.sceneDidEnterBackground,
|
|
314
|
+
object: Application.ios,
|
|
315
|
+
window: nativeWindow,
|
|
316
|
+
scene: windowScene,
|
|
317
|
+
});
|
|
318
|
+
var rootView = nativeWindow === null || nativeWindow === void 0 ? void 0 : nativeWindow.rootView;
|
|
319
|
+
if (rootView && rootView.isLoaded) {
|
|
320
|
+
rootView.callUnloaded();
|
|
321
|
+
}
|
|
182
322
|
};
|
|
183
323
|
SceneDelegate.prototype.sceneDidDisconnect = function (scene) {
|
|
324
|
+
var windowScene = scene;
|
|
325
|
+
var nativeWindow = Application.ios._getWindowForScene(windowScene);
|
|
326
|
+
if (nativeWindow) {
|
|
327
|
+
var isClosing = nativeWindow._closeRequested || !nativeWindow._hasSessionIdentity;
|
|
328
|
+
if (isClosing) {
|
|
329
|
+
nativeWindow._notifyEvent(NativeWindowEvents.close);
|
|
330
|
+
}
|
|
331
|
+
nativeWindow.notify({
|
|
332
|
+
eventName: NativeWindowEvents.sceneDidDisconnect,
|
|
333
|
+
object: nativeWindow,
|
|
334
|
+
window: nativeWindow,
|
|
335
|
+
scene: windowScene,
|
|
336
|
+
});
|
|
337
|
+
if (isClosing) {
|
|
338
|
+
Application.ios._unregisterWindow(nativeWindow);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
nativeWindow._detach();
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
Application.ios.notify({
|
|
345
|
+
eventName: NativeWindowEvents.sceneDidDisconnect,
|
|
346
|
+
object: Application.ios,
|
|
347
|
+
window: nativeWindow,
|
|
348
|
+
scene: windowScene,
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
SceneDelegate.prototype.sceneOpenURLContexts = function (scene, URLContexts) {
|
|
352
|
+
var windowScene = scene;
|
|
353
|
+
var nativeWindow = Application.ios._getWindowForScene(windowScene);
|
|
354
|
+
if (nativeWindow) {
|
|
355
|
+
nativeWindow.notify({
|
|
356
|
+
eventName: NativeWindowEvents.sceneOpenURLContexts,
|
|
357
|
+
object: nativeWindow,
|
|
358
|
+
window: nativeWindow,
|
|
359
|
+
scene: windowScene,
|
|
360
|
+
urlContexts: URLContexts,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
Application.ios.notify({
|
|
364
|
+
eventName: NativeWindowEvents.sceneOpenURLContexts,
|
|
365
|
+
object: Application.ios,
|
|
366
|
+
window: nativeWindow,
|
|
367
|
+
scene: windowScene,
|
|
368
|
+
urlContexts: URLContexts,
|
|
369
|
+
});
|
|
370
|
+
forwardOpenURLContexts(Application.ios.delegate, UIApplication.sharedApplication, URLContexts);
|
|
371
|
+
};
|
|
372
|
+
SceneDelegate.prototype.sceneContinueUserActivity = function (scene, userActivity) {
|
|
373
|
+
var windowScene = scene;
|
|
374
|
+
var nativeWindow = Application.ios._getWindowForScene(windowScene);
|
|
375
|
+
if (nativeWindow) {
|
|
376
|
+
nativeWindow.notify({
|
|
377
|
+
eventName: NativeWindowEvents.sceneContinueUserActivity,
|
|
378
|
+
object: nativeWindow,
|
|
379
|
+
window: nativeWindow,
|
|
380
|
+
scene: windowScene,
|
|
381
|
+
userActivity: userActivity,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
Application.ios.notify({
|
|
385
|
+
eventName: NativeWindowEvents.sceneContinueUserActivity,
|
|
386
|
+
object: Application.ios,
|
|
387
|
+
window: nativeWindow,
|
|
388
|
+
scene: windowScene,
|
|
389
|
+
userActivity: userActivity,
|
|
390
|
+
});
|
|
391
|
+
forwardContinueUserActivity(Application.ios.delegate, UIApplication.sharedApplication, userActivity);
|
|
392
|
+
};
|
|
393
|
+
SceneDelegate.prototype.windowScenePerformActionForShortcutItemCompletionHandler = function (windowScene, shortcutItem, completionHandler) {
|
|
394
|
+
var nativeWindow = Application.ios._getWindowForScene(windowScene);
|
|
395
|
+
var deliver = oneShotCompletion(completionHandler);
|
|
396
|
+
if (nativeWindow) {
|
|
397
|
+
nativeWindow.notify({
|
|
398
|
+
eventName: NativeWindowEvents.scenePerformActionForShortcutItem,
|
|
399
|
+
object: nativeWindow,
|
|
400
|
+
window: nativeWindow,
|
|
401
|
+
scene: windowScene,
|
|
402
|
+
shortcutItem: shortcutItem,
|
|
403
|
+
completionHandler: deliver,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
Application.ios.notify({
|
|
407
|
+
eventName: NativeWindowEvents.scenePerformActionForShortcutItem,
|
|
408
|
+
object: Application.ios,
|
|
409
|
+
window: nativeWindow,
|
|
410
|
+
scene: windowScene,
|
|
411
|
+
shortcutItem: shortcutItem,
|
|
412
|
+
completionHandler: deliver,
|
|
413
|
+
});
|
|
414
|
+
deliverShortcutItem(Application.ios.delegate, UIApplication.sharedApplication, shortcutItem, deliver);
|
|
184
415
|
};
|
|
185
416
|
SceneDelegate.ObjCProtocols = [UIWindowSceneDelegate];
|
|
186
417
|
return SceneDelegate;
|
|
@@ -194,12 +425,12 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
194
425
|
constructor() {
|
|
195
426
|
super();
|
|
196
427
|
this._delegateHandlers = new Map();
|
|
197
|
-
this.launchEventCalled = false;
|
|
198
|
-
this._windowSceneMap = new Map();
|
|
199
|
-
this._primaryScene = null;
|
|
200
|
-
this._openedScenesById = new Map();
|
|
201
428
|
this._notificationObservers = [];
|
|
429
|
+
this._softRebootSceneDelegates = new Map();
|
|
202
430
|
this.displayedOnce = false;
|
|
431
|
+
/**
|
|
432
|
+
* @deprecated Has no effect. Application initialization is signalled by the 'ready' event, which is never deferred.
|
|
433
|
+
*/
|
|
203
434
|
this.shouldDelayLaunchEvent = false;
|
|
204
435
|
this.addNotificationObserver(UIApplicationDidFinishLaunchingNotification, this.didFinishLaunchingWithOptions.bind(this));
|
|
205
436
|
this.addNotificationObserver(UIApplicationDidBecomeActiveNotification, this.didBecomeActive.bind(this));
|
|
@@ -207,26 +438,58 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
207
438
|
this.addNotificationObserver(UIApplicationWillTerminateNotification, this.willTerminate.bind(this));
|
|
208
439
|
this.addNotificationObserver(UIApplicationDidReceiveMemoryWarningNotification, this.didReceiveMemoryWarning.bind(this));
|
|
209
440
|
this.addNotificationObserver(UIApplicationDidChangeStatusBarOrientationNotification, this.didChangeStatusBarOrientation.bind(this));
|
|
210
|
-
// Add scene lifecycle notification observers only if scenes are supported
|
|
211
|
-
if (this.supportsScenes()) {
|
|
212
|
-
this.addNotificationObserver('UISceneWillConnectNotification', this.sceneWillConnect.bind(this));
|
|
213
|
-
this.addNotificationObserver('UISceneDidActivateNotification', this.sceneDidActivate.bind(this));
|
|
214
|
-
this.addNotificationObserver('UISceneWillEnterForegroundNotification', this.sceneWillEnterForeground.bind(this));
|
|
215
|
-
this.addNotificationObserver('UISceneDidEnterBackgroundNotification', this.sceneDidEnterBackground.bind(this));
|
|
216
|
-
this.addNotificationObserver('UISceneDidDisconnectNotification', this.sceneDidDisconnect.bind(this));
|
|
217
|
-
}
|
|
218
441
|
}
|
|
219
442
|
getRootView() {
|
|
220
443
|
return this._rootView;
|
|
221
444
|
}
|
|
222
|
-
resetRootView(
|
|
223
|
-
super.resetRootView(
|
|
445
|
+
resetRootView(entry) {
|
|
446
|
+
super.resetRootView(entry);
|
|
224
447
|
this.setWindowContent();
|
|
225
448
|
}
|
|
226
449
|
run(entry) {
|
|
227
450
|
setAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);
|
|
228
451
|
this.started = true;
|
|
229
452
|
if (this.nativeApp) {
|
|
453
|
+
// During Vite HMR dev boot, the placeholder has already started
|
|
454
|
+
// the app lifecycle. A second run() with an entry should replace
|
|
455
|
+
// the placeholder root, NOT present a modal via runAsEmbeddedApp.
|
|
456
|
+
// The HTTP ESM realm creates a separate @nativescript/core instance,
|
|
457
|
+
// so JS-level patching of Application.run can't intercept this call.
|
|
458
|
+
// Detect HMR mode via the placeholder's global flag and use
|
|
459
|
+
// setWindowContent on the PRIMARY Application singleton (bundled realm)
|
|
460
|
+
// which has the actual window and root view hierarchy.
|
|
461
|
+
const g = globalThis;
|
|
462
|
+
if (g.__NS_DEV_PLACEHOLDER_ROOT_VIEW__ || g.__NS_DEV_PLACEHOLDER_ROOT_EARLY__) {
|
|
463
|
+
if (entry) {
|
|
464
|
+
// Defer to next run loop tick so resetRootView executes outside the
|
|
465
|
+
// HTTP ESM import context. Direct calls can fail with
|
|
466
|
+
// "ReferenceError: __COMMONJS__ is not defined" because the JS
|
|
467
|
+
// execution stack is in the HTTP realm when Builder loads modules.
|
|
468
|
+
const resolvedEntry = typeof entry === 'string' ? { moduleName: entry } : entry;
|
|
469
|
+
setTimeout(() => {
|
|
470
|
+
try {
|
|
471
|
+
const primaryApp = g.Application;
|
|
472
|
+
if (primaryApp && typeof primaryApp.resetRootView === 'function') {
|
|
473
|
+
primaryApp.resetRootView(resolvedEntry);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
catch (e) {
|
|
477
|
+
if (__DEV__)
|
|
478
|
+
console.warn('[app-ios] deferred resetRootView failed:', e);
|
|
479
|
+
}
|
|
480
|
+
delete g.__NS_DEV_PLACEHOLDER_ROOT_VIEW__;
|
|
481
|
+
delete g.__NS_DEV_PLACEHOLDER_ROOT_EARLY__;
|
|
482
|
+
}, 0);
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
// Framework (e.g. Angular) calls run() with no entry — it manages
|
|
486
|
+
// root views itself via resetRootView(). No-op to avoid presenting
|
|
487
|
+
// a modal via runAsEmbeddedApp or throwing "Main entry is missing".
|
|
488
|
+
if (__DEV__)
|
|
489
|
+
console.info('[app-ios] run() called with no entry during HMR placeholder; framework manages root view');
|
|
490
|
+
}
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
230
493
|
this.runAsEmbeddedApp();
|
|
231
494
|
}
|
|
232
495
|
else {
|
|
@@ -237,6 +500,8 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
237
500
|
UIApplicationMain(0, null, null, this.delegate ? NSStringFromClass(this.delegate) : NSStringFromClass(Responder));
|
|
238
501
|
}
|
|
239
502
|
runAsEmbeddedApp() {
|
|
503
|
+
this.notifyReady();
|
|
504
|
+
this._reattachNativeDelegatesAfterSoftReboot();
|
|
240
505
|
// TODO: this rootView should be held alive until rootController dismissViewController is called.
|
|
241
506
|
const rootView = this.createRootView(this._rootView, true);
|
|
242
507
|
if (!rootView) {
|
|
@@ -245,38 +510,126 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
245
510
|
this._rootView = rootView;
|
|
246
511
|
setRootView(rootView);
|
|
247
512
|
// Attach to the existing iOS app
|
|
248
|
-
|
|
513
|
+
let window = getWindow();
|
|
249
514
|
if (!window) {
|
|
250
|
-
|
|
515
|
+
// In-process soft reboot with OTAs.
|
|
516
|
+
// Original UIWindow is deallocated when the old JS isolate is torn down.
|
|
517
|
+
// Recreate a window bound to the active UIWindowScene so the
|
|
518
|
+
// root has somewhere to attach.
|
|
519
|
+
const app = UIApplication.sharedApplication;
|
|
520
|
+
const all = app && app.connectedScenes ? app.connectedScenes.allObjects : null;
|
|
521
|
+
let targetScene;
|
|
522
|
+
if (all) {
|
|
523
|
+
for (let i = 0; i < all.count; i++) {
|
|
524
|
+
const s = all.objectAtIndex(i);
|
|
525
|
+
// Only UIWindowScene exposes `windows`; prefer a foreground-active one.
|
|
526
|
+
if (s && typeof s.windows !== 'undefined') {
|
|
527
|
+
targetScene = s;
|
|
528
|
+
if (s.activationState === 0 /* UISceneActivationState.ForegroundActive */) {
|
|
529
|
+
break;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if (targetScene) {
|
|
535
|
+
window = UIWindow.alloc().initWithWindowScene(targetScene);
|
|
536
|
+
if (!__VISIONOS__) {
|
|
537
|
+
window.backgroundColor = SDK_VERSION <= 12 || !UIColor.systemBackgroundColor ? UIColor.whiteColor : UIColor.systemBackgroundColor;
|
|
538
|
+
}
|
|
539
|
+
// The registry lives in JS and was lost with the previous isolate, so
|
|
540
|
+
// the still-connected scene needs a fresh NativeWindow to be reachable.
|
|
541
|
+
const isPrimary = !this.primaryWindow;
|
|
542
|
+
const nativeWindow = new IOSNativeWindow(targetScene, window, IOSNativeWindow.getSceneId(targetScene), isPrimary);
|
|
543
|
+
this._registerWindow(nativeWindow);
|
|
544
|
+
if (isPrimary) {
|
|
545
|
+
setiOSWindow(window);
|
|
546
|
+
}
|
|
547
|
+
// If the scene's delegate was recreated after a soft reboot, point it
|
|
548
|
+
// at the new window so `scene.delegate.window` queries resolve.
|
|
549
|
+
const freshSceneDelegate = this._softRebootSceneDelegates.get(targetScene);
|
|
550
|
+
if (freshSceneDelegate) {
|
|
551
|
+
freshSceneDelegate.window = window;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
251
554
|
}
|
|
252
|
-
|
|
253
|
-
if (!rootController) {
|
|
555
|
+
if (!window) {
|
|
254
556
|
return;
|
|
255
557
|
}
|
|
256
|
-
|
|
558
|
+
// May be null on a freshly recreated window — expected; the replace-root
|
|
559
|
+
// path below sets it. Only the embedder path needs an existing controller.
|
|
560
|
+
const rootController = window.rootViewController;
|
|
257
561
|
const embedderDelegate = NativeScriptEmbedder.sharedInstance().delegate;
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
const newSystemAppearance = this.getSystemAppearanceValue(userInterfaceStyle);
|
|
262
|
-
this.setSystemAppearance(newSystemAppearance);
|
|
263
|
-
});
|
|
264
|
-
rootView.on(IOSHelper.traitCollectionLayoutDirectionChangedEvent, () => {
|
|
265
|
-
const layoutDirection = controller.traitCollection.layoutDirection;
|
|
266
|
-
const newLayoutDirection = this.getLayoutDirectionValue(layoutDirection);
|
|
267
|
-
this.setLayoutDirection(newLayoutDirection);
|
|
268
|
-
});
|
|
269
|
-
if (embedderDelegate) {
|
|
270
|
-
this.setViewControllerView(rootView);
|
|
271
|
-
embedderDelegate.presentNativeScriptApp(controller);
|
|
562
|
+
// Embed into host app requires an existing root view controller
|
|
563
|
+
if (embedderDelegate && !rootController) {
|
|
564
|
+
return;
|
|
272
565
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
566
|
+
let hostWindow = this.primaryWindow;
|
|
567
|
+
if (!hostWindow) {
|
|
568
|
+
// Only an embedder delegate makes this window a guest: without one NativeScript
|
|
569
|
+
// owns the UIApplication and the window has to attach its own content.
|
|
570
|
+
const role = embedderDelegate ? 'embedded' : 'application';
|
|
571
|
+
hostWindow = new IOSNativeWindow(window.windowScene ?? undefined, window, 'embedded-main', true, role);
|
|
572
|
+
this._registerWindow(hostWindow);
|
|
573
|
+
hostWindow._notifyEvent(NativeWindowEvents.attached);
|
|
276
574
|
}
|
|
277
|
-
|
|
575
|
+
hostWindow.setContent(rootView);
|
|
278
576
|
this.notifyAppStarted();
|
|
279
577
|
}
|
|
578
|
+
/**
|
|
579
|
+
* After an in-process soft reboot (NativeScriptRuntime.reloadApplication /
|
|
580
|
+
* restartWithConfig), the Objective-C delegate classes created by the
|
|
581
|
+
* previous JS isolate still exist and UIKit keeps dispatching to their
|
|
582
|
+
* now-inert instances: their method callbacks bail out because the isolate
|
|
583
|
+
* that implemented them is gone. Notification-center observers are
|
|
584
|
+
* re-registered by the new isolate, but delegate-based dispatch (custom
|
|
585
|
+
* UIApplicationDelegate methods like push-token/openURL callbacks, and the
|
|
586
|
+
* UIScene delegates used by scene-lifecycle apps) stays pinned to the old
|
|
587
|
+
* bundle. Recreate those delegates from this bundle's classes and re-point
|
|
588
|
+
* UIKit at them.
|
|
589
|
+
*/
|
|
590
|
+
_reattachNativeDelegatesAfterSoftReboot() {
|
|
591
|
+
if (getRuntimeReloadCount() <= 0) {
|
|
592
|
+
// First boot: UIApplicationMain (or the host app) set up delegates.
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
if (isEmbedded()) {
|
|
596
|
+
// The host app owns the UIApplication delegate; never touch it.
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
const app = UIApplication.sharedApplication;
|
|
600
|
+
if (!app) {
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
// Fresh application delegate from the new bundle. Assigning `delegate`
|
|
604
|
+
// does not retain (unlike the UIApplicationMain launch path), so keep a
|
|
605
|
+
// strong reference ourselves.
|
|
606
|
+
this.delegate ?? (this.delegate = Responder);
|
|
607
|
+
const freshDelegate = this.delegate.new();
|
|
608
|
+
this._softRebootAppDelegate = freshDelegate;
|
|
609
|
+
app.delegate = freshDelegate;
|
|
610
|
+
// Re-point already-connected scenes at fresh scene delegates so scene
|
|
611
|
+
// lifecycle and user-implemented scene delegate methods (shortcuts,
|
|
612
|
+
// openURLContexts, userActivity continuation, etc.) reach this isolate.
|
|
613
|
+
// Newly connecting scenes are covered by the fresh application delegate's
|
|
614
|
+
// applicationConfigurationForConnectingSceneSessionOptions, which returns
|
|
615
|
+
// this bundle's SceneDelegate class.
|
|
616
|
+
if (this.supportsScenes()) {
|
|
617
|
+
this._softRebootSceneDelegates.clear();
|
|
618
|
+
const scenes = app.connectedScenes?.allObjects;
|
|
619
|
+
for (let i = 0; scenes && i < scenes.count; i++) {
|
|
620
|
+
const scene = scenes.objectAtIndex(i);
|
|
621
|
+
if (!(scene instanceof UIWindowScene)) {
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
const freshSceneDelegate = SceneDelegate.new();
|
|
625
|
+
scene.delegate = freshSceneDelegate;
|
|
626
|
+
this._softRebootSceneDelegates.set(scene, freshSceneDelegate);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
if (Trace.isEnabled()) {
|
|
630
|
+
Trace.write(`Reattached application delegate${this._softRebootSceneDelegates.size ? ` and ${this._softRebootSceneDelegates.size} scene delegate(s)` : ''} after soft reboot (reloadCount: ${getRuntimeReloadCount()})`, Trace.categories.NativeLifecycle);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
280
633
|
getViewController(rootView) {
|
|
281
634
|
let viewController = rootView.viewController || rootView.ios;
|
|
282
635
|
if (!(viewController instanceof UIViewController)) {
|
|
@@ -461,7 +814,6 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
461
814
|
}
|
|
462
815
|
}
|
|
463
816
|
notifyAppStarted(notification) {
|
|
464
|
-
this.launchEventCalled = true;
|
|
465
817
|
const root = this.notifyLaunch({
|
|
466
818
|
ios: notification?.userInfo?.objectForKey('UIApplicationLaunchOptionsLocalNotificationKey') ?? null,
|
|
467
819
|
});
|
|
@@ -474,10 +826,6 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
474
826
|
setiOSWindow(this.window);
|
|
475
827
|
}
|
|
476
828
|
}
|
|
477
|
-
// Public method for scene-based app startup
|
|
478
|
-
_notifySceneAppStarted() {
|
|
479
|
-
this.notifyAppStarted();
|
|
480
|
-
}
|
|
481
829
|
_onLivesync(context) {
|
|
482
830
|
// Handle application root module
|
|
483
831
|
const isAppRootModuleChanged = context && context.path && context.path.includes(this.getMainEntry().moduleName) && context.type !== 'style';
|
|
@@ -492,14 +840,23 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
492
840
|
}
|
|
493
841
|
}
|
|
494
842
|
setWindowContent(view) {
|
|
843
|
+
const rootView = this.createRootView(view);
|
|
844
|
+
const primaryWindow = this.primaryWindow;
|
|
845
|
+
if (primaryWindow) {
|
|
846
|
+
primaryWindow.setContent(rootView);
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
this.setWindowContentFallback(rootView);
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Attaches content to the raw `UIWindow`. Every launch path registers a primary
|
|
853
|
+
* NativeWindow, so this only runs when no window is left to own the content.
|
|
854
|
+
*/
|
|
855
|
+
setWindowContentFallback(rootView) {
|
|
495
856
|
if (this._rootView) {
|
|
496
|
-
// if we already have a root view, we reset it.
|
|
497
857
|
this._rootView._onRootViewReset();
|
|
498
858
|
}
|
|
499
|
-
const rootView = this.createRootView(view);
|
|
500
859
|
const controller = this.getViewController(rootView);
|
|
501
|
-
this._rootView = rootView;
|
|
502
|
-
setRootView(rootView);
|
|
503
860
|
// setup view as styleScopeHost
|
|
504
861
|
rootView._setupAsRootView({});
|
|
505
862
|
this.setViewControllerView(rootView);
|
|
@@ -509,17 +866,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
509
866
|
if (!haveController) {
|
|
510
867
|
win.makeKeyAndVisible();
|
|
511
868
|
}
|
|
512
|
-
this.
|
|
513
|
-
rootView.on(IOSHelper.traitCollectionColorAppearanceChangedEvent, () => {
|
|
514
|
-
const userInterfaceStyle = controller.traitCollection.userInterfaceStyle;
|
|
515
|
-
const newSystemAppearance = this.getSystemAppearanceValue(userInterfaceStyle);
|
|
516
|
-
this.setSystemAppearance(newSystemAppearance);
|
|
517
|
-
});
|
|
518
|
-
rootView.on(IOSHelper.traitCollectionLayoutDirectionChangedEvent, () => {
|
|
519
|
-
const layoutDirection = controller.traitCollection.layoutDirection;
|
|
520
|
-
const newLayoutDirection = this.getLayoutDirectionValue(layoutDirection);
|
|
521
|
-
this.setLayoutDirection(newLayoutDirection);
|
|
522
|
-
});
|
|
869
|
+
this.adoptRootView(rootView);
|
|
523
870
|
}
|
|
524
871
|
// Observers
|
|
525
872
|
didFinishLaunchingWithOptions(notification) {
|
|
@@ -537,6 +884,8 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
537
884
|
}
|
|
538
885
|
}
|
|
539
886
|
}
|
|
887
|
+
// Must precede every window registration below and every scene connect that follows.
|
|
888
|
+
this.notifyReady();
|
|
540
889
|
this.setMaxRefreshRate();
|
|
541
890
|
// Only set up window if NOT using scene-based lifecycle
|
|
542
891
|
if (!this.supportsScenes()) {
|
|
@@ -550,9 +899,26 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
550
899
|
if (!__VISIONOS__) {
|
|
551
900
|
this.window.backgroundColor = SDK_VERSION <= 12 || !UIColor.systemBackgroundColor ? UIColor.whiteColor : UIColor.systemBackgroundColor;
|
|
552
901
|
}
|
|
553
|
-
this.
|
|
554
|
-
|
|
555
|
-
this.
|
|
902
|
+
if (!this.primaryWindow) {
|
|
903
|
+
const nativeWindow = new IOSNativeWindow(undefined, this.window, 'main', true, 'application');
|
|
904
|
+
this._registerWindow(nativeWindow);
|
|
905
|
+
nativeWindow._notifyEvent(NativeWindowEvents.attached);
|
|
906
|
+
}
|
|
907
|
+
const primaryWindow = this.primaryWindow;
|
|
908
|
+
const resolveContent = () => this._resolveWindowContent(primaryWindow, {
|
|
909
|
+
window: primaryWindow,
|
|
910
|
+
isPrimary: true,
|
|
911
|
+
}, {
|
|
912
|
+
launchData: {
|
|
913
|
+
ios: notification?.userInfo?.objectForKey('UIApplicationLaunchOptionsLocalNotificationKey') ?? null,
|
|
914
|
+
},
|
|
915
|
+
});
|
|
916
|
+
if (UIApplication.sharedApplication.applicationState === 2 /* UIApplicationState.Background */) {
|
|
917
|
+
// A background launch has no UI to build yet, so content waits for the first activation.
|
|
918
|
+
this._pendingWindowContentResolve = resolveContent;
|
|
919
|
+
}
|
|
920
|
+
else {
|
|
921
|
+
resolveContent();
|
|
556
922
|
}
|
|
557
923
|
}
|
|
558
924
|
else {
|
|
@@ -560,17 +926,22 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
560
926
|
}
|
|
561
927
|
}
|
|
562
928
|
didBecomeActive(notification) {
|
|
563
|
-
|
|
564
|
-
|
|
929
|
+
const pendingWindowContentResolve = this._pendingWindowContentResolve;
|
|
930
|
+
if (pendingWindowContentResolve) {
|
|
931
|
+
this._pendingWindowContentResolve = null;
|
|
932
|
+
pendingWindowContentResolve();
|
|
565
933
|
}
|
|
566
934
|
const additionalData = {
|
|
567
935
|
ios: UIApplication.sharedApplication,
|
|
568
936
|
};
|
|
569
937
|
this.setInBackground(false, additionalData);
|
|
570
938
|
this.setSuspended(false, additionalData);
|
|
571
|
-
|
|
572
|
-
if (
|
|
573
|
-
rootView.
|
|
939
|
+
// In scene mode the root view belongs to a window, so the scene delegate loads it.
|
|
940
|
+
if (!this.supportsScenes()) {
|
|
941
|
+
const rootView = this._rootView;
|
|
942
|
+
if (rootView && !rootView.isLoaded) {
|
|
943
|
+
rootView.callLoaded();
|
|
944
|
+
}
|
|
574
945
|
}
|
|
575
946
|
}
|
|
576
947
|
didEnterBackground(notification) {
|
|
@@ -579,9 +950,11 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
579
950
|
};
|
|
580
951
|
this.setInBackground(true, additionalData);
|
|
581
952
|
this.setSuspended(true, additionalData);
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
rootView.
|
|
953
|
+
if (!this.supportsScenes()) {
|
|
954
|
+
const rootView = this._rootView;
|
|
955
|
+
if (rootView && rootView.isLoaded) {
|
|
956
|
+
rootView.callUnloaded();
|
|
957
|
+
}
|
|
585
958
|
}
|
|
586
959
|
}
|
|
587
960
|
willTerminate(notification) {
|
|
@@ -603,151 +976,111 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
603
976
|
});
|
|
604
977
|
}
|
|
605
978
|
didChangeStatusBarOrientation(notification) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
this.
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
return;
|
|
615
|
-
}
|
|
616
|
-
// Store as primary scene if it's the first one
|
|
617
|
-
if (!this._primaryScene) {
|
|
618
|
-
this._primaryScene = scene;
|
|
979
|
+
// The notification is app-wide, but scenes rotate independently, so every attached
|
|
980
|
+
// window is refreshed from its own scene.
|
|
981
|
+
for (const nativeWindow of this._windows) {
|
|
982
|
+
if (nativeWindow.state !== 'attached') {
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
const orientation = nativeWindow.ios?.scene?.interfaceOrientation ?? UIApplication.sharedApplication.statusBarOrientation;
|
|
986
|
+
nativeWindow._setOrientation(this.getOrientationValue(orientation));
|
|
619
987
|
}
|
|
620
|
-
this.notify({
|
|
621
|
-
eventName: SceneEvents.sceneWillConnect,
|
|
622
|
-
object: this,
|
|
623
|
-
scene: scene,
|
|
624
|
-
userInfo: notification.userInfo,
|
|
625
|
-
});
|
|
626
988
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
this.
|
|
641
|
-
this.setSuspended(false, additionalData);
|
|
642
|
-
if (this._rootView && !this._rootView.isLoaded) {
|
|
643
|
-
this._rootView.callLoaded();
|
|
644
|
-
}
|
|
989
|
+
// --- App-level root view mirror ---
|
|
990
|
+
/**
|
|
991
|
+
* Keeps the app-level root view state (`getRootView()`, the global root view and the
|
|
992
|
+
* `initRootView` event) following whatever the primary window shows.
|
|
993
|
+
*/
|
|
994
|
+
mirrorPrimaryWindow(nativeWindow) {
|
|
995
|
+
if (this._mirroredWindow === nativeWindow) {
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
998
|
+
this._mirroredWindow?.off(NativeWindowEvents.contentLoaded, this.onPrimaryWindowContentLoaded, this);
|
|
999
|
+
this._mirroredWindow = nativeWindow;
|
|
1000
|
+
nativeWindow.on(NativeWindowEvents.contentLoaded, this.onPrimaryWindowContentLoaded, this);
|
|
1001
|
+
if (nativeWindow.rootView && nativeWindow.rootView !== this._rootView) {
|
|
1002
|
+
this.adoptRootView(nativeWindow.rootView);
|
|
645
1003
|
}
|
|
646
1004
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
this.notify({
|
|
650
|
-
eventName: SceneEvents.sceneWillEnterForeground,
|
|
651
|
-
object: this,
|
|
652
|
-
scene: scene,
|
|
653
|
-
});
|
|
1005
|
+
onPrimaryWindowContentLoaded(data) {
|
|
1006
|
+
this.adoptRootView(data.window.rootView);
|
|
654
1007
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
eventName: SceneEvents.sceneDidEnterBackground,
|
|
659
|
-
object: this,
|
|
660
|
-
scene: scene,
|
|
661
|
-
});
|
|
662
|
-
// If this is the primary scene, trigger traditional app lifecycle
|
|
663
|
-
if (scene === this._primaryScene) {
|
|
664
|
-
const additionalData = {
|
|
665
|
-
ios: UIApplication.sharedApplication,
|
|
666
|
-
scene: scene,
|
|
667
|
-
};
|
|
668
|
-
this.setInBackground(true, additionalData);
|
|
669
|
-
this.setSuspended(true, additionalData);
|
|
670
|
-
if (this._rootView && this._rootView.isLoaded) {
|
|
671
|
-
this._rootView.callUnloaded();
|
|
672
|
-
}
|
|
1008
|
+
adoptRootView(rootView) {
|
|
1009
|
+
if (!rootView) {
|
|
1010
|
+
return;
|
|
673
1011
|
}
|
|
1012
|
+
this._rootView = rootView;
|
|
1013
|
+
setRootView(rootView);
|
|
1014
|
+
this.initRootView(rootView, this._mirroredWindow);
|
|
674
1015
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
if (
|
|
683
|
-
|
|
684
|
-
const request = UISceneSessionActivationRequest.requestWithSession(this._primaryScene.session);
|
|
685
|
-
UIApplication.sharedApplication.activateSceneSessionForRequestErrorHandler(request, (err) => {
|
|
686
|
-
if (err) {
|
|
687
|
-
console.log('Failed to activate primary scene:', err.localizedDescription);
|
|
688
|
-
}
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
else {
|
|
692
|
-
UIApplication.sharedApplication.requestSceneSessionActivationUserActivityOptionsErrorHandler(this._primaryScene.session, null, null, (err) => {
|
|
693
|
-
if (err) {
|
|
694
|
-
console.log('Failed to activate primary scene (legacy):', err.localizedDescription);
|
|
695
|
-
}
|
|
696
|
-
});
|
|
697
|
-
}
|
|
1016
|
+
// --- NativeWindow registry ---
|
|
1017
|
+
/**
|
|
1018
|
+
* @internal - iOS reports discarded sessions for windows this JS context may never
|
|
1019
|
+
* have seen (they can arrive on a later launch), so unknown ids are ignored.
|
|
1020
|
+
*/
|
|
1021
|
+
_onSceneSessionsDiscarded(sessions) {
|
|
1022
|
+
const all = sessions?.allObjects;
|
|
1023
|
+
if (!all) {
|
|
1024
|
+
return;
|
|
698
1025
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
}
|
|
705
|
-
// Scene management helper methods
|
|
706
|
-
_setWindowForScene(window, scene) {
|
|
707
|
-
this._windowSceneMap.set(scene, window);
|
|
708
|
-
}
|
|
709
|
-
_removeWindowForScene(scene) {
|
|
710
|
-
this._windowSceneMap.delete(scene);
|
|
711
|
-
// also untrack opened scene id
|
|
712
|
-
try {
|
|
713
|
-
const s = scene;
|
|
714
|
-
if (s && s.session) {
|
|
715
|
-
const id = this._getSceneId(s);
|
|
716
|
-
this._openedScenesById.delete(id);
|
|
1026
|
+
for (let i = 0; i < all.count; i++) {
|
|
1027
|
+
const persistentIdentifier = all.objectAtIndex(i)?.persistentIdentifier;
|
|
1028
|
+
const nativeWindow = persistentIdentifier ? this.getWindowById(`${persistentIdentifier}`) : undefined;
|
|
1029
|
+
if (!nativeWindow) {
|
|
1030
|
+
continue;
|
|
717
1031
|
}
|
|
1032
|
+
nativeWindow._notifyEvent(NativeWindowEvents.close);
|
|
1033
|
+
this._unregisterWindow(nativeWindow);
|
|
718
1034
|
}
|
|
719
|
-
catch { }
|
|
720
1035
|
}
|
|
1036
|
+
/**
|
|
1037
|
+
* @internal - Get a NativeWindow by its scene.
|
|
1038
|
+
*/
|
|
721
1039
|
_getWindowForScene(scene) {
|
|
722
|
-
return this.
|
|
1040
|
+
return this._windows.find((nw) => nw.ios?.scene === scene);
|
|
723
1041
|
}
|
|
724
|
-
|
|
725
|
-
if (
|
|
726
|
-
|
|
727
|
-
}
|
|
728
|
-
// track opened scene
|
|
729
|
-
try {
|
|
730
|
-
const id = this._getSceneId(scene);
|
|
731
|
-
this._openedScenesById.set(id, scene);
|
|
1042
|
+
_onWindowRegistered(nativeWindow) {
|
|
1043
|
+
if (nativeWindow.isPrimary) {
|
|
1044
|
+
this.mirrorPrimaryWindow(nativeWindow);
|
|
732
1045
|
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
// If this is the primary scene, set up the main application content
|
|
739
|
-
if (scene === this._primaryScene || !this._primaryScene) {
|
|
740
|
-
this._primaryScene = scene;
|
|
741
|
-
if (!getiOSWindow()) {
|
|
742
|
-
setiOSWindow(window);
|
|
743
|
-
}
|
|
744
|
-
// During initial scene startup we must wait for launch to be notified first.
|
|
745
|
-
// Some frameworks provide root content from launch handlers.
|
|
746
|
-
if (this.hasLaunched()) {
|
|
747
|
-
this.setWindowContent();
|
|
748
|
-
}
|
|
1046
|
+
}
|
|
1047
|
+
_onPrimaryWindowPromoted(nativeWindow) {
|
|
1048
|
+
const promotedWindow = nativeWindow.ios?.uiWindow;
|
|
1049
|
+
if (promotedWindow) {
|
|
1050
|
+
setiOSWindow(promotedWindow);
|
|
749
1051
|
}
|
|
1052
|
+
this.mirrorPrimaryWindow(nativeWindow);
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Register a callback to intercept scene configuration.
|
|
1056
|
+
*
|
|
1057
|
+
* Called for every new scene session. Return a `UISceneConfiguration` to handle
|
|
1058
|
+
* the scene yourself (e.g. CarPlay, external display), or return `null`/`undefined`
|
|
1059
|
+
* to let NativeScript handle it with the default SceneDelegate.
|
|
1060
|
+
*
|
|
1061
|
+
* NativeScript only auto-manages `UIWindowSceneSessionRoleApplication` scenes.
|
|
1062
|
+
* All other scene roles are ignored unless you provide a configuration here.
|
|
1063
|
+
*
|
|
1064
|
+
* @example
|
|
1065
|
+
* ```ts
|
|
1066
|
+
* Application.ios.onSceneConfiguration = (app, session, options) => {
|
|
1067
|
+
* if (session.role === CPTemplateApplicationSceneSessionRoleApplication) {
|
|
1068
|
+
* const config = UISceneConfiguration.configurationWithNameSessionRole('CarPlay', session.role);
|
|
1069
|
+
* config.delegateClass = MyCarPlaySceneDelegate;
|
|
1070
|
+
* return config;
|
|
1071
|
+
* }
|
|
1072
|
+
* // Return null to let NativeScript handle the default window scene
|
|
1073
|
+
* return null;
|
|
1074
|
+
* };
|
|
1075
|
+
* ```
|
|
1076
|
+
*/
|
|
1077
|
+
set onSceneConfiguration(handler) {
|
|
1078
|
+
this._onSceneConfiguration = handler;
|
|
750
1079
|
}
|
|
1080
|
+
get onSceneConfiguration() {
|
|
1081
|
+
return this._onSceneConfiguration;
|
|
1082
|
+
}
|
|
1083
|
+
// Scene management helper methods (kept for backward compat)
|
|
751
1084
|
get sceneDelegate() {
|
|
752
1085
|
if (!this._sceneDelegate) {
|
|
753
1086
|
this._sceneDelegate = SceneDelegate.new();
|
|
@@ -761,10 +1094,12 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
761
1094
|
* Multi-window support
|
|
762
1095
|
*/
|
|
763
1096
|
/**
|
|
764
|
-
* Opens a new window
|
|
765
|
-
*
|
|
1097
|
+
* Opens a new window (scene).
|
|
1098
|
+
*
|
|
1099
|
+
* @param options Options for the new window. `options.data` is serialized into the
|
|
1100
|
+
* activating scene's `NSUserActivity.userInfo`.
|
|
766
1101
|
*/
|
|
767
|
-
openWindow(
|
|
1102
|
+
openWindow(options) {
|
|
768
1103
|
if (!supportsMultipleScenes()) {
|
|
769
1104
|
console.log('Cannot create a new scene - not supported on this device.');
|
|
770
1105
|
return;
|
|
@@ -773,34 +1108,18 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
773
1108
|
const app = UIApplication.sharedApplication;
|
|
774
1109
|
// iOS 17+
|
|
775
1110
|
if (SDK_VERSION >= 17) {
|
|
776
|
-
// Create a new scene activation request with proper role
|
|
777
1111
|
let request;
|
|
778
1112
|
try {
|
|
779
|
-
// Use the correct factory method to create request with role
|
|
780
|
-
// Based on the type definitions, this is the proper way
|
|
781
1113
|
request = UISceneSessionActivationRequest.requestWithRole(UIWindowSceneSessionRoleApplication);
|
|
782
|
-
// Note: may be useful to allow user defined activity type through optional string typed data in future
|
|
783
1114
|
const activity = NSUserActivity.alloc().initWithActivityType(`${NSBundle.mainBundle.bundleIdentifier}.scene`);
|
|
784
|
-
activity.userInfo = dataSerialize(data);
|
|
1115
|
+
activity.userInfo = dataSerialize(options?.data ?? {});
|
|
785
1116
|
request.userActivity = activity;
|
|
786
|
-
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
options
|
|
792
|
-
/**
|
|
793
|
-
* Note: This does not work in testing but worth exploring further sometime
|
|
794
|
-
* regarding the size/dimensions of opened secondary windows.
|
|
795
|
-
* The initial size is ultimately determined by the system
|
|
796
|
-
* based on available space and user context.
|
|
797
|
-
*/
|
|
798
|
-
// Get the size restrictions from the window scene
|
|
799
|
-
// const sizeRestrictions = (options.requestingScene as UIWindowScene).sizeRestrictions;
|
|
800
|
-
// // Set your minimum and maximum dimensions
|
|
801
|
-
// sizeRestrictions.minimumSize = CGSizeMake(320, 400);
|
|
802
|
-
// sizeRestrictions.maximumSize = CGSizeMake(600, 800);
|
|
803
|
-
request.options = options;
|
|
1117
|
+
const activationOptions = UISceneActivationRequestOptions.new();
|
|
1118
|
+
const primary = this.primaryWindow;
|
|
1119
|
+
if (primary?.ios?.scene) {
|
|
1120
|
+
activationOptions.requestingScene = primary.ios.scene;
|
|
1121
|
+
}
|
|
1122
|
+
request.options = activationOptions;
|
|
804
1123
|
}
|
|
805
1124
|
catch (roleError) {
|
|
806
1125
|
console.log('Error creating request:', roleError);
|
|
@@ -809,32 +1128,25 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
809
1128
|
app.activateSceneSessionForRequestErrorHandler(request, (error) => {
|
|
810
1129
|
if (error) {
|
|
811
1130
|
console.log('Error creating new scene (iOS 17+):', error);
|
|
812
|
-
// Log additional debugging info
|
|
813
1131
|
if (error.userInfo) {
|
|
814
1132
|
console.error(`Error userInfo: ${error.userInfo.description}`);
|
|
815
1133
|
}
|
|
816
|
-
// Handle specific error types
|
|
817
1134
|
if (error.localizedDescription.includes('role') && error.localizedDescription.includes('nil')) {
|
|
818
|
-
this.createSceneWithLegacyAPI(data);
|
|
1135
|
+
this.createSceneWithLegacyAPI(options?.data);
|
|
819
1136
|
}
|
|
820
1137
|
else if (error.domain === 'FBSWorkspaceErrorDomain' && error.code === 2) {
|
|
821
|
-
this.createSceneWithLegacyAPI(data);
|
|
1138
|
+
this.createSceneWithLegacyAPI(options?.data);
|
|
822
1139
|
}
|
|
823
1140
|
}
|
|
824
1141
|
});
|
|
825
1142
|
}
|
|
826
|
-
// iOS 13-16 - Use the legacy requestSceneSessionActivationUserActivityOptionsErrorHandler method
|
|
827
1143
|
else if (SDK_VERSION >= 13 && SDK_VERSION < 17) {
|
|
828
|
-
app.requestSceneSessionActivationUserActivityOptionsErrorHandler(null,
|
|
829
|
-
null, // userActivity
|
|
830
|
-
null, // options
|
|
831
|
-
(error) => {
|
|
1144
|
+
app.requestSceneSessionActivationUserActivityOptionsErrorHandler(null, null, null, (error) => {
|
|
832
1145
|
if (error) {
|
|
833
1146
|
console.log('Error creating new scene (legacy):', error);
|
|
834
1147
|
}
|
|
835
1148
|
});
|
|
836
1149
|
}
|
|
837
|
-
// Fallback for older iOS versions or unsupported configurations
|
|
838
1150
|
else {
|
|
839
1151
|
console.log('Neither new nor legacy scene activation methods are available');
|
|
840
1152
|
}
|
|
@@ -845,71 +1157,66 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
845
1157
|
}
|
|
846
1158
|
/**
|
|
847
1159
|
* Closes a secondary window/scene.
|
|
848
|
-
*
|
|
849
|
-
* - Application.ios.closeWindow() // best-effort close of a non-primary scene
|
|
850
|
-
* - Application.ios.closeWindow(button) // from a tap handler within the scene
|
|
851
|
-
* - Application.ios.closeWindow(window)
|
|
852
|
-
* - Application.ios.closeWindow(scene)
|
|
853
|
-
* - Application.ios.closeWindow('scene-id')
|
|
1160
|
+
* Accepts a NativeWindow, View, UIWindow, UIWindowScene, or string id.
|
|
854
1161
|
*/
|
|
855
1162
|
closeWindow(target) {
|
|
856
1163
|
if (!__APPLE__) {
|
|
857
1164
|
return;
|
|
858
1165
|
}
|
|
859
1166
|
try {
|
|
860
|
-
|
|
861
|
-
if (
|
|
862
|
-
|
|
863
|
-
return;
|
|
1167
|
+
let nativeWindow;
|
|
1168
|
+
if (target instanceof NativeWindow) {
|
|
1169
|
+
nativeWindow = target;
|
|
864
1170
|
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
1171
|
+
else {
|
|
1172
|
+
const scene = this._resolveScene(target);
|
|
1173
|
+
if (scene) {
|
|
1174
|
+
nativeWindow = this._getWindowForScene(scene);
|
|
1175
|
+
}
|
|
869
1176
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
console.log('closeWindow: Scene has no session to destroy');
|
|
1177
|
+
if (!nativeWindow) {
|
|
1178
|
+
console.log('closeWindow: No window resolved for target');
|
|
873
1179
|
return;
|
|
874
1180
|
}
|
|
875
|
-
|
|
876
|
-
if (app.requestSceneSessionDestructionOptionsErrorHandler) {
|
|
877
|
-
app.requestSceneSessionDestructionOptionsErrorHandler(session, null, (error) => {
|
|
878
|
-
if (error) {
|
|
879
|
-
console.log('closeWindow: destruction error', error);
|
|
880
|
-
}
|
|
881
|
-
else {
|
|
882
|
-
// clean up tracked id
|
|
883
|
-
const id = this._getSceneId(scene);
|
|
884
|
-
this._openedScenesById.delete(id);
|
|
885
|
-
}
|
|
886
|
-
});
|
|
887
|
-
}
|
|
888
|
-
else {
|
|
889
|
-
console.info('closeWindow: Scene destruction API not available on this iOS version');
|
|
890
|
-
}
|
|
1181
|
+
nativeWindow.close();
|
|
891
1182
|
}
|
|
892
1183
|
catch (err) {
|
|
893
1184
|
console.log('closeWindow: Unexpected error', err);
|
|
894
1185
|
}
|
|
895
1186
|
}
|
|
1187
|
+
/**
|
|
1188
|
+
* @deprecated Use `getWindows()` instead.
|
|
1189
|
+
*/
|
|
896
1190
|
getAllWindows() {
|
|
897
|
-
return
|
|
1191
|
+
return this._windows.map((nw) => nw.ios?.uiWindow).filter(Boolean);
|
|
898
1192
|
}
|
|
1193
|
+
/**
|
|
1194
|
+
* @deprecated Use `getWindows()` instead.
|
|
1195
|
+
*/
|
|
899
1196
|
getAllScenes() {
|
|
900
|
-
return
|
|
1197
|
+
return this._windows.map((nw) => nw.ios?.scene).filter(Boolean);
|
|
901
1198
|
}
|
|
1199
|
+
/**
|
|
1200
|
+
* @deprecated Use `getWindows()` instead.
|
|
1201
|
+
*/
|
|
902
1202
|
getWindowScenes() {
|
|
903
1203
|
return this.getAllScenes().filter((scene) => scene instanceof UIWindowScene);
|
|
904
1204
|
}
|
|
1205
|
+
/**
|
|
1206
|
+
* @deprecated Use `primaryWindow?.ios?.uiWindow` instead.
|
|
1207
|
+
*/
|
|
905
1208
|
getPrimaryWindow() {
|
|
906
|
-
|
|
907
|
-
|
|
1209
|
+
const primary = this.primaryWindow;
|
|
1210
|
+
if (primary?.ios?.uiWindow) {
|
|
1211
|
+
return primary.ios.uiWindow;
|
|
908
1212
|
}
|
|
909
1213
|
return getiOSWindow();
|
|
910
1214
|
}
|
|
1215
|
+
/**
|
|
1216
|
+
* @deprecated Use `primaryWindow?.ios?.scene` instead.
|
|
1217
|
+
*/
|
|
911
1218
|
getPrimaryScene() {
|
|
912
|
-
return this.
|
|
1219
|
+
return this.primaryWindow?.ios?.scene || null;
|
|
913
1220
|
}
|
|
914
1221
|
// Scene lifecycle management
|
|
915
1222
|
supportsScenes() {
|
|
@@ -919,7 +1226,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
919
1226
|
return supportsMultipleScenes();
|
|
920
1227
|
}
|
|
921
1228
|
isUsingSceneLifecycle() {
|
|
922
|
-
return this.supportsScenes() && this.
|
|
1229
|
+
return this.supportsScenes() && this._windows.length > 0;
|
|
923
1230
|
}
|
|
924
1231
|
// Call this to set up scene-based configuration
|
|
925
1232
|
configureForScenes() {
|
|
@@ -927,34 +1234,6 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
927
1234
|
console.warn('Scene-based lifecycle is only supported on iOS 13+ iPad or visionOS with multi-scene enabled apps.');
|
|
928
1235
|
return;
|
|
929
1236
|
}
|
|
930
|
-
// Additional scene configuration can be added here
|
|
931
|
-
// For now, the notification observers are already set up in the constructor
|
|
932
|
-
}
|
|
933
|
-
// Stable scene id for lookups
|
|
934
|
-
_getSceneId(scene) {
|
|
935
|
-
try {
|
|
936
|
-
if (!scene) {
|
|
937
|
-
return 'Unknown';
|
|
938
|
-
}
|
|
939
|
-
// Prefer session persistentIdentifier when available (stable across lifetime)
|
|
940
|
-
const session = scene.session;
|
|
941
|
-
const persistentId = session && session.persistentIdentifier;
|
|
942
|
-
if (persistentId) {
|
|
943
|
-
return `${persistentId}`;
|
|
944
|
-
}
|
|
945
|
-
// Fallbacks
|
|
946
|
-
if (scene.hash != null) {
|
|
947
|
-
return `${scene.hash}`;
|
|
948
|
-
}
|
|
949
|
-
const desc = scene.description;
|
|
950
|
-
if (desc) {
|
|
951
|
-
return `${desc}`;
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
catch (err) {
|
|
955
|
-
// ignore
|
|
956
|
-
}
|
|
957
|
-
return 'Unknown';
|
|
958
1237
|
}
|
|
959
1238
|
// Resolve a UIWindowScene from various input types
|
|
960
1239
|
_resolveScene(target) {
|
|
@@ -962,12 +1241,10 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
962
1241
|
return null;
|
|
963
1242
|
}
|
|
964
1243
|
if (!target) {
|
|
965
|
-
// Try to pick a non-primary
|
|
966
|
-
const
|
|
967
|
-
|
|
968
|
-
return nonPrimary[0] || scenes[0] || null;
|
|
1244
|
+
// Try to pick a non-primary window's scene
|
|
1245
|
+
const nonPrimary = this._windows.filter((nw) => !nw.isPrimary);
|
|
1246
|
+
return nonPrimary[0]?.ios?.scene || this.primaryWindow?.ios?.scene || null;
|
|
969
1247
|
}
|
|
970
|
-
// If a View was passed, derive its window.scene
|
|
971
1248
|
if (target && typeof target === 'object') {
|
|
972
1249
|
// UIWindowScene
|
|
973
1250
|
if (target.session && target.activationState !== undefined) {
|
|
@@ -986,15 +1263,15 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
986
1263
|
}
|
|
987
1264
|
// String id lookup
|
|
988
1265
|
if (typeof target === 'string') {
|
|
989
|
-
|
|
990
|
-
|
|
1266
|
+
const found = this.getWindowById(target);
|
|
1267
|
+
if (found) {
|
|
1268
|
+
return found.ios?.scene || null;
|
|
991
1269
|
}
|
|
992
|
-
// Try matching
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
return s;
|
|
1270
|
+
// Try matching among known scenes
|
|
1271
|
+
for (const nw of this._windows) {
|
|
1272
|
+
const scene = nw.ios?.scene;
|
|
1273
|
+
if (scene && IOSNativeWindow.getSceneId(scene) === target) {
|
|
1274
|
+
return scene;
|
|
998
1275
|
}
|
|
999
1276
|
}
|
|
1000
1277
|
}
|
|
@@ -1007,7 +1284,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
1007
1284
|
}
|
|
1008
1285
|
// Create user activity for the new scene
|
|
1009
1286
|
const userActivity = NSUserActivity.alloc().initWithActivityType(`${NSBundle.mainBundle.bundleIdentifier}.scene`);
|
|
1010
|
-
userActivity.userInfo = dataSerialize(data);
|
|
1287
|
+
userActivity.userInfo = dataSerialize(data ?? {});
|
|
1011
1288
|
// Use the legacy API
|
|
1012
1289
|
const options = UISceneActivationRequestOptions.new();
|
|
1013
1290
|
options.requestingScene = windowScene;
|
|
@@ -1058,6 +1335,7 @@ global.__onLiveSyncCore = function (context) {
|
|
|
1058
1335
|
iosApp._onLivesync(context);
|
|
1059
1336
|
};
|
|
1060
1337
|
export * from './application-common';
|
|
1338
|
+
export * from './application-interfaces';
|
|
1061
1339
|
export const Application = iosApp;
|
|
1062
1340
|
export const AndroidApplication = undefined;
|
|
1063
1341
|
function fontScaleChanged(origFontScale) {
|
|
@@ -1387,14 +1665,12 @@ export class AccessibilityServiceEnabledObservable extends CommonA11YServiceEnab
|
|
|
1387
1665
|
}
|
|
1388
1666
|
}
|
|
1389
1667
|
let accessibilityServiceObservable;
|
|
1390
|
-
export function
|
|
1668
|
+
export function ensureA11yClasses() {
|
|
1391
1669
|
if (accessibilityServiceObservable) {
|
|
1392
1670
|
return;
|
|
1393
1671
|
}
|
|
1394
1672
|
setFontScaleCssClasses(new Map(VALID_FONT_SCALES.map((fs) => [fs, `a11y-fontscale-${Number(fs * 100).toFixed(0)}`])));
|
|
1395
1673
|
accessibilityServiceObservable = new AccessibilityServiceEnabledObservable();
|
|
1396
|
-
// Initialize SDK version CSS class once
|
|
1397
|
-
initializeSdkVersionClass(Application.getRootView());
|
|
1398
1674
|
}
|
|
1399
1675
|
export function updateCurrentHelperClasses(applyRootCssClass) {
|
|
1400
1676
|
const fontScale = getFontScale();
|
|
@@ -1463,7 +1739,7 @@ function applyFontScaleToRootViews() {
|
|
|
1463
1739
|
rootModalViews.forEach((rootModalView) => (rootModalView.style.fontScaleInternal = fontScale));
|
|
1464
1740
|
}
|
|
1465
1741
|
export function initAccessibilityCssHelper() {
|
|
1466
|
-
|
|
1742
|
+
ensureA11yClasses();
|
|
1467
1743
|
updateCurrentHelperClasses(applyRootCssClass);
|
|
1468
1744
|
applyFontScaleToRootViews();
|
|
1469
1745
|
Application.on(Application.fontScaleChangedEvent, () => {
|