@weapp-vite/web 1.3.36 → 1.4.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 (321) hide show
  1. package/README.md +144 -5
  2. package/dist/_virtual/_rolldown/runtime.mjs +19 -1
  3. package/dist/compiler/wxml/attributes.mjs +1 -1
  4. package/dist/compiler/wxml/attributes.mjs.map +1 -1
  5. package/dist/compiler/wxml/compile.mjs +6 -3
  6. package/dist/compiler/wxml/compile.mjs.map +1 -1
  7. package/dist/compiler/wxml/interpolation.mjs +1 -2
  8. package/dist/compiler/wxml/interpolation.mjs.map +1 -1
  9. package/dist/compiler/wxml/navigation.mjs +5 -7
  10. package/dist/compiler/wxml/navigation.mjs.map +1 -1
  11. package/dist/compiler/wxml/parser.mjs +5 -5
  12. package/dist/compiler/wxml/parser.mjs.map +1 -1
  13. package/dist/compiler/wxml/renderer.mjs +13 -12
  14. package/dist/compiler/wxml/renderer.mjs.map +1 -1
  15. package/dist/compiler/wxml/specialNodes.mjs +6 -1
  16. package/dist/compiler/wxml/specialNodes.mjs.map +1 -1
  17. package/dist/compiler/wxml/types.d.mts +12 -0
  18. package/dist/compiler/wxs.mjs +5 -5
  19. package/dist/compiler/wxs.mjs.map +1 -1
  20. package/dist/css/wxss.d.mts +1 -0
  21. package/dist/css/wxss.mjs +110 -9
  22. package/dist/css/wxss.mjs.map +1 -1
  23. package/dist/index.d.mts +29 -6
  24. package/dist/index.mjs +197 -4
  25. package/dist/index.mjs.map +1 -0
  26. package/dist/plugin/assets.d.mts +7 -0
  27. package/dist/plugin/assets.mjs +122 -0
  28. package/dist/plugin/assets.mjs.map +1 -0
  29. package/dist/plugin/constants.mjs +10 -1
  30. package/dist/plugin/constants.mjs.map +1 -1
  31. package/dist/plugin/dependencyScan.mjs +41 -0
  32. package/dist/plugin/dependencyScan.mjs.map +1 -0
  33. package/dist/plugin/entry.mjs +56 -7
  34. package/dist/plugin/entry.mjs.map +1 -1
  35. package/dist/plugin/files.mjs +1 -1
  36. package/dist/plugin/files.mjs.map +1 -1
  37. package/dist/plugin/index.d.mts +37 -3
  38. package/dist/plugin/index.mjs +245 -74
  39. package/dist/plugin/index.mjs.map +1 -1
  40. package/dist/plugin/layout.mjs +24 -0
  41. package/dist/plugin/layout.mjs.map +1 -0
  42. package/dist/plugin/path.mjs +4 -1
  43. package/dist/plugin/path.mjs.map +1 -1
  44. package/dist/plugin/register.mjs +48 -36
  45. package/dist/plugin/register.mjs.map +1 -1
  46. package/dist/plugin/scan.mjs +206 -94
  47. package/dist/plugin/scan.mjs.map +1 -1
  48. package/dist/plugin/scanSfc.mjs +65 -0
  49. package/dist/plugin/scanSfc.mjs.map +1 -0
  50. package/dist/plugin/state.mjs +3 -2
  51. package/dist/plugin/state.mjs.map +1 -1
  52. package/dist/plugin/styleModule.mjs +52 -0
  53. package/dist/plugin/styleModule.mjs.map +1 -0
  54. package/dist/plugin/types.d.mts +46 -1
  55. package/dist/plugin/vueSfc.mjs +149 -0
  56. package/dist/plugin/vueSfc.mjs.map +1 -0
  57. package/dist/runtime/appShell/container.mjs +25 -0
  58. package/dist/runtime/appShell/container.mjs.map +1 -0
  59. package/dist/runtime/appShell/tabBar/index.mjs +192 -0
  60. package/dist/runtime/appShell/tabBar/index.mjs.map +1 -0
  61. package/dist/runtime/appShell/tabBar/style.mjs +127 -0
  62. package/dist/runtime/appShell/tabBar/style.mjs.map +1 -0
  63. package/dist/runtime/button/helpers.mjs +1 -58
  64. package/dist/runtime/button/helpers.mjs.map +1 -1
  65. package/dist/runtime/button/index.d.mts +4 -5
  66. package/dist/runtime/button/index.mjs +6 -28
  67. package/dist/runtime/button/index.mjs.map +1 -1
  68. package/dist/runtime/button/style.mjs +53 -28
  69. package/dist/runtime/button/style.mjs.map +1 -1
  70. package/dist/runtime/component/behavior.mjs +26 -2
  71. package/dist/runtime/component/behavior.mjs.map +1 -1
  72. package/dist/runtime/component/element.mjs +107 -31
  73. package/dist/runtime/component/element.mjs.map +1 -1
  74. package/dist/runtime/component/observers.mjs +36 -0
  75. package/dist/runtime/component/observers.mjs.map +1 -0
  76. package/dist/runtime/component/publicInstance.mjs +48 -0
  77. package/dist/runtime/component/publicInstance.mjs.map +1 -0
  78. package/dist/runtime/component/relations.mjs +35 -0
  79. package/dist/runtime/component/relations.mjs.map +1 -0
  80. package/dist/runtime/component/slots.mjs +24 -0
  81. package/dist/runtime/component/slots.mjs.map +1 -0
  82. package/dist/runtime/component/state.mjs +13 -3
  83. package/dist/runtime/component/state.mjs.map +1 -1
  84. package/dist/runtime/component/types.d.mts +29 -4
  85. package/dist/runtime/component/virtualHost.mjs +83 -0
  86. package/dist/runtime/component/virtualHost.mjs.map +1 -0
  87. package/dist/runtime/host/index.d.mts +13 -0
  88. package/dist/runtime/host/index.mjs +47 -0
  89. package/dist/runtime/host/index.mjs.map +1 -0
  90. package/dist/runtime/host/types.d.mts +28 -0
  91. package/dist/runtime/hostGlobals.d.mts +9 -0
  92. package/dist/runtime/hostGlobals.mjs +39 -0
  93. package/dist/runtime/hostGlobals.mjs.map +1 -0
  94. package/dist/runtime/index.d.mts +21 -3
  95. package/dist/runtime/index.mjs +26 -4
  96. package/dist/runtime/index.mjs.map +1 -0
  97. package/dist/runtime/legacyTemplate/dom.mjs +3 -3
  98. package/dist/runtime/legacyTemplate/dom.mjs.map +1 -1
  99. package/dist/runtime/legacyTemplate/expression.mjs +9 -9
  100. package/dist/runtime/legacyTemplate/expression.mjs.map +1 -1
  101. package/dist/runtime/legacyTemplate/index.mjs +6 -6
  102. package/dist/runtime/legacyTemplate/index.mjs.map +1 -1
  103. package/dist/runtime/nativeComponents/canvas/index.mjs +53 -0
  104. package/dist/runtime/nativeComponents/canvas/index.mjs.map +1 -0
  105. package/dist/runtime/nativeComponents/checkbox.mjs +137 -0
  106. package/dist/runtime/nativeComponents/checkbox.mjs.map +1 -0
  107. package/dist/runtime/nativeComponents/cover/index.mjs +23 -0
  108. package/dist/runtime/nativeComponents/cover/index.mjs.map +1 -0
  109. package/dist/runtime/nativeComponents/form.d.mts +7 -0
  110. package/dist/runtime/nativeComponents/form.mjs +50 -0
  111. package/dist/runtime/nativeComponents/form.mjs.map +1 -0
  112. package/dist/runtime/nativeComponents/formControl.mjs +61 -0
  113. package/dist/runtime/nativeComponents/formControl.mjs.map +1 -0
  114. package/dist/runtime/nativeComponents/helpers.mjs +25 -0
  115. package/dist/runtime/nativeComponents/helpers.mjs.map +1 -0
  116. package/dist/runtime/nativeComponents/icon/helpers.mjs +42 -0
  117. package/dist/runtime/nativeComponents/icon/helpers.mjs.map +1 -0
  118. package/dist/runtime/nativeComponents/icon/index.mjs +45 -0
  119. package/dist/runtime/nativeComponents/icon/index.mjs.map +1 -0
  120. package/dist/runtime/nativeComponents/icon/style.mjs +176 -0
  121. package/dist/runtime/nativeComponents/icon/style.mjs.map +1 -0
  122. package/dist/runtime/nativeComponents/image.d.mts +8 -0
  123. package/dist/runtime/nativeComponents/image.mjs +121 -0
  124. package/dist/runtime/nativeComponents/image.mjs.map +1 -0
  125. package/dist/runtime/nativeComponents/index.d.mts +11 -0
  126. package/dist/runtime/nativeComponents/index.mjs +83 -0
  127. package/dist/runtime/nativeComponents/index.mjs.map +1 -0
  128. package/dist/runtime/nativeComponents/input.d.mts +8 -0
  129. package/dist/runtime/nativeComponents/input.mjs +131 -0
  130. package/dist/runtime/nativeComponents/input.mjs.map +1 -0
  131. package/dist/runtime/nativeComponents/label.mjs +36 -0
  132. package/dist/runtime/nativeComponents/label.mjs.map +1 -0
  133. package/dist/runtime/nativeComponents/mediaRegistry.mjs +47 -0
  134. package/dist/runtime/nativeComponents/mediaRegistry.mjs.map +1 -0
  135. package/dist/runtime/nativeComponents/movable/helpers.mjs +23 -0
  136. package/dist/runtime/nativeComponents/movable/helpers.mjs.map +1 -0
  137. package/dist/runtime/nativeComponents/movable/index.mjs +117 -0
  138. package/dist/runtime/nativeComponents/movable/index.mjs.map +1 -0
  139. package/dist/runtime/nativeComponents/navigator.mjs +200 -0
  140. package/dist/runtime/nativeComponents/navigator.mjs.map +1 -0
  141. package/dist/runtime/nativeComponents/picker/editors.mjs +74 -0
  142. package/dist/runtime/nativeComponents/picker/editors.mjs.map +1 -0
  143. package/dist/runtime/nativeComponents/picker/helpers.mjs +57 -0
  144. package/dist/runtime/nativeComponents/picker/helpers.mjs.map +1 -0
  145. package/dist/runtime/nativeComponents/picker/index.mjs +210 -0
  146. package/dist/runtime/nativeComponents/picker/index.mjs.map +1 -0
  147. package/dist/runtime/nativeComponents/picker/style.mjs +71 -0
  148. package/dist/runtime/nativeComponents/picker/style.mjs.map +1 -0
  149. package/dist/runtime/nativeComponents/pickerView/column.mjs +134 -0
  150. package/dist/runtime/nativeComponents/pickerView/column.mjs.map +1 -0
  151. package/dist/runtime/nativeComponents/pickerView/helpers.mjs +17 -0
  152. package/dist/runtime/nativeComponents/pickerView/helpers.mjs.map +1 -0
  153. package/dist/runtime/nativeComponents/pickerView/index.mjs +128 -0
  154. package/dist/runtime/nativeComponents/pickerView/index.mjs.map +1 -0
  155. package/dist/runtime/nativeComponents/pickerView/style.mjs +58 -0
  156. package/dist/runtime/nativeComponents/pickerView/style.mjs.map +1 -0
  157. package/dist/runtime/nativeComponents/primitives.mjs +16 -0
  158. package/dist/runtime/nativeComponents/primitives.mjs.map +1 -0
  159. package/dist/runtime/nativeComponents/progress/helpers.mjs +29 -0
  160. package/dist/runtime/nativeComponents/progress/helpers.mjs.map +1 -0
  161. package/dist/runtime/nativeComponents/progress/index.mjs +130 -0
  162. package/dist/runtime/nativeComponents/progress/index.mjs.map +1 -0
  163. package/dist/runtime/nativeComponents/progress/style.mjs +40 -0
  164. package/dist/runtime/nativeComponents/progress/style.mjs.map +1 -0
  165. package/dist/runtime/nativeComponents/radio.mjs +147 -0
  166. package/dist/runtime/nativeComponents/radio.mjs.map +1 -0
  167. package/dist/runtime/nativeComponents/richText/helpers.mjs +230 -0
  168. package/dist/runtime/nativeComponents/richText/helpers.mjs.map +1 -0
  169. package/dist/runtime/nativeComponents/richText/index.mjs +74 -0
  170. package/dist/runtime/nativeComponents/richText/index.mjs.map +1 -0
  171. package/dist/runtime/nativeComponents/scrollView.d.mts +15 -0
  172. package/dist/runtime/nativeComponents/scrollView.mjs +79 -0
  173. package/dist/runtime/nativeComponents/scrollView.mjs.map +1 -0
  174. package/dist/runtime/nativeComponents/slider/helpers.mjs +28 -0
  175. package/dist/runtime/nativeComponents/slider/helpers.mjs.map +1 -0
  176. package/dist/runtime/nativeComponents/slider/index.mjs +120 -0
  177. package/dist/runtime/nativeComponents/slider/index.mjs.map +1 -0
  178. package/dist/runtime/nativeComponents/slider/style.mjs +60 -0
  179. package/dist/runtime/nativeComponents/slider/style.mjs.map +1 -0
  180. package/dist/runtime/nativeComponents/style.mjs +41 -0
  181. package/dist/runtime/nativeComponents/style.mjs.map +1 -0
  182. package/dist/runtime/nativeComponents/swiper/helpers.mjs +52 -0
  183. package/dist/runtime/nativeComponents/swiper/helpers.mjs.map +1 -0
  184. package/dist/runtime/nativeComponents/swiper/index.mjs +235 -0
  185. package/dist/runtime/nativeComponents/swiper/index.mjs.map +1 -0
  186. package/dist/runtime/nativeComponents/swiper/item.mjs +14 -0
  187. package/dist/runtime/nativeComponents/swiper/item.mjs.map +1 -0
  188. package/dist/runtime/nativeComponents/swiper/style.mjs +20 -0
  189. package/dist/runtime/nativeComponents/swiper/style.mjs.map +1 -0
  190. package/dist/runtime/nativeComponents/switch.d.mts +7 -0
  191. package/dist/runtime/nativeComponents/switch.mjs +132 -0
  192. package/dist/runtime/nativeComponents/switch.mjs.map +1 -0
  193. package/dist/runtime/nativeComponents/textarea.d.mts +9 -0
  194. package/dist/runtime/nativeComponents/textarea.mjs +144 -0
  195. package/dist/runtime/nativeComponents/textarea.mjs.map +1 -0
  196. package/dist/runtime/nativeComponents/video/helpers.d.mts +12 -0
  197. package/dist/runtime/nativeComponents/video/helpers.mjs +21 -0
  198. package/dist/runtime/nativeComponents/video/helpers.mjs.map +1 -0
  199. package/dist/runtime/nativeComponents/video/index.mjs +124 -0
  200. package/dist/runtime/nativeComponents/video/index.mjs.map +1 -0
  201. package/dist/runtime/nativeComponents/video/style.mjs +14 -0
  202. package/dist/runtime/nativeComponents/video/style.mjs.map +1 -0
  203. package/dist/runtime/navigationBar/index.mjs +1 -3
  204. package/dist/runtime/navigationBar/index.mjs.map +1 -1
  205. package/dist/runtime/pageLayout.d.mts +9 -0
  206. package/dist/runtime/pageLayout.mjs +16 -0
  207. package/dist/runtime/pageLayout.mjs.map +1 -0
  208. package/dist/runtime/polyfill/animation.mjs +120 -0
  209. package/dist/runtime/polyfill/animation.mjs.map +1 -0
  210. package/dist/runtime/polyfill/appState.mjs +1 -1
  211. package/dist/runtime/polyfill/appState.mjs.map +1 -1
  212. package/dist/runtime/polyfill/async.d.mts +7 -0
  213. package/dist/runtime/polyfill/async.mjs.map +1 -1
  214. package/dist/runtime/polyfill/canvasContext.mjs +41 -0
  215. package/dist/runtime/polyfill/canvasContext.mjs.map +1 -1
  216. package/dist/runtime/polyfill/device.mjs +1 -1
  217. package/dist/runtime/polyfill/device.mjs.map +1 -1
  218. package/dist/runtime/polyfill/deviceAuthSystemApi.mjs +8 -2
  219. package/dist/runtime/polyfill/deviceAuthSystemApi.mjs.map +1 -1
  220. package/dist/runtime/polyfill/eventBus.mjs +56 -0
  221. package/dist/runtime/polyfill/eventBus.mjs.map +1 -0
  222. package/dist/runtime/polyfill/fileSystemManager.mjs +5 -2
  223. package/dist/runtime/polyfill/fileSystemManager.mjs.map +1 -1
  224. package/dist/runtime/polyfill/files.mjs +10 -10
  225. package/dist/runtime/polyfill/files.mjs.map +1 -1
  226. package/dist/runtime/polyfill/font.mjs +32 -0
  227. package/dist/runtime/polyfill/font.mjs.map +1 -0
  228. package/dist/runtime/polyfill/index.d.mts +2 -2
  229. package/dist/runtime/polyfill/index.mjs +49 -45
  230. package/dist/runtime/polyfill/index.mjs.map +1 -1
  231. package/dist/runtime/polyfill/interaction.mjs +7 -6
  232. package/dist/runtime/polyfill/interaction.mjs.map +1 -1
  233. package/dist/runtime/polyfill/interactionApi.mjs +3 -2
  234. package/dist/runtime/polyfill/interactionApi.mjs.map +1 -1
  235. package/dist/runtime/polyfill/intersectionObserver.mjs +106 -0
  236. package/dist/runtime/polyfill/intersectionObserver.mjs.map +1 -0
  237. package/dist/runtime/polyfill/locale.mjs +14 -0
  238. package/dist/runtime/polyfill/locale.mjs.map +1 -0
  239. package/dist/runtime/polyfill/locationApi.mjs +7 -4
  240. package/dist/runtime/polyfill/locationApi.mjs.map +1 -1
  241. package/dist/runtime/polyfill/mediaActions.mjs +2 -2
  242. package/dist/runtime/polyfill/mediaActions.mjs.map +1 -1
  243. package/dist/runtime/polyfill/mediaApi/file.mjs +1 -1
  244. package/dist/runtime/polyfill/mediaApi/info.mjs +6 -4
  245. package/dist/runtime/polyfill/mediaApi/info.mjs.map +1 -1
  246. package/dist/runtime/polyfill/menuApi.mjs +38 -4
  247. package/dist/runtime/polyfill/menuApi.mjs.map +1 -1
  248. package/dist/runtime/polyfill/navigationBarRuntime.mjs +6 -1
  249. package/dist/runtime/polyfill/navigationBarRuntime.mjs.map +1 -1
  250. package/dist/runtime/polyfill/network/request.mjs +2 -2
  251. package/dist/runtime/polyfill/network/request.mjs.map +1 -1
  252. package/dist/runtime/polyfill/platformApi.mjs +1 -1
  253. package/dist/runtime/polyfill/routeRuntime/appLifecycle.mjs +88 -0
  254. package/dist/runtime/polyfill/routeRuntime/appLifecycle.mjs.map +1 -0
  255. package/dist/runtime/polyfill/routeRuntime/dom.mjs +44 -15
  256. package/dist/runtime/polyfill/routeRuntime/dom.mjs.map +1 -1
  257. package/dist/runtime/polyfill/routeRuntime/history.d.mts +30 -0
  258. package/dist/runtime/polyfill/routeRuntime/history.mjs +148 -0
  259. package/dist/runtime/polyfill/routeRuntime/history.mjs.map +1 -0
  260. package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs +39 -8
  261. package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs.map +1 -1
  262. package/dist/runtime/polyfill/routeRuntime/options.d.mts +11 -1
  263. package/dist/runtime/polyfill/routeRuntime/options.mjs +0 -1
  264. package/dist/runtime/polyfill/routeRuntime/options.mjs.map +1 -1
  265. package/dist/runtime/polyfill/routeRuntime/result.mjs +12 -0
  266. package/dist/runtime/polyfill/routeRuntime/result.mjs.map +1 -0
  267. package/dist/runtime/polyfill/routeRuntime/scroll.mjs +39 -0
  268. package/dist/runtime/polyfill/routeRuntime/scroll.mjs.map +1 -0
  269. package/dist/runtime/polyfill/routeRuntime/stack.mjs +122 -0
  270. package/dist/runtime/polyfill/routeRuntime/stack.mjs.map +1 -0
  271. package/dist/runtime/polyfill/routeRuntime.d.mts +26 -17
  272. package/dist/runtime/polyfill/routeRuntime.mjs +121 -96
  273. package/dist/runtime/polyfill/routeRuntime.mjs.map +1 -1
  274. package/dist/runtime/polyfill/runtimeDataApi.mjs +8 -3
  275. package/dist/runtime/polyfill/runtimeDataApi.mjs.map +1 -1
  276. package/dist/runtime/polyfill/runtimeOps.mjs +10 -6
  277. package/dist/runtime/polyfill/runtimeOps.mjs.map +1 -1
  278. package/dist/runtime/polyfill/selectorQuery.mjs +70 -14
  279. package/dist/runtime/polyfill/selectorQuery.mjs.map +1 -1
  280. package/dist/runtime/polyfill/storage.mjs +5 -2
  281. package/dist/runtime/polyfill/storage.mjs.map +1 -1
  282. package/dist/runtime/polyfill/system.mjs +30 -3
  283. package/dist/runtime/polyfill/system.mjs.map +1 -1
  284. package/dist/runtime/polyfill/types/locationRuntime.d.mts +1 -4
  285. package/dist/runtime/polyfill/types/platformRuntime.d.mts +9 -0
  286. package/dist/runtime/polyfill/types/systemAuth.d.mts +20 -9
  287. package/dist/runtime/polyfill/types/tabBarRuntime.d.mts +25 -0
  288. package/dist/runtime/polyfill/ui.mjs +2 -6
  289. package/dist/runtime/polyfill/ui.mjs.map +1 -1
  290. package/dist/runtime/polyfill/uiMediaApi.d.mts +11 -10
  291. package/dist/runtime/polyfill/uiMediaApi.mjs +26 -2
  292. package/dist/runtime/polyfill/uiMediaApi.mjs.map +1 -1
  293. package/dist/runtime/polyfill/videoContext.mjs +4 -0
  294. package/dist/runtime/polyfill/videoContext.mjs.map +1 -1
  295. package/dist/runtime/polyfill/vkSession.mjs +4 -14
  296. package/dist/runtime/polyfill/vkSession.mjs.map +1 -1
  297. package/dist/runtime/polyfill.d.mts +2 -2
  298. package/dist/runtime/renderContext.mjs +1 -1
  299. package/dist/runtime/renderContext.mjs.map +1 -1
  300. package/dist/runtime/rpx.mjs +17 -8
  301. package/dist/runtime/rpx.mjs.map +1 -1
  302. package/dist/runtime/seo/index.d.mts +31 -0
  303. package/dist/runtime/seo/index.mjs +94 -0
  304. package/dist/runtime/seo/index.mjs.map +1 -0
  305. package/dist/runtime/viewport/index.d.mts +12 -0
  306. package/dist/runtime/viewport/index.mjs +44 -0
  307. package/dist/runtime/viewport/index.mjs.map +1 -0
  308. package/dist/runtime/viewport/style.mjs +62 -0
  309. package/dist/runtime/viewport/style.mjs.map +1 -0
  310. package/dist/runtime/viewport/types.d.mts +14 -0
  311. package/dist/runtime/wevu.d.mts +20 -0
  312. package/dist/runtime/wevu.mjs +73 -0
  313. package/dist/runtime/wevu.mjs.map +1 -0
  314. package/dist/shared/nativeComponents.mjs +401 -0
  315. package/dist/shared/nativeComponents.mjs.map +1 -0
  316. package/dist/shared/tabBar.d.mts +19 -0
  317. package/dist/shared/tabBar.mjs +37 -0
  318. package/dist/shared/tabBar.mjs.map +1 -0
  319. package/dist/shared/wxml.mjs +3 -20
  320. package/dist/shared/wxml.mjs.map +1 -1
  321. package/package.json +13 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result.mjs","names":[],"sources":["../../../../src/runtime/polyfill/routeRuntime/result.ts"],"sourcesContent":["import type { MiniProgramAsyncOptions, MiniProgramBaseResult } from '../types'\nimport {\n callMiniProgramAsyncFailure,\n callMiniProgramAsyncSuccess,\n} from '../async'\n\nexport function resolveRouteAction(\n action: string,\n options: MiniProgramAsyncOptions<MiniProgramBaseResult> | undefined,\n succeeded: boolean,\n failureReason = 'page not found',\n) {\n if (succeeded) {\n return Promise.resolve(callMiniProgramAsyncSuccess(options, {\n errMsg: `${action}:ok`,\n }))\n }\n const failure = callMiniProgramAsyncFailure(options, `${action}:fail ${failureReason}`)\n return Promise.reject(failure)\n}\n"],"mappings":";;;AAMA,SAAgB,mBACd,QACA,SACA,WACA,gBAAgB,kBAChB;CACA,IAAI,WACF,OAAO,QAAQ,QAAQ,4BAA4B,SAAS,EAC1D,QAAQ,GAAG,OAAO,KACpB,CAAC,CAAC;CAEJ,MAAM,UAAU,4BAA4B,SAAS,GAAG,OAAO,QAAQ,eAAe;CACtF,OAAO,QAAQ,OAAO,OAAO;AAC/B"}
@@ -0,0 +1,39 @@
1
+ import { getAppContainer } from "../../appShell/container.mjs";
2
+
3
+ //#region src/runtime/polyfill/routeRuntime/scroll.ts
4
+ let activeEntry;
5
+ let boundContainer;
6
+ let scrollHandler;
7
+ function getPageContainer() {
8
+ return getAppContainer();
9
+ }
10
+ function captureEntryScrollPosition(entry) {
11
+ if (!entry.active) return;
12
+ const container = getPageContainer();
13
+ if (container) entry.scrollTop = container.scrollTop;
14
+ }
15
+ function restoreEntryScrollPosition(entry) {
16
+ const container = getPageContainer();
17
+ if (container) container.scrollTop = entry.scrollTop ?? 0;
18
+ }
19
+ function setEntryScrollOwner(entry, active) {
20
+ if (active) {
21
+ activeEntry = entry;
22
+ return;
23
+ }
24
+ if (activeEntry === entry) activeEntry = void 0;
25
+ }
26
+ function recordActiveEntryScrollPosition() {
27
+ if (activeEntry) captureEntryScrollPosition(activeEntry);
28
+ }
29
+ function bindPageScrollOwner(container) {
30
+ if (boundContainer === container) return;
31
+ if (boundContainer && scrollHandler) boundContainer.removeEventListener("scroll", scrollHandler);
32
+ boundContainer = container;
33
+ scrollHandler = recordActiveEntryScrollPosition;
34
+ container.addEventListener("scroll", scrollHandler, { passive: true });
35
+ }
36
+
37
+ //#endregion
38
+ export { bindPageScrollOwner, captureEntryScrollPosition, getPageContainer, recordActiveEntryScrollPosition, restoreEntryScrollPosition, setEntryScrollOwner };
39
+ //# sourceMappingURL=scroll.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll.mjs","names":[],"sources":["../../../../src/runtime/polyfill/routeRuntime/scroll.ts"],"sourcesContent":["import type { PageStackEntry } from './options'\nimport { getAppContainer } from '../../appShell/container'\n\ntype ScrollContainer = HTMLElement & Pick<EventTarget, 'addEventListener' | 'removeEventListener'>\n\nlet activeEntry: PageStackEntry | undefined\nlet boundContainer: ScrollContainer | undefined\nlet scrollHandler: (() => void) | undefined\n\nexport function getPageContainer() {\n return getAppContainer()\n}\n\nexport function captureEntryScrollPosition(entry: PageStackEntry) {\n if (!entry.active) {\n return\n }\n const container = getPageContainer()\n if (container) {\n entry.scrollTop = container.scrollTop\n }\n}\n\nexport function restoreEntryScrollPosition(entry: PageStackEntry) {\n const container = getPageContainer()\n if (container) {\n container.scrollTop = entry.scrollTop ?? 0\n }\n}\n\nexport function setEntryScrollOwner(entry: PageStackEntry, active: boolean) {\n if (active) {\n activeEntry = entry\n return\n }\n if (activeEntry === entry) {\n activeEntry = undefined\n }\n}\n\nexport function recordActiveEntryScrollPosition() {\n if (activeEntry) {\n captureEntryScrollPosition(activeEntry)\n }\n}\n\nexport function bindPageScrollOwner(container: ScrollContainer) {\n if (boundContainer === container) {\n return\n }\n if (boundContainer && scrollHandler) {\n boundContainer.removeEventListener('scroll', scrollHandler)\n }\n boundContainer = container\n scrollHandler = recordActiveEntryScrollPosition\n container.addEventListener('scroll', scrollHandler, { passive: true })\n}\n\nexport function disposePageScrollOwner() {\n if (boundContainer && scrollHandler) {\n boundContainer.removeEventListener('scroll', scrollHandler)\n }\n activeEntry = undefined\n boundContainer = undefined\n scrollHandler = undefined\n}\n"],"mappings":";;;AAKA,IAAI;AACJ,IAAI;AACJ,IAAI;AAEJ,SAAgB,mBAAmB;CACjC,OAAO,gBAAgB;AACzB;AAEA,SAAgB,2BAA2B,OAAuB;CAChE,IAAI,CAAC,MAAM,QACT;CAEF,MAAM,YAAY,iBAAiB;CACnC,IAAI,WACF,MAAM,YAAY,UAAU;AAEhC;AAEA,SAAgB,2BAA2B,OAAuB;CAChE,MAAM,YAAY,iBAAiB;CACnC,IAAI,WACF,UAAU,YAAY,MAAM,aAAa;AAE7C;AAEA,SAAgB,oBAAoB,OAAuB,QAAiB;CAC1E,IAAI,QAAQ;EACV,cAAc;EACd;CACF;CACA,IAAI,gBAAgB,OAClB,cAAc;AAElB;AAEA,SAAgB,kCAAkC;CAChD,IAAI,aACF,2BAA2B,WAAW;AAE1C;AAEA,SAAgB,oBAAoB,WAA4B;CAC9D,IAAI,mBAAmB,WACrB;CAEF,IAAI,kBAAkB,eACpB,eAAe,oBAAoB,UAAU,aAAa;CAE5D,iBAAiB;CACjB,gBAAgB;CAChB,UAAU,iBAAiB,UAAU,eAAe,EAAE,SAAS,KAAK,CAAC;AACvE"}
@@ -0,0 +1,122 @@
1
+ import { hidePageInstance, showPageInstance } from "./lifecycle.mjs";
2
+ import { captureEntryScrollPosition, restoreEntryScrollPosition } from "./scroll.mjs";
3
+ import { mountEntryToDom, setEntryActiveInDom, unmountEntryFromDom } from "./dom.mjs";
4
+
5
+ //#region src/runtime/polyfill/routeRuntime/stack.ts
6
+ var PageStackRuntime = class {
7
+ pageRegistry;
8
+ onBeforeMount;
9
+ entries = [];
10
+ #tabEntries = /* @__PURE__ */ new Map();
11
+ #tabPageIds = /* @__PURE__ */ new Set();
12
+ constructor(pageRegistry, onBeforeMount) {
13
+ this.pageRegistry = pageRegistry;
14
+ this.onBeforeMount = onBeforeMount;
15
+ }
16
+ configureTabPages(ids) {
17
+ this.#tabPageIds = new Set(ids);
18
+ for (const [id, entry] of this.#tabEntries) {
19
+ if (this.#tabPageIds.has(id)) continue;
20
+ this.#tabEntries.delete(id);
21
+ this.#destroy(entry);
22
+ }
23
+ }
24
+ push(id, query) {
25
+ if (!this.pageRegistry.has(id)) return false;
26
+ this.#hide(this.entries[this.entries.length - 1]);
27
+ const entry = {
28
+ id,
29
+ query,
30
+ active: true
31
+ };
32
+ this.entries.push(entry);
33
+ this.#mount(entry);
34
+ return true;
35
+ }
36
+ replace(id, query) {
37
+ if (!this.pageRegistry.has(id)) return false;
38
+ const entry = {
39
+ id,
40
+ query,
41
+ active: true
42
+ };
43
+ if (this.entries.length) {
44
+ const current = this.entries[this.entries.length - 1];
45
+ this.entries[this.entries.length - 1] = entry;
46
+ this.#destroy(current);
47
+ } else this.entries.push(entry);
48
+ this.#mount(entry);
49
+ return true;
50
+ }
51
+ relaunch(id, query) {
52
+ if (!this.pageRegistry.has(id)) return false;
53
+ const previousEntries = this.entries.splice(0);
54
+ for (const entry of previousEntries.reverse()) this.#destroy(entry);
55
+ for (const entry of this.#tabEntries.values()) this.#destroy(entry);
56
+ this.#tabEntries.clear();
57
+ return this.push(id, query);
58
+ }
59
+ switchTab(id, query) {
60
+ if (!this.#tabPageIds.has(id) || !this.pageRegistry.has(id)) return false;
61
+ const previousEntries = this.entries.splice(0);
62
+ let target = previousEntries.find((entry) => entry.id === id) ?? this.#tabEntries.get(id);
63
+ for (const entry of previousEntries.reverse()) {
64
+ if (entry === target) continue;
65
+ if (this.#tabPageIds.has(entry.id)) {
66
+ this.#hide(entry);
67
+ this.#tabEntries.set(entry.id, entry);
68
+ } else this.#destroy(entry);
69
+ }
70
+ if (target) {
71
+ this.#tabEntries.delete(id);
72
+ target.query = query;
73
+ this.entries.push(target);
74
+ this.#show(target);
75
+ return true;
76
+ }
77
+ target = {
78
+ id,
79
+ query,
80
+ active: true
81
+ };
82
+ this.entries.push(target);
83
+ this.#mount(target);
84
+ return true;
85
+ }
86
+ back(delta = 1) {
87
+ if (this.entries.length <= 1) return false;
88
+ const normalizedDelta = Math.max(1, delta);
89
+ const targetIndex = Math.max(0, this.entries.length - 1 - normalizedDelta);
90
+ const removed = this.entries.splice(targetIndex + 1);
91
+ for (const entry of removed.reverse()) this.#destroy(entry);
92
+ this.#show(this.entries[targetIndex]);
93
+ return true;
94
+ }
95
+ #mount(entry) {
96
+ mountEntryToDom(entry, this.pageRegistry, this.onBeforeMount);
97
+ }
98
+ #record(entry) {
99
+ return this.pageRegistry.get(entry.id);
100
+ }
101
+ #hide(entry) {
102
+ if (!entry) return;
103
+ captureEntryScrollPosition(entry);
104
+ setEntryActiveInDom(entry, false);
105
+ const record = this.#record(entry);
106
+ if (entry.instance && record) hidePageInstance(entry.instance, record);
107
+ }
108
+ #show(entry) {
109
+ setEntryActiveInDom(entry, true);
110
+ restoreEntryScrollPosition(entry);
111
+ const record = this.#record(entry);
112
+ if (entry.instance && record) showPageInstance(entry.instance, record);
113
+ }
114
+ #destroy(entry) {
115
+ unmountEntryFromDom(entry);
116
+ entry.active = false;
117
+ }
118
+ };
119
+
120
+ //#endregion
121
+ export { PageStackRuntime };
122
+ //# sourceMappingURL=stack.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.mjs","names":["#tabEntries","#tabPageIds","#destroy","#hide","#mount","#show","#record"],"sources":["../../../../src/runtime/polyfill/routeRuntime/stack.ts"],"sourcesContent":["import type { PageRecord, PageStackEntry } from './options'\nimport {\n mountEntryToDom,\n setEntryActiveInDom,\n unmountEntryFromDom,\n} from './dom'\nimport { hidePageInstance, showPageInstance } from './lifecycle'\nimport { captureEntryScrollPosition, restoreEntryScrollPosition } from './scroll'\n\nexport class PageStackRuntime {\n readonly entries: PageStackEntry[] = []\n readonly #tabEntries = new Map<string, PageStackEntry>()\n #tabPageIds = new Set<string>()\n\n constructor(\n private readonly pageRegistry: Map<string, PageRecord>,\n private readonly onBeforeMount: (entry: PageStackEntry) => void,\n ) {}\n\n configureTabPages(ids: Iterable<string>) {\n this.#tabPageIds = new Set(ids)\n for (const [id, entry] of this.#tabEntries) {\n if (this.#tabPageIds.has(id)) {\n continue\n }\n this.#tabEntries.delete(id)\n this.#destroy(entry)\n }\n }\n\n push(id: string, query: Record<string, string>) {\n if (!this.pageRegistry.has(id)) {\n return false\n }\n this.#hide(this.entries[this.entries.length - 1])\n const entry: PageStackEntry = { id, query, active: true }\n this.entries.push(entry)\n this.#mount(entry)\n return true\n }\n\n replace(id: string, query: Record<string, string>) {\n if (!this.pageRegistry.has(id)) {\n return false\n }\n const entry: PageStackEntry = { id, query, active: true }\n if (this.entries.length) {\n const current = this.entries[this.entries.length - 1]!\n this.entries[this.entries.length - 1] = entry\n this.#destroy(current)\n }\n else {\n this.entries.push(entry)\n }\n this.#mount(entry)\n return true\n }\n\n relaunch(id: string, query: Record<string, string>) {\n if (!this.pageRegistry.has(id)) {\n return false\n }\n const previousEntries = this.entries.splice(0)\n for (const entry of previousEntries.reverse()) {\n this.#destroy(entry)\n }\n for (const entry of this.#tabEntries.values()) {\n this.#destroy(entry)\n }\n this.#tabEntries.clear()\n return this.push(id, query)\n }\n\n switchTab(id: string, query: Record<string, string>) {\n if (!this.#tabPageIds.has(id) || !this.pageRegistry.has(id)) {\n return false\n }\n\n const previousEntries = this.entries.splice(0)\n let target = previousEntries.find(entry => entry.id === id) ?? this.#tabEntries.get(id)\n for (const entry of previousEntries.reverse()) {\n if (entry === target) {\n continue\n }\n if (this.#tabPageIds.has(entry.id)) {\n this.#hide(entry)\n this.#tabEntries.set(entry.id, entry)\n }\n else {\n this.#destroy(entry)\n }\n }\n\n if (target) {\n this.#tabEntries.delete(id)\n target.query = query\n this.entries.push(target)\n this.#show(target)\n return true\n }\n\n target = { id, query, active: true }\n this.entries.push(target)\n this.#mount(target)\n return true\n }\n\n back(delta = 1) {\n if (this.entries.length <= 1) {\n return false\n }\n const normalizedDelta = Math.max(1, delta)\n const targetIndex = Math.max(0, this.entries.length - 1 - normalizedDelta)\n const removed = this.entries.splice(targetIndex + 1)\n for (const entry of removed.reverse()) {\n this.#destroy(entry)\n }\n this.#show(this.entries[targetIndex]!)\n return true\n }\n\n #mount(entry: PageStackEntry) {\n mountEntryToDom(entry, this.pageRegistry, this.onBeforeMount)\n }\n\n #record(entry: PageStackEntry) {\n return this.pageRegistry.get(entry.id)\n }\n\n #hide(entry: PageStackEntry | undefined) {\n if (!entry) {\n return\n }\n captureEntryScrollPosition(entry)\n setEntryActiveInDom(entry, false)\n const record = this.#record(entry)\n if (entry.instance && record) {\n hidePageInstance(entry.instance, record)\n }\n }\n\n #show(entry: PageStackEntry) {\n setEntryActiveInDom(entry, true)\n restoreEntryScrollPosition(entry)\n const record = this.#record(entry)\n if (entry.instance && record) {\n showPageInstance(entry.instance, record)\n }\n }\n\n #destroy(entry: PageStackEntry) {\n unmountEntryFromDom(entry)\n entry.active = false\n }\n}\n"],"mappings":";;;;;AASA,IAAa,mBAAb,MAA8B;CAMT;CACA;CANnB,AAAS,UAA4B,CAAC;CACtC,AAASA,8BAAc,IAAI,IAA4B;CACvD,8BAAc,IAAI,IAAY;CAE9B,YACE,AAAiB,cACjB,AAAiB,eACjB;EAFiB;EACA;CAChB;CAEH,kBAAkB,KAAuB;EACvC,KAAKC,cAAc,IAAI,IAAI,GAAG;EAC9B,KAAK,MAAM,CAAC,IAAI,UAAU,KAAKD,aAAa;GAC1C,IAAI,KAAKC,YAAY,IAAI,EAAE,GACzB;GAEF,KAAKD,YAAY,OAAO,EAAE;GAC1B,KAAKE,SAAS,KAAK;EACrB;CACF;CAEA,KAAK,IAAY,OAA+B;EAC9C,IAAI,CAAC,KAAK,aAAa,IAAI,EAAE,GAC3B,OAAO;EAET,KAAKC,MAAM,KAAK,QAAQ,KAAK,QAAQ,SAAS,EAAE;EAChD,MAAM,QAAwB;GAAE;GAAI;GAAO,QAAQ;EAAK;EACxD,KAAK,QAAQ,KAAK,KAAK;EACvB,KAAKC,OAAO,KAAK;EACjB,OAAO;CACT;CAEA,QAAQ,IAAY,OAA+B;EACjD,IAAI,CAAC,KAAK,aAAa,IAAI,EAAE,GAC3B,OAAO;EAET,MAAM,QAAwB;GAAE;GAAI;GAAO,QAAQ;EAAK;EACxD,IAAI,KAAK,QAAQ,QAAQ;GACv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AKD,OAAO,MAAM;EAClB,OAAO;CACT;CAEA,KAAK,QAAQ,GAAG;EACd,IAAI,KAAK,QAAQ,UAAU,GACzB,OAAO;EAET,MAAM,kBAAkB,KAAK,IAAI,GAAG,KAAK;EACzC,MAAM,cAAc,KAAK,IAAI,GAAG,KAAK,QAAQ,SAAS,IAAI,eAAe;EACzE,MAAM,UAAU,KAAK,QAAQ,OAAO,cAAc,CAAC;EACnD,KAAK,MAAM,SAAS,QAAQ,QAAQ,GAClC,KAAKF,SAAS,KAAK;EAErB,KAAKG,MAAM,KAAK,QAAQ,YAAa;EACrC,OAAO;CACT;CAEA,OAAO,OAAuB;EAC5B,gBAAgB,OAAO,KAAK,cAAc,KAAK,aAAa;CAC9D;CAEA,QAAQ,OAAuB;EAC7B,OAAO,KAAK,aAAa,IAAI,MAAM,EAAE;CACvC;CAEA,MAAM,OAAmC;EACvC,IAAI,CAAC,OACH;EAEF,2BAA2B,KAAK;EAChC,oBAAoB,OAAO,KAAK;EAChC,MAAM,SAAS,KAAKC,QAAQ,KAAK;EACjC,IAAI,MAAM,YAAY,QACpB,iBAAiB,MAAM,UAAU,MAAM;CAE3C;CAEA,MAAM,OAAuB;EAC3B,oBAAoB,OAAO,IAAI;EAC/B,2BAA2B,KAAK;EAChC,MAAM,SAAS,KAAKA,QAAQ,KAAK;EACjC,IAAI,MAAM,YAAY,QACpB,iBAAiB,MAAM,UAAU,MAAM;CAE3C;CAEA,SAAS,OAAuB;EAC9B,oBAAoB,KAAK;EACzB,MAAM,SAAS;CACjB;AACF"}
@@ -1,7 +1,11 @@
1
- import { ButtonFormConfig } from "../button/index.mjs";
2
1
  import "../component/index.mjs";
2
+ import { AppLaunchOptions, AppRuntime, ComponentRawOptions, NavigateBackOptions, PageRawOptions, RegisterMeta, RouteOptions } from "./routeRuntime/options.mjs";
3
+ import { WebRoutingConfig } from "./routeRuntime/history.mjs";
4
+ import { WebResourceHintsConfig, WebRuntimeSeoConfig as WebSeoConfig } from "../seo/index.mjs";
5
+ import { WebTabBarConfig } from "../../shared/tabBar.mjs";
6
+ import { ButtonFormConfig } from "../button/index.mjs";
3
7
  import { NavigationBarMetrics } from "../navigationBar/index.mjs";
4
- import { AppLaunchOptions, AppRuntime, ComponentRawOptions, PageRawOptions, RegisterMeta } from "./routeRuntime/options.mjs";
8
+ import { WebViewportConfig } from "../viewport/types.mjs";
5
9
  //#region src/runtime/polyfill/routeRuntime.d.ts
6
10
  declare function initializePageRoutes(ids: string[], options?: {
7
11
  rpx?: {
@@ -10,32 +14,37 @@ declare function initializePageRoutes(ids: string[], options?: {
10
14
  };
11
15
  navigationBar?: NavigationBarMetrics;
12
16
  form?: ButtonFormConfig;
17
+ tabBar?: WebTabBarConfig;
13
18
  runtime?: {
14
19
  executionMode?: 'compat' | 'safe' | 'strict';
15
20
  warnings?: {
16
21
  level?: 'off' | 'warn' | 'error';
17
22
  dedupe?: boolean;
18
23
  };
24
+ viewport?: WebViewportConfig;
25
+ routing?: WebRoutingConfig;
26
+ seo?: WebSeoConfig;
27
+ resourceHints?: WebResourceHintsConfig;
19
28
  };
20
29
  }): void;
21
30
  declare function registerPage<T extends PageRawOptions | undefined>(options: T, meta: RegisterMeta): T;
22
31
  declare function registerComponent<T extends ComponentRawOptions | undefined>(options: T, meta: RegisterMeta): T;
23
32
  declare function registerApp<T extends AppRuntime | undefined>(options: T, _meta?: RegisterMeta): T;
24
- declare function navigateTo(options: {
25
- url: string;
26
- }): Promise<void>;
27
- declare function redirectTo(options: {
28
- url: string;
29
- }): Promise<void>;
30
- declare function reLaunch(options: {
31
- url: string;
32
- }): Promise<void>;
33
- declare function switchTab(options: {
34
- url: string;
35
- }): Promise<void>;
36
- declare function navigateBack(options?: {
37
- delta?: number;
38
- }): Promise<void>;
33
+ declare function navigateTo(options: RouteOptions): Promise<{
34
+ errMsg: string;
35
+ }>;
36
+ declare function redirectTo(options: RouteOptions): Promise<{
37
+ errMsg: string;
38
+ }>;
39
+ declare function reLaunch(options: RouteOptions): Promise<{
40
+ errMsg: string;
41
+ }>;
42
+ declare function switchTab(options: RouteOptions): Promise<{
43
+ errMsg: string;
44
+ }>;
45
+ declare function navigateBack(options?: NavigateBackOptions): Promise<{
46
+ errMsg: string;
47
+ }>;
39
48
  declare function getLaunchOptionsSync(): AppLaunchOptions;
40
49
  declare function getEnterOptionsSync(): AppLaunchOptions;
41
50
  //#endregion
@@ -1,93 +1,114 @@
1
1
  import { slugify } from "../../shared/slugify.mjs";
2
- import { ensureButtonDefined, setButtonFormConfig } from "../button/index.mjs";
3
2
  import { setRuntimeWarningOptions } from "../warning.mjs";
3
+ import { setButtonFormConfig } from "../button/index.mjs";
4
4
  import { setRuntimeExecutionMode } from "../execution.mjs";
5
5
  import { defineComponent } from "../component/index.mjs";
6
+ import { configureTabBar, getTabBarPagePaths, syncTabBarRoute } from "../appShell/tabBar/index.mjs";
6
7
  import { ensureNavigationBarDefined, setNavigationBarMetrics } from "../navigationBar/index.mjs";
8
+ import { setupWebViewport } from "../viewport/index.mjs";
7
9
  import { setupRpx } from "../rpx.mjs";
8
- import { cloneLaunchOptions, resolveCurrentPages, resolveFallbackLaunchOptions } from "./appState.mjs";
10
+ import { configureWebSeo, setupWebResourceHints, syncWebDocumentHead } from "../seo/index.mjs";
11
+ import { resolveCurrentPages } from "./appState.mjs";
12
+ import { normalizeComponentOptions, normalizePageOptions } from "./routeRuntime/options.mjs";
13
+ import { AppLifecycleRuntime } from "./routeRuntime/appLifecycle.mjs";
14
+ import { configureWebRouting, getWebHistoryStack, readWebRouteTarget, syncWebRouting } from "./routeRuntime/history.mjs";
9
15
  import { augmentPageComponentOptions, dispatchPageLifetimeToComponents } from "./routeRuntime/lifecycle.mjs";
10
- import { mountEntryToDom } from "./routeRuntime/dom.mjs";
11
- import { isRecord, normalizeComponentOptions, normalizePageOptions } from "./routeRuntime/options.mjs";
16
+ import { resolveRouteAction } from "./routeRuntime/result.mjs";
17
+ import { PageStackRuntime } from "./routeRuntime/stack.mjs";
12
18
  import { parsePageUrl } from "./routeRuntime/url.mjs";
19
+ import { ensureNativeComponentsDefined } from "../nativeComponents/index.mjs";
13
20
 
14
21
  //#region src/runtime/polyfill/routeRuntime.ts
15
22
  const pageRegistry = /* @__PURE__ */ new Map();
16
23
  const componentRegistry = /* @__PURE__ */ new Map();
17
- const navigationHistory = [];
18
24
  let pageOrder = [];
19
- let appInstance;
20
- let appLaunched = false;
21
- let lastLaunchOptions;
22
25
  let pageResizeBridgeBound = false;
26
+ let pageStack;
27
+ const appLifecycle = new AppLifecycleRuntime(() => pageStack?.entries[pageStack.entries.length - 1]);
28
+ pageStack = new PageStackRuntime(pageRegistry, (entry) => appLifecycle.ensureLaunched(entry));
29
+ function syncCurrentWebDocument() {
30
+ const current = pageStack.entries[pageStack.entries.length - 1];
31
+ syncWebDocumentHead({
32
+ route: current?.id,
33
+ title: current ? pageRegistry.get(current.id)?.navigationBar?.title : void 0
34
+ });
35
+ }
36
+ function syncCurrentWebRoute(operation) {
37
+ syncWebRouting(pageStack.entries, operation);
38
+ syncCurrentWebDocument();
39
+ }
40
+ function reconcileWebRoute(target, state) {
41
+ const currentIds = pageStack.entries.map((entry) => entry.id);
42
+ const historyStack = getWebHistoryStack(state);
43
+ if (historyStack?.length) {
44
+ const desiredIds = historyStack.map((entry) => entry.id);
45
+ const sharedLength = Math.min(desiredIds.length, currentIds.length);
46
+ const samePrefix = desiredIds.slice(0, sharedLength).every((id, index) => currentIds[index] === id);
47
+ if (samePrefix && desiredIds.length < currentIds.length) pageStack.back(currentIds.length - desiredIds.length);
48
+ else if (samePrefix && desiredIds.length > currentIds.length) for (const entry of historyStack.slice(currentIds.length)) pageStack.push(entry.id, { ...entry.query });
49
+ else {
50
+ const last = historyStack[historyStack.length - 1];
51
+ pageStack.relaunch(last.id, { ...last.query });
52
+ }
53
+ syncTabBarRoute(pageStack.entries[pageStack.entries.length - 1]?.id ?? "");
54
+ syncCurrentWebDocument();
55
+ return;
56
+ }
57
+ if (target && pageRegistry.has(target.id)) {
58
+ pageStack.relaunch(target.id, { ...target.query });
59
+ syncTabBarRoute(target.id);
60
+ syncCurrentWebDocument();
61
+ }
62
+ }
63
+ function performSwitchTab(options) {
64
+ const { id, query } = parsePageUrl(options?.url ?? "");
65
+ const succeeded = pageStack.switchTab(id, query);
66
+ if (succeeded) {
67
+ syncTabBarRoute(id);
68
+ syncCurrentWebRoute("push");
69
+ }
70
+ return resolveRouteAction("switchTab", options, succeeded, "not a tabBar page");
71
+ }
23
72
  function bindPageResizeBridge() {
24
73
  if (pageResizeBridgeBound || typeof window === "undefined") return;
25
74
  if (typeof window.addEventListener !== "function") return;
26
75
  pageResizeBridgeBound = true;
27
76
  window.addEventListener("resize", () => {
28
- const pages = getCurrentPagesInternal();
77
+ const pages = resolveCurrentPages(pageStack.entries);
29
78
  const current = pages[pages.length - 1];
30
79
  if (!current) return;
31
80
  dispatchPageLifetimeToComponents(current, "resize");
32
81
  });
33
82
  }
34
- function ensureAppLaunched(entry) {
35
- if (!appInstance || appLaunched) return;
36
- const launchOptions = {
37
- path: entry.id,
38
- scene: 0,
39
- query: entry.query,
40
- referrerInfo: {}
41
- };
42
- lastLaunchOptions = {
43
- path: launchOptions.path,
44
- scene: launchOptions.scene,
45
- query: { ...launchOptions.query },
46
- referrerInfo: { ...launchOptions.referrerInfo }
47
- };
48
- if (typeof appInstance.onLaunch === "function") appInstance.onLaunch(launchOptions);
49
- if (typeof appInstance.onShow === "function") appInstance.onShow(launchOptions);
50
- appLaunched = true;
51
- }
52
- function mountEntry(entry) {
53
- mountEntryToDom(entry, pageRegistry, ensureAppLaunched);
54
- }
55
- function pushEntry(id, query) {
56
- if (!pageRegistry.has(id)) return;
57
- const entry = {
58
- id,
59
- query
60
- };
61
- navigationHistory.push(entry);
62
- mountEntry(entry);
63
- }
64
- function replaceEntry(id, query) {
65
- if (!pageRegistry.has(id)) return;
66
- const entry = {
67
- id,
68
- query
69
- };
70
- if (navigationHistory.length) navigationHistory[navigationHistory.length - 1] = entry;
71
- else navigationHistory.push(entry);
72
- mountEntry(entry);
73
- }
74
- function relaunchEntry(id, query) {
75
- navigationHistory.length = 0;
76
- pushEntry(id, query);
77
- }
78
83
  function initializePageRoutes(ids, options) {
79
84
  setRuntimeExecutionMode(options?.runtime?.executionMode);
80
85
  setRuntimeWarningOptions(options?.runtime?.warnings);
86
+ setupWebViewport(options?.runtime?.viewport);
87
+ configureWebSeo(options?.runtime?.seo);
88
+ setupWebResourceHints(options?.runtime?.resourceHints);
89
+ configureWebRouting(options?.runtime?.routing, ids, reconcileWebRoute);
90
+ appLifecycle.bindVisibility();
91
+ ensureNativeComponentsDefined();
81
92
  pageOrder = Array.from(new Set(ids));
93
+ configureTabBar(options?.tabBar, (url) => performSwitchTab({ url }));
94
+ pageStack.configureTabPages(getTabBarPagePaths());
82
95
  if (!pageOrder.length) return;
83
96
  bindPageResizeBridge();
84
97
  if (options?.rpx) setupRpx(options.rpx);
85
98
  if (options?.navigationBar) setNavigationBarMetrics(options.navigationBar);
86
99
  if (options?.form) setButtonFormConfig(options.form);
87
- if (!navigationHistory.length) pushEntry(pageOrder[0], {});
100
+ if (!pageStack.entries.length) {
101
+ const initialTarget = readWebRouteTarget(pageOrder);
102
+ const initialId = initialTarget?.id ?? pageOrder[0];
103
+ const initialQuery = initialTarget?.query ?? {};
104
+ if (pageStack.push(initialId, initialQuery)) {
105
+ syncTabBarRoute(initialId);
106
+ syncCurrentWebRoute("replace");
107
+ }
108
+ }
88
109
  }
89
110
  function registerPage(options, meta) {
90
- ensureButtonDefined();
111
+ ensureNativeComponentsDefined();
91
112
  ensureNavigationBarDefined();
92
113
  const tag = slugify(meta.id, "wv-page");
93
114
  const template = meta.template ?? (() => "");
@@ -95,8 +116,10 @@ function registerPage(options, meta) {
95
116
  const existing = pageRegistry.get(meta.id);
96
117
  if (existing) {
97
118
  existing.hooks = normalized.hooks;
119
+ existing.navigationBar = meta.navigationBar;
98
120
  const component = augmentPageComponentOptions(normalized.component, existing);
99
121
  defineComponent(tag, {
122
+ id: meta.id,
100
123
  template,
101
124
  style: meta.style,
102
125
  component
@@ -106,10 +129,12 @@ function registerPage(options, meta) {
106
129
  const record = {
107
130
  tag,
108
131
  hooks: normalized.hooks,
109
- instances: /* @__PURE__ */ new Set()
132
+ instances: /* @__PURE__ */ new Set(),
133
+ navigationBar: meta.navigationBar
110
134
  };
111
135
  const component = augmentPageComponentOptions(normalized.component, record);
112
136
  defineComponent(tag, {
137
+ id: meta.id,
113
138
  template,
114
139
  style: meta.style,
115
140
  component
@@ -117,13 +142,17 @@ function registerPage(options, meta) {
117
142
  pageRegistry.set(meta.id, record);
118
143
  return options;
119
144
  }
145
+ function getCurrentPageInstance() {
146
+ return pageStack.entries[pageStack.entries.length - 1]?.instance;
147
+ }
120
148
  function registerComponent(options, meta) {
121
- ensureButtonDefined();
149
+ ensureNativeComponentsDefined();
122
150
  const tag = slugify(meta.id, "wv-component");
123
151
  const template = meta.template ?? (() => "");
124
152
  const component = normalizeComponentOptions(options);
125
153
  if (componentRegistry.has(meta.id)) {
126
154
  defineComponent(tag, {
155
+ id: meta.id,
127
156
  template,
128
157
  style: meta.style,
129
158
  component
@@ -131,6 +160,7 @@ function registerComponent(options, meta) {
131
160
  return options;
132
161
  }
133
162
  defineComponent(tag, {
163
+ id: meta.id,
134
164
  template,
135
165
  style: meta.style,
136
166
  component
@@ -139,64 +169,59 @@ function registerComponent(options, meta) {
139
169
  return options;
140
170
  }
141
171
  function registerApp(options, _meta) {
142
- const resolved = options ?? {};
143
- if (appInstance) {
144
- const currentGlobal = appInstance.globalData;
145
- Object.assign(appInstance, resolved);
146
- if (isRecord(currentGlobal)) appInstance.globalData = currentGlobal;
147
- else if (!isRecord(appInstance.globalData)) appInstance.globalData = {};
148
- return options;
149
- }
150
- appInstance = resolved;
151
- appLaunched = false;
152
- lastLaunchOptions = void 0;
153
- if (!isRecord(appInstance.globalData)) appInstance.globalData = {};
154
- return options;
172
+ return appLifecycle.register(options);
155
173
  }
156
174
  function navigateTo(options) {
157
- if (!options?.url) return Promise.resolve();
158
- const { id, query } = parsePageUrl(options.url);
159
- pushEntry(id, query);
160
- return Promise.resolve();
175
+ const { id, query } = parsePageUrl(options?.url ?? "");
176
+ const succeeded = pageStack.push(id, query);
177
+ if (succeeded) {
178
+ syncTabBarRoute(id);
179
+ syncCurrentWebRoute("push");
180
+ }
181
+ return resolveRouteAction("navigateTo", options, succeeded);
161
182
  }
162
183
  function redirectTo(options) {
163
- if (!options?.url) return Promise.resolve();
164
- const { id, query } = parsePageUrl(options.url);
165
- replaceEntry(id, query);
166
- return Promise.resolve();
184
+ const { id, query } = parsePageUrl(options?.url ?? "");
185
+ const succeeded = pageStack.replace(id, query);
186
+ if (succeeded) {
187
+ syncTabBarRoute(id);
188
+ syncCurrentWebRoute("replace");
189
+ }
190
+ return resolveRouteAction("redirectTo", options, succeeded);
167
191
  }
168
192
  function reLaunch(options) {
169
- if (!options?.url) return Promise.resolve();
170
- const { id, query } = parsePageUrl(options.url);
171
- relaunchEntry(id, query);
172
- return Promise.resolve();
193
+ const { id, query } = parsePageUrl(options?.url ?? "");
194
+ const succeeded = pageStack.relaunch(id, query);
195
+ if (succeeded) {
196
+ syncTabBarRoute(id);
197
+ syncCurrentWebRoute("replace");
198
+ }
199
+ return resolveRouteAction("reLaunch", options, succeeded);
173
200
  }
174
201
  function switchTab(options) {
175
- return redirectTo(options);
202
+ return performSwitchTab(options);
176
203
  }
177
204
  function navigateBack(options) {
178
- if (navigationHistory.length <= 1) return Promise.resolve();
179
- const delta = Math.max(1, options?.delta ?? 1);
180
- const targetIndex = Math.max(0, navigationHistory.length - 1 - delta);
181
- const target = navigationHistory[targetIndex];
182
- navigationHistory.length = targetIndex;
183
- pushEntry(target.id, target.query);
184
- return Promise.resolve();
205
+ const succeeded = pageStack.back(options?.delta);
206
+ if (succeeded) {
207
+ syncTabBarRoute(pageStack.entries[pageStack.entries.length - 1]?.id ?? "");
208
+ syncCurrentWebRoute("replace");
209
+ }
210
+ return resolveRouteAction("navigateBack", options, succeeded);
185
211
  }
186
212
  function getCurrentPagesInternal() {
187
- return resolveCurrentPages(navigationHistory);
213
+ return resolveCurrentPages(pageStack.entries);
188
214
  }
189
215
  function getAppInstance() {
190
- return appInstance;
216
+ return appLifecycle.instance;
191
217
  }
192
218
  function getLaunchOptionsSync() {
193
- if (lastLaunchOptions) return cloneLaunchOptions(lastLaunchOptions);
194
- return resolveFallbackLaunchOptions(navigationHistory);
219
+ return appLifecycle.getLaunchOptions();
195
220
  }
196
221
  function getEnterOptionsSync() {
197
- return getLaunchOptionsSync();
222
+ return appLifecycle.getEnterOptions();
198
223
  }
199
224
 
200
225
  //#endregion
201
- export { getAppInstance, getCurrentPagesInternal, getEnterOptionsSync, getLaunchOptionsSync, initializePageRoutes, navigateBack, navigateTo, reLaunch, redirectTo, registerApp, registerComponent, registerPage, switchTab };
226
+ export { getAppInstance, getCurrentPageInstance, getCurrentPagesInternal, getEnterOptionsSync, getLaunchOptionsSync, initializePageRoutes, navigateBack, navigateTo, reLaunch, redirectTo, registerApp, registerComponent, registerPage, switchTab };
202
227
  //# sourceMappingURL=routeRuntime.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"routeRuntime.mjs","names":[],"sources":["../../../src/runtime/polyfill/routeRuntime.ts"],"sourcesContent":["import type { ButtonFormConfig } from '../button'\nimport type { ComponentPublicInstance } from '../component'\nimport type { NavigationBarMetrics } from '../navigationBar'\nimport type { AppLaunchOptions, AppRuntime, ComponentRawOptions, ComponentRecord, PageRawOptions, PageRecord, PageStackEntry, RegisterMeta } from './routeRuntime/options'\nimport { slugify } from '../../shared/slugify'\nimport { ensureButtonDefined, setButtonFormConfig } from '../button'\nimport { defineComponent } from '../component'\nimport { setRuntimeExecutionMode } from '../execution'\nimport { ensureNavigationBarDefined, setNavigationBarMetrics } from '../navigationBar'\nimport { setupRpx } from '../rpx'\nimport { setRuntimeWarningOptions } from '../warning'\nimport {\n cloneLaunchOptions,\n resolveCurrentPages,\n resolveFallbackLaunchOptions,\n} from './appState'\nimport { mountEntryToDom } from './routeRuntime/dom'\nimport {\n augmentPageComponentOptions,\n dispatchPageLifetimeToComponents,\n} from './routeRuntime/lifecycle'\nimport {\n\n isRecord,\n normalizeComponentOptions,\n normalizePageOptions,\n} from './routeRuntime/options'\nimport { parsePageUrl } from './routeRuntime/url'\n\nconst pageRegistry = new Map<string, PageRecord>()\nconst componentRegistry = new Map<string, ComponentRecord>()\nconst navigationHistory: PageStackEntry[] = []\nlet pageOrder: string[] = []\nlet appInstance: AppRuntime | undefined\nlet appLaunched = false\nlet lastLaunchOptions: AppLaunchOptions | undefined\nlet pageResizeBridgeBound = false\n\nfunction bindPageResizeBridge() {\n if (pageResizeBridgeBound || typeof window === 'undefined') {\n return\n }\n if (typeof window.addEventListener !== 'function') {\n return\n }\n pageResizeBridgeBound = true\n window.addEventListener('resize', () => {\n const pages = getCurrentPagesInternal()\n const current = pages[pages.length - 1]\n if (!current) {\n return\n }\n dispatchPageLifetimeToComponents(current, 'resize')\n })\n}\n\nfunction ensureAppLaunched(entry: PageStackEntry) {\n if (!appInstance || appLaunched) {\n return\n }\n const launchOptions: AppLaunchOptions = {\n path: entry.id,\n scene: 0,\n query: entry.query,\n referrerInfo: {},\n }\n lastLaunchOptions = {\n path: launchOptions.path,\n scene: launchOptions.scene,\n query: { ...launchOptions.query },\n referrerInfo: { ...launchOptions.referrerInfo },\n }\n if (typeof appInstance.onLaunch === 'function') {\n appInstance.onLaunch(launchOptions)\n }\n if (typeof appInstance.onShow === 'function') {\n appInstance.onShow(launchOptions)\n }\n appLaunched = true\n}\n\nfunction mountEntry(entry: PageStackEntry) {\n mountEntryToDom(entry, pageRegistry, ensureAppLaunched)\n}\n\nfunction pushEntry(id: string, query: Record<string, string>) {\n if (!pageRegistry.has(id)) {\n return\n }\n const entry: PageStackEntry = { id, query }\n navigationHistory.push(entry)\n mountEntry(entry)\n}\n\nfunction replaceEntry(id: string, query: Record<string, string>) {\n if (!pageRegistry.has(id)) {\n return\n }\n const entry: PageStackEntry = { id, query }\n if (navigationHistory.length) {\n navigationHistory[navigationHistory.length - 1] = entry\n }\n else {\n navigationHistory.push(entry)\n }\n mountEntry(entry)\n}\n\nfunction relaunchEntry(id: string, query: Record<string, string>) {\n navigationHistory.length = 0\n pushEntry(id, query)\n}\n\nexport function initializePageRoutes(\n ids: string[],\n options?: {\n rpx?: { designWidth?: number, varName?: string }\n navigationBar?: NavigationBarMetrics\n form?: ButtonFormConfig\n runtime?: {\n executionMode?: 'compat' | 'safe' | 'strict'\n warnings?: {\n level?: 'off' | 'warn' | 'error'\n dedupe?: boolean\n }\n }\n },\n) {\n setRuntimeExecutionMode(options?.runtime?.executionMode)\n setRuntimeWarningOptions(options?.runtime?.warnings)\n pageOrder = Array.from(new Set(ids))\n if (!pageOrder.length) {\n return\n }\n bindPageResizeBridge()\n if (options?.rpx) {\n setupRpx(options.rpx)\n }\n if (options?.navigationBar) {\n setNavigationBarMetrics(options.navigationBar)\n }\n if (options?.form) {\n setButtonFormConfig(options.form)\n }\n if (!navigationHistory.length) {\n pushEntry(pageOrder[0], {})\n }\n}\n\nexport function registerPage<T extends PageRawOptions | undefined>(options: T, meta: RegisterMeta): T {\n ensureButtonDefined()\n ensureNavigationBarDefined()\n const tag = slugify(meta.id, 'wv-page')\n const template = meta.template ?? (() => '')\n const normalized = normalizePageOptions(options)\n const existing = pageRegistry.get(meta.id)\n if (existing) {\n existing.hooks = normalized.hooks\n const component = augmentPageComponentOptions(normalized.component, existing)\n defineComponent(tag, {\n template,\n style: meta.style,\n component,\n })\n return options\n }\n const record: PageRecord = {\n tag,\n hooks: normalized.hooks,\n instances: new Set(),\n }\n const component = augmentPageComponentOptions(normalized.component, record)\n defineComponent(tag, {\n template,\n style: meta.style,\n component,\n })\n pageRegistry.set(meta.id, record)\n return options\n}\n\nexport function registerComponent<T extends ComponentRawOptions | undefined>(options: T, meta: RegisterMeta): T {\n ensureButtonDefined()\n const tag = slugify(meta.id, 'wv-component')\n const template = meta.template ?? (() => '')\n const component = normalizeComponentOptions(options)\n if (componentRegistry.has(meta.id)) {\n defineComponent(tag, {\n template,\n style: meta.style,\n component,\n })\n return options\n }\n defineComponent(tag, {\n template,\n style: meta.style,\n component,\n })\n componentRegistry.set(meta.id, { tag })\n return options\n}\n\nexport function registerApp<T extends AppRuntime | undefined>(options: T, _meta?: RegisterMeta): T {\n const resolved = (options ?? {}) as AppRuntime\n if (appInstance) {\n const currentGlobal = appInstance.globalData\n Object.assign(appInstance, resolved)\n if (isRecord(currentGlobal)) {\n appInstance.globalData = currentGlobal\n }\n else if (!isRecord(appInstance.globalData)) {\n appInstance.globalData = {}\n }\n return options\n }\n appInstance = resolved\n appLaunched = false\n lastLaunchOptions = undefined\n if (!isRecord(appInstance.globalData)) {\n appInstance.globalData = {}\n }\n return options\n}\n\nexport function navigateTo(options: { url: string }) {\n if (!options?.url) {\n return Promise.resolve()\n }\n const { id, query } = parsePageUrl(options.url)\n pushEntry(id, query)\n return Promise.resolve()\n}\n\nexport function redirectTo(options: { url: string }) {\n if (!options?.url) {\n return Promise.resolve()\n }\n const { id, query } = parsePageUrl(options.url)\n replaceEntry(id, query)\n return Promise.resolve()\n}\n\nexport function reLaunch(options: { url: string }) {\n if (!options?.url) {\n return Promise.resolve()\n }\n const { id, query } = parsePageUrl(options.url)\n relaunchEntry(id, query)\n return Promise.resolve()\n}\n\nexport function switchTab(options: { url: string }) {\n return redirectTo(options)\n}\n\nexport function navigateBack(options?: { delta?: number }) {\n if (navigationHistory.length <= 1) {\n return Promise.resolve()\n }\n const delta = Math.max(1, options?.delta ?? 1)\n const targetIndex = Math.max(0, navigationHistory.length - 1 - delta)\n const target = navigationHistory[targetIndex]\n navigationHistory.length = targetIndex\n pushEntry(target.id, target.query)\n return Promise.resolve()\n}\n\nexport function getCurrentPagesInternal() {\n return resolveCurrentPages<ComponentPublicInstance>(navigationHistory)\n}\n\nexport function getAppInstance() {\n return appInstance\n}\n\nexport function getLaunchOptionsSync(): AppLaunchOptions {\n if (lastLaunchOptions) {\n return cloneLaunchOptions(lastLaunchOptions)\n }\n return resolveFallbackLaunchOptions(navigationHistory)\n}\n\nexport function getEnterOptionsSync(): AppLaunchOptions {\n return getLaunchOptionsSync()\n}\n"],"mappings":";;;;;;;;;;;;;;AA6BA,MAAM,+BAAe,IAAI,IAAwB;AACjD,MAAM,oCAAoB,IAAI,IAA6B;AAC3D,MAAM,oBAAsC,CAAC;AAC7C,IAAI,YAAsB,CAAC;AAC3B,IAAI;AACJ,IAAI,cAAc;AAClB,IAAI;AACJ,IAAI,wBAAwB;AAE5B,SAAS,uBAAuB;CAC9B,IAAI,yBAAyB,OAAO,WAAW,aAC7C;CAEF,IAAI,OAAO,OAAO,qBAAqB,YACrC;CAEF,wBAAwB;CACxB,OAAO,iBAAiB,gBAAgB;EACtC,MAAM,QAAQ,wBAAwB;EACtC,MAAM,UAAU,MAAM,MAAM,SAAS;EACrC,IAAI,CAAC,SACH;EAEF,iCAAiC,SAAS,QAAQ;CACpD,CAAC;AACH;AAEA,SAAS,kBAAkB,OAAuB;CAChD,IAAI,CAAC,eAAe,aAClB;CAEF,MAAM,gBAAkC;EACtC,MAAM,MAAM;EACZ,OAAO;EACP,OAAO,MAAM;EACb,cAAc,CAAC;CACjB;CACA,oBAAoB;EAClB,MAAM,cAAc;EACpB,OAAO,cAAc;EACrB,OAAO,EAAE,GAAG,cAAc,MAAM;EAChC,cAAc,EAAE,GAAG,cAAc,aAAa;CAChD;CACA,IAAI,OAAO,YAAY,aAAa,YAClC,YAAY,SAAS,aAAa;CAEpC,IAAI,OAAO,YAAY,WAAW,YAChC,YAAY,OAAO,aAAa;CAElC,cAAc;AAChB;AAEA,SAAS,WAAW,OAAuB;CACzC,gBAAgB,OAAO,cAAc,iBAAiB;AACxD;AAEA,SAAS,UAAU,IAAY,OAA+B;CAC5D,IAAI,CAAC,aAAa,IAAI,EAAE,GACtB;CAEF,MAAM,QAAwB;EAAE;EAAI;CAAM;CAC1C,kBAAkB,KAAK,KAAK;CAC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QAAQ;AACzB;AAEA,SAAgB,SAAS,SAA0B;CACjD,IAAI,CAAC,SAAS,KACZ,OAAO,QAAQ,QAAQ;CAEzB,MAAM,EAAE,IAAI,UAAU,aAAa,QAAQ,GAAG;CAC9C,cAAc,IAAI,KAAK;CACvB,OAAO,QAAQ,QAAQ;AACzB;AAEA,SAAgB,UAAU,SAA0B;CAClD,OAAO,WAAW,OAAO;AAC3B;AAEA,SAAgB,aAAa,SAA8B;CACzD,IAAI,kBAAkB,UAAU,GAC9B,OAAO,QAAQ,QAAQ;CAEzB,MAAM,QAAQ,KAAK,IAAI,GAAG,SAAS,SAAS,CAAC;CAC7C,MAAM,cAAc,KAAK,IAAI,GAAG,kBAAkB,SAAS,IAAI,KAAK;CACpE,MAAM,SAAS,kBAAkB;CACjC,kBAAkB,SAAS;CAC3B,UAAU,OAAO,IAAI,OAAO,KAAK;CACjC,OAAO,QAAQ,QAAQ;AACzB;AAEA,SAAgB,0BAA0B;CACxC,OAAO,oBAA6C,iBAAiB;AACvE;AAEA,SAAgB,iBAAiB;CAC/B,OAAO;AACT;AAEA,SAAgB,uBAAyC;CACvD,IAAI,mBACF,OAAO,mBAAmB,iBAAiB;CAE7C,OAAO,6BAA6B,iBAAiB;AACvD;AAEA,SAAgB,sBAAwC;CACtD,OAAO,qBAAqB;AAC9B"}
1
+ {"version":3,"file":"routeRuntime.mjs","names":[],"sources":["../../../src/runtime/polyfill/routeRuntime.ts"],"sourcesContent":["import type { WebTabBarConfig } from '../../shared/tabBar'\nimport type { ButtonFormConfig } from '../button'\nimport type { ComponentPublicInstance } from '../component'\nimport type { NavigationBarMetrics } from '../navigationBar'\nimport type { WebResourceHintsConfig, WebSeoConfig } from '../seo'\nimport type { WebViewportConfig } from '../viewport'\nimport type { WebRouteHistoryState, WebRouteTarget, WebRoutingConfig } from './routeRuntime/history'\nimport type { AppRuntime, ComponentRawOptions, ComponentRecord, NavigateBackOptions, PageRawOptions, PageRecord, RegisterMeta, RouteOptions } from './routeRuntime/options'\nimport { slugify } from '../../shared/slugify'\nimport {\n configureTabBar,\n getTabBarPagePaths,\n syncTabBarRoute,\n} from '../appShell/tabBar'\nimport { setButtonFormConfig } from '../button'\nimport { defineComponent } from '../component'\nimport { setRuntimeExecutionMode } from '../execution'\nimport { ensureNativeComponentsDefined } from '../nativeComponents'\nimport { ensureNavigationBarDefined, setNavigationBarMetrics } from '../navigationBar'\nimport { setupRpx } from '../rpx'\nimport { configureWebSeo, setupWebResourceHints, syncWebDocumentHead } from '../seo'\nimport { setupWebViewport } from '../viewport'\nimport { setRuntimeWarningOptions } from '../warning'\nimport { resolveCurrentPages } from './appState'\nimport { AppLifecycleRuntime } from './routeRuntime/appLifecycle'\nimport {\n configureWebRouting,\n getWebHistoryStack,\n readWebRouteTarget,\n syncWebRouting,\n} from './routeRuntime/history'\nimport {\n augmentPageComponentOptions,\n dispatchPageLifetimeToComponents,\n} from './routeRuntime/lifecycle'\nimport {\n normalizeComponentOptions,\n normalizePageOptions,\n} from './routeRuntime/options'\nimport { resolveRouteAction } from './routeRuntime/result'\nimport { PageStackRuntime } from './routeRuntime/stack'\nimport { parsePageUrl } from './routeRuntime/url'\n\nconst pageRegistry = new Map<string, PageRecord>()\nconst componentRegistry = new Map<string, ComponentRecord>()\nlet pageOrder: string[] = []\nlet pageResizeBridgeBound = false\n\nlet pageStack: PageStackRuntime\nconst appLifecycle = new AppLifecycleRuntime(\n () => pageStack?.entries[pageStack.entries.length - 1],\n)\npageStack = new PageStackRuntime(pageRegistry, entry => appLifecycle.ensureLaunched(entry))\n\nfunction syncCurrentWebDocument() {\n const current = pageStack.entries[pageStack.entries.length - 1]\n syncWebDocumentHead({\n route: current?.id,\n title: current ? pageRegistry.get(current.id)?.navigationBar?.title : undefined,\n })\n}\n\nfunction syncCurrentWebRoute(operation: 'push' | 'replace') {\n syncWebRouting(pageStack.entries, operation)\n syncCurrentWebDocument()\n}\n\nfunction reconcileWebRoute(target: WebRouteTarget | undefined, state: WebRouteHistoryState | undefined) {\n const currentIds = pageStack.entries.map(entry => entry.id)\n const historyStack = getWebHistoryStack(state)\n if (historyStack?.length) {\n const desiredIds = historyStack.map(entry => entry.id)\n const sharedLength = Math.min(desiredIds.length, currentIds.length)\n const samePrefix = desiredIds\n .slice(0, sharedLength)\n .every((id, index) => currentIds[index] === id)\n if (samePrefix && desiredIds.length < currentIds.length) {\n pageStack.back(currentIds.length - desiredIds.length)\n }\n else if (samePrefix && desiredIds.length > currentIds.length) {\n for (const entry of historyStack.slice(currentIds.length)) {\n pageStack.push(entry.id, { ...entry.query })\n }\n }\n else {\n const last = historyStack[historyStack.length - 1]!\n pageStack.relaunch(last.id, { ...last.query })\n }\n syncTabBarRoute(pageStack.entries[pageStack.entries.length - 1]?.id ?? '')\n syncCurrentWebDocument()\n return\n }\n if (target && pageRegistry.has(target.id)) {\n pageStack.relaunch(target.id, { ...target.query })\n syncTabBarRoute(target.id)\n syncCurrentWebDocument()\n }\n}\n\nfunction performSwitchTab(options: RouteOptions) {\n const { id, query } = parsePageUrl(options?.url ?? '')\n const succeeded = pageStack.switchTab(id, query)\n if (succeeded) {\n syncTabBarRoute(id)\n syncCurrentWebRoute('push')\n }\n return resolveRouteAction('switchTab', options, succeeded, 'not a tabBar page')\n}\n\nfunction bindPageResizeBridge() {\n if (pageResizeBridgeBound || typeof window === 'undefined') {\n return\n }\n if (typeof window.addEventListener !== 'function') {\n return\n }\n pageResizeBridgeBound = true\n window.addEventListener('resize', () => {\n const pages = resolveCurrentPages<ComponentPublicInstance>(pageStack.entries)\n const current = pages[pages.length - 1]\n if (!current) {\n return\n }\n dispatchPageLifetimeToComponents(current, 'resize')\n })\n}\n\nexport function initializePageRoutes(\n ids: string[],\n options?: {\n rpx?: { designWidth?: number, varName?: string }\n navigationBar?: NavigationBarMetrics\n form?: ButtonFormConfig\n tabBar?: WebTabBarConfig\n runtime?: {\n executionMode?: 'compat' | 'safe' | 'strict'\n warnings?: {\n level?: 'off' | 'warn' | 'error'\n dedupe?: boolean\n }\n viewport?: WebViewportConfig\n routing?: WebRoutingConfig\n seo?: WebSeoConfig\n resourceHints?: WebResourceHintsConfig\n }\n },\n) {\n setRuntimeExecutionMode(options?.runtime?.executionMode)\n setRuntimeWarningOptions(options?.runtime?.warnings)\n setupWebViewport(options?.runtime?.viewport)\n configureWebSeo(options?.runtime?.seo)\n setupWebResourceHints(options?.runtime?.resourceHints)\n configureWebRouting(options?.runtime?.routing, ids, reconcileWebRoute)\n appLifecycle.bindVisibility()\n ensureNativeComponentsDefined()\n pageOrder = Array.from(new Set(ids))\n configureTabBar(options?.tabBar, url => performSwitchTab({ url }))\n pageStack.configureTabPages(getTabBarPagePaths())\n if (!pageOrder.length) {\n return\n }\n bindPageResizeBridge()\n if (options?.rpx) {\n setupRpx(options.rpx)\n }\n if (options?.navigationBar) {\n setNavigationBarMetrics(options.navigationBar)\n }\n if (options?.form) {\n setButtonFormConfig(options.form)\n }\n if (!pageStack.entries.length) {\n const initialTarget = readWebRouteTarget(pageOrder)\n const initialId = initialTarget?.id ?? pageOrder[0]\n const initialQuery = initialTarget?.query ?? {}\n if (pageStack.push(initialId, initialQuery)) {\n syncTabBarRoute(initialId)\n syncCurrentWebRoute('replace')\n }\n }\n}\n\nexport function registerPage<T extends PageRawOptions | undefined>(options: T, meta: RegisterMeta): T {\n ensureNativeComponentsDefined()\n ensureNavigationBarDefined()\n const tag = slugify(meta.id, 'wv-page')\n const template = meta.template ?? (() => '')\n const normalized = normalizePageOptions(options)\n const existing = pageRegistry.get(meta.id)\n if (existing) {\n existing.hooks = normalized.hooks\n existing.navigationBar = meta.navigationBar\n const component = augmentPageComponentOptions(normalized.component, existing)\n defineComponent(tag, {\n id: meta.id,\n template,\n style: meta.style,\n component,\n })\n return options\n }\n const record: PageRecord = {\n tag,\n hooks: normalized.hooks,\n instances: new Set(),\n navigationBar: meta.navigationBar,\n }\n const component = augmentPageComponentOptions(normalized.component, record)\n defineComponent(tag, {\n id: meta.id,\n template,\n style: meta.style,\n component,\n })\n pageRegistry.set(meta.id, record)\n return options\n}\n\nexport function getCurrentPageInstance(): ComponentPublicInstance | undefined {\n return pageStack.entries[pageStack.entries.length - 1]?.instance\n}\n\nexport function registerComponent<T extends ComponentRawOptions | undefined>(options: T, meta: RegisterMeta): T {\n ensureNativeComponentsDefined()\n const tag = slugify(meta.id, 'wv-component')\n const template = meta.template ?? (() => '')\n const component = normalizeComponentOptions(options)\n if (componentRegistry.has(meta.id)) {\n defineComponent(tag, {\n id: meta.id,\n template,\n style: meta.style,\n component,\n })\n return options\n }\n defineComponent(tag, {\n id: meta.id,\n template,\n style: meta.style,\n component,\n })\n componentRegistry.set(meta.id, { tag })\n return options\n}\n\nexport function registerApp<T extends AppRuntime | undefined>(options: T, _meta?: RegisterMeta): T {\n return appLifecycle.register(options)\n}\n\nexport function navigateTo(options: RouteOptions) {\n const { id, query } = parsePageUrl(options?.url ?? '')\n const succeeded = pageStack.push(id, query)\n if (succeeded) {\n syncTabBarRoute(id)\n syncCurrentWebRoute('push')\n }\n return resolveRouteAction('navigateTo', options, succeeded)\n}\n\nexport function redirectTo(options: RouteOptions) {\n const { id, query } = parsePageUrl(options?.url ?? '')\n const succeeded = pageStack.replace(id, query)\n if (succeeded) {\n syncTabBarRoute(id)\n syncCurrentWebRoute('replace')\n }\n return resolveRouteAction('redirectTo', options, succeeded)\n}\n\nexport function reLaunch(options: RouteOptions) {\n const { id, query } = parsePageUrl(options?.url ?? '')\n const succeeded = pageStack.relaunch(id, query)\n if (succeeded) {\n syncTabBarRoute(id)\n syncCurrentWebRoute('replace')\n }\n return resolveRouteAction('reLaunch', options, succeeded)\n}\n\nexport function switchTab(options: RouteOptions) {\n return performSwitchTab(options)\n}\n\nexport function navigateBack(options?: NavigateBackOptions) {\n const succeeded = pageStack.back(options?.delta)\n if (succeeded) {\n syncTabBarRoute(pageStack.entries[pageStack.entries.length - 1]?.id ?? '')\n syncCurrentWebRoute('replace')\n }\n return resolveRouteAction('navigateBack', options, succeeded)\n}\n\nexport function getCurrentPagesInternal() {\n return resolveCurrentPages<ComponentPublicInstance>(pageStack.entries)\n}\n\nexport function getAppInstance() {\n return appLifecycle.instance\n}\n\nexport function getLaunchOptionsSync() {\n return appLifecycle.getLaunchOptions()\n}\n\nexport function getEnterOptionsSync() {\n return appLifecycle.getEnterOptions()\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,+BAAe,IAAI,IAAwB;AACjD,MAAM,oCAAoB,IAAI,IAA6B;AAC3D,IAAI,YAAsB,CAAC;AAC3B,IAAI,wBAAwB;AAE5B,IAAI;AACJ,MAAM,eAAe,IAAI,0BACjB,WAAW,QAAQ,UAAU,QAAQ,SAAS,EACtD;AACA,YAAY,IAAI,iBAAiB,eAAc,UAAS,aAAa,eAAe,KAAK,CAAC;AAE1F,SAAS,yBAAyB;CAChC,MAAM,UAAU,UAAU,QAAQ,UAAU,QAAQ,SAAS;CAC7D,oBAAoB;EAClB,OAAO,SAAS;EAChB,OAAO,UAAU,aAAa,IAAI,QAAQ,EAAE,CAAC,EAAE,eAAe,QAAQ;CACxE,CAAC;AACH;AAEA,SAAS,oBAAoB,WAA+B;CAC1D,eAAe,UAAU,SAAS,SAAS;CAC3C,uBAAuB;AACzB;AAEA,SAAS,kBAAkB,QAAoC,OAAyC;CACtG,MAAM,aAAa,UAAU,QAAQ,KAAI,UAAS,MAAM,EAAE;CAC1D,MAAM,eAAe,mBAAmB,KAAK;CAC7C,IAAI,cAAc,QAAQ;EACxB,MAAM,aAAa,aAAa,KAAI,UAAS,MAAM,EAAE;EACrD,MAAM,eAAe,KAAK,IAAI,WAAW,QAAQ,WAAW,MAAM;EAClE,MAAM,aAAa,WAChB,MAAM,GAAG,YAAY,CAAC,CACtB,OAAO,IAAI,UAAU,WAAW,WAAW,EAAE;EAChD,IAAI,cAAc,WAAW,SAAS,WAAW,QAC/C,UAAU,KAAK,WAAW,SAAS,WAAW,MAAM;OAEjD,IAAI,cAAc,WAAW,SAAS,WAAW,QACpD,KAAK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