@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.
Files changed (481) hide show
  1. package/accessibility/accessibility-common.d.ts +0 -264
  2. package/accessibility/accessibility-common.js +0 -352
  3. package/accessibility/accessibility-common.js.map +1 -1
  4. package/accessibility/accessibility-css-helper.d.ts +1 -0
  5. package/accessibility/accessibility-css-helper.js +101 -0
  6. package/accessibility/accessibility-css-helper.js.map +1 -0
  7. package/accessibility/accessibility-properties.d.ts +1 -1
  8. package/accessibility/accessibility-properties.js +2 -2
  9. package/accessibility/accessibility-properties.js.map +1 -1
  10. package/accessibility/accessibility-service-common.d.ts +8 -0
  11. package/accessibility/accessibility-service-common.js +26 -0
  12. package/accessibility/accessibility-service-common.js.map +1 -0
  13. package/accessibility/accessibility-service.android.d.ts +6 -0
  14. package/accessibility/accessibility-service.android.js +103 -0
  15. package/accessibility/accessibility-service.android.js.map +1 -0
  16. package/accessibility/accessibility-service.d.ts +10 -0
  17. package/accessibility/accessibility-service.ios.d.ts +6 -0
  18. package/accessibility/accessibility-service.ios.js +61 -0
  19. package/accessibility/accessibility-service.ios.js.map +1 -0
  20. package/accessibility/accessibility-types.d.ts +224 -0
  21. package/accessibility/accessibility-types.js +222 -0
  22. package/accessibility/accessibility-types.js.map +1 -0
  23. package/accessibility/font-scale-common.d.ts +7 -0
  24. package/accessibility/font-scale-common.js +14 -0
  25. package/accessibility/font-scale-common.js.map +1 -0
  26. package/accessibility/font-scale.android.d.ts +5 -0
  27. package/accessibility/font-scale.android.js +55 -0
  28. package/accessibility/font-scale.android.js.map +1 -0
  29. package/accessibility/font-scale.d.ts +9 -0
  30. package/accessibility/font-scale.ios.d.ts +5 -0
  31. package/accessibility/font-scale.ios.js +89 -0
  32. package/accessibility/font-scale.ios.js.map +1 -0
  33. package/accessibility/index.android.d.ts +10 -0
  34. package/accessibility/index.android.js +577 -0
  35. package/accessibility/index.android.js.map +1 -0
  36. package/accessibility/index.d.ts +36 -0
  37. package/accessibility/index.ios.d.ts +9 -0
  38. package/accessibility/index.ios.js +229 -0
  39. package/accessibility/index.ios.js.map +1 -0
  40. package/application/application-common.d.ts +8 -6
  41. package/application/application-common.js +14 -21
  42. package/application/application-common.js.map +1 -1
  43. package/application/application-interfaces.d.ts +3 -2
  44. package/application/application.android.d.ts +7 -14
  45. package/application/application.android.js +75 -754
  46. package/application/application.android.js.map +1 -1
  47. package/application/application.d.ts +0 -25
  48. package/application/application.ios.d.ts +18 -16
  49. package/application/application.ios.js +45 -455
  50. package/application/application.ios.js.map +1 -1
  51. package/application-settings/index.android.js +2 -2
  52. package/application-settings/index.android.js.map +1 -1
  53. package/cli-hooks/{before-checkForChanges.mjs → before-checkForChanges.js} +6 -6
  54. package/cli-hooks/postinstall.js +2 -0
  55. package/cli-hooks/preuninstall.js +2 -0
  56. package/color/color-common.d.ts +19 -18
  57. package/color/color-common.js +14 -13
  58. package/color/color-common.js.map +1 -1
  59. package/color/index.ios.d.ts +1 -2
  60. package/color/index.ios.js.map +1 -1
  61. package/connectivity/index.android.js +4 -5
  62. package/connectivity/index.android.js.map +1 -1
  63. package/core-types/index.d.ts +1 -1
  64. package/core-types/index.js +2 -2
  65. package/core-types/index.js.map +1 -1
  66. package/css/css-tree-parser.js +21 -17
  67. package/css/css-tree-parser.js.map +1 -1
  68. package/css/lib/parse/index.js +577 -475
  69. package/css/package.json +36 -0
  70. package/css/reworkcss.d.ts +28 -25
  71. package/css/reworkcss.js +1 -5
  72. package/css-mediaquery/index.js +1 -1
  73. package/css-mediaquery/index.js.map +1 -1
  74. package/css-value/package.json +23 -0
  75. package/css-value/reworkcss-value.d.ts +8 -31
  76. package/css-value/reworkcss-value.js +111 -89
  77. package/debugger/devtools-elements-interfaces.d.ts +1 -1
  78. package/debugger/devtools-elements.common.js +8 -17
  79. package/debugger/devtools-elements.common.js.map +1 -1
  80. package/debugger/devtools-elements.js +1 -1
  81. package/debugger/devtools-elements.js.map +1 -1
  82. package/debugger/dom-node.d.ts +27 -0
  83. package/debugger/{dom-types.js → dom-node.js} +9 -11
  84. package/debugger/dom-node.js.map +1 -0
  85. package/debugger/webinspector-css.d.ts +18 -18
  86. package/debugger/webinspector-css.js +1 -1
  87. package/debugger/webinspector-css.js.map +1 -1
  88. package/debugger/webinspector-dom.d.ts +15 -15
  89. package/debugger/webinspector-dom.js +1 -1
  90. package/debugger/webinspector-dom.js.map +1 -1
  91. package/debugger/webinspector-network.android.d.ts +9 -9
  92. package/debugger/webinspector-network.android.js +3 -3
  93. package/debugger/webinspector-network.android.js.map +1 -1
  94. package/debugger/webinspector-network.ios.d.ts +9 -9
  95. package/debugger/webinspector-network.ios.js +1 -1
  96. package/debugger/webinspector-network.ios.js.map +1 -1
  97. package/fetch/index.js +458 -448
  98. package/file-system/file-system-access.android.js +39 -32
  99. package/file-system/file-system-access.android.js.map +1 -1
  100. package/file-system/index.d.ts +2 -2
  101. package/file-system/index.js +11 -4
  102. package/file-system/index.js.map +1 -1
  103. package/fps-meter/fps-native.android.d.ts +2 -1
  104. package/fps-meter/fps-native.android.js.map +1 -1
  105. package/fps-meter/fps-native.ios.d.ts +2 -1
  106. package/fps-meter/fps-native.ios.js.map +1 -1
  107. package/global-types.d.ts +1 -1
  108. package/globals/index.js +288 -254
  109. package/globals/index.js.map +1 -1
  110. package/http/http-request/http-request-common.js +2 -2
  111. package/http/http-request/http-request-common.js.map +1 -1
  112. package/http/http-request/index.android.d.ts +7 -3
  113. package/http/http-request/index.android.js +22 -6
  114. package/http/http-request/index.android.js.map +1 -1
  115. package/http/http-request/index.d.ts +1 -5
  116. package/http/http-request/index.ios.d.ts +7 -3
  117. package/http/http-request/index.ios.js +22 -6
  118. package/http/http-request/index.ios.js.map +1 -1
  119. package/http/index.d.ts +105 -6
  120. package/http/index.js +12 -10
  121. package/http/index.js.map +1 -1
  122. package/image-asset/index.android.js +3 -3
  123. package/image-asset/index.android.js.map +1 -1
  124. package/image-source/index.android.d.ts +1 -1
  125. package/image-source/index.android.js +23 -5
  126. package/image-source/index.android.js.map +1 -1
  127. package/image-source/index.ios.js +9 -2
  128. package/image-source/index.ios.js.map +1 -1
  129. package/index.d.ts +8 -12
  130. package/index.js +3 -6
  131. package/index.js.map +1 -1
  132. package/inspector_modules.d.ts +0 -3
  133. package/inspector_modules.js +3 -6
  134. package/inspector_modules.js.map +1 -1
  135. package/js-libs/easysax/easysax.js +3 -5
  136. package/media-query-list/index.js +17 -7
  137. package/media-query-list/index.js.map +1 -1
  138. package/module-name-resolver/index.d.ts +11 -2
  139. package/module-name-resolver/index.js +18 -6
  140. package/module-name-resolver/index.js.map +1 -1
  141. package/module-name-resolver/non-bundle-workflow-compat.js +23 -32
  142. package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
  143. package/package.json +5 -8
  144. package/platform/device/index.android.js +2 -2
  145. package/platform/device/index.android.js.map +1 -1
  146. package/platform/screen/index.android.js +2 -2
  147. package/platform/screen/index.android.js.map +1 -1
  148. package/platform/screen/index.ios.js +2 -2
  149. package/platform/screen/index.ios.js.map +1 -1
  150. package/profiling/index.js +1 -2
  151. package/profiling/index.js.map +1 -1
  152. package/ui/action-bar/action-bar-common.js +2 -4
  153. package/ui/action-bar/action-bar-common.js.map +1 -1
  154. package/ui/action-bar/index.android.js +6 -7
  155. package/ui/action-bar/index.android.js.map +1 -1
  156. package/ui/action-bar/index.ios.js +11 -10
  157. package/ui/action-bar/index.ios.js.map +1 -1
  158. package/ui/activity-indicator/index.ios.js +4 -3
  159. package/ui/activity-indicator/index.ios.js.map +1 -1
  160. package/ui/animation/animation-common.d.ts +4 -4
  161. package/ui/animation/animation-common.js +3 -2
  162. package/ui/animation/animation-common.js.map +1 -1
  163. package/ui/animation/{animation-shared.d.ts → animation-interfaces.d.ts} +31 -39
  164. package/{core-types/animation-types.js → ui/animation/animation-interfaces.js} +1 -1
  165. package/ui/animation/animation-interfaces.js.map +1 -0
  166. package/ui/animation/index.android.d.ts +2 -1
  167. package/ui/animation/index.android.js +5 -5
  168. package/ui/animation/index.android.js.map +1 -1
  169. package/ui/animation/index.d.ts +138 -2
  170. package/ui/animation/index.ios.d.ts +2 -1
  171. package/ui/animation/index.ios.js +3 -3
  172. package/ui/animation/index.ios.js.map +1 -1
  173. package/ui/animation/keyframe-animation.d.ts +118 -67
  174. package/ui/animation/keyframe-animation.js +2 -2
  175. package/ui/animation/keyframe-animation.js.map +1 -1
  176. package/ui/builder/component-builder/index.js +2 -2
  177. package/ui/builder/component-builder/index.js.map +1 -1
  178. package/ui/builder/index.js +3 -415
  179. package/ui/builder/index.js.map +1 -1
  180. package/ui/builder/xml2ui.d.ts +134 -0
  181. package/ui/builder/xml2ui.js +397 -0
  182. package/ui/builder/xml2ui.js.map +1 -0
  183. package/ui/button/index.android.js +1 -2
  184. package/ui/button/index.android.js.map +1 -1
  185. package/ui/core/bindable/index.d.ts +38 -2
  186. package/ui/core/bindable/index.js +2 -1
  187. package/ui/core/bindable/index.js.map +1 -1
  188. package/ui/core/properties/index.d.ts +37 -4
  189. package/ui/core/properties/index.js +35 -6
  190. package/ui/core/properties/index.js.map +1 -1
  191. package/ui/core/view/index.android.d.ts +2 -2
  192. package/ui/core/view/index.android.js +10 -13
  193. package/ui/core/view/index.android.js.map +1 -1
  194. package/ui/core/view/index.d.ts +61 -1
  195. package/ui/core/view/index.ios.d.ts +3 -3
  196. package/ui/core/view/index.ios.js +13 -21
  197. package/ui/core/view/index.ios.js.map +1 -1
  198. package/ui/core/view/view-common.d.ts +16 -19
  199. package/ui/core/view/view-common.js +14 -12
  200. package/ui/core/view/view-common.js.map +1 -1
  201. package/ui/core/view/view-helper/index.ios.d.ts +1 -2
  202. package/ui/core/view/view-helper/index.ios.js +4 -3
  203. package/ui/core/view/view-helper/index.ios.js.map +1 -1
  204. package/ui/core/view/view-helper/view-helper-common.js +3 -1
  205. package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
  206. package/ui/core/view-base/index.d.ts +25 -23
  207. package/ui/core/view-base/index.js +30 -9
  208. package/ui/core/view-base/index.js.map +1 -1
  209. package/ui/dialogs/dialogs-common.js +3 -3
  210. package/ui/dialogs/dialogs-common.js.map +1 -1
  211. package/ui/dialogs/index.android.js +7 -8
  212. package/ui/dialogs/index.android.js.map +1 -1
  213. package/ui/dialogs/index.ios.js +2 -2
  214. package/ui/dialogs/index.ios.js.map +1 -1
  215. package/ui/embedding/index.android.d.ts +1 -1
  216. package/ui/embedding/index.d.ts +1 -1
  217. package/ui/frame/callbacks/activity-callbacks.d.ts +19 -0
  218. package/ui/frame/callbacks/activity-callbacks.js +301 -0
  219. package/ui/frame/callbacks/activity-callbacks.js.map +1 -0
  220. package/ui/frame/{frame-helper-for-android.d.ts → callbacks/fragment-callbacks.d.ts} +1 -20
  221. package/ui/frame/{frame-helper-for-android.js → callbacks/fragment-callbacks.js} +38 -52
  222. package/ui/frame/callbacks/fragment-callbacks.js.map +1 -0
  223. package/ui/frame/fragment.android.js +2 -3
  224. package/ui/frame/fragment.android.js.map +1 -1
  225. package/ui/frame/fragment.transitions.android.js.map +1 -1
  226. package/ui/frame/frame-common.d.ts +2 -2
  227. package/ui/frame/frame-common.js.map +1 -1
  228. package/ui/frame/frame-interfaces.d.ts +4 -4
  229. package/ui/frame/frame-interfaces.js.map +1 -1
  230. package/ui/frame/frame-stack.js.map +1 -1
  231. package/ui/frame/index.android.d.ts +5 -20
  232. package/ui/frame/index.android.js +19 -296
  233. package/ui/frame/index.android.js.map +1 -1
  234. package/ui/frame/index.d.ts +19 -18
  235. package/ui/frame/index.ios.d.ts +1 -1
  236. package/ui/frame/index.ios.js +4 -5
  237. package/ui/frame/index.ios.js.map +1 -1
  238. package/ui/gestures/gestures-common.d.ts +273 -4
  239. package/ui/gestures/gestures-common.js +146 -3
  240. package/ui/gestures/gestures-common.js.map +1 -1
  241. package/ui/gestures/index.android.d.ts +1 -29
  242. package/ui/gestures/index.android.js +2 -4
  243. package/ui/gestures/index.android.js.map +1 -1
  244. package/ui/gestures/index.d.ts +0 -35
  245. package/ui/gestures/index.ios.d.ts +1 -35
  246. package/ui/gestures/index.ios.js +3 -3
  247. package/ui/gestures/index.ios.js.map +1 -1
  248. package/ui/gestures/touch-manager.d.ts +1 -1
  249. package/ui/html-view/index.ios.js +3 -3
  250. package/ui/html-view/index.ios.js.map +1 -1
  251. package/ui/image/image-common.js +1 -1
  252. package/ui/image/image-common.js.map +1 -1
  253. package/ui/image/index.android.js +1 -1
  254. package/ui/image/index.android.js.map +1 -1
  255. package/ui/image-cache/index.ios.js +11 -5
  256. package/ui/image-cache/index.ios.js.map +1 -1
  257. package/ui/index.d.ts +5 -10
  258. package/ui/index.js +3 -11
  259. package/ui/index.js.map +1 -1
  260. package/ui/label/index.ios.js.map +1 -1
  261. package/ui/layouts/absolute-layout/absolute-layout-common.js +1 -1
  262. package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
  263. package/ui/layouts/absolute-layout/index.android.js +1 -1
  264. package/ui/layouts/absolute-layout/index.android.js.map +1 -1
  265. package/ui/layouts/absolute-layout/index.d.ts +1 -1
  266. package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
  267. package/ui/layouts/flexbox-layout/flexbox-layout-common.js +1 -2
  268. package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
  269. package/ui/layouts/flexbox-layout/index.android.js +1 -1
  270. package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
  271. package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
  272. package/ui/layouts/layout-base.android.js +1 -2
  273. package/ui/layouts/layout-base.android.js.map +1 -1
  274. package/ui/layouts/stack-layout/index.ios.js.map +1 -1
  275. package/ui/layouts/wrap-layout/index.android.js +1 -1
  276. package/ui/layouts/wrap-layout/index.android.js.map +1 -1
  277. package/ui/layouts/wrap-layout/index.d.ts +1 -1
  278. package/ui/layouts/wrap-layout/wrap-layout-common.js +1 -1
  279. package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
  280. package/ui/list-view/index.android.js +1 -1
  281. package/ui/list-view/index.android.js.map +1 -1
  282. package/ui/list-view/index.d.ts +1 -1
  283. package/ui/list-view/index.ios.js +1 -1
  284. package/ui/list-view/index.ios.js.map +1 -1
  285. package/ui/list-view/list-view-common.js +1 -1
  286. package/ui/list-view/list-view-common.js.map +1 -1
  287. package/ui/page/index.android.js +1 -2
  288. package/ui/page/index.android.js.map +1 -1
  289. package/ui/page/index.d.ts +1 -1
  290. package/ui/page/index.ios.js +5 -4
  291. package/ui/page/index.ios.js.map +1 -1
  292. package/ui/page/page-common.d.ts +2 -3
  293. package/ui/page/page-common.js +4 -5
  294. package/ui/page/page-common.js.map +1 -1
  295. package/ui/scroll-view/index.ios.js +3 -3
  296. package/ui/scroll-view/index.ios.js.map +1 -1
  297. package/ui/styling/background-common.js +1 -0
  298. package/ui/styling/background-common.js.map +1 -1
  299. package/ui/styling/background.android.d.ts +6 -0
  300. package/ui/styling/background.android.js +53 -1
  301. package/ui/styling/background.android.js.map +1 -1
  302. package/ui/styling/background.ios.js +1 -2
  303. package/ui/styling/background.ios.js.map +1 -1
  304. package/ui/styling/converters.d.ts +2 -2
  305. package/ui/styling/css-shadow.js.map +1 -1
  306. package/ui/styling/css-stroke.js.map +1 -1
  307. package/ui/styling/css-transform.d.ts +1 -1
  308. package/ui/styling/css-utils.js +1 -1
  309. package/ui/styling/css-utils.js.map +1 -1
  310. package/ui/styling/font.android.js +2 -2
  311. package/ui/styling/font.android.js.map +1 -1
  312. package/ui/styling/font.ios.js +10 -10
  313. package/ui/styling/font.ios.js.map +1 -1
  314. package/ui/styling/style/index.d.ts +1 -1
  315. package/ui/styling/style-properties.d.ts +113 -58
  316. package/ui/styling/style-properties.js +93 -7
  317. package/ui/styling/style-properties.js.map +1 -1
  318. package/ui/styling/style-scope.d.ts +48 -85
  319. package/ui/styling/style-scope.js +36 -30
  320. package/ui/styling/style-scope.js.map +1 -1
  321. package/ui/switch/index.ios.js +5 -5
  322. package/ui/switch/index.ios.js.map +1 -1
  323. package/ui/tab-view/index.android.js +6 -6
  324. package/ui/tab-view/index.android.js.map +1 -1
  325. package/ui/text-base/index.android.d.ts +1 -1
  326. package/ui/text-base/index.android.js +4 -4
  327. package/ui/text-base/index.android.js.map +1 -1
  328. package/ui/text-base/index.d.ts +1 -1
  329. package/ui/text-base/index.ios.js +4 -5
  330. package/ui/text-base/index.ios.js.map +1 -1
  331. package/ui/text-view/index.ios.js.map +1 -1
  332. package/ui/transition/fade-transition.ios.js +1 -1
  333. package/ui/transition/fade-transition.ios.js.map +1 -1
  334. package/ui/transition/index.ios.js +1 -1
  335. package/ui/transition/index.ios.js.map +1 -1
  336. package/ui/transition/modal-transition.ios.js +1 -1
  337. package/ui/transition/modal-transition.ios.js.map +1 -1
  338. package/ui/transition/page-transition.android.d.ts +1 -1
  339. package/ui/transition/page-transition.android.js +4 -4
  340. package/ui/transition/page-transition.android.js.map +1 -1
  341. package/ui/transition/page-transition.ios.js +1 -1
  342. package/ui/transition/page-transition.ios.js.map +1 -1
  343. package/ui/transition/shared-transition-helper.ios.js +1 -1
  344. package/ui/transition/shared-transition-helper.ios.js.map +1 -1
  345. package/ui/transition/shared-transition.js +1 -2
  346. package/ui/transition/shared-transition.js.map +1 -1
  347. package/ui/transition/slide-transition.ios.js +2 -2
  348. package/ui/transition/slide-transition.ios.js.map +1 -1
  349. package/utils/{native-helper-for-android.d.ts → android/index.d.ts} +2 -4
  350. package/utils/android/index.js +160 -0
  351. package/utils/android/index.js.map +1 -0
  352. package/utils/common.d.ts +38 -1
  353. package/utils/common.js +111 -1
  354. package/utils/common.js.map +1 -1
  355. package/utils/debug.js +59 -1
  356. package/utils/debug.js.map +1 -1
  357. package/utils/index.android.d.ts +1 -3
  358. package/utils/index.android.js +11 -37
  359. package/utils/index.android.js.map +1 -1
  360. package/utils/index.d.ts +14 -2
  361. package/utils/index.ios.d.ts +1 -4
  362. package/utils/index.ios.js +5 -32
  363. package/utils/index.ios.js.map +1 -1
  364. package/utils/ios/index.d.ts +39 -0
  365. package/utils/ios/index.js +229 -0
  366. package/utils/ios/index.js.map +1 -0
  367. package/utils/layout-helper/index.android.js +4 -4
  368. package/utils/layout-helper/index.android.js.map +1 -1
  369. package/utils/layout-helper/index.d.ts +4 -6
  370. package/utils/layout-helper/index.ios.js +5 -5
  371. package/utils/layout-helper/index.ios.js.map +1 -1
  372. package/utils/layout-helper/layout-helper-common.d.ts +9 -0
  373. package/utils/layout-helper/layout-helper-common.js +9 -1
  374. package/utils/layout-helper/layout-helper-common.js.map +1 -1
  375. package/utils/native-helper.android.d.ts +5 -29
  376. package/utils/native-helper.android.js +131 -18
  377. package/utils/native-helper.android.js.map +1 -1
  378. package/utils/native-helper.d.ts +258 -206
  379. package/utils/native-helper.ios.d.ts +3 -72
  380. package/utils/native-helper.ios.js +3 -250
  381. package/utils/native-helper.ios.js.map +1 -1
  382. package/xhr/index.js +13 -12
  383. package/xhr/index.js.map +1 -1
  384. package/xml/index.d.ts +98 -94
  385. package/xml/index.js +2 -58
  386. package/xml/index.js.map +1 -1
  387. package/accessibility/index.js +0 -2
  388. package/accessibility/index.js.map +0 -1
  389. package/application/helpers-common.d.ts +0 -50
  390. package/application/helpers-common.js +0 -153
  391. package/application/helpers-common.js.map +0 -1
  392. package/application/helpers.android.d.ts +0 -17
  393. package/application/helpers.android.js +0 -173
  394. package/application/helpers.android.js.map +0 -1
  395. package/application/helpers.d.ts +0 -25
  396. package/application/helpers.ios.d.ts +0 -27
  397. package/application/helpers.ios.js +0 -62
  398. package/application/helpers.ios.js.map +0 -1
  399. package/cli-hooks/postinstall.mjs +0 -7
  400. package/cli-hooks/preuninstall.mjs +0 -7
  401. package/color/color-types.d.ts +0 -49
  402. package/color/color-types.js +0 -3
  403. package/color/color-types.js.map +0 -1
  404. package/core-types/animation-types.d.ts +0 -11
  405. package/core-types/animation-types.js.map +0 -1
  406. package/core-types/validators.d.ts +0 -2
  407. package/core-types/validators.js +0 -18
  408. package/core-types/validators.js.map +0 -1
  409. package/css/lib/parse/index.d.ts +0 -1
  410. package/css/lib/parse/index.js.map +0 -1
  411. package/css/reworkcss.js.map +0 -1
  412. package/css-value/reworkcss-value.js.map +0 -1
  413. package/debugger/dom-types.d.ts +0 -24
  414. package/debugger/dom-types.js.map +0 -1
  415. package/fetch/index.d.ts +0 -72
  416. package/fetch/index.js.map +0 -1
  417. package/globals/global-utils.d.ts +0 -27
  418. package/globals/global-utils.js +0 -67
  419. package/globals/global-utils.js.map +0 -1
  420. package/http/http-interfaces.d.ts +0 -84
  421. package/http/http-interfaces.js +0 -6
  422. package/http/http-interfaces.js.map +0 -1
  423. package/http/http-shared.d.ts +0 -5
  424. package/http/http-shared.js +0 -14
  425. package/http/http-shared.js.map +0 -1
  426. package/module-name-resolver/helpers.d.ts +0 -14
  427. package/module-name-resolver/helpers.js +0 -27
  428. package/module-name-resolver/helpers.js.map +0 -1
  429. package/ui/animation/animation-shared.js +0 -4
  430. package/ui/animation/animation-shared.js.map +0 -1
  431. package/ui/animation/animation-types.d.ts +0 -1
  432. package/ui/animation/animation-types.js +0 -3
  433. package/ui/animation/animation-types.js.map +0 -1
  434. package/ui/core/bindable/bindable-types.d.ts +0 -37
  435. package/ui/core/bindable/bindable-types.js +0 -3
  436. package/ui/core/bindable/bindable-types.js.map +0 -1
  437. package/ui/core/properties/property-shared.d.ts +0 -35
  438. package/ui/core/properties/property-shared.js +0 -16
  439. package/ui/core/properties/property-shared.js.map +0 -1
  440. package/ui/core/view/view-helper/view-helper-shared.d.ts +0 -5
  441. package/ui/core/view/view-helper/view-helper-shared.js +0 -6
  442. package/ui/core/view/view-helper/view-helper-shared.js.map +0 -1
  443. package/ui/core/view/view-interfaces.d.ts +0 -54
  444. package/ui/core/view/view-interfaces.js +0 -2
  445. package/ui/core/view/view-interfaces.js.map +0 -1
  446. package/ui/core/view-base/utils.d.ts +0 -1
  447. package/ui/core/view-base/utils.js +0 -9
  448. package/ui/core/view-base/utils.js.map +0 -1
  449. package/ui/frame/frame-helper-for-android.js.map +0 -1
  450. package/ui/gestures/gestures-types.d.ts +0 -108
  451. package/ui/gestures/gestures-types.js +0 -40
  452. package/ui/gestures/gestures-types.js.map +0 -1
  453. package/ui/page/events.d.ts +0 -6
  454. package/ui/page/events.js +0 -7
  455. package/ui/page/events.js.map +0 -1
  456. package/ui/styling/length-shared.d.ts +0 -52
  457. package/ui/styling/length-shared.js +0 -173
  458. package/ui/styling/length-shared.js.map +0 -1
  459. package/ui/styling/styling-profile.d.ts +0 -1
  460. package/ui/styling/styling-profile.js +0 -4
  461. package/ui/styling/styling-profile.js.map +0 -1
  462. package/ui/styling/styling-shared.d.ts +0 -3
  463. package/ui/styling/styling-shared.js +0 -6
  464. package/ui/styling/styling-shared.js.map +0 -1
  465. package/utils/animation-helpers.d.ts +0 -27
  466. package/utils/animation-helpers.js +0 -48
  467. package/utils/animation-helpers.js.map +0 -1
  468. package/utils/debug-source.d.ts +0 -19
  469. package/utils/debug-source.js +0 -78
  470. package/utils/debug-source.js.map +0 -1
  471. package/utils/layout-helper/layout-helper-shared.d.ts +0 -9
  472. package/utils/layout-helper/layout-helper-shared.js +0 -13
  473. package/utils/layout-helper/layout-helper-shared.js.map +0 -1
  474. package/utils/native-helper-for-android.js +0 -273
  475. package/utils/native-helper-for-android.js.map +0 -1
  476. package/utils/shared.d.ts +0 -17
  477. package/utils/shared.js +0 -40
  478. package/utils/shared.js.map +0 -1
  479. package/utils/utils-shared.d.ts +0 -1
  480. package/utils/utils-shared.js +0 -8
  481. 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 { getWindow } from '../utils/native-helper';
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
- setAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);
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 = iosUtils.getVisibleViewController(rootController);
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 = iosUtils.getMainScreen().maximumFramesPerSecond;
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 (!getiOSWindow()) {
212
+ if (!this._window) {
202
213
  // Note: NativeScriptViewFactory.getKeyWindow will always be used in SwiftUI app lifecycle based apps
203
- setiOSWindow(getWindow());
214
+ this._window = Utils.ios.getWindow();
204
215
  }
205
- return getiOSWindow();
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
- return iosAddNotificationObserver(notificationName, onReceiveCallback);
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 /* NotificationObserver */, notificationName) {
252
- iosRemoveNotificationObserver(observer, notificationName);
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 (getiOSWindow()) {
315
+ if (this._window) {
298
316
  if (root !== null && !isEmbedded()) {
299
317
  this.setWindowContent(root);
300
318
  }
301
319
  }
302
320
  else {
303
- setiOSWindow(this.window);
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
- setiOSWindow(this.window);
349
- if (!getiOSWindow()) {
365
+ this._window = this.window;
366
+ if (!this._window) {
350
367
  // if still no window, create one
351
- setiOSWindow(UIWindow.alloc().initWithFrame(UIScreen.mainScreen.bounds));
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