@akylas/nativescript 8.9.17 → 9.0.20

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