@nativescript/core 9.0.0-next-07-26-2025-16544379102 → 9.0.0-preview.1
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 +264 -0
- package/accessibility/accessibility-common.js +352 -0
- package/accessibility/accessibility-common.js.map +1 -1
- 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/index.d.ts +0 -36
- package/accessibility/index.js +2 -0
- package/accessibility/index.js.map +1 -0
- package/application/application-common.d.ts +6 -8
- package/application/application-common.js +21 -14
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +2 -3
- package/application/application.android.d.ts +14 -7
- package/application/application.android.js +754 -75
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +25 -0
- package/application/application.ios.d.ts +16 -18
- package/application/application.ios.js +455 -45
- 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 +17 -0
- package/application/helpers.android.js +173 -0
- package/application/helpers.android.js.map +1 -0
- package/application/helpers.d.ts +25 -0
- package/application/helpers.ios.d.ts +27 -0
- package/application/helpers.ios.js +62 -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/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/connectivity/index.android.js +5 -4
- package/connectivity/index.android.js.map +1 -1
- package/core-types/animation-types.d.ts +11 -0
- package/{ui/animation/animation-interfaces.js → core-types/animation-types.js} +1 -1
- package/core-types/animation-types.js.map +1 -0
- package/core-types/index.d.ts +1 -1
- package/core-types/index.js +2 -2
- package/core-types/index.js.map +1 -1
- package/core-types/validators.d.ts +2 -0
- package/core-types/validators.js +18 -0
- package/core-types/validators.js.map +1 -0
- package/css/css-tree-parser.js +17 -21
- 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/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 +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.d.ts +72 -0
- package/fetch/index.js +448 -458
- package/fetch/index.js.map +1 -0
- package/file-system/file-system-access.android.js +32 -39
- 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.d.ts +2 -2
- package/file-system/index.js +4 -11
- 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.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 +276 -281
- package/globals/index.js.map +1 -1
- package/http/http-interfaces.d.ts +84 -0
- package/http/http-interfaces.js +6 -0
- package/http/http-interfaces.js.map +1 -0
- 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 +3 -7
- package/http/http-request/index.android.js +6 -22
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.d.ts +5 -1
- package/http/http-request/index.ios.d.ts +3 -7
- package/http/http-request/index.ios.js +6 -22
- package/http/http-request/index.ios.js.map +1 -1
- package/http/http-shared.d.ts +5 -0
- package/http/http-shared.js +14 -0
- package/http/http-shared.js.map +1 -0
- package/http/index.d.ts +6 -105
- package/http/index.js +10 -12
- 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 +5 -23
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js +2 -9
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +12 -8
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/inspector_modules.d.ts +11 -0
- package/inspector_modules.js +111 -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 +5 -2
- 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 +2 -1
- package/profiling/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js +4 -2
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +7 -6
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +10 -11
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/index.ios.js +3 -4
- 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 +2 -3
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/{animation-interfaces.d.ts → animation-shared.d.ts} +39 -31
- 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 +2 -138
- package/ui/animation/index.ios.d.ts +1 -2
- package/ui/animation/index.ios.js +3 -3
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +67 -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 +450 -10
- package/ui/builder/index.js.map +1 -1
- package/ui/button/index.android.js +2 -1
- package/ui/button/index.android.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/properties/index.d.ts +4 -37
- package/ui/core/properties/index.js +6 -35
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/properties/property-shared.d.ts +35 -0
- package/ui/core/properties/property-shared.js +16 -0
- package/ui/core/properties/property-shared.js.map +1 -0
- package/ui/core/view/index.android.d.ts +2 -2
- package/ui/core/view/index.android.js +13 -10
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +1 -61
- package/ui/core/view/index.ios.d.ts +3 -3
- package/ui/core/view/index.ios.js +11 -11
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +19 -16
- package/ui/core/view/view-common.js +12 -14
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.d.ts +2 -1
- package/ui/core/view/view-helper/index.ios.js +3 -4
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +1 -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.d.ts +22 -24
- package/ui/core/view-base/index.js +9 -30
- 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/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 +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/fragment.android.js +3 -2
- 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 +3 -3
- 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} +52 -38
- package/ui/frame/frame-helper-for-android.js.map +1 -0
- package/ui/frame/frame-interfaces.d.ts +30 -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 +21 -5
- package/ui/frame/index.android.js +296 -19
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +19 -60
- package/ui/frame/index.ios.d.ts +3 -2
- package/ui/frame/index.ios.js +5 -4
- 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 +108 -0
- package/ui/gestures/gestures-types.js +40 -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 +4 -2
- 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 +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 +5 -11
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +10 -5
- package/ui/index.js +18 -3
- 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 +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.map +1 -1
- package/ui/layouts/layout-base.android.js +2 -1
- 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.d.ts +17 -1
- package/ui/list-view/index.android.js +402 -32
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +66 -1
- package/ui/list-view/index.ios.d.ts +24 -2
- package/ui/list-view/index.ios.js +385 -10
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.d.ts +15 -0
- package/ui/list-view/list-view-common.js +73 -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.js +2 -1
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.d.ts +1 -1
- package/ui/page/index.ios.js +4 -5
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +3 -2
- package/ui/page/page-common.js +5 -4
- 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 +0 -1
- 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.ios.js +2 -1
- 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/length-shared.d.ts +52 -0
- package/ui/styling/length-shared.js +173 -0
- package/ui/styling/length-shared.js.map +1 -0
- package/ui/styling/style/index.d.ts +1 -1
- package/ui/styling/style-properties.d.ts +58 -112
- package/ui/styling/style-properties.js +7 -93
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +85 -48
- package/ui/styling/style-scope.js +30 -36
- 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.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 +5 -4
- 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 +2 -1
- 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/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 +1 -38
- package/utils/common.js +2 -112
- package/utils/common.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 +2 -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.js +4 -4
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.d.ts +6 -4
- 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 +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} +4 -2
- package/utils/native-helper-for-android.js +273 -0
- 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 +17 -0
- package/utils/shared.js +40 -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.js +12 -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/accessibility/accessibility-css-helper.d.ts +0 -1
- package/accessibility/accessibility-css-helper.js +0 -101
- package/accessibility/accessibility-css-helper.js.map +0 -1
- package/accessibility/accessibility-service-common.d.ts +0 -8
- package/accessibility/accessibility-service-common.js +0 -26
- package/accessibility/accessibility-service-common.js.map +0 -1
- package/accessibility/accessibility-service.android.d.ts +0 -6
- package/accessibility/accessibility-service.android.js +0 -103
- package/accessibility/accessibility-service.android.js.map +0 -1
- package/accessibility/accessibility-service.d.ts +0 -10
- package/accessibility/accessibility-service.ios.d.ts +0 -6
- package/accessibility/accessibility-service.ios.js +0 -61
- package/accessibility/accessibility-service.ios.js.map +0 -1
- package/accessibility/accessibility-types.d.ts +0 -224
- package/accessibility/accessibility-types.js +0 -222
- package/accessibility/accessibility-types.js.map +0 -1
- package/accessibility/font-scale-common.d.ts +0 -7
- package/accessibility/font-scale-common.js +0 -14
- package/accessibility/font-scale-common.js.map +0 -1
- package/accessibility/font-scale.android.d.ts +0 -5
- package/accessibility/font-scale.android.js +0 -55
- package/accessibility/font-scale.android.js.map +0 -1
- package/accessibility/font-scale.d.ts +0 -9
- package/accessibility/font-scale.ios.d.ts +0 -5
- package/accessibility/font-scale.ios.js +0 -89
- package/accessibility/font-scale.ios.js.map +0 -1
- package/accessibility/index.android.d.ts +0 -10
- package/accessibility/index.android.js +0 -577
- package/accessibility/index.android.js.map +0 -1
- package/accessibility/index.ios.d.ts +0 -9
- package/accessibility/index.ios.js +0 -229
- package/accessibility/index.ios.js.map +0 -1
- package/css/package.json +0 -36
- package/css-value/package.json +0 -23
- package/debugger/dom-node.d.ts +0 -27
- package/debugger/dom-node.js.map +0 -1
- package/ui/animation/animation-interfaces.js.map +0 -1
- package/ui/builder/xml2ui.d.ts +0 -134
- package/ui/builder/xml2ui.js +0 -397
- package/ui/builder/xml2ui.js.map +0 -1
- package/ui/frame/callbacks/activity-callbacks.d.ts +0 -19
- 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 +0 -160
- package/utils/android/index.js.map +0 -1
- package/utils/ios/index.d.ts +0 -39
- package/utils/ios/index.js +0 -229
- package/utils/ios/index.js.map +0 -1
|
@@ -1,8 +1,15 @@
|
|
|
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
|
|
4
|
+
import { getWindow } from '../utils/native-helper';
|
|
5
|
+
import { SDK_VERSION } from '../utils/constants';
|
|
6
|
+
import { ios as iosUtils } from '../utils/native-helper';
|
|
5
7
|
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';
|
|
6
13
|
var CADisplayLinkTarget = /** @class */ (function (_super) {
|
|
7
14
|
__extends(CADisplayLinkTarget, _super);
|
|
8
15
|
function CADisplayLinkTarget() {
|
|
@@ -33,24 +40,6 @@ var CADisplayLinkTarget = /** @class */ (function (_super) {
|
|
|
33
40
|
};
|
|
34
41
|
return CADisplayLinkTarget;
|
|
35
42
|
}(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));
|
|
54
43
|
var Responder = /** @class */ (function (_super) {
|
|
55
44
|
__extends(Responder, _super);
|
|
56
45
|
function Responder() {
|
|
@@ -76,7 +65,6 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
76
65
|
constructor() {
|
|
77
66
|
super();
|
|
78
67
|
this._delegateHandlers = new Map();
|
|
79
|
-
this._notificationObservers = [];
|
|
80
68
|
this.displayedOnce = false;
|
|
81
69
|
this.addNotificationObserver(UIApplicationDidFinishLaunchingNotification, this.didFinishLaunchingWithOptions.bind(this));
|
|
82
70
|
this.addNotificationObserver(UIApplicationDidBecomeActiveNotification, this.didBecomeActive.bind(this));
|
|
@@ -93,7 +81,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
93
81
|
this.setWindowContent();
|
|
94
82
|
}
|
|
95
83
|
run(entry) {
|
|
96
|
-
|
|
84
|
+
setAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);
|
|
97
85
|
this.started = true;
|
|
98
86
|
if (this.nativeApp) {
|
|
99
87
|
this.runAsEmbeddedApp();
|
|
@@ -112,8 +100,9 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
112
100
|
return;
|
|
113
101
|
}
|
|
114
102
|
this._rootView = rootView;
|
|
103
|
+
setRootView(rootView);
|
|
115
104
|
// Attach to the existing iOS app
|
|
116
|
-
const window =
|
|
105
|
+
const window = getWindow();
|
|
117
106
|
if (!window) {
|
|
118
107
|
return;
|
|
119
108
|
}
|
|
@@ -134,7 +123,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
134
123
|
embedderDelegate.presentNativeScriptApp(controller);
|
|
135
124
|
}
|
|
136
125
|
else {
|
|
137
|
-
const visibleVC =
|
|
126
|
+
const visibleVC = iosUtils.getVisibleViewController(rootController);
|
|
138
127
|
visibleVC.presentViewControllerAnimatedCompletion(controller, true, null);
|
|
139
128
|
}
|
|
140
129
|
this.initRootView(rootView);
|
|
@@ -168,7 +157,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
168
157
|
const minFrameRateDisabled = NSBundle.mainBundle.objectForInfoDictionaryKey('CADisableMinimumFrameDurationOnPhone');
|
|
169
158
|
if (minFrameRateDisabled) {
|
|
170
159
|
let max = 120;
|
|
171
|
-
const deviceMaxFrames =
|
|
160
|
+
const deviceMaxFrames = iosUtils.getMainScreen().maximumFramesPerSecond;
|
|
172
161
|
if (options?.max) {
|
|
173
162
|
if (deviceMaxFrames) {
|
|
174
163
|
// iOS 10.3
|
|
@@ -179,7 +168,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
179
168
|
max = options.max <= this.displayedLink.preferredFramesPerSecond ? options.max : this.displayedLink.preferredFramesPerSecond;
|
|
180
169
|
}
|
|
181
170
|
}
|
|
182
|
-
if (
|
|
171
|
+
if (SDK_VERSION >= 15 || __VISIONOS__) {
|
|
183
172
|
const min = options?.min || max / 2;
|
|
184
173
|
const preferred = options?.preferred || max;
|
|
185
174
|
this.displayedLink.preferredFrameRateRange = CAFrameRateRangeMake(min, max, preferred);
|
|
@@ -209,11 +198,11 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
209
198
|
// TODO: consideration
|
|
210
199
|
// may not want to cache this value given the potential of multiple scenes
|
|
211
200
|
// particularly with SwiftUI app lifecycle based apps
|
|
212
|
-
if (!
|
|
201
|
+
if (!getiOSWindow()) {
|
|
213
202
|
// Note: NativeScriptViewFactory.getKeyWindow will always be used in SwiftUI app lifecycle based apps
|
|
214
|
-
|
|
203
|
+
setiOSWindow(getWindow());
|
|
215
204
|
}
|
|
216
|
-
return
|
|
205
|
+
return getiOSWindow();
|
|
217
206
|
}
|
|
218
207
|
get delegate() {
|
|
219
208
|
return this._delegate;
|
|
@@ -257,21 +246,14 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
257
246
|
return this.nativeApp;
|
|
258
247
|
}
|
|
259
248
|
addNotificationObserver(notificationName, onReceiveCallback) {
|
|
260
|
-
|
|
261
|
-
NSNotificationCenter.defaultCenter.addObserverSelectorNameObject(observer, 'onReceive', notificationName, null);
|
|
262
|
-
this._notificationObservers.push(observer);
|
|
263
|
-
return observer;
|
|
249
|
+
return iosAddNotificationObserver(notificationName, onReceiveCallback);
|
|
264
250
|
}
|
|
265
|
-
removeNotificationObserver(observer
|
|
266
|
-
|
|
267
|
-
if (index >= 0) {
|
|
268
|
-
this._notificationObservers.splice(index, 1);
|
|
269
|
-
NSNotificationCenter.defaultCenter.removeObserverNameObject(observer, notificationName, null);
|
|
270
|
-
}
|
|
251
|
+
removeNotificationObserver(observer /* NotificationObserver */, notificationName) {
|
|
252
|
+
iosRemoveNotificationObserver(observer, notificationName);
|
|
271
253
|
}
|
|
272
254
|
getSystemAppearance() {
|
|
273
255
|
// userInterfaceStyle is available on UITraitCollection since iOS 12.
|
|
274
|
-
if ((!__VISIONOS__ &&
|
|
256
|
+
if ((!__VISIONOS__ && SDK_VERSION <= 11) || !this.rootController) {
|
|
275
257
|
return null;
|
|
276
258
|
}
|
|
277
259
|
const userInterfaceStyle = this.rootController.traitCollection.userInterfaceStyle;
|
|
@@ -312,13 +294,13 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
312
294
|
const root = this.notifyLaunch({
|
|
313
295
|
ios: notification?.userInfo?.objectForKey('UIApplicationLaunchOptionsLocalNotificationKey') ?? null,
|
|
314
296
|
});
|
|
315
|
-
if (
|
|
297
|
+
if (getiOSWindow()) {
|
|
316
298
|
if (root !== null && !isEmbedded()) {
|
|
317
299
|
this.setWindowContent(root);
|
|
318
300
|
}
|
|
319
301
|
}
|
|
320
302
|
else {
|
|
321
|
-
this.
|
|
303
|
+
setiOSWindow(this.window);
|
|
322
304
|
}
|
|
323
305
|
}
|
|
324
306
|
_onLivesync(context) {
|
|
@@ -342,6 +324,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
342
324
|
const rootView = this.createRootView(view);
|
|
343
325
|
const controller = this.getViewController(rootView);
|
|
344
326
|
this._rootView = rootView;
|
|
327
|
+
setRootView(rootView);
|
|
345
328
|
// setup view as styleScopeHost
|
|
346
329
|
rootView._setupAsRootView({});
|
|
347
330
|
this.setViewControllerView(rootView);
|
|
@@ -362,13 +345,13 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
362
345
|
didFinishLaunchingWithOptions(notification) {
|
|
363
346
|
this.setMaxRefreshRate();
|
|
364
347
|
// ensures window is assigned to proper window scene
|
|
365
|
-
this.
|
|
366
|
-
if (!
|
|
348
|
+
setiOSWindow(this.window);
|
|
349
|
+
if (!getiOSWindow()) {
|
|
367
350
|
// if still no window, create one
|
|
368
|
-
|
|
351
|
+
setiOSWindow(UIWindow.alloc().initWithFrame(UIScreen.mainScreen.bounds));
|
|
369
352
|
}
|
|
370
353
|
if (!__VISIONOS__) {
|
|
371
|
-
this.window.backgroundColor =
|
|
354
|
+
this.window.backgroundColor = SDK_VERSION <= 12 || !UIColor.systemBackgroundColor ? UIColor.whiteColor : UIColor.systemBackgroundColor;
|
|
372
355
|
}
|
|
373
356
|
this.notifyAppStarted(notification);
|
|
374
357
|
}
|
|
@@ -442,4 +425,431 @@ global.__onLiveSyncCore = function (context) {
|
|
|
442
425
|
export * from './application-common';
|
|
443
426
|
export const Application = iosApp;
|
|
444
427
|
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
|
+
});
|
|
445
855
|
//# sourceMappingURL=application.ios.js.map
|