@akylas/nativescript 9.0.25 → 9.1.5

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 (633) hide show
  1. package/abortcontroller/abortsignal.js.map +1 -1
  2. package/abortcontroller/index.js.map +1 -1
  3. package/accessibility/accessibility-common.js.map +1 -1
  4. package/accessibility/accessibility-css-helper.js.map +1 -1
  5. package/accessibility/accessibility-properties.js.map +1 -1
  6. package/accessibility/accessibility-service-common.js.map +1 -1
  7. package/accessibility/accessibility-service.android.js.map +1 -1
  8. package/accessibility/accessibility-service.ios.js.map +1 -1
  9. package/accessibility/accessibility-types.js.map +1 -1
  10. package/accessibility/font-scale-common.js.map +1 -1
  11. package/accessibility/font-scale.android.js.map +1 -1
  12. package/accessibility/font-scale.ios.js.map +1 -1
  13. package/accessibility/index.android.js.map +1 -1
  14. package/accessibility/index.ios.js.map +1 -1
  15. package/animation-frame/animation-native.android.js.map +1 -1
  16. package/animation-frame/animation-native.ios.js.map +1 -1
  17. package/animation-frame/index.js.map +1 -1
  18. package/application/application-common.d.ts +205 -3
  19. package/application/application-common.js +438 -55
  20. package/application/application-common.js.map +1 -1
  21. package/application/application-interfaces.d.ts +67 -1
  22. package/application/application-interfaces.js.map +1 -1
  23. package/application/application-shims.js.map +1 -1
  24. package/application/application.android.d.ts +39 -0
  25. package/application/application.android.js +239 -18
  26. package/application/application.android.js.map +1 -1
  27. package/application/application.d.ts +161 -54
  28. package/application/application.ios.d.ts +189 -28
  29. package/application/application.ios.js +892 -390
  30. package/application/application.ios.js.map +1 -1
  31. package/application/helpers-common.d.ts +7 -0
  32. package/application/helpers-common.js +46 -1
  33. package/application/helpers-common.js.map +1 -1
  34. package/application/helpers.android.js.map +1 -1
  35. package/application/helpers.ios.js.map +1 -1
  36. package/application/index.android.js.map +1 -1
  37. package/application/index.ios.js.map +1 -1
  38. package/application/scene-delegate-bridge.d.ts +60 -0
  39. package/application/scene-delegate-bridge.js +138 -0
  40. package/application/scene-delegate-bridge.js.map +1 -0
  41. package/application-settings/application-settings-common.js.map +1 -1
  42. package/application-settings/index.android.js.map +1 -1
  43. package/application-settings/index.ios.js.map +1 -1
  44. package/bundle-entry-points.js.map +1 -1
  45. package/cli-hooks/before-checkForChanges.mjs +0 -11
  46. package/color/color-common.js +16 -5
  47. package/color/color-common.js.map +1 -1
  48. package/color/color-types.js.map +1 -1
  49. package/color/color-utils.d.ts +4 -1
  50. package/color/color-utils.js +14 -9
  51. package/color/color-utils.js.map +1 -1
  52. package/color/index.android.js.map +1 -1
  53. package/color/index.ios.js.map +1 -1
  54. package/color/known-colors.js.map +1 -1
  55. package/config/config.interface.d.ts +45 -3
  56. package/config/config.interface.js.map +1 -1
  57. package/config/index.js.map +1 -1
  58. package/connectivity/index.android.js.map +1 -1
  59. package/connectivity/index.ios.js.map +1 -1
  60. package/console/index.js.map +1 -1
  61. package/core-types/animation-types.js.map +1 -1
  62. package/core-types/index.d.ts +25 -2
  63. package/core-types/index.js +23 -0
  64. package/core-types/index.js.map +1 -1
  65. package/core-types/validators.js.map +1 -1
  66. package/css/CSS3Parser.js +3 -2
  67. package/css/CSS3Parser.js.map +1 -1
  68. package/css/CSSNativeScript.js.map +1 -1
  69. package/css/css-tree-parser.js +5 -1
  70. package/css/css-tree-parser.js.map +1 -1
  71. package/css/lib/parse/index.js +5 -1
  72. package/css/lib/parse/index.js.map +1 -1
  73. package/css/parser.js +20 -3
  74. package/css/parser.js.map +1 -1
  75. package/css/reworkcss.js.map +1 -1
  76. package/css/system-classes.d.ts +9 -0
  77. package/css/system-classes.js +23 -0
  78. package/css/system-classes.js.map +1 -1
  79. package/css-mediaquery/index.d.ts +6 -1
  80. package/css-mediaquery/index.js +35 -6
  81. package/css-mediaquery/index.js.map +1 -1
  82. package/css-value/reworkcss-value.js.map +1 -1
  83. package/data/observable/index.d.ts +23 -0
  84. package/data/observable/index.js +50 -9
  85. package/data/observable/index.js.map +1 -1
  86. package/data/observable-array/index.js.map +1 -1
  87. package/data/virtual-array/index.js.map +1 -1
  88. package/debugger/InspectorBackendCommands.js.map +1 -1
  89. package/debugger/devtools-elements-interfaces.js.map +1 -1
  90. package/debugger/devtools-elements.common.js.map +1 -1
  91. package/debugger/devtools-elements.js.map +1 -1
  92. package/debugger/dom-types.js +31 -1
  93. package/debugger/dom-types.js.map +1 -1
  94. package/debugger/index.js.map +1 -1
  95. package/debugger/webinspector-css.js.map +1 -1
  96. package/debugger/webinspector-dom.js.map +1 -1
  97. package/debugger/webinspector-network.android.js.map +1 -1
  98. package/debugger/webinspector-network.d.ts +29 -0
  99. package/debugger/webinspector-network.ios.js.map +1 -1
  100. package/fetch/index.d.ts +79 -0
  101. package/fetch/index.js +408 -0
  102. package/fetch/index.js.map +1 -0
  103. package/file-system/file-system-access.android.d.ts +1 -0
  104. package/file-system/file-system-access.android.js +18 -21
  105. package/file-system/file-system-access.android.js.map +1 -1
  106. package/file-system/file-system-access.ios.js +21 -13
  107. package/file-system/file-system-access.ios.js.map +1 -1
  108. package/file-system/index.d.ts +3 -3
  109. package/file-system/index.js.map +1 -1
  110. package/fps-meter/fps-native.android.js.map +1 -1
  111. package/fps-meter/fps-native.ios.js.map +1 -1
  112. package/fps-meter/index.js.map +1 -1
  113. package/global-types.d.ts +40 -34
  114. package/globals/global-utils.d.ts +6 -1
  115. package/globals/global-utils.js +10 -5
  116. package/globals/global-utils.js.map +1 -1
  117. package/globals/index.js +22 -9
  118. package/globals/index.js.map +1 -1
  119. package/globals/polyfills/polyfill-xhr.js.map +1 -1
  120. package/globals/polyfills/utils.js +2 -0
  121. package/globals/polyfills/utils.js.map +1 -1
  122. package/http/http-interfaces.js.map +1 -1
  123. package/http/http-request/http-request-common.js.map +1 -1
  124. package/http/http-request/index.android.js +5 -1
  125. package/http/http-request/index.android.js.map +1 -1
  126. package/http/http-request/index.ios.js.map +1 -1
  127. package/http/http-request-internal/http-request-internal-common.d.ts +6 -1
  128. package/http/http-request-internal/http-request-internal-common.js +19 -0
  129. package/http/http-request-internal/http-request-internal-common.js.map +1 -1
  130. package/http/http-request-internal/index.android.d.ts +7 -1
  131. package/http/http-request-internal/index.android.js +8 -6
  132. package/http/http-request-internal/index.android.js.map +1 -1
  133. package/http/http-request-internal/index.ios.d.ts +7 -1
  134. package/http/http-request-internal/index.ios.js +34 -17
  135. package/http/http-request-internal/index.ios.js.map +1 -1
  136. package/http/index.js.map +1 -1
  137. package/image-asset/image-asset-common.js.map +1 -1
  138. package/image-asset/index.android.js.map +1 -1
  139. package/image-asset/index.ios.js.map +1 -1
  140. package/image-source/image-source-common.js.map +1 -1
  141. package/image-source/index.android.js.map +1 -1
  142. package/image-source/index.ios.js +7 -6
  143. package/image-source/index.ios.js.map +1 -1
  144. package/index.d.ts +3 -1
  145. package/index.js +1 -0
  146. package/index.js.map +1 -1
  147. package/inspector_modules.js +1 -1
  148. package/inspector_modules.js.map +1 -1
  149. package/js-libs/easysax/easysax.d.ts +49 -7
  150. package/js-libs/easysax/easysax.js +631 -747
  151. package/js-libs/easysax/easysax.js.map +1 -0
  152. package/matrix/index.js.map +1 -1
  153. package/media-query-list/index.js +57 -15
  154. package/media-query-list/index.js.map +1 -1
  155. package/module-name-resolver/helpers.d.ts +1 -1
  156. package/module-name-resolver/helpers.js.map +1 -1
  157. package/module-name-resolver/index.d.ts +2 -2
  158. package/module-name-resolver/index.js.map +1 -1
  159. package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
  160. package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
  161. package/native-window/index.d.ts +426 -0
  162. package/native-window/index.js +4 -0
  163. package/native-window/index.js.map +1 -0
  164. package/native-window/native-window-common.d.ts +153 -0
  165. package/native-window/native-window-common.js +340 -0
  166. package/native-window/native-window-common.js.map +1 -0
  167. package/native-window/native-window-interfaces.d.ts +186 -0
  168. package/native-window/native-window-interfaces.js +90 -0
  169. package/native-window/native-window-interfaces.js.map +1 -0
  170. package/native-window/native-window.android.d.ts +59 -0
  171. package/native-window/native-window.android.js +175 -0
  172. package/native-window/native-window.android.js.map +1 -0
  173. package/native-window/native-window.ios.d.ts +61 -0
  174. package/native-window/native-window.ios.js +218 -0
  175. package/native-window/native-window.ios.js.map +1 -0
  176. package/native-window/window-base.d.ts +111 -0
  177. package/native-window/window-base.js +91 -0
  178. package/native-window/window-base.js.map +1 -0
  179. package/package.json +3 -3
  180. package/platform/common.js.map +1 -1
  181. package/platform/device/index.android.js.map +1 -1
  182. package/platform/device/index.ios.js.map +1 -1
  183. package/platform/index.js.map +1 -1
  184. package/platform/screen/index.android.js.map +1 -1
  185. package/platform/screen/index.ios.d.ts +1 -0
  186. package/platform/screen/index.ios.js +6 -2
  187. package/platform/screen/index.ios.js.map +1 -1
  188. package/platforms/android/java/org/nativescript/widgets/BorderDrawable.java +5 -6
  189. package/platforms/android/java/org/nativescript/widgets/BoxShadowDrawable.java +0 -6
  190. package/platforms/android/java/org/nativescript/widgets/CommonLayoutParams.java +56 -0
  191. package/platforms/android/java/org/nativescript/widgets/ContentLayout.java +20 -4
  192. package/platforms/android/java/org/nativescript/widgets/CustomTransition.java +26 -9
  193. package/platforms/android/java/org/nativescript/widgets/FlexLine.java +3 -3
  194. package/platforms/android/java/org/nativescript/widgets/FlexboxLayout.java +194 -731
  195. package/platforms/android/java/org/nativescript/widgets/ImageView.java +2 -2
  196. package/platforms/android/java/org/nativescript/widgets/Utils.java +37 -9
  197. package/platforms/android/java/org/nativescript/widgets/ViewHelper.java +78 -0
  198. package/platforms/android/java/org/nativescript/widgets/image/BitmapOwner.java +1 -4
  199. package/platforms/android/java/org/nativescript/widgets/image/Worker.java +99 -76
  200. package/platforms/android/native-api-usage.json +11 -0
  201. package/platforms/ios/src/NativeScriptMainWindow.swift +72 -39
  202. package/profiling/index.js.map +1 -1
  203. package/references.d.ts +5 -2
  204. package/text/formatted-string.js.map +1 -1
  205. package/text/index.android.js.map +1 -1
  206. package/text/index.ios.js.map +1 -1
  207. package/text/span.js.map +1 -1
  208. package/text/text-common.js +1 -1
  209. package/text/text-common.js.map +1 -1
  210. package/timer/index.android.js +2 -1
  211. package/timer/index.android.js.map +1 -1
  212. package/timer/index.ios.js.map +1 -1
  213. package/trace/index.d.ts +2 -2
  214. package/trace/index.js.map +1 -1
  215. package/ui/action-bar/action-bar-common.js.map +1 -1
  216. package/ui/action-bar/index.android.js +7 -11
  217. package/ui/action-bar/index.android.js.map +1 -1
  218. package/ui/action-bar/index.d.ts +13 -1
  219. package/ui/action-bar/index.ios.js +26 -0
  220. package/ui/action-bar/index.ios.js.map +1 -1
  221. package/ui/activity-indicator/activity-indicator-common.js.map +1 -1
  222. package/ui/activity-indicator/index.android.js.map +1 -1
  223. package/ui/activity-indicator/index.ios.js.map +1 -1
  224. package/ui/animation/animation-common.js.map +1 -1
  225. package/ui/animation/animation-interfaces.js.map +1 -1
  226. package/ui/animation/animation-shared.js.map +1 -1
  227. package/ui/animation/animation-types.js.map +1 -1
  228. package/ui/animation/index.android.js.map +1 -1
  229. package/ui/animation/index.ios.js +6 -1
  230. package/ui/animation/index.ios.js.map +1 -1
  231. package/ui/animation/keyframe-animation.d.ts +3 -1
  232. package/ui/animation/keyframe-animation.js +72 -3
  233. package/ui/animation/keyframe-animation.js.map +1 -1
  234. package/ui/builder/binding-builder.d.ts +8 -0
  235. package/ui/builder/binding-builder.js +12 -0
  236. package/ui/builder/binding-builder.js.map +1 -1
  237. package/ui/builder/component-builder/index.d.ts +7 -4
  238. package/ui/builder/component-builder/index.js +13 -7
  239. package/ui/builder/component-builder/index.js.map +1 -1
  240. package/ui/builder/index.d.ts +16 -2
  241. package/ui/builder/index.js +61 -13
  242. package/ui/builder/index.js.map +1 -1
  243. package/ui/button/button-common.js.map +1 -1
  244. package/ui/button/index.android.js +4 -3
  245. package/ui/button/index.android.js.map +1 -1
  246. package/ui/button/index.ios.js.map +1 -1
  247. package/ui/content-view/index.js +2 -0
  248. package/ui/content-view/index.js.map +1 -1
  249. package/ui/core/bindable/bindable-expressions.js.map +1 -1
  250. package/ui/core/bindable/bindable-resources.js.map +1 -1
  251. package/ui/core/bindable/bindable-types.d.ts +15 -0
  252. package/ui/core/bindable/bindable-types.js.map +1 -1
  253. package/ui/core/bindable/index.d.ts +1 -1
  254. package/ui/core/bindable/index.js +14 -8
  255. package/ui/core/bindable/index.js.map +1 -1
  256. package/ui/core/control-state-change/index.android.js.map +1 -1
  257. package/ui/core/control-state-change/index.ios.js.map +1 -1
  258. package/ui/core/properties/index.d.ts +37 -2
  259. package/ui/core/properties/index.js +205 -29
  260. package/ui/core/properties/index.js.map +1 -1
  261. package/ui/core/properties/property-shared.js +11 -2
  262. package/ui/core/properties/property-shared.js.map +1 -1
  263. package/ui/core/view/index.android.d.ts +5 -0
  264. package/ui/core/view/index.android.js +89 -15
  265. package/ui/core/view/index.android.js.map +1 -1
  266. package/ui/core/view/index.d.ts +58 -1
  267. package/ui/core/view/index.ios.d.ts +1 -0
  268. package/ui/core/view/index.ios.js +48 -11
  269. package/ui/core/view/index.ios.js.map +1 -1
  270. package/ui/core/view/view-common.d.ts +37 -0
  271. package/ui/core/view/view-common.js +81 -0
  272. package/ui/core/view/view-common.js.map +1 -1
  273. package/ui/core/view/view-helper/index.android.d.ts +1 -0
  274. package/ui/core/view/view-helper/index.android.js +8 -0
  275. package/ui/core/view/view-helper/index.android.js.map +1 -1
  276. package/ui/core/view/view-helper/index.d.ts +46 -0
  277. package/ui/core/view/view-helper/index.ios.d.ts +42 -0
  278. package/ui/core/view/view-helper/index.ios.js +170 -5
  279. package/ui/core/view/view-helper/index.ios.js.map +1 -1
  280. package/ui/core/view/view-helper/view-helper-common.js +21 -3
  281. package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
  282. package/ui/core/view/view-helper/view-helper-shared.js.map +1 -1
  283. package/ui/core/view/view-interfaces.js.map +1 -1
  284. package/ui/core/view-base/index.js +75 -36
  285. package/ui/core/view-base/index.js.map +1 -1
  286. package/ui/core/view-base/utils.js.map +1 -1
  287. package/ui/core/weak-event-listener/index.js.map +1 -1
  288. package/ui/date-picker/date-picker-common.js.map +1 -1
  289. package/ui/date-picker/index.android.js +1 -1
  290. package/ui/date-picker/index.android.js.map +1 -1
  291. package/ui/date-picker/index.ios.js.map +1 -1
  292. package/ui/dialogs/dialogs-common.js.map +1 -1
  293. package/ui/dialogs/index.android.js +5 -5
  294. package/ui/dialogs/index.android.js.map +1 -1
  295. package/ui/dialogs/index.ios.js.map +1 -1
  296. package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
  297. package/ui/editable-text-base/index.android.d.ts +2 -0
  298. package/ui/editable-text-base/index.android.js +17 -7
  299. package/ui/editable-text-base/index.android.js.map +1 -1
  300. package/ui/editable-text-base/index.d.ts +8 -0
  301. package/ui/editable-text-base/index.ios.js.map +1 -1
  302. package/ui/embedding/index.android.js.map +1 -1
  303. package/ui/embedding/index.ios.js.map +1 -1
  304. package/ui/enums/enums.js.map +1 -1
  305. package/ui/enums/index.js.map +1 -1
  306. package/ui/frame/activity.android.js.map +1 -1
  307. package/ui/frame/fragment.android.js.map +1 -1
  308. package/ui/frame/fragment.ios.js.map +1 -1
  309. package/ui/frame/fragment.transitions.android.d.ts +12 -9
  310. package/ui/frame/fragment.transitions.android.js +105 -90
  311. package/ui/frame/fragment.transitions.android.js.map +1 -1
  312. package/ui/frame/fragment.transitions.types.js.map +1 -1
  313. package/ui/frame/frame-common.d.ts +14 -2
  314. package/ui/frame/frame-common.js +51 -24
  315. package/ui/frame/frame-common.js.map +1 -1
  316. package/ui/frame/frame-constants.d.ts +9 -0
  317. package/ui/frame/frame-constants.js +10 -0
  318. package/ui/frame/frame-constants.js.map +1 -0
  319. package/ui/frame/frame-helper-for-android.d.ts +2 -2
  320. package/ui/frame/frame-helper-for-android.js +14 -5
  321. package/ui/frame/frame-helper-for-android.js.map +1 -1
  322. package/ui/frame/frame-helpers.js.map +1 -1
  323. package/ui/frame/frame-interfaces.d.ts +1 -1
  324. package/ui/frame/frame-interfaces.js.map +1 -1
  325. package/ui/frame/frame-stack.d.ts +22 -1
  326. package/ui/frame/frame-stack.js +43 -5
  327. package/ui/frame/frame-stack.js.map +1 -1
  328. package/ui/frame/index.android.d.ts +2 -2
  329. package/ui/frame/index.android.js +161 -56
  330. package/ui/frame/index.android.js.map +1 -1
  331. package/ui/frame/index.d.ts +15 -5
  332. package/ui/frame/index.ios.d.ts +1 -1
  333. package/ui/frame/index.ios.js +86 -26
  334. package/ui/frame/index.ios.js.map +1 -1
  335. package/ui/gestures/gestures-common.js.map +1 -1
  336. package/ui/gestures/gestures-types.d.ts +2 -0
  337. package/ui/gestures/gestures-types.js.map +1 -1
  338. package/ui/gestures/index.android.d.ts +1 -1
  339. package/ui/gestures/index.android.js +177 -133
  340. package/ui/gestures/index.android.js.map +1 -1
  341. package/ui/gestures/index.ios.js +36 -7
  342. package/ui/gestures/index.ios.js.map +1 -1
  343. package/ui/gestures/touch-manager.d.ts +1 -2
  344. package/ui/gestures/touch-manager.js +79 -50
  345. package/ui/gestures/touch-manager.js.map +1 -1
  346. package/ui/html-view/html-view-common.js.map +1 -1
  347. package/ui/html-view/index.android.js.map +1 -1
  348. package/ui/html-view/index.ios.js.map +1 -1
  349. package/ui/image/image-common.js +1 -1
  350. package/ui/image/image-common.js.map +1 -1
  351. package/ui/image/index.android.js +14 -2
  352. package/ui/image/index.android.js.map +1 -1
  353. package/ui/image/index.ios.js.map +1 -1
  354. package/ui/image/symbol-effects-common.js.map +1 -1
  355. package/ui/image/symbol-effects.android.js.map +1 -1
  356. package/ui/image/symbol-effects.ios.js.map +1 -1
  357. package/ui/image-cache/image-cache-common.js.map +1 -1
  358. package/ui/image-cache/index.android.js +1 -2
  359. package/ui/image-cache/index.android.js.map +1 -1
  360. package/ui/image-cache/index.ios.js.map +1 -1
  361. package/ui/index.d.ts +2 -2
  362. package/ui/index.js.map +1 -1
  363. package/ui/label/index.android.js.map +1 -1
  364. package/ui/label/index.ios.js.map +1 -1
  365. package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
  366. package/ui/layouts/absolute-layout/index.android.js.map +1 -1
  367. package/ui/layouts/absolute-layout/index.ios.js +3 -0
  368. package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
  369. package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -1
  370. package/ui/layouts/dock-layout/index.android.js.map +1 -1
  371. package/ui/layouts/dock-layout/index.ios.js +3 -0
  372. package/ui/layouts/dock-layout/index.ios.js.map +1 -1
  373. package/ui/layouts/flexbox-layout/flexbox-layout-common.d.ts +7 -0
  374. package/ui/layouts/flexbox-layout/flexbox-layout-common.js +18 -0
  375. package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
  376. package/ui/layouts/flexbox-layout/index.android.d.ts +5 -0
  377. package/ui/layouts/flexbox-layout/index.android.js +15 -0
  378. package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
  379. package/ui/layouts/flexbox-layout/index.d.ts +19 -1
  380. package/ui/layouts/flexbox-layout/index.ios.d.ts +2 -0
  381. package/ui/layouts/flexbox-layout/index.ios.js +246 -195
  382. package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
  383. package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
  384. package/ui/layouts/grid-layout/index.android.js.map +1 -1
  385. package/ui/layouts/grid-layout/index.ios.js +3 -0
  386. package/ui/layouts/grid-layout/index.ios.js.map +1 -1
  387. package/ui/layouts/index.js.map +1 -1
  388. package/ui/layouts/layout-base-common.d.ts +1 -0
  389. package/ui/layouts/layout-base-common.js +23 -1
  390. package/ui/layouts/layout-base-common.js.map +1 -1
  391. package/ui/layouts/layout-base.android.js.map +1 -1
  392. package/ui/layouts/layout-base.ios.js.map +1 -1
  393. package/ui/layouts/liquid-glass/index.android.js.map +1 -1
  394. package/ui/layouts/liquid-glass/index.ios.d.ts +0 -1
  395. package/ui/layouts/liquid-glass/index.ios.js +2 -43
  396. package/ui/layouts/liquid-glass/index.ios.js.map +1 -1
  397. package/ui/layouts/liquid-glass/liquid-glass-common.js.map +1 -1
  398. package/ui/layouts/liquid-glass-container/index.android.js.map +1 -1
  399. package/ui/layouts/liquid-glass-container/index.ios.d.ts +0 -1
  400. package/ui/layouts/liquid-glass-container/index.ios.js +2 -43
  401. package/ui/layouts/liquid-glass-container/index.ios.js.map +1 -1
  402. package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js.map +1 -1
  403. package/ui/layouts/root-layout/index.android.js.map +1 -1
  404. package/ui/layouts/root-layout/index.ios.js.map +1 -1
  405. package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
  406. package/ui/layouts/root-layout/root-layout-stack.js.map +1 -1
  407. package/ui/layouts/stack-layout/index.android.js.map +1 -1
  408. package/ui/layouts/stack-layout/index.ios.js +3 -0
  409. package/ui/layouts/stack-layout/index.ios.js.map +1 -1
  410. package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -1
  411. package/ui/layouts/wrap-layout/index.android.js.map +1 -1
  412. package/ui/layouts/wrap-layout/index.ios.js +3 -0
  413. package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
  414. package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
  415. package/ui/list-picker/index.android.d.ts +1 -0
  416. package/ui/list-picker/index.android.js +6 -5
  417. package/ui/list-picker/index.android.js.map +1 -1
  418. package/ui/list-picker/index.ios.js.map +1 -1
  419. package/ui/list-picker/list-picker-common.js.map +1 -1
  420. package/ui/list-view/index.android.js +19 -11
  421. package/ui/list-view/index.android.js.map +1 -1
  422. package/ui/list-view/index.d.ts +47 -3
  423. package/ui/list-view/index.ios.d.ts +13 -3
  424. package/ui/list-view/index.ios.js +132 -41
  425. package/ui/list-view/index.ios.js.map +1 -1
  426. package/ui/list-view/list-view-common.d.ts +19 -0
  427. package/ui/list-view/list-view-common.js +30 -0
  428. package/ui/list-view/list-view-common.js.map +1 -1
  429. package/ui/page/events.js.map +1 -1
  430. package/ui/page/index.android.js.map +1 -1
  431. package/ui/page/index.d.ts +1 -1
  432. package/ui/page/index.ios.d.ts +3 -1
  433. package/ui/page/index.ios.js +33 -20
  434. package/ui/page/index.ios.js.map +1 -1
  435. package/ui/page/page-common.d.ts +5 -1
  436. package/ui/page/page-common.js.map +1 -1
  437. package/ui/placeholder/index.android.js.map +1 -1
  438. package/ui/placeholder/index.js.map +1 -1
  439. package/ui/placeholder/placeholder-common.js.map +1 -1
  440. package/ui/progress/index.android.js.map +1 -1
  441. package/ui/progress/index.ios.js.map +1 -1
  442. package/ui/progress/progress-common.js.map +1 -1
  443. package/ui/proxy-view-container/index.js.map +1 -1
  444. package/ui/repeater/index.d.ts +2 -1
  445. package/ui/repeater/index.js.map +1 -1
  446. package/ui/scroll-view/index.android.d.ts +2 -1
  447. package/ui/scroll-view/index.android.js +4 -1
  448. package/ui/scroll-view/index.android.js.map +1 -1
  449. package/ui/scroll-view/index.d.ts +53 -0
  450. package/ui/scroll-view/index.ios.d.ts +13 -1
  451. package/ui/scroll-view/index.ios.js +100 -20
  452. package/ui/scroll-view/index.ios.js.map +1 -1
  453. package/ui/scroll-view/scroll-view-common.d.ts +13 -0
  454. package/ui/scroll-view/scroll-view-common.js +27 -0
  455. package/ui/scroll-view/scroll-view-common.js.map +1 -1
  456. package/ui/search-bar/index.android.js +2 -2
  457. package/ui/search-bar/index.android.js.map +1 -1
  458. package/ui/search-bar/index.ios.js.map +1 -1
  459. package/ui/search-bar/search-bar-common.js.map +1 -1
  460. package/ui/segmented-bar/index.android.js +8 -8
  461. package/ui/segmented-bar/index.android.js.map +1 -1
  462. package/ui/segmented-bar/index.ios.js.map +1 -1
  463. package/ui/segmented-bar/segmented-bar-common.d.ts +5 -1
  464. package/ui/segmented-bar/segmented-bar-common.js +6 -1
  465. package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
  466. package/ui/slider/index.android.js +1 -2
  467. package/ui/slider/index.android.js.map +1 -1
  468. package/ui/slider/index.ios.js.map +1 -1
  469. package/ui/slider/slider-common.js.map +1 -1
  470. package/ui/split-view/index.android.js.map +1 -1
  471. package/ui/split-view/index.ios.js.map +1 -1
  472. package/ui/split-view/split-view-common.js.map +1 -1
  473. package/ui/styling/background-common.d.ts +2 -0
  474. package/ui/styling/background-common.js +10 -2
  475. package/ui/styling/background-common.js.map +1 -1
  476. package/ui/styling/background.android.d.ts +4 -1
  477. package/ui/styling/background.android.js +5 -2
  478. package/ui/styling/background.android.js.map +1 -1
  479. package/ui/styling/background.d.ts +2 -2
  480. package/ui/styling/background.ios.d.ts +1 -1
  481. package/ui/styling/background.ios.js +10 -3
  482. package/ui/styling/background.ios.js.map +1 -1
  483. package/ui/styling/box-shadow.js.map +1 -1
  484. package/ui/styling/clip-path-function.js.map +1 -1
  485. package/ui/styling/converters.js.map +1 -1
  486. package/ui/styling/css-animation-parser.js.map +1 -1
  487. package/ui/styling/css-selector.d.ts +60 -13
  488. package/ui/styling/css-selector.js +311 -50
  489. package/ui/styling/css-selector.js.map +1 -1
  490. package/ui/styling/css-shadow.js.map +1 -1
  491. package/ui/styling/css-stroke.js.map +1 -1
  492. package/ui/styling/css-transform.js.map +1 -1
  493. package/ui/styling/css-utils.d.ts +16 -0
  494. package/ui/styling/css-utils.js +121 -7
  495. package/ui/styling/css-utils.js.map +1 -1
  496. package/ui/styling/font-common.js.map +1 -1
  497. package/ui/styling/font-interfaces.js.map +1 -1
  498. package/ui/styling/font.android.js.map +1 -1
  499. package/ui/styling/font.ios.js.map +1 -1
  500. package/ui/styling/length-shared.d.ts +2 -0
  501. package/ui/styling/length-shared.js +29 -2
  502. package/ui/styling/length-shared.js.map +1 -1
  503. package/ui/styling/linear-gradient.js.map +1 -1
  504. package/ui/styling/style/index.d.ts +29 -2
  505. package/ui/styling/style/index.js +1 -0
  506. package/ui/styling/style/index.js.map +1 -1
  507. package/ui/styling/style-properties.d.ts +5 -0
  508. package/ui/styling/style-properties.js +172 -101
  509. package/ui/styling/style-properties.js.map +1 -1
  510. package/ui/styling/style-scope.d.ts +24 -3
  511. package/ui/styling/style-scope.js +461 -63
  512. package/ui/styling/style-scope.js.map +1 -1
  513. package/ui/styling/styling-profile.js.map +1 -1
  514. package/ui/styling/styling-shared.js.map +1 -1
  515. package/ui/switch/index.android.js +1 -1
  516. package/ui/switch/index.android.js.map +1 -1
  517. package/ui/switch/index.ios.js +5 -1
  518. package/ui/switch/index.ios.js.map +1 -1
  519. package/ui/switch/switch-common.js.map +1 -1
  520. package/ui/tab-view/index.android.js +13 -17
  521. package/ui/tab-view/index.android.js.map +1 -1
  522. package/ui/tab-view/index.d.ts +5 -3
  523. package/ui/tab-view/index.ios.d.ts +2 -1
  524. package/ui/tab-view/index.ios.js +83 -20
  525. package/ui/tab-view/index.ios.js.map +1 -1
  526. package/ui/tab-view/tab-view-common.d.ts +6 -1
  527. package/ui/tab-view/tab-view-common.js +17 -1
  528. package/ui/tab-view/tab-view-common.js.map +1 -1
  529. package/ui/text-base/formatted-string.js.map +1 -1
  530. package/ui/text-base/index.android.js +6 -9
  531. package/ui/text-base/index.android.js.map +1 -1
  532. package/ui/text-base/index.ios.d.ts +3 -0
  533. package/ui/text-base/index.ios.js +26 -4
  534. package/ui/text-base/index.ios.js.map +1 -1
  535. package/ui/text-base/span.js.map +1 -1
  536. package/ui/text-base/text-base-common.js.map +1 -1
  537. package/ui/text-field/index.android.js.map +1 -1
  538. package/ui/text-field/index.ios.js +13 -5
  539. package/ui/text-field/index.ios.js.map +1 -1
  540. package/ui/text-field/text-field-common.js.map +1 -1
  541. package/ui/text-view/index.android.js.map +1 -1
  542. package/ui/text-view/index.ios.js.map +1 -1
  543. package/ui/text-view/text-view-common.js.map +1 -1
  544. package/ui/time-picker/index.android.js +1 -1
  545. package/ui/time-picker/index.android.js.map +1 -1
  546. package/ui/time-picker/index.ios.js.map +1 -1
  547. package/ui/time-picker/time-picker-common.js.map +1 -1
  548. package/ui/transition/fade-transition.android.js.map +1 -1
  549. package/ui/transition/fade-transition.ios.js.map +1 -1
  550. package/ui/transition/flip-transition.android.js.map +1 -1
  551. package/ui/transition/index.android.js.map +1 -1
  552. package/ui/transition/index.d.ts +2 -1
  553. package/ui/transition/index.ios.js.map +1 -1
  554. package/ui/transition/modal-transition.android.js.map +1 -1
  555. package/ui/transition/modal-transition.ios.js +33 -5
  556. package/ui/transition/modal-transition.ios.js.map +1 -1
  557. package/ui/transition/page-transition.android.d.ts +4 -0
  558. package/ui/transition/page-transition.android.js +171 -86
  559. package/ui/transition/page-transition.android.js.map +1 -1
  560. package/ui/transition/page-transition.ios.d.ts +5 -0
  561. package/ui/transition/page-transition.ios.js +298 -36
  562. package/ui/transition/page-transition.ios.js.map +1 -1
  563. package/ui/transition/shared-transition-helper.android.d.ts +3 -0
  564. package/ui/transition/shared-transition-helper.android.js +9 -0
  565. package/ui/transition/shared-transition-helper.android.js.map +1 -1
  566. package/ui/transition/shared-transition-helper.d.ts +7 -0
  567. package/ui/transition/shared-transition-helper.ios.d.ts +48 -0
  568. package/ui/transition/shared-transition-helper.ios.js +977 -95
  569. package/ui/transition/shared-transition-helper.ios.js.map +1 -1
  570. package/ui/transition/shared-transition.d.ts +134 -0
  571. package/ui/transition/shared-transition.js +90 -2
  572. package/ui/transition/shared-transition.js.map +1 -1
  573. package/ui/transition/slide-transition.android.js.map +1 -1
  574. package/ui/transition/slide-transition.ios.js.map +1 -1
  575. package/ui/utils.android.js.map +1 -1
  576. package/ui/utils.d.ts +2 -0
  577. package/ui/utils.ios.js.map +1 -1
  578. package/ui/web-view/index.android.js +1 -1
  579. package/ui/web-view/index.android.js.map +1 -1
  580. package/ui/web-view/index.ios.js.map +1 -1
  581. package/ui/web-view/web-view-common.js.map +1 -1
  582. package/ui/web-view/web-view-interfaces.js.map +1 -1
  583. package/utils/android-runtime-version.d.ts +12 -0
  584. package/utils/android-runtime-version.js +36 -0
  585. package/utils/android-runtime-version.js.map +1 -0
  586. package/utils/animation-helpers.js.map +1 -1
  587. package/utils/common.js.map +1 -1
  588. package/utils/constants.android.js.map +1 -1
  589. package/utils/constants.ios.js.map +1 -1
  590. package/utils/debug-source.js.map +1 -1
  591. package/utils/debug.js.map +1 -1
  592. package/utils/index.android.js.map +1 -1
  593. package/utils/index.ios.js.map +1 -1
  594. package/utils/layout-helper/index.android.js.map +1 -1
  595. package/utils/layout-helper/index.ios.js +11 -3
  596. package/utils/layout-helper/index.ios.js.map +1 -1
  597. package/utils/layout-helper/layout-helper-common.js.map +1 -1
  598. package/utils/layout-helper/layout-helper-shared.js.map +1 -1
  599. package/utils/lazy.js.map +1 -1
  600. package/utils/macrotask-scheduler.js.map +1 -1
  601. package/utils/mainthread-helper.android.js.map +1 -1
  602. package/utils/mainthread-helper.ios.js.map +1 -1
  603. package/utils/module-merge.js.map +1 -1
  604. package/utils/native-helper-for-android.js +9 -3
  605. package/utils/native-helper-for-android.js.map +1 -1
  606. package/utils/native-helper.android.d.ts +66 -2
  607. package/utils/native-helper.android.js.map +1 -1
  608. package/utils/native-helper.d.ts +2 -2
  609. package/utils/native-helper.ios.d.ts +52 -2
  610. package/utils/native-helper.ios.js +35 -5
  611. package/utils/native-helper.ios.js.map +1 -1
  612. package/utils/native-helper.types.d.ts +2 -0
  613. package/utils/number-utils.js.map +1 -1
  614. package/utils/platform-check.d.ts +1 -1
  615. package/utils/platform-check.js.map +1 -1
  616. package/utils/shared.js.map +1 -1
  617. package/utils/types.js.map +1 -1
  618. package/utils/utils-shared.js.map +1 -1
  619. package/wgc/atob.js.map +1 -1
  620. package/wgc/btoa.js.map +1 -1
  621. package/wgc/crypto/SubtleCrypto.js.map +1 -1
  622. package/wgc/crypto/index.d.ts +1 -1
  623. package/wgc/crypto/index.js +12 -8
  624. package/wgc/crypto/index.js.map +1 -1
  625. package/wgc/index.js.map +1 -1
  626. package/xhr/index.d.ts +5 -4
  627. package/xhr/index.js +18 -18
  628. package/xhr/index.js.map +1 -1
  629. package/xml/index.d.ts +2 -2
  630. package/xml/index.js +1 -1
  631. package/xml/index.js.map +1 -1
  632. package/LICENSE +0 -19
  633. package/fetch/index.mjs +0 -535
@@ -1,4 +1,3 @@
1
- import { CoreTypes } from '../core-types';
2
1
  import { CSSUtils } from '../css/system-classes';
3
2
  import { Device, Screen } from '../platform';
4
3
  import { profile } from '../profiling';
@@ -6,47 +5,76 @@ import { Trace } from '../trace';
6
5
  import { clearResolverCache, prepareAppForModuleResolver, _setResolver } from '../module-name-resolver/helpers';
7
6
  import { Builder } from '../ui/builder';
8
7
  import * as bindableResources from '../ui/core/bindable/bindable-resources';
9
- import { getAppMainEntry, isAppInBackground, setAppInBackground, setAppMainEntry } from './helpers-common';
8
+ import { getActiveWindow, getAppMainEntry, getAutoSystemAppearanceChanged, isAppInBackground, setActiveWindow, setAppInBackground, setAppMainEntry, setAutoSystemAppearanceChanged } from './helpers-common';
10
9
  import { getNativeScriptGlobals } from '../globals/global-utils';
11
10
  import { SDK_VERSION } from '../utils/constants';
12
- // prettier-ignore
13
- const ORIENTATION_CSS_CLASSES = [
14
- `${CSSUtils.CLASS_PREFIX}${CoreTypes.DeviceOrientation.portrait}`,
15
- `${CSSUtils.CLASS_PREFIX}${CoreTypes.DeviceOrientation.landscape}`,
16
- `${CSSUtils.CLASS_PREFIX}${CoreTypes.DeviceOrientation.unknown}`,
17
- ];
18
- // prettier-ignore
19
- const SYSTEM_APPEARANCE_CSS_CLASSES = [
20
- `${CSSUtils.CLASS_PREFIX}${CoreTypes.SystemAppearance.light}`,
21
- `${CSSUtils.CLASS_PREFIX}${CoreTypes.SystemAppearance.dark}`,
22
- ];
23
- // prettier-ignore
24
- const LAYOUT_DIRECTION_CSS_CLASSES = [
25
- `${CSSUtils.CLASS_PREFIX}${CoreTypes.LayoutDirection.ltr}`,
26
- `${CSSUtils.CLASS_PREFIX}${CoreTypes.LayoutDirection.rtl}`,
27
- ];
11
+ import { NativeWindowEvents, WindowEvents } from '../native-window/native-window-interfaces';
12
+ const ORIENTATION_CSS_CLASSES = CSSUtils.ORIENTATION_CSS_CLASSES;
13
+ const SYSTEM_APPEARANCE_CSS_CLASSES = CSSUtils.SYSTEM_APPEARANCE_CSS_CLASSES;
14
+ const LAYOUT_DIRECTION_CSS_CLASSES = CSSUtils.LAYOUT_DIRECTION_CSS_CLASSES;
28
15
  const globalEvents = getNativeScriptGlobals().events;
29
16
  // Scene lifecycle event names
17
+ /**
18
+ * @deprecated Use `NativeWindowEvents` from `@nativescript/core/native-window` instead.
19
+ */
30
20
  export const SceneEvents = {
21
+ /** @deprecated Use `NativeWindowEvents.sceneWillConnect` instead. */
31
22
  sceneWillConnect: 'sceneWillConnect',
23
+ /** @deprecated Use `NativeWindowEvents.sceneDidActivate` instead. */
32
24
  sceneDidActivate: 'sceneDidActivate',
25
+ /** @deprecated Use `NativeWindowEvents.sceneWillResignActive` instead. */
33
26
  sceneWillResignActive: 'sceneWillResignActive',
27
+ /** @deprecated Use `NativeWindowEvents.sceneWillEnterForeground` instead. */
34
28
  sceneWillEnterForeground: 'sceneWillEnterForeground',
29
+ /** @deprecated Use `NativeWindowEvents.sceneDidEnterBackground` instead. */
35
30
  sceneDidEnterBackground: 'sceneDidEnterBackground',
31
+ /** @deprecated Use `NativeWindowEvents.sceneDidDisconnect` instead. */
36
32
  sceneDidDisconnect: 'sceneDidDisconnect',
33
+ /** @deprecated Use the Application 'windowOpen' event and NativeWindow.setContent() instead. */
37
34
  sceneContentSetup: 'sceneContentSetup',
38
35
  };
39
36
  export class ApplicationCommon {
37
+ /**
38
+ * Boolean to enable/disable systemAppearanceChanged
39
+ */
40
+ get autoSystemAppearanceChanged() {
41
+ return getAutoSystemAppearanceChanged();
42
+ }
43
+ set autoSystemAppearanceChanged(value) {
44
+ setAutoSystemAppearanceChanged(value);
45
+ }
40
46
  /**
41
47
  * @internal - should not be constructed by the user.
42
48
  */
43
49
  constructor() {
50
+ /**
51
+ * @deprecated Use the 'ready' event for application initialization and Application.setWindowContentResolver() to provide window UI. 'launch' continues to fire before the first window's content is created, and its 'root' property is still honored, for backwards compatibility. It never fires for additional windows. In a scene-based app it fires with the first window's content, so a background launch that connects no scene does not raise it.
52
+ */
44
53
  this.launchEvent = 'launch';
54
+ /**
55
+ * Raised once per JS context, as soon as the context is initialized. It is never deferred,
56
+ * so it also fires on a background launch where no window is created.
57
+ *
58
+ * Guaranteed ordering: `ready` -> `windowOpen` -> raw connect/create events -> content
59
+ * resolution (the legacy `launch` bridge runs here, for the first window and the first
60
+ * one after `exit`) ->
61
+ * `contentLoaded` -> `activate`/`displayed`.
62
+ */
63
+ this.readyEvent = 'ready';
64
+ /**
65
+ * Reflects whole-app state: with multiple windows it is raised once the app itself is
66
+ * no longer in the foreground, not when an individual window backgrounds. Listen on a
67
+ * NativeWindow for per-window state.
68
+ */
45
69
  this.suspendEvent = 'suspend';
46
70
  this.displayedEvent = 'displayed';
47
71
  this.backgroundEvent = 'background';
48
72
  this.foregroundEvent = 'foreground';
49
73
  this.resumeEvent = 'resume';
74
+ /**
75
+ * On Android, raised when the last window closes; the process may stay alive.
76
+ * On iOS, raised when the process itself terminates.
77
+ */
50
78
  this.exitEvent = 'exit';
51
79
  this.lowMemoryEvent = 'lowMemory';
52
80
  this.uncaughtErrorEvent = 'uncaughtError';
@@ -59,6 +87,9 @@ export class ApplicationCommon {
59
87
  this.loadAppCssEvent = 'loadAppCss';
60
88
  this.cssChangedEvent = 'cssChanged';
61
89
  this.initRootViewEvent = 'initRootView';
90
+ this.windowOpenEvent = WindowEvents.windowOpen;
91
+ this.windowCloseEvent = WindowEvents.windowClose;
92
+ this.primaryWindowChangedEvent = WindowEvents.primaryWindowChanged;
62
93
  // Application events go through the global events.
63
94
  this.on = globalEvents.on.bind(globalEvents);
64
95
  this.off = globalEvents.off.bind(globalEvents);
@@ -68,11 +99,15 @@ export class ApplicationCommon {
68
99
  this._inBackground = false;
69
100
  this._suspended = false;
70
101
  this._cssFile = './app.css';
102
+ this._readyNotified = false;
103
+ this._appCssLoaded = false;
104
+ this._launchBridgeConsumed = false;
105
+ this._windowContentResolver = null;
71
106
  this.started = false;
72
- /**
73
- * Boolean to enable/disable systemAppearanceChanged
74
- */
75
- this.autoSystemAppearanceChanged = true;
107
+ // --- NativeWindow registry ---
108
+ this._windows = [];
109
+ // --- Primary window traits ---
110
+ this._traitsWindow = null;
76
111
  getNativeScriptGlobals().appInstanceReady = true;
77
112
  global.__onUncaughtError = (error) => {
78
113
  this.notify({
@@ -150,18 +185,37 @@ export class ApplicationCommon {
150
185
  CSSUtils.removeSystemCssClass(cssClass);
151
186
  rootView.cssClasses.delete(cssClass);
152
187
  }
188
+ /**
189
+ * Same as {@link applyCssClass}, minus the system class list: window-scoped classes
190
+ * must not leak into it, because it seeds every window's root view.
191
+ */
192
+ applyWindowScopedCssClass(rootView, cssClasses, newCssClass) {
193
+ if (rootView.cssClasses.has(newCssClass)) {
194
+ return;
195
+ }
196
+ cssClasses.forEach((cssClass) => rootView.cssClasses.delete(cssClass));
197
+ rootView.cssClasses.add(newCssClass);
198
+ this.increaseStyleScopeApplicationCssSelectorVersion(rootView);
199
+ }
200
+ /**
201
+ * The modal registry is process-wide, so only the modals presented over this root
202
+ * view may follow its window-scoped classes.
203
+ */
204
+ getOwnedModalViews(rootView) {
205
+ return rootView._getRootModalViews().filter((modalView) => modalView._getRootModalHost() === rootView);
206
+ }
153
207
  increaseStyleScopeApplicationCssSelectorVersion(rootView) {
154
208
  const styleScope = rootView._styleScope ?? rootView?.currentPage?._styleScope;
155
209
  if (styleScope) {
156
210
  styleScope._increaseApplicationCssSelectorVersion();
157
211
  }
158
212
  }
159
- setRootViewCSSClasses(rootView) {
213
+ setRootViewCSSClasses(rootView, window) {
160
214
  const platform = Device.os.toLowerCase();
161
215
  const deviceType = Device.deviceType.toLowerCase();
162
- const orientation = this.orientation();
163
- const systemAppearance = this.systemAppearance();
164
- const layoutDirection = this.layoutDirection();
216
+ const orientation = window ? window.orientation() : this.orientation();
217
+ const systemAppearance = window ? window.systemAppearance() : this.systemAppearance();
218
+ const layoutDirection = window ? window.layoutDirection() : this.layoutDirection();
165
219
  if (platform) {
166
220
  CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}`);
167
221
  // SDK Version CSS classes
@@ -173,18 +227,20 @@ export class ApplicationCommon {
173
227
  if (deviceType) {
174
228
  CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${deviceType}`);
175
229
  }
230
+ rootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);
231
+ const rootViewCssClasses = CSSUtils.getSystemCssClasses();
232
+ rootViewCssClasses.forEach((c) => rootView.cssClasses.add(c));
233
+ // Two windows can disagree on these, so they never reach the process-wide
234
+ // system class list — see CSSUtils.WINDOW_SCOPED_CSS_CLASSES.
176
235
  if (orientation) {
177
- CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${orientation}`);
236
+ rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${orientation}`);
178
237
  }
179
238
  if (systemAppearance) {
180
- CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${systemAppearance}`);
239
+ rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${systemAppearance}`);
181
240
  }
182
241
  if (layoutDirection) {
183
- CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${layoutDirection}`);
242
+ rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${layoutDirection}`);
184
243
  }
185
- rootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);
186
- const rootViewCssClasses = CSSUtils.getSystemCssClasses();
187
- rootViewCssClasses.forEach((c) => rootView.cssClasses.add(c));
188
244
  this.increaseStyleScopeApplicationCssSelectorVersion(rootView);
189
245
  rootView._onCssStateChange();
190
246
  if (Trace.isEnabled()) {
@@ -214,7 +270,326 @@ export class ApplicationCommon {
214
270
  getMainEntry() {
215
271
  return getAppMainEntry();
216
272
  }
273
+ /**
274
+ * Sets the callback that supplies the UI for windows that need content.
275
+ * Pass `null` to remove a previously set resolver.
276
+ */
277
+ setWindowContentResolver(resolver) {
278
+ this._windowContentResolver = resolver ?? null;
279
+ }
280
+ /**
281
+ * @returns The callback currently supplying window content, if any.
282
+ */
283
+ getWindowContentResolver() {
284
+ return this._windowContentResolver;
285
+ }
286
+ /**
287
+ * Get the primary NativeWindow.
288
+ */
289
+ get primaryWindow() {
290
+ return this._windows.find((nw) => nw.isPrimary);
291
+ }
292
+ /**
293
+ * Get the NativeWindow the user is currently interacting with - the one that activated most
294
+ * recently and is still attached. Falls back to the primary window while no window holds
295
+ * activation, which is the case before the first window activates and on a platform that
296
+ * never raises `activate`.
297
+ */
298
+ get activeWindow() {
299
+ const active = getActiveWindow();
300
+ if (active && active.state === 'attached' && this._windows.indexOf(active) !== -1) {
301
+ return active;
302
+ }
303
+ return this.primaryWindow;
304
+ }
305
+ getWindows(role) {
306
+ if (role === 'all') {
307
+ return [...this._windows];
308
+ }
309
+ const roles = role ? (Array.isArray(role) ? role : [role]) : ['application', 'embedded'];
310
+ return this._windows.filter((nw) => roles.indexOf(nw.role) !== -1);
311
+ }
312
+ /**
313
+ * Get a registered NativeWindow by its id.
314
+ */
315
+ getWindowById(id) {
316
+ return this._windows.find((nw) => nw.id === id);
317
+ }
318
+ /**
319
+ * Opens a new window.
320
+ *
321
+ * @param options Options for the new window, including data to hand to it.
322
+ */
323
+ openWindow(options) {
324
+ throw new Error('openWindow() is not supported on this platform.');
325
+ }
326
+ /**
327
+ * @internal - Get all registered NativeWindows, whatever their role.
328
+ */
329
+ _getWindows() {
330
+ return [...this._windows];
331
+ }
332
+ /**
333
+ * @internal - Register a NativeWindow created by the platform lifecycle.
334
+ */
335
+ _registerWindow(nativeWindow) {
336
+ this._windows.push(nativeWindow);
337
+ // A closing window drops its own listeners, so this is never explicitly removed.
338
+ nativeWindow.on(NativeWindowEvents.activate, this.onWindowActivated, this);
339
+ if (nativeWindow.isPrimary) {
340
+ this.trackPrimaryWindowTraits(nativeWindow);
341
+ }
342
+ this._onWindowRegistered(nativeWindow);
343
+ this.notify({
344
+ eventName: this.windowOpenEvent,
345
+ object: this,
346
+ window: nativeWindow,
347
+ });
348
+ }
349
+ /**
350
+ * @internal - retire the windows behind discarded window-session ids.
351
+ *
352
+ * A session id can only stand in for a window whose native surface is already gone.
353
+ * iOS reports sessions discarded while the app was not running on the next launch,
354
+ * and such an id can name the session driving the app now, so an id match alone is
355
+ * no evidence that the window is finished with. Retiring an attached window tears
356
+ * down the UI in use - its root view unloads and nothing ever reloads it - so only
357
+ * detached windows are retired. Ids matching no window are ignored: they routinely
358
+ * belong to windows this JS context has never seen.
359
+ */
360
+ _retireDiscardedWindows(ids) {
361
+ for (const id of ids) {
362
+ const nativeWindow = id ? this.getWindowById(id) : undefined;
363
+ if (!nativeWindow) {
364
+ continue;
365
+ }
366
+ if (nativeWindow.state === 'attached') {
367
+ Trace.write(`Ignoring a discarded session for window '${id}': its surface is still attached.`, Trace.categories.NativeLifecycle, Trace.messageType.warn);
368
+ continue;
369
+ }
370
+ nativeWindow._notifyEvent(NativeWindowEvents.close);
371
+ this._unregisterWindow(nativeWindow);
372
+ }
373
+ }
374
+ /**
375
+ * @internal - Unregister a NativeWindow when its native surface is gone for good.
376
+ */
377
+ _unregisterWindow(nativeWindow) {
378
+ if (!nativeWindow._surfaceGone) {
379
+ Trace.write(`Unregistering window '${nativeWindow.id}' while its native surface is still live. A window may only be retired once the platform has reported the surface gone.`, Trace.categories.NativeLifecycle, Trace.messageType.error);
380
+ }
381
+ const idx = this._windows.indexOf(nativeWindow);
382
+ if (idx >= 0) {
383
+ this._windows.splice(idx, 1);
384
+ }
385
+ if (getActiveWindow() === nativeWindow) {
386
+ setActiveWindow(undefined);
387
+ }
388
+ this.notify({
389
+ eventName: this.windowCloseEvent,
390
+ object: this,
391
+ window: nativeWindow,
392
+ });
393
+ // If primary was removed, promote the next window that can actually host content
394
+ if (nativeWindow.isPrimary) {
395
+ nativeWindow._setIsPrimary(false);
396
+ const promoted = this.getWindows().find((nw) => nw.state === 'attached');
397
+ this.trackPrimaryWindowTraits(promoted);
398
+ if (promoted) {
399
+ promoted._setIsPrimary(true);
400
+ this._onPrimaryWindowPromoted(promoted);
401
+ this.notify({
402
+ eventName: this.primaryWindowChangedEvent,
403
+ object: this,
404
+ window: promoted,
405
+ });
406
+ }
407
+ }
408
+ nativeWindow._destroy();
409
+ }
410
+ /**
411
+ * Hook for platform-specific bookkeeping right after a window joins the registry,
412
+ * before `windowOpen` is raised.
413
+ */
414
+ _onWindowRegistered(nativeWindow) {
415
+ // noop
416
+ }
417
+ /**
418
+ * Hook for platform-specific bookkeeping right after a window takes over the primary
419
+ * role, before `primaryWindowChanged` is raised.
420
+ */
421
+ _onPrimaryWindowPromoted(nativeWindow) {
422
+ // noop
423
+ }
424
+ /**
425
+ * Points the application-level orientation, appearance and layout direction at the
426
+ * primary window, which owns those values now that each window has its own.
427
+ */
428
+ trackPrimaryWindowTraits(nativeWindow) {
429
+ const target = nativeWindow ?? null;
430
+ if (this._traitsWindow === target) {
431
+ return;
432
+ }
433
+ const previous = this._traitsWindow;
434
+ if (previous) {
435
+ previous.off(NativeWindowEvents.orientationChanged, this.onWindowOrientationChanged, this);
436
+ previous.off(NativeWindowEvents.systemAppearanceChanged, this.onWindowSystemAppearanceChanged, this);
437
+ previous.off(NativeWindowEvents.layoutDirectionChanged, this.onWindowLayoutDirectionChanged, this);
438
+ }
439
+ this._traitsWindow = target;
440
+ if (!target) {
441
+ return;
442
+ }
443
+ target.on(NativeWindowEvents.orientationChanged, this.onWindowOrientationChanged, this);
444
+ target.on(NativeWindowEvents.systemAppearanceChanged, this.onWindowSystemAppearanceChanged, this);
445
+ target.on(NativeWindowEvents.layoutDirectionChanged, this.onWindowLayoutDirectionChanged, this);
446
+ this.syncTraitsFromWindow(target);
447
+ }
448
+ /**
449
+ * Adopts the window's values. The very first window seeds them quietly — there is no
450
+ * previous application state for it to differ from — while a later promotion raises
451
+ * the change events, because app code observed the outgoing window's values.
452
+ */
453
+ syncTraitsFromWindow(nativeWindow) {
454
+ const orientation = nativeWindow.orientation();
455
+ if (orientation) {
456
+ if (this._orientation === undefined) {
457
+ this._orientation = orientation;
458
+ }
459
+ else {
460
+ this.setOrientation(orientation);
461
+ }
462
+ }
463
+ const systemAppearance = nativeWindow.systemAppearance();
464
+ if (systemAppearance) {
465
+ if (this._systemAppearance === undefined) {
466
+ this._systemAppearance = systemAppearance;
467
+ }
468
+ else {
469
+ this.setSystemAppearance(systemAppearance);
470
+ }
471
+ }
472
+ const layoutDirection = nativeWindow.layoutDirection();
473
+ if (layoutDirection) {
474
+ if (this._layoutDirection === undefined) {
475
+ this._layoutDirection = layoutDirection;
476
+ }
477
+ else {
478
+ this.setLayoutDirection(layoutDirection);
479
+ }
480
+ }
481
+ }
482
+ onWindowActivated(data) {
483
+ setActiveWindow(data.window);
484
+ }
485
+ onWindowOrientationChanged(data) {
486
+ this.setOrientation(data.newValue);
487
+ }
488
+ onWindowSystemAppearanceChanged(data) {
489
+ this.setSystemAppearance(data.newValue);
490
+ }
491
+ onWindowLayoutDirectionChanged(data) {
492
+ this.setLayoutDirection(data.newValue);
493
+ }
494
+ /**
495
+ * @internal - raises `ready` at most once per JS context.
496
+ */
497
+ notifyReady() {
498
+ if (this._readyNotified) {
499
+ return;
500
+ }
501
+ this._readyNotified = true;
502
+ getNativeScriptGlobals().setLaunched();
503
+ this.notify({
504
+ eventName: this.readyEvent,
505
+ object: this,
506
+ ios: this.ios,
507
+ android: this.android,
508
+ });
509
+ }
510
+ /**
511
+ * @internal - raises `exit` and re-arms the legacy `launch` bridge, since the process
512
+ * can outlive the exit and open a new first window.
513
+ */
514
+ notifyExit(data) {
515
+ this._launchBridgeConsumed = false;
516
+ this.notify({
517
+ eventName: this.exitEvent,
518
+ object: this,
519
+ ...data,
520
+ });
521
+ }
522
+ /**
523
+ * @internal - produces the content for a window that has none.
524
+ *
525
+ * Resolution order: the window content resolver, then the legacy `launch` event
526
+ * (offered to the first window that asks for content, and again to the first one after
527
+ * `exit`), then the application main entry. A resolver or a `launch` handler returning `null` takes
528
+ * ownership of the content, so nothing else is tried. A missing main entry leaves
529
+ * the window empty instead of throwing, because content can still arrive later
530
+ * through `run()`/`resetRootView()`.
531
+ *
532
+ * @param options.install `false` returns the resolved view instead of applying it,
533
+ * for platform pipelines that install the root view on the native surface themselves.
534
+ * @param options.launchData platform payload merged into the legacy `launch` event args.
535
+ * @returns The resolved view, or `null` when no content was produced.
536
+ */
537
+ _resolveWindowContent(window, request, options) {
538
+ const content = this.resolveWindowContent(request, options?.launchData);
539
+ if (content == null) {
540
+ return null;
541
+ }
542
+ if (options?.install === false) {
543
+ return this.buildContentView(content);
544
+ }
545
+ window.setContent(content);
546
+ return window.rootView;
547
+ }
548
+ resolveWindowContent(request, launchData) {
549
+ const launchBridgeAvailable = !this._launchBridgeConsumed;
550
+ this._launchBridgeConsumed = true;
551
+ const resolver = this._windowContentResolver;
552
+ if (resolver) {
553
+ const resolved = resolver(request);
554
+ // `null` means the resolver supplies the content itself; only `undefined` falls through.
555
+ if (resolved !== undefined) {
556
+ this._ensureAppCssLoaded();
557
+ return resolved;
558
+ }
559
+ }
560
+ if (launchBridgeAvailable) {
561
+ const root = this.notifyLaunch(launchData);
562
+ if (root === null) {
563
+ return null;
564
+ }
565
+ if (root) {
566
+ return root;
567
+ }
568
+ }
569
+ this._ensureAppCssLoaded();
570
+ const mainEntry = getAppMainEntry();
571
+ return mainEntry ? Builder.createViewFromEntry(mainEntry) : undefined;
572
+ }
573
+ buildContentView(content) {
574
+ if (typeof content === 'string') {
575
+ return Builder.createViewFromEntry({ moduleName: content });
576
+ }
577
+ const entry = content;
578
+ return entry.moduleName || entry.create ? Builder.createViewFromEntry(entry) : content;
579
+ }
580
+ /**
581
+ * Loads the app CSS once per JS context. On the legacy `launch` path this has to run
582
+ * after the handlers, which are allowed to call `setCssFileName()`.
583
+ */
584
+ _ensureAppCssLoaded() {
585
+ if (this._appCssLoaded) {
586
+ return;
587
+ }
588
+ this._appCssLoaded = true;
589
+ this.loadAppCss();
590
+ }
217
591
  notifyLaunch(additionalLanchEventData) {
592
+ this._launchBridgeConsumed = true;
218
593
  const launchArgs = {
219
594
  eventName: this.launchEvent,
220
595
  object: this,
@@ -223,7 +598,7 @@ export class ApplicationCommon {
223
598
  ...additionalLanchEventData,
224
599
  };
225
600
  this.notify(launchArgs);
226
- this.loadAppCss();
601
+ this._ensureAppCssLoaded();
227
602
  return launchArgs.root;
228
603
  }
229
604
  createRootView(view, fireLaunchEvent = false, additionalLanchEventData) {
@@ -253,8 +628,12 @@ export class ApplicationCommon {
253
628
  setAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);
254
629
  // rest of implementation is platform specific
255
630
  }
256
- initRootView(rootView) {
257
- this.setRootViewCSSClasses(rootView);
631
+ /**
632
+ * @param window the window the root view belongs to. Supplies the window-scoped CSS
633
+ * classes; without it they come from the primary window.
634
+ */
635
+ initRootView(rootView, window) {
636
+ this.setRootViewCSSClasses(rootView, window);
258
637
  // ensure css is "loaded" on the rootview so that user rootview can access css variables right away
259
638
  rootView._onCssStateChange(true);
260
639
  this.notify({ eventName: this.initRootViewEvent, rootView });
@@ -348,18 +727,20 @@ export class ApplicationCommon {
348
727
  object: this,
349
728
  });
350
729
  }
730
+ /**
731
+ * @deprecated Use Application.primaryWindow?.orientation() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
732
+ */
351
733
  orientation() {
352
- return (this._orientation ?? (this._orientation = this.getOrientation()));
734
+ return this.primaryWindow?.orientation() ?? (this._orientation ?? (this._orientation = this.getOrientation()));
353
735
  }
354
736
  orientationChanged(rootView, newOrientation) {
355
737
  if (!rootView) {
356
738
  return;
357
739
  }
358
740
  const newOrientationCssClass = `${CSSUtils.CLASS_PREFIX}${newOrientation}`;
359
- this.applyCssClass(rootView, ORIENTATION_CSS_CLASSES, newOrientationCssClass, true);
360
- const rootModalViews = rootView._getRootModalViews();
361
- rootModalViews.forEach((rootModalView) => {
362
- this.applyCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass, true);
741
+ this.applyWindowScopedCssClass(rootView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);
742
+ this.getOwnedModalViews(rootView).forEach((rootModalView) => {
743
+ this.applyWindowScopedCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass);
363
744
  // Trigger state change for root modal view classes and media queries
364
745
  rootModalView._onCssStateChange();
365
746
  });
@@ -391,19 +772,21 @@ export class ApplicationCommon {
391
772
  object: this,
392
773
  };
393
774
  this.notify(args);
394
- if (args.cancel === false) {
775
+ if (args.cancel === false && this.autoSystemAppearanceChanged) {
395
776
  this.systemAppearanceChanged(this.getRootView(), value);
396
777
  }
397
778
  }
779
+ /**
780
+ * @deprecated Use Application.primaryWindow?.systemAppearance() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
781
+ */
398
782
  systemAppearance() {
399
- // return cached value, or get it from the platform specific override
400
- return (this._systemAppearance ?? (this._systemAppearance = this.getSystemAppearance()));
783
+ return this.primaryWindow?.systemAppearance() ?? (this._systemAppearance ?? (this._systemAppearance = this.getSystemAppearance()));
401
784
  }
402
785
  /**
403
786
  * enable/disable systemAppearanceChanged
404
787
  */
405
788
  setAutoSystemAppearanceChanged(value) {
406
- this.autoSystemAppearanceChanged = value;
789
+ setAutoSystemAppearanceChanged(value);
407
790
  }
408
791
  /**
409
792
  * Updates root view classes including those of modals
@@ -411,14 +794,13 @@ export class ApplicationCommon {
411
794
  * @param newSystemAppearance the new appearance change
412
795
  */
413
796
  systemAppearanceChanged(rootView, newSystemAppearance) {
414
- if (!rootView || !this.autoSystemAppearanceChanged) {
797
+ if (!rootView) {
415
798
  return;
416
799
  }
417
800
  const newSystemAppearanceCssClass = `${CSSUtils.CLASS_PREFIX}${newSystemAppearance}`;
418
- this.applyCssClass(rootView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass, true);
419
- const rootModalViews = rootView._getRootModalViews();
420
- rootModalViews.forEach((rootModalView) => {
421
- this.applyCssClass(rootModalView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass, true);
801
+ this.applyWindowScopedCssClass(rootView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass);
802
+ this.getOwnedModalViews(rootView).forEach((rootModalView) => {
803
+ this.applyWindowScopedCssClass(rootModalView, SYSTEM_APPEARANCE_CSS_CLASSES, newSystemAppearanceCssClass);
422
804
  // Trigger state change for root modal view classes and media queries
423
805
  rootModalView._onCssStateChange();
424
806
  });
@@ -443,9 +825,11 @@ export class ApplicationCommon {
443
825
  object: this,
444
826
  });
445
827
  }
828
+ /**
829
+ * @deprecated Use Application.primaryWindow?.layoutDirection() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
830
+ */
446
831
  layoutDirection() {
447
- // return cached value, or get it from the platform specific override
448
- return (this._layoutDirection ?? (this._layoutDirection = this.getLayoutDirection()));
832
+ return this.primaryWindow?.layoutDirection() ?? (this._layoutDirection ?? (this._layoutDirection = this.getLayoutDirection()));
449
833
  }
450
834
  /**
451
835
  * Updates root view classes including those of modals
@@ -457,10 +841,9 @@ export class ApplicationCommon {
457
841
  return;
458
842
  }
459
843
  const newLayoutDirectionCssClass = `${CSSUtils.CLASS_PREFIX}${newLayoutDirection}`;
460
- this.applyCssClass(rootView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass, true);
461
- const rootModalViews = rootView._getRootModalViews();
462
- rootModalViews.forEach((rootModalView) => {
463
- this.applyCssClass(rootModalView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass, true);
844
+ this.applyWindowScopedCssClass(rootView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass);
845
+ this.getOwnedModalViews(rootView).forEach((rootModalView) => {
846
+ this.applyWindowScopedCssClass(rootModalView, LAYOUT_DIRECTION_CSS_CLASSES, newLayoutDirectionCssClass);
464
847
  // Trigger state change for root modal view classes and media queries
465
848
  rootModalView._onCssStateChange();
466
849
  });