@akylas/nativescript 9.0.24 → 9.1.4

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 (585) 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 +199 -3
  19. package/application/application-common.js +425 -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 +242 -17
  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 +885 -379
  30. package/application/application.ios.js.map +1 -1
  31. package/application/helpers-common.d.ts +5 -0
  32. package/application/helpers-common.js +23 -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 +44 -2
  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.js +4 -4
  80. package/css-mediaquery/index.js.map +1 -1
  81. package/css-value/reworkcss-value.js.map +1 -1
  82. package/data/observable/index.d.ts +23 -0
  83. package/data/observable/index.js +50 -9
  84. package/data/observable/index.js.map +1 -1
  85. package/data/observable-array/index.js.map +1 -1
  86. package/data/virtual-array/index.js.map +1 -1
  87. package/debugger/InspectorBackendCommands.js.map +1 -1
  88. package/debugger/devtools-elements-interfaces.js.map +1 -1
  89. package/debugger/devtools-elements.common.js.map +1 -1
  90. package/debugger/devtools-elements.js.map +1 -1
  91. package/debugger/dom-types.js +31 -1
  92. package/debugger/dom-types.js.map +1 -1
  93. package/debugger/index.js.map +1 -1
  94. package/debugger/webinspector-css.js.map +1 -1
  95. package/debugger/webinspector-dom.js.map +1 -1
  96. package/debugger/webinspector-network.android.js.map +1 -1
  97. package/debugger/webinspector-network.ios.js.map +1 -1
  98. package/file-system/file-system-access.android.js.map +1 -1
  99. package/file-system/file-system-access.ios.js +21 -13
  100. package/file-system/file-system-access.ios.js.map +1 -1
  101. package/file-system/index.d.ts +3 -3
  102. package/file-system/index.js.map +1 -1
  103. package/fps-meter/fps-native.android.js.map +1 -1
  104. package/fps-meter/fps-native.ios.js.map +1 -1
  105. package/fps-meter/index.js.map +1 -1
  106. package/global-types.d.ts +39 -33
  107. package/globals/global-utils.d.ts +6 -1
  108. package/globals/global-utils.js +10 -5
  109. package/globals/global-utils.js.map +1 -1
  110. package/globals/index.js +18 -5
  111. package/globals/index.js.map +1 -1
  112. package/globals/polyfills/polyfill-xhr.js.map +1 -1
  113. package/globals/polyfills/utils.js +2 -0
  114. package/globals/polyfills/utils.js.map +1 -1
  115. package/http/http-interfaces.js.map +1 -1
  116. package/http/http-request/http-request-common.js.map +1 -1
  117. package/http/http-request/index.android.js.map +1 -1
  118. package/http/http-request/index.ios.js.map +1 -1
  119. package/http/http-request-internal/http-request-internal-common.d.ts +5 -1
  120. package/http/http-request-internal/http-request-internal-common.js +10 -0
  121. package/http/http-request-internal/http-request-internal-common.js.map +1 -1
  122. package/http/http-request-internal/index.android.d.ts +7 -1
  123. package/http/http-request-internal/index.android.js +2 -2
  124. package/http/http-request-internal/index.android.js.map +1 -1
  125. package/http/http-request-internal/index.ios.d.ts +7 -1
  126. package/http/http-request-internal/index.ios.js +2 -2
  127. package/http/http-request-internal/index.ios.js.map +1 -1
  128. package/http/index.js.map +1 -1
  129. package/image-asset/image-asset-common.js.map +1 -1
  130. package/image-asset/index.android.js.map +1 -1
  131. package/image-asset/index.ios.js.map +1 -1
  132. package/image-source/image-source-common.js.map +1 -1
  133. package/image-source/index.android.js.map +1 -1
  134. package/image-source/index.ios.js.map +1 -1
  135. package/index.d.ts +2 -0
  136. package/index.js +1 -0
  137. package/index.js.map +1 -1
  138. package/inspector_modules.js +1 -1
  139. package/inspector_modules.js.map +1 -1
  140. package/matrix/index.js.map +1 -1
  141. package/media-query-list/index.js.map +1 -1
  142. package/module-name-resolver/helpers.js.map +1 -1
  143. package/module-name-resolver/index.js.map +1 -1
  144. package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
  145. package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
  146. package/native-window/index.d.ts +426 -0
  147. package/native-window/index.js +4 -0
  148. package/native-window/index.js.map +1 -0
  149. package/native-window/native-window-common.d.ts +153 -0
  150. package/native-window/native-window-common.js +340 -0
  151. package/native-window/native-window-common.js.map +1 -0
  152. package/native-window/native-window-interfaces.d.ts +186 -0
  153. package/native-window/native-window-interfaces.js +90 -0
  154. package/native-window/native-window-interfaces.js.map +1 -0
  155. package/native-window/native-window.android.d.ts +59 -0
  156. package/native-window/native-window.android.js +175 -0
  157. package/native-window/native-window.android.js.map +1 -0
  158. package/native-window/native-window.ios.d.ts +61 -0
  159. package/native-window/native-window.ios.js +220 -0
  160. package/native-window/native-window.ios.js.map +1 -0
  161. package/native-window/window-base.d.ts +111 -0
  162. package/native-window/window-base.js +91 -0
  163. package/native-window/window-base.js.map +1 -0
  164. package/package.json +3 -2
  165. package/platform/common.js.map +1 -1
  166. package/platform/device/index.android.js.map +1 -1
  167. package/platform/device/index.ios.js.map +1 -1
  168. package/platform/index.js.map +1 -1
  169. package/platform/screen/index.android.js.map +1 -1
  170. package/platform/screen/index.ios.d.ts +1 -0
  171. package/platform/screen/index.ios.js +6 -2
  172. package/platform/screen/index.ios.js.map +1 -1
  173. package/platforms/android/java/org/nativescript/widgets/BorderDrawable.java +5 -6
  174. package/platforms/android/java/org/nativescript/widgets/BoxShadowDrawable.java +0 -6
  175. package/platforms/android/java/org/nativescript/widgets/CommonLayoutParams.java +56 -0
  176. package/platforms/android/java/org/nativescript/widgets/ContentLayout.java +20 -4
  177. package/platforms/android/java/org/nativescript/widgets/CustomTransition.java +26 -9
  178. package/platforms/android/java/org/nativescript/widgets/FlexLine.java +3 -3
  179. package/platforms/android/java/org/nativescript/widgets/FlexboxLayout.java +194 -731
  180. package/platforms/android/java/org/nativescript/widgets/ImageView.java +2 -2
  181. package/platforms/android/java/org/nativescript/widgets/Utils.java +37 -9
  182. package/platforms/android/java/org/nativescript/widgets/ViewHelper.java +78 -0
  183. package/platforms/android/java/org/nativescript/widgets/image/BitmapOwner.java +1 -4
  184. package/platforms/android/java/org/nativescript/widgets/image/Worker.java +99 -76
  185. package/platforms/android/native-api-usage.json +11 -0
  186. package/platforms/ios/src/NativeScriptMainWindow.swift +72 -39
  187. package/profiling/index.js.map +1 -1
  188. package/references.d.ts +5 -2
  189. package/text/formatted-string.js.map +1 -1
  190. package/text/index.android.js.map +1 -1
  191. package/text/index.ios.js.map +1 -1
  192. package/text/span.js.map +1 -1
  193. package/text/text-common.js +1 -1
  194. package/text/text-common.js.map +1 -1
  195. package/timer/index.android.js.map +1 -1
  196. package/timer/index.ios.js.map +1 -1
  197. package/trace/index.d.ts +2 -2
  198. package/trace/index.js.map +1 -1
  199. package/ui/action-bar/action-bar-common.js.map +1 -1
  200. package/ui/action-bar/index.android.js +2 -7
  201. package/ui/action-bar/index.android.js.map +1 -1
  202. package/ui/action-bar/index.d.ts +13 -1
  203. package/ui/action-bar/index.ios.js +26 -0
  204. package/ui/action-bar/index.ios.js.map +1 -1
  205. package/ui/activity-indicator/activity-indicator-common.js.map +1 -1
  206. package/ui/activity-indicator/index.android.js.map +1 -1
  207. package/ui/activity-indicator/index.ios.js.map +1 -1
  208. package/ui/animation/animation-common.js.map +1 -1
  209. package/ui/animation/animation-interfaces.js.map +1 -1
  210. package/ui/animation/animation-shared.js.map +1 -1
  211. package/ui/animation/animation-types.js.map +1 -1
  212. package/ui/animation/index.android.js.map +1 -1
  213. package/ui/animation/index.ios.js.map +1 -1
  214. package/ui/animation/keyframe-animation.d.ts +3 -1
  215. package/ui/animation/keyframe-animation.js +72 -3
  216. package/ui/animation/keyframe-animation.js.map +1 -1
  217. package/ui/builder/binding-builder.js.map +1 -1
  218. package/ui/builder/component-builder/index.js.map +1 -1
  219. package/ui/builder/index.js +9 -1
  220. package/ui/builder/index.js.map +1 -1
  221. package/ui/button/button-common.js.map +1 -1
  222. package/ui/button/index.android.js.map +1 -1
  223. package/ui/button/index.ios.js.map +1 -1
  224. package/ui/content-view/index.js.map +1 -1
  225. package/ui/core/bindable/bindable-expressions.js.map +1 -1
  226. package/ui/core/bindable/bindable-resources.js.map +1 -1
  227. package/ui/core/bindable/bindable-types.js.map +1 -1
  228. package/ui/core/bindable/index.js +2 -1
  229. package/ui/core/bindable/index.js.map +1 -1
  230. package/ui/core/control-state-change/index.android.js.map +1 -1
  231. package/ui/core/control-state-change/index.ios.js.map +1 -1
  232. package/ui/core/properties/index.d.ts +37 -2
  233. package/ui/core/properties/index.js +209 -32
  234. package/ui/core/properties/index.js.map +1 -1
  235. package/ui/core/properties/property-shared.js +11 -2
  236. package/ui/core/properties/property-shared.js.map +1 -1
  237. package/ui/core/view/index.android.d.ts +5 -0
  238. package/ui/core/view/index.android.js +78 -6
  239. package/ui/core/view/index.android.js.map +1 -1
  240. package/ui/core/view/index.d.ts +58 -1
  241. package/ui/core/view/index.ios.d.ts +1 -0
  242. package/ui/core/view/index.ios.js +48 -11
  243. package/ui/core/view/index.ios.js.map +1 -1
  244. package/ui/core/view/view-common.d.ts +37 -0
  245. package/ui/core/view/view-common.js +81 -0
  246. package/ui/core/view/view-common.js.map +1 -1
  247. package/ui/core/view/view-helper/index.android.d.ts +1 -0
  248. package/ui/core/view/view-helper/index.android.js +8 -0
  249. package/ui/core/view/view-helper/index.android.js.map +1 -1
  250. package/ui/core/view/view-helper/index.d.ts +46 -0
  251. package/ui/core/view/view-helper/index.ios.d.ts +42 -0
  252. package/ui/core/view/view-helper/index.ios.js +170 -5
  253. package/ui/core/view/view-helper/index.ios.js.map +1 -1
  254. package/ui/core/view/view-helper/view-helper-common.js +21 -3
  255. package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
  256. package/ui/core/view/view-helper/view-helper-shared.js.map +1 -1
  257. package/ui/core/view/view-interfaces.js.map +1 -1
  258. package/ui/core/view-base/index.js +80 -36
  259. package/ui/core/view-base/index.js.map +1 -1
  260. package/ui/core/view-base/utils.js.map +1 -1
  261. package/ui/core/weak-event-listener/index.js.map +1 -1
  262. package/ui/date-picker/date-picker-common.js.map +1 -1
  263. package/ui/date-picker/index.android.js.map +1 -1
  264. package/ui/date-picker/index.ios.js.map +1 -1
  265. package/ui/dialogs/dialogs-common.js.map +1 -1
  266. package/ui/dialogs/index.android.js +5 -5
  267. package/ui/dialogs/index.android.js.map +1 -1
  268. package/ui/dialogs/index.ios.js.map +1 -1
  269. package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
  270. package/ui/editable-text-base/index.android.js +2 -1
  271. package/ui/editable-text-base/index.android.js.map +1 -1
  272. package/ui/editable-text-base/index.ios.js.map +1 -1
  273. package/ui/embedding/index.android.js.map +1 -1
  274. package/ui/embedding/index.ios.js.map +1 -1
  275. package/ui/enums/enums.js.map +1 -1
  276. package/ui/enums/index.js.map +1 -1
  277. package/ui/frame/activity.android.js.map +1 -1
  278. package/ui/frame/fragment.android.js.map +1 -1
  279. package/ui/frame/fragment.ios.js.map +1 -1
  280. package/ui/frame/fragment.transitions.android.d.ts +4 -4
  281. package/ui/frame/fragment.transitions.android.js +95 -78
  282. package/ui/frame/fragment.transitions.android.js.map +1 -1
  283. package/ui/frame/fragment.transitions.types.js.map +1 -1
  284. package/ui/frame/frame-common.d.ts +14 -2
  285. package/ui/frame/frame-common.js +51 -24
  286. package/ui/frame/frame-common.js.map +1 -1
  287. package/ui/frame/frame-constants.d.ts +9 -0
  288. package/ui/frame/frame-constants.js +10 -0
  289. package/ui/frame/frame-constants.js.map +1 -0
  290. package/ui/frame/frame-helper-for-android.d.ts +2 -2
  291. package/ui/frame/frame-helper-for-android.js +14 -5
  292. package/ui/frame/frame-helper-for-android.js.map +1 -1
  293. package/ui/frame/frame-helpers.js.map +1 -1
  294. package/ui/frame/frame-interfaces.d.ts +1 -1
  295. package/ui/frame/frame-interfaces.js.map +1 -1
  296. package/ui/frame/frame-stack.d.ts +22 -1
  297. package/ui/frame/frame-stack.js +43 -5
  298. package/ui/frame/frame-stack.js.map +1 -1
  299. package/ui/frame/index.android.d.ts +1 -2
  300. package/ui/frame/index.android.js +152 -53
  301. package/ui/frame/index.android.js.map +1 -1
  302. package/ui/frame/index.d.ts +15 -5
  303. package/ui/frame/index.ios.d.ts +1 -1
  304. package/ui/frame/index.ios.js +86 -26
  305. package/ui/frame/index.ios.js.map +1 -1
  306. package/ui/gestures/gestures-common.js.map +1 -1
  307. package/ui/gestures/gestures-types.d.ts +2 -0
  308. package/ui/gestures/gestures-types.js.map +1 -1
  309. package/ui/gestures/index.android.d.ts +1 -1
  310. package/ui/gestures/index.android.js +159 -124
  311. package/ui/gestures/index.android.js.map +1 -1
  312. package/ui/gestures/index.ios.js +30 -1
  313. package/ui/gestures/index.ios.js.map +1 -1
  314. package/ui/gestures/touch-manager.d.ts +1 -2
  315. package/ui/gestures/touch-manager.js +79 -50
  316. package/ui/gestures/touch-manager.js.map +1 -1
  317. package/ui/html-view/html-view-common.js.map +1 -1
  318. package/ui/html-view/index.android.js.map +1 -1
  319. package/ui/html-view/index.ios.js.map +1 -1
  320. package/ui/image/image-common.js +1 -1
  321. package/ui/image/image-common.js.map +1 -1
  322. package/ui/image/index.android.js +13 -1
  323. package/ui/image/index.android.js.map +1 -1
  324. package/ui/image/index.ios.js.map +1 -1
  325. package/ui/image/symbol-effects-common.js.map +1 -1
  326. package/ui/image/symbol-effects.android.js.map +1 -1
  327. package/ui/image/symbol-effects.ios.js.map +1 -1
  328. package/ui/image-cache/image-cache-common.js.map +1 -1
  329. package/ui/image-cache/index.android.js.map +1 -1
  330. package/ui/image-cache/index.ios.js.map +1 -1
  331. package/ui/index.d.ts +1 -1
  332. package/ui/index.js.map +1 -1
  333. package/ui/label/index.android.js.map +1 -1
  334. package/ui/label/index.ios.js.map +1 -1
  335. package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
  336. package/ui/layouts/absolute-layout/index.android.js.map +1 -1
  337. package/ui/layouts/absolute-layout/index.ios.js +3 -0
  338. package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
  339. package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -1
  340. package/ui/layouts/dock-layout/index.android.js.map +1 -1
  341. package/ui/layouts/dock-layout/index.ios.js +3 -0
  342. package/ui/layouts/dock-layout/index.ios.js.map +1 -1
  343. package/ui/layouts/flexbox-layout/flexbox-layout-common.d.ts +7 -0
  344. package/ui/layouts/flexbox-layout/flexbox-layout-common.js +18 -0
  345. package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
  346. package/ui/layouts/flexbox-layout/index.android.d.ts +5 -0
  347. package/ui/layouts/flexbox-layout/index.android.js +15 -0
  348. package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
  349. package/ui/layouts/flexbox-layout/index.d.ts +19 -1
  350. package/ui/layouts/flexbox-layout/index.ios.d.ts +2 -0
  351. package/ui/layouts/flexbox-layout/index.ios.js +246 -195
  352. package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
  353. package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
  354. package/ui/layouts/grid-layout/index.android.js.map +1 -1
  355. package/ui/layouts/grid-layout/index.ios.js +3 -0
  356. package/ui/layouts/grid-layout/index.ios.js.map +1 -1
  357. package/ui/layouts/index.js.map +1 -1
  358. package/ui/layouts/layout-base-common.d.ts +1 -0
  359. package/ui/layouts/layout-base-common.js +23 -1
  360. package/ui/layouts/layout-base-common.js.map +1 -1
  361. package/ui/layouts/layout-base.android.js.map +1 -1
  362. package/ui/layouts/layout-base.ios.js.map +1 -1
  363. package/ui/layouts/liquid-glass/index.android.js.map +1 -1
  364. package/ui/layouts/liquid-glass/index.ios.d.ts +0 -1
  365. package/ui/layouts/liquid-glass/index.ios.js +2 -43
  366. package/ui/layouts/liquid-glass/index.ios.js.map +1 -1
  367. package/ui/layouts/liquid-glass/liquid-glass-common.js.map +1 -1
  368. package/ui/layouts/liquid-glass-container/index.android.js.map +1 -1
  369. package/ui/layouts/liquid-glass-container/index.ios.d.ts +0 -1
  370. package/ui/layouts/liquid-glass-container/index.ios.js +2 -43
  371. package/ui/layouts/liquid-glass-container/index.ios.js.map +1 -1
  372. package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js.map +1 -1
  373. package/ui/layouts/root-layout/index.android.js.map +1 -1
  374. package/ui/layouts/root-layout/index.ios.js.map +1 -1
  375. package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
  376. package/ui/layouts/root-layout/root-layout-stack.js.map +1 -1
  377. package/ui/layouts/stack-layout/index.android.js.map +1 -1
  378. package/ui/layouts/stack-layout/index.ios.js +3 -0
  379. package/ui/layouts/stack-layout/index.ios.js.map +1 -1
  380. package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -1
  381. package/ui/layouts/wrap-layout/index.android.js.map +1 -1
  382. package/ui/layouts/wrap-layout/index.ios.js +3 -0
  383. package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
  384. package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
  385. package/ui/list-picker/index.android.js.map +1 -1
  386. package/ui/list-picker/index.ios.js.map +1 -1
  387. package/ui/list-picker/list-picker-common.js.map +1 -1
  388. package/ui/list-view/index.android.js +2 -2
  389. package/ui/list-view/index.android.js.map +1 -1
  390. package/ui/list-view/index.d.ts +47 -3
  391. package/ui/list-view/index.ios.d.ts +13 -3
  392. package/ui/list-view/index.ios.js +132 -41
  393. package/ui/list-view/index.ios.js.map +1 -1
  394. package/ui/list-view/list-view-common.d.ts +19 -0
  395. package/ui/list-view/list-view-common.js +30 -0
  396. package/ui/list-view/list-view-common.js.map +1 -1
  397. package/ui/page/events.js.map +1 -1
  398. package/ui/page/index.android.js.map +1 -1
  399. package/ui/page/index.d.ts +1 -1
  400. package/ui/page/index.ios.d.ts +3 -1
  401. package/ui/page/index.ios.js +26 -17
  402. package/ui/page/index.ios.js.map +1 -1
  403. package/ui/page/page-common.d.ts +5 -1
  404. package/ui/page/page-common.js.map +1 -1
  405. package/ui/placeholder/index.android.js.map +1 -1
  406. package/ui/placeholder/index.js.map +1 -1
  407. package/ui/placeholder/placeholder-common.js.map +1 -1
  408. package/ui/progress/index.android.js.map +1 -1
  409. package/ui/progress/index.ios.js.map +1 -1
  410. package/ui/progress/progress-common.js.map +1 -1
  411. package/ui/proxy-view-container/index.js.map +1 -1
  412. package/ui/repeater/index.d.ts +2 -1
  413. package/ui/repeater/index.js.map +1 -1
  414. package/ui/scroll-view/index.android.d.ts +2 -1
  415. package/ui/scroll-view/index.android.js +4 -1
  416. package/ui/scroll-view/index.android.js.map +1 -1
  417. package/ui/scroll-view/index.d.ts +53 -0
  418. package/ui/scroll-view/index.ios.d.ts +13 -1
  419. package/ui/scroll-view/index.ios.js +100 -20
  420. package/ui/scroll-view/index.ios.js.map +1 -1
  421. package/ui/scroll-view/scroll-view-common.d.ts +13 -0
  422. package/ui/scroll-view/scroll-view-common.js +27 -0
  423. package/ui/scroll-view/scroll-view-common.js.map +1 -1
  424. package/ui/search-bar/index.android.js.map +1 -1
  425. package/ui/search-bar/index.ios.js.map +1 -1
  426. package/ui/search-bar/search-bar-common.js.map +1 -1
  427. package/ui/segmented-bar/index.android.js.map +1 -1
  428. package/ui/segmented-bar/index.ios.js.map +1 -1
  429. package/ui/segmented-bar/segmented-bar-common.d.ts +5 -1
  430. package/ui/segmented-bar/segmented-bar-common.js +6 -1
  431. package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
  432. package/ui/slider/index.android.js.map +1 -1
  433. package/ui/slider/index.ios.js.map +1 -1
  434. package/ui/slider/slider-common.js.map +1 -1
  435. package/ui/split-view/index.android.js.map +1 -1
  436. package/ui/split-view/index.ios.js.map +1 -1
  437. package/ui/split-view/split-view-common.js.map +1 -1
  438. package/ui/styling/background-common.d.ts +2 -0
  439. package/ui/styling/background-common.js +8 -0
  440. package/ui/styling/background-common.js.map +1 -1
  441. package/ui/styling/background.android.d.ts +4 -1
  442. package/ui/styling/background.android.js +5 -2
  443. package/ui/styling/background.android.js.map +1 -1
  444. package/ui/styling/background.d.ts +1 -1
  445. package/ui/styling/background.ios.js +9 -2
  446. package/ui/styling/background.ios.js.map +1 -1
  447. package/ui/styling/box-shadow.js.map +1 -1
  448. package/ui/styling/clip-path-function.js.map +1 -1
  449. package/ui/styling/converters.js.map +1 -1
  450. package/ui/styling/css-animation-parser.js.map +1 -1
  451. package/ui/styling/css-selector.d.ts +60 -13
  452. package/ui/styling/css-selector.js +311 -50
  453. package/ui/styling/css-selector.js.map +1 -1
  454. package/ui/styling/css-shadow.js.map +1 -1
  455. package/ui/styling/css-stroke.js.map +1 -1
  456. package/ui/styling/css-transform.js.map +1 -1
  457. package/ui/styling/css-utils.d.ts +16 -0
  458. package/ui/styling/css-utils.js +121 -7
  459. package/ui/styling/css-utils.js.map +1 -1
  460. package/ui/styling/font-common.js.map +1 -1
  461. package/ui/styling/font-interfaces.js.map +1 -1
  462. package/ui/styling/font.android.js.map +1 -1
  463. package/ui/styling/font.ios.js.map +1 -1
  464. package/ui/styling/length-shared.d.ts +2 -0
  465. package/ui/styling/length-shared.js +29 -2
  466. package/ui/styling/length-shared.js.map +1 -1
  467. package/ui/styling/linear-gradient.js.map +1 -1
  468. package/ui/styling/style/index.d.ts +16 -0
  469. package/ui/styling/style/index.js +1 -0
  470. package/ui/styling/style/index.js.map +1 -1
  471. package/ui/styling/style-properties.d.ts +5 -0
  472. package/ui/styling/style-properties.js +172 -101
  473. package/ui/styling/style-properties.js.map +1 -1
  474. package/ui/styling/style-scope.d.ts +24 -3
  475. package/ui/styling/style-scope.js +455 -63
  476. package/ui/styling/style-scope.js.map +1 -1
  477. package/ui/styling/styling-profile.js.map +1 -1
  478. package/ui/styling/styling-shared.js.map +1 -1
  479. package/ui/switch/index.android.js.map +1 -1
  480. package/ui/switch/index.ios.js +5 -1
  481. package/ui/switch/index.ios.js.map +1 -1
  482. package/ui/switch/switch-common.js.map +1 -1
  483. package/ui/tab-view/index.android.js +4 -1
  484. package/ui/tab-view/index.android.js.map +1 -1
  485. package/ui/tab-view/index.d.ts +5 -3
  486. package/ui/tab-view/index.ios.d.ts +2 -1
  487. package/ui/tab-view/index.ios.js +81 -18
  488. package/ui/tab-view/index.ios.js.map +1 -1
  489. package/ui/tab-view/tab-view-common.d.ts +6 -1
  490. package/ui/tab-view/tab-view-common.js +17 -1
  491. package/ui/tab-view/tab-view-common.js.map +1 -1
  492. package/ui/text-base/formatted-string.js.map +1 -1
  493. package/ui/text-base/index.android.js +5 -8
  494. package/ui/text-base/index.android.js.map +1 -1
  495. package/ui/text-base/index.ios.d.ts +3 -0
  496. package/ui/text-base/index.ios.js +25 -3
  497. package/ui/text-base/index.ios.js.map +1 -1
  498. package/ui/text-base/span.js.map +1 -1
  499. package/ui/text-base/text-base-common.js.map +1 -1
  500. package/ui/text-field/index.android.js.map +1 -1
  501. package/ui/text-field/index.ios.js +13 -5
  502. package/ui/text-field/index.ios.js.map +1 -1
  503. package/ui/text-field/text-field-common.js.map +1 -1
  504. package/ui/text-view/index.android.js.map +1 -1
  505. package/ui/text-view/index.ios.js.map +1 -1
  506. package/ui/text-view/text-view-common.js.map +1 -1
  507. package/ui/time-picker/index.android.js.map +1 -1
  508. package/ui/time-picker/index.ios.js.map +1 -1
  509. package/ui/time-picker/time-picker-common.js.map +1 -1
  510. package/ui/transition/fade-transition.android.js.map +1 -1
  511. package/ui/transition/fade-transition.ios.js.map +1 -1
  512. package/ui/transition/flip-transition.android.js.map +1 -1
  513. package/ui/transition/index.android.js.map +1 -1
  514. package/ui/transition/index.d.ts +2 -1
  515. package/ui/transition/index.ios.js.map +1 -1
  516. package/ui/transition/modal-transition.android.js.map +1 -1
  517. package/ui/transition/modal-transition.ios.js +33 -5
  518. package/ui/transition/modal-transition.ios.js.map +1 -1
  519. package/ui/transition/page-transition.android.d.ts +4 -0
  520. package/ui/transition/page-transition.android.js +174 -45
  521. package/ui/transition/page-transition.android.js.map +1 -1
  522. package/ui/transition/page-transition.ios.d.ts +5 -0
  523. package/ui/transition/page-transition.ios.js +298 -36
  524. package/ui/transition/page-transition.ios.js.map +1 -1
  525. package/ui/transition/shared-transition-helper.android.d.ts +3 -0
  526. package/ui/transition/shared-transition-helper.android.js +9 -0
  527. package/ui/transition/shared-transition-helper.android.js.map +1 -1
  528. package/ui/transition/shared-transition-helper.d.ts +7 -0
  529. package/ui/transition/shared-transition-helper.ios.d.ts +48 -0
  530. package/ui/transition/shared-transition-helper.ios.js +977 -95
  531. package/ui/transition/shared-transition-helper.ios.js.map +1 -1
  532. package/ui/transition/shared-transition.d.ts +134 -0
  533. package/ui/transition/shared-transition.js +90 -2
  534. package/ui/transition/shared-transition.js.map +1 -1
  535. package/ui/transition/slide-transition.android.js.map +1 -1
  536. package/ui/transition/slide-transition.ios.js.map +1 -1
  537. package/ui/utils.android.js.map +1 -1
  538. package/ui/utils.d.ts +2 -0
  539. package/ui/utils.ios.js.map +1 -1
  540. package/ui/web-view/index.android.js.map +1 -1
  541. package/ui/web-view/index.ios.js.map +1 -1
  542. package/ui/web-view/web-view-common.js.map +1 -1
  543. package/ui/web-view/web-view-interfaces.js.map +1 -1
  544. package/utils/animation-helpers.js.map +1 -1
  545. package/utils/common.js.map +1 -1
  546. package/utils/constants.android.js.map +1 -1
  547. package/utils/constants.ios.js.map +1 -1
  548. package/utils/debug-source.js.map +1 -1
  549. package/utils/debug.js.map +1 -1
  550. package/utils/index.android.js.map +1 -1
  551. package/utils/index.ios.js.map +1 -1
  552. package/utils/layout-helper/index.android.js.map +1 -1
  553. package/utils/layout-helper/index.ios.js +11 -3
  554. package/utils/layout-helper/index.ios.js.map +1 -1
  555. package/utils/layout-helper/layout-helper-common.js.map +1 -1
  556. package/utils/layout-helper/layout-helper-shared.js.map +1 -1
  557. package/utils/lazy.js.map +1 -1
  558. package/utils/macrotask-scheduler.js.map +1 -1
  559. package/utils/mainthread-helper.android.js.map +1 -1
  560. package/utils/mainthread-helper.ios.js.map +1 -1
  561. package/utils/module-merge.js.map +1 -1
  562. package/utils/native-helper-for-android.js +6 -2
  563. package/utils/native-helper-for-android.js.map +1 -1
  564. package/utils/native-helper.android.d.ts +66 -2
  565. package/utils/native-helper.android.js.map +1 -1
  566. package/utils/native-helper.d.ts +2 -2
  567. package/utils/native-helper.ios.d.ts +52 -2
  568. package/utils/native-helper.ios.js +35 -5
  569. package/utils/native-helper.ios.js.map +1 -1
  570. package/utils/native-helper.types.d.ts +2 -0
  571. package/utils/number-utils.js.map +1 -1
  572. package/utils/platform-check.d.ts +1 -1
  573. package/utils/platform-check.js.map +1 -1
  574. package/utils/shared.js.map +1 -1
  575. package/utils/types.js.map +1 -1
  576. package/utils/utils-shared.js.map +1 -1
  577. package/wgc/atob.js.map +1 -1
  578. package/wgc/btoa.js.map +1 -1
  579. package/wgc/crypto/SubtleCrypto.js.map +1 -1
  580. package/wgc/crypto/index.d.ts +1 -1
  581. package/wgc/crypto/index.js +12 -8
  582. package/wgc/crypto/index.js.map +1 -1
  583. package/wgc/index.js.map +1 -1
  584. package/xhr/index.js.map +1 -1
  585. package/xml/index.js.map +1 -1
@@ -0,0 +1,340 @@
1
+ import { CSSUtils } from '../css/system-classes';
2
+ import { Device } from '../platform';
3
+ import { Trace } from '../trace';
4
+ import { Builder } from '../ui/builder';
5
+ import { SDK_VERSION } from '../utils/constants';
6
+ import { NativeWindowEvents } from './native-window-interfaces';
7
+ import { getAutoSystemAppearanceChanged } from '../application/helpers-common';
8
+ import { WindowBase } from './window-base';
9
+ const ORIENTATION_CSS_CLASSES = CSSUtils.ORIENTATION_CSS_CLASSES;
10
+ const SYSTEM_APPEARANCE_CSS_CLASSES = CSSUtils.SYSTEM_APPEARANCE_CSS_CLASSES;
11
+ const LAYOUT_DIRECTION_CSS_CLASSES = CSSUtils.LAYOUT_DIRECTION_CSS_CLASSES;
12
+ /**
13
+ * Cross-platform NativeWindow base class.
14
+ *
15
+ * Wraps a platform window surface (iOS UIWindowScene+UIWindow, Android Activity)
16
+ * and manages per-window root view lifecycle, CSS classes, and events.
17
+ *
18
+ * Platform-specific subclasses implement the abstract methods.
19
+ */
20
+ export class NativeWindow extends WindowBase {
21
+ constructor(id, isPrimary = false, role = 'application') {
22
+ super(id, isPrimary, role);
23
+ }
24
+ get rootView() {
25
+ return this._rootView;
26
+ }
27
+ /**
28
+ * Set the content of this window.
29
+ * Accepts a View, a NavigationEntry, or a module name string.
30
+ */
31
+ setContent(content) {
32
+ let view;
33
+ if (typeof content === 'string') {
34
+ view = Builder.createViewFromEntry({ moduleName: content });
35
+ }
36
+ else if (content && typeof content === 'object') {
37
+ if (content.moduleName || content.create) {
38
+ view = Builder.createViewFromEntry(content);
39
+ }
40
+ else {
41
+ view = content;
42
+ }
43
+ }
44
+ if (!view) {
45
+ throw new Error('NativeWindow.setContent: Invalid content provided.');
46
+ }
47
+ const previousRootView = this._rootView;
48
+ if (previousRootView) {
49
+ previousRootView._onRootViewReset();
50
+ }
51
+ this._takeRootView(view);
52
+ this._applyRootViewSettings(view);
53
+ this._setNativeContent(view);
54
+ this._notifyEvent(NativeWindowEvents.contentLoaded);
55
+ }
56
+ /**
57
+ * @internal – take ownership of a root view the platform pipeline built and attached itself.
58
+ *
59
+ * The pipeline already ran `_setupAsRootView` and `Application.initRootView` on this view and
60
+ * installed it on the native surface, so neither `_applyRootViewSettings` nor `_setNativeContent`
61
+ * may run here — both would redo that work.
62
+ */
63
+ _adoptRootView(view) {
64
+ if (!view || this._rootView === view) {
65
+ return;
66
+ }
67
+ this._takeRootView(view);
68
+ this._notifyEvent(NativeWindowEvents.contentLoaded);
69
+ }
70
+ /**
71
+ * @internal – give up the root view without tearing it down.
72
+ *
73
+ * Called when another window takes the view over: the view is being moved, not
74
+ * destroyed, so — unlike {@link _onDestroy} — nothing here unloads, resets or tears
75
+ * down the view. It stays loaded and usable in its new window.
76
+ */
77
+ _releaseRootView() {
78
+ const rootView = this._rootView;
79
+ if (!rootView) {
80
+ return;
81
+ }
82
+ this._onReleaseRootView(rootView);
83
+ rootView._nativeWindow = null;
84
+ this._rootView = null;
85
+ }
86
+ /**
87
+ * Platform hook: unhook the released view from the native surface. The view itself
88
+ * must survive — it is on its way into another window.
89
+ */
90
+ _onReleaseRootView(rootView) {
91
+ // noop
92
+ }
93
+ /**
94
+ * Becomes the owner of `view`, releasing it from whichever window held it before.
95
+ */
96
+ _takeRootView(view) {
97
+ const currentOwner = view._nativeWindow;
98
+ if (currentOwner && currentOwner !== this) {
99
+ currentOwner._releaseRootView();
100
+ }
101
+ if (this._rootView && this._rootView !== view) {
102
+ this._rootView._nativeWindow = null;
103
+ }
104
+ this._rootView = view;
105
+ view._nativeWindow = this;
106
+ }
107
+ /**
108
+ * Get the current orientation of this window.
109
+ *
110
+ * Read from the native surface while the window is attached; a detached window
111
+ * reports the last value it saw.
112
+ *
113
+ * A read that catches a change the platform has not reported yet goes through
114
+ * {@link _setOrientation}, so the change is never swallowed by the reading.
115
+ */
116
+ orientation() {
117
+ if (this.state === 'attached') {
118
+ const value = this._getOrientation();
119
+ if (this._orientation === undefined) {
120
+ this._orientation = value;
121
+ }
122
+ else if (this._orientation !== value) {
123
+ this._setOrientation(value);
124
+ }
125
+ }
126
+ return this._orientation;
127
+ }
128
+ /**
129
+ * Get the current system appearance of this window.
130
+ *
131
+ * Read from the native surface while the window is attached; a detached window
132
+ * reports the last value it saw.
133
+ *
134
+ * A read that catches a change the platform has not reported yet goes through
135
+ * {@link _setSystemAppearance}, so the change is never swallowed by the reading.
136
+ */
137
+ systemAppearance() {
138
+ if (this.state === 'attached') {
139
+ const value = this._getSystemAppearance();
140
+ if (this._systemAppearance === undefined) {
141
+ this._systemAppearance = value;
142
+ }
143
+ else if (this._systemAppearance !== value && value !== null) {
144
+ this._setSystemAppearance(value);
145
+ }
146
+ }
147
+ return this._systemAppearance;
148
+ }
149
+ /**
150
+ * Get the current layout direction of this window.
151
+ *
152
+ * Read from the native surface while the window is attached; a detached window
153
+ * reports the last value it saw.
154
+ *
155
+ * A read that catches a change the platform has not reported yet goes through
156
+ * {@link _setLayoutDirection}, so the change is never swallowed by the reading.
157
+ */
158
+ layoutDirection() {
159
+ if (this.state === 'attached') {
160
+ const value = this._getLayoutDirection();
161
+ if (this._layoutDirection === undefined) {
162
+ this._layoutDirection = value;
163
+ }
164
+ else if (this._layoutDirection !== value && value !== null) {
165
+ this._setLayoutDirection(value);
166
+ }
167
+ }
168
+ return this._layoutDirection;
169
+ }
170
+ on(eventName, callback, thisArg) {
171
+ super.on(eventName, callback, thisArg);
172
+ }
173
+ // --- Root view CSS class management ---
174
+ /**
175
+ * Applies platform, orientation, appearance, and layout direction CSS classes
176
+ * to the root view.
177
+ */
178
+ _applyRootViewSettings(rootView) {
179
+ rootView._setupAsRootView({});
180
+ this._setRootViewCSSClasses(rootView);
181
+ // TODO(merge): the fork replaced upstream's readyInit*/applyAccessibilityCssToRoot with accessibility-css-helper.ts
182
+ // (initAccessibilityCssHelper); verify a11y/font-scale classes reach secondary windows' root views.
183
+ rootView._onCssStateChange(true);
184
+ }
185
+ _setRootViewCSSClasses(rootView) {
186
+ const platform = Device.os.toLowerCase();
187
+ const deviceType = Device.deviceType.toLowerCase();
188
+ if (platform) {
189
+ CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}`);
190
+ // SDK Version CSS classes
191
+ // Add exact version class (e.g., .ns-ios-26 or .ns-android-36)
192
+ // this acts like 'gte' for that major version range
193
+ // e.g., if user wants iOS 27, they can add .ns-ios-27 specifiers
194
+ CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}-${Math.floor(SDK_VERSION)}`);
195
+ }
196
+ if (deviceType) {
197
+ CSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${deviceType}`);
198
+ }
199
+ rootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);
200
+ const rootViewCssClasses = CSSUtils.getSystemCssClasses();
201
+ rootViewCssClasses.forEach((c) => rootView.cssClasses.add(c));
202
+ // Two windows can disagree on these, so they never reach the process-wide
203
+ // system class list — see CSSUtils.WINDOW_SCOPED_CSS_CLASSES.
204
+ const orientationValue = this.orientation();
205
+ const appearanceValue = this.systemAppearance();
206
+ const directionValue = this.layoutDirection();
207
+ if (orientationValue) {
208
+ rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${orientationValue}`);
209
+ }
210
+ if (appearanceValue) {
211
+ rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${appearanceValue}`);
212
+ }
213
+ if (directionValue) {
214
+ rootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${directionValue}`);
215
+ }
216
+ this._increaseStyleScopeVersion(rootView);
217
+ rootView._onCssStateChange();
218
+ if (Trace.isEnabled()) {
219
+ const rootCssClasses = Array.from(rootView.cssClasses);
220
+ Trace.write(`NativeWindow [${this.id}] Setting root css classes: ${rootCssClasses.join(' ')}`, Trace.categories.Style);
221
+ }
222
+ }
223
+ // --- Orientation / Appearance / Direction change handling ---
224
+ /**
225
+ * @internal – called by platform when orientation changes for this window.
226
+ */
227
+ _setOrientation(value) {
228
+ if (this._orientation === value) {
229
+ return;
230
+ }
231
+ this._orientation = value;
232
+ if (this._rootView) {
233
+ const cssClass = `${CSSUtils.CLASS_PREFIX}${value}`;
234
+ this._applyCssClass(this._rootView, ORIENTATION_CSS_CLASSES, cssClass);
235
+ }
236
+ this._notifyValueChanged(NativeWindowEvents.orientationChanged, value);
237
+ }
238
+ /**
239
+ * @internal – called by platform when system appearance changes for this window.
240
+ */
241
+ _setSystemAppearance(value) {
242
+ if (this._systemAppearance === value) {
243
+ return;
244
+ }
245
+ this._systemAppearance = value;
246
+ // `Application.autoSystemAppearanceChanged` opts out of the CSS classes only —
247
+ // the event still fires so apps driving their own theming can react to it.
248
+ if (this._rootView && getAutoSystemAppearanceChanged()) {
249
+ const cssClass = `${CSSUtils.CLASS_PREFIX}${value}`;
250
+ this._applyCssClass(this._rootView, SYSTEM_APPEARANCE_CSS_CLASSES, cssClass);
251
+ }
252
+ this._notifyValueChanged(NativeWindowEvents.systemAppearanceChanged, value);
253
+ }
254
+ /**
255
+ * @internal – called by platform when layout direction changes for this window.
256
+ */
257
+ _setLayoutDirection(value) {
258
+ if (this._layoutDirection === value) {
259
+ return;
260
+ }
261
+ this._layoutDirection = value;
262
+ if (this._rootView) {
263
+ const cssClass = `${CSSUtils.CLASS_PREFIX}${value}`;
264
+ this._applyCssClass(this._rootView, LAYOUT_DIRECTION_CSS_CLASSES, cssClass);
265
+ }
266
+ this._notifyValueChanged(NativeWindowEvents.layoutDirectionChanged, value);
267
+ }
268
+ // --- Internal helpers ---
269
+ _notifyValueChanged(eventName, newValue) {
270
+ this.notify({
271
+ eventName,
272
+ object: this,
273
+ window: this,
274
+ newValue,
275
+ });
276
+ }
277
+ _applyCssClass(rootView, cssClasses, newCssClass) {
278
+ if (!rootView.cssClasses.has(newCssClass)) {
279
+ cssClasses.forEach((cssClass) => rootView.cssClasses.delete(cssClass));
280
+ rootView.cssClasses.add(newCssClass);
281
+ this._increaseStyleScopeVersion(rootView);
282
+ rootView._onCssStateChange();
283
+ }
284
+ // The modal registry is process-wide, so only the modals presented over this
285
+ // window's root view may follow it.
286
+ const rootModalViews = rootView._getRootModalViews();
287
+ rootModalViews.forEach((modalView) => {
288
+ if (modalView._getRootModalHost() !== rootView) {
289
+ return;
290
+ }
291
+ if (!modalView.cssClasses.has(newCssClass)) {
292
+ cssClasses.forEach((cssClass) => modalView.cssClasses.delete(cssClass));
293
+ modalView.cssClasses.add(newCssClass);
294
+ modalView._onCssStateChange();
295
+ }
296
+ });
297
+ }
298
+ _increaseStyleScopeVersion(rootView) {
299
+ const styleScope = rootView._styleScope ?? rootView?.currentPage?._styleScope;
300
+ if (styleScope) {
301
+ styleScope._increaseApplicationCssSelectorVersion();
302
+ }
303
+ }
304
+ /**
305
+ * @internal – the native surface went away but the window session lives on.
306
+ *
307
+ * The window stays registered and keeps its listeners, so app code that subscribed
308
+ * to it keeps working once a surface re-attaches. The root view keeps pointing back at
309
+ * this window for the same reason — it is still this window's content.
310
+ */
311
+ _detach() {
312
+ this._surfaceGone = true;
313
+ // Take a final reading while the surface can still answer and the root view is
314
+ // still up: from here on these are what the window reports.
315
+ this.orientation();
316
+ this.systemAppearance();
317
+ this.layoutDirection();
318
+ if (this._rootView) {
319
+ if (this._rootView.isLoaded) {
320
+ this._rootView.callUnloaded();
321
+ }
322
+ this._rootView._tearDownUI(true);
323
+ this._rootView._onRootViewReset();
324
+ }
325
+ this._setState('detached');
326
+ this._notifyEvent(NativeWindowEvents.detached);
327
+ }
328
+ _onDestroy() {
329
+ super._onDestroy();
330
+ if (this._rootView) {
331
+ if (this._rootView.isLoaded) {
332
+ this._rootView.callUnloaded();
333
+ }
334
+ this._rootView._onRootViewReset();
335
+ this._rootView._nativeWindow = null;
336
+ this._rootView = null;
337
+ }
338
+ }
339
+ }
340
+ //# sourceMappingURL=native-window-common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-window-common.js","sourceRoot":"","sources":["../../../../packages/core/native-window/native-window-common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKxC,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AAC,SAAS,CAAC,QAAQ,EAAE,CAAC;gBAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;YAC/B,CAAC;YACD,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YAClC,IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC;YACpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACvB,CAAC;IACF,CAAC;CACD","sourcesContent":["import { CoreTypes } from '../core-types';\nimport { CSSUtils } from '../css/system-classes';\nimport { Device } from '../platform';\nimport { Trace } from '../trace';\nimport { Builder } from '../ui/builder';\nimport type { View } from '../ui/core/view';\nimport type { Frame } from '../ui/frame';\nimport type { NavigationEntry } from '../ui/frame/frame-interfaces';\nimport type { StyleScope } from '../ui/styling/style-scope';\nimport { SDK_VERSION } from '../utils/constants';\nimport type { NativeWindowEventData, NativeWindowEventName, WindowLayoutDirectionChangedEventData, WindowOrientationChangedEventData, WindowSystemAppearanceChangedEventData } from './native-window-interfaces';\nimport type { AndroidActivityEventData, AndroidActivityBundleEventData, AndroidActivityResultEventData, AndroidActivityBackPressedEventData, AndroidActivityNewIntentEventData, AndroidActivityRequestPermissionsEventData, SceneEventData, SceneOpenURLContextsEventData, SceneContinueUserActivityEventData, ScenePerformActionForShortcutItemEventData } from '../application/application-interfaces';\nimport { NativeWindowEvents } from './native-window-interfaces';\nimport { getAutoSystemAppearanceChanged } from '../application/helpers-common';\nimport type { WindowRole } from './window-base';\nimport { WindowBase } from './window-base';\n\nconst ORIENTATION_CSS_CLASSES = CSSUtils.ORIENTATION_CSS_CLASSES;\nconst SYSTEM_APPEARANCE_CSS_CLASSES = CSSUtils.SYSTEM_APPEARANCE_CSS_CLASSES;\nconst LAYOUT_DIRECTION_CSS_CLASSES = CSSUtils.LAYOUT_DIRECTION_CSS_CLASSES;\n\n/**\n * Cross-platform NativeWindow base class.\n *\n * Wraps a platform window surface (iOS UIWindowScene+UIWindow, Android Activity)\n * and manages per-window root view lifecycle, CSS classes, and events.\n *\n * Platform-specific subclasses implement the abstract methods.\n */\nexport abstract class NativeWindow extends WindowBase {\n\tprotected _rootView: View;\n\tprotected _orientation: 'portrait' | 'landscape' | 'unknown';\n\tprotected _systemAppearance: 'dark' | 'light' | null;\n\tprotected _layoutDirection: CoreTypes.LayoutDirectionType | null;\n\n\tconstructor(id?: string, isPrimary = false, role: WindowRole = 'application') {\n\t\tsuper(id, isPrimary, role);\n\t}\n\n\tget rootView(): View {\n\t\treturn this._rootView;\n\t}\n\n\t/**\n\t * Set the content of this window.\n\t * Accepts a View, a NavigationEntry, or a module name string.\n\t */\n\tsetContent(content: View | NavigationEntry | string): void {\n\t\tlet view: View;\n\n\t\tif (typeof content === 'string') {\n\t\t\tview = Builder.createViewFromEntry({ moduleName: content });\n\t\t} else if (content && typeof content === 'object') {\n\t\t\tif ((content as NavigationEntry).moduleName || (content as NavigationEntry).create) {\n\t\t\t\tview = Builder.createViewFromEntry(content as NavigationEntry);\n\t\t\t} else {\n\t\t\t\tview = content as View;\n\t\t\t}\n\t\t}\n\n\t\tif (!view) {\n\t\t\tthrow new Error('NativeWindow.setContent: Invalid content provided.');\n\t\t}\n\n\t\tconst previousRootView = this._rootView;\n\t\tif (previousRootView) {\n\t\t\tpreviousRootView._onRootViewReset();\n\t\t}\n\n\t\tthis._takeRootView(view);\n\t\tthis._applyRootViewSettings(view);\n\t\tthis._setNativeContent(view);\n\n\t\tthis._notifyEvent(NativeWindowEvents.contentLoaded);\n\t}\n\n\t/**\n\t * @internal – take ownership of a root view the platform pipeline built and attached itself.\n\t *\n\t * The pipeline already ran `_setupAsRootView` and `Application.initRootView` on this view and\n\t * installed it on the native surface, so neither `_applyRootViewSettings` nor `_setNativeContent`\n\t * may run here — both would redo that work.\n\t */\n\t_adoptRootView(view: View): void {\n\t\tif (!view || this._rootView === view) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._takeRootView(view);\n\n\t\tthis._notifyEvent(NativeWindowEvents.contentLoaded);\n\t}\n\n\t/**\n\t * @internal – give up the root view without tearing it down.\n\t *\n\t * Called when another window takes the view over: the view is being moved, not\n\t * destroyed, so — unlike {@link _onDestroy} — nothing here unloads, resets or tears\n\t * down the view. It stays loaded and usable in its new window.\n\t */\n\t_releaseRootView(): void {\n\t\tconst rootView = this._rootView;\n\t\tif (!rootView) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._onReleaseRootView(rootView);\n\n\t\trootView._nativeWindow = null;\n\t\tthis._rootView = null;\n\t}\n\n\t/**\n\t * Platform hook: unhook the released view from the native surface. The view itself\n\t * must survive — it is on its way into another window.\n\t */\n\tprotected _onReleaseRootView(rootView: View): void {\n\t\t// noop\n\t}\n\n\t/**\n\t * Becomes the owner of `view`, releasing it from whichever window held it before.\n\t */\n\tprivate _takeRootView(view: View): void {\n\t\tconst currentOwner = view._nativeWindow;\n\t\tif (currentOwner && currentOwner !== this) {\n\t\t\tcurrentOwner._releaseRootView();\n\t\t}\n\n\t\tif (this._rootView && this._rootView !== view) {\n\t\t\tthis._rootView._nativeWindow = null;\n\t\t}\n\n\t\tthis._rootView = view;\n\t\tview._nativeWindow = this;\n\t}\n\n\t/**\n\t * Platform-specific: apply the view to the native window surface.\n\t */\n\tprotected abstract _setNativeContent(view: View): void;\n\n\t/**\n\t * Get the current orientation of this window.\n\t *\n\t * Read from the native surface while the window is attached; a detached window\n\t * reports the last value it saw.\n\t *\n\t * A read that catches a change the platform has not reported yet goes through\n\t * {@link _setOrientation}, so the change is never swallowed by the reading.\n\t */\n\torientation(): 'portrait' | 'landscape' | 'unknown' {\n\t\tif (this.state === 'attached') {\n\t\t\tconst value = this._getOrientation();\n\t\t\tif (this._orientation === undefined) {\n\t\t\t\tthis._orientation = value;\n\t\t\t} else if (this._orientation !== value) {\n\t\t\t\tthis._setOrientation(value);\n\t\t\t}\n\t\t}\n\n\t\treturn this._orientation;\n\t}\n\n\t/**\n\t * Get the current system appearance of this window.\n\t *\n\t * Read from the native surface while the window is attached; a detached window\n\t * reports the last value it saw.\n\t *\n\t * A read that catches a change the platform has not reported yet goes through\n\t * {@link _setSystemAppearance}, so the change is never swallowed by the reading.\n\t */\n\tsystemAppearance(): 'light' | 'dark' | null {\n\t\tif (this.state === 'attached') {\n\t\t\tconst value = this._getSystemAppearance();\n\t\t\tif (this._systemAppearance === undefined) {\n\t\t\t\tthis._systemAppearance = value;\n\t\t\t} else if (this._systemAppearance !== value && value !== null) {\n\t\t\t\tthis._setSystemAppearance(value);\n\t\t\t}\n\t\t}\n\n\t\treturn this._systemAppearance;\n\t}\n\n\t/**\n\t * Get the current layout direction of this window.\n\t *\n\t * Read from the native surface while the window is attached; a detached window\n\t * reports the last value it saw.\n\t *\n\t * A read that catches a change the platform has not reported yet goes through\n\t * {@link _setLayoutDirection}, so the change is never swallowed by the reading.\n\t */\n\tlayoutDirection(): CoreTypes.LayoutDirectionType | null {\n\t\tif (this.state === 'attached') {\n\t\t\tconst value = this._getLayoutDirection();\n\t\t\tif (this._layoutDirection === undefined) {\n\t\t\t\tthis._layoutDirection = value;\n\t\t\t} else if (this._layoutDirection !== value && value !== null) {\n\t\t\t\tthis._setLayoutDirection(value);\n\t\t\t}\n\t\t}\n\n\t\treturn this._layoutDirection;\n\t}\n\n\t// --- Typed event overloads ---\n\n\t// The whole set is repeated here: TypeScript only accepts an override whose overloads\n\t// cover every overload of the base signature.\n\ton(event: 'contentLoaded', callback: (data: NativeWindowEventData) => void, thisArg?: any): void;\n\ton(event: 'activate', callback: (data: NativeWindowEventData) => void, thisArg?: any): void;\n\ton(event: 'deactivate', callback: (data: NativeWindowEventData) => void, thisArg?: any): void;\n\ton(event: 'background', callback: (data: NativeWindowEventData) => void, thisArg?: any): void;\n\ton(event: 'foreground', callback: (data: NativeWindowEventData) => void, thisArg?: any): void;\n\ton(event: 'close', callback: (data: NativeWindowEventData) => void, thisArg?: any): void;\n\ton(event: 'attached', callback: (data: NativeWindowEventData) => void, thisArg?: any): void;\n\ton(event: 'detached', callback: (data: NativeWindowEventData) => void, thisArg?: any): void;\n\ton(event: 'displayed', callback: (data: NativeWindowEventData) => void, thisArg?: any): void;\n\ton(event: 'orientationChanged', callback: (data: WindowOrientationChangedEventData) => void, thisArg?: any): void;\n\ton(event: 'systemAppearanceChanged', callback: (data: WindowSystemAppearanceChangedEventData) => void, thisArg?: any): void;\n\ton(event: 'layoutDirectionChanged', callback: (data: WindowLayoutDirectionChangedEventData) => void, thisArg?: any): void;\n\ton(event: 'activityCreated', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any): void;\n\ton(event: 'activityDestroyed', callback: (args: AndroidActivityEventData) => void, thisArg?: any): void;\n\ton(event: 'activityStarted', callback: (args: AndroidActivityEventData) => void, thisArg?: any): void;\n\ton(event: 'activityPaused', callback: (args: AndroidActivityEventData) => void, thisArg?: any): void;\n\ton(event: 'activityResumed', callback: (args: AndroidActivityEventData) => void, thisArg?: any): void;\n\ton(event: 'activityStopped', callback: (args: AndroidActivityEventData) => void, thisArg?: any): void;\n\ton(event: 'saveActivityState', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any): void;\n\ton(event: 'activityResult', callback: (args: AndroidActivityResultEventData) => void, thisArg?: any): void;\n\ton(event: 'activityBackPressed', callback: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any): void;\n\ton(event: 'activityNewIntent', callback: (args: AndroidActivityNewIntentEventData) => void, thisArg?: any): void;\n\ton(event: 'activityRequestPermissions', callback: (args: AndroidActivityRequestPermissionsEventData) => void, thisArg?: any): void;\n\ton(event: 'sceneWillConnect', callback: (args: SceneEventData) => void, thisArg?: any): void;\n\ton(event: 'sceneDidActivate', callback: (args: SceneEventData) => void, thisArg?: any): void;\n\ton(event: 'sceneWillResignActive', callback: (args: SceneEventData) => void, thisArg?: any): void;\n\ton(event: 'sceneWillEnterForeground', callback: (args: SceneEventData) => void, thisArg?: any): void;\n\ton(event: 'sceneDidEnterBackground', callback: (args: SceneEventData) => void, thisArg?: any): void;\n\ton(event: 'sceneDidDisconnect', callback: (args: SceneEventData) => void, thisArg?: any): void;\n\ton(event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any): void;\n\ton(event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any): void;\n\ton(event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any): void;\n\ton(eventName: string, callback: (data: NativeWindowEventData) => void, thisArg?: any): void;\n\ton(eventName: string, callback: (data: any) => void, thisArg?: any): void {\n\t\tsuper.on(eventName, callback, thisArg);\n\t}\n\n\t// Platform-specific abstract getters\n\tprotected abstract _getOrientation(): 'portrait' | 'landscape' | 'unknown';\n\tprotected abstract _getSystemAppearance(): 'light' | 'dark' | null;\n\tprotected abstract _getLayoutDirection(): CoreTypes.LayoutDirectionType | null;\n\n\t// --- Root view CSS class management ---\n\n\t/**\n\t * Applies platform, orientation, appearance, and layout direction CSS classes\n\t * to the root view.\n\t */\n\tprotected _applyRootViewSettings(rootView: View): void {\n\t\trootView._setupAsRootView({});\n\t\tthis._setRootViewCSSClasses(rootView);\n\t\t// TODO(merge): the fork replaced upstream's readyInit*/applyAccessibilityCssToRoot with accessibility-css-helper.ts\n\t\t// (initAccessibilityCssHelper); verify a11y/font-scale classes reach secondary windows' root views.\n\t\trootView._onCssStateChange(true);\n\t}\n\n\tprivate _setRootViewCSSClasses(rootView: View): void {\n\t\tconst platform = Device.os.toLowerCase();\n\t\tconst deviceType = Device.deviceType.toLowerCase();\n\n\t\tif (platform) {\n\t\t\tCSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}`);\n\n\t\t\t// SDK Version CSS classes\n\t\t\t// Add exact version class (e.g., .ns-ios-26 or .ns-android-36)\n\t\t\t// this acts like 'gte' for that major version range\n\t\t\t// e.g., if user wants iOS 27, they can add .ns-ios-27 specifiers\n\t\t\tCSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${platform}-${Math.floor(SDK_VERSION)}`);\n\t\t}\n\n\t\tif (deviceType) {\n\t\t\tCSSUtils.pushToSystemCssClasses(`${CSSUtils.CLASS_PREFIX}${deviceType}`);\n\t\t}\n\n\t\trootView.cssClasses.add(CSSUtils.ROOT_VIEW_CSS_CLASS);\n\t\tconst rootViewCssClasses = CSSUtils.getSystemCssClasses();\n\t\trootViewCssClasses.forEach((c) => rootView.cssClasses.add(c));\n\n\t\t// Two windows can disagree on these, so they never reach the process-wide\n\t\t// system class list — see CSSUtils.WINDOW_SCOPED_CSS_CLASSES.\n\t\tconst orientationValue = this.orientation();\n\t\tconst appearanceValue = this.systemAppearance();\n\t\tconst directionValue = this.layoutDirection();\n\n\t\tif (orientationValue) {\n\t\t\trootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${orientationValue}`);\n\t\t}\n\n\t\tif (appearanceValue) {\n\t\t\trootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${appearanceValue}`);\n\t\t}\n\n\t\tif (directionValue) {\n\t\t\trootView.cssClasses.add(`${CSSUtils.CLASS_PREFIX}${directionValue}`);\n\t\t}\n\n\t\tthis._increaseStyleScopeVersion(rootView);\n\t\trootView._onCssStateChange();\n\n\t\tif (Trace.isEnabled()) {\n\t\t\tconst rootCssClasses = Array.from(rootView.cssClasses);\n\t\t\tTrace.write(`NativeWindow [${this.id}] Setting root css classes: ${rootCssClasses.join(' ')}`, Trace.categories.Style);\n\t\t}\n\t}\n\n\t// --- Orientation / Appearance / Direction change handling ---\n\n\t/**\n\t * @internal – called by platform when orientation changes for this window.\n\t */\n\t_setOrientation(value: 'portrait' | 'landscape' | 'unknown'): void {\n\t\tif (this._orientation === value) {\n\t\t\treturn;\n\t\t}\n\t\tthis._orientation = value;\n\t\tif (this._rootView) {\n\t\t\tconst cssClass = `${CSSUtils.CLASS_PREFIX}${value}`;\n\t\t\tthis._applyCssClass(this._rootView, ORIENTATION_CSS_CLASSES, cssClass);\n\t\t}\n\t\tthis._notifyValueChanged(NativeWindowEvents.orientationChanged, value);\n\t}\n\n\t/**\n\t * @internal – called by platform when system appearance changes for this window.\n\t */\n\t_setSystemAppearance(value: 'dark' | 'light'): void {\n\t\tif (this._systemAppearance === value) {\n\t\t\treturn;\n\t\t}\n\t\tthis._systemAppearance = value;\n\t\t// `Application.autoSystemAppearanceChanged` opts out of the CSS classes only —\n\t\t// the event still fires so apps driving their own theming can react to it.\n\t\tif (this._rootView && getAutoSystemAppearanceChanged()) {\n\t\t\tconst cssClass = `${CSSUtils.CLASS_PREFIX}${value}`;\n\t\t\tthis._applyCssClass(this._rootView, SYSTEM_APPEARANCE_CSS_CLASSES, cssClass);\n\t\t}\n\t\tthis._notifyValueChanged(NativeWindowEvents.systemAppearanceChanged, value);\n\t}\n\n\t/**\n\t * @internal – called by platform when layout direction changes for this window.\n\t */\n\t_setLayoutDirection(value: CoreTypes.LayoutDirectionType): void {\n\t\tif (this._layoutDirection === value) {\n\t\t\treturn;\n\t\t}\n\t\tthis._layoutDirection = value;\n\t\tif (this._rootView) {\n\t\t\tconst cssClass = `${CSSUtils.CLASS_PREFIX}${value}`;\n\t\t\tthis._applyCssClass(this._rootView, LAYOUT_DIRECTION_CSS_CLASSES, cssClass);\n\t\t}\n\t\tthis._notifyValueChanged(NativeWindowEvents.layoutDirectionChanged, value);\n\t}\n\n\t// --- Internal helpers ---\n\n\tprivate _notifyValueChanged(eventName: NativeWindowEventName, newValue: unknown): void {\n\t\tthis.notify({\n\t\t\teventName,\n\t\t\tobject: this,\n\t\t\twindow: this,\n\t\t\tnewValue,\n\t\t});\n\t}\n\n\tprivate _applyCssClass(rootView: View, cssClasses: string[], newCssClass: string): void {\n\t\tif (!rootView.cssClasses.has(newCssClass)) {\n\t\t\tcssClasses.forEach((cssClass) => rootView.cssClasses.delete(cssClass));\n\t\t\trootView.cssClasses.add(newCssClass);\n\t\t\tthis._increaseStyleScopeVersion(rootView);\n\t\t\trootView._onCssStateChange();\n\t\t}\n\n\t\t// The modal registry is process-wide, so only the modals presented over this\n\t\t// window's root view may follow it.\n\t\tconst rootModalViews = <Array<View>>rootView._getRootModalViews();\n\t\trootModalViews.forEach((modalView) => {\n\t\t\tif (modalView._getRootModalHost() !== rootView) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!modalView.cssClasses.has(newCssClass)) {\n\t\t\t\tcssClasses.forEach((cssClass) => modalView.cssClasses.delete(cssClass));\n\t\t\t\tmodalView.cssClasses.add(newCssClass);\n\t\t\t\tmodalView._onCssStateChange();\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _increaseStyleScopeVersion(rootView: View): void {\n\t\tconst styleScope: StyleScope = rootView._styleScope ?? (rootView as unknown as Frame)?.currentPage?._styleScope;\n\t\tif (styleScope) {\n\t\t\tstyleScope._increaseApplicationCssSelectorVersion();\n\t\t}\n\t}\n\n\t/**\n\t * @internal – the native surface went away but the window session lives on.\n\t *\n\t * The window stays registered and keeps its listeners, so app code that subscribed\n\t * to it keeps working once a surface re-attaches. The root view keeps pointing back at\n\t * this window for the same reason — it is still this window's content.\n\t */\n\t_detach(): void {\n\t\tthis._surfaceGone = true;\n\n\t\t// Take a final reading while the surface can still answer and the root view is\n\t\t// still up: from here on these are what the window reports.\n\t\tthis.orientation();\n\t\tthis.systemAppearance();\n\t\tthis.layoutDirection();\n\n\t\tif (this._rootView) {\n\t\t\tif (this._rootView.isLoaded) {\n\t\t\t\tthis._rootView.callUnloaded();\n\t\t\t}\n\t\t\tthis._rootView._tearDownUI(true);\n\t\t\tthis._rootView._onRootViewReset();\n\t\t}\n\n\t\tthis._setState('detached');\n\t\tthis._notifyEvent(NativeWindowEvents.detached);\n\t}\n\n\tprotected _onDestroy(): void {\n\t\tsuper._onDestroy();\n\t\tif (this._rootView) {\n\t\t\tif (this._rootView.isLoaded) {\n\t\t\t\tthis._rootView.callUnloaded();\n\t\t\t}\n\t\t\tthis._rootView._onRootViewReset();\n\t\t\tthis._rootView._nativeWindow = null;\n\t\t\tthis._rootView = null;\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,186 @@
1
+ import type { CoreTypes } from '../core-types';
2
+ import type { EventData } from '../data/observable';
3
+ import type { View } from '../ui/core/view';
4
+ import type { NavigationEntry } from '../ui/frame/frame-interfaces';
5
+ import type { NativeWindow, WindowBase } from '.';
6
+ /**
7
+ * Events emitted by a NativeWindow instance.
8
+ */
9
+ export declare const NativeWindowEvents: {
10
+ /** Fired when the window becomes the active/focused window. */
11
+ readonly activate: "activate";
12
+ /** Fired when the window loses focus. */
13
+ readonly deactivate: "deactivate";
14
+ /** Fired when the window enters the background. */
15
+ readonly background: "background";
16
+ /** Fired when the window enters the foreground. */
17
+ readonly foreground: "foreground";
18
+ /**
19
+ * Fired when the window session ends for good. Fires at most once per window;
20
+ * every listener on the window is dropped right after it is dispatched.
21
+ */
22
+ readonly close: "close";
23
+ /** Fired when a native surface is bound to the window, both on first connect and on every re-attach. */
24
+ readonly attached: "attached";
25
+ /**
26
+ * Fired when the native surface goes away while the window session stays alive
27
+ * (iOS scene disconnect, Android activity recreation). The window stays registered
28
+ * and keeps its listeners, so the same instance is reused when `attached` fires again.
29
+ */
30
+ readonly detached: "detached";
31
+ /** Fired after the window content has been displayed for the first time. */
32
+ readonly displayed: "displayed";
33
+ /** Fired when the root view content is set or changed. */
34
+ readonly contentLoaded: "contentLoaded";
35
+ /** Fired when the orientation of this window changes. */
36
+ readonly orientationChanged: "orientationChanged";
37
+ /** Fired when the system appearance of this window changes between light and dark. */
38
+ readonly systemAppearanceChanged: "systemAppearanceChanged";
39
+ /** Fired when the layout direction of this window changes between ltr and rtl. */
40
+ readonly layoutDirectionChanged: "layoutDirectionChanged";
41
+ /** Fired when the scene is about to connect (iOS only). */
42
+ readonly sceneWillConnect: "sceneWillConnect";
43
+ /** Fired when the scene becomes active (iOS only). */
44
+ readonly sceneDidActivate: "sceneDidActivate";
45
+ /** Fired when the scene is about to resign active state (iOS only). */
46
+ readonly sceneWillResignActive: "sceneWillResignActive";
47
+ /** Fired when the scene is about to enter the foreground (iOS only). */
48
+ readonly sceneWillEnterForeground: "sceneWillEnterForeground";
49
+ /** Fired when the scene has entered the background (iOS only). */
50
+ readonly sceneDidEnterBackground: "sceneDidEnterBackground";
51
+ /** Fired when the scene has disconnected (iOS only). */
52
+ readonly sceneDidDisconnect: "sceneDidDisconnect";
53
+ /** Fired when the scene is asked to open one or more URLs (iOS only). */
54
+ readonly sceneOpenURLContexts: "sceneOpenURLContexts";
55
+ /** Fired when the scene is asked to continue a handoff/universal link activity (iOS only). */
56
+ readonly sceneContinueUserActivity: "sceneContinueUserActivity";
57
+ /** Fired when a home screen quick action is directed at the scene (iOS only). */
58
+ readonly scenePerformActionForShortcutItem: "scenePerformActionForShortcutItem";
59
+ /** Fired when the activity is created (Android only). */
60
+ readonly activityCreated: "activityCreated";
61
+ /** Fired when the activity is destroyed (Android only). */
62
+ readonly activityDestroyed: "activityDestroyed";
63
+ /** Fired when the activity is started (Android only). */
64
+ readonly activityStarted: "activityStarted";
65
+ /** Fired when the activity is paused (Android only). */
66
+ readonly activityPaused: "activityPaused";
67
+ /** Fired when the activity is resumed (Android only). */
68
+ readonly activityResumed: "activityResumed";
69
+ /** Fired when the activity is stopped (Android only). */
70
+ readonly activityStopped: "activityStopped";
71
+ /** Fired when the activity state is being saved (Android only). */
72
+ readonly saveActivityState: "saveActivityState";
73
+ /** Fired when the activity receives a result (Android only). */
74
+ readonly activityResult: "activityResult";
75
+ /** Fired when the back button is pressed (Android only). */
76
+ readonly activityBackPressed: "activityBackPressed";
77
+ /** Fired when the activity receives a new intent (Android only). */
78
+ readonly activityNewIntent: "activityNewIntent";
79
+ /** Fired when permission results are received (Android only). */
80
+ readonly activityRequestPermissions: "activityRequestPermissions";
81
+ };
82
+ export type NativeWindowEventName = (typeof NativeWindowEvents)[keyof typeof NativeWindowEvents];
83
+ /**
84
+ * Application-level events related to window management.
85
+ */
86
+ export declare const WindowEvents: {
87
+ /** Fired on Application when a new NativeWindow is created. */
88
+ readonly windowOpen: "windowOpen";
89
+ /** Fired on Application when a NativeWindow is closed/destroyed. */
90
+ readonly windowClose: "windowClose";
91
+ /** Fired on Application when another window takes over the primary role. */
92
+ readonly primaryWindowChanged: "primaryWindowChanged";
93
+ };
94
+ /**
95
+ * Base event data for window surface events.
96
+ */
97
+ export interface WindowBaseEventData extends EventData {
98
+ /** The window that emitted the event. */
99
+ window: WindowBase;
100
+ }
101
+ /**
102
+ * Base event data for NativeWindow events.
103
+ */
104
+ export interface NativeWindowEventData extends WindowBaseEventData {
105
+ /** The NativeWindow that emitted the event. */
106
+ window: NativeWindow;
107
+ }
108
+ /**
109
+ * Event data for the `orientationChanged` event of a NativeWindow.
110
+ */
111
+ export interface WindowOrientationChangedEventData extends NativeWindowEventData {
112
+ /** The orientation the window is now in. */
113
+ newValue: 'portrait' | 'landscape' | 'unknown';
114
+ }
115
+ /**
116
+ * Event data for the `systemAppearanceChanged` event of a NativeWindow.
117
+ */
118
+ export interface WindowSystemAppearanceChangedEventData extends NativeWindowEventData {
119
+ /** The system appearance the window is now showing. */
120
+ newValue: 'light' | 'dark';
121
+ }
122
+ /**
123
+ * Event data for the `layoutDirectionChanged` event of a NativeWindow.
124
+ */
125
+ export interface WindowLayoutDirectionChangedEventData extends NativeWindowEventData {
126
+ /** The layout direction the window is now using. */
127
+ newValue: CoreTypes.LayoutDirectionType;
128
+ }
129
+ /**
130
+ * Event data fired on Application when a window opens.
131
+ */
132
+ export interface WindowOpenEventData extends EventData {
133
+ /** The NativeWindow that was opened. */
134
+ window: NativeWindow;
135
+ }
136
+ /**
137
+ * Event data fired on Application when a window closes.
138
+ */
139
+ export interface WindowCloseEventData extends EventData {
140
+ /** The NativeWindow that was closed. */
141
+ window: NativeWindow;
142
+ }
143
+ /**
144
+ * Event data fired on Application when the primary window changes.
145
+ */
146
+ export interface PrimaryWindowChangedEventData extends EventData {
147
+ /** The NativeWindow that is now primary. */
148
+ window: NativeWindow;
149
+ }
150
+ /**
151
+ * Options for opening a new window.
152
+ */
153
+ export interface WindowOpenOptions {
154
+ /**
155
+ * Data to pass to the new window.
156
+ * On iOS: serialized into NSUserActivity.userInfo.
157
+ * On Android: added as intent extras.
158
+ */
159
+ data?: Record<string, any>;
160
+ }
161
+ /**
162
+ * Supplies the UI for a window that needs content. Called once per window that needs it.
163
+ *
164
+ * Return a `View`, a `NavigationEntry` or a module name to set the window content,
165
+ * `null` to take ownership and set the content asynchronously later, or `undefined`
166
+ * to fall back to the application main entry.
167
+ */
168
+ export type WindowContentResolver = (request: WindowContentRequest) => View | NavigationEntry | string | null | undefined;
169
+ /**
170
+ * Describes the window asking for content.
171
+ */
172
+ export interface WindowContentRequest {
173
+ /** The window that needs content. */
174
+ window: NativeWindow;
175
+ /** Whether the window is the application's primary window. */
176
+ isPrimary: boolean;
177
+ /** NSUserActivity.userInfo on iOS, intent extras on Android. */
178
+ data?: Record<string, any>;
179
+ ios?: {
180
+ connectionOptions?: UISceneConnectionOptions;
181
+ };
182
+ android?: {
183
+ intent?: android.content.Intent;
184
+ savedInstanceState?: android.os.Bundle;
185
+ };
186
+ }