@nativescript/vite 8.0.0-beta.0 → 8.0.0-rc.0

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 (577) hide show
  1. package/README.md +73 -14
  2. package/bin/cli.cjs +8 -14
  3. package/configuration/angular.d.ts +35 -2
  4. package/configuration/angular.js +541 -216
  5. package/configuration/angular.js.map +1 -1
  6. package/configuration/base.js +227 -77
  7. package/configuration/base.js.map +1 -1
  8. package/configuration/javascript.js +17 -96
  9. package/configuration/javascript.js.map +1 -1
  10. package/configuration/react.js +41 -73
  11. package/configuration/react.js.map +1 -1
  12. package/configuration/solid.js +58 -6
  13. package/configuration/solid.js.map +1 -1
  14. package/configuration/typescript.js +15 -96
  15. package/configuration/typescript.js.map +1 -1
  16. package/helpers/app-components.d.ts +2 -1
  17. package/helpers/app-components.js.map +1 -1
  18. package/helpers/app-css-refresh.d.ts +31 -0
  19. package/helpers/app-css-refresh.js +43 -0
  20. package/helpers/app-css-refresh.js.map +1 -0
  21. package/helpers/app-css-state.d.ts +17 -0
  22. package/helpers/app-css-state.js +51 -0
  23. package/helpers/app-css-state.js.map +1 -0
  24. package/helpers/bundler-context.d.ts +11 -0
  25. package/helpers/bundler-context.js +71 -0
  26. package/helpers/bundler-context.js.map +1 -0
  27. package/helpers/cli-flags.d.ts +12 -0
  28. package/helpers/cli-flags.js +34 -0
  29. package/helpers/cli-flags.js.map +1 -1
  30. package/helpers/commonjs-plugins.d.ts +5 -2
  31. package/helpers/commonjs-plugins.js +126 -0
  32. package/helpers/commonjs-plugins.js.map +1 -1
  33. package/helpers/config-as-json.js +10 -0
  34. package/helpers/config-as-json.js.map +1 -1
  35. package/helpers/css-platform-plugin.d.ts +14 -0
  36. package/helpers/css-platform-plugin.js +43 -25
  37. package/helpers/css-platform-plugin.js.map +1 -1
  38. package/helpers/dev-host.d.ts +360 -0
  39. package/helpers/dev-host.js +694 -0
  40. package/helpers/dev-host.js.map +1 -0
  41. package/helpers/dynamic-import-plugin.d.ts +2 -1
  42. package/helpers/dynamic-import-plugin.js +59 -53
  43. package/helpers/dynamic-import-plugin.js.map +1 -1
  44. package/helpers/esbuild-platform-resolver.js +9 -6
  45. package/helpers/esbuild-platform-resolver.js.map +1 -1
  46. package/helpers/external-configs.d.ts +10 -4
  47. package/helpers/external-configs.js +63 -15
  48. package/helpers/external-configs.js.map +1 -1
  49. package/helpers/flavor.d.ts +13 -0
  50. package/helpers/flavor.js +18 -1
  51. package/helpers/flavor.js.map +1 -1
  52. package/helpers/global-defines.d.ts +117 -0
  53. package/helpers/global-defines.js +209 -11
  54. package/helpers/global-defines.js.map +1 -1
  55. package/helpers/hmr-scope.d.ts +26 -0
  56. package/helpers/hmr-scope.js +67 -0
  57. package/helpers/hmr-scope.js.map +1 -0
  58. package/helpers/import-meta-path.d.ts +4 -0
  59. package/helpers/import-meta-path.js +5 -0
  60. package/helpers/import-meta-path.js.map +1 -0
  61. package/helpers/import-specifier.d.ts +1 -0
  62. package/helpers/import-specifier.js +18 -0
  63. package/helpers/import-specifier.js.map +1 -0
  64. package/helpers/init.js +6 -20
  65. package/helpers/init.js.map +1 -1
  66. package/helpers/logging.d.ts +1 -0
  67. package/helpers/logging.js +65 -4
  68. package/helpers/logging.js.map +1 -1
  69. package/helpers/main-entry.d.ts +8 -2
  70. package/helpers/main-entry.js +622 -120
  71. package/helpers/main-entry.js.map +1 -1
  72. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  73. package/helpers/nativeclass-esbuild-plugin.js +6 -1
  74. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  75. package/helpers/nativeclass-transform.d.ts +13 -0
  76. package/helpers/nativeclass-transform.js +42 -131
  77. package/helpers/nativeclass-transform.js.map +1 -1
  78. package/helpers/nativeclass-transformer-plugin.d.ts +19 -1
  79. package/helpers/nativeclass-transformer-plugin.js +324 -37
  80. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  81. package/helpers/nativescript-package-resolver.js +10 -62
  82. package/helpers/nativescript-package-resolver.js.map +1 -1
  83. package/helpers/normalize-id.d.ts +42 -0
  84. package/helpers/normalize-id.js +60 -0
  85. package/helpers/normalize-id.js.map +1 -0
  86. package/helpers/ns-core-external-urls.d.ts +32 -0
  87. package/helpers/ns-core-external-urls.js +107 -0
  88. package/helpers/ns-core-external-urls.js.map +1 -0
  89. package/helpers/ns-core-url.d.ts +106 -0
  90. package/helpers/ns-core-url.js +225 -0
  91. package/helpers/ns-core-url.js.map +1 -0
  92. package/helpers/optimize-deps.d.ts +16 -0
  93. package/helpers/optimize-deps.js +17 -0
  94. package/helpers/optimize-deps.js.map +1 -0
  95. package/helpers/package-platform-aliases.js +34 -49
  96. package/helpers/package-platform-aliases.js.map +1 -1
  97. package/helpers/platform-types.d.ts +2 -0
  98. package/helpers/platform-types.js +2 -0
  99. package/helpers/platform-types.js.map +1 -0
  100. package/helpers/postcss-platform-config.d.ts +17 -1
  101. package/helpers/postcss-platform-config.js +20 -37
  102. package/helpers/postcss-platform-config.js.map +1 -1
  103. package/helpers/project.d.ts +35 -0
  104. package/helpers/project.js +120 -2
  105. package/helpers/project.js.map +1 -1
  106. package/helpers/resolve-main-field-platform.d.ts +20 -0
  107. package/helpers/resolve-main-field-platform.js +49 -0
  108. package/helpers/resolve-main-field-platform.js.map +1 -0
  109. package/helpers/resolver.js +17 -2
  110. package/helpers/resolver.js.map +1 -1
  111. package/helpers/theme-core-plugins.js +1 -1
  112. package/helpers/theme-core-plugins.js.map +1 -1
  113. package/helpers/ts-config-paths.d.ts +32 -0
  114. package/helpers/ts-config-paths.js +156 -27
  115. package/helpers/ts-config-paths.js.map +1 -1
  116. package/helpers/typescript-check.d.ts +2 -1
  117. package/helpers/typescript-check.js +4 -4
  118. package/helpers/typescript-check.js.map +1 -1
  119. package/helpers/ui-registration.d.ts +21 -0
  120. package/helpers/ui-registration.js +156 -0
  121. package/helpers/ui-registration.js.map +1 -0
  122. package/helpers/utils.d.ts +9 -0
  123. package/helpers/utils.js +22 -2
  124. package/helpers/utils.js.map +1 -1
  125. package/helpers/vite-package-version.d.ts +7 -0
  126. package/helpers/vite-package-version.js +44 -0
  127. package/helpers/vite-package-version.js.map +1 -0
  128. package/helpers/workers.d.ts +40 -19
  129. package/helpers/workers.js +312 -13
  130. package/helpers/workers.js.map +1 -1
  131. package/hmr/client/css-handler.d.ts +2 -1
  132. package/hmr/client/css-handler.js +95 -23
  133. package/hmr/client/css-handler.js.map +1 -1
  134. package/hmr/client/css-update-overlay.d.ts +18 -0
  135. package/hmr/client/css-update-overlay.js +27 -0
  136. package/hmr/client/css-update-overlay.js.map +1 -0
  137. package/hmr/client/framework-client-strategy.d.ts +87 -0
  138. package/hmr/client/framework-client-strategy.js +18 -0
  139. package/hmr/client/framework-client-strategy.js.map +1 -0
  140. package/hmr/client/hmr-pending-overlay.d.ts +13 -0
  141. package/hmr/client/hmr-pending-overlay.js +41 -0
  142. package/hmr/client/hmr-pending-overlay.js.map +1 -0
  143. package/hmr/client/hot-context.d.ts +67 -0
  144. package/hmr/client/hot-context.js +307 -0
  145. package/hmr/client/hot-context.js.map +1 -0
  146. package/hmr/client/index.d.ts +9 -1
  147. package/hmr/client/index.js +91 -1418
  148. package/hmr/client/index.js.map +1 -1
  149. package/hmr/client/overlay-driver.d.ts +10 -0
  150. package/hmr/client/overlay-driver.js +33 -0
  151. package/hmr/client/overlay-driver.js.map +1 -0
  152. package/hmr/client/protocol-dispatch.d.ts +8 -0
  153. package/hmr/client/protocol-dispatch.js +308 -0
  154. package/hmr/client/protocol-dispatch.js.map +1 -0
  155. package/hmr/client/root-reset.d.ts +15 -0
  156. package/hmr/client/root-reset.js +358 -0
  157. package/hmr/client/root-reset.js.map +1 -0
  158. package/hmr/client/strategy-loader.d.ts +24 -0
  159. package/hmr/client/strategy-loader.js +100 -0
  160. package/hmr/client/strategy-loader.js.map +1 -0
  161. package/hmr/client/update-pipeline.d.ts +27 -0
  162. package/hmr/client/update-pipeline.js +464 -0
  163. package/hmr/client/update-pipeline.js.map +1 -0
  164. package/hmr/client/utils.d.ts +14 -1
  165. package/hmr/client/utils.js +265 -54
  166. package/hmr/client/utils.js.map +1 -1
  167. package/hmr/client/ws-transport.d.ts +21 -0
  168. package/hmr/client/ws-transport.js +323 -0
  169. package/hmr/client/ws-transport.js.map +1 -0
  170. package/hmr/entry-runtime.d.ts +11 -0
  171. package/hmr/entry-runtime.js +566 -43
  172. package/hmr/entry-runtime.js.map +1 -1
  173. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  174. package/hmr/frameworks/angular/build/angular-linker.js +113 -0
  175. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  176. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  177. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  178. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  179. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  180. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  181. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  182. package/hmr/frameworks/angular/build/inline-decorator-component-templates.d.ts +3 -0
  183. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js +231 -0
  184. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  185. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  186. package/hmr/frameworks/angular/build/js-lexer.js +182 -0
  187. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  188. package/hmr/frameworks/angular/build/linker-stats.d.ts +18 -0
  189. package/hmr/frameworks/angular/build/linker-stats.js +29 -0
  190. package/hmr/frameworks/angular/build/linker-stats.js.map +1 -0
  191. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  192. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  193. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  194. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.d.ts +1 -0
  195. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  196. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  197. package/hmr/frameworks/angular/build/synthesize-injectable-factories.d.ts +3 -0
  198. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js +241 -0
  199. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  200. package/hmr/frameworks/angular/build/ts-fallback-transform.d.ts +5 -0
  201. package/hmr/frameworks/angular/build/ts-fallback-transform.js +138 -0
  202. package/hmr/frameworks/angular/build/ts-fallback-transform.js.map +1 -0
  203. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  204. package/hmr/frameworks/angular/build/util.js +155 -0
  205. package/hmr/frameworks/angular/build/util.js.map +1 -0
  206. package/hmr/frameworks/angular/build/worker-url-preserve.d.ts +5 -0
  207. package/hmr/frameworks/angular/build/worker-url-preserve.js +140 -0
  208. package/hmr/frameworks/angular/build/worker-url-preserve.js.map +1 -0
  209. package/hmr/frameworks/angular/client/index.d.ts +2 -1
  210. package/hmr/frameworks/angular/client/index.js +637 -23
  211. package/hmr/frameworks/angular/client/index.js.map +1 -1
  212. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  213. package/hmr/frameworks/angular/client/strategy.js +19 -0
  214. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  215. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  216. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  217. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  218. package/hmr/frameworks/angular/server/linker.js +37 -6
  219. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  220. package/hmr/frameworks/angular/server/ng-component-route.d.ts +43 -0
  221. package/hmr/frameworks/angular/server/ng-component-route.js +113 -0
  222. package/hmr/frameworks/angular/server/ng-component-route.js.map +1 -0
  223. package/hmr/frameworks/angular/server/strategy.js +697 -18
  224. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  225. package/hmr/frameworks/angular/server/websocket-angular-entry.d.ts +2 -0
  226. package/hmr/frameworks/angular/server/websocket-angular-entry.js +68 -0
  227. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  228. package/hmr/frameworks/angular/server/websocket-angular-hot-update.d.ts +94 -0
  229. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +485 -0
  230. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  231. package/hmr/frameworks/react/client/strategy.d.ts +12 -0
  232. package/hmr/frameworks/react/client/strategy.js +27 -0
  233. package/hmr/frameworks/react/client/strategy.js.map +1 -0
  234. package/hmr/frameworks/react/server/strategy.d.ts +2 -0
  235. package/hmr/frameworks/react/server/strategy.js +230 -0
  236. package/hmr/frameworks/react/server/strategy.js.map +1 -0
  237. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  238. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  239. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  240. package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
  241. package/hmr/frameworks/solid/client/app-runtime.js +252 -0
  242. package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
  243. package/hmr/frameworks/solid/client/strategy.d.ts +7 -0
  244. package/hmr/frameworks/solid/client/strategy.js +391 -0
  245. package/hmr/frameworks/solid/client/strategy.js.map +1 -0
  246. package/hmr/frameworks/solid/server/strategy.js +293 -16
  247. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  248. package/hmr/frameworks/typescript/client/strategy.d.ts +7 -0
  249. package/hmr/frameworks/typescript/client/strategy.js +418 -0
  250. package/hmr/frameworks/typescript/client/strategy.js.map +1 -0
  251. package/hmr/frameworks/typescript/server/strategy.js +48 -16
  252. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  253. package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
  254. package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
  255. package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
  256. package/hmr/frameworks/vue/client/index.d.ts +10 -1
  257. package/hmr/frameworks/vue/client/index.js +287 -562
  258. package/hmr/frameworks/vue/client/index.js.map +1 -1
  259. package/hmr/frameworks/vue/client/navigate-app.d.ts +3 -0
  260. package/hmr/frameworks/vue/client/navigate-app.js +178 -0
  261. package/hmr/frameworks/vue/client/navigate-app.js.map +1 -0
  262. package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
  263. package/hmr/frameworks/vue/client/strategy.js +152 -0
  264. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  265. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
  266. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +124 -0
  267. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  268. package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
  269. package/hmr/frameworks/vue/server/compiler.js +3 -1
  270. package/hmr/frameworks/vue/server/compiler.js.map +1 -1
  271. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  272. package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
  273. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  274. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  275. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  276. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  277. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  278. package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
  279. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  280. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
  281. package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
  282. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  283. package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
  284. package/hmr/frameworks/vue/server/strategy.js +291 -7
  285. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  286. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  287. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  288. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  289. package/hmr/helpers/ast-normalizer.d.ts +3 -1
  290. package/hmr/helpers/ast-normalizer.js +131 -24
  291. package/hmr/helpers/ast-normalizer.js.map +1 -1
  292. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  293. package/hmr/helpers/cjs-named-exports.js +152 -0
  294. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  295. package/hmr/helpers/package-exports.d.ts +16 -0
  296. package/hmr/helpers/package-exports.js +396 -0
  297. package/hmr/helpers/package-exports.js.map +1 -0
  298. package/hmr/helpers/vendor-rewrite.d.ts +1 -1
  299. package/hmr/helpers/vendor-rewrite.js +5 -3
  300. package/hmr/helpers/vendor-rewrite.js.map +1 -1
  301. package/hmr/server/boot-recording.d.ts +51 -0
  302. package/hmr/server/boot-recording.js +214 -0
  303. package/hmr/server/boot-recording.js.map +1 -0
  304. package/hmr/server/constants.d.ts +1 -0
  305. package/hmr/server/constants.js +21 -4
  306. package/hmr/server/constants.js.map +1 -1
  307. package/hmr/server/content-css-update.d.ts +54 -0
  308. package/hmr/server/content-css-update.js +78 -0
  309. package/hmr/server/content-css-update.js.map +1 -0
  310. package/hmr/server/core-bundle.d.ts +140 -0
  311. package/hmr/server/core-bundle.js +614 -0
  312. package/hmr/server/core-bundle.js.map +1 -0
  313. package/hmr/server/core-sanitize.d.ts +130 -4
  314. package/hmr/server/core-sanitize.js +393 -32
  315. package/hmr/server/core-sanitize.js.map +1 -1
  316. package/hmr/server/css-connect-sync.d.ts +28 -0
  317. package/hmr/server/css-connect-sync.js +59 -0
  318. package/hmr/server/css-connect-sync.js.map +1 -0
  319. package/hmr/server/css-device-module.d.ts +28 -0
  320. package/hmr/server/css-device-module.js +44 -0
  321. package/hmr/server/css-device-module.js.map +1 -0
  322. package/hmr/server/css-update-message.d.ts +23 -0
  323. package/hmr/server/css-update-message.js +41 -0
  324. package/hmr/server/css-update-message.js.map +1 -0
  325. package/hmr/server/deps-bundle.d.ts +233 -0
  326. package/hmr/server/deps-bundle.js +1022 -0
  327. package/hmr/server/deps-bundle.js.map +1 -0
  328. package/hmr/server/device-transform-helpers.d.ts +24 -0
  329. package/hmr/server/device-transform-helpers.js +408 -0
  330. package/hmr/server/device-transform-helpers.js.map +1 -0
  331. package/hmr/server/framework-strategy.d.ts +182 -11
  332. package/hmr/server/hmr-module-graph.d.ts +37 -0
  333. package/hmr/server/hmr-module-graph.js +215 -0
  334. package/hmr/server/hmr-module-graph.js.map +1 -0
  335. package/hmr/server/import-map.d.ts +99 -0
  336. package/hmr/server/import-map.js +294 -0
  337. package/hmr/server/import-map.js.map +1 -0
  338. package/hmr/server/index.d.ts +2 -1
  339. package/hmr/server/index.js +7 -16
  340. package/hmr/server/index.js.map +1 -1
  341. package/hmr/server/node-builtins-route.d.ts +12 -0
  342. package/hmr/server/node-builtins-route.js +86 -0
  343. package/hmr/server/node-builtins-route.js.map +1 -0
  344. package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
  345. package/hmr/server/ns-core-cjs-shape.js +271 -0
  346. package/hmr/server/ns-core-cjs-shape.js.map +1 -0
  347. package/hmr/server/ns-m-response-memo.d.ts +10 -0
  348. package/hmr/server/ns-m-response-memo.js +33 -0
  349. package/hmr/server/ns-m-response-memo.js.map +1 -0
  350. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  351. package/hmr/server/ns-rt-bridge.js +131 -0
  352. package/hmr/server/ns-rt-bridge.js.map +1 -0
  353. package/hmr/server/ns-rt-route.d.ts +5 -0
  354. package/hmr/server/ns-rt-route.js +39 -0
  355. package/hmr/server/ns-rt-route.js.map +1 -0
  356. package/hmr/server/perf-instrumentation.d.ts +114 -0
  357. package/hmr/server/perf-instrumentation.js +197 -0
  358. package/hmr/server/perf-instrumentation.js.map +1 -0
  359. package/hmr/server/process-code-for-device.d.ts +44 -0
  360. package/hmr/server/process-code-for-device.js +834 -0
  361. package/hmr/server/process-code-for-device.js.map +1 -0
  362. package/hmr/server/require-guard.d.ts +1 -0
  363. package/hmr/server/require-guard.js +12 -0
  364. package/hmr/server/require-guard.js.map +1 -0
  365. package/hmr/server/rewrite-imports.d.ts +2 -0
  366. package/hmr/server/rewrite-imports.js +631 -0
  367. package/hmr/server/rewrite-imports.js.map +1 -0
  368. package/hmr/server/route-helpers.d.ts +7 -0
  369. package/hmr/server/route-helpers.js +13 -0
  370. package/hmr/server/route-helpers.js.map +1 -0
  371. package/hmr/server/runtime-graph-filter.d.ts +5 -0
  372. package/hmr/server/runtime-graph-filter.js +28 -0
  373. package/hmr/server/runtime-graph-filter.js.map +1 -0
  374. package/hmr/server/server-origin.d.ts +2 -0
  375. package/hmr/server/server-origin.js +88 -0
  376. package/hmr/server/server-origin.js.map +1 -0
  377. package/hmr/server/shared-transform-request.d.ts +12 -0
  378. package/hmr/server/shared-transform-request.js +143 -0
  379. package/hmr/server/shared-transform-request.js.map +1 -0
  380. package/hmr/server/socket-utils.d.ts +10 -0
  381. package/hmr/server/socket-utils.js +14 -0
  382. package/hmr/server/socket-utils.js.map +1 -0
  383. package/hmr/server/transform-cache-invalidation.d.ts +37 -0
  384. package/hmr/server/transform-cache-invalidation.js +156 -0
  385. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  386. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  387. package/hmr/server/vendor-bare-module-shims.js +80 -0
  388. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  389. package/hmr/server/vite-plugin.d.ts +22 -1
  390. package/hmr/server/vite-plugin.js +655 -58
  391. package/hmr/server/vite-plugin.js.map +1 -1
  392. package/hmr/server/websocket-core-bridge.d.ts +68 -0
  393. package/hmr/server/websocket-core-bridge.js +370 -0
  394. package/hmr/server/websocket-core-bridge.js.map +1 -0
  395. package/hmr/server/websocket-device-transform.d.ts +3 -0
  396. package/hmr/server/websocket-device-transform.js +7 -0
  397. package/hmr/server/websocket-device-transform.js.map +1 -0
  398. package/hmr/server/websocket-graph-upsert.d.ts +21 -0
  399. package/hmr/server/websocket-graph-upsert.js +33 -0
  400. package/hmr/server/websocket-graph-upsert.js.map +1 -0
  401. package/hmr/server/websocket-hmr-pending.d.ts +29 -0
  402. package/hmr/server/websocket-hmr-pending.js +33 -0
  403. package/hmr/server/websocket-hmr-pending.js.map +1 -0
  404. package/hmr/server/websocket-hot-update.d.ts +80 -0
  405. package/hmr/server/websocket-hot-update.js +295 -0
  406. package/hmr/server/websocket-hot-update.js.map +1 -0
  407. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  408. package/hmr/server/websocket-import-map-route.js +51 -0
  409. package/hmr/server/websocket-import-map-route.js.map +1 -0
  410. package/hmr/server/websocket-module-bindings.d.ts +21 -0
  411. package/hmr/server/websocket-module-bindings.js +504 -0
  412. package/hmr/server/websocket-module-bindings.js.map +1 -0
  413. package/hmr/server/websocket-module-specifiers.d.ts +96 -0
  414. package/hmr/server/websocket-module-specifiers.js +819 -0
  415. package/hmr/server/websocket-module-specifiers.js.map +1 -0
  416. package/hmr/server/websocket-ns-core.d.ts +34 -0
  417. package/hmr/server/websocket-ns-core.js +414 -0
  418. package/hmr/server/websocket-ns-core.js.map +1 -0
  419. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  420. package/hmr/server/websocket-ns-entry.js +163 -0
  421. package/hmr/server/websocket-ns-entry.js.map +1 -0
  422. package/hmr/server/websocket-ns-m-paths.d.ts +19 -0
  423. package/hmr/server/websocket-ns-m-paths.js +115 -0
  424. package/hmr/server/websocket-ns-m-paths.js.map +1 -0
  425. package/hmr/server/websocket-ns-m-request.d.ts +46 -0
  426. package/hmr/server/websocket-ns-m-request.js +197 -0
  427. package/hmr/server/websocket-ns-m-request.js.map +1 -0
  428. package/hmr/server/websocket-ns-m.d.ts +52 -0
  429. package/hmr/server/websocket-ns-m.js +590 -0
  430. package/hmr/server/websocket-ns-m.js.map +1 -0
  431. package/hmr/server/websocket-served-module-helpers.d.ts +89 -0
  432. package/hmr/server/websocket-served-module-helpers.js +935 -0
  433. package/hmr/server/websocket-served-module-helpers.js.map +1 -0
  434. package/hmr/server/websocket-txn.d.ts +6 -0
  435. package/hmr/server/websocket-txn.js +42 -0
  436. package/hmr/server/websocket-txn.js.map +1 -0
  437. package/hmr/server/websocket-vendor-unifier.d.ts +9 -0
  438. package/hmr/server/websocket-vendor-unifier.js +46 -0
  439. package/hmr/server/websocket-vendor-unifier.js.map +1 -0
  440. package/hmr/server/websocket.d.ts +7 -17
  441. package/hmr/server/websocket.js +723 -5376
  442. package/hmr/server/websocket.js.map +1 -1
  443. package/hmr/shared/ns-globals.d.ts +107 -0
  444. package/hmr/shared/ns-globals.js +29 -0
  445. package/hmr/shared/ns-globals.js.map +1 -0
  446. package/hmr/shared/package-classifier.d.ts +9 -0
  447. package/hmr/shared/package-classifier.js +58 -0
  448. package/hmr/shared/package-classifier.js.map +1 -0
  449. package/hmr/shared/protocol.d.ts +157 -0
  450. package/hmr/shared/protocol.js +28 -0
  451. package/hmr/shared/protocol.js.map +1 -0
  452. package/hmr/shared/runtime/boot-complete.d.ts +14 -0
  453. package/hmr/shared/runtime/boot-complete.js +32 -0
  454. package/hmr/shared/runtime/boot-complete.js.map +1 -0
  455. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  456. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  457. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  458. package/hmr/shared/runtime/boot-progress.d.ts +44 -0
  459. package/hmr/shared/runtime/boot-progress.js +134 -0
  460. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  461. package/hmr/shared/runtime/boot-timeline.d.ts +17 -0
  462. package/hmr/shared/runtime/boot-timeline.js +40 -0
  463. package/hmr/shared/runtime/boot-timeline.js.map +1 -0
  464. package/hmr/shared/runtime/browser-runtime-contract.d.ts +97 -0
  465. package/hmr/shared/runtime/browser-runtime-contract.js +66 -0
  466. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
  467. package/hmr/shared/runtime/dev-overlay-ios.d.ts +87 -0
  468. package/hmr/shared/runtime/dev-overlay-ios.js +521 -0
  469. package/hmr/shared/runtime/dev-overlay-ios.js.map +1 -0
  470. package/hmr/shared/runtime/dev-overlay-shared.d.ts +58 -0
  471. package/hmr/shared/runtime/dev-overlay-shared.js +116 -0
  472. package/hmr/shared/runtime/dev-overlay-shared.js.map +1 -0
  473. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  474. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  475. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  476. package/hmr/shared/runtime/dev-overlay-tree.d.ts +59 -0
  477. package/hmr/shared/runtime/dev-overlay-tree.js +712 -0
  478. package/hmr/shared/runtime/dev-overlay-tree.js.map +1 -0
  479. package/hmr/shared/runtime/dev-overlay.d.ts +39 -0
  480. package/hmr/shared/runtime/dev-overlay.js +292 -0
  481. package/hmr/shared/runtime/dev-overlay.js.map +1 -0
  482. package/hmr/shared/runtime/global-scope.d.ts +18 -0
  483. package/hmr/shared/runtime/global-scope.js +21 -0
  484. package/hmr/shared/runtime/global-scope.js.map +1 -0
  485. package/hmr/shared/runtime/hooks.js +2 -1
  486. package/hmr/shared/runtime/hooks.js.map +1 -1
  487. package/hmr/shared/runtime/launch-bridge.d.ts +9 -0
  488. package/hmr/shared/runtime/launch-bridge.js +98 -0
  489. package/hmr/shared/runtime/launch-bridge.js.map +1 -0
  490. package/hmr/shared/runtime/module-provenance.d.ts +1 -0
  491. package/hmr/shared/runtime/module-provenance.js +64 -0
  492. package/hmr/shared/runtime/module-provenance.js.map +1 -0
  493. package/hmr/shared/runtime/ns-runtime-test-double.d.ts +21 -0
  494. package/hmr/shared/runtime/ns-runtime-test-double.js +20 -0
  495. package/hmr/shared/runtime/ns-runtime-test-double.js.map +1 -0
  496. package/hmr/shared/runtime/overlay-flag.d.ts +9 -0
  497. package/hmr/shared/runtime/overlay-flag.js +34 -0
  498. package/hmr/shared/runtime/overlay-flag.js.map +1 -0
  499. package/hmr/shared/runtime/platform-polyfills.d.ts +26 -0
  500. package/hmr/shared/runtime/platform-polyfills.js +122 -0
  501. package/hmr/shared/runtime/platform-polyfills.js.map +1 -0
  502. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  503. package/hmr/shared/runtime/root-placeholder-view.js +311 -0
  504. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  505. package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
  506. package/hmr/shared/runtime/root-placeholder.js +778 -83
  507. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  508. package/hmr/shared/runtime/session-bootstrap.d.ts +1 -0
  509. package/hmr/shared/runtime/session-bootstrap.js +350 -0
  510. package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
  511. package/hmr/shared/runtime/vendor-bootstrap.js +54 -16
  512. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  513. package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
  514. package/hmr/shared/runtime/vendor-resolve.js +45 -0
  515. package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
  516. package/hmr/shared/runtime/worker-tracking.d.ts +28 -0
  517. package/hmr/shared/runtime/worker-tracking.js +114 -0
  518. package/hmr/shared/runtime/worker-tracking.js.map +1 -0
  519. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  520. package/hmr/shared/vendor/manifest-collect.js +909 -0
  521. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  522. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  523. package/hmr/shared/vendor/manifest-loader.js +5 -3
  524. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  525. package/hmr/shared/vendor/manifest.d.ts +12 -0
  526. package/hmr/shared/vendor/manifest.js +341 -545
  527. package/hmr/shared/vendor/manifest.js.map +1 -1
  528. package/hmr/shared/vendor/registry.d.ts +2 -0
  529. package/hmr/shared/vendor/registry.js +118 -7
  530. package/hmr/shared/vendor/registry.js.map +1 -1
  531. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  532. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  533. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  534. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +107 -0
  535. package/hmr/shared/vendor/vendor-esbuild-plugins.js +540 -0
  536. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  537. package/index.d.ts +1 -0
  538. package/index.js +5 -0
  539. package/index.js.map +1 -1
  540. package/package.json +76 -14
  541. package/runtime/core-aliases-early.js +103 -81
  542. package/runtime/core-aliases-early.js.map +1 -1
  543. package/shims/react-jsx-runtime.d.ts +4 -0
  544. package/shims/react-jsx-runtime.js +61 -0
  545. package/shims/react-jsx-runtime.js.map +1 -0
  546. package/shims/solid-jsx-runtime.d.ts +7 -0
  547. package/shims/solid-jsx-runtime.js +17 -0
  548. package/shims/solid-jsx-runtime.js.map +1 -0
  549. package/helpers/angular/angular-linker.d.ts +0 -13
  550. package/helpers/angular/angular-linker.js +0 -189
  551. package/helpers/angular/angular-linker.js.map +0 -1
  552. package/helpers/angular/shared-linker.d.ts +0 -4
  553. package/helpers/angular/shared-linker.js +0 -39
  554. package/helpers/angular/shared-linker.js.map +0 -1
  555. package/helpers/angular/util.js +0 -67
  556. package/helpers/angular/util.js.map +0 -1
  557. package/helpers/module-runner-patch.d.ts +0 -3
  558. package/helpers/module-runner-patch.js +0 -63
  559. package/helpers/module-runner-patch.js.map +0 -1
  560. package/helpers/prelink-angular.d.ts +0 -2
  561. package/helpers/prelink-angular.js +0 -117
  562. package/helpers/prelink-angular.js.map +0 -1
  563. package/hmr/shared/runtime/http-only-boot.d.ts +0 -1
  564. package/hmr/shared/runtime/http-only-boot.js +0 -124
  565. package/hmr/shared/runtime/http-only-boot.js.map +0 -1
  566. package/hmr/vendor-bootstrap.d.ts +0 -3
  567. package/hmr/vendor-bootstrap.js +0 -32
  568. package/hmr/vendor-bootstrap.js.map +0 -1
  569. package/shims/react-reconciler-constants.d.ts +0 -14
  570. package/shims/react-reconciler-constants.js +0 -21
  571. package/shims/react-reconciler-constants.js.map +0 -1
  572. package/shims/react-reconciler.d.ts +0 -8
  573. package/shims/react-reconciler.js +0 -15
  574. package/shims/react-reconciler.js.map +0 -1
  575. package/transformers/NativeClass/index.d.ts +0 -2
  576. package/transformers/NativeClass/index.js +0 -222
  577. package/transformers/NativeClass/index.js.map +0 -1
@@ -0,0 +1,712 @@
1
+ /**
2
+ * In-tree overlay backend: the boot placeholder page and the live/update
3
+ * toast chip rendered inside the app's own view tree (Android, and the iOS
4
+ * fallback when the UIWindow backend can't build). Pure margin math
5
+ * (`computeAndroidToastMargin`) is exported separately so the safe-area rules
6
+ * stay unit-testable without a device.
7
+ */
8
+ import { BOOT_PLACEHOLDER_MOTION, computeBootProgressFillScale, formatBootDetailLine, formatBootPrimaryLine } from './boot-placeholder-ui.js';
9
+ import { BOOT_TITLE } from './dev-overlay-snapshots.js';
10
+ import { asColor, formatStatusText, getHmrDevOverlayPosition, getOverlayGlobal, getRuntimeState, resolveCoreExport } from './dev-overlay-shared.js';
11
+ export function buildBootOverlayRefs(snapshot) {
12
+ const Page = resolveCoreExport('Page');
13
+ const StackLayout = resolveCoreExport('StackLayout');
14
+ const Label = resolveCoreExport('Label');
15
+ const ActivityIndicator = resolveCoreExport('ActivityIndicator');
16
+ if (!Page || !StackLayout || !Label) {
17
+ return null;
18
+ }
19
+ const page = new Page();
20
+ page.actionBarHidden = true;
21
+ const root = new StackLayout();
22
+ root.padding = 24;
23
+ root.verticalAlignment = 'middle';
24
+ root.horizontalAlignment = 'stretch';
25
+ const titleLabel = new Label();
26
+ titleLabel.text = BOOT_TITLE;
27
+ titleLabel.textAlignment = 'center';
28
+ titleLabel.textWrap = true;
29
+ titleLabel.fontSize = 22;
30
+ titleLabel.fontWeight = '600';
31
+ const statusLabel = new Label();
32
+ statusLabel.textAlignment = 'center';
33
+ statusLabel.textWrap = true;
34
+ statusLabel.fontSize = 14;
35
+ statusLabel.marginTop = 12;
36
+ const activityIndicator = ActivityIndicator
37
+ ? (() => {
38
+ const indicator = new ActivityIndicator();
39
+ indicator.marginTop = 16;
40
+ indicator.width = 28;
41
+ indicator.height = 28;
42
+ indicator.horizontalAlignment = 'center';
43
+ return indicator;
44
+ })()
45
+ : null;
46
+ root.addChild(titleLabel);
47
+ root.addChild(statusLabel);
48
+ if (activityIndicator) {
49
+ root.addChild(activityIndicator);
50
+ }
51
+ page.content = root;
52
+ const refs = {
53
+ page,
54
+ root,
55
+ titleLabel,
56
+ statusLabel,
57
+ activityIndicator,
58
+ };
59
+ applySnapshotToBootRefs(refs, snapshot);
60
+ return refs;
61
+ }
62
+ export function applySnapshotToBootRefs(refs, snapshot) {
63
+ if (!refs) {
64
+ return;
65
+ }
66
+ refs.page.actionBarHidden = true;
67
+ refs.page.backgroundColor = asColor(snapshot.tone === 'error' ? '#b4181068' : '#a1771683');
68
+ refs.root.visibility = snapshot.visible && snapshot.mode === 'boot' ? 'visible' : 'collapse';
69
+ refs.titleLabel.text = BOOT_TITLE;
70
+ refs.titleLabel.color = asColor(snapshot.tone === 'error' ? '#b41810e6' : '#563e3fb1');
71
+ refs.statusLabel.text = formatStatusText(snapshot) || 'Preparing the HTTP HMR bootstrap (4%)';
72
+ refs.statusLabel.color = asColor(snapshot.tone === 'error' ? '#b41810e6' : '#563e3fb1');
73
+ if (refs.activityIndicator) {
74
+ refs.activityIndicator.busy = !!snapshot.busy;
75
+ refs.activityIndicator.visibility = snapshot.visible && snapshot.mode === 'boot' && snapshot.busy ? 'visible' : 'collapse';
76
+ }
77
+ }
78
+ function findBootActivityIndicator() {
79
+ const g = getOverlayGlobal();
80
+ if (g.__NS_DEV_BOOT_ACTIVITY_INDICATOR__) {
81
+ return g.__NS_DEV_BOOT_ACTIVITY_INDICATOR__;
82
+ }
83
+ try {
84
+ const frame = g.__NS_DEV_PLACEHOLDER_ROOT_VIEW__;
85
+ if (!frame)
86
+ return null;
87
+ const page = frame.currentPage || frame._currentEntry?.resolvedPage;
88
+ const content = page?.content;
89
+ const children = content?.getChildrenCount?.() || 0;
90
+ if (children >= 3) {
91
+ const indicator = content.getChildAt?.(2);
92
+ if (indicator && typeof indicator.busy !== 'undefined') {
93
+ g.__NS_DEV_BOOT_ACTIVITY_INDICATOR__ = indicator;
94
+ return indicator;
95
+ }
96
+ }
97
+ }
98
+ catch { }
99
+ return null;
100
+ }
101
+ function findBootStatusLabel() {
102
+ const g = getOverlayGlobal();
103
+ // Try direct reference first
104
+ if (g.__NS_DEV_BOOT_STATUS_LABEL__) {
105
+ return g.__NS_DEV_BOOT_STATUS_LABEL__;
106
+ }
107
+ // Fallback: walk from placeholder root view
108
+ try {
109
+ const frame = g.__NS_DEV_PLACEHOLDER_ROOT_VIEW__;
110
+ if (!frame)
111
+ return null;
112
+ const page = frame.currentPage || frame._currentEntry?.resolvedPage;
113
+ if (!page)
114
+ return null;
115
+ const content = page.content;
116
+ if (!content)
117
+ return null;
118
+ // StackLayout with children: titleLabel, statusLabel
119
+ const children = content.getChildrenCount?.() || 0;
120
+ if (children >= 2) {
121
+ const label = content.getChildAt?.(1);
122
+ if (label && typeof label.text !== 'undefined') {
123
+ // Cache for next time
124
+ g.__NS_DEV_BOOT_STATUS_LABEL__ = label;
125
+ return label;
126
+ }
127
+ }
128
+ }
129
+ catch { }
130
+ return null;
131
+ }
132
+ function findBootDetailLabel() {
133
+ const g = getOverlayGlobal();
134
+ return g.__NS_DEV_BOOT_DETAIL_LABEL__ || null;
135
+ }
136
+ function findBootProgressFill() {
137
+ const g = getOverlayGlobal();
138
+ return g.__NS_DEV_BOOT_PROGRESS_FILL__ || null;
139
+ }
140
+ export function updateBootStatusLabel(snapshot) {
141
+ const statusLabel = findBootStatusLabel();
142
+ const detailLabel = findBootDetailLabel();
143
+ const progressFill = findBootProgressFill();
144
+ const activityIndicator = findBootActivityIndicator();
145
+ // New (card) layout: phase line + detail line live in separate
146
+ // labels so the typography can differ. Legacy (single-label)
147
+ // layout: keep the original combined "phase (X%)\ndetail" text so
148
+ // nothing visually regresses for runtimes still attached to the
149
+ // older placeholder shape.
150
+ const hasSplitLabels = !!detailLabel;
151
+ const phaseLine = formatBootPrimaryLine(snapshot);
152
+ const detailLine = formatBootDetailLine(snapshot);
153
+ const combinedText = formatStatusText(snapshot) || 'Preparing the HTTP HMR bootstrap (4%)';
154
+ if (!statusLabel) {
155
+ if (activityIndicator) {
156
+ try {
157
+ activityIndicator.busy = !!snapshot.busy;
158
+ activityIndicator.visibility = snapshot.visible && snapshot.mode === 'boot' && snapshot.busy ? 'visible' : 'collapse';
159
+ }
160
+ catch { }
161
+ }
162
+ applyBootProgressFill(progressFill, snapshot);
163
+ return;
164
+ }
165
+ try {
166
+ statusLabel.text = hasSplitLabels ? phaseLine || 'Preparing the HTTP HMR bootstrap' : combinedText;
167
+ // Card layout uses the calibrated phase-text colour from the
168
+ // palette; legacy single-label layout keeps the original muted
169
+ // brown so we don't visually regress mid-session.
170
+ const phaseColorHex = snapshot.tone === 'error' ? '#B91C1C' : hasSplitLabels ? '#475569' : '#563e3fb1';
171
+ statusLabel.color = asColor(phaseColorHex);
172
+ if (typeof statusLabel.requestLayout === 'function') {
173
+ statusLabel.requestLayout();
174
+ }
175
+ const parent = statusLabel.parent;
176
+ if (parent && typeof parent.requestLayout === 'function') {
177
+ parent.requestLayout();
178
+ }
179
+ }
180
+ catch { }
181
+ if (detailLabel) {
182
+ try {
183
+ detailLabel.text = detailLine;
184
+ detailLabel.color = asColor(snapshot.tone === 'error' ? '#DC2626' : '#94A3B8');
185
+ detailLabel.visibility = detailLine ? 'visible' : 'collapse';
186
+ }
187
+ catch { }
188
+ }
189
+ applyBootProgressFill(progressFill, snapshot);
190
+ if (activityIndicator) {
191
+ try {
192
+ activityIndicator.busy = !!snapshot.busy;
193
+ activityIndicator.visibility = snapshot.visible && snapshot.mode === 'boot' && snapshot.busy ? 'visible' : 'collapse';
194
+ }
195
+ catch { }
196
+ }
197
+ }
198
+ // Drive the progress fill scaleX from the snapshot. Uses NS's view
199
+ // animate API for a smooth 220 ms easeOut between heartbeat ticks; a
200
+ // monotonic ratchet on `globalThis.__NS_DEV_BOOT_PROGRESS_LAST_SCALE__`
201
+ // guards against the fill snapping backwards if a less-progressed
202
+ // snapshot ever lands between ticks (mirrors the JS-side
203
+ // `applyMonotonicBootProgress` contract).
204
+ function applyBootProgressFill(progressFill, snapshot) {
205
+ if (!progressFill)
206
+ return;
207
+ const g = getOverlayGlobal();
208
+ const isError = snapshot.tone === 'error';
209
+ progressFill.backgroundColor = asColor(isError ? '#B41810' : '#3B6FE5');
210
+ const targetScale = computeBootProgressFillScale(snapshot.progress ?? null);
211
+ const previousRaw = Number(g.__NS_DEV_BOOT_PROGRESS_LAST_SCALE__);
212
+ const previous = Number.isFinite(previousRaw) ? previousRaw : 0;
213
+ const next = Math.max(previous, targetScale);
214
+ g.__NS_DEV_BOOT_PROGRESS_LAST_SCALE__ = next;
215
+ try {
216
+ // NS view.animate scales around `originX`/`originY`; the
217
+ // placeholder builder pins `originX = 0` so the fill grows
218
+ // rightward. animate() may be unavailable in some headless
219
+ // test environments — fall through to a direct property set.
220
+ if (typeof progressFill.animate === 'function') {
221
+ progressFill
222
+ .animate({
223
+ scale: { x: next, y: 1 },
224
+ duration: BOOT_PLACEHOLDER_MOTION.progressDurationMs,
225
+ curve: 'easeOut',
226
+ })
227
+ .catch(() => {
228
+ try {
229
+ progressFill.scaleX = next;
230
+ }
231
+ catch { }
232
+ });
233
+ }
234
+ else {
235
+ progressFill.scaleX = next;
236
+ }
237
+ }
238
+ catch {
239
+ progressFill.scaleX = next;
240
+ }
241
+ }
242
+ function resolveActivePage() {
243
+ try {
244
+ const Frame = resolveCoreExport('Frame');
245
+ const frame = Frame?.topmost?.() || null;
246
+ const currentPage = frame?.currentPage || frame?._currentEntry?.resolvedPage || null;
247
+ if (currentPage) {
248
+ return currentPage;
249
+ }
250
+ }
251
+ catch { }
252
+ try {
253
+ const Application = resolveCoreExport('Application');
254
+ const rootView = Application?.getRootView?.() || null;
255
+ if (rootView?.currentPage) {
256
+ return rootView.currentPage;
257
+ }
258
+ if (typeof rootView?.content !== 'undefined') {
259
+ return rootView;
260
+ }
261
+ }
262
+ catch { }
263
+ return null;
264
+ }
265
+ function readCachedAndroidSafeAreaInsets() {
266
+ const g = getOverlayGlobal();
267
+ const cached = g.__NS_HMR_ANDROID_SAFE_INSETS__;
268
+ if (cached && typeof cached.top === 'number') {
269
+ return cached;
270
+ }
271
+ return null;
272
+ }
273
+ /**
274
+ * Read the Android system-bar safe-area insets (status bar / navigation
275
+ * bar / display cutout) in device-independent pixels.
276
+ *
277
+ * NativeScript runs every Android activity edge-to-edge, so the overlay
278
+ * wrapper fills the whole window — we need these insets to keep the toast
279
+ * chip out from under the system bars (see `computeAndroidToastMargin`).
280
+ *
281
+ * Returns null on non-Android runtimes (iOS / web / vitest) so callers
282
+ * fall back to base margins. The last good reading is cached on the
283
+ * global so a transient null (e.g. insets queried before the decor view
284
+ * is attached) reuses the previous value instead of snapping the chip
285
+ * back under the status bar.
286
+ */
287
+ function readAndroidSafeAreaInsets() {
288
+ const g = getOverlayGlobal();
289
+ // `android.*` is exposed as a global only on the NativeScript Android
290
+ // runtime; its absence means iOS, web, or a test environment.
291
+ const androidNs = g.android || (typeof globalThis.android !== 'undefined' ? globalThis.android : undefined);
292
+ if (!androidNs) {
293
+ return null;
294
+ }
295
+ try {
296
+ const Application = resolveCoreExport('Application');
297
+ const activity = Application?.android?.foregroundActivity || Application?.android?.startActivity;
298
+ const decorView = activity?.getWindow?.()?.getDecorView?.();
299
+ const rootInsets = decorView?.getRootWindowInsets?.();
300
+ if (!rootInsets) {
301
+ return readCachedAndroidSafeAreaInsets();
302
+ }
303
+ let density = 1;
304
+ try {
305
+ const metricsDensity = Number(activity?.getResources?.()?.getDisplayMetrics?.()?.density);
306
+ if (Number.isFinite(metricsDensity) && metricsDensity > 0) {
307
+ density = metricsDensity;
308
+ }
309
+ }
310
+ catch { }
311
+ let px = { top: 0, bottom: 0, left: 0, right: 0 };
312
+ const WindowInsets = androidNs.view?.WindowInsets;
313
+ const Type = WindowInsets?.Type;
314
+ if (typeof rootInsets.getInsets === 'function' && Type && typeof Type.systemBars === 'function') {
315
+ // API 30+: query the system bars + display cutout so notches /
316
+ // camera holes are respected in landscape.
317
+ let mask = Type.systemBars();
318
+ if (typeof Type.displayCutout === 'function') {
319
+ mask = mask | Type.displayCutout();
320
+ }
321
+ const i = rootInsets.getInsets(mask);
322
+ px = { top: Number(i?.top) || 0, bottom: Number(i?.bottom) || 0, left: Number(i?.left) || 0, right: Number(i?.right) || 0 };
323
+ }
324
+ else {
325
+ // API < 30 fallback.
326
+ px = {
327
+ top: Number(rootInsets.getSystemWindowInsetTop?.()) || 0,
328
+ bottom: Number(rootInsets.getSystemWindowInsetBottom?.()) || 0,
329
+ left: Number(rootInsets.getSystemWindowInsetLeft?.()) || 0,
330
+ right: Number(rootInsets.getSystemWindowInsetRight?.()) || 0,
331
+ };
332
+ }
333
+ const insets = {
334
+ top: px.top / density,
335
+ bottom: px.bottom / density,
336
+ left: px.left / density,
337
+ right: px.right / density,
338
+ };
339
+ g.__NS_HMR_ANDROID_SAFE_INSETS__ = insets;
340
+ return insets;
341
+ }
342
+ catch {
343
+ return readCachedAndroidSafeAreaInsets();
344
+ }
345
+ }
346
+ /**
347
+ * Margin math for the in-tree (Android) live/update toast chip.
348
+ *
349
+ * NativeScript enables edge-to-edge on every Android activity
350
+ * (`@nativescript/core` → `application.android.ts` → `enableEdgeToEdge`),
351
+ * so the page content — and therefore the overlay wrapper we inject into
352
+ * it — extends underneath the status bar and navigation bar. A fixed
353
+ * top/bottom margin leaves the chip tucked behind the system bars, where
354
+ * it gets clipped (Android 15 / API 35 enforces edge-to-edge, so this is
355
+ * now the norm rather than the exception).
356
+ *
357
+ * This pure helper folds the system-bar safe-area insets into the chip's
358
+ * margin so the toast always clears the status bar (top position) /
359
+ * navigation bar (bottom position). It is deterministic and free of
360
+ * native deps so the rules stay unit-testable — the runtime reads the
361
+ * live insets via `readAndroidSafeAreaInsets()` and forwards them here.
362
+ *
363
+ * - 'top': margin.top = baseVerticalInset + safeInsets.top
364
+ * - 'bottom': margin.bottom = baseVerticalInset + safeInsets.bottom
365
+ * - 'center': fixed `centerMargin` all around (vertically centered, so
366
+ * it never approaches the system bars on normal viewports).
367
+ *
368
+ * Horizontal margins always include the relevant safe-area inset so a
369
+ * landscape display cutout / gesture pill doesn't clip the chip edge.
370
+ */
371
+ export function computeAndroidToastMargin(input) {
372
+ // Clamp to a finite, non-negative number; fall back to `fallback`
373
+ // for missing/NaN input so a glitched measurement can't produce a
374
+ // negative or NaN margin (which NativeScript would silently drop).
375
+ const clamp = (value, fallback) => {
376
+ const n = Number(value);
377
+ return Number.isFinite(n) && n >= 0 ? n : fallback;
378
+ };
379
+ const safe = {
380
+ top: clamp(input.safeInsets?.top, 0),
381
+ bottom: clamp(input.safeInsets?.bottom, 0),
382
+ left: clamp(input.safeInsets?.left, 0),
383
+ right: clamp(input.safeInsets?.right, 0),
384
+ };
385
+ const baseVerticalInset = clamp(input.baseVerticalInset, 8);
386
+ const baseHorizontalInset = clamp(input.baseHorizontalInset, 16);
387
+ const centerMargin = clamp(input.centerMargin, 24);
388
+ if (input.position === 'center') {
389
+ return { top: centerMargin, right: centerMargin, bottom: centerMargin, left: centerMargin };
390
+ }
391
+ const left = Math.round(baseHorizontalInset + safe.left);
392
+ const right = Math.round(baseHorizontalInset + safe.right);
393
+ if (input.position === 'bottom') {
394
+ return { top: 0, right, bottom: Math.round(baseVerticalInset + safe.bottom), left };
395
+ }
396
+ // 'top' (and any unexpected value) hugs the status-bar safe area.
397
+ return { top: Math.round(baseVerticalInset + safe.top), right, bottom: 0, left };
398
+ }
399
+ function buildLiveOverlayView(snapshot) {
400
+ const GridLayout = resolveCoreExport('GridLayout');
401
+ const StackLayout = resolveCoreExport('StackLayout');
402
+ const Label = resolveCoreExport('Label');
403
+ if (!GridLayout || !StackLayout || !Label) {
404
+ return null;
405
+ }
406
+ const overlay = new GridLayout();
407
+ overlay.visibility = 'collapse';
408
+ overlay.width = '100%';
409
+ overlay.height = '100%';
410
+ overlay.horizontalAlignment = 'stretch';
411
+ overlay.verticalAlignment = 'stretch';
412
+ // Toast mode lets touches reach the underlying app. We flip
413
+ // isUserInteractionEnabled in applySnapshotToLiveRefs based on
414
+ // the resolved position, but keep it false here as a safe default
415
+ // (the panel itself is purely informational).
416
+ try {
417
+ overlay.isUserInteractionEnabled = false;
418
+ }
419
+ catch { }
420
+ const panel = new StackLayout();
421
+ panel.horizontalAlignment = 'center';
422
+ // Vertical alignment is overridden in applySnapshotToLiveRefs
423
+ // based on getHmrDevOverlayPosition(); 'middle' is the default
424
+ panel.verticalAlignment = 'middle';
425
+ panel.width = 320;
426
+ panel.margin = 24;
427
+ panel.padding = 16;
428
+ const titleLabel = new Label();
429
+ titleLabel.textAlignment = 'center';
430
+ titleLabel.textWrap = true;
431
+ titleLabel.fontSize = 18;
432
+ titleLabel.fontWeight = '600';
433
+ const statusLabel = new Label();
434
+ statusLabel.textAlignment = 'center';
435
+ statusLabel.textWrap = true;
436
+ statusLabel.fontSize = 13;
437
+ statusLabel.marginTop = 10;
438
+ panel.addChild(titleLabel);
439
+ panel.addChild(statusLabel);
440
+ overlay.addChild(panel);
441
+ const refs = {
442
+ overlay,
443
+ titleLabel,
444
+ statusLabel,
445
+ wasVisible: false,
446
+ currentPosition: getHmrDevOverlayPosition(),
447
+ };
448
+ applySnapshotToLiveRefs(refs, snapshot);
449
+ return refs;
450
+ }
451
+ export function ensureLiveOverlayRefs(snapshot) {
452
+ const state = getRuntimeState();
453
+ const page = resolveActivePage();
454
+ if (!page) {
455
+ return null;
456
+ }
457
+ if (state.liveRefs) {
458
+ if (state.liveRefs.page === page && state.liveRefs.overlay?.parent) {
459
+ return state.liveRefs;
460
+ }
461
+ try {
462
+ state.liveRefs.overlay.visibility = 'collapse';
463
+ }
464
+ catch { }
465
+ state.liveRefs = null;
466
+ }
467
+ const GridLayout = resolveCoreExport('GridLayout');
468
+ if (!GridLayout || typeof page.content === 'undefined') {
469
+ return null;
470
+ }
471
+ let wrapper = page.content;
472
+ if (!wrapper || !wrapper.__ns_hmr_overlay_wrapper__) {
473
+ const currentContent = page.content || null;
474
+ wrapper = new GridLayout();
475
+ wrapper.width = '100%';
476
+ wrapper.height = '100%';
477
+ wrapper.__ns_hmr_overlay_wrapper__ = true;
478
+ try {
479
+ page.content = null;
480
+ }
481
+ catch { }
482
+ if (currentContent) {
483
+ wrapper.addChild(currentContent);
484
+ }
485
+ page.content = wrapper;
486
+ }
487
+ const liveView = buildLiveOverlayView(snapshot);
488
+ if (!liveView) {
489
+ return null;
490
+ }
491
+ wrapper.addChild(liveView.overlay);
492
+ state.liveRefs = {
493
+ page,
494
+ wrapper,
495
+ ...liveView,
496
+ };
497
+ return state.liveRefs;
498
+ }
499
+ export function applySnapshotToLiveRefs(refs, snapshot) {
500
+ if (!refs) {
501
+ return;
502
+ }
503
+ // 'update' mode shares the live (in-tree) overlay chrome with
504
+ // 'connection'. Both render a small panel inside the page; only
505
+ // the colours, text, and (now) panel position change with the
506
+ // snapshot's tone and the configured overlay position.
507
+ const visible = snapshot.visible && (snapshot.mode === 'connection' || snapshot.mode === 'update');
508
+ const wasVisible = !!refs.wasVisible;
509
+ const position = getHmrDevOverlayPosition();
510
+ const previousPosition = refs.currentPosition || position;
511
+ const isToast = position !== 'center';
512
+ refs.titleLabel.text = snapshot.title;
513
+ refs.statusLabel.text = formatStatusText(snapshot);
514
+ const textColor = snapshot.tone === 'error' ? '#b41810e6' : snapshot.tone === 'success' ? '#0e6e2fff' : '#563e3fb1';
515
+ refs.titleLabel.color = asColor(textColor);
516
+ refs.statusLabel.color = asColor(textColor);
517
+ // Backdrop tints (centered modal only). Toast modes use a fully
518
+ // transparent backdrop so the rest of the app stays visible AND
519
+ // reachable; the panel itself carries enough colour to stand out.
520
+ if (isToast) {
521
+ refs.overlay.backgroundColor = asColor('transparent');
522
+ }
523
+ else {
524
+ // Original wash-by-tone for centered:
525
+ // error → red wash (matches existing UX)
526
+ // success → richer green wash so the apply event is visible
527
+ // on bright app backgrounds
528
+ // default → warm orange (existing connection-overlay look)
529
+ const overlayBg = snapshot.tone === 'error' ? '#b4181068' : snapshot.tone === 'success' ? '#1f883d80' : '#a1771683';
530
+ refs.overlay.backgroundColor = asColor(overlayBg);
531
+ }
532
+ // Panel chrome — toast and centered share the same chip look,
533
+ // just position differs. We keep the slightly richer green tint
534
+ // for the HMR success state so it pops without needing the
535
+ // backdrop wash.
536
+ let panel = null;
537
+ try {
538
+ panel = refs.titleLabel.parent;
539
+ if (panel) {
540
+ const panelBg = snapshot.tone === 'success' ? '#E6F8E9FF' : '#FFFFFFFF';
541
+ panel.backgroundColor = asColor(panelBg);
542
+ panel.opacity = 1;
543
+ panel.padding = 16;
544
+ try {
545
+ panel.borderRadius = 12;
546
+ }
547
+ catch { }
548
+ // Position-aware alignment. The wrapper GridLayout fills the
549
+ // page content area. NativeScript runs every Android activity
550
+ // edge-to-edge, so that area extends under the status bar and
551
+ // navigation bar — we fold the system-bar safe-area insets into
552
+ // the chip's margin (via computeAndroidToastMargin) so a top
553
+ // chip clears the status bar and a bottom chip clears the nav
554
+ // bar instead of being clipped behind them. readAndroidSafeAreaInsets
555
+ // returns null off-Android, so the margins collapse to their base
556
+ // values (no behavioural change on iOS's in-tree fallback / tests).
557
+ try {
558
+ if (position === 'top' || position === 'bottom') {
559
+ const m = computeAndroidToastMargin({ position, safeInsets: readAndroidSafeAreaInsets() });
560
+ panel.verticalAlignment = position;
561
+ panel.margin = `${m.top} ${m.right} ${m.bottom} ${m.left}`;
562
+ }
563
+ else {
564
+ panel.verticalAlignment = 'middle';
565
+ panel.margin = 24;
566
+ }
567
+ }
568
+ catch { }
569
+ // Force a tight re-measure so the StackLayout panel hugs the
570
+ // CURRENT title+status text. Connection stages can swap between
571
+ // frames whose text wraps to a different number of lines (e.g. a
572
+ // long 'reconnecting' "Retrying ws://…" detail vs. the short
573
+ // 'offline' message). Without an explicit relayout the panel can
574
+ // retain the tallest height it ever measured, leaving an oversized
575
+ // gap between title and message. Mirrors updateBootStatusLabel.
576
+ try {
577
+ refs.titleLabel.requestLayout?.();
578
+ refs.statusLabel.requestLayout?.();
579
+ panel.requestLayout?.();
580
+ }
581
+ catch { }
582
+ }
583
+ }
584
+ catch { }
585
+ // Touch passthrough for toast; centered mode keeps the
586
+ // blocking modal so the dim backdrop is meaningful.
587
+ try {
588
+ refs.overlay.isUserInteractionEnabled = !isToast;
589
+ }
590
+ catch { }
591
+ const positionChanged = previousPosition !== position;
592
+ const justAppeared = visible && (!wasVisible || positionChanged);
593
+ const justDismissed = !visible && wasVisible;
594
+ if (justAppeared) {
595
+ refs.overlay.visibility = 'visible';
596
+ if (isToast && panel && typeof panel.animate === 'function') {
597
+ animateLivePanelIn(panel, position);
598
+ }
599
+ else if (panel) {
600
+ try {
601
+ panel.translateY = 0;
602
+ panel.opacity = 1;
603
+ }
604
+ catch { }
605
+ }
606
+ }
607
+ else if (justDismissed) {
608
+ if (isToast && panel && typeof panel.animate === 'function') {
609
+ animateLivePanelOut(panel, previousPosition, () => {
610
+ try {
611
+ refs.overlay.visibility = 'collapse';
612
+ }
613
+ catch { }
614
+ });
615
+ }
616
+ else {
617
+ refs.overlay.visibility = 'collapse';
618
+ }
619
+ }
620
+ else {
621
+ // Steady-state refresh (e.g. offline → reconnecting → offline while
622
+ // already visible): no slide animation fires here, so clear any
623
+ // transform residue a previously-interrupted slide-in/out may have
624
+ // left on the panel. Otherwise the chip can appear shifted or
625
+ // faded across rapid connection-stage swaps.
626
+ if (visible && panel) {
627
+ try {
628
+ panel.translateY = 0;
629
+ panel.opacity = 1;
630
+ }
631
+ catch { }
632
+ }
633
+ refs.overlay.visibility = visible ? 'visible' : 'collapse';
634
+ }
635
+ if (typeof refs.wasVisible !== 'undefined')
636
+ refs.wasVisible = visible;
637
+ if (typeof refs.currentPosition !== 'undefined')
638
+ refs.currentPosition = position;
639
+ }
640
+ /**
641
+ * Slide-in animation for the in-tree toast panel.
642
+ *
643
+ * NativeScript's `View.animate({ translate, opacity, duration, curve })`
644
+ * is widely available across Core versions, so we don't depend on any
645
+ * specific curve enum being importable here. We use a moderate-to-snappy
646
+ * 320ms ease-out which feels close to a UIView spring without needing
647
+ * platform-specific APIs.
648
+ */
649
+ function animateLivePanelIn(panel, position) {
650
+ if (!panel || typeof panel.animate !== 'function')
651
+ return;
652
+ try {
653
+ const startY = position === 'bottom' ? 80 : -80;
654
+ panel.translateY = startY;
655
+ panel.opacity = 0;
656
+ const result = panel.animate({
657
+ translate: { x: 0, y: 0 },
658
+ opacity: 1,
659
+ duration: 320,
660
+ curve: 'easeOut',
661
+ });
662
+ if (result && typeof result.catch === 'function') {
663
+ result.catch(() => {
664
+ try {
665
+ panel.translateY = 0;
666
+ panel.opacity = 1;
667
+ }
668
+ catch { }
669
+ });
670
+ }
671
+ }
672
+ catch {
673
+ try {
674
+ panel.translateY = 0;
675
+ panel.opacity = 1;
676
+ }
677
+ catch { }
678
+ }
679
+ }
680
+ function animateLivePanelOut(panel, position, onComplete) {
681
+ if (!panel || typeof panel.animate !== 'function') {
682
+ onComplete();
683
+ return;
684
+ }
685
+ try {
686
+ const targetY = position === 'bottom' ? 80 : -80;
687
+ const result = panel.animate({
688
+ translate: { x: 0, y: targetY },
689
+ opacity: 0,
690
+ duration: 220,
691
+ curve: 'easeIn',
692
+ });
693
+ const finish = () => {
694
+ try {
695
+ panel.translateY = 0;
696
+ panel.opacity = 1;
697
+ }
698
+ catch { }
699
+ onComplete();
700
+ };
701
+ if (result && typeof result.then === 'function') {
702
+ result.then(finish, finish);
703
+ }
704
+ else {
705
+ finish();
706
+ }
707
+ }
708
+ catch {
709
+ onComplete();
710
+ }
711
+ }
712
+ //# sourceMappingURL=dev-overlay-tree.js.map