wevu 7.2.2 → 7.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 (383) hide show
  1. package/README.md +6 -0
  2. package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +1 -1
  3. package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +1 -1
  4. package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +1 -1
  5. package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +1 -1
  6. package/dist/dev/internal-runtime.d.mts +2 -1
  7. package/dist/dev/internal-runtime.mjs +3 -2
  8. package/dist/dev/package.mjs +1 -1
  9. package/dist/dev/reactivity/asyncDerivation.mjs +8 -10
  10. package/dist/dev/reactivity/asyncDerivation.mjs.map +1 -1
  11. package/dist/dev/reactivity/core.mjs +5 -8
  12. package/dist/dev/reactivity/core.mjs.map +1 -1
  13. package/dist/dev/reactivity/reactive/patch.mjs +3 -3
  14. package/dist/dev/reactivity/reactive/patch.mjs.map +1 -1
  15. package/dist/dev/reactivity/reactive/patchState.mjs +4 -8
  16. package/dist/dev/reactivity/reactive/patchState.mjs.map +1 -1
  17. package/dist/dev/reactivity/reactive/shared.mjs +1 -2
  18. package/dist/dev/reactivity/reactive/shared.mjs.map +1 -1
  19. package/dist/dev/reactivity/reactive.mjs +5 -10
  20. package/dist/dev/reactivity/reactive.mjs.map +1 -1
  21. package/dist/dev/reactivity/ref.mjs +2 -2
  22. package/dist/dev/reactivity/ref.mjs.map +1 -1
  23. package/dist/dev/reactivity/shallowRef.mjs +1 -1
  24. package/dist/dev/reactivity/shallowRef.mjs.map +1 -1
  25. package/dist/dev/reactivity/watch/helpers.mjs +1 -1
  26. package/dist/dev/reactivity/watch/helpers.mjs.map +1 -1
  27. package/dist/dev/reactivity/watch.mjs +6 -8
  28. package/dist/dev/reactivity/watch.mjs.map +1 -1
  29. package/dist/dev/router/createRouter.mjs +17 -24
  30. package/dist/dev/router/createRouter.mjs.map +1 -1
  31. package/dist/dev/router/initialNavigation.mjs +22 -17
  32. package/dist/dev/router/initialNavigation.mjs.map +1 -1
  33. package/dist/dev/router/instance.mjs +1 -2
  34. package/dist/dev/router/instance.mjs.map +1 -1
  35. package/dist/dev/router/navigationCore.mjs +2 -2
  36. package/dist/dev/router/navigationCore.mjs.map +1 -1
  37. package/dist/dev/router/navigationResult.mjs +7 -10
  38. package/dist/dev/router/navigationResult.mjs.map +1 -1
  39. package/dist/dev/router/navigationTarget.mjs +1 -3
  40. package/dist/dev/router/navigationTarget.mjs.map +1 -1
  41. package/dist/dev/router/resolve.mjs +3 -4
  42. package/dist/dev/router/resolve.mjs.map +1 -1
  43. package/dist/dev/router/routeRegistry.mjs +1 -1
  44. package/dist/dev/router/routeRegistry.mjs.map +1 -1
  45. package/dist/dev/router/routeSync.mjs +1 -1
  46. package/dist/dev/router/routeSync.mjs.map +1 -1
  47. package/dist/dev/router/scrollRestoration/adapters.d.mts +8 -0
  48. package/dist/dev/router/scrollRestoration/adapters.mjs +86 -0
  49. package/dist/dev/router/scrollRestoration/adapters.mjs.map +1 -0
  50. package/dist/dev/router/scrollRestoration/controller.d.mts +8 -0
  51. package/dist/dev/router/scrollRestoration/controller.mjs +148 -0
  52. package/dist/dev/router/scrollRestoration/controller.mjs.map +1 -0
  53. package/dist/dev/router/scrollRestoration/host.d.mts +3 -0
  54. package/dist/dev/router/scrollRestoration/host.mjs +76 -0
  55. package/dist/dev/router/scrollRestoration/host.mjs.map +1 -0
  56. package/dist/dev/router/scrollRestoration/index.d.mts +9 -0
  57. package/dist/dev/router/scrollRestoration/index.mjs +156 -0
  58. package/dist/dev/router/scrollRestoration/index.mjs.map +1 -0
  59. package/dist/dev/router/scrollRestoration/types.d.mts +61 -0
  60. package/dist/dev/router/useRoute.mjs +12 -19
  61. package/dist/dev/router/useRoute.mjs.map +1 -1
  62. package/dist/dev/router.d.mts +5 -1
  63. package/dist/dev/router.mjs +4 -1
  64. package/dist/dev/routerInternal/location.mjs +2 -3
  65. package/dist/dev/routerInternal/location.mjs.map +1 -1
  66. package/dist/dev/routerInternal/params.mjs +2 -3
  67. package/dist/dev/routerInternal/params.mjs.map +1 -1
  68. package/dist/dev/routerInternal/records.mjs +1 -1
  69. package/dist/dev/routerInternal/records.mjs.map +1 -1
  70. package/dist/dev/routerInternal/recordsWarnings.mjs +1 -2
  71. package/dist/dev/routerInternal/recordsWarnings.mjs.map +1 -1
  72. package/dist/dev/runtime/app/context.mjs +13 -26
  73. package/dist/dev/runtime/app/context.mjs.map +1 -1
  74. package/dist/dev/runtime/app/diagnostics.mjs +2 -4
  75. package/dist/dev/runtime/app/diagnostics.mjs.map +1 -1
  76. package/dist/dev/runtime/app/mount.mjs +27 -33
  77. package/dist/dev/runtime/app/mount.mjs.map +1 -1
  78. package/dist/dev/runtime/app/setData/commitTracker.mjs +5 -9
  79. package/dist/dev/runtime/app/setData/commitTracker.mjs.map +1 -1
  80. package/dist/dev/runtime/app/setData/patchScheduler.mjs +2 -4
  81. package/dist/dev/runtime/app/setData/patchScheduler.mjs.map +1 -1
  82. package/dist/dev/runtime/app/setData/payload.mjs +2 -3
  83. package/dist/dev/runtime/app/setData/payload.mjs.map +1 -1
  84. package/dist/dev/runtime/app/setData/scheduler.mjs +7 -9
  85. package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -1
  86. package/dist/dev/runtime/app/setData/snapshot.mjs +5 -6
  87. package/dist/dev/runtime/app/setData/snapshot.mjs.map +1 -1
  88. package/dist/dev/runtime/app/setDataOptions.mjs +26 -27
  89. package/dist/dev/runtime/app/setDataOptions.mjs.map +1 -1
  90. package/dist/dev/runtime/app.mjs +9 -9
  91. package/dist/dev/runtime/app.mjs.map +1 -1
  92. package/dist/dev/runtime/bindingManifest.mjs +6 -14
  93. package/dist/dev/runtime/bindingManifest.mjs.map +1 -1
  94. package/dist/dev/runtime/capabilities.d.mts +4 -1
  95. package/dist/dev/runtime/capabilities.mjs.map +1 -1
  96. package/dist/dev/runtime/css.mjs +4 -8
  97. package/dist/dev/runtime/css.mjs.map +1 -1
  98. package/dist/dev/runtime/defaults.mjs +4 -4
  99. package/dist/dev/runtime/defaults.mjs.map +1 -1
  100. package/dist/dev/runtime/define/initialComputed.mjs +5 -5
  101. package/dist/dev/runtime/define/initialComputed.mjs.map +1 -1
  102. package/dist/dev/runtime/define/options.mjs +10 -12
  103. package/dist/dev/runtime/define/options.mjs.map +1 -1
  104. package/dist/dev/runtime/define/props.mjs +4 -5
  105. package/dist/dev/runtime/define/props.mjs.map +1 -1
  106. package/dist/dev/runtime/define/scopedSlotOptions.mjs +43 -61
  107. package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
  108. package/dist/dev/runtime/define/setupResult.mjs +17 -28
  109. package/dist/dev/runtime/define/setupResult.mjs.map +1 -1
  110. package/dist/dev/runtime/define.mjs +9 -12
  111. package/dist/dev/runtime/define.mjs.map +1 -1
  112. package/dist/dev/runtime/diff.mjs +9 -11
  113. package/dist/dev/runtime/diff.mjs.map +1 -1
  114. package/dist/dev/runtime/disposables.mjs +2 -2
  115. package/dist/dev/runtime/disposables.mjs.map +1 -1
  116. package/dist/dev/runtime/elementIntersectionObserver.mjs +16 -24
  117. package/dist/dev/runtime/elementIntersectionObserver.mjs.map +1 -1
  118. package/dist/dev/runtime/features/inlineEvents.mjs +2 -3
  119. package/dist/dev/runtime/features/inlineEvents.mjs.map +1 -1
  120. package/dist/dev/runtime/features/jsxIslands.d.mts +7 -0
  121. package/dist/dev/runtime/features/jsxIslands.mjs +20 -0
  122. package/dist/dev/runtime/features/jsxIslands.mjs.map +1 -0
  123. package/dist/dev/runtime/features/layout.mjs +2 -3
  124. package/dist/dev/runtime/features/layout.mjs.map +1 -1
  125. package/dist/dev/runtime/features/publicLayout.mjs +2 -6
  126. package/dist/dev/runtime/features/publicLayout.mjs.map +1 -1
  127. package/dist/dev/runtime/features/scopedSlots.mjs +5 -9
  128. package/dist/dev/runtime/features/scopedSlots.mjs.map +1 -1
  129. package/dist/dev/runtime/features/templateRefs.mjs +1 -1
  130. package/dist/dev/runtime/features/templateRefs.mjs.map +1 -1
  131. package/dist/dev/runtime/hooks/base.mjs +20 -43
  132. package/dist/dev/runtime/hooks/base.mjs.map +1 -1
  133. package/dist/dev/runtime/hooks/pageScroll.mjs +41 -0
  134. package/dist/dev/runtime/hooks/pageScroll.mjs.map +1 -0
  135. package/dist/dev/runtime/hooks/register.mjs +2 -1
  136. package/dist/dev/runtime/hooks/register.mjs.map +1 -1
  137. package/dist/dev/runtime/inlineDataset.mjs +1 -2
  138. package/dist/dev/runtime/inlineDataset.mjs.map +1 -1
  139. package/dist/dev/runtime/intersectionObserver.mjs +6 -6
  140. package/dist/dev/runtime/intersectionObserver.mjs.map +1 -1
  141. package/dist/dev/runtime/jsxIsland.mjs +16 -33
  142. package/dist/dev/runtime/jsxIsland.mjs.map +1 -1
  143. package/dist/dev/runtime/layoutBridge.mjs +32 -62
  144. package/dist/dev/runtime/layoutBridge.mjs.map +1 -1
  145. package/dist/dev/runtime/nativeBridge.mjs +1 -1
  146. package/dist/dev/runtime/nativeBridge.mjs.map +1 -1
  147. package/dist/dev/runtime/navigationLifecycle.mjs +24 -0
  148. package/dist/dev/runtime/navigationLifecycle.mjs.map +1 -0
  149. package/dist/dev/runtime/pageEnvironment.mjs +15 -18
  150. package/dist/dev/runtime/pageEnvironment.mjs.map +1 -1
  151. package/dist/dev/runtime/pageLayout.mjs +7 -11
  152. package/dist/dev/runtime/pageLayout.mjs.map +1 -1
  153. package/dist/dev/runtime/pageScroll.mjs +2 -3
  154. package/dist/dev/runtime/pageScroll.mjs.map +1 -1
  155. package/dist/dev/runtime/platform/current.mjs +12 -0
  156. package/dist/dev/runtime/platform/current.mjs.map +1 -0
  157. package/dist/dev/runtime/platform/generic.mjs +36 -0
  158. package/dist/dev/runtime/platform/generic.mjs.map +1 -0
  159. package/dist/dev/runtime/platform/globals.mjs +29 -0
  160. package/dist/dev/runtime/platform/globals.mjs.map +1 -0
  161. package/dist/dev/runtime/platform.mjs +15 -60
  162. package/dist/dev/runtime/platform.mjs.map +1 -1
  163. package/dist/dev/runtime/provideContext.mjs +7 -9
  164. package/dist/dev/runtime/provideContext.mjs.map +1 -1
  165. package/dist/dev/runtime/publicRuntime.mjs +4 -0
  166. package/dist/dev/runtime/publicRuntime.mjs.map +1 -1
  167. package/dist/dev/runtime/pullDownRefresh.mjs +2 -4
  168. package/dist/dev/runtime/pullDownRefresh.mjs.map +1 -1
  169. package/dist/dev/runtime/register/app.mjs +18 -19
  170. package/dist/dev/runtime/register/app.mjs.map +1 -1
  171. package/dist/dev/runtime/register/component/alipay.mjs +9 -18
  172. package/dist/dev/runtime/register/component/alipay.mjs.map +1 -1
  173. package/dist/dev/runtime/register/component/alipayRegistration.mjs +60 -0
  174. package/dist/dev/runtime/register/component/alipayRegistration.mjs.map +1 -0
  175. package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs +2 -5
  176. package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs.map +1 -1
  177. package/dist/dev/runtime/register/component/lifecycle/platform.mjs +13 -26
  178. package/dist/dev/runtime/register/component/lifecycle/platform.mjs.map +1 -1
  179. package/dist/dev/runtime/register/component/lifecycle.mjs +7 -12
  180. package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -1
  181. package/dist/dev/runtime/register/component/methods.mjs +13 -18
  182. package/dist/dev/runtime/register/component/methods.mjs.map +1 -1
  183. package/dist/dev/runtime/register/component/options.mjs +3 -4
  184. package/dist/dev/runtime/register/component/options.mjs.map +1 -1
  185. package/dist/dev/runtime/register/component/props.mjs +25 -31
  186. package/dist/dev/runtime/register/component/props.mjs.map +1 -1
  187. package/dist/dev/runtime/register/component/registerDefinition.mjs +21 -40
  188. package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
  189. package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +18 -60
  190. package/dist/dev/runtime/register/component/registerNativeDefinition.mjs.map +1 -1
  191. package/dist/dev/runtime/register/component.mjs +3 -5
  192. package/dist/dev/runtime/register/component.mjs.map +1 -1
  193. package/dist/dev/runtime/register/inline.mjs +8 -10
  194. package/dist/dev/runtime/register/inline.mjs.map +1 -1
  195. package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +7 -8
  196. package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs.map +1 -1
  197. package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +1 -1
  198. package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs.map +1 -1
  199. package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +25 -34
  200. package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -1
  201. package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +13 -15
  202. package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
  203. package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +2 -2
  204. package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs.map +1 -1
  205. package/dist/dev/runtime/register/runtimeInstance/utils.mjs +9 -9
  206. package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -1
  207. package/dist/dev/runtime/register/runtimeInstance.mjs +74 -100
  208. package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
  209. package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +12 -15
  210. package/dist/dev/runtime/register/setDataFrequencyWarning.mjs.map +1 -1
  211. package/dist/dev/runtime/register/setup.mjs +2 -3
  212. package/dist/dev/runtime/register/setup.mjs.map +1 -1
  213. package/dist/dev/runtime/register/snapshot.mjs +1 -4
  214. package/dist/dev/runtime/register/snapshot.mjs.map +1 -1
  215. package/dist/dev/runtime/register/watch.mjs +3 -5
  216. package/dist/dev/runtime/register/watch.mjs.map +1 -1
  217. package/dist/dev/runtime/scopedSlots.mjs +14 -21
  218. package/dist/dev/runtime/scopedSlots.mjs.map +1 -1
  219. package/dist/dev/runtime/selectorQuery.mjs +5 -9
  220. package/dist/dev/runtime/selectorQuery.mjs.map +1 -1
  221. package/dist/dev/runtime/template.mjs +1 -1
  222. package/dist/dev/runtime/template.mjs.map +1 -1
  223. package/dist/dev/runtime/templateRefs/helpers.mjs +14 -24
  224. package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -1
  225. package/dist/dev/runtime/templateRefs.mjs +8 -15
  226. package/dist/dev/runtime/templateRefs.mjs.map +1 -1
  227. package/dist/dev/runtime/uniAppHost.mjs +6 -14
  228. package/dist/dev/runtime/uniAppHost.mjs.map +1 -1
  229. package/dist/dev/runtime/updatePerformance.mjs +1 -1
  230. package/dist/dev/runtime/updatePerformance.mjs.map +1 -1
  231. package/dist/dev/runtime/use.mjs +1 -1
  232. package/dist/dev/runtime/use.mjs.map +1 -1
  233. package/dist/dev/runtime/vueCompat/context.mjs +3 -5
  234. package/dist/dev/runtime/vueCompat/context.mjs.map +1 -1
  235. package/dist/dev/runtime/vueCompat/model.mjs +9 -13
  236. package/dist/dev/runtime/vueCompat/model.mjs.map +1 -1
  237. package/dist/dev/runtime/vueCompat/router.mjs +4 -4
  238. package/dist/dev/runtime/vueCompat/router.mjs.map +1 -1
  239. package/dist/dev/runtime/vueCompat/templateRef.mjs +1 -1
  240. package/dist/dev/runtime/vueCompat/templateRef.mjs.map +1 -1
  241. package/dist/dev/scheduler.mjs +3 -4
  242. package/dist/dev/scheduler.mjs.map +1 -1
  243. package/dist/dev/store/base.mjs +1 -2
  244. package/dist/dev/store/base.mjs.map +1 -1
  245. package/dist/dev/store/define/create.mjs +11 -22
  246. package/dist/dev/store/define/create.mjs.map +1 -1
  247. package/dist/dev/store/define.mjs +1 -1
  248. package/dist/dev/store/define.mjs.map +1 -1
  249. package/dist/dev/store/view.mjs +1 -1
  250. package/dist/dev/store/view.mjs.map +1 -1
  251. package/dist/internal-runtime.d.mts +2 -1
  252. package/dist/internal-runtime.mjs +1 -1
  253. package/dist/package.mjs +1 -1
  254. package/dist/reactivity/asyncDerivation.mjs +1 -1
  255. package/dist/reactivity/core.mjs +1 -1
  256. package/dist/reactivity/reactive/patch.mjs +1 -1
  257. package/dist/reactivity/reactive/patchState.mjs +1 -1
  258. package/dist/reactivity/reactive/shared.mjs +1 -1
  259. package/dist/reactivity/reactive.mjs +1 -1
  260. package/dist/reactivity/ref.mjs +1 -1
  261. package/dist/reactivity/shallowRef.mjs +1 -1
  262. package/dist/reactivity/watch/helpers.mjs +1 -1
  263. package/dist/reactivity/watch.mjs +1 -1
  264. package/dist/router/createRouter.mjs +1 -1
  265. package/dist/router/initialNavigation.mjs +1 -1
  266. package/dist/router/instance.mjs +1 -1
  267. package/dist/router/navigationCore.mjs +1 -1
  268. package/dist/router/navigationResult.mjs +1 -1
  269. package/dist/router/navigationTarget.mjs +1 -1
  270. package/dist/router/resolve.mjs +1 -1
  271. package/dist/router/routeRegistry.mjs +1 -1
  272. package/dist/router/routeSync.mjs +1 -1
  273. package/dist/router/scrollRestoration/adapters.d.mts +7 -0
  274. package/dist/router/scrollRestoration/adapters.mjs +1 -0
  275. package/dist/router/scrollRestoration/controller.d.mts +7 -0
  276. package/dist/router/scrollRestoration/controller.mjs +1 -0
  277. package/dist/router/scrollRestoration/host.d.mts +3 -0
  278. package/dist/router/scrollRestoration/host.mjs +1 -0
  279. package/dist/router/scrollRestoration/index.d.mts +8 -0
  280. package/dist/router/scrollRestoration/index.mjs +1 -0
  281. package/dist/router/scrollRestoration/types.d.mts +60 -0
  282. package/dist/router/useRoute.mjs +1 -1
  283. package/dist/router.d.mts +5 -1
  284. package/dist/router.mjs +1 -1
  285. package/dist/routerInternal/location.mjs +1 -1
  286. package/dist/routerInternal/params.mjs +1 -1
  287. package/dist/routerInternal/records.mjs +1 -1
  288. package/dist/routerInternal/recordsWarnings.mjs +1 -1
  289. package/dist/runtime/app/context.mjs +1 -1
  290. package/dist/runtime/app/diagnostics.mjs +1 -1
  291. package/dist/runtime/app/mount.mjs +1 -1
  292. package/dist/runtime/app/setData/commitTracker.mjs +1 -1
  293. package/dist/runtime/app/setData/patchScheduler.mjs +1 -1
  294. package/dist/runtime/app/setData/payload.mjs +1 -1
  295. package/dist/runtime/app/setData/scheduler.mjs +1 -1
  296. package/dist/runtime/app/setData/snapshot.mjs +1 -1
  297. package/dist/runtime/app/setDataOptions.mjs +1 -1
  298. package/dist/runtime/app.mjs +1 -1
  299. package/dist/runtime/bindingManifest.mjs +1 -1
  300. package/dist/runtime/capabilities.d.mts +4 -1
  301. package/dist/runtime/css.mjs +1 -1
  302. package/dist/runtime/defaults.mjs +1 -1
  303. package/dist/runtime/define/initialComputed.mjs +1 -1
  304. package/dist/runtime/define/options.mjs +1 -1
  305. package/dist/runtime/define/props.mjs +1 -1
  306. package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
  307. package/dist/runtime/define/setupResult.mjs +1 -1
  308. package/dist/runtime/define.mjs +1 -1
  309. package/dist/runtime/diff.mjs +1 -1
  310. package/dist/runtime/disposables.mjs +1 -1
  311. package/dist/runtime/elementIntersectionObserver.mjs +1 -1
  312. package/dist/runtime/features/inlineEvents.mjs +1 -1
  313. package/dist/runtime/features/jsxIslands.d.mts +6 -0
  314. package/dist/runtime/features/jsxIslands.mjs +1 -0
  315. package/dist/runtime/features/layout.mjs +1 -1
  316. package/dist/runtime/features/publicLayout.mjs +1 -1
  317. package/dist/runtime/features/scopedSlots.mjs +1 -1
  318. package/dist/runtime/features/templateRefs.mjs +1 -1
  319. package/dist/runtime/hooks/base.mjs +1 -1
  320. package/dist/runtime/hooks/pageScroll.mjs +1 -0
  321. package/dist/runtime/hooks/register.mjs +1 -1
  322. package/dist/runtime/inlineDataset.mjs +1 -1
  323. package/dist/runtime/intersectionObserver.mjs +1 -1
  324. package/dist/runtime/jsxIsland.mjs +1 -1
  325. package/dist/runtime/layoutBridge.mjs +1 -1
  326. package/dist/runtime/nativeBridge.mjs +1 -1
  327. package/dist/runtime/navigationLifecycle.mjs +1 -0
  328. package/dist/runtime/pageEnvironment.mjs +1 -1
  329. package/dist/runtime/pageLayout.mjs +1 -1
  330. package/dist/runtime/pageScroll.mjs +1 -1
  331. package/dist/runtime/platform/current.mjs +1 -0
  332. package/dist/runtime/platform/generic.mjs +1 -0
  333. package/dist/runtime/platform/globals.mjs +1 -0
  334. package/dist/runtime/platform.mjs +1 -1
  335. package/dist/runtime/provideContext.mjs +1 -1
  336. package/dist/runtime/publicRuntime.mjs +1 -1
  337. package/dist/runtime/pullDownRefresh.mjs +1 -1
  338. package/dist/runtime/register/app.mjs +1 -1
  339. package/dist/runtime/register/component/alipay.mjs +1 -1
  340. package/dist/runtime/register/component/alipayRegistration.mjs +1 -0
  341. package/dist/runtime/register/component/lifecycle/optionalHooks.mjs +1 -1
  342. package/dist/runtime/register/component/lifecycle/platform.mjs +1 -1
  343. package/dist/runtime/register/component/lifecycle.mjs +1 -1
  344. package/dist/runtime/register/component/methods.mjs +1 -1
  345. package/dist/runtime/register/component/options.mjs +1 -1
  346. package/dist/runtime/register/component/props.mjs +1 -1
  347. package/dist/runtime/register/component/registerDefinition.mjs +1 -1
  348. package/dist/runtime/register/component/registerNativeDefinition.mjs +1 -1
  349. package/dist/runtime/register/component.mjs +1 -1
  350. package/dist/runtime/register/inline.mjs +1 -1
  351. package/dist/runtime/register/runtimeInstance/methodBridge.mjs +1 -1
  352. package/dist/runtime/register/runtimeInstance/provideContext.mjs +1 -1
  353. package/dist/runtime/register/runtimeInstance/setupContext.mjs +1 -1
  354. package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -1
  355. package/dist/runtime/register/runtimeInstance/setupSnapshot.mjs +1 -1
  356. package/dist/runtime/register/runtimeInstance/utils.mjs +1 -1
  357. package/dist/runtime/register/runtimeInstance.mjs +1 -1
  358. package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -1
  359. package/dist/runtime/register/setup.mjs +1 -1
  360. package/dist/runtime/register/snapshot.mjs +1 -1
  361. package/dist/runtime/register/watch.mjs +1 -1
  362. package/dist/runtime/scopedSlots.mjs +1 -1
  363. package/dist/runtime/selectorQuery.mjs +1 -1
  364. package/dist/runtime/template.mjs +1 -1
  365. package/dist/runtime/templateRefs/helpers.mjs +1 -1
  366. package/dist/runtime/templateRefs.mjs +1 -1
  367. package/dist/runtime/uniAppHost.mjs +1 -1
  368. package/dist/runtime/updatePerformance.mjs +1 -1
  369. package/dist/runtime/use.mjs +1 -1
  370. package/dist/runtime/vueCompat/context.mjs +1 -1
  371. package/dist/runtime/vueCompat/model.mjs +1 -1
  372. package/dist/runtime/vueCompat/router.mjs +1 -1
  373. package/dist/runtime/vueCompat/templateRef.mjs +1 -1
  374. package/dist/scheduler.mjs +1 -1
  375. package/dist/store/base.mjs +1 -1
  376. package/dist/store/define/create.mjs +1 -1
  377. package/dist/store/define.mjs +1 -1
  378. package/dist/store/view.mjs +1 -1
  379. package/package.json +7 -7
  380. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +0 -0
  381. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +0 -0
  382. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +0 -0
  383. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +0 -0
@@ -1 +1 @@
1
- import{callHookList as e,callHookReturn as t,getCurrentInstance as n,getCurrentSetupContext as r,setCurrentInstance as i,setCurrentSetupContext as a}from"./runtime/hooks/base.mjs";import{onAddToFavorites as o,onAttached as s,onDetached as c,onError as l,onHide as u,onLaunch as d,onLoad as f,onMemoryWarning as p,onMoved as m,onPageNotFound as h,onPageScroll as g,onPullDownRefresh as _,onReachBottom as v,onReady as y,onResize as b,onRouteDone as x,onSaveExitState as S,onShareAppMessage as C,onShareTimeline as w,onShow as T,onTabItemTap as E,onThemeChange as D,onUnhandledRejection as O,onUnload as k}from"./runtime/hooks/register.mjs";import{onActivated as A,onBeforeMount as j,onBeforeUnmount as M,onBeforeUpdate as N,onDeactivated as P,onErrorCaptured as F,onMounted as I,onServerPrefetch as L,onUnmounted as R,onUpdated as z}from"./runtime/hooks/vue.mjs";import{useCssModule as B,useCssVars as V}from"./runtime/css.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as H,resetWevuDefaults as U,setWevuDefaults as W}from"./runtime/defaults.mjs";import{useDisposables as G}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as K}from"./runtime/elementIntersectionObserver.mjs";import{isNoSetData as q,markNoSetData as J}from"./runtime/noSetData.mjs";import{installTemplateRefs as Y}from"./runtime/features/templateRefs.mjs";import{installLayout as X}from"./runtime/features/layout.mjs";import{resolveLayoutBridge as Z,resolveLayoutHost as Q,resolveRuntimePageLayoutName as $,setPageLayout as ee,syncRuntimePageLayoutState as te,syncRuntimePageLayoutStateFromRuntime as ne,useLayoutBridge as re,useLayoutHosts as ie,usePageLayout as ae,waitForLayoutHost as oe}from"./runtime/features/publicLayout.mjs";import{useIntersectionObserver as se}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as ce,getNavigationBarMetrics as le,useNavigationBarMetrics as ue,usePageStack as de}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as fe}from"./runtime/pageScroll.mjs";import{setGlobalProvidedValue as pe}from"./runtime/provideStore.mjs";import{hasInjectionContext as me,inject as he,injectGlobal as ge,provide as _e,provideGlobal as ve}from"./runtime/provide.mjs";import{version as ye}from"./version.mjs";import{takePendingRuntimeAppRegistration as be}from"./runtime/app/pending.mjs";import{runSetupFunction as xe}from"./runtime/register/setup.mjs";import{mountRuntimeInstance as Se,setRuntimeSetDataVisibility as Ce,teardownRuntimeInstance as we}from"./runtime/register/runtimeInstance.mjs";import{registerApp as Te}from"./runtime/register/app.mjs";import{Fragment as Ee,createTextVNode as De,createVNode as Oe,isVNode as ke,mergeProps as Ae,normalizeJsxIsland as je,resolveComponent as Me,resolveDirective as Ne,transformOn as Pe,vModelCheckbox as Fe,vModelRadio as Ie,vModelSelect as Le,vModelText as Re,vShow as ze,withDirectives as Be}from"./runtime/jsxIsland.mjs";import{registerComponent as Ve}from"./runtime/register/component.mjs";import{createApp as He}from"./runtime/app.mjs";import{createIsolatedWevuComponentDefinition as Ue,createWevuComponent as We,createWevuComponentDefinition as Ge,defineComponent as Ke,getWevuComponentLifecycleDefinition as qe}from"./runtime/define.mjs";import{installInlineEvents as Je}from"./runtime/features/inlineEvents.mjs";import{installPatchStrategy as Ye}from"./runtime/features/patchStrategy.mjs";import{createWevuScopedSlotComponent as Xe,installScopedSlots as Ze}from"./runtime/features/scopedSlots.mjs";import{installSetDataHighFrequencyWarning as Qe}from"./runtime/features/setDataHighFrequencyWarning.mjs";import{useAsyncPullDownRefresh as $e}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as et,useScrollOffset as tt,useSelectorFields as nt,useSelectorQuery as rt}from"./runtime/selectorQuery.mjs";import{useUpdatePerformanceListener as it}from"./runtime/updatePerformance.mjs";import{defineAppSetup as at,use as ot}from"./runtime/use.mjs";import{useAttrs as st,useNativeInstance as ct,useSlots as lt}from"./runtime/vueCompat/context.mjs";import{mergeModels as ut,useBindModel as dt,useChangeModel as ft,useModel as pt}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as mt,useNativeRouter as ht}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as gt}from"./runtime/vueCompat/templateRef.mjs";import{createUniAppHost as _t}from"./runtime/uniAppHost.mjs";export{Ee as Fragment,H as INTERNAL_DEFAULTS_SCOPE_KEY,e as callHookList,t as callHookReturn,He as createApp,Ue as createIsolatedWevuComponentDefinition,De as createTextVNode,_t as createUniAppHost,Oe as createVNode,We as createWevuComponent,Ge as createWevuComponentDefinition,Xe as createWevuScopedSlotComponent,at as defineAppSetup,Ke as defineComponent,n as getCurrentInstance,ce as getCurrentPageStackSnapshot,r as getCurrentSetupContext,le as getNavigationBarMetrics,qe as getWevuComponentLifecycleDefinition,me as hasInjectionContext,he as inject,ge as injectGlobal,Je as installInlineEvents,X as installLayout,Ye as installPatchStrategy,Ze as installScopedSlots,Qe as installSetDataHighFrequencyWarning,Y as installTemplateRefs,q as isNoSetData,ke as isVNode,J as markNoSetData,ut as mergeModels,Ae as mergeProps,Se as mountRuntimeInstance,je as normalizeJsxIsland,A as onActivated,o as onAddToFavorites,s as onAttached,j as onBeforeMount,M as onBeforeUnmount,N as onBeforeUpdate,P as onDeactivated,c as onDetached,l as onError,F as onErrorCaptured,u as onHide,d as onLaunch,f as onLoad,p as onMemoryWarning,I as onMounted,m as onMoved,h as onPageNotFound,g as onPageScroll,_ as onPullDownRefresh,v as onReachBottom,y as onReady,b as onResize,x as onRouteDone,S as onSaveExitState,L as onServerPrefetch,C as onShareAppMessage,w as onShareTimeline,T as onShow,E as onTabItemTap,D as onThemeChange,O as onUnhandledRejection,k as onUnload,R as onUnmounted,z as onUpdated,_e as provide,ve as provideGlobal,Te as registerApp,Ve as registerComponent,U as resetWevuDefaults,Me as resolveComponent,Ne as resolveDirective,Z as resolveLayoutBridge,Q as resolveLayoutHost,$ as resolveRuntimePageLayoutName,xe as runSetupFunction,i as setCurrentInstance,a as setCurrentSetupContext,pe as setGlobalProvidedValue,ee as setPageLayout,Ce as setRuntimeSetDataVisibility,W as setWevuDefaults,te as syncRuntimePageLayoutState,ne as syncRuntimePageLayoutStateFromRuntime,be as takePendingRuntimeAppRegistration,we as teardownRuntimeInstance,Pe as transformOn,ot as use,$e as useAsyncPullDownRefresh,st as useAttrs,dt as useBindModel,et as useBoundingClientRect,ft as useChangeModel,B as useCssModule,V as useCssVars,G as useDisposables,K as useElementIntersectionObserver,se as useIntersectionObserver,re as useLayoutBridge,ie as useLayoutHosts,pt as useModel,ct as useNativeInstance,mt as useNativePageRouter,ht as useNativeRouter,ue as useNavigationBarMetrics,ae as usePageLayout,fe as usePageScrollThrottle,de as usePageStack,tt as useScrollOffset,nt as useSelectorFields,rt as useSelectorQuery,lt as useSlots,gt as useTemplateRef,it as useUpdatePerformanceListener,Fe as vModelCheckbox,Ie as vModelRadio,Le as vModelSelect,Re as vModelText,ze as vShow,ye as version,oe as waitForLayoutHost,Be as withDirectives};
1
+ import{callHookList as e,callHookReturn as t,getCurrentInstance as n,getCurrentSetupContext as r,setCurrentInstance as i,setCurrentSetupContext as a}from"./runtime/hooks/base.mjs";import{onAddToFavorites as o,onAttached as s,onDetached as c,onError as l,onHide as u,onLaunch as d,onLoad as f,onMemoryWarning as p,onMoved as m,onPageNotFound as h,onPageScroll as g,onPullDownRefresh as _,onReachBottom as v,onReady as y,onResize as b,onRouteDone as x,onSaveExitState as S,onShareAppMessage as C,onShareTimeline as w,onShow as T,onTabItemTap as E,onThemeChange as D,onUnhandledRejection as O,onUnload as k}from"./runtime/hooks/register.mjs";import{onActivated as A,onBeforeMount as j,onBeforeUnmount as M,onBeforeUpdate as N,onDeactivated as P,onErrorCaptured as F,onMounted as I,onServerPrefetch as L,onUnmounted as R,onUpdated as z}from"./runtime/hooks/vue.mjs";import{useCssModule as B,useCssVars as V}from"./runtime/css.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as H,resetWevuDefaults as U,setWevuDefaults as W}from"./runtime/defaults.mjs";import{useDisposables as G}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as K}from"./runtime/elementIntersectionObserver.mjs";import{isNoSetData as q,markNoSetData as J}from"./runtime/noSetData.mjs";import{installTemplateRefs as Y}from"./runtime/features/templateRefs.mjs";import{installLayout as X}from"./runtime/features/layout.mjs";import{resolveLayoutBridge as Z,resolveLayoutHost as Q,resolveRuntimePageLayoutName as $,setPageLayout as ee,syncRuntimePageLayoutState as te,syncRuntimePageLayoutStateFromRuntime as ne,useLayoutBridge as re,useLayoutHosts as ie,usePageLayout as ae,waitForLayoutHost as oe}from"./runtime/features/publicLayout.mjs";import{useIntersectionObserver as se}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as ce,getNavigationBarMetrics as le,useNavigationBarMetrics as ue,usePageStack as de}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as fe}from"./runtime/pageScroll.mjs";import{setGlobalProvidedValue as pe}from"./runtime/provideStore.mjs";import{hasInjectionContext as me,inject as he,injectGlobal as ge,provide as _e,provideGlobal as ve}from"./runtime/provide.mjs";import{version as ye}from"./version.mjs";import{takePendingRuntimeAppRegistration as be}from"./runtime/app/pending.mjs";import{runSetupFunction as xe}from"./runtime/register/setup.mjs";import{mountRuntimeInstance as Se,setRuntimeSetDataVisibility as Ce,teardownRuntimeInstance as we}from"./runtime/register/runtimeInstance.mjs";import{registerApp as Te}from"./runtime/register/app.mjs";import{registerComponent as Ee}from"./runtime/register/component.mjs";import{createApp as De}from"./runtime/app.mjs";import{createIsolatedWevuComponentDefinition as Oe,createWevuComponent as ke,createWevuComponentDefinition as Ae,defineComponent as je,getWevuComponentLifecycleDefinition as Me}from"./runtime/define.mjs";import{installInlineEvents as Ne}from"./runtime/features/inlineEvents.mjs";import{Fragment as Pe,createTextVNode as Fe,createVNode as Ie,isVNode as Le,mergeProps as Re,normalizeJsxIsland as ze,resolveComponent as Be,resolveDirective as Ve,transformOn as He,vModelCheckbox as Ue,vModelRadio as We,vModelSelect as Ge,vModelText as Ke,vShow as qe,withDirectives as Je}from"./runtime/jsxIsland.mjs";import{installJsxIslands as Ye}from"./runtime/features/jsxIslands.mjs";import{installPatchStrategy as Xe}from"./runtime/features/patchStrategy.mjs";import{createWevuScopedSlotComponent as Ze,installScopedSlots as Qe}from"./runtime/features/scopedSlots.mjs";import{installSetDataHighFrequencyWarning as $e}from"./runtime/features/setDataHighFrequencyWarning.mjs";import{useAsyncPullDownRefresh as et}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as tt,useScrollOffset as nt,useSelectorFields as rt,useSelectorQuery as it}from"./runtime/selectorQuery.mjs";import{useUpdatePerformanceListener as at}from"./runtime/updatePerformance.mjs";import{defineAppSetup as ot,use as st}from"./runtime/use.mjs";import{useAttrs as ct,useNativeInstance as lt,useSlots as ut}from"./runtime/vueCompat/context.mjs";import{mergeModels as dt,useBindModel as ft,useChangeModel as pt,useModel as mt}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as ht,useNativeRouter as gt}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as _t}from"./runtime/vueCompat/templateRef.mjs";import{createUniAppHost as vt}from"./runtime/uniAppHost.mjs";export{Pe as Fragment,H as INTERNAL_DEFAULTS_SCOPE_KEY,e as callHookList,t as callHookReturn,De as createApp,Oe as createIsolatedWevuComponentDefinition,Fe as createTextVNode,vt as createUniAppHost,Ie as createVNode,ke as createWevuComponent,Ae as createWevuComponentDefinition,Ze as createWevuScopedSlotComponent,ot as defineAppSetup,je as defineComponent,n as getCurrentInstance,ce as getCurrentPageStackSnapshot,r as getCurrentSetupContext,le as getNavigationBarMetrics,Me as getWevuComponentLifecycleDefinition,me as hasInjectionContext,he as inject,ge as injectGlobal,Ne as installInlineEvents,Ye as installJsxIslands,X as installLayout,Xe as installPatchStrategy,Qe as installScopedSlots,$e as installSetDataHighFrequencyWarning,Y as installTemplateRefs,q as isNoSetData,Le as isVNode,J as markNoSetData,dt as mergeModels,Re as mergeProps,Se as mountRuntimeInstance,ze as normalizeJsxIsland,A as onActivated,o as onAddToFavorites,s as onAttached,j as onBeforeMount,M as onBeforeUnmount,N as onBeforeUpdate,P as onDeactivated,c as onDetached,l as onError,F as onErrorCaptured,u as onHide,d as onLaunch,f as onLoad,p as onMemoryWarning,I as onMounted,m as onMoved,h as onPageNotFound,g as onPageScroll,_ as onPullDownRefresh,v as onReachBottom,y as onReady,b as onResize,x as onRouteDone,S as onSaveExitState,L as onServerPrefetch,C as onShareAppMessage,w as onShareTimeline,T as onShow,E as onTabItemTap,D as onThemeChange,O as onUnhandledRejection,k as onUnload,R as onUnmounted,z as onUpdated,_e as provide,ve as provideGlobal,Te as registerApp,Ee as registerComponent,U as resetWevuDefaults,Be as resolveComponent,Ve as resolveDirective,Z as resolveLayoutBridge,Q as resolveLayoutHost,$ as resolveRuntimePageLayoutName,xe as runSetupFunction,i as setCurrentInstance,a as setCurrentSetupContext,pe as setGlobalProvidedValue,ee as setPageLayout,Ce as setRuntimeSetDataVisibility,W as setWevuDefaults,te as syncRuntimePageLayoutState,ne as syncRuntimePageLayoutStateFromRuntime,be as takePendingRuntimeAppRegistration,we as teardownRuntimeInstance,He as transformOn,st as use,et as useAsyncPullDownRefresh,ct as useAttrs,ft as useBindModel,tt as useBoundingClientRect,pt as useChangeModel,B as useCssModule,V as useCssVars,G as useDisposables,K as useElementIntersectionObserver,se as useIntersectionObserver,re as useLayoutBridge,ie as useLayoutHosts,mt as useModel,lt as useNativeInstance,ht as useNativePageRouter,gt as useNativeRouter,ue as useNavigationBarMetrics,ae as usePageLayout,fe as usePageScrollThrottle,de as usePageStack,nt as useScrollOffset,rt as useSelectorFields,it as useSelectorQuery,ut as useSlots,_t as useTemplateRef,at as useUpdatePerformanceListener,Ue as vModelCheckbox,We as vModelRadio,Ge as vModelSelect,Ke as vModelText,qe as vShow,ye as version,oe as waitForLayoutHost,Je as withDirectives};
package/dist/package.mjs CHANGED
@@ -1 +1 @@
1
- var e=`7.2.2`;export{e as version};
1
+ var e=`7.4.0`;export{e as version};
@@ -1 +1 @@
1
- import{batch as e,onScopeDispose as t,runWithoutTracking as n}from"./core.mjs";import{reactive as r}from"./reactive.mjs";import{readonly as i}from"./readonly.mjs";import{AbortControllerPolyfill as a}from"@wevu/web-apis/abort";const o=Promise.resolve();function s(){let e;return{promise:new Promise(t=>{e=t}),resolve:e}}function c(c,l={}){var u;let d={status:`idle`,value:void 0,error:void 0},f=r(d),p,m,h=0,g=!1,_=!1;function v(e){if(_||e!==h)return;let t=m;m=void 0,t==null||t.resolve()}function y(t,n){if(!(_||t!==h)){p=void 0,g=!0;try{e(()=>{f.status=`ready`,f.value=n,f.error=void 0})}finally{v(t)}}}function b(t,n){if(!(_||t!==h)){p=void 0;try{e(()=>{f.status=`error`,f.error=n,g||(f.value=void 0)})}finally{v(t)}}}function x(){var t;if(_)return o;let r=(t=m)==null?s():t;m=r;let i=++h,l=p,u=new(typeof AbortController==`function`?AbortController:a);p=u;try{l==null||l.abort()}catch(e){}return _||i!==h||(e(()=>{f.status=g?`refreshing`:`initial-pending`,f.error=void 0}),_||i!==h)||n(()=>{new Promise(e=>{e(c({signal:u.signal}))}).then(e=>y(i,e),e=>b(i,e)).catch(e=>{setTimeout(()=>{throw e},0)})}),r.promise}function S(){if(_)return;_=!0,h+=1;let t=p;p=void 0;try{t==null||t.abort()}catch(e){}try{e(()=>{f.status=`disposed`,f.value=void 0,f.error=void 0})}finally{g=!1;let e=m;m=void 0,e==null||e.resolve()}}Object.defineProperties(d,{refresh:{value:x},dispose:{value:S}});let C=i(f);return t(S),((u=l.immediate)==null||u)&&x(),C}export{c as useAsyncDerivation};
1
+ import{batch as e,onScopeDispose as t,runWithoutTracking as n}from"./core.mjs";import{reactive as r}from"./reactive.mjs";import{readonly as i}from"./readonly.mjs";import{AbortControllerPolyfill as a}from"@wevu/web-apis/abort";const o=Promise.resolve();function s(){let e;return{promise:new Promise(t=>{e=t}),resolve:e}}function c(c,l={}){let u={status:`idle`,value:void 0,error:void 0},d=r(u),f,p,m=0,h=!1,g=!1;function _(e){if(g||e!==m)return;let t=p;p=void 0,t?.resolve()}function v(t,n){if(!(g||t!==m)){f=void 0,h=!0;try{e(()=>{d.status=`ready`,d.value=n,d.error=void 0})}finally{_(t)}}}function y(t,n){if(!(g||t!==m)){f=void 0;try{e(()=>{d.status=`error`,d.error=n,h||(d.value=void 0)})}finally{_(t)}}}function b(){if(g)return o;let t=p??s();p=t;let r=++m,i=f,l=new(typeof AbortController==`function`?AbortController:a);f=l;try{i?.abort()}catch{}return g||r!==m||(e(()=>{d.status=h?`refreshing`:`initial-pending`,d.error=void 0}),g||r!==m)||n(()=>{new Promise(e=>{e(c({signal:l.signal}))}).then(e=>v(r,e),e=>y(r,e)).catch(e=>{setTimeout(()=>{throw e},0)})}),t.promise}function x(){if(g)return;g=!0,m+=1;let t=f;f=void 0;try{t?.abort()}catch{}try{e(()=>{d.status=`disposed`,d.value=void 0,d.error=void 0})}finally{h=!1;let e=p;p=void 0,e?.resolve()}}Object.defineProperties(u,{refresh:{value:b},dispose:{value:x}});let S=i(d);return t(x),(l.immediate??!0)&&b(),S}export{c as useAsyncDerivation};
@@ -1 +1 @@
1
- import{queueJob as e}from"../scheduler.mjs";import t from"../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/defineProperty.mjs";const n=/* @__PURE__ */ new WeakMap;let r=null;const i=[];let a=!0,o,s=0,c=!1;const l=/* @__PURE__ */ new Set,u=/* @__PURE__ */ new Set;function d(e){if(e.active){if(e.scheduler){let t=o;o=e._scope;try{e.scheduler()}finally{o=t}return}e()}}function f(e){if(s>0||c){u.add(e);return}u.delete(e),e()}function p(){s++}function m(e){let t=e.values().next();if(!t.done)return e.delete(t.value),t.value}function h(){let e,t=!1;c=!0;try{for(;l.size;){let n=m(l);if(n)try{d(n)}catch(n){t||(e=n,t=!0)}}}finally{c=!1}for(;u.size;){let n=u.values().next().value;u.delete(n);try{n()}catch(n){t||(e=n,t=!0)}}if(t)throw e}function g(){s!==0&&(s--,s===0&&!c&&h())}function _(e){p();try{return e()}finally{g()}}function v(e){let{deps:t}=e;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}function y(e){var t;e.active&&(e.active=!1,v(e),(t=e.onStop)==null||t.call(e))}var b=class{constructor(e=!1){if(this.detached=e,t(this,`active`,!0),t(this,`effects`,[]),t(this,`cleanups`,[]),t(this,`parent`,void 0),t(this,`scopes`,void 0),!e&&o){var n;if(!o.active){this.active=!1;return}this.parent=o,((n=o).scopes||(n.scopes=[])).push(this)}}run(e){if(!this.active)return;let t=o;o=this;try{return e()}finally{o=t}}stop(){if(!this.active)return;this.active=!1;let e=o;o=this;let t,n=!1,r=e=>{n||(t=e,n=!0)};try{let e=this.effects.splice(0);for(let t of e)try{y(t)}catch(e){r(e)}let t=this.cleanups.splice(0);for(let e of t)try{e()}catch(e){r(e)}let n=this.scopes;if(this.scopes=void 0,n){for(let e of n)try{e.stop()}catch(e){r(e)}n.length=0}}finally{var i;if((i=this.parent)!=null&&i.scopes){let e=this.parent.scopes.indexOf(this);e>=0&&this.parent.scopes.splice(e,1)}this.parent=void 0,o=e}if(n)throw t}};function x(e=!1){return new b(e)}function S(){return o}function C(e){o!=null&&o.active&&o.cleanups.push(e)}function w(e){let t=a;a=!1;try{return e()}finally{a=t}}function T(e){if(o){if(o.active){o.effects.push(e);return}y(e)}}function E(e,t={}){let n=function(){if(!n.active||n._running)return e();v(n);let t=o;o=n._scope;let s=a;try{return a=!0,n._running=!0,i.push(n),r=n,e()}finally{var c;i.pop(),r=(c=i[i.length-1])==null?null:c,n._running=!1,o=t,a=s}};return n.deps=[],n.scheduler=t.scheduler,n.onStop=t.onStop,n.active=!0,n._running=!1,n._fn=e,n._scope=o,n}function D(e,t,n){let r=E(e,t);return r._computed=n,T(r),t.lazy||r(),r}function O(e,t={}){return D(e,t,!1)}function k(e,t={}){return D(e,t,!0)}function A(e,t){if(!a||!r)return;let i=n.get(e);i||(i=/* @__PURE__ */ new Map,n.set(e,i));let o=i.get(t);o||(o=/* @__PURE__ */ new Set,i.set(t,o)),o.has(r)||(o.add(r),r.deps.push(o))}function j(e){if(!e._running){if(e._computed){d(e);return}if(s>0||c){l.add(e);return}d(e)}}function M(e,t){let i=n.get(e);if(!i)return;let a=i.get(t);if(!a)return;let o=/* @__PURE__ */ new Set;a.forEach(e=>{e!==r&&o.add(e)}),o.forEach(j)}function N(e){a&&r&&(e.has(r)||(e.add(r),r.deps.push(e)))}function P(e){new Set(e).forEach(j)}export{_ as batch,k as createComputedEffect,E as createReactiveEffect,O as effect,x as effectScope,g as endBatch,S as getCurrentScope,C as onScopeDispose,f as queueBatchCallback,e as queueJob,w as runWithoutTracking,p as startBatch,y as stop,A as track,N as trackEffects,M as trigger,P as triggerEffects};
1
+ import{queueJob as e}from"../scheduler.mjs";import t from"../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.mjs";const n=/* @__PURE__ */ new WeakMap;let r=null;const i=[];let a=!0,o,s=0,c=!1;const l=/* @__PURE__ */ new Set,u=/* @__PURE__ */ new Set;function d(e){if(e.active){if(e.scheduler){let t=o;o=e._scope;try{e.scheduler()}finally{o=t}return}e()}}function f(e){if(s>0||c){u.add(e);return}u.delete(e),e()}function p(){s++}function m(e){let t=e.values().next();if(!t.done)return e.delete(t.value),t.value}function h(){let e,t=!1;c=!0;try{for(;l.size;){let n=m(l);if(n)try{d(n)}catch(n){t||(e=n,t=!0)}}}finally{c=!1}for(;u.size;){let n=u.values().next().value;u.delete(n);try{n()}catch(n){t||(e=n,t=!0)}}if(t)throw e}function g(){s!==0&&(s--,s===0&&!c&&h())}function _(e){p();try{return e()}finally{g()}}function v(e){let{deps:t}=e;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}function y(e){e.active&&(e.active=!1,v(e),e.onStop?.())}var b=class{constructor(e=!1){if(this.detached=e,t(this,`active`,!0),t(this,`effects`,[]),t(this,`cleanups`,[]),t(this,`parent`,void 0),t(this,`scopes`,void 0),!e&&o){var n;if(!o.active){this.active=!1;return}this.parent=o,((n=o).scopes||(n.scopes=[])).push(this)}}run(e){if(!this.active)return;let t=o;o=this;try{return e()}finally{o=t}}stop(){if(!this.active)return;this.active=!1;let e=o;o=this;let t,n=!1,r=e=>{n||(t=e,n=!0)};try{let e=this.effects.splice(0);for(let t of e)try{y(t)}catch(e){r(e)}let t=this.cleanups.splice(0);for(let e of t)try{e()}catch(e){r(e)}let n=this.scopes;if(this.scopes=void 0,n){for(let e of n)try{e.stop()}catch(e){r(e)}n.length=0}}finally{if(this.parent?.scopes){let e=this.parent.scopes.indexOf(this);e>=0&&this.parent.scopes.splice(e,1)}this.parent=void 0,o=e}if(n)throw t}};function x(e=!1){return new b(e)}function S(){return o}function C(e){o?.active&&o.cleanups.push(e)}function w(e){let t=a;a=!1;try{return e()}finally{a=t}}function T(e){if(o){if(o.active){o.effects.push(e);return}y(e)}}function E(e,t={}){let n=function(){if(!n.active||n._running)return e();v(n);let t=o;o=n._scope;let s=a;try{return a=!0,n._running=!0,i.push(n),r=n,e()}finally{i.pop(),r=i[i.length-1]??null,n._running=!1,o=t,a=s}};return n.deps=[],n.scheduler=t.scheduler,n.onStop=t.onStop,n.active=!0,n._running=!1,n._fn=e,n._scope=o,n}function D(e,t,n){let r=E(e,t);return r._computed=n,T(r),t.lazy||r(),r}function O(e,t={}){return D(e,t,!1)}function k(e,t={}){return D(e,t,!0)}function A(e,t){if(!a||!r)return;let i=n.get(e);i||(i=/* @__PURE__ */ new Map,n.set(e,i));let o=i.get(t);o||(o=/* @__PURE__ */ new Set,i.set(t,o)),o.has(r)||(o.add(r),r.deps.push(o))}function j(e){if(!e._running){if(e._computed){d(e);return}if(s>0||c){l.add(e);return}d(e)}}function M(e,t){let i=n.get(e);if(!i)return;let a=i.get(t);if(!a)return;let o=/* @__PURE__ */ new Set;a.forEach(e=>{e!==r&&o.add(e)}),o.forEach(j)}function N(e){a&&r&&(e.has(r)||(e.add(r),r.deps.push(e)))}function P(e){new Set(e).forEach(j)}export{_ as batch,k as createComputedEffect,E as createReactiveEffect,O as effect,x as effectScope,g as endBatch,S as getCurrentScope,C as onScopeDispose,f as queueBatchCallback,e as queueJob,w as runWithoutTracking,p as startBatch,y as stop,A as track,N as trackEffects,M as trigger,P as triggerEffects};
@@ -1 +1 @@
1
- import{track as e}from"../core.mjs";import{adoptReactiveRoot as t,indexPatchNode as n,rawMultiParentSet as r,rawParentMap as i,rawParentsMap as a,rawPathMap as o,rawRootMap as s,rawVersionMap as c,recordParentLink as l,rootPatchNodesMap as u}from"./patchState.mjs";import{VERSION_KEY as d,isObject as f,toRaw as p}from"./shared.mjs";function m(e,i){let a=p(e);o.set(a,``),n(a,a);let s=i==null?void 0:i.shouldIncludeTopKey,c=typeof(i==null?void 0:i.maxDepth)==`number`?Math.max(0,Math.floor(i.maxDepth)):1/0,u=typeof(i==null?void 0:i.maxKeys)==`number`?Math.max(0,Math.floor(i.maxKeys)):1/0,d=/* @__PURE__ */ new WeakSet,m=[{current:a,path:``,depth:0}],h=0;for(;m.length;){let e=m.pop();if(d.has(e.current)||(d.add(e.current),o.set(e.current,e.path),n(a,e.current),h+=1,h>=u)||e.depth>=c||Array.isArray(e.current))continue;let i=Object.entries(e.current);for(let[c,u]of i){if(e.path===``&&s&&!s(c)||!f(u)||u.__r_skip)continue;let i=p(u);if(t(i,e.current),l(i,e.current,c),!r.has(i)){let t=e.path?`${e.path}.${c}`:c;o.set(i,t)}n(a,i),m.push({current:i,path:e.path?`${e.path}.${c}`:c,depth:e.depth+1})}}}function h(e){let t=p(e),n=u.get(t);if(!n){o.delete(t);return}for(let e of n)i.delete(e),a.delete(e),o.delete(e),r.delete(e),s.delete(e),c.delete(e);u.delete(t)}function g(t){let n=p(t);e(n,d)}export{h as clearPatchIndices,m as prelinkReactiveTree,g as touchReactive};
1
+ import{track as e}from"../core.mjs";import{adoptReactiveRoot as t,indexPatchNode as n,rawMultiParentSet as r,rawParentMap as i,rawParentsMap as a,rawPathMap as o,rawRootMap as s,rawVersionMap as c,recordParentLink as l,rootPatchNodesMap as u}from"./patchState.mjs";import{VERSION_KEY as d,isObject as f,toRaw as p}from"./shared.mjs";function m(e,i){let a=p(e);o.set(a,``),n(a,a);let s=i?.shouldIncludeTopKey,c=typeof i?.maxDepth==`number`?Math.max(0,Math.floor(i.maxDepth)):1/0,u=typeof i?.maxKeys==`number`?Math.max(0,Math.floor(i.maxKeys)):1/0,d=/* @__PURE__ */ new WeakSet,m=[{current:a,path:``,depth:0}],h=0;for(;m.length;){let e=m.pop();if(d.has(e.current)||(d.add(e.current),o.set(e.current,e.path),n(a,e.current),h+=1,h>=u)||e.depth>=c||Array.isArray(e.current))continue;let i=Object.entries(e.current);for(let[c,u]of i){if(e.path===``&&s&&!s(c)||!f(u)||u.__r_skip)continue;let i=p(u);if(t(i,e.current),l(i,e.current,c),!r.has(i)){let t=e.path?`${e.path}.${c}`:c;o.set(i,t)}n(a,i),m.push({current:i,path:e.path?`${e.path}.${c}`:c,depth:e.depth+1})}}}function h(e){let t=p(e),n=u.get(t);if(!n){o.delete(t);return}for(let e of n)i.delete(e),a.delete(e),o.delete(e),r.delete(e),s.delete(e),c.delete(e);u.delete(t)}function g(t){let n=p(t);e(n,d)}export{h as clearPatchIndices,m as prelinkReactiveTree,g as touchReactive};
@@ -1 +1 @@
1
- import{mutationRecorders as e}from"./mutation.mjs";const t=/* @__PURE__ */ new WeakMap,n=/* @__PURE__ */ new WeakMap,r=/* @__PURE__ */ new WeakMap,i=/* @__PURE__ */ new WeakMap,a=/* @__PURE__ */ new WeakSet,o=/* @__PURE__ */ new WeakMap,s=/* @__PURE__ */ new WeakMap;function c(e){let t=s.get(e);return t||(t=/* @__PURE__ */ new Set,s.set(e,t)),t}function l(e,t){c(e).add(t)}function u(e){var t;n.set(e,((t=n.get(e))==null?0:t)+1)}function d(e){var t;return(t=n.get(e))==null?0:t}function f(e,n){var r;let i=(r=t.get(n))==null?n:r,a=t.get(e);(!a||a===e||a===n)&&t.set(e,i)}function p(e){let t=/* @__PURE__ */ new Set,n=[e];for(let e=0;e<2e3&&n.length;e++){let e=n.pop(),r=i.get(e);if(r)for(let e of r.keys())t.has(e)||(t.add(e),u(e),n.push(e))}}function m(e){let t=i.get(e);if(!t){a.delete(e),r.delete(e);return}let n,o,s=0;for(let[e,r]of t){for(let t of r){if(s+=1,s>1)break;n=e,o=t}if(s>1)break}if(s===1&&n&&o){a.delete(e),r.set(e,{parent:n,key:o});return}a.add(e),r.delete(e)}function h(n,o,s){if(typeof s!=`string`){a.add(n),r.delete(n);return}if(e.size){var c;let e=(c=t.get(o))==null?o:c;l(e,o),l(e,n)}let u=i.get(n);u||(u=/* @__PURE__ */ new Map,i.set(n,u));let d=u.get(o);d||(d=/* @__PURE__ */ new Set,u.set(o,d)),d.add(s),m(n)}function g(e,t,n){let r=i.get(e);if(!r)return;let a=r.get(t);a&&(a.delete(n),a.size||r.delete(t),r.size||i.delete(e),m(e))}function _(e,t){if(t===e)return[];if(a.has(t))return;let n=[],i=t;for(let t=0;t<2e3;t++){if(i===e)return n.reverse();if(a.has(i))return;let t=r.get(i);if(!t||typeof t.key!=`string`)return;n.push(t.key),i=t.parent}}export{f as adoptReactiveRoot,p as bumpAncestorVersions,u as bumpRawVersion,d as getRawVersion,l as indexPatchNode,a as rawMultiParentSet,r as rawParentMap,i as rawParentsMap,o as rawPathMap,t as rawRootMap,n as rawVersionMap,h as recordParentLink,g as removeParentLink,_ as resolvePathToTarget,s as rootPatchNodesMap};
1
+ import{mutationRecorders as e}from"./mutation.mjs";const t=/* @__PURE__ */ new WeakMap,n=/* @__PURE__ */ new WeakMap,r=/* @__PURE__ */ new WeakMap,i=/* @__PURE__ */ new WeakMap,a=/* @__PURE__ */ new WeakSet,o=/* @__PURE__ */ new WeakMap,s=/* @__PURE__ */ new WeakMap;function c(e){let t=s.get(e);return t||(t=/* @__PURE__ */ new Set,s.set(e,t)),t}function l(e,t){c(e).add(t)}function u(e){n.set(e,(n.get(e)??0)+1)}function d(e){return n.get(e)??0}function f(e,n){let r=t.get(n)??n,i=t.get(e);(!i||i===e||i===n)&&t.set(e,r)}function p(e){let t=/* @__PURE__ */ new Set,n=[e];for(let e=0;e<2e3&&n.length;e++){let e=n.pop(),r=i.get(e);if(r)for(let e of r.keys())t.has(e)||(t.add(e),u(e),n.push(e))}}function m(e){let t=i.get(e);if(!t){a.delete(e),r.delete(e);return}let n,o,s=0;for(let[e,r]of t){for(let t of r){if(s+=1,s>1)break;n=e,o=t}if(s>1)break}if(s===1&&n&&o){a.delete(e),r.set(e,{parent:n,key:o});return}a.add(e),r.delete(e)}function h(n,o,s){if(typeof s!=`string`){a.add(n),r.delete(n);return}if(e.size){let e=t.get(o)??o;l(e,o),l(e,n)}let c=i.get(n);c||(c=/* @__PURE__ */ new Map,i.set(n,c));let u=c.get(o);u||(u=/* @__PURE__ */ new Set,c.set(o,u)),u.add(s),m(n)}function g(e,t,n){let r=i.get(e);if(!r)return;let a=r.get(t);a&&(a.delete(n),a.size||r.delete(t),r.size||i.delete(e),m(e))}function _(e,t){if(t===e)return[];if(a.has(t))return;let n=[],i=t;for(let t=0;t<2e3;t++){if(i===e)return n.reverse();if(a.has(i))return;let t=r.get(i);if(!t||typeof t.key!=`string`)return;n.push(t.key),i=t.parent}}export{f as adoptReactiveRoot,p as bumpAncestorVersions,u as bumpRawVersion,d as getRawVersion,l as indexPatchNode,a as rawMultiParentSet,r as rawParentMap,i as rawParentsMap,o as rawPathMap,t as rawRootMap,n as rawVersionMap,h as recordParentLink,g as removeParentLink,_ as resolvePathToTarget,s as rootPatchNodesMap};
@@ -1 +1 @@
1
- function e(e){return typeof e==`object`&&!!e}function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e){return Object.prototype.toString.call(e).slice(8,-1)}function r(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 0;default:return 0}}function i(e){return e.__r_skip?0:r(n(e))}const a=Symbol(`wevu.version`);function o(e){if(!e)return!1;let t=e.charCodeAt(0);if(t<48||t>57)return!1;let n=Number(e);return Number.isInteger(n)&&n>=0&&String(n)===e}function s(e){var t;return(t=e==null?void 0:e.__r_raw)==null?e:t}export{a as VERSION_KEY,i as getTargetType,t as hasOwn,o as isArrayIndexKey,e as isObject,s as toRaw,n as toRawType};
1
+ function e(e){return typeof e==`object`&&!!e}function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e){return Object.prototype.toString.call(e).slice(8,-1)}function r(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 0;default:return 0}}function i(e){return e.__r_skip?0:r(n(e))}const a=Symbol(`wevu.version`);function o(e){if(!e)return!1;let t=e.charCodeAt(0);if(t<48||t>57)return!1;let n=Number(e);return Number.isInteger(n)&&n>=0&&String(n)===e}function s(e){return e?.__r_raw??e}export{a as VERSION_KEY,i as getTargetType,t as hasOwn,o as isArrayIndexKey,e as isObject,s as toRaw,n as toRawType};
@@ -1 +1 @@
1
- import{batch as e,track as t,trigger as n}from"./core.mjs";import{addMutationRecorder as r,mutationRecorders as i,removeMutationRecorder as a}from"./reactive/mutation.mjs";import{adoptReactiveRoot as o,bumpAncestorVersions as s,bumpRawVersion as c,getRawVersion as l,rawMultiParentSet as u,rawParentsMap as d,rawPathMap as f,rawRootMap as p,rawVersionMap as m,recordParentLink as h,removeParentLink as g,resolvePathToTarget as _}from"./reactive/patchState.mjs";import{VERSION_KEY as v,getTargetType as y,hasOwn as b,isArrayIndexKey as x,isObject as S,toRaw as C}from"./reactive/shared.mjs";import{rawMap as w,reactiveMap as T}from"./reactive/state.mjs";import{clearPatchIndices as E,prelinkReactiveTree as D,touchReactive as O}from"./reactive/patch.mjs";import{isShallowReactive as k,shallowReactive as A}from"./reactive/shallow.mjs";function j(e){let t=C(e);return l(t)}function M(e,t,n){var r;if(!i.size||typeof t!=`string`||t.startsWith(`__r_`))return;let a=(r=p.get(e))==null?e:r,o=Array.isArray(e)&&(t===`length`||x(t))?`array`:`property`,s=_(a,e);if(!s){let r=/* @__PURE__ */ new Set,s=d.get(e);if(s)for(let[e,t]of s){var c;let n=f.get(e),i=n?n.split(`.`,1)[0]:void 0,o=i||(c=_(a,e))==null?void 0:c[0];for(let e of t){var l;typeof e==`string`&&r.add((l=i==null?o:i)==null?e:l)}}else r.add(t);for(let e of i)e({root:a,kind:o,op:n,path:void 0,fallbackTopKeys:r.size?[...r]:void 0});return}let u=s.findIndex(e=>x(e));if(u!==-1){let e=s.slice(0,u).join(`.`)||void 0;for(let t of i)t({root:a,kind:`array`,op:n,path:e});return}let m=s.length?s.join(`.`):``,h=o===`array`?m||void 0:m?`${m}.${t}`:t;for(let e of i)e({root:a,kind:o,op:n,path:h})}const N={get(e,n,r){if(n===`__r_isReactive`)return!0;if(n===`__r_raw`)return e;let a=Reflect.get(e,n,r);if(t(e,n),S(a)){var s;if(a.__r_skip)return a;let t=(s=a==null?void 0:a.__r_raw)==null?a:s;o(t,e),h(t,e,n);let r=f.get(e);if(i.size&&typeof n==`string`&&r!=null&&!u.has(t)){let e=r?`${r}.${n}`:n;f.set(t,e)}return P(a)}return a},set(t,r,a,l){let d=b(t,r),m=Array.isArray(t),_=m?t.length:0,y=Reflect.get(t,r,l),w=S(y)?C(y):y,T=S(a)?C(a):a;if(Object.is(w,T))return!0;let E=Reflect.set(t,r,a,l);if(E){let a=S(w)?w:void 0;if(a&&g(a,t,r),S(T)&&!T.__r_skip){let e=T;o(e,t),h(e,t,r);let n=f.get(t);if(i.size&&typeof r==`string`&&n!=null&&!u.has(e)){let t=n?`${n}.${r}`:r;f.set(e,t)}}e(()=>{n(t,r),m&&typeof r==`string`&&x(r)&&Number(r)>=_&&n(t,`length`),n(t,v),c(t),s(t);let e=p.get(t);e&&e!==t&&(n(e,v),c(e)),d||n(t,Symbol.iterator)}),M(t,r,`set`)}return E},deleteProperty(t,r){let i=b(t,r),a=i?t[r]:void 0,o=Reflect.deleteProperty(t,r);if(i&&o){var l;let i=S(a)?(l=a==null?void 0:a.__r_raw)==null?a:l:void 0;i&&g(i,t,r),e(()=>{n(t,r),n(t,v),c(t),s(t);let e=p.get(t);e&&e!==t&&(n(e,v),c(e)),n(t,Symbol.iterator)}),M(t,r,`delete`)}return o},ownKeys(e){return t(e,Symbol.iterator),t(e,v),Reflect.ownKeys(e)}};function P(e){if(!S(e)||e.__r_isReactive)return e;let t=T.get(e);if(t)return t;if(y(e)===0)return e;let n=new Proxy(e,N);return T.set(e,n),w.set(n,e),m.has(e)||m.set(e,0),p.has(e)||p.set(e,e),n}function F(e){return!!(e&&e.__r_isReactive)}function I(e){return S(e)?P(e):e}function L(e){return S(e)&&Object.defineProperty(e,"__r_skip",{value:!0,configurable:!0,enumerable:!1,writable:!0}),e}function R(e){return S(e)&&`__r_skip`in e}export{r as addMutationRecorder,E as clearPatchIndices,I as convertToReactive,j as getReactiveVersion,S as isObject,R as isRaw,F as isReactive,k as isShallowReactive,L as markRaw,D as prelinkReactiveTree,P as reactive,a as removeMutationRecorder,A as shallowReactive,C as toRaw,O as touchReactive};
1
+ import{batch as e,track as t,trigger as n}from"./core.mjs";import{addMutationRecorder as r,mutationRecorders as i,removeMutationRecorder as a}from"./reactive/mutation.mjs";import{adoptReactiveRoot as o,bumpAncestorVersions as s,bumpRawVersion as c,getRawVersion as l,rawMultiParentSet as u,rawParentsMap as d,rawPathMap as f,rawRootMap as p,rawVersionMap as m,recordParentLink as h,removeParentLink as g,resolvePathToTarget as _}from"./reactive/patchState.mjs";import{VERSION_KEY as v,getTargetType as y,hasOwn as b,isArrayIndexKey as x,isObject as S,toRaw as C}from"./reactive/shared.mjs";import{rawMap as w,reactiveMap as T}from"./reactive/state.mjs";import{clearPatchIndices as E,prelinkReactiveTree as D,touchReactive as O}from"./reactive/patch.mjs";import{isShallowReactive as k,shallowReactive as A}from"./reactive/shallow.mjs";function j(e){let t=C(e);return l(t)}function M(e,t,n){if(!i.size||typeof t!=`string`||t.startsWith(`__r_`))return;let r=p.get(e)??e,a=Array.isArray(e)&&(t===`length`||x(t))?`array`:`property`,o=_(r,e);if(!o){let o=/* @__PURE__ */ new Set,s=d.get(e);if(s)for(let[e,t]of s){let n=f.get(e),i=n?n.split(`.`,1)[0]:void 0,a=i?void 0:_(r,e)?.[0];for(let e of t)typeof e==`string`&&o.add(i??a??e)}else o.add(t);for(let e of i)e({root:r,kind:a,op:n,path:void 0,fallbackTopKeys:o.size?[...o]:void 0});return}let s=o.findIndex(e=>x(e));if(s!==-1){let e=o.slice(0,s).join(`.`)||void 0;for(let t of i)t({root:r,kind:`array`,op:n,path:e});return}let c=o.length?o.join(`.`):``,l=a===`array`?c||void 0:c?`${c}.${t}`:t;for(let e of i)e({root:r,kind:a,op:n,path:l})}const N={get(e,n,r){if(n===`__r_isReactive`)return!0;if(n===`__r_raw`)return e;let a=Reflect.get(e,n,r);if(t(e,n),S(a)){if(a.__r_skip)return a;let t=a?.__r_raw??a;o(t,e),h(t,e,n);let r=f.get(e);if(i.size&&typeof n==`string`&&r!=null&&!u.has(t)){let e=r?`${r}.${n}`:n;f.set(t,e)}return P(a)}return a},set(t,r,a,l){let d=b(t,r),m=Array.isArray(t),_=m?t.length:0,y=Reflect.get(t,r,l),w=S(y)?C(y):y,T=S(a)?C(a):a;if(Object.is(w,T))return!0;let E=Reflect.set(t,r,a,l);if(E){let a=S(w)?w:void 0;if(a&&g(a,t,r),S(T)&&!T.__r_skip){let e=T;o(e,t),h(e,t,r);let n=f.get(t);if(i.size&&typeof r==`string`&&n!=null&&!u.has(e)){let t=n?`${n}.${r}`:r;f.set(e,t)}}e(()=>{n(t,r),m&&typeof r==`string`&&x(r)&&Number(r)>=_&&n(t,`length`),n(t,v),c(t),s(t);let e=p.get(t);e&&e!==t&&(n(e,v),c(e)),d||n(t,Symbol.iterator)}),M(t,r,`set`)}return E},deleteProperty(t,r){let i=b(t,r),a=i?t[r]:void 0,o=Reflect.deleteProperty(t,r);if(i&&o){let i=S(a)?a?.__r_raw??a:void 0;i&&g(i,t,r),e(()=>{n(t,r),n(t,v),c(t),s(t);let e=p.get(t);e&&e!==t&&(n(e,v),c(e)),n(t,Symbol.iterator)}),M(t,r,`delete`)}return o},ownKeys(e){return t(e,Symbol.iterator),t(e,v),Reflect.ownKeys(e)}};function P(e){if(!S(e)||e.__r_isReactive)return e;let t=T.get(e);if(t)return t;if(y(e)===0)return e;let n=new Proxy(e,N);return T.set(e,n),w.set(n,e),m.has(e)||m.set(e,0),p.has(e)||p.set(e,e),n}function F(e){return!!(e&&e.__r_isReactive)}function I(e){return S(e)?P(e):e}function L(e){return S(e)&&Object.defineProperty(e,"__r_skip",{value:!0,configurable:!0,enumerable:!1,writable:!0}),e}function R(e){return S(e)&&`__r_skip`in e}export{r as addMutationRecorder,E as clearPatchIndices,I as convertToReactive,j as getReactiveVersion,S as isObject,R as isRaw,F as isReactive,k as isShallowReactive,L as markRaw,D as prelinkReactiveTree,P as reactive,a as removeMutationRecorder,A as shallowReactive,C as toRaw,O as touchReactive};
@@ -1 +1 @@
1
- import e from"../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/defineProperty.mjs";import{trackEffects as t,triggerEffects as n}from"./core.mjs";import{convertToReactive as r,markRaw as i}from"./reactive.mjs";const a=`__v_isRef`;function o(e){try{Object.defineProperty(e,a,{value:!0,configurable:!0})}catch(t){e[a]=!0}return e}function s(e){return!!(e&&typeof e==`object`&&e.__v_isRef===!0)}var c=class{constructor(t){e(this,`_value`,void 0),e(this,`_rawValue`,void 0),e(this,`dep`,void 0),o(this),this._rawValue=t,this._value=r(t)}get value(){return this.dep||(this.dep=/* @__PURE__ */ new Set),t(this.dep),this._value}set value(e){Object.is(e,this._rawValue)||(this._rawValue=e,this._value=r(e),this.dep&&n(this.dep))}};function l(e){return s(e)?e:i(new c(e))}function u(e){return s(e)?e.value:e}function d(e){return typeof e==`function`?e():u(e)}var f=class{constructor(r,i){e(this,`_getValue`,void 0),e(this,`_setValue`,void 0),e(this,`dep`,void 0),o(this);let a=i,s=()=>{this.dep||(this.dep=/* @__PURE__ */ new Set),t(this.dep)},c=()=>{this.dep&&n(this.dep)},l=e=>e===void 0&&a!==void 0?a:e;if(typeof r==`function`){let e=r(s,c);this._getValue=()=>l(e.get()),this._setValue=t=>e.set(t);return}let u=r;this._getValue=()=>(s(),l(u.get())),this._setValue=e=>{u.set(e),c()}}get value(){return this._getValue()}set value(e){this._setValue(e)}};function p(e,t){return i(new f(e,t))}export{a as RefFlag,p as customRef,s as isRef,o as markAsRef,l as ref,d as toValue,u as unref};
1
+ import e from"../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.mjs";import{trackEffects as t,triggerEffects as n}from"./core.mjs";import{convertToReactive as r,markRaw as i}from"./reactive.mjs";const a=`__v_isRef`;function o(e){try{Object.defineProperty(e,a,{value:!0,configurable:!0})}catch{e[a]=!0}return e}function s(e){return!!(e&&typeof e==`object`&&e.__v_isRef===!0)}var c=class{constructor(t){e(this,`_value`,void 0),e(this,`_rawValue`,void 0),e(this,`dep`,void 0),o(this),this._rawValue=t,this._value=r(t)}get value(){return this.dep||(this.dep=/* @__PURE__ */ new Set),t(this.dep),this._value}set value(e){Object.is(e,this._rawValue)||(this._rawValue=e,this._value=r(e),this.dep&&n(this.dep))}};function l(e){return s(e)?e:i(new c(e))}function u(e){return s(e)?e.value:e}function d(e){return typeof e==`function`?e():u(e)}var f=class{constructor(r,i){e(this,`_getValue`,void 0),e(this,`_setValue`,void 0),e(this,`dep`,void 0),o(this);let a=i,s=()=>{this.dep||(this.dep=/* @__PURE__ */ new Set),t(this.dep)},c=()=>{this.dep&&n(this.dep)},l=e=>e===void 0&&a!==void 0?a:e;if(typeof r==`function`){let e=r(s,c);this._getValue=()=>l(e.get()),this._setValue=t=>e.set(t);return}let u=r;this._getValue=()=>(s(),l(u.get())),this._setValue=e=>{u.set(e),c()}}get value(){return this._getValue()}set value(e){this._setValue(e)}};function p(e,t){return i(new f(e,t))}export{a as RefFlag,p as customRef,s as isRef,o as markAsRef,l as ref,d as toValue,u as unref};
@@ -1 +1 @@
1
- import{triggerEffects as e}from"./core.mjs";import{customRef as t,isRef as n}from"./ref.mjs";const r=`__v_isShallow`;function i(e){try{Object.defineProperty(e,r,{value:!0,configurable:!0})}catch(t){e[r]=!0}return e}function a(e,n){return i(t((t,n)=>({get(){return t(),e},set(t){Object.is(e,t)||(e=t,n())}}),n))}function o(e){return n(e)&&e[r]===!0}function s(t){if(n(t)){let n=t.dep;if(n){e(n);return}t.value=t.value}}export{o as isShallowRef,a as shallowRef,s as triggerRef};
1
+ import{triggerEffects as e}from"./core.mjs";import{customRef as t,isRef as n}from"./ref.mjs";const r=`__v_isShallow`;function i(e){try{Object.defineProperty(e,r,{value:!0,configurable:!0})}catch{e[r]=!0}return e}function a(e,n){return i(t((t,n)=>({get(){return t(),e},set(t){Object.is(e,t)||(e=t,n())}}),n))}function o(e){return n(e)&&e[r]===!0}function s(t){if(n(t)){let n=t.dep;if(n){e(n);return}t.value=t.value}}export{o as isShallowRef,a as shallowRef,s as triggerRef};
@@ -1 +1 @@
1
- import{nextTick as e,queueJob as t}from"../../scheduler.mjs";import{touchReactive as n}from"../reactive/patch.mjs";import{isReactive as r}from"../reactive.mjs";import{isRef as i}from"../ref.mjs";import{isShallowRef as a}from"../shallowRef.mjs";import{traverse as o}from"../traverse.mjs";import{getDeepWatchStrategy as s}from"./types.mjs";function c(e){if(typeof e==`function`)return e();if(i(e))return e.value;if(r(e))return e;throw Error(`无效的 watch 源`)}function l(e){let t=Array.isArray(e),n=!t&&r(e),o=t?e.some(e=>r(e)):n,s=t?e.some(e=>a(e)):a(e),l;if(t){let t=e;l=()=>t.map(e=>c(e))}else if(typeof e==`function`)l=e;else if(i(e))l=()=>e.value;else if(n)l=()=>e;else throw Error(`无效的 watch 源`);return{getter:l,hasReactiveSource:o,hasShallowSource:s,isMultiSource:t,isReactiveSource:n}}function u(e,t,i,a,c){let l=i?t.some(e=>r(e)):a,u=c==null?l:c;if(u!==!0&&typeof u!=`number`)return e;let d=typeof u==`number`?u:u?1/0:0;return()=>{let t=e(),a=s();return i&&Array.isArray(t)?t.map(e=>a===`version`&&r(e)?(n(e),e):o(e,d)):a===`version`&&r(t)?(n(t),t):o(t,d)}}function d(n,r,i,a){if(a){a(n,i);return}if(r===`sync`){n();return}if(r===`post`){e(()=>t(n));return}i?n():t(n)}export{u as applyDeepWatchGetter,l as createWatchGetter,d as dispatchScheduledJob};
1
+ import{nextTick as e,queueJob as t}from"../../scheduler.mjs";import{touchReactive as n}from"../reactive/patch.mjs";import{isReactive as r}from"../reactive.mjs";import{isRef as i}from"../ref.mjs";import{isShallowRef as a}from"../shallowRef.mjs";import{traverse as o}from"../traverse.mjs";import{getDeepWatchStrategy as s}from"./types.mjs";function c(e){if(typeof e==`function`)return e();if(i(e))return e.value;if(r(e))return e;throw Error(`无效的 watch 源`)}function l(e){let t=Array.isArray(e),n=!t&&r(e),o=t?e.some(e=>r(e)):n,s=t?e.some(e=>a(e)):a(e),l;if(t){let t=e;l=()=>t.map(e=>c(e))}else if(typeof e==`function`)l=e;else if(i(e))l=()=>e.value;else if(n)l=()=>e;else throw Error(`无效的 watch 源`);return{getter:l,hasReactiveSource:o,hasShallowSource:s,isMultiSource:t,isReactiveSource:n}}function u(e,t,i,a,c){let l=i?t.some(e=>r(e)):a,u=c??l;if(u!==!0&&typeof u!=`number`)return e;let d=typeof u==`number`?u:u?1/0:0;return()=>{let t=e(),a=s();return i&&Array.isArray(t)?t.map(e=>a===`version`&&r(e)?(n(e),e):o(e,d)):a===`version`&&r(t)?(n(t),t):o(t,d)}}function d(n,r,i,a){if(a){a(n,i);return}if(r===`sync`){n();return}if(r===`post`){e(()=>t(n));return}i?n():t(n)}export{u as applyDeepWatchGetter,l as createWatchGetter,d as dispatchScheduledJob};
@@ -1 +1 @@
1
- import{effect as e,onScopeDispose as t,stop as n}from"./core.mjs";import{getCurrentInstance as r,setCurrentInstance as i}from"../runtime/hooks/base.mjs";import{getDeepWatchStrategy as a,setDeepWatchStrategy as o}from"./watch/types.mjs";import{applyDeepWatchGetter as s,createWatchGetter as c,dispatchScheduledJob as l}from"./watch/helpers.mjs";function u(a,o,u={}){var d;let f=r(),p=c(a),m=s(p.getter,a,p.isMultiSource,p.isReactiveSource,u.deep),h=u.deep===!0||typeof u.deep==`number`||u.deep===void 0&&p.hasReactiveSource||p.hasShallowSource,g,_=e=>{g=e},v=p.isMultiSource?[]:void 0,y,b=!1,x=0,S=x,C,w=u.once?(e,t,n)=>{o(e,t,n),C()}:o,T=(d=u.flush)==null?`pre`:d,E=(e,t)=>!p.isMultiSource||!Array.isArray(e)||!Array.isArray(t)?!Object.is(e,t):e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n])),D=(e,t=!1)=>{if(!y.active||b||e!==x)return;let n=y();if(!t&&!h&&!E(n,v))return;g==null||g();let a=r();i(f);try{w(n,v,_)}finally{i(a)}v=n},O=()=>D(S),k=e=>{S=x,l(O,T,e,u.scheduler)};y=e(()=>m(),{scheduler:()=>{b||k(!1)},lazy:!0});let A=()=>{g==null||g(),g=void 0,n(y)};return C=A,C.stop=A,C.pause=()=>{b||(b=!0,x+=1)},C.resume=()=>{b&&y.active&&(b=!1,v=y())},u.immediate?D(x,!0):v=y(),t(C),C}function d(a,o={}){var s;let c=r(),u,d=e=>{u=e},f,p=!1,m=0,h=m,g=(s=o.flush)==null?`pre`:s,_=e=>{f.active&&!p&&e===m&&f()},v=()=>_(h),y=e=>{h=m,l(v,g,e)};f=e(()=>{u==null||u(),u=void 0;let e=r();i(c);try{a(d)}finally{i(e)}},{lazy:!0,scheduler:()=>{p||y(!1)}}),y(!0);let b=()=>{u==null||u(),u=void 0,n(f)},x=b;return x.stop=b,x.pause=()=>{p||(p=!0,m+=1)},x.resume=()=>{p&&f.active&&(p=!1,y(!0))},t(x),x}function f(e,t={}){return d(e,{...t,flush:`post`})}function p(e,t={}){return d(e,{...t,flush:`sync`})}export{a as getDeepWatchStrategy,o as setDeepWatchStrategy,u as watch,d as watchEffect,f as watchPostEffect,p as watchSyncEffect};
1
+ import{effect as e,onScopeDispose as t,stop as n}from"./core.mjs";import{getCurrentInstance as r,setCurrentInstance as i}from"../runtime/hooks/base.mjs";import{getDeepWatchStrategy as a,setDeepWatchStrategy as o}from"./watch/types.mjs";import{applyDeepWatchGetter as s,createWatchGetter as c,dispatchScheduledJob as l}from"./watch/helpers.mjs";function u(a,o,u={}){let d=r(),f=c(a),p=s(f.getter,a,f.isMultiSource,f.isReactiveSource,u.deep),m=u.deep===!0||typeof u.deep==`number`||u.deep===void 0&&f.hasReactiveSource||f.hasShallowSource,h,g=e=>{h=e},_=f.isMultiSource?[]:void 0,v,y=!1,b=0,x=b,S,C=u.once?(e,t,n)=>{o(e,t,n),S()}:o,w=u.flush??`pre`,T=(e,t)=>!f.isMultiSource||!Array.isArray(e)||!Array.isArray(t)?!Object.is(e,t):e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n])),E=(e,t=!1)=>{if(!v.active||y||e!==b)return;let n=v();if(!t&&!m&&!T(n,_))return;h?.();let a=r();i(d);try{C(n,_,g)}finally{i(a)}_=n},D=()=>E(x),O=e=>{x=b,l(D,w,e,u.scheduler)};v=e(()=>p(),{scheduler:()=>{y||O(!1)},lazy:!0});let k=()=>{h?.(),h=void 0,n(v)};return S=k,S.stop=k,S.pause=()=>{y||(y=!0,b+=1)},S.resume=()=>{y&&v.active&&(y=!1,_=v())},u.immediate?E(b,!0):_=v(),t(S),S}function d(a,o={}){let s=r(),c,u=e=>{c=e},d,f=!1,p=0,m=p,h=o.flush??`pre`,g=e=>{d.active&&!f&&e===p&&d()},_=()=>g(m),v=e=>{m=p,l(_,h,e)};d=e(()=>{c?.(),c=void 0;let e=r();i(s);try{a(u)}finally{i(e)}},{lazy:!0,scheduler:()=>{f||v(!1)}}),v(!0);let y=()=>{c?.(),c=void 0,n(d)},b=y;return b.stop=y,b.pause=()=>{f||(f=!0,p+=1)},b.resume=()=>{f&&d.active&&(f=!1,v(!0))},t(b),b}function f(e,t={}){return d(e,{...t,flush:`post`})}function p(e,t={}){return d(e,{...t,flush:`sync`})}export{a as getDeepWatchStrategy,o as setDeepWatchStrategy,u as watch,d as watchEffect,f as watchPostEffect,p as watchSyncEffect};
@@ -1 +1 @@
1
- import{getCurrentMiniProgramTabBarPagePaths as e,getMiniProgramGlobalObject as t}from"../runtime/platform.mjs";import{setActiveRouter as n}from"./instance.mjs";import{DEFAULT_INITIAL_NAVIGATION_TIMEOUT as r,registerInitialNavigationRunner as i}from"./initialNavigation.mjs";import{installRouteStateSyncOnNativeRouter as a,notifyRouteStateSync as o}from"./routeSync.mjs";import{resolvePath as ee}from"../routerInternal/path.mjs";import{parseQuery as te,stringifyQuery as ne}from"../routerInternal/query.mjs";import{resolveCurrentRoute as re}from"../routerInternal/location.mjs";import{resolveNamedRouteLocation as s}from"../routerInternal/params.mjs";import{mergeMatchedRouteMeta as ie,resolveMatchedRouteRecord as ae}from"../routerInternal/matching.mjs";import{warnDuplicateRouteEntries as oe}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteLookup as se,resolveRouteOptionEntries as ce}from"../routerInternal/records.mjs";import{cloneRouteMeta as le,cloneRouteParams as ue,createNativeRouteUrl as de,createRouterOptionsSnapshot as fe,normalizeRouteRecordMatched as pe,snapshotRouteLocation as c}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as l}from"./types.mjs";import{createNavigationFailure as u,executeNavigationMethod as d}from"./navigationCore.mjs";import{createNavigationResultController as f}from"./navigationResult.mjs";import{resolveBackNavigationTarget as p,runBackNavigationGuards as me}from"./backNavigation.mjs";import{navigateWithTarget as he}from"./navigationTarget.mjs";import{createNavigationApi as ge}from"./navigationApi.mjs";import{resolveRouteLocation as _e}from"./resolve.mjs";import{createRouteRegistry as ve}from"./routeRegistry.mjs";import{createRouteStateController as ye,useNativeRouter as m}from"./useRoute.mjs";function h(h={}){var g,_,v,y,b,x,S;let C=h,w=m();a(t());let T=/* @__PURE__ */ new Set,E=/* @__PURE__ */ new Set,D=/* @__PURE__ */ new Set,O=/* @__PURE__ */ new Set,k=(g=C.maxRedirects)==null?10:g,A=C.initialNavigationMode===`blocking`?`blocking`:`eager`,j=Number.isFinite(C.initialNavigationTimeout)&&((_=C.initialNavigationTimeout)==null?0:_)>0?Math.max(1,Math.trunc(C.initialNavigationTimeout)):r,M=(v=C.paramsMode)==null?`loose`:v,N=(y=C.rejectOnError)==null||y,P={parseQuery:(b=C.parseQuery)==null?te:b,stringifyQuery:(x=C.stringifyQuery)==null?ne:x},be=Promise.resolve(),F=ce(C);oe(F);let I=se(F),L=((S=C.tabBarEntries)==null?e():S).map(e=>ee(e,``)).filter(Boolean),R=new Set(L),z=ve(I),B=0,V,H,U,xe=fe(L,z.getRoutes(),M,k,A,j,P,N);function W(e){let t={...e};t.href=t.fullPath;let n=ae(t,I);if(n){let e=n.record;t.name===void 0&&(t.name=e.name);let r=ie(n.matchedRecords);r!==void 0&&(t.meta=le(r)),n.params&&Object.keys(t.params).length===0&&(t.params=ue(n.params)),t.matched=n.matchedRecords.map((e,t,r)=>{let i=t===r.length-1?n.matchedPath:void 0;return pe(e,i)})}else t.matched=[];return t}function G(e,t){let n=typeof e==`string`?e:s(e,I,M);return W(_e(n,t,P))}let K,q;function J(e){return e.source===`page`||e.source===`native`&&e.method===`navigateBack`}function Se(e,t){if(B>0||!J(t)||U!==void 0)return;if(H!==void 0){let t=H;if(H=void 0,e.fullPath===t)return}if(e.fullPath===K.fullPath)return;U=e.fullPath;let n=c(K);me({target:e,from:n,nativeRouter:w,beforeEachGuards:T,beforeResolveGuards:E,resolveWithCodec:G}).then(e=>q==null?void 0:q(e)).finally(()=>{U=void 0})}K=ye({beforeRouteStateSync:Se,resolveRoute:W}).route;let Ce=e=>G(e,K.path),Y=f({afterEachHooks:D,errorHandlers:O,nativeRouter:w,rejectOnError:N});q=Y.emitNavigationAfterEach;let X=ge({nativeRouter:w,route:K,routeResolveCodec:P,namedRouteLookup:I,beforeEachGuards:T,beforeResolveGuards:E,maxRedirects:k,tabBarPathSet:R,resolveWithCodec:G,settleNavigationResult:Y.settleNavigationResult});async function Z(e,t){let n=K.fullPath;t&&(V=t),B+=1;try{let t=await e();return K.fullPath!==n&&(H=K.fullPath),t}finally{--B,B<=0&&(V=void 0)}}function Q(e){try{return G(e,K.path).fullPath}catch(e){return}}async function we(e,t,n=()=>!0){return Z(async()=>{let r=c(K),i=W(re(t,e));if(!i.path)return;if(V===i.fullPath){o({route:i,source:`router`});return}let a=await he({mode:`push`,target:i,from:r,nativeRouter:w,routeResolveCodec:P,namedRouteLookup:I,beforeEachGuards:T,beforeResolveGuards:E,maxRedirects:k,tabBarPathSet:R,resolveWithCodec:G,executeNative:!1,allowSameLocation:!0});if(n()){if(A===`blocking`&&a.to&&a.to.fullPath!==i.fullPath){let e=a.to,t=R.has(e.path)?w.switchTab:w.redirectTo;return await d(t,{url:de(e,P.stringifyQuery)},e,r)||(o({route:e,source:`router`}),u(l.cancelled,e,r))}return Y.settleNavigationResult(a)}})}function Te(e){return T.add(e),()=>{T.delete(e)}}function Ee(e){return E.add(e),()=>{E.delete(e)}}function De(e){return D.add(e),()=>{D.delete(e)}}function Oe(e){return O.add(e),()=>{O.delete(e)}}let $={nativeRouter:w,options:xe,currentRoute:K,install(e){var t;n($);let r=e==null||(t=e.config)==null?void 0:t.globalProperties;r&&(r.$router=$)},resolve:Ce,isReady(){return be},push:e=>Z(()=>X.push(e),Q(e)),replace:e=>Z(()=>X.replace(e),Q(e)),back:e=>{var t;return Z(()=>X.back(e),(t=p(e==null?1:e,K,G))==null?void 0:t.fullPath)},go:e=>{var t;return Z(()=>X.go(e),e<0?(t=p(Math.abs(e),K,G))==null?void 0:t.fullPath:void 0)},forward:()=>Z(()=>X.forward()),hasRoute:z.hasRoute,getRoutes:z.getRoutes,addRoute:z.addRoute,removeRoute:z.removeRoute,clearRoutes:z.clearRoutes,beforeEach:Te,beforeResolve:Ee,afterEach:De,onError:Oe};return n($),i($,we,j,A),$}export{h as createRouter};
1
+ import{getCurrentMiniProgramGlobalObject as e}from"../runtime/platform/current.mjs";import{getCurrentMiniProgramTabBarPagePaths as t}from"../runtime/platform.mjs";import{installRouteStateSyncOnNativeRouter as n,notifyRouteStateSync as r}from"./routeSync.mjs";import{resolvePath as i}from"../routerInternal/path.mjs";import{parseQuery as a,stringifyQuery as o}from"../routerInternal/query.mjs";import{resolveCurrentRoute as ee}from"../routerInternal/location.mjs";import{resolveNamedRouteLocation as te}from"../routerInternal/params.mjs";import{mergeMatchedRouteMeta as ne,resolveMatchedRouteRecord as re}from"../routerInternal/matching.mjs";import{warnDuplicateRouteEntries as s}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteLookup as c,resolveRouteOptionEntries as l}from"../routerInternal/records.mjs";import{cloneRouteMeta as u,cloneRouteParams as d,createNativeRouteUrl as ie,createRouterOptionsSnapshot as ae,normalizeRouteRecordMatched as oe,snapshotRouteLocation as f}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as se}from"./types.mjs";import{createNavigationFailure as ce,executeNavigationMethod as le}from"./navigationCore.mjs";import{createNavigationResultController as ue}from"./navigationResult.mjs";import{resolveBackNavigationTarget as p,runBackNavigationGuards as m}from"./backNavigation.mjs";import{setActiveRouter as h}from"./instance.mjs";import{DEFAULT_INITIAL_NAVIGATION_TIMEOUT as de,registerInitialNavigationRunner as fe}from"./initialNavigation.mjs";import{navigateWithTarget as pe}from"./navigationTarget.mjs";import{createNavigationApi as g}from"./navigationApi.mjs";import{resolveRouteLocation as _}from"./resolve.mjs";import{createRouteRegistry as v}from"./routeRegistry.mjs";import{createRouteStateController as y,useNativeRouter as b}from"./useRoute.mjs";function x(x={}){let S=x,C=b();n(e());let w=/* @__PURE__ */ new Set,T=/* @__PURE__ */ new Set,E=/* @__PURE__ */ new Set,D=/* @__PURE__ */ new Set,O=S.maxRedirects??10,k=S.initialNavigationMode===`blocking`?`blocking`:`eager`,A=Number.isFinite(S.initialNavigationTimeout)&&(S.initialNavigationTimeout??0)>0?Math.max(1,Math.trunc(S.initialNavigationTimeout)):de,j=S.paramsMode??`loose`,M=S.rejectOnError??!0,N={parseQuery:S.parseQuery??a,stringifyQuery:S.stringifyQuery??o},P=Promise.resolve(),F=l(S);s(F);let I=c(F),L=(S.tabBarEntries??t()).map(e=>i(e,``)).filter(Boolean),R=new Set(L),z=v(I),B=0,V,H,U,me=ae(L,z.getRoutes(),j,O,k,A,N,M);function W(e){let t={...e};t.href=t.fullPath;let n=re(t,I);if(n){let e=n.record;t.name===void 0&&(t.name=e.name);let r=ne(n.matchedRecords);r!==void 0&&(t.meta=u(r)),n.params&&Object.keys(t.params).length===0&&(t.params=d(n.params)),t.matched=n.matchedRecords.map((e,t,r)=>{let i=t===r.length-1?n.matchedPath:void 0;return oe(e,i)})}else t.matched=[];return t}function G(e,t){let n=typeof e==`string`?e:te(e,I,j);return W(_(n,t,N))}let K,q;function he(e){return e.source===`page`||e.source===`native`&&e.method===`navigateBack`}function J(e,t){if(B>0||!he(t)||U!==void 0)return;if(H!==void 0){let t=H;if(H=void 0,e.fullPath===t)return}if(e.fullPath===K.fullPath)return;U=e.fullPath;let n=f(K);m({target:e,from:n,nativeRouter:C,beforeEachGuards:w,beforeResolveGuards:T,resolveWithCodec:G}).then(e=>q?.(e)).finally(()=>{U=void 0})}K=y({beforeRouteStateSync:J,resolveRoute:W}).route;let ge=e=>G(e,K.path),Y=ue({afterEachHooks:E,errorHandlers:D,nativeRouter:C,rejectOnError:M});q=Y.emitNavigationAfterEach;let X=g({nativeRouter:C,route:K,routeResolveCodec:N,namedRouteLookup:I,beforeEachGuards:w,beforeResolveGuards:T,maxRedirects:O,tabBarPathSet:R,resolveWithCodec:G,settleNavigationResult:Y.settleNavigationResult});async function Z(e,t){let n=K.fullPath;t&&(V=t),B+=1;try{let t=await e();return K.fullPath!==n&&(H=K.fullPath),t}finally{--B,B<=0&&(V=void 0)}}function Q(e){try{return G(e,K.path).fullPath}catch{return}}async function _e(e,t,n=()=>!0){return Z(async()=>{let i=f(K),a=W(ee(t,e));if(!a.path)return;if(V===a.fullPath){r({route:a,source:`router`});return}let o=await pe({mode:`push`,target:a,from:i,nativeRouter:C,routeResolveCodec:N,namedRouteLookup:I,beforeEachGuards:w,beforeResolveGuards:T,maxRedirects:O,tabBarPathSet:R,resolveWithCodec:G,executeNative:!1,allowSameLocation:!0});if(n()){if(k===`blocking`&&o.to&&o.to.fullPath!==a.fullPath){let e=o.to,t=R.has(e.path)?C.switchTab:C.redirectTo;return await le(t,{url:ie(e,N.stringifyQuery)},e,i)||(r({route:e,source:`router`}),ce(se.cancelled,e,i))}return Y.settleNavigationResult(o)}})}function ve(e){return w.add(e),()=>{w.delete(e)}}function ye(e){return T.add(e),()=>{T.delete(e)}}function be(e){return E.add(e),()=>{E.delete(e)}}function xe(e){return D.add(e),()=>{D.delete(e)}}let $={nativeRouter:C,options:me,currentRoute:K,install(e){h($);let t=e?.config?.globalProperties;t&&(t.$router=$)},resolve:ge,isReady(){return P},push:e=>Z(()=>X.push(e),Q(e)),replace:e=>Z(()=>X.replace(e),Q(e)),back:e=>Z(()=>X.back(e),p(e??1,K,G)?.fullPath),go:e=>Z(()=>X.go(e),e<0?p(Math.abs(e),K,G)?.fullPath:void 0),forward:()=>Z(()=>X.forward()),hasRoute:z.hasRoute,getRoutes:z.getRoutes,addRoute:z.addRoute,removeRoute:z.removeRoute,clearRoutes:z.clearRoutes,beforeEach:ve,beforeResolve:ye,afterEach:be,onError:xe};return h($),fe($,_e,A,k),$}export{x as createRouter};
@@ -1 +1 @@
1
- import{getActiveRouter as e}from"./instance.mjs";import{WEVU_INITIAL_NAVIGATION_TIMEOUT_MARKER as t}from"@weapp-core/constants";import{queueMicrotaskPolyfill as n}from"@wevu/web-apis";const r=1e4,i=/* @__PURE__ */ new WeakMap,a=/* @__PURE__ */ new WeakMap;function o(e){return Number.isFinite(e)&&e>0?Math.max(1,Math.trunc(e)):r}function s(e){return{route:typeof e.route==`string`?e.route:void 0,__route__:typeof e.__route__==`string`?e.__route__:void 0,options:e.options&&typeof e.options==`object`?{...e.options}:void 0}}function c(e){if(!e||typeof e!=`object`)return;let t={};for(let[n,r]of Object.entries(e))t[n]=Array.isArray(r)?[...r]:r;return t}function l(e,t,n=r,a=`blocking`){i.set(e,{runner:t,mode:a,timeoutMs:o(n)})}function u(){var t,n;let a=e();return a?(t=(n=i.get(a))==null?void 0:n.timeoutMs)==null?r:t:r}function d(e){return!!(e&&typeof e==`object`&&e.__wevuNavigationFailure)}function f(r,o,l={}){let f=a.get(r);if(f)return l.onComplete&&f.blocking&&f.subscribe(l.onComplete),l.start!==!1&&f.start(o),f.blocking?f.promise:void 0;let p=e(),m=p?i.get(p):void 0,h=m==null?void 0:m.runner;if(!h)return;let g=(m==null?void 0:m.mode)===`blocking`,_=s(r),v=c(o),y=`idle`,b,x=u(),S,C=/* @__PURE__ */ new Set,w=new Promise(e=>{S=e}),T=(e,t)=>{if(y!==`idle`&&y!==`running`)return;y=e,b!==void 0&&(clearTimeout(b),b=void 0);let r=[...C];C.clear(),h=void 0,_=void 0,v=void 0,S(t),n(()=>{if(y===`allowed`||y===`timed-out`)for(let e of r)e.active&&(e.callback(t),e.active=!1)})},E={promise:w,blocking:g,status:()=>y,subscribe(e){let t={callback:e,active:!0};return y!==`idle`&&y!==`running`?n(()=>{t.active&&(y===`allowed`||y===`timed-out`)&&(e(y===`allowed`||y===`timed-out`),t.active=!1)}):C.add(t),()=>{t.active=!1,C.delete(t)}},start(e){if(y!==`idle`)return;y=`running`,g&&(b=setTimeout(()=>{var e,n;y===`running`&&(console.warn(`${t} initial navigation exceeded ${x}ms; mounting page`,(e=(n=_==null?void 0:_.route)==null?_==null?void 0:_.__route__:n)==null?``:e),T(`timed-out`,!0))},x));let n=_,r=c(e==null?v:e),i=h;if(h=void 0,!i||!n){T(`aborted`,!1);return}i(n,r,()=>y===`running`).then(e=>{let t=d(e);T(t?`aborted`:`allowed`,!t)},()=>{T(`aborted`,!1)})},cancel(){T(`cancelled`,!1)}};return a.set(r,E),l.onComplete&&g&&E.subscribe(l.onComplete),l.start!==!1&&E.start(o),g?w:void 0}function p(e){var t;(t=a.get(e))==null||t.cancel()}export{r as DEFAULT_INITIAL_NAVIGATION_TIMEOUT,p as cancelInitialNavigation,f as ensureInitialNavigation,u as getInitialNavigationTimeout,l as registerInitialNavigationRunner};
1
+ import{registerInitialNavigationLifecycle as e}from"../runtime/navigationLifecycle.mjs";import{getActiveRouter as t}from"./instance.mjs";import{WEVU_INITIAL_NAVIGATION_TIMEOUT_MARKER as n}from"@weapp-core/constants";import{queueMicrotaskPolyfill as r}from"@wevu/web-apis";const i=1e4,a=/* @__PURE__ */ new WeakMap,o=/* @__PURE__ */ new WeakMap;function s(e){return Number.isFinite(e)&&e>0?Math.max(1,Math.trunc(e)):i}function c(e){return{route:typeof e.route==`string`?e.route:void 0,__route__:typeof e.__route__==`string`?e.__route__:void 0,options:e.options&&typeof e.options==`object`?{...e.options}:void 0}}function l(e){if(!e||typeof e!=`object`)return;let t={};for(let[n,r]of Object.entries(e))t[n]=Array.isArray(r)?[...r]:r;return t}function u(){let e=t();return e?a.get(e)?.timeoutMs??1e4:i}function d(e){return!!(e&&typeof e==`object`&&e.__wevuNavigationFailure)}function f(e){return o.get(e)?.promise}function p(e,i,s={}){let f=o.get(e);if(f)return s.onComplete&&f.blocking&&f.subscribe(s.onComplete),s.start!==!1&&f.start(i),f.blocking?f.promise:void 0;let p=t(),m=p?a.get(p):void 0,h=m?.runner;if(!h)return;let g=m?.mode===`blocking`,_=c(e),v=l(i),y=`idle`,b,x=u(),S,C=/* @__PURE__ */ new Set,w=new Promise(e=>{S=e}),T=(e,t)=>{if(y!==`idle`&&y!==`running`)return;y=e,b!==void 0&&(clearTimeout(b),b=void 0);let n=[...C];C.clear(),h=void 0,_=void 0,v=void 0,S(t),r(()=>{if(y===`allowed`||y===`timed-out`)for(let e of n)e.active&&(e.callback(t),e.active=!1)})},E={promise:w,blocking:g,status:()=>y,subscribe(e){let t={callback:e,active:!0};return y!==`idle`&&y!==`running`?r(()=>{t.active&&(y===`allowed`||y===`timed-out`)&&(e(y===`allowed`||y===`timed-out`),t.active=!1)}):C.add(t),()=>{t.active=!1,C.delete(t)}},start(e){if(y!==`idle`)return;y=`running`,g&&(b=setTimeout(()=>{y===`running`&&(console.warn(`${n} initial navigation exceeded ${x}ms; mounting page`,_?.route??_?.__route__??``),T(`timed-out`,!0))},x));let t=_,r=l(e??v),i=h;if(h=void 0,!i||!t){T(`aborted`,!1);return}i(t,r,()=>y===`running`).then(e=>{let t=d(e);T(t?`aborted`:`allowed`,!t)},()=>{T(`aborted`,!1)})},cancel(){T(`cancelled`,!1)}};return o.set(e,E),s.onComplete&&g&&E.subscribe(s.onComplete),s.start!==!1&&E.start(i),g?w:void 0}function m(e){o.get(e)?.cancel()}function h(t,n,r=i,o=`blocking`){e({ensure:p,cancel:m}),a.set(t,{runner:n,mode:o,timeoutMs:s(r)})}export{i as DEFAULT_INITIAL_NAVIGATION_TIMEOUT,m as cancelInitialNavigation,p as ensureInitialNavigation,f as getInitialNavigationPromise,u as getInitialNavigationTimeout,h as registerInitialNavigationRunner};
@@ -1 +1 @@
1
- import{injectGlobal as e,provideGlobal as t}from"../runtime/provide.mjs";const n=Symbol(`wevu.router.instance`);let r;function i(e){r=e,t(n,e)}function a(){var t;return(t=r)==null?e(n,void 0):t}export{a as getActiveRouter,i as setActiveRouter};
1
+ import{injectGlobal as e,provideGlobal as t}from"../runtime/provide.mjs";const n=Symbol(`wevu.router.instance`);let r;function i(e){r=e,t(n,e)}function a(){return r??e(n,void 0)}export{a as getActiveRouter,i as setActiveRouter};
@@ -1 +1 @@
1
- import{NavigationFailureType as e}from"./types.mjs";const t=/already|same|duplicat|重复/,n=/cancel|取消/,r=/abort|interrupt|中断/;function i(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function a(a){let o=i(a).toLowerCase();return t.test(o)?e.duplicated:n.test(o)?e.cancelled:r.test(o)?e.aborted:e.unknown}function o(e,t,n,r){let a=i(r)||`Navigation failed`;return Object.assign(Error(a),{__wevuNavigationFailure:!0,type:e,to:t,from:n,cause:r})}function s(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0||n.type===t:!1}function c(e){return!e||typeof e!=`object`?!1:`to`in e}function l(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function u(t,n,r){for(let i of t)try{let t=await i(n.to,n.from,n);if(s(t))return{status:`failure`,failure:t};if(t===!1)return{status:`failure`,failure:o(e.aborted,n.to,n.from,`Navigation aborted by guard`)};if(c(t))return n.to?{status:`redirect`,target:r(t.to,n.to.path),replace:t.replace}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)};if(l(t))return n.to?{status:`redirect`,target:r(t,n.to.path)}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)}}catch(t){return{status:`failure`,failure:o(e.aborted,n.to,n.from,t)}}return{status:`continue`}}function d(e,t,n,r){return new Promise(i=>{let s=!1,c=e=>{s||(s=!0,i(e))};try{let i=e({...t,success:()=>c(),fail:e=>{c(o(a(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>c(),e=>c(o(a(e),n,r,e)))}catch(e){c(o(a(e),n,r,e))}})}async function f(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch(e){}}async function p(e,t,n){for(let r of e)try{await r(t,n)}catch(e){}}function m(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function h(t){return t.type===e.unknown||t.cause instanceof Error||t.type===e.aborted&&t.cause!==void 0&&!(typeof t.cause==`string`||m(t.cause))}export{o as createNavigationFailure,d as executeNavigationMethod,s as isNavigationFailure,c as isNavigationRedirectCandidate,f as runAfterEachHooks,p as runNavigationErrorHooks,u as runNavigationGuards,h as shouldEmitNavigationError};
1
+ import{NavigationFailureType as e}from"./types.mjs";const t=/already|same|duplicat|重复/,n=/cancel|取消/,r=/abort|interrupt|中断/;function i(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function a(a){let o=i(a).toLowerCase();return t.test(o)?e.duplicated:n.test(o)?e.cancelled:r.test(o)?e.aborted:e.unknown}function o(e,t,n,r){let a=i(r)||`Navigation failed`;return Object.assign(Error(a),{__wevuNavigationFailure:!0,type:e,to:t,from:n,cause:r})}function s(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0||n.type===t:!1}function c(e){return!e||typeof e!=`object`?!1:`to`in e}function l(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function u(t,n,r){for(let i of t)try{let t=await i(n.to,n.from,n);if(s(t))return{status:`failure`,failure:t};if(t===!1)return{status:`failure`,failure:o(e.aborted,n.to,n.from,`Navigation aborted by guard`)};if(c(t))return n.to?{status:`redirect`,target:r(t.to,n.to.path),replace:t.replace}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)};if(l(t))return n.to?{status:`redirect`,target:r(t,n.to.path)}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)}}catch(t){return{status:`failure`,failure:o(e.aborted,n.to,n.from,t)}}return{status:`continue`}}function d(e,t,n,r){return new Promise(i=>{let s=!1,c=e=>{s||(s=!0,i(e))};try{let i=e({...t,success:()=>c(),fail:e=>{c(o(a(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>c(),e=>c(o(a(e),n,r,e)))}catch(e){c(o(a(e),n,r,e))}})}async function f(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch{}}async function p(e,t,n){for(let r of e)try{await r(t,n)}catch{}}function m(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function h(t){return t.type===e.unknown||t.cause instanceof Error||t.type===e.aborted&&t.cause!==void 0&&!(typeof t.cause==`string`||m(t.cause))}export{o as createNavigationFailure,d as executeNavigationMethod,s as isNavigationFailure,c as isNavigationRedirectCandidate,f as runAfterEachHooks,p as runNavigationErrorHooks,u as runNavigationGuards,h as shouldEmitNavigationError};
@@ -1 +1 @@
1
- import{notifyRouteStateSync as e}from"./routeSync.mjs";import{runAfterEachHooks as t,runNavigationErrorHooks as n,shouldEmitNavigationError as r}from"./navigationCore.mjs";function i(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function a(i){let{afterEachHooks:a,errorHandlers:o,nativeRouter:s,rejectOnError:c}=i;async function l(e){if(await t(a,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure}),e.failure&&r(e.failure)){var i;await n(o,(i=e.failure.cause)==null?e.failure:i,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure})}}function u(e){return c&&r(e)}async function d(t){if(t.failure||e(t.to?{route:t.to,source:`router`}:void 0),await l(t),t.failure&&u(t.failure))throw t.failure;return t.failure}return{emitNavigationAfterEach:l,settleNavigationResult:d}}export{a as createNavigationResultController,i as createNavigationRunResult};
1
+ import{notifyRouteStateSync as e}from"./routeSync.mjs";import{runAfterEachHooks as t,runNavigationErrorHooks as n,shouldEmitNavigationError as r}from"./navigationCore.mjs";function i(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function a(i){let{afterEachHooks:a,errorHandlers:o,nativeRouter:s,rejectOnError:c}=i;async function l(e){await t(a,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure}),e.failure&&r(e.failure)&&await n(o,e.failure.cause??e.failure,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure})}function u(e){return c&&r(e)}async function d(t){if(t.failure||e(t.to?{route:t.to,source:`router`}:void 0),await l(t),t.failure&&u(t.failure))throw t.failure;return t.failure}return{emitNavigationAfterEach:l,settleNavigationResult:d}}export{a as createNavigationResultController,i as createNavigationRunResult};
@@ -1 +1 @@
1
- import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{resolveMatchedRouteRecord as t}from"../routerInternal/matching.mjs";import{createNativeRouteUrl as n,hasLocationQuery as r}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as i}from"./types.mjs";import{createNavigationFailure as a,executeNavigationMethod as o,isNavigationFailure as s,runNavigationGuards as c}from"./navigationCore.mjs";import{createNavigationRunResult as l}from"./navigationResult.mjs";import{applyRedirectedFrom as u,createDuplicatedFailure as d,createHashOnlyNavigationFailure as f,createTabBarQueryFailure as p,createTooManyRedirectsFailure as m,resolveRouteRecordRedirect as h}from"./navigationTargetHelpers.mjs";async function g(g){let{mode:_,target:v,from:y,nativeRouter:b,routeResolveCodec:x,namedRouteLookup:S,beforeEachGuards:C,beforeResolveGuards:w,maxRedirects:T,tabBarPathSet:E,resolveWithCodec:D,executeNative:O=!0,allowSameLocation:k=!1}=g,A=v,j=_,M=0;for(;;){var N;let g=E.has(A.path);if(n(A,x.stringifyQuery)===n(y,x.stringifyQuery)&&A.hash!==y.hash)return l(j,y,A,f(A,y));if(!k&&(g?A.path===y.path:A.fullPath===y.fullPath))return l(j,y,A,d(A,y));if(g&&r(A.query))return l(j,y,A,p(A,y));let _=await c(C,{mode:j,to:A,from:y,nativeRouter:b},D);if(_.status===`failure`)return l(j,y,A,_.failure);if(_.status===`redirect`){let e=_.target,t=_.replace===!0?`replace`:_.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}let v=t(A,S),P=(N=v==null?void 0:v.matchedRecords)==null?[]:N,F=!1;for(let e of P){if(e.redirect===void 0)continue;let t;try{t=await h(e.redirect,A,y,D)}catch(e){return l(j,y,A,a(i.aborted,A,y,e))}let n=t.replace===!1?`push`:`replace`,r=t.target;if(r.fullPath!==A.fullPath||n!==j){if(u(r,A),A=r,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));F=!0;break}}if(F)continue;let I=!1;for(let e of P){if(e.beforeEnterGuards.length===0)continue;let t=await c(new Set(e.beforeEnterGuards),{mode:j,to:A,from:y,nativeRouter:b},D);if(t.status===`failure`)return l(j,y,A,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||n!==j){if(u(e,A),A=e,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));I=!0;break}}}if(I)continue;let L=await c(w,{mode:j,to:A,from:y,nativeRouter:b},D);if(L.status===`failure`)return l(j,y,A,L.failure);if(L.status===`redirect`){let e=L.target,t=L.replace===!0?`replace`:L.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}if(!O)return l(j,y,A);if(g){let t=await o(b.switchTab,{url:e(A.path)},A,y);return s(t)?l(j,y,A,t):l(j,y,A)}let R=j===`push`?b.navigateTo:b.redirectTo,z=await o(R,{url:n(A,x.stringifyQuery)},A,y);return s(z)?l(j,y,A,z):l(j,y,A)}}export{g as navigateWithTarget};
1
+ import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{resolveMatchedRouteRecord as t}from"../routerInternal/matching.mjs";import{createNativeRouteUrl as n,hasLocationQuery as r}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as i}from"./types.mjs";import{createNavigationFailure as a,executeNavigationMethod as o,isNavigationFailure as s,runNavigationGuards as c}from"./navigationCore.mjs";import{createNavigationRunResult as l}from"./navigationResult.mjs";import{applyRedirectedFrom as u,createDuplicatedFailure as d,createHashOnlyNavigationFailure as f,createTabBarQueryFailure as p,createTooManyRedirectsFailure as m,resolveRouteRecordRedirect as h}from"./navigationTargetHelpers.mjs";async function g(g){let{mode:_,target:v,from:y,nativeRouter:b,routeResolveCodec:x,namedRouteLookup:S,beforeEachGuards:C,beforeResolveGuards:w,maxRedirects:T,tabBarPathSet:E,resolveWithCodec:D,executeNative:O=!0,allowSameLocation:k=!1}=g,A=v,j=_,M=0;for(;;){let g=E.has(A.path);if(n(A,x.stringifyQuery)===n(y,x.stringifyQuery)&&A.hash!==y.hash)return l(j,y,A,f(A,y));if(!k&&(g?A.path===y.path:A.fullPath===y.fullPath))return l(j,y,A,d(A,y));if(g&&r(A.query))return l(j,y,A,p(A,y));let _=await c(C,{mode:j,to:A,from:y,nativeRouter:b},D);if(_.status===`failure`)return l(j,y,A,_.failure);if(_.status===`redirect`){let e=_.target,t=_.replace===!0?`replace`:_.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}let v=t(A,S)?.matchedRecords??[],N=!1;for(let e of v){if(e.redirect===void 0)continue;let t;try{t=await h(e.redirect,A,y,D)}catch(e){return l(j,y,A,a(i.aborted,A,y,e))}let n=t.replace===!1?`push`:`replace`,r=t.target;if(r.fullPath!==A.fullPath||n!==j){if(u(r,A),A=r,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));N=!0;break}}if(N)continue;let P=!1;for(let e of v){if(e.beforeEnterGuards.length===0)continue;let t=await c(new Set(e.beforeEnterGuards),{mode:j,to:A,from:y,nativeRouter:b},D);if(t.status===`failure`)return l(j,y,A,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||n!==j){if(u(e,A),A=e,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));P=!0;break}}}if(P)continue;let F=await c(w,{mode:j,to:A,from:y,nativeRouter:b},D);if(F.status===`failure`)return l(j,y,A,F.failure);if(F.status===`redirect`){let e=F.target,t=F.replace===!0?`replace`:F.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}if(!O)return l(j,y,A);if(g){let t=await o(b.switchTab,{url:e(A.path)},A,y);return s(t)?l(j,y,A,t):l(j,y,A)}let I=j===`push`?b.navigateTo:b.redirectTo,L=await o(I,{url:n(A,x.stringifyQuery)},A,y);return s(L)?l(j,y,A,L):l(j,y,A)}}export{g as navigateWithTarget};
@@ -1 +1 @@
1
- import{resolvePath as e}from"../routerInternal/path.mjs";import{normalizeHash as t,normalizeQuery as n,normalizeRouteParams as r,parseQuery as i,stringifyQuery as a}from"../routerInternal/query.mjs";import{createRouteLocation as o,parsePathInput as s}from"../routerInternal/location.mjs";const c={parseQuery:i,stringifyQuery:a};function l(i,a=``,l=c){var u,d,f,p;if(typeof i==`string`){let t=s(i,l),n=e(t.path,a);return o(n,t.query,t.hash,void 0,{},l.stringifyQuery)}let m=typeof i.fullPath==`string`?s(i.fullPath,l):void 0,h=(u=(d=i.path)==null?m==null?void 0:m.path:d)==null?a:u,g=e(h,a),_=i.query?n(i.query):(f=m==null?void 0:m.query)==null?{}:f,v=t((p=i.hash)==null?m==null?void 0:m.hash:p),y=typeof i.name==`string`?i.name:void 0,b=i.params?r(i.params):{};return o(g,_,v,y,b,l.stringifyQuery)}export{c as DEFAULT_ROUTE_RESOLVE_CODEC,l as resolveRouteLocation};
1
+ import{resolvePath as e}from"../routerInternal/path.mjs";import{normalizeHash as t,normalizeQuery as n,normalizeRouteParams as r,parseQuery as i,stringifyQuery as a}from"../routerInternal/query.mjs";import{createRouteLocation as o,parsePathInput as s}from"../routerInternal/location.mjs";const c={parseQuery:i,stringifyQuery:a};function l(i,a=``,l=c){if(typeof i==`string`){let t=s(i,l),n=e(t.path,a);return o(n,t.query,t.hash,void 0,{},l.stringifyQuery)}let u=typeof i.fullPath==`string`?s(i.fullPath,l):void 0,d=i.path??u?.path??a,f=e(d,a),p=i.query?n(i.query):u?.query??{},m=t(i.hash??u?.hash),h=typeof i.name==`string`?i.name:void 0,g=i.params?r(i.params):{};return o(f,p,m,h,g,l.stringifyQuery)}export{c as DEFAULT_ROUTE_RESOLVE_CODEC,l as resolveRouteLocation};
@@ -1 +1 @@
1
- import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{collectRouteNamesForRemoval as t}from"../routerInternal/matching.mjs";import{assertValidAddRouteInput as n,warnRouteConfig as r}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteNameByStaticPath as i,flattenNamedRouteRecords as a,normalizeRouteRecordRaw as o}from"../routerInternal/records.mjs";import{cloneRouteMeta as s}from"../routerInternal/snapshots.mjs";function c(t){let n={name:t.name,path:t.path?`/${t.path}`:`/`};return t.meta!==void 0&&(n.meta=s(t.meta)),t.aliasPaths.length===1?n.alias=e(t.aliasPaths[0]):t.aliasPaths.length>1&&(n.alias=t.aliasPaths.map(t=>e(t))),t.beforeEnterGuards.length===1?n.beforeEnter=t.beforeEnterGuards[0]:t.beforeEnterGuards.length>1&&(n.beforeEnter=t.beforeEnterGuards.slice()),t.redirect!==void 0&&(n.redirect=t.redirect),n}function l(s){let l=e=>s.recordByName.has(e),u=()=>Array.from(s.recordByName.values(),c),d=((c,l)=>{let u=typeof c==`string`?l:c;if(!u)throw Error(`Route record is required when adding a child route`);n(u);let d=typeof c==`string`?c:void 0,f=d?s.recordByName.get(d):void 0;if(d&&!f)throw Error(`Parent route "${d}" is not defined in createRouter({ routes | namedRoutes })`);let p=a([u],f==null?void 0:f.path,d,f==null?void 0:f.aliasPaths,void 0,`addRoute`);if(p.length===0)throw Error(`Route name and path are required when adding a named route`);let m=[];for(let n of p){let i=o(n.route,n.parentName);if(!i)continue;let a=s.recordByName.get(i.name);if(a){let n=t(a.name,s.recordByName);for(let e of n)s.recordByName.delete(e);r(`addRoute() replaced existing route "${i.name}" (${e(a.path)} -> ${e(i.path)}) and removed ${n.size-1} nested route(s)`)}s.recordByName.set(i.name,i),m.push(i)}return s.nameByStaticPath=i(s.recordByName),()=>{let e=!1;for(let t of m)s.recordByName.get(t.name)===t&&(s.recordByName.delete(t.name),e=!0);e&&(s.nameByStaticPath=i(s.recordByName))}});function f(e){let n=t(e,s.recordByName);if(n.size===0)return;let r=!1;for(let e of n)r=s.recordByName.delete(e)||r;r&&(s.nameByStaticPath=i(s.recordByName))}function p(){s.recordByName.clear(),s.nameByStaticPath.clear()}return{hasRoute:l,getRoutes:u,addRoute:d,removeRoute:f,clearRoutes:p}}export{l as createRouteRegistry};
1
+ import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{collectRouteNamesForRemoval as t}from"../routerInternal/matching.mjs";import{assertValidAddRouteInput as n,warnRouteConfig as r}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteNameByStaticPath as i,flattenNamedRouteRecords as a,normalizeRouteRecordRaw as o}from"../routerInternal/records.mjs";import{cloneRouteMeta as s}from"../routerInternal/snapshots.mjs";function c(t){let n={name:t.name,path:t.path?`/${t.path}`:`/`};return t.meta!==void 0&&(n.meta=s(t.meta)),t.aliasPaths.length===1?n.alias=e(t.aliasPaths[0]):t.aliasPaths.length>1&&(n.alias=t.aliasPaths.map(t=>e(t))),t.beforeEnterGuards.length===1?n.beforeEnter=t.beforeEnterGuards[0]:t.beforeEnterGuards.length>1&&(n.beforeEnter=t.beforeEnterGuards.slice()),t.redirect!==void 0&&(n.redirect=t.redirect),n}function l(s){let l=e=>s.recordByName.has(e),u=()=>Array.from(s.recordByName.values(),c),d=((c,l)=>{let u=typeof c==`string`?l:c;if(!u)throw Error(`Route record is required when adding a child route`);n(u);let d=typeof c==`string`?c:void 0,f=d?s.recordByName.get(d):void 0;if(d&&!f)throw Error(`Parent route "${d}" is not defined in createRouter({ routes | namedRoutes })`);let p=a([u],f?.path,d,f?.aliasPaths,void 0,`addRoute`);if(p.length===0)throw Error(`Route name and path are required when adding a named route`);let m=[];for(let n of p){let i=o(n.route,n.parentName);if(!i)continue;let a=s.recordByName.get(i.name);if(a){let n=t(a.name,s.recordByName);for(let e of n)s.recordByName.delete(e);r(`addRoute() replaced existing route "${i.name}" (${e(a.path)} -> ${e(i.path)}) and removed ${n.size-1} nested route(s)`)}s.recordByName.set(i.name,i),m.push(i)}return s.nameByStaticPath=i(s.recordByName),()=>{let e=!1;for(let t of m)s.recordByName.get(t.name)===t&&(s.recordByName.delete(t.name),e=!0);e&&(s.nameByStaticPath=i(s.recordByName))}});function f(e){let n=t(e,s.recordByName);if(n.size===0)return;let r=!1;for(let e of n)r=s.recordByName.delete(e)||r;r&&(s.nameByStaticPath=i(s.recordByName))}function p(){s.recordByName.clear(),s.nameByStaticPath.clear()}return{hasRoute:l,getRoutes:u,addRoute:d,removeRoute:f,clearRoutes:p}}export{l as createRouteRegistry};
@@ -1 +1 @@
1
- import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";const t=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new WeakSet;function i(e){return n.add(e),()=>{n.delete(e)}}function a(e){for(let t of n)try{t(e)}catch(e){}}function o(e,t,n){if(e===`navigateBack`)return{method:e,source:`native`};if(t&&typeof t==`object`){let r=t.url;if(typeof r==`string`)return{method:e,page:n,source:`native`,url:r}}return{method:e,page:n,source:`native`}}function s(n){if(!n||typeof n!=`object`)return;let i=n;if(!r.has(i)){r.add(i);for(let n of t){let t=i[n];typeof t==`function`&&(i[n]=function(r,...i){let s=e(),c=s[s.length-1],l=!1,u=()=>{l||(l=!0,a(o(n,r,c)))},d=r&&typeof r==`object`?{...r,success:(...e)=>{u();let t=r.success;return typeof t==`function`?t(...e):void 0}}:r,f=t.call(this,d,...i);return f&&typeof f.then==`function`&&f.then(u,()=>{}),f})}}}export{s as installRouteStateSyncOnNativeRouter,a as notifyRouteStateSync,i as registerRouteStateSyncHandler};
1
+ import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";const t=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new WeakSet;function i(e){return n.add(e),()=>{n.delete(e)}}function a(e){for(let t of n)try{t(e)}catch{}}function o(e,t,n){if(e===`navigateBack`)return{method:e,source:`native`};if(t&&typeof t==`object`){let r=t.url;if(typeof r==`string`)return{method:e,page:n,source:`native`,url:r}}return{method:e,page:n,source:`native`}}function s(n){if(!n||typeof n!=`object`)return;let i=n;if(!r.has(i)){r.add(i);for(let n of t){let t=i[n];typeof t==`function`&&(i[n]=function(r,...i){let s=e(),c=s[s.length-1],l=!1,u=()=>{l||(l=!0,a(o(n,r,c)))},d=r&&typeof r==`object`?{...r,success:(...e)=>{u();let t=r.success;return typeof t==`function`?t(...e):void 0}}:r,f=t.call(this,d,...i);return f&&typeof f.then==`function`&&f.then(u,()=>{}),f})}}}export{s as installRouteStateSyncOnNativeRouter,a as notifyRouteStateSync,i as registerRouteStateSyncHandler};
@@ -0,0 +1,7 @@
1
+ import { ScrollRestorationHandle, ScrollRestorationRegistrationOptions, ScrollViewRestorationHandle } from "./types.mjs";
2
+ //#region src/router/scrollRestoration/adapters.d.ts
3
+ /** WebView 页面适配器;Skyline 没有隐式页面滚动容器。 */
4
+ export declare function usePageScrollRestoration(options?: ScrollRestorationRegistrationOptions): ScrollRestorationHandle;
5
+ /** 用属性控制 WebView/Skyline scroll-view,scroll 事件不产生 setData。 */
6
+ export declare function useScrollViewRestoration(options?: ScrollRestorationRegistrationOptions): ScrollViewRestorationHandle;
7
+ //#endregion
@@ -0,0 +1 @@
1
+ import{ref as e}from"../../reactivity/ref.mjs";import{getCurrentMiniProgramGlobalObject as t}from"../../runtime/platform/current.mjs";import{ensurePageHookOnInstance as n}from"../../runtime/hooks/pageScroll.mjs";import{addScrollHook as r}from"./host.mjs";import{resolveScrollController as i}from"./controller.mjs";import{getScrollSetupScope as a,registerScrollRestoration as o}from"./index.mjs";import{WEVU_PAGE_SCROLL_OBSERVERS_KEY as s,WEVU_PAGE_SCROLL_RESTORATION_OWNER_KEY as c}from"@weapp-core/constants";function l(e={}){let a=i(e.controller),l=t();if(typeof l?.pageScrollTo!=`function`)throw TypeError(`当前宿主不支持 pageScrollTo,请使用显式 scroll-view 适配器。`);let u=0,d,f=[];return o({...e,capture:()=>({top:u}),async restore(e,t){let n=a.transition;if(n&&n.page===d&&n.event.renderer===`skyline`)throw Error(`Skyline 不支持页面级滚动,请使用 useScrollViewRestoration()。`);t.isActive()&&await new Promise((t,n)=>{l.pageScrollTo({scrollTop:e?.top??0,duration:0,success:()=>t(),fail:n})})}},{onBindPage(e){d=e;let t=l[c]?.(d);typeof t==`function`&&f.push(t),f.push(r(d,s,e=>{e&&typeof e==`object`&&`scrollTop`in e&&typeof e.scrollTop==`number`&&(u=e.scrollTop)})),n(d,`onPageScroll`)},onStop(){for(let e of f)e();f.length=0}})}function u(t={}){let{commit:n}=a(),r=e(0),i=e(0),s=0,c=0;return{...o({...t,capture:()=>({top:s,left:c}),async restore(e,t){t.isActive()&&(r.value=s,i.value=c,await n(),t.isActive()&&(r.value=e?.top??0,i.value=e?.left??0,await n()))}}),scrollTop:r,scrollLeft:i,onScroll(e){s=e.detail.scrollTop,c=e.detail.scrollLeft}}}export{l as usePageScrollRestoration,u as useScrollViewRestoration};
@@ -0,0 +1,7 @@
1
+ import "../types.mjs";
2
+ import { ScrollRestorationController, ScrollRestorationOptions } from "./types.mjs";
3
+ import "./host.mjs";
4
+ //#region src/router/scrollRestoration/controller.d.ts
5
+ /** 创建显式启用的路由会话;不会安装全局默认滚动行为。 */
6
+ export declare function createScrollRestoration<TRouteMap extends object>(options: ScrollRestorationOptions<TRouteMap>): ScrollRestorationController;
7
+ //#endregion
@@ -0,0 +1 @@
1
+ import{getCurrentMiniProgramPages as e}from"../../runtime/platform.mjs";import{resolvePageRoute as t}from"../../routerInternal/location.mjs";import{getActiveRouter as n}from"../instance.mjs";import{currentScrollPage as r,subscribeScrollRouteEvents as i,supportsScrollRouteEvents as a}from"./host.mjs";const o=/* @__PURE__ */ new WeakMap,s=/* @__PURE__ */ new WeakMap;function c(n){if(s.has(n.router))throw Error(`该 router 已创建 scroll restoration 会话,请复用或先 dispose()。`);let c=n.router,l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map,d=new WeakSet(e()),f=n.onError??(e=>console.error(`[wevu/router] scroll restoration:`,e)),p=!1,m=0,h,g,_={automatic:a(),clear(e){e===void 0?l.clear():l.delete(e);for(let t of u.values())for(let n of t)(e===void 0||n.key===e)&&n.invalidate()},dispose(){if(!p){p=!0,m++,g?.();for(let e of u.values())for(let t of e)t.stop();u.clear(),l.clear(),h=void 0,s.delete(n.router),o.delete(_)}}},v={controller:_,get disposed(){return p},get transition(){return h},get generation(){return m},resolveRoute:e=>c.resolve(t(e)),register(e,t){if(p)throw Error(`scroll restoration 会话已 dispose()。`);let n=u.get(e);n||(n=/* @__PURE__ */ new Set,u.set(e,n));for(let e of n)if(e.key===t.key&&e.id===t.id)throw Error(`同一页面重复注册 scroll restoration key/id: ${t.key} / ${t.id}`);return n.add(t),()=>{n.delete(t),n.size===0&&u.delete(e)}},read:(e,t)=>l.get(e)?.get(t),save(e,t,n){if(p)return;if(n===null){v.clear(e,t);return}let r=l.get(e);r||(r=/* @__PURE__ */ new Map,l.set(e,r)),r.set(t,n)},clear(e,t){let n=l.get(e);n?.delete(t),n?.size===0&&l.delete(e);for(let n of u.values())for(let r of n)r.key===e&&r.id===t&&r.invalidate()},report:f};return _.automatic&&(g=i({BeforeAppRoute(e){if(p||h?.event.routeEventId===e.routeEventId)return;let t=r();if(t){d.add(t);for(let e of u.get(t)??[])e.capture()}m++;for(let e of u.values())for(let t of e)t.invalidate();h={event:e,fresh:!1,done:!1}},BeforePageUnload(e){let t=e.page;if(t){if(h?.event.routeEventId!==e.routeEventId&&t===r())for(let e of u.get(t)??[])e.capture();for(let e of u.get(t)??[])e.stop()}},AppRoute(e){if(p||h&&h.event.routeEventId!==e.routeEventId)return;let n=r();n&&t(n).path===e.path.replace(/^\/+/,``)&&(h??(h={event:e,fresh:!1,done:!1}),!h.page&&(h.page=n,h.fresh=!d.has(n),d.add(n)))},AppRouteDone(e){if(p||!h)return;let t=e.routeEventId===``&&h.fresh&&Number.isInteger(h.event.webviewId)&&e.webviewId===h.event.webviewId&&e.path===h.event.path&&typeof e.openType==`string`&&e.openType===h.event.openType;if((h.event.routeEventId===e.routeEventId||t)&&h.page&&h.page===r()&&!h.done){h.done=!0;for(let e of u.get(h.page)??[])e.restoreAutomatic()}}})),o.set(_,v),s.set(n.router,_),_}function l(e){let t=n(),r=e??(t&&s.get(t)),i=r&&o.get(r);if(!i||i.disposed)throw Error(`请先在应用启动时调用 createScrollRestoration({ router }),或传入有效的 controller。`);return i}export{c as createScrollRestoration,l as resolveScrollController};
@@ -0,0 +1,3 @@
1
+ import "../../routerInternal/types.mjs";
2
+ import "../types.mjs";
3
+ import { WEVU_HOOKS_KEY, WEVU_NATIVE_INSTANCE_KEY, WEVU_READY_CALLED_KEY } from "@weapp-core/constants";
@@ -0,0 +1 @@
1
+ import{getCurrentMiniProgramGlobalObject as e}from"../../runtime/platform/current.mjs";import{getCurrentMiniProgramPages as t}from"../../runtime/platform.mjs";import{pushHook as n}from"../../runtime/hooks/base.mjs";import{WEVU_HOOKS_KEY as r,WEVU_NATIVE_INSTANCE_KEY as i,WEVU_ROUTE_EVENT_CONTRACT_KEY as a}from"@weapp-core/constants";const o=[`BeforeAppRoute`,`BeforePageUnload`,`AppRoute`,`AppRouteDone`];function s(t=e()){if(!t||!o.every(e=>typeof t[`on${e}`]==`function`&&typeof t[`off${e}`]==`function`))return!1;if(t[a]===1)return!0;let n=t.getAppBaseInfo?.().SDKVersion??t.getSystemInfoSync?.().SDKVersion;if(typeof n!=`string`)return!1;let r=/^(\d+)\.(\d+)\.(\d+)(?:\D|$)/.exec(n);if(!r)return!1;let i=Number(r[1]),s=Number(r[2]),c=Number(r[3]);return i>3||i===3&&(s>5||s===5&&c>=5)}function c(t){let n=e(),r=[];try{for(let e of o){let i=n=>{typeof n?.routeEventId==`string`&&typeof n.path==`string`&&t[e](n)};n[`on${e}`](i),r.push(()=>n[`off${e}`](i))}}catch(e){for(let e of r)e();throw e}return()=>{for(let e of r)e()}}function l(){let e=t();return e[e.length-1]}function u(e){let n=t(),r=/* @__PURE__ */ new Set,a=e;for(;a&&!r.has(a);){if(r.add(a),n.includes(a))return a;let e=a.__wxWebviewId__;if(e!==void 0){let t=n.find(t=>t.__wxWebviewId__===e);if(t)return t}let t=a[i]??a.$;a=t&&t!==a?t:a.selectOwnerComponent?.()}}function d(e,t,i){return n(e,t,i),()=>{let n=e[r],a=n?.[t];n&&Array.isArray(a)&&(n[t]=a.filter(e=>e!==i))}}export{d as addScrollHook,l as currentScrollPage,u as resolveScrollPage,c as subscribeScrollRouteEvents,s as supportsScrollRouteEvents};
@@ -0,0 +1,8 @@
1
+ import { ScrollRestorationContext, ScrollRestorationController, ScrollRestorationHandle, ScrollRestorationOptions, ScrollRestorationRegistrationOptions, ScrollViewRestorationHandle, UseScrollRestorationOptions } from "./types.mjs";
2
+ import "./host.mjs";
3
+ import { createScrollRestoration } from "./controller.mjs";
4
+ //#region src/router/scrollRestoration/index.d.ts
5
+ /** 在同步 setup 中注册快照;只恢复新实例,不覆盖原生保留页的位置。 */
6
+ export declare function useScrollRestoration<T extends object>(options: UseScrollRestorationOptions<T>): ScrollRestorationHandle;
7
+ //#endregion
8
+ export { type ScrollRestorationContext, type ScrollRestorationController, type ScrollRestorationHandle, type ScrollRestorationOptions, type ScrollRestorationRegistrationOptions, type ScrollViewRestorationHandle, type UseScrollRestorationOptions, createScrollRestoration };
@@ -0,0 +1 @@
1
+ import{onScopeDispose as e}from"../../reactivity/core.mjs";import{assertInSetup as t,getCurrentSetupContext as n}from"../../runtime/hooks/base.mjs";import{getInitialNavigationPromise as r}from"../initialNavigation.mjs";import{addScrollHook as i,currentScrollPage as a,resolveScrollPage as o}from"./host.mjs";import{createScrollRestoration as s,resolveScrollController as c}from"./controller.mjs";import{WEVU_READY_CALLED_KEY as l}from"@weapp-core/constants";function u(){let e=t(`useScrollRestoration`),r=n()?.proxy;if(typeof r?.$nextTick!=`function`)throw TypeError(`scroll restoration 需要具有宿主提交屏障的 wevu setup 实例。`);return{instance:e,commit:()=>r.$nextTick()}}function d(t,n){let{instance:s,commit:d}=u(),f=c(t.controller),p=[],m,h,g=!1,_=!0,v=!1,y=!1,b=0,x=!!s[l],S=!1,C,w,T;function E(){(g||x&&S)&&w?.()}function D(){if(m||g)return;let e=o(s);if(!e)return;let r=f.resolveRoute(e);T.key=typeof t.key==`function`?t.key(r):t.key??r.fullPath;let a=f.register(e,T);m=e,h=r,p.push(a),S=!!e[l],p.push(i(e,`onReady`,()=>{S=!0,E(),T.restoreAutomatic()})),n?.onBindPage?.(e)}async function O(){if(g||f.disposed)return!1;if(D(),!m||!h)throw Error(`无法确定 scroll restoration 的原生归属页面,请在页面 attached 后恢复。`);if(!_||a()!==m)return!1;let e=++b,n=f.generation,i={route:h,routeEventId:f.transition?.page===m?f.transition.event.routeEventId:void 0,isActive:()=>!g&&!f.disposed&&_&&e===b&&n===f.generation&&a()===m};if((!x||!S)&&(C??(C=new Promise(e=>{w=e})),await C),!i.isActive()||await r(m)===!1||!i.isActive()||(await d(),!i.isActive()))return!1;let o=f.read(T.key,T.id);return await t.restore(o,i),i.isActive()}T={key:``,id:t.id??`default`,capture(){if(!(g||f.disposed||!m||!_||v)){v=!0;try{let e=t.capture();if(e!==null&&`then`in e&&typeof e.then==`function`)throw TypeError(`scroll restoration capture 必须同步返回快照,不能返回 Promise。`);f.save(T.key,T.id,e)}catch(e){f.clear(T.key,T.id),f.report(e)}}},invalidate(){b++,w?.(),C=void 0,w=void 0},restoreAutomatic(){let e=f.transition;!g&&!t.manual&&!y&&x&&S&&e?.fresh&&e.done&&e.page===m&&(y=!0,O().catch(f.report))},stop(){if(!g){g=!0,b++,E();for(let e of p)e();p.length=0,n?.onStop?.()}}};function k(){T.capture(),T.stop()}return p.push(i(s,`onAttached`,D),i(s,`onReady`,()=>{D(),x=!0,E(),T.restoreAutomatic()}),i(s,`onShow`,()=>{D(),_=!0,v=!1}),i(s,`onHide`,()=>{T.capture(),_=!1,T.invalidate()}),i(s,`onDetached`,k),i(s,`onUnload`,k)),e(k),D(),T.restoreAutomatic(),{automatic:f.controller.automatic&&!t.manual,scroll:O,clear:()=>{D(),m&&f.clear(T.key,T.id)},stop:T.stop}}function f(e){return d(e)}export{s as createScrollRestoration,u as getScrollSetupScope,d as registerScrollRestoration,f as useScrollRestoration};
@@ -0,0 +1,60 @@
1
+ import { Ref } from "../../reactivity/ref.mjs";
2
+ import "../../reactivity/index.mjs";
3
+ import { RouteLocationNormalizedLoaded, RouterNavigation } from "../types.mjs";
4
+ //#region src/router/scrollRestoration/types.d.ts
5
+ export interface ScrollRestorationController {
6
+ /** 当前宿主是否支持带 routeEventId 的自动路由关联。 */
7
+ readonly automatic: boolean;
8
+ /** 清除整个会话或指定路由 key 的快照,不注销组件。 */
9
+ clear: (key?: string) => void;
10
+ /** 注销宿主监听、组件注册和未完成的恢复,并清空会话。 */
11
+ dispose: () => void;
12
+ }
13
+ export interface ScrollRestorationOptions<TRouteMap extends object = object> {
14
+ router: RouterNavigation<TRouteMap>;
15
+ /** 自动捕获或恢复失败时调用;手动 scroll 的错误由调用者处理。 */
16
+ onError?: (error: unknown) => void;
17
+ }
18
+ export interface ScrollRestorationContext {
19
+ readonly route: Readonly<RouteLocationNormalizedLoaded>;
20
+ readonly routeEventId?: string;
21
+ /** 异步自定义恢复在每次 await 后、写入宿主前必须重新检查。 */
22
+ isActive: () => boolean;
23
+ }
24
+ export interface ScrollRestorationRegistrationOptions {
25
+ controller?: ScrollRestorationController;
26
+ /** 默认使用包含 query 的 route.fullPath。 */
27
+ key?: string | ((route: Readonly<RouteLocationNormalizedLoaded>) => string);
28
+ /** 同一页面和路由 key 内的独立容器名,默认为 default。 */
29
+ id?: string;
30
+ /** 只捕获,不在原生路由完成后自动恢复。 */
31
+ manual?: boolean;
32
+ }
33
+ export interface UseScrollRestorationOptions<T extends object> extends ScrollRestorationRegistrationOptions {
34
+ /** 同步返回独立快照;不能返回响应式活动对象或 Promise,null 表示清除。 */
35
+ capture: () => (T & {
36
+ then?: never;
37
+ }) | null;
38
+ restore: (snapshot: T | undefined, context: ScrollRestorationContext) => void | Promise<void>;
39
+ }
40
+ export interface ScrollRestorationHandle {
41
+ readonly automatic: boolean;
42
+ /** 等待组件就绪及宿主提交后恢复;已离开或失效时返回 false。 */
43
+ scroll: () => Promise<boolean>;
44
+ /** 只清除当前 key/id 的快照。 */
45
+ clear: () => void;
46
+ /** 停止当前注册;保留已捕获快照。 */
47
+ stop: () => void;
48
+ }
49
+ export interface ScrollViewRestorationHandle extends ScrollRestorationHandle {
50
+ scrollTop: Ref<number>;
51
+ scrollLeft: Ref<number>;
52
+ /** 绑定 scroll-view 的 scroll 事件,只更新非响应式缓存。 */
53
+ onScroll: (event: {
54
+ detail: {
55
+ scrollTop: number;
56
+ scrollLeft: number;
57
+ };
58
+ }) => void;
59
+ }
60
+ //#endregion
@@ -1 +1 @@
1
- import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{getCurrentMiniProgramPages as n}from"../runtime/platform.mjs";import{getCurrentSetupContext as r}from"../runtime/hooks/base.mjs";import{onLoad as i,onReady as a,onRouteDone as o,onShow as s,onUnload as c}from"../runtime/hooks/register.mjs";import{getActiveRouter as l}from"./instance.mjs";import{registerRouteStateSyncHandler as u}from"./routeSync.mjs";import{resolveCurrentRoute as d,resolvePageRoute as f}from"../routerInternal/location.mjs";import{cloneLocationQuery as p,cloneRouteLocationRedirectedFrom as m,cloneRouteMeta as h,cloneRouteParams as g,cloneRouteRecordMatchedList as _}from"../routerInternal/snapshots.mjs";import{useNativePageRouter as v,useNativeRouter as y}from"../runtime/vueCompat/router.mjs";import{resolveRouteLocation as b}from"./resolve.mjs";import{WEVU_NATIVE_INSTANCE_KEY as x}from"@weapp-core/constants";function S(e){return typeof e.route==`string`||typeof e.__route__==`string`}function C(e){let t=e[x];return t&&typeof t==`object`?t:e}function w(e,t,r){if((r==null?void 0:r.source)===`router`||!t)return!0;let i=C(e);if(r!=null&&r.page)return r.page===i;let a=n();return a[a.length-1]===i}function T(e,t){e.path=t.path,e.fullPath=t.fullPath,e.query=p(t.query),e.hash=t.hash,e.params=g(t.params),t.name===void 0?delete e.name:e.name=t.name,t.meta===void 0?delete e.meta:e.meta=h(t.meta),t.href===void 0?delete e.href:e.href=t.href,t.matched===void 0?delete e.matched:e.matched=_(t.matched),t.redirectedFrom===void 0?delete e.redirectedFrom:e.redirectedFrom=m(t.redirectedFrom)}function E(m={}){var h;let _=r(),v=_!=null&&_.instance&&typeof _.instance==`object`?_.instance:void 0,y=(h=m.resolveRoute)==null?(e=>{var t,n;return(t=(n=l())==null?void 0:n.resolve(e))==null?e:t}):h,x=y(d(void 0,v)),E=e({path:x.path,fullPath:x.fullPath,query:p(x.query),hash:x.hash,params:g(x.params)});T(E,x);function D(e,t,n){let r=y(t||d(e,v));if(n){var i;(i=m.beforeRouteStateSync)==null||i.call(m,r,n)}T(E,r)}if(!v)return u(e=>{if(e!=null&&e.route){D(void 0,e.route,e);return}if(e!=null&&e.url){D(void 0,b(e.url,E.path),e);return}if(e!=null&&e.page){D(void 0,f(e.page),e);return}D(void 0,void 0,e)}),{route:t(E)};let O=v,k=C(O),A=S(k)||n().includes(k);i(e=>{D(e)}),a(()=>{D()}),s(()=>{D()}),o(()=>{D()});let j=u(e=>{if(w(O,A,e)){if(e!=null&&e.route){D(void 0,e.route,e);return}if(e!=null&&e.url){D(void 0,b(e.url,E.path),e);return}if(e!=null&&e.page){D(void 0,f(e.page),e);return}D(void 0,void 0,e)}});return c(()=>{j()}),{route:t(E)}}function D(e={}){return E(e).route}function O(){return y()}function k(){return v()}export{E as createRouteStateController,k as useNativePageRouter,O as useNativeRouter,D as useRoute};
1
+ import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{getCurrentMiniProgramPages as n}from"../runtime/platform.mjs";import{getCurrentSetupContext as r}from"../runtime/hooks/base.mjs";import{onLoad as i,onReady as a,onRouteDone as o,onShow as s,onUnload as c}from"../runtime/hooks/register.mjs";import{registerRouteStateSyncHandler as l}from"./routeSync.mjs";import{resolveCurrentRoute as u,resolvePageRoute as d}from"../routerInternal/location.mjs";import{cloneLocationQuery as f,cloneRouteLocationRedirectedFrom as p,cloneRouteMeta as m,cloneRouteParams as h,cloneRouteRecordMatchedList as g}from"../routerInternal/snapshots.mjs";import{useNativePageRouter as _,useNativeRouter as v}from"../runtime/vueCompat/router.mjs";import{getActiveRouter as y}from"./instance.mjs";import{resolveRouteLocation as b}from"./resolve.mjs";import{WEVU_NATIVE_INSTANCE_KEY as x}from"@weapp-core/constants";function S(e){return typeof e.route==`string`||typeof e.__route__==`string`}function C(e){let t=e[x];return t&&typeof t==`object`?t:e}function w(e,t,r){if(r?.source===`router`||!t)return!0;let i=C(e);if(r?.page)return r.page===i;let a=n();return a[a.length-1]===i}function T(e,t){e.path=t.path,e.fullPath=t.fullPath,e.query=f(t.query),e.hash=t.hash,e.params=h(t.params),t.name===void 0?delete e.name:e.name=t.name,t.meta===void 0?delete e.meta:e.meta=m(t.meta),t.href===void 0?delete e.href:e.href=t.href,t.matched===void 0?delete e.matched:e.matched=g(t.matched),t.redirectedFrom===void 0?delete e.redirectedFrom:e.redirectedFrom=p(t.redirectedFrom)}function E(p={}){let m=r(),g=m?.instance&&typeof m.instance==`object`?m.instance:void 0,_=p.resolveRoute??(e=>y()?.resolve(e)??e),v=_(u(void 0,g)),x=e({path:v.path,fullPath:v.fullPath,query:f(v.query),hash:v.hash,params:h(v.params)});T(x,v);function E(e,t,n){let r=_(t||u(e,g));n&&p.beforeRouteStateSync?.(r,n),T(x,r)}if(!g)return l(e=>{if(e?.route){E(void 0,e.route,e);return}if(e?.url){E(void 0,b(e.url,x.path),e);return}if(e?.page){E(void 0,d(e.page),e);return}E(void 0,void 0,e)}),{route:t(x)};let D=g,O=C(D),k=S(O)||n().includes(O);i(e=>{E(e)}),a(()=>{E()}),s(()=>{E()}),o(()=>{E()});let A=l(e=>{if(w(D,k,e)){if(e?.route){E(void 0,e.route,e);return}if(e?.url){E(void 0,b(e.url,x.path),e);return}if(e?.page){E(void 0,d(e.page),e);return}E(void 0,void 0,e)}});return c(()=>{A()}),{route:t(x)}}function D(e={}){return E(e).route}function O(){return v()}function k(){return _()}export{E as createRouteStateController,k as useNativePageRouter,O as useNativeRouter,D as useRoute};
package/dist/router.d.mts CHANGED
@@ -6,6 +6,10 @@ import { AddRoute, InitialNavigationMode, LocationQuery, LocationQueryRaw, Locat
6
6
  import { createRouter } from "./router/createRouter.mjs";
7
7
  import { createNavigationFailure, isNavigationFailure } from "./router/navigationCore.mjs";
8
8
  import { resolveRouteLocation } from "./router/resolve.mjs";
9
+ import { ScrollRestorationContext, ScrollRestorationController, ScrollRestorationHandle, ScrollRestorationOptions, ScrollRestorationRegistrationOptions, ScrollViewRestorationHandle, UseScrollRestorationOptions } from "./router/scrollRestoration/types.mjs";
10
+ import { usePageScrollRestoration, useScrollViewRestoration } from "./router/scrollRestoration/adapters.mjs";
11
+ import { createScrollRestoration } from "./router/scrollRestoration/controller.mjs";
12
+ import { useScrollRestoration } from "./router/scrollRestoration/index.mjs";
9
13
  import { UseRouteOptions, useNativePageRouter, useNativeRouter, useRoute } from "./router/useRoute.mjs";
10
14
  import { useRouter } from "./router/useRouter.mjs";
11
15
  import { StaticPageDeclaration, StaticPageDeclaration as StaticPageDeclaration$1, StaticRouteValue } from "@wevu/compiler/page-route";
@@ -22,4 +26,4 @@ export interface WevuNamedRouteMap {}
22
26
  */
23
27
  export declare function definePage(route: StaticPageDeclaration$1): void;
24
28
  //#endregion
25
- export { type AddRoute, type InitialNavigationMode, type LocationQuery, type LocationQueryRaw, type LocationQueryValue, type LocationQueryValueRaw, type NamedRouteRecord, type NamedRoutes, type NavigationAfterEach, type NavigationAfterEachContext, type NavigationErrorContext, type NavigationErrorHandler, type NavigationFailure, NavigationFailureType, type NavigationFailureTypeValue, type NavigationGuard, type NavigationGuardContext, type NavigationGuardResult, type NavigationMode, type NavigationRedirect, type RouteLocationNamedRaw, type RouteLocationNormalizedByName, type RouteLocationNormalizedLoaded, type RouteLocationRaw, type RouteLocationRedirectedFrom, type RouteMeta, type RouteParamValue, type RouteParamValueRaw, type RouteParams, type RouteParamsMode, type RouteParamsRaw, type RouteQueryParser, type RouteQueryStringifier, type RouteRecordInput, type RouteRecordMatched, type RouteRecordRaw, type RouteRecordRedirect, type RouterNavigateToOption, type RouterNavigation, type RouterReLaunchOption, type RouterRedirectToOption, type RouterResolve, type RouterSwitchTabOption, type SetupContextRouter, type StaticPageDeclaration, type StaticRouteValue, type TypedRouterTabBarUrl, type TypedRouterUrl, type UseRouteOptions, type UseRouterOptions, type WevuAutoRoute, type WevuBroadRouteMap, type WevuNamedRouteDefinition, type WevuNamedRouteMeta, type WevuNamedRoutePath, type WevuRouteName, type WevuTypedRouterRouteMap, createNavigationFailure, createRouter, isNavigationFailure, parseQuery, resolveRouteLocation, stringifyQuery, useNativePageRouter, useNativeRouter, useRoute, useRouter };
29
+ export { type AddRoute, type InitialNavigationMode, type LocationQuery, type LocationQueryRaw, type LocationQueryValue, type LocationQueryValueRaw, type NamedRouteRecord, type NamedRoutes, type NavigationAfterEach, type NavigationAfterEachContext, type NavigationErrorContext, type NavigationErrorHandler, type NavigationFailure, NavigationFailureType, type NavigationFailureTypeValue, type NavigationGuard, type NavigationGuardContext, type NavigationGuardResult, type NavigationMode, type NavigationRedirect, type RouteLocationNamedRaw, type RouteLocationNormalizedByName, type RouteLocationNormalizedLoaded, type RouteLocationRaw, type RouteLocationRedirectedFrom, type RouteMeta, type RouteParamValue, type RouteParamValueRaw, type RouteParams, type RouteParamsMode, type RouteParamsRaw, type RouteQueryParser, type RouteQueryStringifier, type RouteRecordInput, type RouteRecordMatched, type RouteRecordRaw, type RouteRecordRedirect, type RouterNavigateToOption, type RouterNavigation, type RouterReLaunchOption, type RouterRedirectToOption, type RouterResolve, type RouterSwitchTabOption, type ScrollRestorationContext, type ScrollRestorationController, type ScrollRestorationHandle, type ScrollRestorationOptions, type ScrollRestorationRegistrationOptions, type ScrollViewRestorationHandle, type SetupContextRouter, type StaticPageDeclaration, type StaticRouteValue, type TypedRouterTabBarUrl, type TypedRouterUrl, type UseRouteOptions, type UseRouterOptions, type UseScrollRestorationOptions, type WevuAutoRoute, type WevuBroadRouteMap, type WevuNamedRouteDefinition, type WevuNamedRouteMeta, type WevuNamedRoutePath, type WevuRouteName, type WevuTypedRouterRouteMap, createNavigationFailure, createRouter, createScrollRestoration, isNavigationFailure, parseQuery, resolveRouteLocation, stringifyQuery, useNativePageRouter, useNativeRouter, usePageScrollRestoration, useRoute, useRouter, useScrollRestoration, useScrollViewRestoration };
package/dist/router.mjs CHANGED
@@ -1 +1 @@
1
- import{parseQuery as e,stringifyQuery as t}from"./routerInternal/query.mjs";import{NavigationFailureType as n}from"./router/types.mjs";import{createNavigationFailure as r,isNavigationFailure as i}from"./router/navigationCore.mjs";import{resolveRouteLocation as a}from"./router/resolve.mjs";import{useNativePageRouter as o,useNativeRouter as s,useRoute as c}from"./router/useRoute.mjs";import{createRouter as l}from"./router/createRouter.mjs";import{useRouter as u}from"./router/useRouter.mjs";export{n as NavigationFailureType,r as createNavigationFailure,l as createRouter,i as isNavigationFailure,e as parseQuery,a as resolveRouteLocation,t as stringifyQuery,o as useNativePageRouter,s as useNativeRouter,c as useRoute,u as useRouter};
1
+ import{parseQuery as e,stringifyQuery as t}from"./routerInternal/query.mjs";import{NavigationFailureType as n}from"./router/types.mjs";import{createNavigationFailure as r,isNavigationFailure as i}from"./router/navigationCore.mjs";import{resolveRouteLocation as a}from"./router/resolve.mjs";import{useNativePageRouter as o,useNativeRouter as s,useRoute as c}from"./router/useRoute.mjs";import{createRouter as l}from"./router/createRouter.mjs";import{createScrollRestoration as u}from"./router/scrollRestoration/controller.mjs";import{useScrollRestoration as d}from"./router/scrollRestoration/index.mjs";import{usePageScrollRestoration as f,useScrollViewRestoration as p}from"./router/scrollRestoration/adapters.mjs";import{useRouter as m}from"./router/useRouter.mjs";export{n as NavigationFailureType,r as createNavigationFailure,l as createRouter,u as createScrollRestoration,i as isNavigationFailure,e as parseQuery,a as resolveRouteLocation,t as stringifyQuery,o as useNativePageRouter,s as useNativeRouter,f as usePageScrollRestoration,c as useRoute,m as useRouter,d as useScrollRestoration,p as useScrollViewRestoration};
@@ -1 +1 @@
1
- import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";import{getCurrentPageInstance as t}from"../runtime/register/component/lifecycle/platform.mjs";import{createAbsoluteRoutePath as n,resolvePath as r}from"./path.mjs";import{normalizeHash as i,normalizeQuery as a,parseQuery as o,stringifyQuery as s}from"./query.mjs";const c={parseQuery:o,stringifyQuery:s};function l(e,t=c){let n=e.indexOf(`#`),r=n>=0?e.slice(0,n):e,o=n>=0?i(e.slice(n+1)):``,s=r.indexOf(`?`);return s<0?{path:r,query:{},hash:o}:{path:r.slice(0,s),query:a(t.parseQuery(r.slice(s+1))),hash:o}}function u(e,t,a=``,o,c={},l=s){let u=r(e,``),d=l(t),f=n(u),p=i(a),m=d?`${f}?${d}`:f,h={path:u,fullPath:p?`${m}${p}`:m,query:t,hash:p,params:c};return o!==void 0&&(h.name=o),h}function d(e){return typeof(e==null?void 0:e.route)==`string`&&e.route.length>0||typeof(e==null?void 0:e.__route__)==`string`&&e.__route__.length>0}function f(n){let r=e();if(Array.isArray(r)&&r.length>0){let e=r[r.length-1];if(d(e))return e}let i=t();return d(i)?i:n}function p(e,t){var n;if(!e)return u(``,{});let r=typeof e.route==`string`?e.route:typeof e.__route__==`string`?e.__route__:``,i=t==null?(n=e.options)==null?{}:n:t;return u(r,a(i),``,void 0,{})}function m(e,t){return p(f(t),e)}export{u as createRouteLocation,l as parsePathInput,m as resolveCurrentRoute,p as resolvePageRoute};
1
+ import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";import{getCurrentPageInstance as t}from"../runtime/register/component/lifecycle/platform.mjs";import{createAbsoluteRoutePath as n,resolvePath as r}from"./path.mjs";import{normalizeHash as i,normalizeQuery as a,parseQuery as o,stringifyQuery as s}from"./query.mjs";const c={parseQuery:o,stringifyQuery:s};function l(e,t=c){let n=e.indexOf(`#`),r=n>=0?e.slice(0,n):e,o=n>=0?i(e.slice(n+1)):``,s=r.indexOf(`?`);return s<0?{path:r,query:{},hash:o}:{path:r.slice(0,s),query:a(t.parseQuery(r.slice(s+1))),hash:o}}function u(e,t,a=``,o,c={},l=s){let u=r(e,``),d=l(t),f=n(u),p=i(a),m=d?`${f}?${d}`:f,h={path:u,fullPath:p?`${m}${p}`:m,query:t,hash:p,params:c};return o!==void 0&&(h.name=o),h}function d(e){return typeof e?.route==`string`&&e.route.length>0||typeof e?.__route__==`string`&&e.__route__.length>0}function f(n){let r=e();if(Array.isArray(r)&&r.length>0){let e=r[r.length-1];if(d(e))return e}let i=t();return d(i)?i:n}function p(e,t){if(!e)return u(``,{});let n=typeof e.route==`string`?e.route:typeof e.__route__==`string`?e.__route__:``,r=t??e.options??{};return u(n,a(r),``,void 0,{})}function m(e,t){return p(f(t),e)}export{u as createRouteLocation,l as parsePathInput,m as resolveCurrentRoute,p as resolvePageRoute};
@@ -1 +1 @@
1
- import{normalizeRouteParams as e}from"./query.mjs";const t=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function n(e){var n;let r=t.exec(e);if(r)return{key:r[1],modifier:(n=r[2])==null?``:n}}function r(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function i(e){return encodeURIComponent(e)}function a(e){try{return decodeURIComponent(e)}catch(t){return e}}function o(e,t,a){let o=[],s=/* @__PURE__ */ new Set;for(let c of e.split(`/`)){if(!c)continue;let e=n(c);if(!e){o.push(c);continue}let l=r(t[e.key]);if(e.modifier===``){if(l.length!==1)throw Error(`Missing required param "${e.key}" for named route "${a}"`);s.add(e.key),o.push(i(l[0]));continue}if(e.modifier===`?`){if(l.length===0)continue;if(l.length>1)throw Error(`Param "${e.key}" for named route "${a}" must be a single value`);s.add(e.key),o.push(i(l[0]));continue}if(e.modifier===`+`){if(l.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${a}"`);s.add(e.key);for(let e of l)o.push(i(e));continue}l.length>0&&s.add(e.key);for(let e of l)o.push(i(e))}return{path:o.join(`/`),consumedKeys:s}}function s(e){return e===void 0?!1:!Array.isArray(e)||e.length>0}function c(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>s(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function l(t,n,r){let i=t.name;if(typeof i!=`string`||!i||t.path!==void 0||t.fullPath!==void 0)return t;let a=n.recordByName.get(i);if(!a)throw Error(`Named route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let s=t.params?e(t.params):{},l=o(a.path,s,i);return r===`strict`&&c(s,l.consumedKeys,i),{...t,path:l.path?`/${l.path}`:`/`,params:s}}export{a as decodeRouteParamSegment,n as parsePathParamToken,l as resolveNamedRouteLocation};
1
+ import{normalizeRouteParams as e}from"./query.mjs";const t=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function n(e){let n=t.exec(e);if(n)return{key:n[1],modifier:n[2]??``}}function r(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function i(e){return encodeURIComponent(e)}function a(e){try{return decodeURIComponent(e)}catch{return e}}function o(e,t,a){let o=[],s=/* @__PURE__ */ new Set;for(let c of e.split(`/`)){if(!c)continue;let e=n(c);if(!e){o.push(c);continue}let l=r(t[e.key]);if(e.modifier===``){if(l.length!==1)throw Error(`Missing required param "${e.key}" for named route "${a}"`);s.add(e.key),o.push(i(l[0]));continue}if(e.modifier===`?`){if(l.length===0)continue;if(l.length>1)throw Error(`Param "${e.key}" for named route "${a}" must be a single value`);s.add(e.key),o.push(i(l[0]));continue}if(e.modifier===`+`){if(l.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${a}"`);s.add(e.key);for(let e of l)o.push(i(e));continue}l.length>0&&s.add(e.key);for(let e of l)o.push(i(e))}return{path:o.join(`/`),consumedKeys:s}}function s(e){return e===void 0?!1:!Array.isArray(e)||e.length>0}function c(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>s(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function l(t,n,r){let i=t.name;if(typeof i!=`string`||!i||t.path!==void 0||t.fullPath!==void 0)return t;let a=n.recordByName.get(i);if(!a)throw Error(`Named route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let s=t.params?e(t.params):{},l=o(a.path,s,i);return r===`strict`&&c(s,l.consumedKeys,i),{...t,path:l.path?`/${l.path}`:`/`,params:s}}export{a as decodeRouteParamSegment,n as parsePathParamToken,l as resolveNamedRouteLocation};
@@ -1 +1 @@
1
- import{createAbsoluteRoutePath as e,isDynamicRoutePath as t,resolvePath as n}from"./path.mjs";import{warnRouteConfig as r}from"./recordsWarnings.mjs";function i(e){return e?Array.isArray(e)?e:[e]:[]}function a(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function o(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){if(typeof e!=`string`)continue;let r=n(e,``);r&&r!==t&&(i.includes(r)||i.push(r))}return i}function s(e,t,r=`namedRoutes`){let s=n(e.path,``);if(!s&&e.path!==`/`)return;let c=a(e,s,r);if(c)return{name:c,path:s,aliasPaths:o(e.alias,s),parentName:t,meta:e.meta,beforeEnterGuards:i(e.beforeEnter),redirect:e.redirect}}function c(t,r){return!r||t.startsWith(`/`)?n(t,``):n(`${e(r)}/${t}`,``)}function l(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function u(e){let t=[];for(let n of e)n&&!t.includes(n)&&t.push(n);return t}function d(t){if(t.length!==0)return t.length===1?e(t[0]):t.map(t=>e(t))}function f(t,n,i,o=[],s,p=`namedRoutes`,m=/* @__PURE__ */ new Set){let h=[];for(let[g,_]of t.entries()){let t=`${p}[${g}]`;if(m.has(_)){r(`ignored route record at ${t}: detected circular children reference`);continue}if(typeof _.path!=`string`||!_.path){let e=typeof(_==null?void 0:_.name)==`string`?_.name.trim():``;r(`ignored route record "${e}" at ${t}: route path is required`);continue}let v=c(_.path,n),y=a(_,v,s);if(!y){r(`ignored route record at ${t}: route name is required`);continue}let b=[],x=/* @__PURE__ */ new Map;for(let i of l(_.alias)){let a=c(i,n);if(!a)continue;if(a===v){r(`ignored alias "${e(a)}" for route "${y}" at ${t}: alias is same as route path`);continue}let o=x.get(a);if(o){r(`ignored duplicate alias "${e(a)}" for route "${y}" at ${t}: already declared by "${o}"`);continue}x.set(a,i),b.push(a)}let S=_.path.startsWith(`/`)?[]:o.map(e=>c(_.path,e)).filter(Boolean).filter(e=>e!==v),C=u([...b,...S]),w={name:y,path:v?e(v):`/`,alias:d(C),meta:_.meta,beforeEnter:_.beforeEnter,redirect:_.redirect};if(h.push({route:w,parentName:i,source:s}),Array.isArray(_.children)&&_.children.length>0){let e=new Set(m);e.add(_),h.push(...f(_.children,v,y,C,s,`${t}.children`,e))}}return h}function p(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return f(e,void 0,void 0,[],t,t);let n=[];for(let[i,a]of Object.entries(e)){let e=typeof i==`string`?i.trim():``;if(!e){r(`ignored route record at ${t}: route name is required`);continue}if(typeof a!=`string`||!a){r(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:a},source:t})}return n}function m(e){return[...p(e.routes,`routes`),...p(e.namedRoutes,`namedRoutes`)]}function h(e){let n=/* @__PURE__ */ new Map;for(let[r,i]of e.entries()){!t(i.path)&&!n.has(i.path)&&n.set(i.path,r);for(let e of i.aliasPaths)!t(e)&&!n.has(e)&&n.set(e,r)}return n}function g(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=s(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:h(t)}}export{g as createNamedRouteLookup,h as createNamedRouteNameByStaticPath,d as createRouteRecordAliasValue,f as flattenNamedRouteRecords,s as normalizeRouteRecordRaw,m as resolveRouteOptionEntries};
1
+ import{createAbsoluteRoutePath as e,isDynamicRoutePath as t,resolvePath as n}from"./path.mjs";import{warnRouteConfig as r}from"./recordsWarnings.mjs";function i(e){return e?Array.isArray(e)?e:[e]:[]}function a(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function o(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){if(typeof e!=`string`)continue;let r=n(e,``);r&&r!==t&&(i.includes(r)||i.push(r))}return i}function s(e,t,r=`namedRoutes`){let s=n(e.path,``);if(!s&&e.path!==`/`)return;let c=a(e,s,r);if(c)return{name:c,path:s,aliasPaths:o(e.alias,s),parentName:t,meta:e.meta,beforeEnterGuards:i(e.beforeEnter),redirect:e.redirect}}function c(t,r){return!r||t.startsWith(`/`)?n(t,``):n(`${e(r)}/${t}`,``)}function l(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function u(e){let t=[];for(let n of e)n&&!t.includes(n)&&t.push(n);return t}function d(t){if(t.length!==0)return t.length===1?e(t[0]):t.map(t=>e(t))}function f(t,n,i,o=[],s,p=`namedRoutes`,m=/* @__PURE__ */ new Set){let h=[];for(let[g,_]of t.entries()){let t=`${p}[${g}]`;if(m.has(_)){r(`ignored route record at ${t}: detected circular children reference`);continue}if(typeof _.path!=`string`||!_.path){let e=typeof _?.name==`string`?_.name.trim():``;r(`ignored route record "${e}" at ${t}: route path is required`);continue}let v=c(_.path,n),y=a(_,v,s);if(!y){r(`ignored route record at ${t}: route name is required`);continue}let b=[],x=/* @__PURE__ */ new Map;for(let i of l(_.alias)){let a=c(i,n);if(!a)continue;if(a===v){r(`ignored alias "${e(a)}" for route "${y}" at ${t}: alias is same as route path`);continue}let o=x.get(a);if(o){r(`ignored duplicate alias "${e(a)}" for route "${y}" at ${t}: already declared by "${o}"`);continue}x.set(a,i),b.push(a)}let S=_.path.startsWith(`/`)?[]:o.map(e=>c(_.path,e)).filter(Boolean).filter(e=>e!==v),C=u([...b,...S]),w={name:y,path:v?e(v):`/`,alias:d(C),meta:_.meta,beforeEnter:_.beforeEnter,redirect:_.redirect};if(h.push({route:w,parentName:i,source:s}),Array.isArray(_.children)&&_.children.length>0){let e=new Set(m);e.add(_),h.push(...f(_.children,v,y,C,s,`${t}.children`,e))}}return h}function p(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return f(e,void 0,void 0,[],t,t);let n=[];for(let[i,a]of Object.entries(e)){let e=typeof i==`string`?i.trim():``;if(!e){r(`ignored route record at ${t}: route name is required`);continue}if(typeof a!=`string`||!a){r(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:a},source:t})}return n}function m(e){return[...p(e.routes,`routes`),...p(e.namedRoutes,`namedRoutes`)]}function h(e){let n=/* @__PURE__ */ new Map;for(let[r,i]of e.entries()){!t(i.path)&&!n.has(i.path)&&n.set(i.path,r);for(let e of i.aliasPaths)!t(e)&&!n.has(e)&&n.set(e,r)}return n}function g(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=s(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:h(t)}}export{g as createNamedRouteLookup,h as createNamedRouteNameByStaticPath,d as createRouteRecordAliasValue,f as flattenNamedRouteRecords,s as normalizeRouteRecordRaw,m as resolveRouteOptionEntries};
@@ -1 +1 @@
1
- import{createAbsoluteRoutePath as e,resolvePath as t}from"./path.mjs";function n(e){typeof console<`u`&&typeof console.warn==`function`&&console.warn(`[wevu/router] ${e}`)}function r(n){let r=t(n,``);return r?e(r):`/`}function i(e,t=/* @__PURE__ */ new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(i(t,n))return!0;return!1}function a(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(i(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function o(e){let t=/* @__PURE__ */ new Map,i=[];for(let n of e){var a;let e=typeof n.route.name==`string`?n.route.name.trim():``;if(!e)continue;let o=(a=n.source)==null?`namedRoutes`:a,s=r(n.route.path),c=t.get(e);c&&i.push(`"${e}" (${c.source}:${c.path} -> ${o}:${s})`),t.set(e,{source:o,path:s})}i.length!==0&&n(`duplicate route names detected, later entries override earlier ones: ${i.join(`, `)}`)}export{a as assertValidAddRouteInput,o as warnDuplicateRouteEntries,n as warnRouteConfig};
1
+ import{createAbsoluteRoutePath as e,resolvePath as t}from"./path.mjs";function n(e){typeof console<`u`&&typeof console.warn==`function`&&console.warn(`[wevu/router] ${e}`)}function r(n){let r=t(n,``);return r?e(r):`/`}function i(e,t=/* @__PURE__ */ new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(i(t,n))return!0;return!1}function a(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(i(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function o(e){let t=/* @__PURE__ */ new Map,i=[];for(let n of e){let e=typeof n.route.name==`string`?n.route.name.trim():``;if(!e)continue;let a=n.source??`namedRoutes`,o=r(n.route.path),s=t.get(e);s&&i.push(`"${e}" (${s.source}:${s.path} -> ${a}:${o})`),t.set(e,{source:a,path:o})}i.length!==0&&n(`duplicate route names detected, later entries override earlier ones: ${i.join(`, `)}`)}export{a as assertValidAddRouteInput,o as warnDuplicateRouteEntries,n as warnRouteConfig};