@akylas/nativescript 8.9.17 → 9.0.21
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/README.md +41 -5
- package/accessibility/accessibility-common.d.ts +3 -0
- package/accessibility/accessibility-common.js +19 -0
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-css-helper.js +2 -45
- package/accessibility/accessibility-css-helper.js.map +1 -1
- package/accessibility/accessibility-service.android.js +5 -2
- package/accessibility/accessibility-service.android.js.map +1 -1
- package/accessibility/accessibility-service.d.ts +1 -1
- package/accessibility/index.android.d.ts +5 -1
- package/accessibility/index.android.js +283 -138
- package/accessibility/index.android.js.map +1 -1
- package/accessibility/index.d.ts +4 -0
- package/accessibility/index.ios.d.ts +1 -0
- package/accessibility/index.ios.js +6 -1
- package/accessibility/index.ios.js.map +1 -1
- package/application/application-common.d.ts +45 -18
- package/application/application-common.js +92 -19
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +32 -1
- package/application/application-shims.d.ts +27 -0
- package/application/application-shims.js +27 -0
- package/application/application-shims.js.map +1 -1
- package/application/application.android.d.ts +10 -6
- package/application/application.android.js +336 -275
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +82 -3
- package/application/application.ios.d.ts +72 -16
- package/application/application.ios.js +677 -46
- package/application/application.ios.js.map +1 -1
- package/application/helpers-common.d.ts +50 -0
- package/application/helpers-common.js +153 -0
- package/application/helpers-common.js.map +1 -0
- package/application/helpers.android.d.ts +6 -0
- package/application/helpers.android.js +26 -0
- package/application/helpers.android.js.map +1 -0
- package/application/helpers.d.ts +11 -0
- package/application/helpers.ios.d.ts +8 -0
- package/application/helpers.ios.js +24 -0
- package/application/helpers.ios.js.map +1 -0
- package/application-settings/index.android.js +2 -2
- package/application-settings/index.android.js.map +1 -1
- package/cli-hooks/{before-checkForChanges.js → before-checkForChanges.mjs} +20 -14
- package/cli-hooks/postinstall.mjs +7 -0
- package/cli-hooks/preuninstall.mjs +7 -0
- package/color/color-common.d.ts +18 -19
- package/color/color-common.js +13 -14
- package/color/color-common.js.map +1 -1
- package/color/color-types.d.ts +49 -0
- package/color/color-types.js +3 -0
- package/color/color-types.js.map +1 -0
- package/color/index.ios.d.ts +2 -1
- package/color/index.ios.js.map +1 -1
- package/config/config.interface.d.ts +43 -0
- package/connectivity/index.android.js +25 -24
- package/connectivity/index.android.js.map +1 -1
- package/core-types/animation-types.d.ts +11 -0
- package/core-types/animation-types.js +13 -0
- package/core-types/animation-types.js.map +1 -0
- package/core-types/index.d.ts +12 -3
- package/core-types/index.js +13 -4
- package/core-types/index.js.map +1 -1
- package/core-types/validators.d.ts +2 -0
- package/core-types/validators.js +20 -0
- package/core-types/validators.js.map +1 -0
- package/css/css-tree-parser.js +2 -2
- package/css/css-tree-parser.js.map +1 -1
- package/css/lib/parse/index.d.ts +1 -0
- package/css/lib/parse/index.js +475 -577
- package/css/lib/parse/index.js.map +1 -0
- package/css/reworkcss.d.ts +25 -28
- package/css/reworkcss.js +5 -1
- package/css/reworkcss.js.map +1 -0
- package/css-mediaquery/index.js +1 -1
- package/css-mediaquery/index.js.map +1 -1
- package/css-value/reworkcss-value.d.ts +31 -8
- package/css-value/reworkcss-value.js +89 -111
- package/css-value/reworkcss-value.js.map +1 -0
- package/data/observable/index.d.ts +2 -1
- package/data/observable/index.js +31 -19
- package/data/observable/index.js.map +1 -1
- package/debugger/devtools-elements-interfaces.d.ts +1 -1
- package/debugger/devtools-elements.common.js +17 -8
- package/debugger/devtools-elements.common.js.map +1 -1
- package/debugger/devtools-elements.js +1 -1
- package/debugger/devtools-elements.js.map +1 -1
- package/debugger/dom-types.d.ts +24 -0
- package/debugger/{dom-node.js → dom-types.js} +11 -9
- package/debugger/dom-types.js.map +1 -0
- package/debugger/webinspector-css.d.ts +18 -18
- package/debugger/webinspector-css.js +1 -1
- package/debugger/webinspector-css.js.map +1 -1
- package/debugger/webinspector-dom.d.ts +15 -15
- package/debugger/webinspector-dom.js +1 -1
- package/debugger/webinspector-dom.js.map +1 -1
- package/debugger/webinspector-network.android.d.ts +9 -9
- package/debugger/webinspector-network.android.js +2 -2
- package/debugger/webinspector-network.android.js.map +1 -1
- package/debugger/webinspector-network.ios.d.ts +9 -9
- package/debugger/webinspector-network.ios.js +1 -1
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/fetch/{index.js → index.mjs} +20 -24
- package/file-system/file-system-access.android.js +27 -33
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.js +2 -15
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.js +5 -10
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.d.ts +1 -2
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.d.ts +1 -2
- package/fps-meter/fps-native.ios.js +1 -1
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/global-types.d.ts +7 -8
- package/globals/global-utils.d.ts +27 -0
- package/globals/global-utils.js +67 -0
- package/globals/global-utils.js.map +1 -0
- package/globals/index.d.ts +3 -7
- package/globals/index.js +254 -292
- package/globals/index.js.map +1 -1
- package/globals/polyfills/polyfill-xhr.d.ts +1 -0
- package/globals/polyfills/polyfill-xhr.js +5 -0
- package/globals/polyfills/polyfill-xhr.js.map +1 -0
- package/globals/polyfills/utils.d.ts +1 -0
- package/globals/polyfills/utils.js +8 -0
- package/globals/polyfills/utils.js.map +1 -0
- package/http/http-interfaces.d.ts +83 -0
- package/http/http-interfaces.js +6 -0
- package/http/http-interfaces.js.map +1 -0
- package/http/http-request/http-request-common.d.ts +1 -0
- package/http/http-request/http-request-common.js +10 -2
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.d.ts +2 -7
- package/http/http-request/index.android.js +57 -279
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.d.ts +6 -2
- package/http/http-request/index.ios.d.ts +2 -7
- package/http/http-request/index.ios.js +37 -235
- package/http/http-request/index.ios.js.map +1 -1
- package/http/http-request-internal/http-request-internal-common.d.ts +2 -0
- package/http/http-request-internal/http-request-internal-common.js +12 -0
- package/http/http-request-internal/http-request-internal-common.js.map +1 -0
- package/http/http-request-internal/index.android.d.ts +4 -0
- package/http/http-request-internal/index.android.js +204 -0
- package/http/http-request-internal/index.android.js.map +1 -0
- package/http/http-request-internal/index.d.ts +28 -0
- package/http/http-request-internal/index.ios.d.ts +4 -0
- package/http/http-request-internal/index.ios.js +181 -0
- package/http/http-request-internal/index.ios.js.map +1 -0
- package/http/index.d.ts +6 -105
- package/http/index.js +8 -12
- package/http/index.js.map +1 -1
- package/image-asset/image-asset-common.js +28 -1
- package/image-asset/image-asset-common.js.map +1 -1
- package/image-asset/index.android.js +4 -3
- package/image-asset/index.android.js.map +1 -1
- package/image-source/index.android.d.ts +1 -1
- package/image-source/index.android.js +9 -26
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.d.ts +2 -2
- package/image-source/index.ios.js +2 -9
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +13 -8
- package/index.js +5 -3
- package/index.js.map +1 -1
- package/inspector_modules.d.ts +6 -0
- package/inspector_modules.js +231 -3
- package/inspector_modules.js.map +1 -1
- package/js-libs/easysax/easysax.js +5 -3
- package/media-query-list/index.js +7 -17
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/helpers.d.ts +14 -0
- package/module-name-resolver/helpers.js +27 -0
- package/module-name-resolver/helpers.js.map +1 -0
- package/module-name-resolver/index.d.ts +12 -22
- package/module-name-resolver/index.js +6 -18
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js +32 -23
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/module-name-resolver/qualifier-matcher/index.d.ts +6 -12
- package/module-name-resolver/qualifier-matcher/index.js +5 -5
- package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
- package/package.json +88 -83
- package/platform/device/index.android.js +2 -2
- package/platform/device/index.android.js.map +1 -1
- package/platform/screen/index.android.js +2 -2
- package/platform/screen/index.android.js.map +1 -1
- package/platform/screen/index.d.ts +5 -0
- package/platform/screen/index.ios.js +2 -2
- package/platform/screen/index.ios.js.map +1 -1
- package/platforms/android/java/org/nativescript/widgets/BoxShadowDrawable.java +112 -113
- package/platforms/android/java/org/nativescript/widgets/LayoutBase.java +0 -4
- package/platforms/android/java/org/nativescript/widgets/Utils.java +87 -23
- package/platforms/android/java/org/nativescript/widgets/ViewHelper.java +13 -1
- package/platforms/android/native-api-usage.json +2 -0
- package/profiling/index.js +2 -1
- package/profiling/index.js.map +1 -1
- package/timer/index.android.js +15 -7
- package/timer/index.android.js.map +1 -1
- package/timer/index.ios.js +1 -1
- package/timer/index.ios.js.map +1 -1
- package/ui/action-bar/action-bar-common.js +4 -3
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +22 -22
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +2 -5
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/index.ios.js +1 -1
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.d.ts +5 -5
- package/ui/animation/animation-common.js +2 -3
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/animation-interfaces.d.ts +1 -79
- package/ui/animation/animation-interfaces.js +1 -12
- package/ui/animation/animation-interfaces.js.map +1 -1
- package/ui/animation/animation-shared.d.ts +140 -0
- package/ui/animation/animation-shared.js +4 -0
- package/ui/animation/animation-shared.js.map +1 -0
- package/ui/animation/animation-types.d.ts +1 -0
- package/ui/animation/animation-types.js +3 -0
- package/ui/animation/animation-types.js.map +1 -0
- package/ui/animation/index.android.d.ts +1 -2
- package/ui/animation/index.android.js +5 -5
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.d.ts +7 -132
- package/ui/animation/index.ios.d.ts +2 -2
- package/ui/animation/index.ios.js +9 -9
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +66 -118
- package/ui/animation/keyframe-animation.js +2 -2
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/binding-builder.d.ts +12 -15
- package/ui/builder/component-builder/index.js +5 -5
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.d.ts +179 -59
- package/ui/builder/index.js +447 -10
- package/ui/builder/index.js.map +1 -1
- package/ui/button/index.android.d.ts +3 -9
- package/ui/button/index.android.js +34 -43
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.d.ts +1 -1
- package/ui/button/index.ios.d.ts +3 -9
- package/ui/button/index.ios.js +43 -79
- package/ui/button/index.ios.js.map +1 -1
- package/ui/core/bindable/bindable-types.d.ts +37 -0
- package/ui/core/bindable/bindable-types.js +3 -0
- package/ui/core/bindable/bindable-types.js.map +1 -0
- package/ui/core/bindable/index.d.ts +2 -38
- package/ui/core/bindable/index.js +1 -2
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/control-state-change/index.ios.js +1 -1
- package/ui/core/control-state-change/index.ios.js.map +1 -1
- package/ui/core/properties/index.d.ts +2 -37
- package/ui/core/properties/index.js +27 -42
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/properties/property-shared.d.ts +39 -0
- package/ui/core/properties/property-shared.js +14 -0
- package/ui/core/properties/property-shared.js.map +1 -0
- package/ui/core/view/index.android.d.ts +18 -4
- package/ui/core/view/index.android.js +353 -246
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +48 -64
- package/ui/core/view/index.ios.d.ts +25 -5
- package/ui/core/view/index.ios.js +172 -25
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +91 -28
- package/ui/core/view/view-common.js +83 -27
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.d.ts +6 -0
- package/ui/core/view/view-helper/index.ios.d.ts +10 -5
- package/ui/core/view/view-helper/index.ios.js +88 -23
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +8 -3
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-shared.d.ts +5 -0
- package/ui/core/view/view-helper/view-helper-shared.js +6 -0
- package/ui/core/view/view-helper/view-helper-shared.js.map +1 -0
- package/ui/core/view/view-interfaces.d.ts +54 -0
- package/ui/core/view/view-interfaces.js +2 -0
- package/ui/core/view/view-interfaces.js.map +1 -0
- package/ui/core/view-base/index.js +74 -58
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/core/view-base/utils.d.ts +1 -0
- package/ui/core/view-base/utils.js +9 -0
- package/ui/core/view-base/utils.js.map +1 -0
- package/ui/date-picker/index.android.js +36 -36
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/date-picker/index.ios.js +1 -1
- package/ui/date-picker/index.ios.js.map +1 -1
- package/ui/dialogs/dialogs-common.js +3 -3
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.android.js +8 -7
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js +56 -51
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/editable-text-base/index.android.d.ts +1 -0
- package/ui/editable-text-base/index.android.js +36 -32
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/embedding/index.android.d.ts +1 -1
- package/ui/embedding/index.d.ts +1 -1
- package/ui/frame/activity.android.js.map +1 -1
- package/ui/frame/fragment.android.js +3 -2
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.transitions.android.d.ts +15 -13
- package/ui/frame/fragment.transitions.android.js +101 -98
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/fragment.transitions.d.ts +3 -2
- package/ui/frame/frame-common.d.ts +5 -4
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/{callbacks/fragment-callbacks.d.ts → frame-helper-for-android.d.ts} +20 -1
- package/ui/frame/{callbacks/fragment-callbacks.js → frame-helper-for-android.js} +87 -48
- package/ui/frame/frame-helper-for-android.js.map +1 -0
- package/ui/frame/frame-interfaces.d.ts +40 -4
- package/ui/frame/frame-interfaces.js.map +1 -1
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.d.ts +27 -15
- package/ui/frame/index.android.js +347 -83
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +18 -69
- package/ui/frame/index.ios.d.ts +7 -4
- package/ui/frame/index.ios.js +114 -48
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.d.ts +4 -273
- package/ui/gestures/gestures-common.js +3 -146
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/gestures-types.d.ts +301 -0
- package/ui/gestures/gestures-types.js +146 -0
- package/ui/gestures/gestures-types.js.map +1 -0
- package/ui/gestures/index.android.d.ts +29 -1
- package/ui/gestures/index.android.js +133 -132
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.d.ts +35 -0
- package/ui/gestures/index.ios.d.ts +35 -1
- package/ui/gestures/index.ios.js +6 -8
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.d.ts +1 -1
- package/ui/gestures/touch-manager.js +32 -32
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/html-view/index.ios.js +2 -1
- package/ui/html-view/index.ios.js.map +1 -1
- package/ui/image/image-common.js +2 -1
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.js +18 -18
- package/ui/image/index.android.js.map +1 -1
- package/ui/image-cache/index.android.js +12 -14
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +11 -17
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +20 -8
- package/ui/index.js +22 -4
- package/ui/index.js.map +1 -1
- package/ui/label/index.android.js +4 -1
- package/ui/label/index.android.js.map +1 -1
- package/ui/label/index.ios.d.ts +3 -5
- package/ui/label/index.ios.js +23 -45
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
- package/ui/layouts/absolute-layout/index.android.js +1 -1
- package/ui/layouts/absolute-layout/index.android.js.map +1 -1
- package/ui/layouts/absolute-layout/index.d.ts +1 -1
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +2 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.js +1 -1
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.ios.js +3 -6
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/grid-layout/index.android.d.ts +1 -0
- package/ui/layouts/grid-layout/index.android.js +5 -5
- package/ui/layouts/grid-layout/index.android.js.map +1 -1
- package/ui/layouts/index.d.ts +5 -1
- package/ui/layouts/index.js +2 -0
- package/ui/layouts/index.js.map +1 -1
- package/ui/layouts/layout-base.android.d.ts +3 -10
- package/ui/layouts/layout-base.android.js +8 -24
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/liquid-glass/index.android.d.ts +5 -0
- package/ui/layouts/liquid-glass/index.android.js +8 -0
- package/ui/layouts/liquid-glass/index.android.js.map +1 -0
- package/ui/layouts/liquid-glass/index.d.ts +10 -0
- package/ui/layouts/liquid-glass/index.ios.d.ts +12 -0
- package/ui/layouts/liquid-glass/index.ios.js +106 -0
- package/ui/layouts/liquid-glass/index.ios.js.map +1 -0
- package/ui/layouts/liquid-glass/liquid-glass-common.d.ts +3 -0
- package/ui/layouts/liquid-glass/liquid-glass-common.js +4 -0
- package/ui/layouts/liquid-glass/liquid-glass-common.js.map +1 -0
- package/ui/layouts/liquid-glass-container/index.android.d.ts +3 -0
- package/ui/layouts/liquid-glass-container/index.android.js +4 -0
- package/ui/layouts/liquid-glass-container/index.android.js.map +1 -0
- package/ui/layouts/liquid-glass-container/index.d.ts +3 -0
- package/ui/layouts/liquid-glass-container/index.ios.d.ts +15 -0
- package/ui/layouts/liquid-glass-container/index.ios.js +167 -0
- package/ui/layouts/liquid-glass-container/index.ios.js.map +1 -0
- package/ui/layouts/liquid-glass-container/liquid-glass-container-common.d.ts +4 -0
- package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js +5 -0
- package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js.map +1 -0
- package/ui/layouts/stack-layout/index.ios.js +6 -0
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/index.android.js +1 -1
- package/ui/layouts/wrap-layout/index.android.js.map +1 -1
- package/ui/layouts/wrap-layout/index.d.ts +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
- package/ui/list-picker/index.android.js +31 -31
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-picker/index.ios.js +2 -2
- package/ui/list-picker/index.ios.js.map +1 -1
- package/ui/list-view/index.android.d.ts +26 -1
- package/ui/list-view/index.android.js +767 -124
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +128 -1
- package/ui/list-view/index.ios.d.ts +34 -2
- package/ui/list-view/index.ios.js +558 -22
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.d.ts +22 -1
- package/ui/list-view/list-view-common.js +87 -1
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/events.d.ts +6 -0
- package/ui/page/events.js +7 -0
- package/ui/page/events.js.map +1 -0
- package/ui/page/index.android.d.ts +1 -10
- package/ui/page/index.android.js +4 -46
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.d.ts +1 -9
- package/ui/page/index.ios.d.ts +1 -3
- package/ui/page/index.ios.js +84 -142
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +3 -8
- package/ui/page/page-common.js +6 -18
- package/ui/page/page-common.js.map +1 -1
- package/ui/scroll-view/index.d.ts +1 -1
- package/ui/scroll-view/index.ios.d.ts +2 -0
- package/ui/scroll-view/index.ios.js +33 -13
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.d.ts +3 -8
- package/ui/scroll-view/scroll-view-common.js +4 -4
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/search-bar/index.android.js +44 -48
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.js +3 -6
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/index.android.js +52 -54
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.ios.d.ts +1 -0
- package/ui/segmented-bar/index.ios.js +10 -1
- package/ui/segmented-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/segmented-bar-common.js +2 -2
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
- package/ui/slider/index.android.d.ts +1 -0
- package/ui/slider/index.android.js +92 -25
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.d.ts +1 -1
- package/ui/slider/index.ios.d.ts +1 -0
- package/ui/slider/index.ios.js +85 -3
- package/ui/slider/index.ios.js.map +1 -1
- package/ui/split-view/index.android.d.ts +3 -0
- package/ui/split-view/index.android.js +4 -0
- package/ui/split-view/index.android.js.map +1 -0
- package/ui/split-view/index.d.ts +16 -0
- package/ui/split-view/index.ios.d.ts +51 -0
- package/ui/split-view/index.ios.js +567 -0
- package/ui/split-view/index.ios.js.map +1 -0
- package/ui/split-view/split-view-common.d.ts +59 -0
- package/ui/split-view/split-view-common.js +127 -0
- package/ui/split-view/split-view-common.js.map +1 -0
- package/ui/styling/background-common.d.ts +4 -4
- package/ui/styling/background-common.js +7 -8
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.d.ts +0 -6
- package/ui/styling/background.android.js +1 -53
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.d.ts +0 -3
- package/ui/styling/background.ios.d.ts +2 -1
- package/ui/styling/background.ios.js +53 -39
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/converters.d.ts +2 -2
- package/ui/styling/css-selector.js.map +1 -1
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-transform.d.ts +1 -1
- package/ui/styling/css-utils.d.ts +1 -0
- package/ui/styling/css-utils.js +16 -5
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font.android.js +2 -2
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.ios.js +10 -10
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/length-shared.d.ts +52 -0
- package/ui/styling/length-shared.js +172 -0
- package/ui/styling/length-shared.js.map +1 -0
- 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 +62 -112
- package/ui/styling/style-properties.js +50 -98
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +85 -48
- package/ui/styling/style-scope.js +29 -39
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/styling/styling-profile.d.ts +1 -0
- package/ui/styling/styling-profile.js +4 -0
- package/ui/styling/styling-profile.js.map +1 -0
- package/ui/styling/styling-shared.d.ts +3 -0
- package/ui/styling/styling-shared.js +6 -0
- package/ui/styling/styling-shared.js.map +1 -0
- package/ui/switch/index.android.js +16 -16
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.d.ts +1 -0
- package/ui/switch/index.ios.js +62 -12
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.js +167 -158
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.d.ts +22 -1
- package/ui/tab-view/index.ios.d.ts +19 -3
- package/ui/tab-view/index.ios.js +337 -61
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.d.ts +15 -0
- package/ui/tab-view/tab-view-common.js +15 -0
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/index.android.d.ts +8 -18
- package/ui/text-base/index.android.js +126 -165
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.d.ts +6 -6
- package/ui/text-base/index.ios.js +16 -20
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/text-base-common.d.ts +2 -1
- package/ui/text-base/text-base-common.js +1 -1
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-field/index.ios.d.ts +4 -9
- package/ui/text-field/index.ios.js +55 -35
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.d.ts +3 -9
- package/ui/text-view/index.ios.js +31 -78
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/time-picker/index.android.js +19 -19
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/time-picker/index.ios.js +1 -1
- package/ui/time-picker/index.ios.js.map +1 -1
- package/ui/transition/fade-transition.ios.js +6 -7
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/index.ios.js +1 -1
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +20 -27
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.d.ts +1 -1
- package/ui/transition/page-transition.android.js +7 -16
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +20 -26
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.ios.js +1 -1
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.js +2 -1
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +7 -8
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/ui/web-view/index.android.js +58 -62
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.ios.js +17 -17
- package/ui/web-view/index.ios.js.map +1 -1
- package/utils/animation-helpers.d.ts +27 -0
- package/utils/animation-helpers.js +48 -0
- package/utils/animation-helpers.js.map +1 -0
- package/utils/common.d.ts +4 -41
- package/utils/common.js +26 -121
- package/utils/common.js.map +1 -1
- package/utils/constants.android.d.ts +1 -0
- package/utils/constants.android.js +3 -0
- package/utils/constants.android.js.map +1 -1
- package/utils/constants.d.ts +1 -0
- package/utils/constants.ios.d.ts +1 -0
- package/utils/constants.ios.js +3 -0
- package/utils/constants.ios.js.map +1 -1
- package/utils/debug-source.d.ts +19 -0
- package/utils/debug-source.js +78 -0
- package/utils/debug-source.js.map +1 -0
- package/utils/debug.js +1 -59
- package/utils/debug.js.map +1 -1
- package/utils/index.android.d.ts +3 -1
- package/utils/index.android.js +37 -11
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +8 -14
- package/utils/index.ios.d.ts +4 -1
- package/utils/index.ios.js +32 -5
- package/utils/index.ios.js.map +1 -1
- package/utils/layout-helper/index.android.d.ts +1 -0
- package/utils/layout-helper/index.android.js +13 -4
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.d.ts +11 -4
- package/utils/layout-helper/index.ios.d.ts +1 -0
- package/utils/layout-helper/index.ios.js +9 -5
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.d.ts +0 -9
- package/utils/layout-helper/layout-helper-common.js +1 -9
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/layout-helper/layout-helper-shared.d.ts +9 -0
- package/utils/layout-helper/layout-helper-shared.js +13 -0
- package/utils/layout-helper/layout-helper-shared.js.map +1 -0
- package/utils/{android/index.d.ts → native-helper-for-android.d.ts} +5 -3
- package/utils/{android/index.js → native-helper-for-android.js} +140 -28
- package/utils/native-helper-for-android.js.map +1 -0
- package/utils/native-helper.android.d.ts +29 -5
- package/utils/native-helper.android.js +18 -131
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.d.ts +206 -258
- package/utils/native-helper.ios.d.ts +72 -3
- package/utils/native-helper.ios.js +250 -3
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/shared.d.ts +19 -0
- package/utils/shared.js +44 -0
- package/utils/shared.js.map +1 -0
- package/utils/utils-shared.d.ts +1 -0
- package/utils/utils-shared.js +8 -0
- package/utils/utils-shared.js.map +1 -0
- package/xhr/index.d.ts +6 -0
- package/xhr/index.js +27 -13
- package/xhr/index.js.map +1 -1
- package/xml/index.d.ts +94 -98
- package/xml/index.js +58 -2
- package/xml/index.js.map +1 -1
- package/cli-hooks/postinstall.js +0 -2
- package/cli-hooks/preuninstall.js +0 -2
- package/debugger/dom-node.d.ts +0 -27
- package/debugger/dom-node.js.map +0 -1
- package/polyfills/formdata.d.ts +0 -6
- package/polyfills/formdata.js +0 -16
- package/polyfills/formdata.js.map +0 -1
- package/ui/builder/xml2ui.d.ts +0 -134
- package/ui/builder/xml2ui.js +0 -394
- package/ui/builder/xml2ui.js.map +0 -1
- package/ui/frame/callbacks/activity-callbacks.d.ts +0 -20
- package/ui/frame/callbacks/activity-callbacks.js +0 -301
- package/ui/frame/callbacks/activity-callbacks.js.map +0 -1
- package/ui/frame/callbacks/fragment-callbacks.js.map +0 -1
- package/utils/android/index.js.map +0 -1
- package/utils/ios/index.d.ts +0 -39
- package/utils/ios/index.js +0 -257
- package/utils/ios/index.js.map +0 -1
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
import { profile } from '../profiling';
|
|
2
|
+
import { ContentView } from '../ui/content-view';
|
|
2
3
|
import { isEmbedded } from '../ui/embedding';
|
|
3
4
|
import { IOSHelper } from '../ui/core/view/view-helper';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { getWindow } from '../utils/native-helper';
|
|
6
|
+
import { SDK_VERSION } from '../utils/constants';
|
|
7
|
+
import { ios as iosUtils, dataSerialize } from '../utils/native-helper';
|
|
8
|
+
import { ApplicationCommon, SceneEvents } from './application-common';
|
|
9
|
+
import { Trace } from '../trace';
|
|
10
|
+
import { CoreTypes } from '../core-types';
|
|
11
|
+
import { getiOSWindow, setApplicationPropertiesCallback, setAppMainEntry, setiOSWindow, setRootView, setToggleApplicationEventListenersCallback } from './helpers-common';
|
|
12
|
+
var NotificationObserver = (function (_super) {
|
|
13
|
+
__extends(NotificationObserver, _super);
|
|
14
|
+
function NotificationObserver() {
|
|
15
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
16
|
+
}
|
|
17
|
+
NotificationObserver.initWithCallback = function (onReceiveCallback) {
|
|
18
|
+
var observer = _super.new.call(this);
|
|
19
|
+
observer._onReceiveCallback = onReceiveCallback;
|
|
20
|
+
return observer;
|
|
21
|
+
};
|
|
22
|
+
NotificationObserver.prototype.onReceive = function (notification) {
|
|
23
|
+
this._onReceiveCallback(notification);
|
|
24
|
+
};
|
|
25
|
+
NotificationObserver.ObjCExposedMethods = {
|
|
26
|
+
onReceive: { returns: interop.types.void, params: [NSNotification] },
|
|
27
|
+
};
|
|
28
|
+
return NotificationObserver;
|
|
29
|
+
}(NSObject));
|
|
30
|
+
var CADisplayLinkTarget = (function (_super) {
|
|
7
31
|
__extends(CADisplayLinkTarget, _super);
|
|
8
32
|
function CADisplayLinkTarget() {
|
|
9
33
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -33,25 +57,29 @@ var CADisplayLinkTarget = /** @class */ (function (_super) {
|
|
|
33
57
|
};
|
|
34
58
|
return CADisplayLinkTarget;
|
|
35
59
|
}(NSObject));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Detect if the app supports scenes.
|
|
62
|
+
* When an app configures UIApplicationSceneManifest in Info.plist
|
|
63
|
+
* it will use scene lifecycle management.
|
|
64
|
+
*/
|
|
65
|
+
let sceneManifest;
|
|
66
|
+
function supportsScenes() {
|
|
67
|
+
if (SDK_VERSION < 13) {
|
|
68
|
+
return false;
|
|
40
69
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var Responder = /** @class */ (function (_super) {
|
|
70
|
+
if (typeof sceneManifest === 'undefined') {
|
|
71
|
+
// Check if scene manifest exists in Info.plist
|
|
72
|
+
sceneManifest = NSBundle.mainBundle.objectForInfoDictionaryKey('UIApplicationSceneManifest');
|
|
73
|
+
}
|
|
74
|
+
return !!sceneManifest;
|
|
75
|
+
}
|
|
76
|
+
function supportsMultipleScenes() {
|
|
77
|
+
if (SDK_VERSION < 13) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return UIApplication.sharedApplication?.supportsMultipleScenes;
|
|
81
|
+
}
|
|
82
|
+
var Responder = (function (_super) {
|
|
55
83
|
__extends(Responder, _super);
|
|
56
84
|
function Responder() {
|
|
57
85
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -61,7 +89,6 @@ var Responder = /** @class */ (function (_super) {
|
|
|
61
89
|
return Application.ios.window;
|
|
62
90
|
},
|
|
63
91
|
set: function (value) {
|
|
64
|
-
// NOOP
|
|
65
92
|
},
|
|
66
93
|
enumerable: true,
|
|
67
94
|
configurable: true
|
|
@@ -69,6 +96,96 @@ var Responder = /** @class */ (function (_super) {
|
|
|
69
96
|
Responder.ObjCProtocols = [UIApplicationDelegate];
|
|
70
97
|
return Responder;
|
|
71
98
|
}(UIResponder));
|
|
99
|
+
if (supportsScenes()) {
|
|
100
|
+
/**
|
|
101
|
+
* This method is called when a new scene session is being created.
|
|
102
|
+
* Important: When this method is implemented, the app assumes scene-based lifecycle management.
|
|
103
|
+
* Detected by the Info.plist existence 'UIApplicationSceneManifest'.
|
|
104
|
+
* If this method is implemented when there is no manifest defined,
|
|
105
|
+
* the app will boot to a white screen.
|
|
106
|
+
*/
|
|
107
|
+
Responder.prototype.applicationConfigurationForConnectingSceneSessionOptions = function (application, connectingSceneSession, options) {
|
|
108
|
+
const config = UISceneConfiguration.configurationWithNameSessionRole('Default Configuration', connectingSceneSession.role);
|
|
109
|
+
config.sceneClass = UIWindowScene;
|
|
110
|
+
config.delegateClass = SceneDelegate;
|
|
111
|
+
return config;
|
|
112
|
+
};
|
|
113
|
+
// scene session destruction handling
|
|
114
|
+
Responder.prototype.applicationDidDiscardSceneSessions = function (application, sceneSessions) {
|
|
115
|
+
// Note: we could emit an event here if needed
|
|
116
|
+
// console.log('Scene sessions discarded:', sceneSessions.count);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
var SceneDelegate = (function (_super) {
|
|
120
|
+
__extends(SceneDelegate, _super);
|
|
121
|
+
function SceneDelegate() {
|
|
122
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
123
|
+
}
|
|
124
|
+
Object.defineProperty(SceneDelegate.prototype, "window", {
|
|
125
|
+
get: function () {
|
|
126
|
+
return this._window;
|
|
127
|
+
},
|
|
128
|
+
set: function (value) {
|
|
129
|
+
this._window = value;
|
|
130
|
+
},
|
|
131
|
+
enumerable: true,
|
|
132
|
+
configurable: true
|
|
133
|
+
});
|
|
134
|
+
SceneDelegate.prototype.sceneWillConnectToSessionOptions = function (scene, session, connectionOptions) {
|
|
135
|
+
if (Trace.isEnabled()) {
|
|
136
|
+
Trace.write("SceneDelegate.sceneWillConnectToSessionOptions called with role: ".concat(session.role), Trace.categories.NativeLifecycle);
|
|
137
|
+
}
|
|
138
|
+
if (!(scene instanceof UIWindowScene)) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
var isFirstScene = !Application.ios.getPrimaryScene() && !Application.hasLaunched();
|
|
142
|
+
this._scene = scene;
|
|
143
|
+
this._window = UIWindow.alloc().initWithWindowScene(scene);
|
|
144
|
+
Application.ios._setWindowForScene(this._window, scene);
|
|
145
|
+
Application.ios._setupWindowForScene(this._window, scene);
|
|
146
|
+
Application.ios.notify({
|
|
147
|
+
eventName: SceneEvents.sceneWillConnect,
|
|
148
|
+
object: Application.ios,
|
|
149
|
+
scene: scene,
|
|
150
|
+
window: this._window,
|
|
151
|
+
connectionOptions: connectionOptions,
|
|
152
|
+
});
|
|
153
|
+
if (scene === Application.ios.getPrimaryScene()) {
|
|
154
|
+
this._window.makeKeyAndVisible();
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
Application.ios.notify({
|
|
158
|
+
eventName: SceneEvents.sceneContentSetup,
|
|
159
|
+
object: Application.ios,
|
|
160
|
+
scene: scene,
|
|
161
|
+
window: this._window,
|
|
162
|
+
connectionOptions: connectionOptions,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
if (isFirstScene) {
|
|
166
|
+
Application.ios._notifySceneAppStarted();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
SceneDelegate.prototype.sceneDidBecomeActive = function (scene) {
|
|
170
|
+
};
|
|
171
|
+
SceneDelegate.prototype.sceneWillResignActive = function (scene) {
|
|
172
|
+
Application.ios.notify({
|
|
173
|
+
eventName: SceneEvents.sceneWillResignActive,
|
|
174
|
+
object: Application.ios,
|
|
175
|
+
scene: scene,
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
SceneDelegate.prototype.sceneWillEnterForeground = function (scene) {
|
|
179
|
+
};
|
|
180
|
+
SceneDelegate.prototype.sceneDidEnterBackground = function (scene) {
|
|
181
|
+
};
|
|
182
|
+
SceneDelegate.prototype.sceneDidDisconnect = function (scene) {
|
|
183
|
+
};
|
|
184
|
+
SceneDelegate.ObjCProtocols = [UIWindowSceneDelegate];
|
|
185
|
+
return SceneDelegate;
|
|
186
|
+
}(UIResponder));
|
|
187
|
+
// ensure available globally
|
|
188
|
+
global.SceneDelegate = SceneDelegate;
|
|
72
189
|
export class iOSApplication extends ApplicationCommon {
|
|
73
190
|
/**
|
|
74
191
|
* @internal - should not be constructed by the user.
|
|
@@ -76,14 +193,27 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
76
193
|
constructor() {
|
|
77
194
|
super();
|
|
78
195
|
this._delegateHandlers = new Map();
|
|
196
|
+
this.launchEventCalled = false;
|
|
197
|
+
this._windowSceneMap = new Map();
|
|
198
|
+
this._primaryScene = null;
|
|
199
|
+
this._openedScenesById = new Map();
|
|
79
200
|
this._notificationObservers = [];
|
|
80
201
|
this.displayedOnce = false;
|
|
202
|
+
this.shouldDelayLaunchEvent = false;
|
|
81
203
|
this.addNotificationObserver(UIApplicationDidFinishLaunchingNotification, this.didFinishLaunchingWithOptions.bind(this));
|
|
82
204
|
this.addNotificationObserver(UIApplicationDidBecomeActiveNotification, this.didBecomeActive.bind(this));
|
|
83
205
|
this.addNotificationObserver(UIApplicationDidEnterBackgroundNotification, this.didEnterBackground.bind(this));
|
|
84
206
|
this.addNotificationObserver(UIApplicationWillTerminateNotification, this.willTerminate.bind(this));
|
|
85
207
|
this.addNotificationObserver(UIApplicationDidReceiveMemoryWarningNotification, this.didReceiveMemoryWarning.bind(this));
|
|
86
208
|
this.addNotificationObserver(UIApplicationDidChangeStatusBarOrientationNotification, this.didChangeStatusBarOrientation.bind(this));
|
|
209
|
+
// Add scene lifecycle notification observers only if scenes are supported
|
|
210
|
+
if (this.supportsScenes()) {
|
|
211
|
+
this.addNotificationObserver('UISceneWillConnectNotification', this.sceneWillConnect.bind(this));
|
|
212
|
+
this.addNotificationObserver('UISceneDidActivateNotification', this.sceneDidActivate.bind(this));
|
|
213
|
+
this.addNotificationObserver('UISceneWillEnterForegroundNotification', this.sceneWillEnterForeground.bind(this));
|
|
214
|
+
this.addNotificationObserver('UISceneDidEnterBackgroundNotification', this.sceneDidEnterBackground.bind(this));
|
|
215
|
+
this.addNotificationObserver('UISceneDidDisconnectNotification', this.sceneDidDisconnect.bind(this));
|
|
216
|
+
}
|
|
87
217
|
}
|
|
88
218
|
getRootView() {
|
|
89
219
|
return this._subRootView || this._rootView;
|
|
@@ -93,7 +223,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
93
223
|
this.setWindowContent();
|
|
94
224
|
}
|
|
95
225
|
run(entry) {
|
|
96
|
-
|
|
226
|
+
setAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);
|
|
97
227
|
this.started = true;
|
|
98
228
|
if (this.nativeApp) {
|
|
99
229
|
this.runAsEmbeddedApp();
|
|
@@ -112,8 +242,9 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
112
242
|
return;
|
|
113
243
|
}
|
|
114
244
|
this._rootView = rootView;
|
|
245
|
+
setRootView(rootView);
|
|
115
246
|
// Attach to the existing iOS app
|
|
116
|
-
const window =
|
|
247
|
+
const window = getWindow();
|
|
117
248
|
if (!window) {
|
|
118
249
|
return;
|
|
119
250
|
}
|
|
@@ -129,12 +260,17 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
129
260
|
const newSystemAppearance = this.getSystemAppearanceValue(userInterfaceStyle);
|
|
130
261
|
this.setSystemAppearance(newSystemAppearance);
|
|
131
262
|
});
|
|
263
|
+
rootView.on(IOSHelper.traitCollectionLayoutDirectionChangedEvent, () => {
|
|
264
|
+
const layoutDirection = controller.traitCollection.layoutDirection;
|
|
265
|
+
const newLayoutDirection = this.getLayoutDirectionValue(layoutDirection);
|
|
266
|
+
this.setLayoutDirection(newLayoutDirection);
|
|
267
|
+
});
|
|
132
268
|
if (embedderDelegate) {
|
|
133
269
|
this.setViewControllerView(rootView);
|
|
134
270
|
embedderDelegate.presentNativeScriptApp(controller);
|
|
135
271
|
}
|
|
136
272
|
else {
|
|
137
|
-
const visibleVC =
|
|
273
|
+
const visibleVC = iosUtils.getVisibleViewController(rootController);
|
|
138
274
|
visibleVC.presentViewControllerAnimatedCompletion(controller, true, null);
|
|
139
275
|
}
|
|
140
276
|
this.initRootView(rootView);
|
|
@@ -168,7 +304,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
168
304
|
const minFrameRateDisabled = NSBundle.mainBundle.objectForInfoDictionaryKey('CADisableMinimumFrameDurationOnPhone');
|
|
169
305
|
if (minFrameRateDisabled) {
|
|
170
306
|
let max = 120;
|
|
171
|
-
const deviceMaxFrames =
|
|
307
|
+
const deviceMaxFrames = iosUtils.getMainScreen().maximumFramesPerSecond;
|
|
172
308
|
if (options?.max) {
|
|
173
309
|
if (deviceMaxFrames) {
|
|
174
310
|
// iOS 10.3
|
|
@@ -179,7 +315,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
179
315
|
max = options.max <= this.displayedLink.preferredFramesPerSecond ? options.max : this.displayedLink.preferredFramesPerSecond;
|
|
180
316
|
}
|
|
181
317
|
}
|
|
182
|
-
if (
|
|
318
|
+
if (SDK_VERSION >= 15 || __VISIONOS__) {
|
|
183
319
|
const min = options?.min || max / 2;
|
|
184
320
|
const preferred = options?.preferred || max;
|
|
185
321
|
this.displayedLink.preferredFrameRateRange = CAFrameRateRangeMake(min, max, preferred);
|
|
@@ -209,11 +345,11 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
209
345
|
// TODO: consideration
|
|
210
346
|
// may not want to cache this value given the potential of multiple scenes
|
|
211
347
|
// particularly with SwiftUI app lifecycle based apps
|
|
212
|
-
if (!
|
|
348
|
+
if (!getiOSWindow()) {
|
|
213
349
|
// Note: NativeScriptViewFactory.getKeyWindow will always be used in SwiftUI app lifecycle based apps
|
|
214
|
-
|
|
350
|
+
setiOSWindow(getWindow());
|
|
215
351
|
}
|
|
216
|
-
return
|
|
352
|
+
return getiOSWindow();
|
|
217
353
|
}
|
|
218
354
|
get delegate() {
|
|
219
355
|
return this._delegate;
|
|
@@ -262,7 +398,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
262
398
|
this._notificationObservers.push(observer);
|
|
263
399
|
return observer;
|
|
264
400
|
}
|
|
265
|
-
removeNotificationObserver(observer
|
|
401
|
+
removeNotificationObserver(observer /* NotificationObserver */, notificationName) {
|
|
266
402
|
const index = this._notificationObservers.indexOf(observer);
|
|
267
403
|
if (index >= 0) {
|
|
268
404
|
this._notificationObservers.splice(index, 1);
|
|
@@ -271,7 +407,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
271
407
|
}
|
|
272
408
|
getSystemAppearance() {
|
|
273
409
|
// userInterfaceStyle is available on UITraitCollection since iOS 12.
|
|
274
|
-
if ((!__VISIONOS__ &&
|
|
410
|
+
if ((!__VISIONOS__ && SDK_VERSION <= 11) || !this.rootController) {
|
|
275
411
|
return null;
|
|
276
412
|
}
|
|
277
413
|
const userInterfaceStyle = this.rootController.traitCollection.userInterfaceStyle;
|
|
@@ -286,6 +422,21 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
286
422
|
return 'light';
|
|
287
423
|
}
|
|
288
424
|
}
|
|
425
|
+
getLayoutDirection() {
|
|
426
|
+
if (!this.rootController) {
|
|
427
|
+
return null;
|
|
428
|
+
}
|
|
429
|
+
const layoutDirection = this.rootController.traitCollection.layoutDirection;
|
|
430
|
+
return this.getLayoutDirectionValue(layoutDirection);
|
|
431
|
+
}
|
|
432
|
+
getLayoutDirectionValue(layoutDirection) {
|
|
433
|
+
switch (layoutDirection) {
|
|
434
|
+
case 0 /* UITraitEnvironmentLayoutDirection.LeftToRight */:
|
|
435
|
+
return CoreTypes.LayoutDirection.ltr;
|
|
436
|
+
case 1 /* UITraitEnvironmentLayoutDirection.RightToLeft */:
|
|
437
|
+
return CoreTypes.LayoutDirection.rtl;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
289
440
|
getOrientation() {
|
|
290
441
|
let statusBarOrientation;
|
|
291
442
|
if (__VISIONOS__) {
|
|
@@ -320,18 +471,23 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
320
471
|
return [newOrientation, degrees];
|
|
321
472
|
}
|
|
322
473
|
notifyAppStarted(notification) {
|
|
474
|
+
this.launchEventCalled = true;
|
|
323
475
|
const root = this.notifyLaunch({
|
|
324
476
|
ios: notification?.userInfo?.objectForKey('UIApplicationLaunchOptionsLocalNotificationKey') ?? null,
|
|
325
477
|
});
|
|
326
|
-
if (
|
|
478
|
+
if (getiOSWindow()) {
|
|
327
479
|
if (root !== null && !isEmbedded()) {
|
|
328
480
|
this.setWindowContent(root);
|
|
329
481
|
}
|
|
330
482
|
}
|
|
331
483
|
else {
|
|
332
|
-
this.
|
|
484
|
+
setiOSWindow(this.window);
|
|
333
485
|
}
|
|
334
486
|
}
|
|
487
|
+
// Public method for scene-based app startup
|
|
488
|
+
_notifySceneAppStarted() {
|
|
489
|
+
this.notifyAppStarted();
|
|
490
|
+
}
|
|
335
491
|
_onLivesync(context) {
|
|
336
492
|
// Handle application root module
|
|
337
493
|
const isAppRootModuleChanged = context && context.path && context.path.includes(this.getMainEntry().moduleName) && context.type !== 'style';
|
|
@@ -351,10 +507,10 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
351
507
|
this._rootView._onRootViewReset();
|
|
352
508
|
}
|
|
353
509
|
// TODO: using import crashes. it creates a circular dependency which is tricky to fix right now
|
|
354
|
-
const ContentView = require('../ui/content-view').ContentView;
|
|
355
510
|
const rootView = new ContentView();
|
|
356
511
|
const controller = this.getViewController(rootView);
|
|
357
512
|
this._rootView = rootView;
|
|
513
|
+
setRootView(rootView);
|
|
358
514
|
// setup view as styleScopeHost
|
|
359
515
|
rootView._setupAsRootView({});
|
|
360
516
|
this.setViewControllerView(rootView);
|
|
@@ -370,6 +526,11 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
370
526
|
const newSystemAppearance = this.getSystemAppearanceValue(userInterfaceStyle);
|
|
371
527
|
this.setSystemAppearance(newSystemAppearance);
|
|
372
528
|
});
|
|
529
|
+
rootView.on(IOSHelper.traitCollectionLayoutDirectionChangedEvent, () => {
|
|
530
|
+
const layoutDirection = controller.traitCollection.layoutDirection;
|
|
531
|
+
const newLayoutDirection = this.getLayoutDirectionValue(layoutDirection);
|
|
532
|
+
this.setLayoutDirection(newLayoutDirection);
|
|
533
|
+
});
|
|
373
534
|
let subRootView = this._subRootView;
|
|
374
535
|
subRootView = this.createRootView(view);
|
|
375
536
|
if (!subRootView) {
|
|
@@ -381,25 +542,49 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
381
542
|
subRootView.parent._removeView(subRootView);
|
|
382
543
|
}
|
|
383
544
|
rootView.content = subRootView;
|
|
384
|
-
if (!haveController) {
|
|
385
|
-
this._window.makeKeyAndVisible();
|
|
386
|
-
}
|
|
387
545
|
}
|
|
388
546
|
// Observers
|
|
389
547
|
didFinishLaunchingWithOptions(notification) {
|
|
548
|
+
if (__DEV__) {
|
|
549
|
+
/**
|
|
550
|
+
* v9+ runtime crash handling
|
|
551
|
+
* When crash occurs during boot, we let runtime take over
|
|
552
|
+
*/
|
|
553
|
+
if (notification.userInfo) {
|
|
554
|
+
const isBootCrash = notification.userInfo.objectForKey('NativeScriptBootCrash');
|
|
555
|
+
if (isBootCrash) {
|
|
556
|
+
// fatal crash will show in console without app exiting
|
|
557
|
+
// allowing hot reload fixes to continue
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
390
562
|
this.setMaxRefreshRate();
|
|
391
|
-
//
|
|
392
|
-
this.
|
|
393
|
-
|
|
394
|
-
//
|
|
395
|
-
this.
|
|
563
|
+
// Only set up window if NOT using scene-based lifecycle
|
|
564
|
+
if (!this.supportsScenes()) {
|
|
565
|
+
// Traditional single-window app setup
|
|
566
|
+
// ensures window is assigned to proper window scene
|
|
567
|
+
setiOSWindow(this.window);
|
|
568
|
+
if (!getiOSWindow()) {
|
|
569
|
+
// if still no window, create one
|
|
570
|
+
setiOSWindow(UIWindow.alloc().initWithFrame(UIScreen.mainScreen.bounds));
|
|
571
|
+
}
|
|
572
|
+
if (!__VISIONOS__) {
|
|
573
|
+
this.window.backgroundColor = SDK_VERSION <= 12 || !UIColor.systemBackgroundColor ? UIColor.whiteColor : UIColor.systemBackgroundColor;
|
|
574
|
+
}
|
|
575
|
+
this.launchEventCalled = false;
|
|
576
|
+
if (!this.shouldDelayLaunchEvent) {
|
|
577
|
+
this.notifyAppStarted();
|
|
578
|
+
}
|
|
396
579
|
}
|
|
397
|
-
|
|
398
|
-
|
|
580
|
+
else {
|
|
581
|
+
// Scene-based app - window creation will happen in scene delegate
|
|
399
582
|
}
|
|
400
|
-
this.notifyAppStarted(notification);
|
|
401
583
|
}
|
|
402
584
|
didBecomeActive(notification) {
|
|
585
|
+
if (!this.launchEventCalled) {
|
|
586
|
+
this.notifyAppStarted(notification);
|
|
587
|
+
}
|
|
403
588
|
const additionalData = {
|
|
404
589
|
ios: UIApplication.sharedApplication,
|
|
405
590
|
};
|
|
@@ -444,6 +629,434 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
444
629
|
const [newOrientation, degrees] = this.getOrientationValue(statusBarOrientation);
|
|
445
630
|
this.setOrientation(newOrientation, degrees);
|
|
446
631
|
}
|
|
632
|
+
// Scene lifecycle notification handlers
|
|
633
|
+
sceneWillConnect(notification) {
|
|
634
|
+
const scene = notification.object;
|
|
635
|
+
if (!scene || !(scene instanceof UIWindowScene)) {
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
// Store as primary scene if it's the first one
|
|
639
|
+
if (!this._primaryScene) {
|
|
640
|
+
this._primaryScene = scene;
|
|
641
|
+
}
|
|
642
|
+
this.notify({
|
|
643
|
+
eventName: SceneEvents.sceneWillConnect,
|
|
644
|
+
object: this,
|
|
645
|
+
scene: scene,
|
|
646
|
+
userInfo: notification.userInfo,
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
sceneDidActivate(notification) {
|
|
650
|
+
const scene = notification.object;
|
|
651
|
+
this.notify({
|
|
652
|
+
eventName: SceneEvents.sceneDidActivate,
|
|
653
|
+
object: this,
|
|
654
|
+
scene: scene,
|
|
655
|
+
});
|
|
656
|
+
// If this is the primary scene, trigger traditional app lifecycle
|
|
657
|
+
if (scene === this._primaryScene) {
|
|
658
|
+
const additionalData = {
|
|
659
|
+
ios: UIApplication.sharedApplication,
|
|
660
|
+
scene: scene,
|
|
661
|
+
};
|
|
662
|
+
this.setInBackground(false, additionalData);
|
|
663
|
+
this.setSuspended(false, additionalData);
|
|
664
|
+
if (this._rootView && !this._rootView.isLoaded) {
|
|
665
|
+
this._rootView.callLoaded();
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
sceneWillEnterForeground(notification) {
|
|
670
|
+
const scene = notification.object;
|
|
671
|
+
this.notify({
|
|
672
|
+
eventName: SceneEvents.sceneWillEnterForeground,
|
|
673
|
+
object: this,
|
|
674
|
+
scene: scene,
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
sceneDidEnterBackground(notification) {
|
|
678
|
+
const scene = notification.object;
|
|
679
|
+
this.notify({
|
|
680
|
+
eventName: SceneEvents.sceneDidEnterBackground,
|
|
681
|
+
object: this,
|
|
682
|
+
scene: scene,
|
|
683
|
+
});
|
|
684
|
+
// If this is the primary scene, trigger traditional app lifecycle
|
|
685
|
+
if (scene === this._primaryScene) {
|
|
686
|
+
const additionalData = {
|
|
687
|
+
ios: UIApplication.sharedApplication,
|
|
688
|
+
scene: scene,
|
|
689
|
+
};
|
|
690
|
+
this.setInBackground(true, additionalData);
|
|
691
|
+
this.setSuspended(true, additionalData);
|
|
692
|
+
if (this._rootView && this._rootView.isLoaded) {
|
|
693
|
+
this._rootView.callUnloaded();
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
sceneDidDisconnect(notification) {
|
|
698
|
+
const scene = notification.object;
|
|
699
|
+
this._removeWindowForScene(scene);
|
|
700
|
+
// If primary scene disconnected, clear it
|
|
701
|
+
if (scene === this._primaryScene) {
|
|
702
|
+
this._primaryScene = null;
|
|
703
|
+
}
|
|
704
|
+
if (this._primaryScene) {
|
|
705
|
+
if (SDK_VERSION >= 17) {
|
|
706
|
+
const request = UISceneSessionActivationRequest.requestWithSession(this._primaryScene.session);
|
|
707
|
+
UIApplication.sharedApplication.activateSceneSessionForRequestErrorHandler(request, (err) => {
|
|
708
|
+
if (err) {
|
|
709
|
+
console.log('Failed to activate primary scene:', err.localizedDescription);
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
else {
|
|
714
|
+
UIApplication.sharedApplication.requestSceneSessionActivationUserActivityOptionsErrorHandler(this._primaryScene.session, null, null, (err) => {
|
|
715
|
+
if (err) {
|
|
716
|
+
console.log('Failed to activate primary scene (legacy):', err.localizedDescription);
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
this.notify({
|
|
722
|
+
eventName: SceneEvents.sceneDidDisconnect,
|
|
723
|
+
object: this,
|
|
724
|
+
scene: scene,
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
// Scene management helper methods
|
|
728
|
+
_setWindowForScene(window, scene) {
|
|
729
|
+
this._windowSceneMap.set(scene, window);
|
|
730
|
+
}
|
|
731
|
+
_removeWindowForScene(scene) {
|
|
732
|
+
this._windowSceneMap.delete(scene);
|
|
733
|
+
// also untrack opened scene id
|
|
734
|
+
try {
|
|
735
|
+
const s = scene;
|
|
736
|
+
if (s && s.session) {
|
|
737
|
+
const id = this._getSceneId(s);
|
|
738
|
+
this._openedScenesById.delete(id);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
catch { }
|
|
742
|
+
}
|
|
743
|
+
_getWindowForScene(scene) {
|
|
744
|
+
return this._windowSceneMap.get(scene);
|
|
745
|
+
}
|
|
746
|
+
_setupWindowForScene(window, scene) {
|
|
747
|
+
if (!window) {
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
// track opened scene
|
|
751
|
+
try {
|
|
752
|
+
const id = this._getSceneId(scene);
|
|
753
|
+
this._openedScenesById.set(id, scene);
|
|
754
|
+
}
|
|
755
|
+
catch { }
|
|
756
|
+
// Set up window background
|
|
757
|
+
if (!__VISIONOS__) {
|
|
758
|
+
window.backgroundColor = SDK_VERSION <= 12 || !UIColor.systemBackgroundColor ? UIColor.whiteColor : UIColor.systemBackgroundColor;
|
|
759
|
+
}
|
|
760
|
+
// If this is the primary scene, set up the main application content
|
|
761
|
+
if (scene === this._primaryScene || !this._primaryScene) {
|
|
762
|
+
this._primaryScene = scene;
|
|
763
|
+
if (!getiOSWindow()) {
|
|
764
|
+
setiOSWindow(window);
|
|
765
|
+
}
|
|
766
|
+
// During initial scene startup we must wait for launch to be notified first.
|
|
767
|
+
// Some frameworks provide root content from launch handlers.
|
|
768
|
+
if (this.hasLaunched()) {
|
|
769
|
+
this.setWindowContent();
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
get sceneDelegate() {
|
|
774
|
+
if (!this._sceneDelegate) {
|
|
775
|
+
this._sceneDelegate = SceneDelegate.new();
|
|
776
|
+
}
|
|
777
|
+
return this._sceneDelegate;
|
|
778
|
+
}
|
|
779
|
+
set sceneDelegate(value) {
|
|
780
|
+
this._sceneDelegate = value;
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Multi-window support
|
|
784
|
+
*/
|
|
785
|
+
/**
|
|
786
|
+
* Opens a new window with the specified data.
|
|
787
|
+
* @param data The data to pass to the new window.
|
|
788
|
+
*/
|
|
789
|
+
openWindow(data) {
|
|
790
|
+
if (!supportsMultipleScenes()) {
|
|
791
|
+
console.log('Cannot create a new scene - not supported on this device.');
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
try {
|
|
795
|
+
const app = UIApplication.sharedApplication;
|
|
796
|
+
// iOS 17+
|
|
797
|
+
if (SDK_VERSION >= 17) {
|
|
798
|
+
// Create a new scene activation request with proper role
|
|
799
|
+
let request;
|
|
800
|
+
try {
|
|
801
|
+
// Use the correct factory method to create request with role
|
|
802
|
+
// Based on the type definitions, this is the proper way
|
|
803
|
+
request = UISceneSessionActivationRequest.requestWithRole(UIWindowSceneSessionRoleApplication);
|
|
804
|
+
// Note: may be useful to allow user defined activity type through optional string typed data in future
|
|
805
|
+
const activity = NSUserActivity.alloc().initWithActivityType(`${NSBundle.mainBundle.bundleIdentifier}.scene`);
|
|
806
|
+
activity.userInfo = dataSerialize(data);
|
|
807
|
+
request.userActivity = activity;
|
|
808
|
+
// Set proper options with requesting scene
|
|
809
|
+
const options = UISceneActivationRequestOptions.new();
|
|
810
|
+
// Note: explore secondary windows spawning other windows
|
|
811
|
+
// and if this context needs to change in those cases
|
|
812
|
+
const mainWindow = Application.ios.getPrimaryWindow();
|
|
813
|
+
options.requestingScene = mainWindow?.windowScene;
|
|
814
|
+
/**
|
|
815
|
+
* Note: This does not work in testing but worth exploring further sometime
|
|
816
|
+
* regarding the size/dimensions of opened secondary windows.
|
|
817
|
+
* The initial size is ultimately determined by the system
|
|
818
|
+
* based on available space and user context.
|
|
819
|
+
*/
|
|
820
|
+
// Get the size restrictions from the window scene
|
|
821
|
+
// const sizeRestrictions = (options.requestingScene as UIWindowScene).sizeRestrictions;
|
|
822
|
+
// // Set your minimum and maximum dimensions
|
|
823
|
+
// sizeRestrictions.minimumSize = CGSizeMake(320, 400);
|
|
824
|
+
// sizeRestrictions.maximumSize = CGSizeMake(600, 800);
|
|
825
|
+
request.options = options;
|
|
826
|
+
}
|
|
827
|
+
catch (roleError) {
|
|
828
|
+
console.log('Error creating request:', roleError);
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
app.activateSceneSessionForRequestErrorHandler(request, (error) => {
|
|
832
|
+
if (error) {
|
|
833
|
+
console.log('Error creating new scene (iOS 17+):', error);
|
|
834
|
+
// Log additional debugging info
|
|
835
|
+
if (error.userInfo) {
|
|
836
|
+
console.error(`Error userInfo: ${error.userInfo.description}`);
|
|
837
|
+
}
|
|
838
|
+
// Handle specific error types
|
|
839
|
+
if (error.localizedDescription.includes('role') && error.localizedDescription.includes('nil')) {
|
|
840
|
+
this.createSceneWithLegacyAPI(data);
|
|
841
|
+
}
|
|
842
|
+
else if (error.domain === 'FBSWorkspaceErrorDomain' && error.code === 2) {
|
|
843
|
+
this.createSceneWithLegacyAPI(data);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
// iOS 13-16 - Use the legacy requestSceneSessionActivationUserActivityOptionsErrorHandler method
|
|
849
|
+
else if (SDK_VERSION >= 13 && SDK_VERSION < 17) {
|
|
850
|
+
app.requestSceneSessionActivationUserActivityOptionsErrorHandler(null, // session
|
|
851
|
+
null, // userActivity
|
|
852
|
+
null, // options
|
|
853
|
+
(error) => {
|
|
854
|
+
if (error) {
|
|
855
|
+
console.log('Error creating new scene (legacy):', error);
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
// Fallback for older iOS versions or unsupported configurations
|
|
860
|
+
else {
|
|
861
|
+
console.log('Neither new nor legacy scene activation methods are available');
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
catch (error) {
|
|
865
|
+
console.error('Error requesting new scene:', error);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Closes a secondary window/scene.
|
|
870
|
+
* Usage examples:
|
|
871
|
+
* - Application.ios.closeWindow() // best-effort close of a non-primary scene
|
|
872
|
+
* - Application.ios.closeWindow(button) // from a tap handler within the scene
|
|
873
|
+
* - Application.ios.closeWindow(window)
|
|
874
|
+
* - Application.ios.closeWindow(scene)
|
|
875
|
+
* - Application.ios.closeWindow('scene-id')
|
|
876
|
+
*/
|
|
877
|
+
closeWindow(target) {
|
|
878
|
+
if (!__APPLE__) {
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
try {
|
|
882
|
+
const scene = this._resolveScene(target);
|
|
883
|
+
if (!scene) {
|
|
884
|
+
console.log('closeWindow: No scene resolved for target');
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
// Don't allow closing the primary scene
|
|
888
|
+
if (scene === this._primaryScene) {
|
|
889
|
+
console.log('closeWindow: Refusing to close the primary scene');
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
const session = scene.session;
|
|
893
|
+
if (!session) {
|
|
894
|
+
console.log('closeWindow: Scene has no session to destroy');
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
const app = UIApplication.sharedApplication;
|
|
898
|
+
if (app.requestSceneSessionDestructionOptionsErrorHandler) {
|
|
899
|
+
app.requestSceneSessionDestructionOptionsErrorHandler(session, null, (error) => {
|
|
900
|
+
if (error) {
|
|
901
|
+
console.log('closeWindow: destruction error', error);
|
|
902
|
+
}
|
|
903
|
+
else {
|
|
904
|
+
// clean up tracked id
|
|
905
|
+
const id = this._getSceneId(scene);
|
|
906
|
+
this._openedScenesById.delete(id);
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
else {
|
|
911
|
+
console.info('closeWindow: Scene destruction API not available on this iOS version');
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
catch (err) {
|
|
915
|
+
console.log('closeWindow: Unexpected error', err);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
getAllWindows() {
|
|
919
|
+
return Array.from(this._windowSceneMap.values());
|
|
920
|
+
}
|
|
921
|
+
getAllScenes() {
|
|
922
|
+
return Array.from(this._windowSceneMap.keys());
|
|
923
|
+
}
|
|
924
|
+
getWindowScenes() {
|
|
925
|
+
return this.getAllScenes().filter((scene) => scene instanceof UIWindowScene);
|
|
926
|
+
}
|
|
927
|
+
getPrimaryWindow() {
|
|
928
|
+
if (this._primaryScene) {
|
|
929
|
+
return this._getWindowForScene(this._primaryScene) || getiOSWindow();
|
|
930
|
+
}
|
|
931
|
+
return getiOSWindow();
|
|
932
|
+
}
|
|
933
|
+
getPrimaryScene() {
|
|
934
|
+
return this._primaryScene;
|
|
935
|
+
}
|
|
936
|
+
// Scene lifecycle management
|
|
937
|
+
supportsScenes() {
|
|
938
|
+
return supportsScenes();
|
|
939
|
+
}
|
|
940
|
+
supportsMultipleScenes() {
|
|
941
|
+
return supportsMultipleScenes();
|
|
942
|
+
}
|
|
943
|
+
isUsingSceneLifecycle() {
|
|
944
|
+
return this.supportsScenes() && this._windowSceneMap.size > 0;
|
|
945
|
+
}
|
|
946
|
+
// Call this to set up scene-based configuration
|
|
947
|
+
configureForScenes() {
|
|
948
|
+
if (!this.supportsScenes()) {
|
|
949
|
+
console.warn('Scene-based lifecycle is only supported on iOS 13+ iPad or visionOS with multi-scene enabled apps.');
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
// Additional scene configuration can be added here
|
|
953
|
+
// For now, the notification observers are already set up in the constructor
|
|
954
|
+
}
|
|
955
|
+
// Stable scene id for lookups
|
|
956
|
+
_getSceneId(scene) {
|
|
957
|
+
try {
|
|
958
|
+
if (!scene) {
|
|
959
|
+
return 'Unknown';
|
|
960
|
+
}
|
|
961
|
+
// Prefer session persistentIdentifier when available (stable across lifetime)
|
|
962
|
+
const session = scene.session;
|
|
963
|
+
const persistentId = session && session.persistentIdentifier;
|
|
964
|
+
if (persistentId) {
|
|
965
|
+
return `${persistentId}`;
|
|
966
|
+
}
|
|
967
|
+
// Fallbacks
|
|
968
|
+
if (scene.hash != null) {
|
|
969
|
+
return `${scene.hash}`;
|
|
970
|
+
}
|
|
971
|
+
const desc = scene.description;
|
|
972
|
+
if (desc) {
|
|
973
|
+
return `${desc}`;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
catch (err) {
|
|
977
|
+
// ignore
|
|
978
|
+
}
|
|
979
|
+
return 'Unknown';
|
|
980
|
+
}
|
|
981
|
+
// Resolve a UIWindowScene from various input types
|
|
982
|
+
_resolveScene(target) {
|
|
983
|
+
if (!__APPLE__) {
|
|
984
|
+
return null;
|
|
985
|
+
}
|
|
986
|
+
if (!target) {
|
|
987
|
+
// Try to pick a non-primary foreground active scene, else last known scene
|
|
988
|
+
const scenes = this.getWindowScenes?.() || [];
|
|
989
|
+
const nonPrimary = scenes.filter((s) => s !== this._primaryScene);
|
|
990
|
+
return nonPrimary[0] || scenes[0] || null;
|
|
991
|
+
}
|
|
992
|
+
// If a View was passed, derive its window.scene
|
|
993
|
+
if (target && typeof target === 'object') {
|
|
994
|
+
// UIWindowScene
|
|
995
|
+
if (target.session && target.activationState !== undefined) {
|
|
996
|
+
return target;
|
|
997
|
+
}
|
|
998
|
+
// UIWindow
|
|
999
|
+
if (target.windowScene) {
|
|
1000
|
+
return target.windowScene;
|
|
1001
|
+
}
|
|
1002
|
+
// NativeScript View
|
|
1003
|
+
if (target?.nativeViewProtected) {
|
|
1004
|
+
const uiView = target.nativeViewProtected;
|
|
1005
|
+
const win = uiView?.window;
|
|
1006
|
+
return win?.windowScene || null;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
// String id lookup
|
|
1010
|
+
if (typeof target === 'string') {
|
|
1011
|
+
if (this._openedScenesById.has(target)) {
|
|
1012
|
+
return this._openedScenesById.get(target);
|
|
1013
|
+
}
|
|
1014
|
+
// Try matching by persistentIdentifier or hash among known scenes
|
|
1015
|
+
const scenes = this.getWindowScenes?.() || [];
|
|
1016
|
+
for (const s of scenes) {
|
|
1017
|
+
const sid = this._getSceneId(s);
|
|
1018
|
+
if (sid === target) {
|
|
1019
|
+
return s;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
return null;
|
|
1024
|
+
}
|
|
1025
|
+
createSceneWithLegacyAPI(data) {
|
|
1026
|
+
const windowScene = this.window?.windowScene;
|
|
1027
|
+
if (!windowScene) {
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
// Create user activity for the new scene
|
|
1031
|
+
const userActivity = NSUserActivity.alloc().initWithActivityType(`${NSBundle.mainBundle.bundleIdentifier}.scene`);
|
|
1032
|
+
userActivity.userInfo = dataSerialize(data);
|
|
1033
|
+
// Use the legacy API
|
|
1034
|
+
const options = UISceneActivationRequestOptions.new();
|
|
1035
|
+
options.requestingScene = windowScene;
|
|
1036
|
+
UIApplication.sharedApplication.requestSceneSessionActivationUserActivityOptionsErrorHandler(null, // session - null for new scene
|
|
1037
|
+
userActivity, options, (error) => {
|
|
1038
|
+
if (error) {
|
|
1039
|
+
console.error(`Legacy scene API failed: ${error.localizedDescription}`);
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Creates a simple view controller with a NativeScript view for a scene window.
|
|
1045
|
+
* @param window The UIWindow to set content for
|
|
1046
|
+
* @param view The NativeScript View to set as root content
|
|
1047
|
+
*/
|
|
1048
|
+
setWindowRootView(window, view) {
|
|
1049
|
+
if (!window || !view) {
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
if (view.ios) {
|
|
1053
|
+
window.rootViewController = view.viewController;
|
|
1054
|
+
window.makeKeyAndVisible();
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
console.warn('View does not have a native iOS implementation');
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
447
1060
|
get ios() {
|
|
448
1061
|
// ensures Application.ios is defined when running on iOS
|
|
449
1062
|
return this;
|
|
@@ -463,4 +1076,22 @@ global.__onLiveSyncCore = function (context) {
|
|
|
463
1076
|
export * from './application-common';
|
|
464
1077
|
export const Application = iosApp;
|
|
465
1078
|
export const AndroidApplication = undefined;
|
|
1079
|
+
const applicationEvents = [Application.orientationChangedEvent, Application.systemAppearanceChangedEvent];
|
|
1080
|
+
function toggleApplicationEventListeners(toAdd, callback) {
|
|
1081
|
+
for (const eventName of applicationEvents) {
|
|
1082
|
+
if (toAdd) {
|
|
1083
|
+
Application.on(eventName, callback);
|
|
1084
|
+
}
|
|
1085
|
+
else {
|
|
1086
|
+
Application.off(eventName, callback);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
setToggleApplicationEventListenersCallback(toggleApplicationEventListeners);
|
|
1091
|
+
setApplicationPropertiesCallback(() => {
|
|
1092
|
+
return {
|
|
1093
|
+
orientation: Application.orientation(),
|
|
1094
|
+
systemAppearance: Application.systemAppearance(),
|
|
1095
|
+
};
|
|
1096
|
+
});
|
|
466
1097
|
//# sourceMappingURL=application.ios.js.map
|