@nativescript/core 9.0.0-alpha.5 → 9.0.0-next-07-20-2025-16403500407
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 +0 -264
- package/accessibility/accessibility-common.js +0 -352
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-css-helper.d.ts +1 -0
- package/accessibility/accessibility-css-helper.js +101 -0
- package/accessibility/accessibility-css-helper.js.map +1 -0
- package/accessibility/accessibility-properties.d.ts +1 -1
- package/accessibility/accessibility-properties.js +2 -2
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/accessibility-service-common.d.ts +8 -0
- package/accessibility/accessibility-service-common.js +26 -0
- package/accessibility/accessibility-service-common.js.map +1 -0
- package/accessibility/accessibility-service.android.d.ts +6 -0
- package/accessibility/accessibility-service.android.js +103 -0
- package/accessibility/accessibility-service.android.js.map +1 -0
- package/accessibility/accessibility-service.d.ts +10 -0
- package/accessibility/accessibility-service.ios.d.ts +6 -0
- package/accessibility/accessibility-service.ios.js +61 -0
- package/accessibility/accessibility-service.ios.js.map +1 -0
- package/accessibility/accessibility-types.d.ts +224 -0
- package/accessibility/accessibility-types.js +222 -0
- package/accessibility/accessibility-types.js.map +1 -0
- package/accessibility/font-scale-common.d.ts +7 -0
- package/accessibility/font-scale-common.js +14 -0
- package/accessibility/font-scale-common.js.map +1 -0
- package/accessibility/font-scale.android.d.ts +5 -0
- package/accessibility/font-scale.android.js +55 -0
- package/accessibility/font-scale.android.js.map +1 -0
- package/accessibility/font-scale.d.ts +9 -0
- package/accessibility/font-scale.ios.d.ts +5 -0
- package/accessibility/font-scale.ios.js +89 -0
- package/accessibility/font-scale.ios.js.map +1 -0
- package/accessibility/index.android.d.ts +10 -0
- package/accessibility/index.android.js +577 -0
- package/accessibility/index.android.js.map +1 -0
- package/accessibility/index.d.ts +36 -0
- package/accessibility/index.ios.d.ts +9 -0
- package/accessibility/index.ios.js +229 -0
- package/accessibility/index.ios.js.map +1 -0
- package/application/application-common.d.ts +8 -6
- package/application/application-common.js +14 -21
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +3 -2
- package/application/application.android.d.ts +7 -14
- package/application/application.android.js +75 -754
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +0 -25
- package/application/application.ios.d.ts +18 -16
- package/application/application.ios.js +45 -455
- package/application/application.ios.js.map +1 -1
- package/application-settings/index.android.js +2 -2
- package/application-settings/index.android.js.map +1 -1
- package/cli-hooks/{before-checkForChanges.mjs → before-checkForChanges.js} +6 -6
- package/cli-hooks/postinstall.js +2 -0
- package/cli-hooks/preuninstall.js +2 -0
- package/color/color-common.d.ts +19 -18
- package/color/color-common.js +14 -13
- package/color/color-common.js.map +1 -1
- package/color/index.ios.d.ts +1 -2
- package/color/index.ios.js.map +1 -1
- package/connectivity/index.android.js +4 -5
- package/connectivity/index.android.js.map +1 -1
- package/core-types/index.d.ts +1 -1
- package/core-types/index.js +2 -2
- package/core-types/index.js.map +1 -1
- package/css/css-tree-parser.js +21 -17
- package/css/css-tree-parser.js.map +1 -1
- package/css/lib/parse/index.js +577 -475
- package/css/package.json +36 -0
- package/css/reworkcss.d.ts +28 -25
- package/css/reworkcss.js +1 -5
- package/css-mediaquery/index.js +1 -1
- package/css-mediaquery/index.js.map +1 -1
- package/css-value/package.json +23 -0
- package/css-value/reworkcss-value.d.ts +8 -31
- package/css-value/reworkcss-value.js +111 -89
- package/debugger/devtools-elements-interfaces.d.ts +1 -1
- package/debugger/devtools-elements.common.js +8 -17
- 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-node.d.ts +27 -0
- package/debugger/{dom-types.js → dom-node.js} +9 -11
- package/debugger/dom-node.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 +3 -3
- 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 +458 -448
- package/file-system/file-system-access.android.js +39 -32
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/index.d.ts +2 -2
- package/file-system/index.js +11 -4
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.d.ts +2 -1
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.d.ts +2 -1
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/global-types.d.ts +1 -1
- package/globals/index.js +288 -254
- package/globals/index.js.map +1 -1
- package/http/http-request/http-request-common.js +2 -2
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.d.ts +7 -3
- package/http/http-request/index.android.js +22 -6
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.d.ts +1 -5
- package/http/http-request/index.ios.d.ts +7 -3
- package/http/http-request/index.ios.js +22 -6
- package/http/http-request/index.ios.js.map +1 -1
- package/http/index.d.ts +105 -6
- package/http/index.js +12 -10
- package/http/index.js.map +1 -1
- package/image-asset/index.android.js +3 -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 +23 -5
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js +9 -2
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +8 -12
- package/index.js +3 -6
- package/index.js.map +1 -1
- package/inspector_modules.d.ts +0 -3
- package/inspector_modules.js +3 -6
- package/inspector_modules.js.map +1 -1
- package/js-libs/easysax/easysax.js +3 -5
- package/media-query-list/index.js +17 -7
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/index.d.ts +11 -2
- package/module-name-resolver/index.js +18 -6
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js +23 -32
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/package.json +5 -8
- 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.ios.js +2 -2
- package/platform/screen/index.ios.js.map +1 -1
- package/profiling/index.js +1 -2
- package/profiling/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js +2 -4
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +6 -7
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +11 -10
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/index.ios.js +4 -3
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.d.ts +4 -4
- package/ui/animation/animation-common.js +3 -2
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/{animation-shared.d.ts → animation-interfaces.d.ts} +31 -39
- package/{core-types/animation-types.js → ui/animation/animation-interfaces.js} +1 -1
- package/ui/animation/animation-interfaces.js.map +1 -0
- package/ui/animation/index.android.d.ts +2 -1
- package/ui/animation/index.android.js +5 -5
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.d.ts +138 -2
- package/ui/animation/index.ios.d.ts +2 -1
- package/ui/animation/index.ios.js +3 -3
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +118 -67
- package/ui/animation/keyframe-animation.js +2 -2
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/component-builder/index.js +2 -2
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.js +3 -415
- package/ui/builder/index.js.map +1 -1
- package/ui/builder/xml2ui.d.ts +134 -0
- package/ui/builder/xml2ui.js +397 -0
- package/ui/builder/xml2ui.js.map +1 -0
- package/ui/button/index.android.js +1 -2
- package/ui/button/index.android.js.map +1 -1
- package/ui/core/bindable/index.d.ts +38 -2
- package/ui/core/bindable/index.js +2 -1
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/properties/index.d.ts +37 -4
- package/ui/core/properties/index.js +35 -6
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.d.ts +2 -2
- package/ui/core/view/index.android.js +10 -13
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +61 -1
- package/ui/core/view/index.ios.d.ts +3 -3
- package/ui/core/view/index.ios.js +13 -21
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +16 -19
- package/ui/core/view/view-common.js +14 -12
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.d.ts +1 -2
- package/ui/core/view/view-helper/index.ios.js +4 -3
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +3 -1
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.d.ts +25 -23
- package/ui/core/view-base/index.js +30 -9
- package/ui/core/view-base/index.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 +7 -8
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js +2 -2
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/embedding/index.android.d.ts +1 -1
- package/ui/embedding/index.d.ts +1 -1
- package/ui/frame/callbacks/activity-callbacks.d.ts +19 -0
- package/ui/frame/callbacks/activity-callbacks.js +301 -0
- package/ui/frame/callbacks/activity-callbacks.js.map +1 -0
- package/ui/frame/{frame-helper-for-android.d.ts → callbacks/fragment-callbacks.d.ts} +1 -20
- package/ui/frame/{frame-helper-for-android.js → callbacks/fragment-callbacks.js} +38 -52
- package/ui/frame/callbacks/fragment-callbacks.js.map +1 -0
- package/ui/frame/fragment.android.js +2 -3
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +2 -2
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-interfaces.d.ts +4 -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 +5 -20
- package/ui/frame/index.android.js +19 -296
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +19 -18
- package/ui/frame/index.ios.d.ts +1 -1
- package/ui/frame/index.ios.js +4 -5
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.d.ts +273 -4
- package/ui/gestures/gestures-common.js +146 -3
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/index.android.d.ts +1 -29
- package/ui/gestures/index.android.js +2 -4
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.d.ts +0 -35
- package/ui/gestures/index.ios.d.ts +1 -35
- package/ui/gestures/index.ios.js +3 -3
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.d.ts +1 -1
- package/ui/html-view/index.ios.js +3 -3
- package/ui/html-view/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 +1 -1
- package/ui/image/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +11 -5
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +5 -10
- package/ui/index.js +3 -11
- package/ui/index.js.map +1 -1
- 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 +1 -2
- 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.map +1 -1
- package/ui/layouts/layout-base.android.js +1 -2
- package/ui/layouts/layout-base.android.js.map +1 -1
- 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-view/index.android.js +1 -1
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +1 -1
- package/ui/list-view/index.ios.js +1 -1
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.js +1 -1
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.android.js +1 -2
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.d.ts +1 -1
- package/ui/page/index.ios.js +5 -4
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +2 -3
- package/ui/page/page-common.js +4 -5
- package/ui/page/page-common.js.map +1 -1
- package/ui/scroll-view/index.ios.js +3 -3
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/styling/background-common.js +1 -0
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.d.ts +6 -0
- package/ui/styling/background.android.js +53 -1
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +1 -2
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/converters.d.ts +2 -2
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-transform.d.ts +1 -1
- package/ui/styling/css-utils.js +1 -1
- 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/style/index.d.ts +1 -1
- package/ui/styling/style-properties.d.ts +113 -58
- package/ui/styling/style-properties.js +93 -7
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +48 -85
- package/ui/styling/style-scope.js +36 -30
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.ios.js +5 -5
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.js +6 -6
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/text-base/index.android.d.ts +1 -1
- package/ui/text-base/index.android.js +4 -4
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.d.ts +1 -1
- package/ui/text-base/index.ios.js +4 -5
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/transition/fade-transition.ios.js +1 -1
- 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 +1 -1
- 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 +4 -4
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +1 -1
- 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 +1 -2
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +2 -2
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/utils/{native-helper-for-android.d.ts → android/index.d.ts} +2 -4
- package/utils/android/index.js +160 -0
- package/utils/android/index.js.map +1 -0
- package/utils/common.d.ts +38 -1
- package/utils/common.js +111 -1
- package/utils/common.js.map +1 -1
- package/utils/debug.js +59 -1
- package/utils/debug.js.map +1 -1
- package/utils/index.android.d.ts +1 -3
- package/utils/index.android.js +11 -37
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +14 -2
- package/utils/index.ios.d.ts +1 -4
- package/utils/index.ios.js +5 -32
- package/utils/index.ios.js.map +1 -1
- package/utils/ios/index.d.ts +39 -0
- package/utils/ios/index.js +229 -0
- package/utils/ios/index.js.map +1 -0
- package/utils/layout-helper/index.android.js +4 -4
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.d.ts +4 -6
- package/utils/layout-helper/index.ios.js +5 -5
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.d.ts +9 -0
- package/utils/layout-helper/layout-helper-common.js +9 -1
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/native-helper.android.d.ts +5 -29
- package/utils/native-helper.android.js +131 -18
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.d.ts +258 -206
- package/utils/native-helper.ios.d.ts +3 -72
- package/utils/native-helper.ios.js +3 -250
- package/utils/native-helper.ios.js.map +1 -1
- package/xhr/index.js +13 -12
- package/xhr/index.js.map +1 -1
- package/xml/index.d.ts +98 -94
- package/xml/index.js +2 -58
- package/xml/index.js.map +1 -1
- package/accessibility/index.js +0 -2
- package/accessibility/index.js.map +0 -1
- package/application/helpers-common.d.ts +0 -50
- package/application/helpers-common.js +0 -153
- package/application/helpers-common.js.map +0 -1
- package/application/helpers.android.d.ts +0 -17
- package/application/helpers.android.js +0 -173
- package/application/helpers.android.js.map +0 -1
- package/application/helpers.d.ts +0 -25
- package/application/helpers.ios.d.ts +0 -27
- package/application/helpers.ios.js +0 -62
- package/application/helpers.ios.js.map +0 -1
- package/cli-hooks/postinstall.mjs +0 -7
- package/cli-hooks/preuninstall.mjs +0 -7
- package/color/color-types.d.ts +0 -49
- package/color/color-types.js +0 -3
- package/color/color-types.js.map +0 -1
- package/core-types/animation-types.d.ts +0 -11
- package/core-types/animation-types.js.map +0 -1
- package/core-types/validators.d.ts +0 -2
- package/core-types/validators.js +0 -18
- package/core-types/validators.js.map +0 -1
- package/css/lib/parse/index.d.ts +0 -1
- package/css/lib/parse/index.js.map +0 -1
- package/css/reworkcss.js.map +0 -1
- package/css-value/reworkcss-value.js.map +0 -1
- package/debugger/dom-types.d.ts +0 -24
- package/debugger/dom-types.js.map +0 -1
- package/fetch/index.d.ts +0 -72
- package/fetch/index.js.map +0 -1
- package/globals/global-utils.d.ts +0 -27
- package/globals/global-utils.js +0 -67
- package/globals/global-utils.js.map +0 -1
- package/http/http-interfaces.d.ts +0 -84
- package/http/http-interfaces.js +0 -6
- package/http/http-interfaces.js.map +0 -1
- package/http/http-shared.d.ts +0 -5
- package/http/http-shared.js +0 -14
- package/http/http-shared.js.map +0 -1
- package/module-name-resolver/helpers.d.ts +0 -14
- package/module-name-resolver/helpers.js +0 -27
- package/module-name-resolver/helpers.js.map +0 -1
- package/ui/animation/animation-shared.js +0 -4
- package/ui/animation/animation-shared.js.map +0 -1
- package/ui/animation/animation-types.d.ts +0 -1
- package/ui/animation/animation-types.js +0 -3
- package/ui/animation/animation-types.js.map +0 -1
- package/ui/core/bindable/bindable-types.d.ts +0 -37
- package/ui/core/bindable/bindable-types.js +0 -3
- package/ui/core/bindable/bindable-types.js.map +0 -1
- package/ui/core/properties/property-shared.d.ts +0 -35
- package/ui/core/properties/property-shared.js +0 -16
- package/ui/core/properties/property-shared.js.map +0 -1
- package/ui/core/view/view-helper/view-helper-shared.d.ts +0 -5
- package/ui/core/view/view-helper/view-helper-shared.js +0 -6
- package/ui/core/view/view-helper/view-helper-shared.js.map +0 -1
- package/ui/core/view/view-interfaces.d.ts +0 -54
- package/ui/core/view/view-interfaces.js +0 -2
- package/ui/core/view/view-interfaces.js.map +0 -1
- package/ui/core/view-base/utils.d.ts +0 -1
- package/ui/core/view-base/utils.js +0 -9
- package/ui/core/view-base/utils.js.map +0 -1
- package/ui/frame/frame-helper-for-android.js.map +0 -1
- package/ui/gestures/gestures-types.d.ts +0 -108
- package/ui/gestures/gestures-types.js +0 -40
- package/ui/gestures/gestures-types.js.map +0 -1
- package/ui/page/events.d.ts +0 -6
- package/ui/page/events.js +0 -7
- package/ui/page/events.js.map +0 -1
- package/ui/styling/length-shared.d.ts +0 -52
- package/ui/styling/length-shared.js +0 -173
- package/ui/styling/length-shared.js.map +0 -1
- package/ui/styling/styling-profile.d.ts +0 -1
- package/ui/styling/styling-profile.js +0 -4
- package/ui/styling/styling-profile.js.map +0 -1
- package/ui/styling/styling-shared.d.ts +0 -3
- package/ui/styling/styling-shared.js +0 -6
- package/ui/styling/styling-shared.js.map +0 -1
- package/utils/animation-helpers.d.ts +0 -27
- package/utils/animation-helpers.js +0 -48
- package/utils/animation-helpers.js.map +0 -1
- package/utils/debug-source.d.ts +0 -19
- package/utils/debug-source.js +0 -78
- package/utils/debug-source.js.map +0 -1
- package/utils/layout-helper/layout-helper-shared.d.ts +0 -9
- package/utils/layout-helper/layout-helper-shared.js +0 -13
- package/utils/layout-helper/layout-helper-shared.js.map +0 -1
- package/utils/native-helper-for-android.js +0 -273
- package/utils/native-helper-for-android.js.map +0 -1
- package/utils/shared.d.ts +0 -17
- package/utils/shared.js +0 -40
- package/utils/shared.js.map +0 -1
- package/utils/utils-shared.d.ts +0 -1
- package/utils/utils-shared.js +0 -8
- package/utils/utils-shared.js.map +0 -1
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { profile } from '../profiling';
|
|
2
2
|
import { isEmbedded } from '../ui/embedding';
|
|
3
3
|
import { IOSHelper } from '../ui/core/view/view-helper';
|
|
4
|
-
import
|
|
5
|
-
import { SDK_VERSION } from '../utils/constants';
|
|
6
|
-
import { ios as iosUtils } from '../utils/native-helper';
|
|
4
|
+
import * as Utils from '../utils';
|
|
7
5
|
import { ApplicationCommon } from './application-common';
|
|
8
|
-
import { Observable } from '../data/observable';
|
|
9
|
-
import { Trace } from '../trace';
|
|
10
|
-
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
|
-
import { iosAddNotificationObserver, iosRemoveNotificationObserver } from './helpers';
|
|
12
|
-
import { getiOSWindow, setA11yUpdatePropertiesCallback, setApplicationPropertiesCallback, setAppMainEntry, setiOSWindow, setRootView, setToggleApplicationEventListenersCallback } from './helpers-common';
|
|
13
6
|
var CADisplayLinkTarget = /** @class */ (function (_super) {
|
|
14
7
|
__extends(CADisplayLinkTarget, _super);
|
|
15
8
|
function CADisplayLinkTarget() {
|
|
@@ -40,6 +33,24 @@ var CADisplayLinkTarget = /** @class */ (function (_super) {
|
|
|
40
33
|
};
|
|
41
34
|
return CADisplayLinkTarget;
|
|
42
35
|
}(NSObject));
|
|
36
|
+
var NotificationObserver = /** @class */ (function (_super) {
|
|
37
|
+
__extends(NotificationObserver, _super);
|
|
38
|
+
function NotificationObserver() {
|
|
39
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
+
}
|
|
41
|
+
NotificationObserver.initWithCallback = function (onReceiveCallback) {
|
|
42
|
+
var observer = _super.new.call(this);
|
|
43
|
+
observer._onReceiveCallback = onReceiveCallback;
|
|
44
|
+
return observer;
|
|
45
|
+
};
|
|
46
|
+
NotificationObserver.prototype.onReceive = function (notification) {
|
|
47
|
+
this._onReceiveCallback(notification);
|
|
48
|
+
};
|
|
49
|
+
NotificationObserver.ObjCExposedMethods = {
|
|
50
|
+
onReceive: { returns: interop.types.void, params: [NSNotification] },
|
|
51
|
+
};
|
|
52
|
+
return NotificationObserver;
|
|
53
|
+
}(NSObject));
|
|
43
54
|
var Responder = /** @class */ (function (_super) {
|
|
44
55
|
__extends(Responder, _super);
|
|
45
56
|
function Responder() {
|
|
@@ -65,6 +76,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
65
76
|
constructor() {
|
|
66
77
|
super();
|
|
67
78
|
this._delegateHandlers = new Map();
|
|
79
|
+
this._notificationObservers = [];
|
|
68
80
|
this.displayedOnce = false;
|
|
69
81
|
this.addNotificationObserver(UIApplicationDidFinishLaunchingNotification, this.didFinishLaunchingWithOptions.bind(this));
|
|
70
82
|
this.addNotificationObserver(UIApplicationDidBecomeActiveNotification, this.didBecomeActive.bind(this));
|
|
@@ -81,7 +93,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
81
93
|
this.setWindowContent();
|
|
82
94
|
}
|
|
83
95
|
run(entry) {
|
|
84
|
-
|
|
96
|
+
this.mainEntry = typeof entry === 'string' ? { moduleName: entry } : entry;
|
|
85
97
|
this.started = true;
|
|
86
98
|
if (this.nativeApp) {
|
|
87
99
|
this.runAsEmbeddedApp();
|
|
@@ -100,9 +112,8 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
100
112
|
return;
|
|
101
113
|
}
|
|
102
114
|
this._rootView = rootView;
|
|
103
|
-
setRootView(rootView);
|
|
104
115
|
// Attach to the existing iOS app
|
|
105
|
-
const window = getWindow();
|
|
116
|
+
const window = Utils.ios.getWindow();
|
|
106
117
|
if (!window) {
|
|
107
118
|
return;
|
|
108
119
|
}
|
|
@@ -123,7 +134,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
123
134
|
embedderDelegate.presentNativeScriptApp(controller);
|
|
124
135
|
}
|
|
125
136
|
else {
|
|
126
|
-
const visibleVC =
|
|
137
|
+
const visibleVC = Utils.ios.getVisibleViewController(rootController);
|
|
127
138
|
visibleVC.presentViewControllerAnimatedCompletion(controller, true, null);
|
|
128
139
|
}
|
|
129
140
|
this.initRootView(rootView);
|
|
@@ -157,7 +168,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
157
168
|
const minFrameRateDisabled = NSBundle.mainBundle.objectForInfoDictionaryKey('CADisableMinimumFrameDurationOnPhone');
|
|
158
169
|
if (minFrameRateDisabled) {
|
|
159
170
|
let max = 120;
|
|
160
|
-
const deviceMaxFrames =
|
|
171
|
+
const deviceMaxFrames = Utils.ios.getMainScreen().maximumFramesPerSecond;
|
|
161
172
|
if (options?.max) {
|
|
162
173
|
if (deviceMaxFrames) {
|
|
163
174
|
// iOS 10.3
|
|
@@ -168,7 +179,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
168
179
|
max = options.max <= this.displayedLink.preferredFramesPerSecond ? options.max : this.displayedLink.preferredFramesPerSecond;
|
|
169
180
|
}
|
|
170
181
|
}
|
|
171
|
-
if (SDK_VERSION >= 15 || __VISIONOS__) {
|
|
182
|
+
if (Utils.SDK_VERSION >= 15 || __VISIONOS__) {
|
|
172
183
|
const min = options?.min || max / 2;
|
|
173
184
|
const preferred = options?.preferred || max;
|
|
174
185
|
this.displayedLink.preferredFrameRateRange = CAFrameRateRangeMake(min, max, preferred);
|
|
@@ -198,11 +209,11 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
198
209
|
// TODO: consideration
|
|
199
210
|
// may not want to cache this value given the potential of multiple scenes
|
|
200
211
|
// particularly with SwiftUI app lifecycle based apps
|
|
201
|
-
if (!
|
|
212
|
+
if (!this._window) {
|
|
202
213
|
// Note: NativeScriptViewFactory.getKeyWindow will always be used in SwiftUI app lifecycle based apps
|
|
203
|
-
|
|
214
|
+
this._window = Utils.ios.getWindow();
|
|
204
215
|
}
|
|
205
|
-
return
|
|
216
|
+
return this._window;
|
|
206
217
|
}
|
|
207
218
|
get delegate() {
|
|
208
219
|
return this._delegate;
|
|
@@ -246,14 +257,21 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
246
257
|
return this.nativeApp;
|
|
247
258
|
}
|
|
248
259
|
addNotificationObserver(notificationName, onReceiveCallback) {
|
|
249
|
-
|
|
260
|
+
const observer = NotificationObserver.initWithCallback(onReceiveCallback);
|
|
261
|
+
NSNotificationCenter.defaultCenter.addObserverSelectorNameObject(observer, 'onReceive', notificationName, null);
|
|
262
|
+
this._notificationObservers.push(observer);
|
|
263
|
+
return observer;
|
|
250
264
|
}
|
|
251
|
-
removeNotificationObserver(observer
|
|
252
|
-
|
|
265
|
+
removeNotificationObserver(observer, notificationName) {
|
|
266
|
+
const index = this._notificationObservers.indexOf(observer);
|
|
267
|
+
if (index >= 0) {
|
|
268
|
+
this._notificationObservers.splice(index, 1);
|
|
269
|
+
NSNotificationCenter.defaultCenter.removeObserverNameObject(observer, notificationName, null);
|
|
270
|
+
}
|
|
253
271
|
}
|
|
254
272
|
getSystemAppearance() {
|
|
255
273
|
// userInterfaceStyle is available on UITraitCollection since iOS 12.
|
|
256
|
-
if ((!__VISIONOS__ && SDK_VERSION <= 11) || !this.rootController) {
|
|
274
|
+
if ((!__VISIONOS__ && Utils.SDK_VERSION <= 11) || !this.rootController) {
|
|
257
275
|
return null;
|
|
258
276
|
}
|
|
259
277
|
const userInterfaceStyle = this.rootController.traitCollection.userInterfaceStyle;
|
|
@@ -294,13 +312,13 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
294
312
|
const root = this.notifyLaunch({
|
|
295
313
|
ios: notification?.userInfo?.objectForKey('UIApplicationLaunchOptionsLocalNotificationKey') ?? null,
|
|
296
314
|
});
|
|
297
|
-
if (
|
|
315
|
+
if (this._window) {
|
|
298
316
|
if (root !== null && !isEmbedded()) {
|
|
299
317
|
this.setWindowContent(root);
|
|
300
318
|
}
|
|
301
319
|
}
|
|
302
320
|
else {
|
|
303
|
-
|
|
321
|
+
this._window = this.window; // UIApplication.sharedApplication.keyWindow;
|
|
304
322
|
}
|
|
305
323
|
}
|
|
306
324
|
_onLivesync(context) {
|
|
@@ -324,7 +342,6 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
324
342
|
const rootView = this.createRootView(view);
|
|
325
343
|
const controller = this.getViewController(rootView);
|
|
326
344
|
this._rootView = rootView;
|
|
327
|
-
setRootView(rootView);
|
|
328
345
|
// setup view as styleScopeHost
|
|
329
346
|
rootView._setupAsRootView({});
|
|
330
347
|
this.setViewControllerView(rootView);
|
|
@@ -345,13 +362,13 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
345
362
|
didFinishLaunchingWithOptions(notification) {
|
|
346
363
|
this.setMaxRefreshRate();
|
|
347
364
|
// ensures window is assigned to proper window scene
|
|
348
|
-
|
|
349
|
-
if (!
|
|
365
|
+
this._window = this.window;
|
|
366
|
+
if (!this._window) {
|
|
350
367
|
// if still no window, create one
|
|
351
|
-
|
|
368
|
+
this._window = UIWindow.alloc().initWithFrame(UIScreen.mainScreen.bounds);
|
|
352
369
|
}
|
|
353
370
|
if (!__VISIONOS__) {
|
|
354
|
-
this.window.backgroundColor = SDK_VERSION <= 12 || !UIColor.systemBackgroundColor ? UIColor.whiteColor : UIColor.systemBackgroundColor;
|
|
371
|
+
this.window.backgroundColor = Utils.SDK_VERSION <= 12 || !UIColor.systemBackgroundColor ? UIColor.whiteColor : UIColor.systemBackgroundColor;
|
|
355
372
|
}
|
|
356
373
|
this.notifyAppStarted(notification);
|
|
357
374
|
}
|
|
@@ -425,431 +442,4 @@ global.__onLiveSyncCore = function (context) {
|
|
|
425
442
|
export * from './application-common';
|
|
426
443
|
export const Application = iosApp;
|
|
427
444
|
export const AndroidApplication = undefined;
|
|
428
|
-
function fontScaleChanged(origFontScale) {
|
|
429
|
-
const oldValue = getFontScale();
|
|
430
|
-
setFontScale(getClosestValidFontScale(origFontScale));
|
|
431
|
-
const currentFontScale = getFontScale();
|
|
432
|
-
if (oldValue !== currentFontScale) {
|
|
433
|
-
Application.notify({
|
|
434
|
-
eventName: Application.fontScaleChangedEvent,
|
|
435
|
-
object: Application,
|
|
436
|
-
newValue: currentFontScale,
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
export function getCurrentFontScale() {
|
|
441
|
-
setupConfigListener();
|
|
442
|
-
return getFontScale();
|
|
443
|
-
}
|
|
444
|
-
const sizeMap = new Map([
|
|
445
|
-
[UIContentSizeCategoryExtraSmall, 0.5],
|
|
446
|
-
[UIContentSizeCategorySmall, 0.7],
|
|
447
|
-
[UIContentSizeCategoryMedium, 0.85],
|
|
448
|
-
[UIContentSizeCategoryLarge, 1],
|
|
449
|
-
[UIContentSizeCategoryExtraLarge, 1.15],
|
|
450
|
-
[UIContentSizeCategoryExtraExtraLarge, 1.3],
|
|
451
|
-
[UIContentSizeCategoryExtraExtraExtraLarge, 1.5],
|
|
452
|
-
[UIContentSizeCategoryAccessibilityMedium, 2],
|
|
453
|
-
[UIContentSizeCategoryAccessibilityLarge, 2.5],
|
|
454
|
-
[UIContentSizeCategoryAccessibilityExtraLarge, 3],
|
|
455
|
-
[UIContentSizeCategoryAccessibilityExtraExtraLarge, 3.5],
|
|
456
|
-
[UIContentSizeCategoryAccessibilityExtraExtraExtraLarge, 4],
|
|
457
|
-
]);
|
|
458
|
-
function contentSizeUpdated(fontSize) {
|
|
459
|
-
if (sizeMap.has(fontSize)) {
|
|
460
|
-
fontScaleChanged(sizeMap.get(fontSize));
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
fontScaleChanged(1);
|
|
464
|
-
}
|
|
465
|
-
function useIOSFontScale() {
|
|
466
|
-
if (Application.ios.nativeApp) {
|
|
467
|
-
contentSizeUpdated(Application.ios.nativeApp.preferredContentSizeCategory);
|
|
468
|
-
}
|
|
469
|
-
else {
|
|
470
|
-
fontScaleChanged(1);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
let fontSizeObserver;
|
|
474
|
-
function setupConfigListener(attempt = 0) {
|
|
475
|
-
if (fontSizeObserver) {
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
if (!Application.ios.nativeApp) {
|
|
479
|
-
if (attempt > 100) {
|
|
480
|
-
fontScaleChanged(1);
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
// Couldn't get launchEvent to trigger.
|
|
484
|
-
setTimeout(() => setupConfigListener(attempt + 1), 1);
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
fontSizeObserver = Application.ios.addNotificationObserver(UIContentSizeCategoryDidChangeNotification, (args) => {
|
|
488
|
-
const fontSize = args.userInfo.valueForKey(UIContentSizeCategoryNewValueKey);
|
|
489
|
-
contentSizeUpdated(fontSize);
|
|
490
|
-
});
|
|
491
|
-
Application.on(Application.exitEvent, () => {
|
|
492
|
-
if (fontSizeObserver) {
|
|
493
|
-
Application.ios.removeNotificationObserver(fontSizeObserver, UIContentSizeCategoryDidChangeNotification);
|
|
494
|
-
fontSizeObserver = null;
|
|
495
|
-
}
|
|
496
|
-
Application.off(Application.resumeEvent, useIOSFontScale);
|
|
497
|
-
});
|
|
498
|
-
Application.on(Application.resumeEvent, useIOSFontScale);
|
|
499
|
-
useIOSFontScale();
|
|
500
|
-
}
|
|
501
|
-
setInitFontScale(setupConfigListener);
|
|
502
|
-
/**
|
|
503
|
-
* Convert array of values into a bitmask.
|
|
504
|
-
*
|
|
505
|
-
* @param values string values
|
|
506
|
-
* @param map map lower-case name to integer value.
|
|
507
|
-
*/
|
|
508
|
-
function inputArrayToBitMask(values, map) {
|
|
509
|
-
return (enforceArray(values)
|
|
510
|
-
.filter((value) => !!value)
|
|
511
|
-
.map((value) => `${value}`.toLocaleLowerCase())
|
|
512
|
-
.filter((value) => map.has(value))
|
|
513
|
-
.reduce((res, value) => res | map.get(value), 0) || 0);
|
|
514
|
-
}
|
|
515
|
-
let AccessibilityTraitsMap;
|
|
516
|
-
let RoleTypeMap;
|
|
517
|
-
let nativeFocusedNotificationObserver;
|
|
518
|
-
let lastFocusedView;
|
|
519
|
-
function ensureNativeClasses() {
|
|
520
|
-
if (AccessibilityTraitsMap && nativeFocusedNotificationObserver) {
|
|
521
|
-
return;
|
|
522
|
-
}
|
|
523
|
-
AccessibilityTraitsMap = new Map([
|
|
524
|
-
[AccessibilityTrait.AllowsDirectInteraction, UIAccessibilityTraitAllowsDirectInteraction],
|
|
525
|
-
[AccessibilityTrait.CausesPageTurn, UIAccessibilityTraitCausesPageTurn],
|
|
526
|
-
[AccessibilityTrait.NotEnabled, UIAccessibilityTraitNotEnabled],
|
|
527
|
-
[AccessibilityTrait.Selected, UIAccessibilityTraitSelected],
|
|
528
|
-
[AccessibilityTrait.UpdatesFrequently, UIAccessibilityTraitUpdatesFrequently],
|
|
529
|
-
]);
|
|
530
|
-
RoleTypeMap = new Map([
|
|
531
|
-
[AccessibilityRole.Adjustable, UIAccessibilityTraitAdjustable],
|
|
532
|
-
[AccessibilityRole.Button, UIAccessibilityTraitButton],
|
|
533
|
-
[AccessibilityRole.Checkbox, UIAccessibilityTraitButton],
|
|
534
|
-
[AccessibilityRole.Header, UIAccessibilityTraitHeader],
|
|
535
|
-
[AccessibilityRole.KeyboardKey, UIAccessibilityTraitKeyboardKey],
|
|
536
|
-
[AccessibilityRole.Image, UIAccessibilityTraitImage],
|
|
537
|
-
[AccessibilityRole.ImageButton, UIAccessibilityTraitImage | UIAccessibilityTraitButton],
|
|
538
|
-
[AccessibilityRole.Link, UIAccessibilityTraitLink],
|
|
539
|
-
[AccessibilityRole.None, UIAccessibilityTraitNone],
|
|
540
|
-
[AccessibilityRole.PlaysSound, UIAccessibilityTraitPlaysSound],
|
|
541
|
-
[AccessibilityRole.RadioButton, UIAccessibilityTraitButton],
|
|
542
|
-
[AccessibilityRole.Search, UIAccessibilityTraitSearchField],
|
|
543
|
-
[AccessibilityRole.StaticText, UIAccessibilityTraitStaticText],
|
|
544
|
-
[AccessibilityRole.StartsMediaSession, UIAccessibilityTraitStartsMediaSession],
|
|
545
|
-
[AccessibilityRole.Summary, UIAccessibilityTraitSummaryElement],
|
|
546
|
-
[AccessibilityRole.Switch, UIAccessibilityTraitButton],
|
|
547
|
-
]);
|
|
548
|
-
nativeFocusedNotificationObserver = Application.ios.addNotificationObserver(UIAccessibilityElementFocusedNotification, (args) => {
|
|
549
|
-
const uiView = args.userInfo?.objectForKey(UIAccessibilityFocusedElementKey);
|
|
550
|
-
if (!uiView?.tag) {
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
const rootView = Application.getRootView();
|
|
554
|
-
// We use the UIView's tag to find the NativeScript View by its domId.
|
|
555
|
-
let view = rootView.getViewByDomId(uiView?.tag);
|
|
556
|
-
if (!view) {
|
|
557
|
-
for (const modalView of rootView._getRootModalViews()) {
|
|
558
|
-
view = modalView.getViewByDomId(uiView?.tag);
|
|
559
|
-
if (view) {
|
|
560
|
-
break;
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
if (!view) {
|
|
565
|
-
return;
|
|
566
|
-
}
|
|
567
|
-
const lastView = lastFocusedView?.deref();
|
|
568
|
-
if (lastView && view !== lastView) {
|
|
569
|
-
const lastFocusedUIView = lastView.nativeViewProtected;
|
|
570
|
-
if (lastFocusedUIView) {
|
|
571
|
-
lastFocusedView = null;
|
|
572
|
-
notifyAccessibilityFocusState(lastView, false, true);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
lastFocusedView = new WeakRef(view);
|
|
576
|
-
notifyAccessibilityFocusState(view, true, false);
|
|
577
|
-
});
|
|
578
|
-
Application.on(Application.exitEvent, () => {
|
|
579
|
-
if (nativeFocusedNotificationObserver) {
|
|
580
|
-
Application.ios.removeNotificationObserver(nativeFocusedNotificationObserver, UIAccessibilityElementFocusedNotification);
|
|
581
|
-
}
|
|
582
|
-
nativeFocusedNotificationObserver = null;
|
|
583
|
-
lastFocusedView = null;
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
export function updateAccessibilityProperties(view) {
|
|
587
|
-
const uiView = view.nativeViewProtected;
|
|
588
|
-
if (!uiView) {
|
|
589
|
-
return;
|
|
590
|
-
}
|
|
591
|
-
ensureNativeClasses();
|
|
592
|
-
const accessibilityRole = view.accessibilityRole;
|
|
593
|
-
const accessibilityState = view.accessibilityState;
|
|
594
|
-
if (!view.accessible || view.accessibilityHidden) {
|
|
595
|
-
uiView.accessibilityTraits = UIAccessibilityTraitNone;
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
// NOTE: left here for various core inspection passes while running the toolbox app
|
|
599
|
-
// console.log('--- Accessible element: ', view.constructor.name);
|
|
600
|
-
// console.log('accessibilityLabel: ', view.accessibilityLabel);
|
|
601
|
-
// console.log('accessibilityRole: ', accessibilityRole);
|
|
602
|
-
// console.log('accessibilityState: ', accessibilityState);
|
|
603
|
-
// console.log('accessibilityValue: ', view.accessibilityValue);
|
|
604
|
-
let a11yTraits = UIAccessibilityTraitNone;
|
|
605
|
-
if (RoleTypeMap.has(accessibilityRole)) {
|
|
606
|
-
a11yTraits |= RoleTypeMap.get(accessibilityRole);
|
|
607
|
-
}
|
|
608
|
-
switch (accessibilityRole) {
|
|
609
|
-
case AccessibilityRole.Checkbox:
|
|
610
|
-
case AccessibilityRole.RadioButton:
|
|
611
|
-
case AccessibilityRole.Switch: {
|
|
612
|
-
if (accessibilityState === AccessibilityState.Checked) {
|
|
613
|
-
a11yTraits |= AccessibilityTraitsMap.get(AccessibilityTrait.Selected);
|
|
614
|
-
}
|
|
615
|
-
break;
|
|
616
|
-
}
|
|
617
|
-
default: {
|
|
618
|
-
if (accessibilityState === AccessibilityState.Selected) {
|
|
619
|
-
a11yTraits |= AccessibilityTraitsMap.get(AccessibilityTrait.Selected);
|
|
620
|
-
}
|
|
621
|
-
if (accessibilityState === AccessibilityState.Disabled) {
|
|
622
|
-
a11yTraits |= AccessibilityTraitsMap.get(AccessibilityTrait.NotEnabled);
|
|
623
|
-
}
|
|
624
|
-
break;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
const UpdatesFrequentlyTrait = AccessibilityTraitsMap.get(AccessibilityTrait.UpdatesFrequently);
|
|
628
|
-
switch (view.accessibilityLiveRegion) {
|
|
629
|
-
case AccessibilityLiveRegion.Polite:
|
|
630
|
-
case AccessibilityLiveRegion.Assertive: {
|
|
631
|
-
a11yTraits |= UpdatesFrequentlyTrait;
|
|
632
|
-
break;
|
|
633
|
-
}
|
|
634
|
-
default: {
|
|
635
|
-
a11yTraits &= ~UpdatesFrequentlyTrait;
|
|
636
|
-
break;
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
// NOTE: left here for various core inspection passes while running the toolbox app
|
|
640
|
-
// if (view.accessibilityLiveRegion) {
|
|
641
|
-
// console.log('accessibilityLiveRegion:', view.accessibilityLiveRegion);
|
|
642
|
-
// }
|
|
643
|
-
if (view.accessibilityMediaSession) {
|
|
644
|
-
a11yTraits |= RoleTypeMap.get(AccessibilityRole.StartsMediaSession);
|
|
645
|
-
}
|
|
646
|
-
// NOTE: There were duplicated types in traits and roles previously which we conslidated
|
|
647
|
-
// not sure if this is still needed
|
|
648
|
-
// accessibilityTraits used to be stored on {N} view component but if the above
|
|
649
|
-
// is combining all traits fresh each time through, don't believe we need to keep track or previous traits
|
|
650
|
-
// if (view.accessibilityTraits) {
|
|
651
|
-
// a11yTraits |= inputArrayToBitMask(view.accessibilityTraits, AccessibilityTraitsMap);
|
|
652
|
-
// }
|
|
653
|
-
// NOTE: left here for various core inspection passes while running the toolbox app
|
|
654
|
-
// console.log('a11yTraits:', a11yTraits);
|
|
655
|
-
// console.log(' ');
|
|
656
|
-
uiView.accessibilityTraits = a11yTraits;
|
|
657
|
-
}
|
|
658
|
-
setA11yUpdatePropertiesCallback(updateAccessibilityProperties);
|
|
659
|
-
export const sendAccessibilityEvent = () => { };
|
|
660
|
-
export function isAccessibilityServiceEnabled() {
|
|
661
|
-
const accessibilityServiceEnabled = isA11yEnabled();
|
|
662
|
-
if (typeof accessibilityServiceEnabled === 'boolean') {
|
|
663
|
-
return accessibilityServiceEnabled;
|
|
664
|
-
}
|
|
665
|
-
let isVoiceOverRunning;
|
|
666
|
-
if (typeof UIAccessibilityIsVoiceOverRunning === 'function') {
|
|
667
|
-
isVoiceOverRunning = UIAccessibilityIsVoiceOverRunning;
|
|
668
|
-
}
|
|
669
|
-
else {
|
|
670
|
-
// iOS is too old to tell us if voice over is enabled
|
|
671
|
-
if (typeof UIAccessibilityIsVoiceOverRunning !== 'function') {
|
|
672
|
-
setA11yEnabled(false);
|
|
673
|
-
return isA11yEnabled();
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
setA11yEnabled(isVoiceOverRunning());
|
|
677
|
-
let voiceOverStatusChangedNotificationName = null;
|
|
678
|
-
if (typeof UIAccessibilityVoiceOverStatusDidChangeNotification !== 'undefined') {
|
|
679
|
-
voiceOverStatusChangedNotificationName = UIAccessibilityVoiceOverStatusDidChangeNotification;
|
|
680
|
-
}
|
|
681
|
-
else if (typeof UIAccessibilityVoiceOverStatusChanged !== 'undefined') {
|
|
682
|
-
voiceOverStatusChangedNotificationName = UIAccessibilityVoiceOverStatusChanged;
|
|
683
|
-
}
|
|
684
|
-
if (voiceOverStatusChangedNotificationName) {
|
|
685
|
-
nativeObserver = Application.ios.addNotificationObserver(voiceOverStatusChangedNotificationName, () => {
|
|
686
|
-
setA11yEnabled(isVoiceOverRunning());
|
|
687
|
-
});
|
|
688
|
-
Application.on(Application.exitEvent, () => {
|
|
689
|
-
if (nativeObserver) {
|
|
690
|
-
Application.ios.removeNotificationObserver(nativeObserver, voiceOverStatusChangedNotificationName);
|
|
691
|
-
}
|
|
692
|
-
setA11yEnabled(undefined);
|
|
693
|
-
nativeObserver = null;
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
Application.on(Application.resumeEvent, () => {
|
|
697
|
-
setA11yEnabled(isVoiceOverRunning());
|
|
698
|
-
});
|
|
699
|
-
return isA11yEnabled();
|
|
700
|
-
}
|
|
701
|
-
export function getAndroidAccessibilityManager() {
|
|
702
|
-
return null;
|
|
703
|
-
}
|
|
704
|
-
let sharedA11YObservable;
|
|
705
|
-
let nativeObserver;
|
|
706
|
-
function getSharedA11YObservable() {
|
|
707
|
-
if (sharedA11YObservable) {
|
|
708
|
-
return sharedA11YObservable;
|
|
709
|
-
}
|
|
710
|
-
sharedA11YObservable = new SharedA11YObservable();
|
|
711
|
-
let isVoiceOverRunning;
|
|
712
|
-
if (typeof UIAccessibilityIsVoiceOverRunning === 'function') {
|
|
713
|
-
isVoiceOverRunning = UIAccessibilityIsVoiceOverRunning;
|
|
714
|
-
}
|
|
715
|
-
else {
|
|
716
|
-
if (typeof UIAccessibilityIsVoiceOverRunning !== 'function') {
|
|
717
|
-
Trace.write(`UIAccessibilityIsVoiceOverRunning() - is not a function`, Trace.categories.Accessibility, Trace.messageType.error);
|
|
718
|
-
isVoiceOverRunning = () => false;
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
sharedA11YObservable.set(AccessibilityServiceEnabledPropName, isVoiceOverRunning());
|
|
722
|
-
let voiceOverStatusChangedNotificationName = null;
|
|
723
|
-
if (typeof UIAccessibilityVoiceOverStatusDidChangeNotification !== 'undefined') {
|
|
724
|
-
// iOS 11+
|
|
725
|
-
voiceOverStatusChangedNotificationName = UIAccessibilityVoiceOverStatusDidChangeNotification;
|
|
726
|
-
}
|
|
727
|
-
else if (typeof UIAccessibilityVoiceOverStatusChanged !== 'undefined') {
|
|
728
|
-
// iOS <11
|
|
729
|
-
voiceOverStatusChangedNotificationName = UIAccessibilityVoiceOverStatusChanged;
|
|
730
|
-
}
|
|
731
|
-
if (voiceOverStatusChangedNotificationName) {
|
|
732
|
-
nativeObserver = Application.ios.addNotificationObserver(voiceOverStatusChangedNotificationName, () => {
|
|
733
|
-
sharedA11YObservable?.set(AccessibilityServiceEnabledPropName, isVoiceOverRunning());
|
|
734
|
-
});
|
|
735
|
-
Application.on(Application.exitEvent, () => {
|
|
736
|
-
if (nativeObserver) {
|
|
737
|
-
Application.ios.removeNotificationObserver(nativeObserver, voiceOverStatusChangedNotificationName);
|
|
738
|
-
}
|
|
739
|
-
nativeObserver = null;
|
|
740
|
-
if (sharedA11YObservable) {
|
|
741
|
-
sharedA11YObservable.removeEventListener(Observable.propertyChangeEvent);
|
|
742
|
-
sharedA11YObservable = null;
|
|
743
|
-
}
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
Application.on(Application.resumeEvent, () => sharedA11YObservable.set(AccessibilityServiceEnabledPropName, isVoiceOverRunning()));
|
|
747
|
-
return sharedA11YObservable;
|
|
748
|
-
}
|
|
749
|
-
export class AccessibilityServiceEnabledObservable extends CommonA11YServiceEnabledObservable {
|
|
750
|
-
constructor() {
|
|
751
|
-
super(getSharedA11YObservable());
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
let accessibilityServiceObservable;
|
|
755
|
-
export function ensureClasses() {
|
|
756
|
-
if (accessibilityServiceObservable) {
|
|
757
|
-
return;
|
|
758
|
-
}
|
|
759
|
-
setFontScaleCssClasses(new Map(VALID_FONT_SCALES.map((fs) => [fs, `a11y-fontscale-${Number(fs * 100).toFixed(0)}`])));
|
|
760
|
-
accessibilityServiceObservable = new AccessibilityServiceEnabledObservable();
|
|
761
|
-
}
|
|
762
|
-
export function updateCurrentHelperClasses(applyRootCssClass) {
|
|
763
|
-
const fontScale = getFontScale();
|
|
764
|
-
const fontScaleCategory = getFontScaleCategory();
|
|
765
|
-
const fontScaleCssClasses = getFontScaleCssClasses();
|
|
766
|
-
const oldFontScaleClass = getCurrentFontScaleClass();
|
|
767
|
-
if (fontScaleCssClasses.has(fontScale)) {
|
|
768
|
-
setCurrentFontScaleClass(fontScaleCssClasses.get(fontScale));
|
|
769
|
-
}
|
|
770
|
-
else {
|
|
771
|
-
setCurrentFontScaleClass(fontScaleCssClasses.get(1));
|
|
772
|
-
}
|
|
773
|
-
if (oldFontScaleClass !== getCurrentFontScaleClass()) {
|
|
774
|
-
applyRootCssClass([...fontScaleCssClasses.values()], getCurrentFontScaleClass());
|
|
775
|
-
}
|
|
776
|
-
const oldActiveFontScaleCategory = getCurrentFontScaleCategory();
|
|
777
|
-
switch (fontScaleCategory) {
|
|
778
|
-
case FontScaleCategory.ExtraSmall: {
|
|
779
|
-
setCurrentFontScaleCategory(fontScaleExtraSmallCategoryClass);
|
|
780
|
-
break;
|
|
781
|
-
}
|
|
782
|
-
case FontScaleCategory.Medium: {
|
|
783
|
-
setCurrentFontScaleCategory(fontScaleMediumCategoryClass);
|
|
784
|
-
break;
|
|
785
|
-
}
|
|
786
|
-
case FontScaleCategory.ExtraLarge: {
|
|
787
|
-
setCurrentFontScaleCategory(fontScaleExtraLargeCategoryClass);
|
|
788
|
-
break;
|
|
789
|
-
}
|
|
790
|
-
default: {
|
|
791
|
-
setCurrentFontScaleCategory(fontScaleMediumCategoryClass);
|
|
792
|
-
break;
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
if (oldActiveFontScaleCategory !== getCurrentFontScaleCategory()) {
|
|
796
|
-
applyRootCssClass(fontScaleCategoryClasses, getCurrentFontScaleCategory());
|
|
797
|
-
}
|
|
798
|
-
const oldA11YStatusClass = getCurrentA11YServiceClass();
|
|
799
|
-
if (accessibilityServiceObservable.accessibilityServiceEnabled) {
|
|
800
|
-
setCurrentA11YServiceClass(a11yServiceEnabledClass);
|
|
801
|
-
}
|
|
802
|
-
else {
|
|
803
|
-
setCurrentA11YServiceClass(a11yServiceDisabledClass);
|
|
804
|
-
}
|
|
805
|
-
if (oldA11YStatusClass !== getCurrentA11YServiceClass()) {
|
|
806
|
-
applyRootCssClass(a11yServiceClasses, getCurrentA11YServiceClass());
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
function applyRootCssClass(cssClasses, newCssClass) {
|
|
810
|
-
const rootView = Application.getRootView();
|
|
811
|
-
if (!rootView) {
|
|
812
|
-
return;
|
|
813
|
-
}
|
|
814
|
-
Application.applyCssClass(rootView, cssClasses, newCssClass);
|
|
815
|
-
const rootModalViews = rootView._getRootModalViews();
|
|
816
|
-
rootModalViews.forEach((rootModalView) => Application.applyCssClass(rootModalView, cssClasses, newCssClass));
|
|
817
|
-
}
|
|
818
|
-
function applyFontScaleToRootViews() {
|
|
819
|
-
const rootView = Application.getRootView();
|
|
820
|
-
if (!rootView) {
|
|
821
|
-
return;
|
|
822
|
-
}
|
|
823
|
-
const fontScale = getCurrentFontScale();
|
|
824
|
-
rootView.style.fontScaleInternal = fontScale;
|
|
825
|
-
const rootModalViews = rootView._getRootModalViews();
|
|
826
|
-
rootModalViews.forEach((rootModalView) => (rootModalView.style.fontScaleInternal = fontScale));
|
|
827
|
-
}
|
|
828
|
-
export function initAccessibilityCssHelper() {
|
|
829
|
-
ensureClasses();
|
|
830
|
-
Application.on(Application.fontScaleChangedEvent, () => {
|
|
831
|
-
updateCurrentHelperClasses(applyRootCssClass);
|
|
832
|
-
applyFontScaleToRootViews();
|
|
833
|
-
});
|
|
834
|
-
accessibilityServiceObservable.on(AccessibilityServiceEnabledObservable.propertyChangeEvent, () => updateCurrentHelperClasses(applyRootCssClass));
|
|
835
|
-
}
|
|
836
|
-
setInitAccessibilityCssHelper(initAccessibilityCssHelper);
|
|
837
|
-
const applicationEvents = [Application.orientationChangedEvent, Application.systemAppearanceChangedEvent];
|
|
838
|
-
function toggleApplicationEventListeners(toAdd, callback) {
|
|
839
|
-
for (const eventName of applicationEvents) {
|
|
840
|
-
if (toAdd) {
|
|
841
|
-
Application.on(eventName, callback);
|
|
842
|
-
}
|
|
843
|
-
else {
|
|
844
|
-
Application.off(eventName, callback);
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
setToggleApplicationEventListenersCallback(toggleApplicationEventListeners);
|
|
849
|
-
setApplicationPropertiesCallback(() => {
|
|
850
|
-
return {
|
|
851
|
-
orientation: Application.orientation(),
|
|
852
|
-
systemAppearance: Application.systemAppearance(),
|
|
853
|
-
};
|
|
854
|
-
});
|
|
855
445
|
//# sourceMappingURL=application.ios.js.map
|