wevu 7.2.1 → 7.3.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 (466) 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/api/vitest/setup.d.mts +1 -0
  7. package/dist/dev/api/vitest.d.mts +1 -0
  8. package/dist/dev/api.d.mts +1 -0
  9. package/dist/dev/compiler.d.mts +1 -0
  10. package/dist/dev/fetch.d.mts +9 -0
  11. package/dist/dev/index.d.mts +72 -0
  12. package/dist/dev/internal-reactivity.d.mts +18 -0
  13. package/dist/dev/internal-runtime.d.mts +45 -0
  14. package/dist/dev/internal-runtime.mjs +3 -2
  15. package/dist/dev/internal-template.d.mts +2 -0
  16. package/dist/dev/jsxTypes.d.mts +9 -0
  17. package/dist/dev/macros/shared.d.mts +83 -0
  18. package/dist/dev/macros.d.mts +71 -0
  19. package/dist/dev/package.mjs +1 -1
  20. package/dist/dev/reactivity/asyncDerivation.d.mts +41 -0
  21. package/dist/dev/reactivity/asyncDerivation.mjs +8 -10
  22. package/dist/dev/reactivity/asyncDerivation.mjs.map +1 -1
  23. package/dist/dev/reactivity/computed.d.mts +25 -0
  24. package/dist/dev/reactivity/core.d.mts +35 -0
  25. package/dist/dev/reactivity/core.mjs +5 -8
  26. package/dist/dev/reactivity/core.mjs.map +1 -1
  27. package/dist/dev/reactivity/index.d.mts +16 -0
  28. package/dist/dev/reactivity/reactive/mutation.d.mts +21 -0
  29. package/dist/dev/reactivity/reactive/patch.d.mts +18 -0
  30. package/dist/dev/reactivity/reactive/patch.mjs +3 -3
  31. package/dist/dev/reactivity/reactive/patch.mjs.map +1 -1
  32. package/dist/dev/reactivity/reactive/patchState.mjs +4 -8
  33. package/dist/dev/reactivity/reactive/patchState.mjs.map +1 -1
  34. package/dist/dev/reactivity/reactive/shallow.d.mts +22 -0
  35. package/dist/dev/reactivity/reactive/shared.d.mts +4 -0
  36. package/dist/dev/reactivity/reactive/shared.mjs +1 -2
  37. package/dist/dev/reactivity/reactive/shared.mjs.map +1 -1
  38. package/dist/dev/reactivity/reactive.d.mts +42 -0
  39. package/dist/dev/reactivity/reactive.mjs +5 -10
  40. package/dist/dev/reactivity/reactive.mjs.map +1 -1
  41. package/dist/dev/reactivity/readonly.d.mts +27 -0
  42. package/dist/dev/reactivity/ref.d.mts +27 -0
  43. package/dist/dev/reactivity/ref.mjs +2 -2
  44. package/dist/dev/reactivity/ref.mjs.map +1 -1
  45. package/dist/dev/reactivity/shallowRef.d.mts +19 -0
  46. package/dist/dev/reactivity/shallowRef.mjs +1 -1
  47. package/dist/dev/reactivity/shallowRef.mjs.map +1 -1
  48. package/dist/dev/reactivity/toRefs.d.mts +43 -0
  49. package/dist/dev/reactivity/traverse.d.mts +8 -0
  50. package/dist/dev/reactivity/watch/helpers.mjs +1 -1
  51. package/dist/dev/reactivity/watch/helpers.mjs.map +1 -1
  52. package/dist/dev/reactivity/watch/types.d.mts +43 -0
  53. package/dist/dev/reactivity/watch.d.mts +22 -0
  54. package/dist/dev/reactivity/watch.mjs +6 -8
  55. package/dist/dev/reactivity/watch.mjs.map +1 -1
  56. package/dist/dev/router/auto-routes.d.mts +8 -0
  57. package/dist/dev/router/createRouter.d.mts +9 -0
  58. package/dist/dev/router/createRouter.mjs +17 -24
  59. package/dist/dev/router/createRouter.mjs.map +1 -1
  60. package/dist/dev/router/initialNavigation.mjs +18 -16
  61. package/dist/dev/router/initialNavigation.mjs.map +1 -1
  62. package/dist/dev/router/instance.mjs +1 -2
  63. package/dist/dev/router/instance.mjs.map +1 -1
  64. package/dist/dev/router/navigationCore.d.mts +7 -0
  65. package/dist/dev/router/navigationCore.mjs +2 -2
  66. package/dist/dev/router/navigationCore.mjs.map +1 -1
  67. package/dist/dev/router/navigationResult.mjs +7 -10
  68. package/dist/dev/router/navigationResult.mjs.map +1 -1
  69. package/dist/dev/router/navigationTarget.mjs +1 -3
  70. package/dist/dev/router/navigationTarget.mjs.map +1 -1
  71. package/dist/dev/router/resolve.d.mts +7 -0
  72. package/dist/dev/router/resolve.mjs +3 -4
  73. package/dist/dev/router/resolve.mjs.map +1 -1
  74. package/dist/dev/router/routeRegistry.mjs +1 -1
  75. package/dist/dev/router/routeRegistry.mjs.map +1 -1
  76. package/dist/dev/router/routeSync.d.mts +2 -0
  77. package/dist/dev/router/routeSync.mjs +1 -1
  78. package/dist/dev/router/routeSync.mjs.map +1 -1
  79. package/dist/dev/router/types.d.mts +267 -0
  80. package/dist/dev/router/useRoute.d.mts +20 -0
  81. package/dist/dev/router/useRoute.mjs +12 -19
  82. package/dist/dev/router/useRoute.mjs.map +1 -1
  83. package/dist/dev/router/useRouter.d.mts +9 -0
  84. package/dist/dev/router.d.mts +26 -0
  85. package/dist/dev/routerInternal/location.d.mts +2 -0
  86. package/dist/dev/routerInternal/location.mjs +2 -3
  87. package/dist/dev/routerInternal/location.mjs.map +1 -1
  88. package/dist/dev/routerInternal/matching.d.mts +2 -0
  89. package/dist/dev/routerInternal/params.d.mts +2 -0
  90. package/dist/dev/routerInternal/params.mjs +2 -3
  91. package/dist/dev/routerInternal/params.mjs.map +1 -1
  92. package/dist/dev/routerInternal/query.d.mts +7 -0
  93. package/dist/dev/routerInternal/records.d.mts +2 -0
  94. package/dist/dev/routerInternal/records.mjs +1 -1
  95. package/dist/dev/routerInternal/records.mjs.map +1 -1
  96. package/dist/dev/routerInternal/recordsWarnings.d.mts +2 -0
  97. package/dist/dev/routerInternal/recordsWarnings.mjs +1 -2
  98. package/dist/dev/routerInternal/recordsWarnings.mjs.map +1 -1
  99. package/dist/dev/routerInternal/shared.d.mts +9 -0
  100. package/dist/dev/routerInternal/snapshots.d.mts +2 -0
  101. package/dist/dev/routerInternal/types.d.mts +9 -0
  102. package/dist/dev/runtime/app/context.mjs +13 -26
  103. package/dist/dev/runtime/app/context.mjs.map +1 -1
  104. package/dist/dev/runtime/app/diagnostics.mjs +2 -4
  105. package/dist/dev/runtime/app/diagnostics.mjs.map +1 -1
  106. package/dist/dev/runtime/app/mount.mjs +27 -33
  107. package/dist/dev/runtime/app/mount.mjs.map +1 -1
  108. package/dist/dev/runtime/app/pending.d.mts +10 -0
  109. package/dist/dev/runtime/app/setData/commitTracker.d.mts +13 -0
  110. package/dist/dev/runtime/app/setData/commitTracker.mjs +5 -9
  111. package/dist/dev/runtime/app/setData/commitTracker.mjs.map +1 -1
  112. package/dist/dev/runtime/app/setData/patchScheduler.mjs +2 -4
  113. package/dist/dev/runtime/app/setData/patchScheduler.mjs.map +1 -1
  114. package/dist/dev/runtime/app/setData/payload.mjs +2 -3
  115. package/dist/dev/runtime/app/setData/payload.mjs.map +1 -1
  116. package/dist/dev/runtime/app/setData/scheduler.d.mts +51 -0
  117. package/dist/dev/runtime/app/setData/scheduler.mjs +7 -9
  118. package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -1
  119. package/dist/dev/runtime/app/setData/snapshot.mjs +5 -6
  120. package/dist/dev/runtime/app/setData/snapshot.mjs.map +1 -1
  121. package/dist/dev/runtime/app/setDataOptions.mjs +26 -27
  122. package/dist/dev/runtime/app/setDataOptions.mjs.map +1 -1
  123. package/dist/dev/runtime/app.d.mts +8 -0
  124. package/dist/dev/runtime/app.mjs +9 -9
  125. package/dist/dev/runtime/app.mjs.map +1 -1
  126. package/dist/dev/runtime/bindingManifest.mjs +6 -14
  127. package/dist/dev/runtime/bindingManifest.mjs.map +1 -1
  128. package/dist/dev/runtime/capabilities.d.mts +78 -0
  129. package/dist/dev/runtime/capabilities.mjs.map +1 -1
  130. package/dist/dev/runtime/css.d.mts +14 -0
  131. package/dist/dev/runtime/css.mjs +4 -8
  132. package/dist/dev/runtime/css.mjs.map +1 -1
  133. package/dist/dev/runtime/defaults.d.mts +12 -0
  134. package/dist/dev/runtime/defaults.mjs +4 -4
  135. package/dist/dev/runtime/defaults.mjs.map +1 -1
  136. package/dist/dev/runtime/define/initialComputed.mjs +5 -5
  137. package/dist/dev/runtime/define/initialComputed.mjs.map +1 -1
  138. package/dist/dev/runtime/define/options.mjs +10 -12
  139. package/dist/dev/runtime/define/options.mjs.map +1 -1
  140. package/dist/dev/runtime/define/props.mjs +4 -5
  141. package/dist/dev/runtime/define/props.mjs.map +1 -1
  142. package/dist/dev/runtime/define/scopedSlotOptions.mjs +43 -61
  143. package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
  144. package/dist/dev/runtime/define/setupResult.mjs +17 -28
  145. package/dist/dev/runtime/define/setupResult.mjs.map +1 -1
  146. package/dist/dev/runtime/define.d.mts +118 -0
  147. package/dist/dev/runtime/define.mjs +9 -12
  148. package/dist/dev/runtime/define.mjs.map +1 -1
  149. package/dist/dev/runtime/diff.mjs +9 -11
  150. package/dist/dev/runtime/diff.mjs.map +1 -1
  151. package/dist/dev/runtime/disposables.d.mts +31 -0
  152. package/dist/dev/runtime/disposables.mjs +2 -2
  153. package/dist/dev/runtime/disposables.mjs.map +1 -1
  154. package/dist/dev/runtime/elementIntersectionObserver.d.mts +26 -0
  155. package/dist/dev/runtime/elementIntersectionObserver.mjs +16 -24
  156. package/dist/dev/runtime/elementIntersectionObserver.mjs.map +1 -1
  157. package/dist/dev/runtime/features/inlineEvents.d.mts +7 -0
  158. package/dist/dev/runtime/features/inlineEvents.mjs +2 -3
  159. package/dist/dev/runtime/features/inlineEvents.mjs.map +1 -1
  160. package/dist/dev/runtime/features/jsxIslands.d.mts +7 -0
  161. package/dist/dev/runtime/features/jsxIslands.mjs +20 -0
  162. package/dist/dev/runtime/features/jsxIslands.mjs.map +1 -0
  163. package/dist/dev/runtime/features/layout.d.mts +7 -0
  164. package/dist/dev/runtime/features/layout.mjs +2 -3
  165. package/dist/dev/runtime/features/layout.mjs.map +1 -1
  166. package/dist/dev/runtime/features/patchStrategy.d.mts +7 -0
  167. package/dist/dev/runtime/features/publicLayout.d.mts +24 -0
  168. package/dist/dev/runtime/features/publicLayout.mjs +2 -6
  169. package/dist/dev/runtime/features/publicLayout.mjs.map +1 -1
  170. package/dist/dev/runtime/features/scopedSlots.d.mts +23 -0
  171. package/dist/dev/runtime/features/scopedSlots.mjs +5 -9
  172. package/dist/dev/runtime/features/scopedSlots.mjs.map +1 -1
  173. package/dist/dev/runtime/features/setDataHighFrequencyWarning.d.mts +7 -0
  174. package/dist/dev/runtime/features/templateRefs.d.mts +7 -0
  175. package/dist/dev/runtime/features/templateRefs.mjs +1 -1
  176. package/dist/dev/runtime/features/templateRefs.mjs.map +1 -1
  177. package/dist/dev/runtime/hooks/base.d.mts +27 -0
  178. package/dist/dev/runtime/hooks/base.mjs +21 -32
  179. package/dist/dev/runtime/hooks/base.mjs.map +1 -1
  180. package/dist/dev/runtime/hooks/register.d.mts +30 -0
  181. package/dist/dev/runtime/hooks/vue.d.mts +52 -0
  182. package/dist/dev/runtime/hooks.d.mts +4 -0
  183. package/dist/dev/runtime/index.d.mts +46 -0
  184. package/dist/dev/runtime/inlineDataset.mjs +1 -2
  185. package/dist/dev/runtime/inlineDataset.mjs.map +1 -1
  186. package/dist/dev/runtime/intersectionObserver.d.mts +14 -0
  187. package/dist/dev/runtime/intersectionObserver.mjs +6 -6
  188. package/dist/dev/runtime/intersectionObserver.mjs.map +1 -1
  189. package/dist/dev/runtime/jsxIsland.d.mts +37 -0
  190. package/dist/dev/runtime/jsxIsland.mjs +16 -33
  191. package/dist/dev/runtime/jsxIsland.mjs.map +1 -1
  192. package/dist/dev/runtime/layoutBridge.d.mts +55 -0
  193. package/dist/dev/runtime/layoutBridge.mjs +32 -62
  194. package/dist/dev/runtime/layoutBridge.mjs.map +1 -1
  195. package/dist/dev/runtime/nativeBridge.mjs +1 -1
  196. package/dist/dev/runtime/nativeBridge.mjs.map +1 -1
  197. package/dist/dev/runtime/navigationLifecycle.mjs +24 -0
  198. package/dist/dev/runtime/navigationLifecycle.mjs.map +1 -0
  199. package/dist/dev/runtime/noSetData.d.mts +5 -0
  200. package/dist/dev/runtime/pageEnvironment.d.mts +50 -0
  201. package/dist/dev/runtime/pageEnvironment.mjs +15 -18
  202. package/dist/dev/runtime/pageEnvironment.mjs.map +1 -1
  203. package/dist/dev/runtime/pageLayout.d.mts +25 -0
  204. package/dist/dev/runtime/pageLayout.mjs +7 -11
  205. package/dist/dev/runtime/pageLayout.mjs.map +1 -1
  206. package/dist/dev/runtime/pageScroll.d.mts +29 -0
  207. package/dist/dev/runtime/pageScroll.mjs +2 -3
  208. package/dist/dev/runtime/pageScroll.mjs.map +1 -1
  209. package/dist/dev/runtime/platform/current.mjs +12 -0
  210. package/dist/dev/runtime/platform/current.mjs.map +1 -0
  211. package/dist/dev/runtime/platform/generic.mjs +36 -0
  212. package/dist/dev/runtime/platform/generic.mjs.map +1 -0
  213. package/dist/dev/runtime/platform/globals.mjs +29 -0
  214. package/dist/dev/runtime/platform/globals.mjs.map +1 -0
  215. package/dist/dev/runtime/platform.mjs +15 -60
  216. package/dist/dev/runtime/platform.mjs.map +1 -1
  217. package/dist/dev/runtime/provide.d.mts +60 -0
  218. package/dist/dev/runtime/provideContext.mjs +7 -9
  219. package/dist/dev/runtime/provideContext.mjs.map +1 -1
  220. package/dist/dev/runtime/provideStore.d.mts +7 -0
  221. package/dist/dev/runtime/publicRuntime.d.mts +22 -0
  222. package/dist/dev/runtime/publicRuntime.mjs +4 -0
  223. package/dist/dev/runtime/publicRuntime.mjs.map +1 -1
  224. package/dist/dev/runtime/pullDownRefresh.d.mts +12 -0
  225. package/dist/dev/runtime/pullDownRefresh.mjs +2 -4
  226. package/dist/dev/runtime/pullDownRefresh.mjs.map +1 -1
  227. package/dist/dev/runtime/register/app.d.mts +14 -0
  228. package/dist/dev/runtime/register/app.mjs +18 -19
  229. package/dist/dev/runtime/register/app.mjs.map +1 -1
  230. package/dist/dev/runtime/register/component/alipay.mjs +9 -18
  231. package/dist/dev/runtime/register/component/alipay.mjs.map +1 -1
  232. package/dist/dev/runtime/register/component/alipayRegistration.mjs +60 -0
  233. package/dist/dev/runtime/register/component/alipayRegistration.mjs.map +1 -0
  234. package/dist/dev/runtime/register/component/lifecycle/platform.mjs +8 -9
  235. package/dist/dev/runtime/register/component/lifecycle/platform.mjs.map +1 -1
  236. package/dist/dev/runtime/register/component/lifecycle.mjs +7 -12
  237. package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -1
  238. package/dist/dev/runtime/register/component/methods.mjs +13 -18
  239. package/dist/dev/runtime/register/component/methods.mjs.map +1 -1
  240. package/dist/dev/runtime/register/component/options.mjs +3 -4
  241. package/dist/dev/runtime/register/component/options.mjs.map +1 -1
  242. package/dist/dev/runtime/register/component/props.mjs +25 -31
  243. package/dist/dev/runtime/register/component/props.mjs.map +1 -1
  244. package/dist/dev/runtime/register/component/registerDefinition.mjs +18 -40
  245. package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
  246. package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +18 -60
  247. package/dist/dev/runtime/register/component/registerNativeDefinition.mjs.map +1 -1
  248. package/dist/dev/runtime/register/component.d.mts +17 -0
  249. package/dist/dev/runtime/register/component.mjs +3 -5
  250. package/dist/dev/runtime/register/component.mjs.map +1 -1
  251. package/dist/dev/runtime/register/inline.d.mts +15 -0
  252. package/dist/dev/runtime/register/inline.mjs +8 -10
  253. package/dist/dev/runtime/register/inline.mjs.map +1 -1
  254. package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +7 -8
  255. package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs.map +1 -1
  256. package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +1 -1
  257. package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs.map +1 -1
  258. package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +25 -34
  259. package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -1
  260. package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +6 -13
  261. package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
  262. package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +2 -2
  263. package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs.map +1 -1
  264. package/dist/dev/runtime/register/runtimeInstance/utils.mjs +9 -9
  265. package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -1
  266. package/dist/dev/runtime/register/runtimeInstance.d.mts +26 -0
  267. package/dist/dev/runtime/register/runtimeInstance.mjs +74 -100
  268. package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
  269. package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +12 -15
  270. package/dist/dev/runtime/register/setDataFrequencyWarning.mjs.map +1 -1
  271. package/dist/dev/runtime/register/setup.d.mts +11 -0
  272. package/dist/dev/runtime/register/setup.mjs +2 -3
  273. package/dist/dev/runtime/register/setup.mjs.map +1 -1
  274. package/dist/dev/runtime/register/snapshot.mjs +1 -4
  275. package/dist/dev/runtime/register/snapshot.mjs.map +1 -1
  276. package/dist/dev/runtime/register/watch.d.mts +12 -0
  277. package/dist/dev/runtime/register/watch.mjs +3 -5
  278. package/dist/dev/runtime/register/watch.mjs.map +1 -1
  279. package/dist/dev/runtime/register.d.mts +5 -0
  280. package/dist/dev/runtime/scopedSlots.mjs +14 -21
  281. package/dist/dev/runtime/scopedSlots.mjs.map +1 -1
  282. package/dist/dev/runtime/selectorQuery.d.mts +54 -0
  283. package/dist/dev/runtime/selectorQuery.mjs +5 -9
  284. package/dist/dev/runtime/selectorQuery.mjs.map +1 -1
  285. package/dist/dev/runtime/template.d.mts +6 -0
  286. package/dist/dev/runtime/template.mjs +1 -1
  287. package/dist/dev/runtime/template.mjs.map +1 -1
  288. package/dist/dev/runtime/templateRefTypes.d.mts +12 -0
  289. package/dist/dev/runtime/templateRefs/helpers.mjs +14 -24
  290. package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -1
  291. package/dist/dev/runtime/templateRefs.mjs +8 -15
  292. package/dist/dev/runtime/templateRefs.mjs.map +1 -1
  293. package/dist/dev/runtime/types/core.d.mts +35 -0
  294. package/dist/dev/runtime/types/miniprogram.d.mts +84 -0
  295. package/dist/dev/runtime/types/miniprogramHost.d.mts +45 -0
  296. package/dist/dev/runtime/types/miniprogramHostSources.d.mts +112 -0
  297. package/dist/dev/runtime/types/options.d.mts +138 -0
  298. package/dist/dev/runtime/types/props/propTypes.d.mts +79 -0
  299. package/dist/dev/runtime/types/props/router.d.mts +51 -0
  300. package/dist/dev/runtime/types/props/setup.d.mts +96 -0
  301. package/dist/dev/runtime/types/props.d.mts +4 -0
  302. package/dist/dev/runtime/types/runtime.d.mts +59 -0
  303. package/dist/dev/runtime/types/setData.d.mts +237 -0
  304. package/dist/dev/runtime/types.d.mts +29 -0
  305. package/dist/dev/runtime/uniAppHost.d.mts +8 -0
  306. package/dist/dev/runtime/uniAppHost.mjs +6 -14
  307. package/dist/dev/runtime/uniAppHost.mjs.map +1 -1
  308. package/dist/dev/runtime/updatePerformance.d.mts +13 -0
  309. package/dist/dev/runtime/updatePerformance.mjs +1 -1
  310. package/dist/dev/runtime/updatePerformance.mjs.map +1 -1
  311. package/dist/dev/runtime/use.d.mts +13 -0
  312. package/dist/dev/runtime/use.mjs +1 -1
  313. package/dist/dev/runtime/use.mjs.map +1 -1
  314. package/dist/dev/runtime/vueCompat/context.d.mts +8 -0
  315. package/dist/dev/runtime/vueCompat/context.mjs +3 -5
  316. package/dist/dev/runtime/vueCompat/context.mjs.map +1 -1
  317. package/dist/dev/runtime/vueCompat/model.d.mts +30 -0
  318. package/dist/dev/runtime/vueCompat/model.mjs +9 -13
  319. package/dist/dev/runtime/vueCompat/model.mjs.map +1 -1
  320. package/dist/dev/runtime/vueCompat/router.d.mts +29 -0
  321. package/dist/dev/runtime/vueCompat/router.mjs +4 -4
  322. package/dist/dev/runtime/vueCompat/router.mjs.map +1 -1
  323. package/dist/dev/runtime/vueCompat/templateRef.d.mts +9 -0
  324. package/dist/dev/runtime/vueCompat/templateRef.mjs +1 -1
  325. package/dist/dev/runtime/vueCompat/templateRef.mjs.map +1 -1
  326. package/dist/dev/runtime/vueCompat.d.mts +5 -0
  327. package/dist/dev/scheduler.d.mts +4 -0
  328. package/dist/dev/scheduler.mjs +3 -4
  329. package/dist/dev/scheduler.mjs.map +1 -1
  330. package/dist/dev/store/base.mjs +1 -2
  331. package/dist/dev/store/base.mjs.map +1 -1
  332. package/dist/dev/store/define/create.mjs +11 -22
  333. package/dist/dev/store/define/create.mjs.map +1 -1
  334. package/dist/dev/store/define.d.mts +8 -0
  335. package/dist/dev/store/define.mjs +1 -1
  336. package/dist/dev/store/define.mjs.map +1 -1
  337. package/dist/dev/store/manager.d.mts +16 -0
  338. package/dist/dev/store/storeToRefs.d.mts +11 -0
  339. package/dist/dev/store/types.d.mts +106 -0
  340. package/dist/dev/store/view.mjs +1 -1
  341. package/dist/dev/store/view.mjs.map +1 -1
  342. package/dist/dev/store.d.mts +5 -0
  343. package/dist/dev/version.d.mts +4 -0
  344. package/dist/dev/vue-augment.d.mts +8 -0
  345. package/dist/dev/vue-demi.d.mts +87 -0
  346. package/dist/dev/vue-types.d.mts +19 -0
  347. package/dist/dev/web-apis.d.mts +3 -0
  348. package/dist/internal-runtime.d.mts +2 -1
  349. package/dist/internal-runtime.mjs +1 -1
  350. package/dist/package.mjs +1 -1
  351. package/dist/reactivity/asyncDerivation.mjs +1 -1
  352. package/dist/reactivity/core.mjs +1 -1
  353. package/dist/reactivity/reactive/patch.mjs +1 -1
  354. package/dist/reactivity/reactive/patchState.mjs +1 -1
  355. package/dist/reactivity/reactive/shared.mjs +1 -1
  356. package/dist/reactivity/reactive.mjs +1 -1
  357. package/dist/reactivity/ref.mjs +1 -1
  358. package/dist/reactivity/shallowRef.mjs +1 -1
  359. package/dist/reactivity/watch/helpers.mjs +1 -1
  360. package/dist/reactivity/watch.mjs +1 -1
  361. package/dist/router/createRouter.mjs +1 -1
  362. package/dist/router/initialNavigation.mjs +1 -1
  363. package/dist/router/instance.mjs +1 -1
  364. package/dist/router/navigationCore.mjs +1 -1
  365. package/dist/router/navigationResult.mjs +1 -1
  366. package/dist/router/navigationTarget.mjs +1 -1
  367. package/dist/router/resolve.mjs +1 -1
  368. package/dist/router/routeRegistry.mjs +1 -1
  369. package/dist/router/routeSync.mjs +1 -1
  370. package/dist/router/useRoute.mjs +1 -1
  371. package/dist/routerInternal/location.mjs +1 -1
  372. package/dist/routerInternal/params.mjs +1 -1
  373. package/dist/routerInternal/records.mjs +1 -1
  374. package/dist/routerInternal/recordsWarnings.mjs +1 -1
  375. package/dist/runtime/app/context.mjs +1 -1
  376. package/dist/runtime/app/diagnostics.mjs +1 -1
  377. package/dist/runtime/app/mount.mjs +1 -1
  378. package/dist/runtime/app/setData/commitTracker.mjs +1 -1
  379. package/dist/runtime/app/setData/patchScheduler.mjs +1 -1
  380. package/dist/runtime/app/setData/payload.mjs +1 -1
  381. package/dist/runtime/app/setData/scheduler.mjs +1 -1
  382. package/dist/runtime/app/setData/snapshot.mjs +1 -1
  383. package/dist/runtime/app/setDataOptions.mjs +1 -1
  384. package/dist/runtime/app.mjs +1 -1
  385. package/dist/runtime/bindingManifest.mjs +1 -1
  386. package/dist/runtime/capabilities.d.mts +4 -1
  387. package/dist/runtime/css.mjs +1 -1
  388. package/dist/runtime/defaults.mjs +1 -1
  389. package/dist/runtime/define/initialComputed.mjs +1 -1
  390. package/dist/runtime/define/options.mjs +1 -1
  391. package/dist/runtime/define/props.mjs +1 -1
  392. package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
  393. package/dist/runtime/define/setupResult.mjs +1 -1
  394. package/dist/runtime/define.mjs +1 -1
  395. package/dist/runtime/diff.mjs +1 -1
  396. package/dist/runtime/disposables.mjs +1 -1
  397. package/dist/runtime/elementIntersectionObserver.mjs +1 -1
  398. package/dist/runtime/features/inlineEvents.mjs +1 -1
  399. package/dist/runtime/features/jsxIslands.d.mts +6 -0
  400. package/dist/runtime/features/jsxIslands.mjs +1 -0
  401. package/dist/runtime/features/layout.mjs +1 -1
  402. package/dist/runtime/features/publicLayout.mjs +1 -1
  403. package/dist/runtime/features/scopedSlots.mjs +1 -1
  404. package/dist/runtime/features/templateRefs.mjs +1 -1
  405. package/dist/runtime/hooks/base.mjs +1 -1
  406. package/dist/runtime/inlineDataset.mjs +1 -1
  407. package/dist/runtime/intersectionObserver.mjs +1 -1
  408. package/dist/runtime/jsxIsland.mjs +1 -1
  409. package/dist/runtime/layoutBridge.mjs +1 -1
  410. package/dist/runtime/nativeBridge.mjs +1 -1
  411. package/dist/runtime/navigationLifecycle.mjs +1 -0
  412. package/dist/runtime/pageEnvironment.mjs +1 -1
  413. package/dist/runtime/pageLayout.mjs +1 -1
  414. package/dist/runtime/pageScroll.mjs +1 -1
  415. package/dist/runtime/platform/current.mjs +1 -0
  416. package/dist/runtime/platform/generic.mjs +1 -0
  417. package/dist/runtime/platform/globals.mjs +1 -0
  418. package/dist/runtime/platform.mjs +1 -1
  419. package/dist/runtime/provideContext.mjs +1 -1
  420. package/dist/runtime/publicRuntime.mjs +1 -1
  421. package/dist/runtime/pullDownRefresh.mjs +1 -1
  422. package/dist/runtime/register/app.mjs +1 -1
  423. package/dist/runtime/register/component/alipay.mjs +1 -1
  424. package/dist/runtime/register/component/alipayRegistration.mjs +1 -0
  425. package/dist/runtime/register/component/lifecycle/platform.mjs +1 -1
  426. package/dist/runtime/register/component/lifecycle.mjs +1 -1
  427. package/dist/runtime/register/component/methods.mjs +1 -1
  428. package/dist/runtime/register/component/options.mjs +1 -1
  429. package/dist/runtime/register/component/props.mjs +1 -1
  430. package/dist/runtime/register/component/registerDefinition.mjs +1 -1
  431. package/dist/runtime/register/component/registerNativeDefinition.mjs +1 -1
  432. package/dist/runtime/register/component.mjs +1 -1
  433. package/dist/runtime/register/inline.mjs +1 -1
  434. package/dist/runtime/register/runtimeInstance/methodBridge.mjs +1 -1
  435. package/dist/runtime/register/runtimeInstance/provideContext.mjs +1 -1
  436. package/dist/runtime/register/runtimeInstance/setupContext.mjs +1 -1
  437. package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -1
  438. package/dist/runtime/register/runtimeInstance/setupSnapshot.mjs +1 -1
  439. package/dist/runtime/register/runtimeInstance/utils.mjs +1 -1
  440. package/dist/runtime/register/runtimeInstance.mjs +1 -1
  441. package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -1
  442. package/dist/runtime/register/setup.mjs +1 -1
  443. package/dist/runtime/register/snapshot.mjs +1 -1
  444. package/dist/runtime/register/watch.mjs +1 -1
  445. package/dist/runtime/scopedSlots.mjs +1 -1
  446. package/dist/runtime/selectorQuery.mjs +1 -1
  447. package/dist/runtime/template.mjs +1 -1
  448. package/dist/runtime/templateRefs/helpers.mjs +1 -1
  449. package/dist/runtime/templateRefs.mjs +1 -1
  450. package/dist/runtime/uniAppHost.mjs +1 -1
  451. package/dist/runtime/updatePerformance.mjs +1 -1
  452. package/dist/runtime/use.mjs +1 -1
  453. package/dist/runtime/vueCompat/context.mjs +1 -1
  454. package/dist/runtime/vueCompat/model.mjs +1 -1
  455. package/dist/runtime/vueCompat/router.mjs +1 -1
  456. package/dist/runtime/vueCompat/templateRef.mjs +1 -1
  457. package/dist/scheduler.mjs +1 -1
  458. package/dist/store/base.mjs +1 -1
  459. package/dist/store/define/create.mjs +1 -1
  460. package/dist/store/define.mjs +1 -1
  461. package/dist/store/view.mjs +1 -1
  462. package/package.json +7 -7
  463. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +0 -0
  464. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +0 -0
  465. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +0 -0
  466. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +0 -0
@@ -0,0 +1,30 @@
1
+ import { HostMiniProgramAddToFavoritesOption, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramSaveExitState, HostMiniProgramShareAppMessageOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramUnhandledRejectionResult } from "../types/miniprogramHost.mjs";
2
+ import "../types.mjs";
3
+ //#region src/runtime/hooks/register.d.ts
4
+ export declare function onLaunch(handler: (options: HostMiniProgramLaunchOptions) => void): void;
5
+ export declare function onPageNotFound(handler: (options: HostMiniProgramPageNotFoundOptions) => void): void;
6
+ export declare function onUnhandledRejection(handler: (options: HostMiniProgramUnhandledRejectionResult) => void): void;
7
+ export declare function onThemeChange(handler: (options: HostMiniProgramThemeChangeResult) => void): void;
8
+ export declare function onMemoryWarning(handler: (options: HostMiniProgramMemoryWarningResult) => void): void;
9
+ export declare function onShow(handler: () => void): void;
10
+ export declare function onShow(handler: (options: HostMiniProgramLaunchOptions) => void): void;
11
+ export declare function onLoad(handler: HostMiniProgramPageLifetime['onLoad']): void;
12
+ export declare function onHide(handler: () => void): void;
13
+ export declare function onUnload(handler: () => void): void;
14
+ export declare function onReady(handler: () => void): void;
15
+ export declare function onPullDownRefresh(handler: HostMiniProgramPageLifetime['onPullDownRefresh']): void;
16
+ export declare function onReachBottom(handler: HostMiniProgramPageLifetime['onReachBottom']): void;
17
+ export declare function onPageScroll(handler: (opt: HostMiniProgramPageScrollOption) => void): void;
18
+ export declare function onRouteDone(handler: HostMiniProgramPageLifetime['onRouteDone'] | ((opt?: unknown) => void)): void;
19
+ export declare function onTabItemTap(handler: (opt: HostMiniProgramTabItemTapOption) => void): void;
20
+ export declare function onResize(handler: (opt: HostMiniProgramPageResizeOption) => void): void;
21
+ export declare function onMoved(handler: () => void): void;
22
+ export declare function onAttached(handler: () => void): void;
23
+ export declare function onDetached(handler: () => void): void;
24
+ export declare function onError(handler: (err: any) => void): void;
25
+ export declare function onSaveExitState(handler: () => HostMiniProgramSaveExitState): void;
26
+ export declare function onShareAppMessage(handler: (options: HostMiniProgramShareAppMessageOption) => Record<string, any> | void): void;
27
+ export declare function onShareTimeline(handler: HostMiniProgramPageLifetime['onShareTimeline']): void;
28
+ export declare function onAddToFavorites(handler: (options: HostMiniProgramAddToFavoritesOption) => Record<string, any> | void): void;
29
+ //#endregion
30
+ //# sourceMappingURL=register.d.mts.map
@@ -0,0 +1,52 @@
1
+ import { InternalRuntimeState } from "../types/runtime.mjs";
2
+ import "../types.mjs";
3
+ //#region src/runtime/hooks/vue.d.ts
4
+ /**
5
+ * Vue 3 对齐:组件/页面已挂载,映射小程序 onReady
6
+ */
7
+ export declare function onMounted(handler: () => void): void;
8
+ /**
9
+ * Vue 3 对齐:组件/页面更新后触发。
10
+ * 小程序没有专用 update 生命周期,这里在每次 setData 完成后调用。
11
+ */
12
+ export declare function onUpdated(handler: () => void): void;
13
+ /**
14
+ * Vue 3 对齐:在卸载清理前触发,保持实例上下文和暴露方法可用。
15
+ */
16
+ export declare function onBeforeUnmount(handler: () => void): void;
17
+ /**
18
+ * Vue 3 对齐:组件/页面卸载;映射到页面 onUnload 或组件 detached
19
+ */
20
+ export declare function onUnmounted(handler: () => void): void;
21
+ /**
22
+ * Vue 3 对齐:挂载前;setup 时同步触发以模拟 beforeMount 语义
23
+ */
24
+ export declare function onBeforeMount(handler: () => void): void;
25
+ /**
26
+ * Vue 3 对齐:更新前;在每次 setData 前触发
27
+ */
28
+ export declare function onBeforeUpdate(handler: () => void): void;
29
+ /**
30
+ * Vue 3 对齐:错误捕获;映射到小程序 onError
31
+ */
32
+ export declare function onErrorCaptured(handler: (err: any, instance: any, info: string) => void): void;
33
+ /**
34
+ * Vue 3 对齐:组件激活;映射到小程序 onShow
35
+ */
36
+ export declare function onActivated(handler: () => void): void;
37
+ /**
38
+ * Vue 3 对齐:组件失活;映射到小程序 onHide
39
+ */
40
+ export declare function onDeactivated(handler: () => void): void;
41
+ /**
42
+ * Vue 3 对齐:服务端渲染前置钩子。
43
+ * 小程序无此场景,保留空实现以保持 API 兼容。
44
+ */
45
+ export declare function onServerPrefetch(_handler: () => void): void;
46
+ /**
47
+ * 派发更新阶段钩子(框架内部调度入口)。
48
+ * @internal
49
+ */
50
+ export declare function callUpdateHooks(target: InternalRuntimeState, phase: 'before' | 'after'): void;
51
+ //#endregion
52
+ //# sourceMappingURL=vue.d.mts.map
@@ -0,0 +1,4 @@
1
+ import { callHookList, callHookReturn, getCurrentInstance, getCurrentSetupContext, setCurrentInstance, setCurrentSetupContext } from "./hooks/base.mjs";
2
+ import { onAddToFavorites, onAttached, onDetached, onError, onHide, onLaunch, onLoad, onMemoryWarning, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload } from "./hooks/register.mjs";
3
+ import { callUpdateHooks, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated } from "./hooks/vue.mjs";
4
+ export { callHookList, callHookReturn, callUpdateHooks, getCurrentInstance, getCurrentSetupContext, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, setCurrentInstance, setCurrentSetupContext };
@@ -0,0 +1,46 @@
1
+ import { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract } from "./types/miniprogramHostSources.mjs";
2
+ import { HostMiniProgramAddToFavoritesOption, HostMiniProgramAppOptions, HostMiniProgramAppTrivialInstance, HostMiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray, HostMiniProgramComponentInstance, HostMiniProgramComponentMethodOption, HostMiniProgramComponentPropertyOption, HostMiniProgramComponentPropertyValue, HostMiniProgramComponentShortProperty, HostMiniProgramComponentTrivialInstance, HostMiniProgramComponentTrivialOption, HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption, HostMiniProgramNodesRef, HostMiniProgramNodesRefFields, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramPageTrivialInstance, HostMiniProgramReLaunchOption, HostMiniProgramRedirectToOption, HostMiniProgramRouter, HostMiniProgramSaveExitState, HostMiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramTriggerEventOptions, HostMiniProgramUnhandledRejectionResult } from "./types/miniprogramHost.mjs";
3
+ import { MiniProgramAdapter, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, MiniProgramComponentInstance, MiniProgramComponentOptions, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, MiniProgramInstance, MiniProgramPageLifetimes } from "./types/miniprogram.mjs";
4
+ import { ComponentPropsOptions, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InferNativePropType, InferNativeProps, InferPropType, InferProps, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, PropConstructor, PropOptions, PropType } from "./types/props/propTypes.mjs";
5
+ import { MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, SetupContextRouter, WevuTypedRouterRouteMap } from "./types/props/router.mjs";
6
+ import { ComponentPublicInstance, ComputedDefinitions, ExtractComputed, ExtractMethods, MethodDefinitions, ModelBinding, ModelBindingOptions, ModelBindingPayload } from "./types/core.mjs";
7
+ import { AppConfig, InternalRuntimeState, InternalRuntimeStateFields, RuntimeApp, RuntimeInstance, WevuPlugin } from "./types/runtime.mjs";
8
+ import { SetupContext, SetupContextIntersectionObserver, SetupContextIntersectionObserverOptions, SetupContextNativeInstance, SetupContextSelectorQuery, SetupFunction } from "./types/props/setup.mjs";
9
+ import { AllowedComponentProps, ComponentCustomProps, ComponentOptionsMixin, DefineComponent, NativeComponent, ObjectDirective, PublicProps, ShallowUnwrapRef, VNode, VNodeProps } from "../vue-types.mjs";
10
+ import { SetDataBindingDiagnostic, SetDataDebugInfo, SetDataSnapshotOptions } from "./types/setData.mjs";
11
+ import { CreateAppOptions, DataOption, DefineAppOptions, DefineComponentOptions, PageFeatures } from "./types/options.mjs";
12
+ import { GlobalComponents, GlobalDirectives, MiniProgramTemplateRefValue, TemplateRefValue, TemplateRefs, WevuGlobalComponents, WevuGlobalDirectives } from "./types.mjs";
13
+ import { useCssModule } from "./css.mjs";
14
+ import { WevuDefaults, resetWevuDefaults } from "./defaults.mjs";
15
+ import { ComponentDefinition, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, SetupContextWithTypeProps, SetupFunctionWithTypeProps, WevuComponentConstructor, WevuDefinedComponent } from "./define.mjs";
16
+ import { DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, useDisposables } from "./disposables.mjs";
17
+ import { ElementIntersectionObserverCallback, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, useElementIntersectionObserver } from "./elementIntersectionObserver.mjs";
18
+ import { PageLayoutState, WevuPageLayoutMap } from "./pageLayout.mjs";
19
+ import { LayoutHostBinding } from "./capabilities.mjs";
20
+ import { LayoutBridgeInstance } from "./layoutBridge.mjs";
21
+ import { registerPageLayoutBridge, registerRuntimeLayoutHosts, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, setPageLayout, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, useLayoutBridge, useLayoutHosts, usePageLayout, waitForLayoutHost } from "./features/publicLayout.mjs";
22
+ import { callHookList, callHookReturn, getCurrentInstance, getCurrentSetupContext, setCurrentInstance, setCurrentSetupContext } from "./hooks/base.mjs";
23
+ import { onAddToFavorites, onAttached, onDetached, onError, onHide, onLaunch, onLoad, onMemoryWarning, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload } from "./hooks/register.mjs";
24
+ import { callUpdateHooks, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated } from "./hooks/vue.mjs";
25
+ import "./hooks.mjs";
26
+ import { UseIntersectionObserverOptions, UseIntersectionObserverResult, useIntersectionObserver } from "./intersectionObserver.mjs";
27
+ import { isNoSetData, markNoSetData } from "./noSetData.mjs";
28
+ import { NavigationBarMetrics, PageStackSnapshot, UseNavigationBarMetricsOptions, UsePageStackOptions, getCurrentPageStackSnapshot, getNavigationBarMetrics, useNavigationBarMetrics, usePageStack } from "./pageEnvironment.mjs";
29
+ import { UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, usePageScrollThrottle } from "./pageScroll.mjs";
30
+ import { setGlobalProvidedValue } from "./provideStore.mjs";
31
+ import { hasInjectionContext, inject, injectGlobal, provide, provideGlobal } from "./provide.mjs";
32
+ import { setRuntimeSetDataVisibility, teardownRuntimeInstance } from "./register/runtimeInstance.mjs";
33
+ import { runSetupFunction } from "./register/setup.mjs";
34
+ import "./register.mjs";
35
+ import { createApp, createWevuComponent, createWevuScopedSlotComponent, defineComponent, mountRuntimeInstance, registerApp, registerComponent, setWevuDefaults } from "./publicRuntime.mjs";
36
+ import { PullDownRefreshHandler, UseAsyncPullDownRefreshOptions, useAsyncPullDownRefresh } from "./pullDownRefresh.mjs";
37
+ import { UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, UseBoundingClientRectOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, useBoundingClientRect, useScrollOffset, useSelectorFields, useSelectorQuery } from "./selectorQuery.mjs";
38
+ import { normalizeClass, normalizeStyle, resolvePropValue } from "./template.mjs";
39
+ import { UpdatePerformanceListener, UpdatePerformanceListenerResult, UseUpdatePerformanceListenerStopHandle, useUpdatePerformanceListener } from "./updatePerformance.mjs";
40
+ import { defineAppSetup, use } from "./use.mjs";
41
+ import { useAttrs, useNativeInstance, useSlots } from "./vueCompat/context.mjs";
42
+ import { ModelModifiers, UseModelOptions, mergeModels, useBindModel, useChangeModel, useModel } from "./vueCompat/model.mjs";
43
+ import { useNativePageRouter, useNativeRouter } from "./vueCompat/router.mjs";
44
+ import { TemplateRef, useTemplateRef } from "./vueCompat/templateRef.mjs";
45
+ import "./vueCompat.mjs";
46
+ export { type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type ComponentCustomProps, type ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComputedDefinitions, type CreateAppOptions, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, type DefineComponentTypePropsOptions, type DefineComponentWithTypeProps, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, ElementIntersectionObserverCallback, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, type LayoutBridgeInstance, type LayoutHostBinding, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type PageFeatures, type PageLayoutState, PageStackSnapshot, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type RuntimeApp, type RuntimeInstance, type SetDataBindingDiagnostic, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextIntersectionObserver, type SetupContextIntersectionObserverOptions, type SetupContextNativeInstance, type SetupContextRouter, type SetupContextSelectorQuery, type SetupContextWithTypeProps, type SetupFunction, type SetupFunctionWithTypeProps, type ShallowUnwrapRef, type TemplateRef, TemplateRefValue, TemplateRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, type WevuComponentConstructor, type WevuDefaults, type WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, type WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, callHookList, callHookReturn, callUpdateHooks, createApp, createWevuComponent, createWevuScopedSlotComponent, defineAppSetup, defineComponent, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentSetupContext, getNavigationBarMetrics, hasInjectionContext, inject, injectGlobal, isNoSetData, markNoSetData, mergeModels, mountRuntimeInstance, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, provide, provideGlobal, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, waitForLayoutHost };
@@ -47,8 +47,7 @@ function decodeWxmlEntities(value) {
47
47
  * 解析模板事件数据集键,兼容平台的大小写和事件后缀归一化。
48
48
  */
49
49
  function resolveDatasetEventValue(dataset, baseKey, event) {
50
- var _DATASET_KEY_ALIASES$;
51
- const aliasKeys = (_DATASET_KEY_ALIASES$ = DATASET_KEY_ALIASES[baseKey]) !== null && _DATASET_KEY_ALIASES$ !== void 0 ? _DATASET_KEY_ALIASES$ : [baseKey];
50
+ const aliasKeys = DATASET_KEY_ALIASES[baseKey] ?? [baseKey];
52
51
  for (const aliasKey of aliasKeys) {
53
52
  const specificKey = resolveEventDatasetKey(aliasKey, event);
54
53
  if (specificKey && dataset[specificKey] !== void 0) return dataset[specificKey];
@@ -1 +1 @@
1
- {"version":3,"file":"inlineDataset.mjs","names":[],"sources":["../../../src/runtime/inlineDataset.ts"],"sourcesContent":["const AMP_RE = /&amp;/g\nconst QUOT_RE = /&quot;/g\nconst NUM_QUOT_RE = /&#34;/g\nconst APOS_RE = /&apos;/g\nconst NUM_APOS_RE = /&#39;/g\nconst LT_RE = /&lt;/g\nconst GT_RE = /&gt;/g\n\nconst DATASET_ARRAY_INDEX_RE = /^(?:0|[1-9]\\d*)$/\nconst NON_ALNUM_RE = /[^a-z0-9]+/gi\nconst LEADING_TRAILING_DASH_RE = /^-+|-+$/g\nconst DASH_ALNUM_RE = /-([a-z0-9])/g\nconst DATASET_KEY_SEPARATOR_RE = /[-_]/g\n\nfunction normalizeDatasetIndex(value: unknown): number | string | undefined {\n if (typeof value === 'number' && Number.isFinite(value)) {\n return value\n }\n if (typeof value === 'string' && value.trim()) {\n const trimmed = value.trim()\n return DATASET_ARRAY_INDEX_RE.test(trimmed) ? Number(trimmed) : trimmed\n }\n return undefined\n}\n\nfunction normalizeEventToken(value: string): string {\n return value\n .trim()\n .replace(NON_ALNUM_RE, '-')\n .replace(LEADING_TRAILING_DASH_RE, '')\n .toLowerCase()\n}\n\nfunction resolveNormalizedDatasetValue(dataset: Record<string, unknown>, key: string): unknown {\n const normalizedKey = key.replace(DATASET_KEY_SEPARATOR_RE, '').toLowerCase()\n for (const [datasetKey, value] of Object.entries(dataset)) {\n if (datasetKey.replace(DATASET_KEY_SEPARATOR_RE, '').toLowerCase() === normalizedKey) {\n return value\n }\n }\n return undefined\n}\n\nfunction resolveEventDatasetKey(baseKey: string, event: unknown): string | undefined {\n const eventType = event && typeof event === 'object' && 'type' in event && typeof event.type === 'string'\n ? event.type\n : ''\n const token = normalizeEventToken(eventType)\n if (!token) {\n return undefined\n }\n const camelToken = token.replace(DASH_ALNUM_RE, (_, character: string) => character.toUpperCase())\n if (!camelToken) {\n return undefined\n }\n return `${baseKey}${camelToken[0].toUpperCase()}${camelToken.slice(1)}`\n}\n\nconst DATASET_KEY_ALIASES: Record<string, string[]> = {\n wvEventDetail: ['wd', 'wvEventDetail'],\n wvHandler: ['wh', 'wvHandler'],\n wvInlineId: ['wi', 'wvInlineId'],\n}\n\n/**\n * 解码 WXML 数据集传递时可能保留的实体。\n */\nexport function decodeWxmlEntities(value: string): string {\n return value\n .replace(AMP_RE, '&')\n .replace(QUOT_RE, '\"')\n .replace(NUM_QUOT_RE, '\"')\n .replace(APOS_RE, '\\'')\n .replace(NUM_APOS_RE, '\\'')\n .replace(LT_RE, '<')\n .replace(GT_RE, '>')\n}\n\n/**\n * 解析模板事件数据集键,兼容平台的大小写和事件后缀归一化。\n */\nexport function resolveDatasetEventValue(\n dataset: Record<string, unknown>,\n baseKey: string,\n event: unknown,\n): unknown {\n const aliasKeys = DATASET_KEY_ALIASES[baseKey] ?? [baseKey]\n for (const aliasKey of aliasKeys) {\n const specificKey = resolveEventDatasetKey(aliasKey, event)\n if (specificKey && dataset[specificKey] !== undefined) {\n return dataset[specificKey]\n }\n if (specificKey) {\n const normalizedValue = resolveNormalizedDatasetValue(dataset, specificKey)\n if (normalizedValue !== undefined) {\n return normalizedValue\n }\n }\n }\n for (const aliasKey of aliasKeys) {\n if (dataset[aliasKey] !== undefined) {\n return dataset[aliasKey]\n }\n const normalizedValue = resolveNormalizedDatasetValue(dataset, aliasKey)\n if (normalizedValue !== undefined) {\n return normalizedValue\n }\n }\n return undefined\n}\n\n/**\n * 将模板循环索引转换为稳定的数字或字符串键。\n */\nexport function resolveDatasetIndex(value: unknown): number | string | undefined {\n return normalizeDatasetIndex(value)\n}\n"],"mappings":";AAAA,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,cAAc;AACpB,MAAM,UAAU;AAChB,MAAM,cAAc;AACpB,MAAM,QAAQ;AACd,MAAM,QAAQ;AAEd,MAAM,yBAAyB;AAC/B,MAAM,eAAe;AACrB,MAAM,2BAA2B;AACjC,MAAM,gBAAgB;AACtB,MAAM,2BAA2B;AAEjC,SAAS,sBAAsB,OAA6C;CAC1E,IAAI,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,GACpD,OAAO;CAET,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,GAAG;EAC7C,MAAM,UAAU,MAAM,KAAK;EAC3B,OAAO,uBAAuB,KAAK,OAAO,IAAI,OAAO,OAAO,IAAI;C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,MAAM,cAAc,uBAAuB,UAAU,KAAK;EAC1D,IAAI,eAAe,QAAQ,iBAAiB,QAC1C,OAAO,QAAQ;EAEjB,IAAI,aAAa;GACf,MAAM,kBAAkB,8BAA8B,SAAS,WAAW;GAC1E,IAAI,oBAAoB,QACtB,OAAO;EAEX;CACF;CACA,KAAK,MAAM,YAAY,WAAW;EAChC,IAAI,QAAQ,cAAc,QACxB,OAAO,QAAQ;EAEjB,MAAM,kBAAkB,8BAA8B,SAAS,QAAQ;EACvE,IAAI,oBAAoB,QACtB,OAAO;CAEX;AAEF;;;;AAKA,SAAgB,oBAAoB,OAA6C;CAC/E,OAAO,sBAAsB,KAAK;AACpC"}
1
+ {"version":3,"file":"inlineDataset.mjs","names":[],"sources":["../../../src/runtime/inlineDataset.ts"],"sourcesContent":["const AMP_RE = /&amp;/g\nconst QUOT_RE = /&quot;/g\nconst NUM_QUOT_RE = /&#34;/g\nconst APOS_RE = /&apos;/g\nconst NUM_APOS_RE = /&#39;/g\nconst LT_RE = /&lt;/g\nconst GT_RE = /&gt;/g\n\nconst DATASET_ARRAY_INDEX_RE = /^(?:0|[1-9]\\d*)$/\nconst NON_ALNUM_RE = /[^a-z0-9]+/gi\nconst LEADING_TRAILING_DASH_RE = /^-+|-+$/g\nconst DASH_ALNUM_RE = /-([a-z0-9])/g\nconst DATASET_KEY_SEPARATOR_RE = /[-_]/g\n\nfunction normalizeDatasetIndex(value: unknown): number | string | undefined {\n if (typeof value === 'number' && Number.isFinite(value)) {\n return value\n }\n if (typeof value === 'string' && value.trim()) {\n const trimmed = value.trim()\n return DATASET_ARRAY_INDEX_RE.test(trimmed) ? Number(trimmed) : trimmed\n }\n return undefined\n}\n\nfunction normalizeEventToken(value: string): string {\n return value\n .trim()\n .replace(NON_ALNUM_RE, '-')\n .replace(LEADING_TRAILING_DASH_RE, '')\n .toLowerCase()\n}\n\nfunction resolveNormalizedDatasetValue(dataset: Record<string, unknown>, key: string): unknown {\n const normalizedKey = key.replace(DATASET_KEY_SEPARATOR_RE, '').toLowerCase()\n for (const [datasetKey, value] of Object.entries(dataset)) {\n if (datasetKey.replace(DATASET_KEY_SEPARATOR_RE, '').toLowerCase() === normalizedKey) {\n return value\n }\n }\n return undefined\n}\n\nfunction resolveEventDatasetKey(baseKey: string, event: unknown): string | undefined {\n const eventType = event && typeof event === 'object' && 'type' in event && typeof event.type === 'string'\n ? event.type\n : ''\n const token = normalizeEventToken(eventType)\n if (!token) {\n return undefined\n }\n const camelToken = token.replace(DASH_ALNUM_RE, (_, character: string) => character.toUpperCase())\n if (!camelToken) {\n return undefined\n }\n return `${baseKey}${camelToken[0].toUpperCase()}${camelToken.slice(1)}`\n}\n\nconst DATASET_KEY_ALIASES: Record<string, string[]> = {\n wvEventDetail: ['wd', 'wvEventDetail'],\n wvHandler: ['wh', 'wvHandler'],\n wvInlineId: ['wi', 'wvInlineId'],\n}\n\n/**\n * 解码 WXML 数据集传递时可能保留的实体。\n */\nexport function decodeWxmlEntities(value: string): string {\n return value\n .replace(AMP_RE, '&')\n .replace(QUOT_RE, '\"')\n .replace(NUM_QUOT_RE, '\"')\n .replace(APOS_RE, '\\'')\n .replace(NUM_APOS_RE, '\\'')\n .replace(LT_RE, '<')\n .replace(GT_RE, '>')\n}\n\n/**\n * 解析模板事件数据集键,兼容平台的大小写和事件后缀归一化。\n */\nexport function resolveDatasetEventValue(\n dataset: Record<string, unknown>,\n baseKey: string,\n event: unknown,\n): unknown {\n const aliasKeys = DATASET_KEY_ALIASES[baseKey] ?? [baseKey]\n for (const aliasKey of aliasKeys) {\n const specificKey = resolveEventDatasetKey(aliasKey, event)\n if (specificKey && dataset[specificKey] !== undefined) {\n return dataset[specificKey]\n }\n if (specificKey) {\n const normalizedValue = resolveNormalizedDatasetValue(dataset, specificKey)\n if (normalizedValue !== undefined) {\n return normalizedValue\n }\n }\n }\n for (const aliasKey of aliasKeys) {\n if (dataset[aliasKey] !== undefined) {\n return dataset[aliasKey]\n }\n const normalizedValue = resolveNormalizedDatasetValue(dataset, aliasKey)\n if (normalizedValue !== undefined) {\n return normalizedValue\n }\n }\n return undefined\n}\n\n/**\n * 将模板循环索引转换为稳定的数字或字符串键。\n */\nexport function resolveDatasetIndex(value: unknown): number | string | undefined {\n return normalizeDatasetIndex(value)\n}\n"],"mappings":";AAAA,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,cAAc;AACpB,MAAM,UAAU;AAChB,MAAM,cAAc;AACpB,MAAM,QAAQ;AACd,MAAM,QAAQ;AAEd,MAAM,yBAAyB;AAC/B,MAAM,eAAe;AACrB,MAAM,2BAA2B;AACjC,MAAM,gBAAgB;AACtB,MAAM,2BAA2B;AAEjC,SAAS,sBAAsB,OAA6C;CAC1E,IAAI,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,GACpD,OAAO;CAET,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,GAAG;EAC7C,MAAM,UAAU,MAAM,KAAK;EAC3B,OAAO,uBAAuB,KAAK,OAAO,IAAI,OAAO,OAAO,IAAI;CAClE;AAEF;AAEA,SAAS,oBAAoB,OAAuB;CAClD,OAAO,MACJ,KAAK,CAAC,CACN,QAAQ,cAAc,GAAG,CAAC,CAC1B,QAAQ,0BAA0B,EAAE,CAAC,CACrC,YAAY;AACjB;AAEA,SAAS,8BAA8B,SAAkC,KAAsB;CAC7F,MAAM,gBAAgB,IAAI,QAAQ,0BAA0B,EAAE,CAAC,CAAC,YAAY;CAC5E,KAAK,MAAM,CAAC,YAAY,UAAU,OAAO,QAAQ,OAAO,GACtD,IAAI,WAAW,QAAQ,0BAA0B,EAAE,CAAC,CAAC,YAAY,MAAM,eACrE,OAAO;AAIb;AAEA,SAAS,uBAAuB,SAAiB,OAAoC;CAInF,MAAM,QAAQ,oBAHI,SAAS,OAAO,UAAU,YAAY,UAAU,SAAS,OAAO,MAAM,SAAS,WAC7F,MAAM,OACN,EACuC;CAC3C,IAAI,CAAC,OACH;CAEF,MAAM,aAAa,MAAM,QAAQ,gBAAgB,GAAG,cAAsB,UAAU,YAAY,CAAC;CACjG,IAAI,CAAC,YACH;CAEF,OAAO,GAAG,UAAU,WAAW,EAAE,CAAC,YAAY,IAAI,WAAW,MAAM,CAAC;AACtE;AAEA,MAAM,sBAAgD;CACpD,eAAe,CAAC,MAAM,eAAe;CACrC,WAAW,CAAC,MAAM,WAAW;CAC7B,YAAY,CAAC,MAAM,YAAY;AACjC;;;;AAKA,SAAgB,mBAAmB,OAAuB;CACxD,OAAO,MACJ,QAAQ,QAAQ,GAAG,CAAC,CACpB,QAAQ,SAAS,IAAG,CAAC,CACrB,QAAQ,aAAa,IAAG,CAAC,CACzB,QAAQ,SAAS,GAAI,CAAC,CACtB,QAAQ,aAAa,GAAI,CAAC,CAC1B,QAAQ,OAAO,GAAG,CAAC,CACnB,QAAQ,OAAO,GAAG;AACvB;;;;AAKA,SAAgB,yBACd,SACA,SACA,OACS;CACT,MAAM,YAAY,oBAAoB,YAAY,CAAC,OAAO;CAC1D,KAAK,MAAM,YAAY,WAAW;EAChC,MAAM,cAAc,uBAAuB,UAAU,KAAK;EAC1D,IAAI,eAAe,QAAQ,iBAAiB,QAC1C,OAAO,QAAQ;EAEjB,IAAI,aAAa;GACf,MAAM,kBAAkB,8BAA8B,SAAS,WAAW;GAC1E,IAAI,oBAAoB,QACtB,OAAO;EAEX;CACF;CACA,KAAK,MAAM,YAAY,WAAW;EAChC,IAAI,QAAQ,cAAc,QACxB,OAAO,QAAQ;EAEjB,MAAM,kBAAkB,8BAA8B,SAAS,QAAQ;EACvE,IAAI,oBAAoB,QACtB,OAAO;CAEX;AAEF;;;;AAKA,SAAgB,oBAAoB,OAA6C;CAC/E,OAAO,sBAAsB,KAAK;AACpC"}
@@ -0,0 +1,14 @@
1
+ import { HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions } from "./types/miniprogramHost.mjs";
2
+ import "./types.mjs";
3
+ //#region src/runtime/intersectionObserver.d.ts
4
+ export type UseIntersectionObserverOptions = HostMiniProgramIntersectionObserverOptions;
5
+ export type UseIntersectionObserverResult = HostMiniProgramIntersectionObserver;
6
+ /**
7
+ * 在 setup 中创建 IntersectionObserver,并在卸载时自动断开。
8
+ *
9
+ * - 优先使用 `ctx.instance.createIntersectionObserver(options)`。
10
+ * - 不可用时回退到宿主全局对象的 `createIntersectionObserver(...)`。
11
+ */
12
+ export declare function useIntersectionObserver(options?: UseIntersectionObserverOptions): UseIntersectionObserverResult;
13
+ //#endregion
14
+ //# sourceMappingURL=intersectionObserver.d.mts.map
@@ -1,4 +1,5 @@
1
- import { getCurrentMiniProgramRuntimeCapabilities, getMiniProgramGlobalObject, supportsCurrentMiniProgramRuntimeCapability } from "./platform.mjs";
1
+ import { getCurrentMiniProgramGlobalObject, getCurrentMiniProgramRuntimeCapabilities } from "./platform/current.mjs";
2
+ import { supportsCurrentMiniProgramRuntimeCapability } from "./platform.mjs";
2
3
  import { getCurrentInstance } from "./hooks/base.mjs";
3
4
  import { onDetached, onUnload } from "./hooks/register.mjs";
4
5
 
@@ -11,8 +12,8 @@ function createObserverFromInstance(instance, options) {
11
12
  }
12
13
  function createObserverFromGlobal(instance, options) {
13
14
  if (!supportsCurrentMiniProgramRuntimeCapability("globalCreateIntersectionObserver")) return;
14
- const miniProgramGlobal = getMiniProgramGlobalObject();
15
- const creator = miniProgramGlobal === null || miniProgramGlobal === void 0 ? void 0 : miniProgramGlobal.createIntersectionObserver;
15
+ const miniProgramGlobal = getCurrentMiniProgramGlobalObject();
16
+ const creator = miniProgramGlobal?.createIntersectionObserver;
16
17
  if (typeof creator !== "function") return;
17
18
  return getCurrentMiniProgramRuntimeCapabilities().intersectionObserverScopeByParameter ? creator.call(miniProgramGlobal, instance, options) : creator.call(miniProgramGlobal, options);
18
19
  }
@@ -23,10 +24,9 @@ function createObserverFromGlobal(instance, options) {
23
24
  * - 不可用时回退到宿主全局对象的 `createIntersectionObserver(...)`。
24
25
  */
25
26
  function useIntersectionObserver(options = {}) {
26
- var _createObserverFromIn;
27
27
  const instance = getCurrentInstance();
28
28
  if (!instance) throw new Error("useIntersectionObserver() 必须在 setup() 的同步阶段调用");
29
- const observer = (_createObserverFromIn = createObserverFromInstance(instance, options)) !== null && _createObserverFromIn !== void 0 ? _createObserverFromIn : createObserverFromGlobal(instance, options);
29
+ const observer = createObserverFromInstance(instance, options) ?? createObserverFromGlobal(instance, options);
30
30
  if (!observer || typeof observer.disconnect !== "function") throw new Error("当前运行环境不支持 IntersectionObserver,请检查基础库版本或平台能力");
31
31
  let disconnected = false;
32
32
  const disconnect = () => {
@@ -34,7 +34,7 @@ function useIntersectionObserver(options = {}) {
34
34
  disconnected = true;
35
35
  try {
36
36
  observer.disconnect();
37
- } catch (_unused) {}
37
+ } catch {}
38
38
  };
39
39
  onUnload(disconnect);
40
40
  onDetached(disconnect);
@@ -1 +1 @@
1
- {"version":3,"file":"intersectionObserver.mjs","names":[],"sources":["../../../src/runtime/intersectionObserver.ts"],"sourcesContent":["import type {\n InternalRuntimeState,\n MiniProgramIntersectionObserver,\n MiniProgramIntersectionObserverOptions,\n} from './types'\nimport { getCurrentInstance, onDetached, onUnload } from './hooks'\nimport { getCurrentMiniProgramRuntimeCapabilities, getMiniProgramGlobalObject, supportsCurrentMiniProgramRuntimeCapability } from './platform'\n\nexport type UseIntersectionObserverOptions = MiniProgramIntersectionObserverOptions\nexport type UseIntersectionObserverResult = MiniProgramIntersectionObserver\n\nfunction createObserverFromInstance(\n instance: InternalRuntimeState,\n options: UseIntersectionObserverOptions,\n): UseIntersectionObserverResult | undefined {\n const nativeInstance = instance as Record<string, any>\n const creator = nativeInstance.createIntersectionObserver\n if (typeof creator !== 'function') {\n return undefined\n }\n const observer = creator.call(nativeInstance, options)\n return observer as UseIntersectionObserverResult | undefined\n}\n\nfunction createObserverFromGlobal(\n instance: InternalRuntimeState,\n options: UseIntersectionObserverOptions,\n): UseIntersectionObserverResult | undefined {\n if (!supportsCurrentMiniProgramRuntimeCapability('globalCreateIntersectionObserver')) {\n return undefined\n }\n const miniProgramGlobal = getMiniProgramGlobalObject()\n const creator = miniProgramGlobal?.createIntersectionObserver\n if (typeof creator !== 'function') {\n return undefined\n }\n const observer = getCurrentMiniProgramRuntimeCapabilities().intersectionObserverScopeByParameter\n ? creator.call(miniProgramGlobal, instance, options)\n : creator.call(miniProgramGlobal, options)\n return observer as UseIntersectionObserverResult | undefined\n}\n\n/**\n * 在 setup 中创建 IntersectionObserver,并在卸载时自动断开。\n *\n * - 优先使用 `ctx.instance.createIntersectionObserver(options)`。\n * - 不可用时回退到宿主全局对象的 `createIntersectionObserver(...)`。\n */\nexport function useIntersectionObserver(\n options: UseIntersectionObserverOptions = {},\n): UseIntersectionObserverResult {\n const instance = getCurrentInstance()\n if (!instance) {\n throw new Error('useIntersectionObserver() 必须在 setup() 的同步阶段调用')\n }\n\n const observer = createObserverFromInstance(instance, options)\n ?? createObserverFromGlobal(instance, options)\n\n if (!observer || typeof observer.disconnect !== 'function') {\n throw new Error('当前运行环境不支持 IntersectionObserver,请检查基础库版本或平台能力')\n }\n\n let disconnected = false\n const disconnect = () => {\n if (disconnected) {\n return\n }\n disconnected = true\n try {\n observer.disconnect()\n }\n catch {\n // 忽略平台差异导致的断开异常,避免影响页面卸载流程\n }\n }\n\n onUnload(disconnect)\n onDetached(disconnect)\n\n return observer\n}\n"],"mappings":";;;;;AAWA,SAAS,2BACP,UACA,SAC2C;CAC3C,MAAM,iBAAiB;CACvB,MAAM,UAAU,eAAe;CAC/B,IAAI,OAAO,YAAY,YACrB;CAGF,OADiB,QAAQ,KAAK,gBAAgB,OAChC;AAChB;AAEA,SAAS,yBACP,UACA,SAC2C;CAC3C,IAAI,CAAC,4CAA4C,kCAAkC,GACjF;CAEF,MAAM,oBAAoB,2BAA2B;CACrD,MAAM,gFAAU,kBAAmB;CACnC,IAAI,OAAO,YAAY,YACrB;CAKF,OAHiB,yCAAyC,CAAC,CAAC,uCACxD,QAAQ,KAAK,mBAAmB,UAAU,OAAO,IACjD,QAAQ,KAAK,mBAAmB,OAAO;AAE7C;;;;;;;AAQA,SAAgB,wBACd,UAA0C,CAAC,GACZ;;CAC/B,MAAM,WAAW,mBAAmB;CACpC,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,+CAA+C;CAGjE,MAAM,oCAAW,2BAA2B,UAAU,OAAO,0EACxD,yBAAyB,UAAU,OAAO;CAE/C,IAAI,CAAC,YAAY,OAAO,SAAS,eAAe,YAC9C,MAAM,IAAI,MAAM,8CAA8C;CAGhE,IAAI,eAAe;CACnB,MAAM,mBAAmB;EACvB,IAAI,cACF;EAEF,eAAe;EACf,IAAI;GACF,SAAS,WAAW;EACtB,kBACM,CAEN;CACF;CAEA,SAAS,UAAU;CACnB,WAAW,UAAU;CAErB,OAAO;AACT"}
1
+ {"version":3,"file":"intersectionObserver.mjs","names":[],"sources":["../../../src/runtime/intersectionObserver.ts"],"sourcesContent":["import type {\n InternalRuntimeState,\n MiniProgramIntersectionObserver,\n MiniProgramIntersectionObserverOptions,\n} from './types'\nimport { getCurrentInstance, onDetached, onUnload } from './hooks'\nimport { getCurrentMiniProgramGlobalObject, getCurrentMiniProgramRuntimeCapabilities, supportsCurrentMiniProgramRuntimeCapability } from './platform'\n\nexport type UseIntersectionObserverOptions = MiniProgramIntersectionObserverOptions\nexport type UseIntersectionObserverResult = MiniProgramIntersectionObserver\n\nfunction createObserverFromInstance(\n instance: InternalRuntimeState,\n options: UseIntersectionObserverOptions,\n): UseIntersectionObserverResult | undefined {\n const nativeInstance = instance as Record<string, any>\n const creator = nativeInstance.createIntersectionObserver\n if (typeof creator !== 'function') {\n return undefined\n }\n const observer = creator.call(nativeInstance, options)\n return observer as UseIntersectionObserverResult | undefined\n}\n\nfunction createObserverFromGlobal(\n instance: InternalRuntimeState,\n options: UseIntersectionObserverOptions,\n): UseIntersectionObserverResult | undefined {\n if (!supportsCurrentMiniProgramRuntimeCapability('globalCreateIntersectionObserver')) {\n return undefined\n }\n const miniProgramGlobal = getCurrentMiniProgramGlobalObject()\n const creator = miniProgramGlobal?.createIntersectionObserver\n if (typeof creator !== 'function') {\n return undefined\n }\n const observer = getCurrentMiniProgramRuntimeCapabilities().intersectionObserverScopeByParameter\n ? creator.call(miniProgramGlobal, instance, options)\n : creator.call(miniProgramGlobal, options)\n return observer as UseIntersectionObserverResult | undefined\n}\n\n/**\n * 在 setup 中创建 IntersectionObserver,并在卸载时自动断开。\n *\n * - 优先使用 `ctx.instance.createIntersectionObserver(options)`。\n * - 不可用时回退到宿主全局对象的 `createIntersectionObserver(...)`。\n */\nexport function useIntersectionObserver(\n options: UseIntersectionObserverOptions = {},\n): UseIntersectionObserverResult {\n const instance = getCurrentInstance()\n if (!instance) {\n throw new Error('useIntersectionObserver() 必须在 setup() 的同步阶段调用')\n }\n\n const observer = createObserverFromInstance(instance, options)\n ?? createObserverFromGlobal(instance, options)\n\n if (!observer || typeof observer.disconnect !== 'function') {\n throw new Error('当前运行环境不支持 IntersectionObserver,请检查基础库版本或平台能力')\n }\n\n let disconnected = false\n const disconnect = () => {\n if (disconnected) {\n return\n }\n disconnected = true\n try {\n observer.disconnect()\n }\n catch {\n // 忽略平台差异导致的断开异常,避免影响页面卸载流程\n }\n }\n\n onUnload(disconnect)\n onDetached(disconnect)\n\n return observer\n}\n"],"mappings":";;;;;;AAWA,SAAS,2BACP,UACA,SAC2C;CAC3C,MAAM,iBAAiB;CACvB,MAAM,UAAU,eAAe;CAC/B,IAAI,OAAO,YAAY,YACrB;CAGF,OADiB,QAAQ,KAAK,gBAAgB,OAChC;AAChB;AAEA,SAAS,yBACP,UACA,SAC2C;CAC3C,IAAI,CAAC,4CAA4C,kCAAkC,GACjF;CAEF,MAAM,oBAAoB,kCAAkC;CAC5D,MAAM,UAAU,mBAAmB;CACnC,IAAI,OAAO,YAAY,YACrB;CAKF,OAHiB,yCAAyC,CAAC,CAAC,uCACxD,QAAQ,KAAK,mBAAmB,UAAU,OAAO,IACjD,QAAQ,KAAK,mBAAmB,OAAO;AAE7C;;;;;;;AAQA,SAAgB,wBACd,UAA0C,CAAC,GACZ;CAC/B,MAAM,WAAW,mBAAmB;CACpC,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,+CAA+C;CAGjE,MAAM,WAAW,2BAA2B,UAAU,OAAO,KACxD,yBAAyB,UAAU,OAAO;CAE/C,IAAI,CAAC,YAAY,OAAO,SAAS,eAAe,YAC9C,MAAM,IAAI,MAAM,8CAA8C;CAGhE,IAAI,eAAe;CACnB,MAAM,mBAAmB;EACvB,IAAI,cACF;EAEF,eAAe;EACf,IAAI;GACF,SAAS,WAAW;EACtB,QACM,CAEN;CACF;CAEA,SAAS,UAAU;CACnB,WAAW,UAAU;CAErB,OAAO;AACT"}
@@ -0,0 +1,37 @@
1
+ import { WevuJsxVNode } from "../jsxTypes.mjs";
2
+ //#region src/runtime/jsxIsland.d.ts
3
+ export declare const Fragment: unique symbol;
4
+ export interface WevuJsxIslandNode {
5
+ children?: WevuJsxIslandNode[];
6
+ events?: Record<string, string>;
7
+ kind: 'element' | 'fragment' | 'text';
8
+ props?: Record<string, any>;
9
+ tag?: string;
10
+ text?: string;
11
+ }
12
+ export interface WevuJsxIslandAdapters {
13
+ normalizeClass: (value: unknown) => string;
14
+ normalizeStyle: (value: unknown) => string;
15
+ }
16
+ export declare function createVNode(type: unknown, props?: Record<string, any> | null, children?: unknown): WevuJsxVNode;
17
+ export declare function createTextVNode(text: unknown): WevuJsxVNode;
18
+ export declare function isVNode(value: unknown): value is WevuJsxVNode;
19
+ export declare function mergeProps(...sources: Array<Record<string, any> | null | undefined>): Record<string, any>;
20
+ export declare function transformOn(events: Record<string, unknown>): Record<string, unknown>;
21
+ export declare function resolveComponent(name: string): string;
22
+ export declare const vShow = "show";
23
+ export declare const vModelText = "model-text";
24
+ export declare const vModelCheckbox = "model-checkbox";
25
+ export declare const vModelRadio = "model-radio";
26
+ export declare const vModelSelect = "model-select";
27
+ export declare function withDirectives(vnode: WevuJsxVNode, directives: unknown[]): {
28
+ props: {
29
+ [x: string]: unknown;
30
+ };
31
+ children?: unknown;
32
+ type: unknown;
33
+ };
34
+ export declare function resolveDirective(name: string): string;
35
+ export declare function normalizeJsxIsland(this: any, value: unknown, islandId: string, adapters: WevuJsxIslandAdapters): WevuJsxIslandNode | null;
36
+ //#endregion
37
+ //# sourceMappingURL=jsxIsland.d.mts.map
@@ -13,7 +13,7 @@ function createTextVNode(text) {
13
13
  return {
14
14
  type: "text",
15
15
  props: null,
16
- children: String(text !== null && text !== void 0 ? text : "")
16
+ children: String(text ?? "")
17
17
  };
18
18
  }
19
19
  function isVNode(value) {
@@ -43,8 +43,7 @@ const vModelCheckbox = "model-checkbox";
43
43
  const vModelRadio = "model-radio";
44
44
  const vModelSelect = "model-select";
45
45
  function withDirectives(vnode, directives) {
46
- var _vnode$props;
47
- const props = { ...(_vnode$props = vnode.props) !== null && _vnode$props !== void 0 ? _vnode$props : {} };
46
+ const props = { ...vnode.props ?? {} };
48
47
  for (const raw of directives) {
49
48
  if (!Array.isArray(raw)) continue;
50
49
  const [directive, value, argument] = raw;
@@ -58,10 +57,7 @@ function withDirectives(vnode, directives) {
58
57
  props[modelName === "modelValue" ? "value" : modelName] = value;
59
58
  if (typeof updater === "function") {
60
59
  const eventName = directive === "model-text" ? "onInput" : "onChange";
61
- props[eventName] = (event) => {
62
- var _event$detail$value, _event$detail;
63
- return updater((_event$detail$value = event === null || event === void 0 || (_event$detail = event.detail) === null || _event$detail === void 0 ? void 0 : _event$detail.value) !== null && _event$detail$value !== void 0 ? _event$detail$value : event === null || event === void 0 ? void 0 : event.detail);
64
- };
60
+ props[eventName] = (event) => updater(event?.detail?.value ?? event?.detail);
65
61
  }
66
62
  }
67
63
  }
@@ -78,7 +74,7 @@ function eventNameFromProp(name) {
78
74
  return name.slice(2).toLowerCase();
79
75
  }
80
76
  function getHandlerMap(target) {
81
- const existing = target === null || target === void 0 ? void 0 : target[WEVU_JSX_ISLAND_HANDLER_MAP_KEY];
77
+ const existing = target?.[WEVU_JSX_ISLAND_HANDLER_MAP_KEY];
82
78
  if (existing && typeof existing === "object") return existing;
83
79
  const next = Object.create(null);
84
80
  if (target && (typeof target === "object" || typeof target === "function")) Object.defineProperty(target, WEVU_JSX_ISLAND_HANDLER_MAP_KEY, {
@@ -101,7 +97,6 @@ function normalizeChildren(value, target, islandId, seed, adapters) {
101
97
  return node ? [node] : [];
102
98
  }
103
99
  function normalizeNode(value, target, islandId, seed, adapters) {
104
- var _value$props3;
105
100
  if (value == null || value === false || value === true) return;
106
101
  if (Array.isArray(value)) return {
107
102
  kind: "fragment",
@@ -119,27 +114,18 @@ function normalizeNode(value, target, islandId, seed, adapters) {
119
114
  kind: "fragment",
120
115
  children: normalizeChildren(value.children, target, islandId, seed, adapters)
121
116
  };
122
- if (value.type === "text") {
123
- var _value$children;
124
- return {
125
- kind: "text",
126
- text: String((_value$children = value.children) !== null && _value$children !== void 0 ? _value$children : "")
127
- };
128
- }
129
- if (typeof value.type === "function") {
130
- var _value$props;
131
- return normalizeNode(value.type((_value$props = value.props) !== null && _value$props !== void 0 ? _value$props : {}, value.children), target, islandId, seed, adapters);
132
- }
133
- if (value.type && typeof value.type === "object" && typeof value.type.render === "function") {
134
- var _value$props2;
135
- return normalizeNode(value.type.render.call((_value$props2 = value.props) !== null && _value$props2 !== void 0 ? _value$props2 : {}), target, islandId, seed, adapters);
136
- }
117
+ if (value.type === "text") return {
118
+ kind: "text",
119
+ text: String(value.children ?? "")
120
+ };
121
+ if (typeof value.type === "function") return normalizeNode(value.type(value.props ?? {}, value.children), target, islandId, seed, adapters);
122
+ if (value.type && typeof value.type === "object" && typeof value.type.render === "function") return normalizeNode(value.type.render.call(value.props ?? {}), target, islandId, seed, adapters);
137
123
  const tag = typeof value.type === "string" ? value.type : void 0;
138
124
  if (!tag) return;
139
125
  const props = {};
140
126
  const events = {};
141
127
  const handlers = getHandlerMap(target);
142
- for (const [name, raw] of Object.entries((_value$props3 = value.props) !== null && _value$props3 !== void 0 ? _value$props3 : {})) {
128
+ for (const [name, raw] of Object.entries(value.props ?? {})) {
143
129
  const eventName = eventNameFromProp(name);
144
130
  if (eventName && typeof raw === "function") {
145
131
  const handlerId = `${islandId}:${seed.value++}`;
@@ -161,19 +147,16 @@ function normalizeNode(value, target, islandId, seed, adapters) {
161
147
  };
162
148
  }
163
149
  function normalizeJsxIsland(value, islandId, adapters) {
164
- var _normalizeNode;
165
150
  const handlers = getHandlerMap(this);
166
151
  for (const key of Object.keys(handlers)) if (key.startsWith(`${islandId}:`)) delete handlers[key];
167
- return (_normalizeNode = normalizeNode(value, this, islandId, { value: 0 }, adapters)) !== null && _normalizeNode !== void 0 ? _normalizeNode : null;
152
+ return normalizeNode(value, this, islandId, { value: 0 }, adapters) ?? null;
168
153
  }
169
154
  function runJsxIslandHandler(target, event) {
170
- var _event$currentTarget$, _event$currentTarget, _event$target, _target$WEVU_JSX_ISLA, _runtime$proxy, _runtime$proxy2;
171
- const handlerId = (_event$currentTarget$ = event === null || event === void 0 || (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || (_event$currentTarget = _event$currentTarget.dataset) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.wvJsxHandler) !== null && _event$currentTarget$ !== void 0 ? _event$currentTarget$ : event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 || (_event$target = _event$target.dataset) === null || _event$target === void 0 ? void 0 : _event$target.wvJsxHandler;
155
+ const handlerId = event?.currentTarget?.dataset?.wvJsxHandler ?? event?.target?.dataset?.wvJsxHandler;
172
156
  if (typeof handlerId !== "string" || !handlerId) return;
173
- const runtime = target === null || target === void 0 ? void 0 : target.__wevu;
174
- const handlers = (_target$WEVU_JSX_ISLA = target === null || target === void 0 ? void 0 : target[WEVU_JSX_ISLAND_HANDLER_MAP_KEY]) !== null && _target$WEVU_JSX_ISLA !== void 0 ? _target$WEVU_JSX_ISLA : runtime === null || runtime === void 0 || (_runtime$proxy = runtime.proxy) === null || _runtime$proxy === void 0 ? void 0 : _runtime$proxy[WEVU_JSX_ISLAND_HANDLER_MAP_KEY];
175
- const handler = handlers === null || handlers === void 0 ? void 0 : handlers[handlerId];
176
- return typeof handler === "function" ? handler.call((_runtime$proxy2 = runtime === null || runtime === void 0 ? void 0 : runtime.proxy) !== null && _runtime$proxy2 !== void 0 ? _runtime$proxy2 : target, event) : void 0;
157
+ const runtime = target?.__wevu;
158
+ const handler = (target?.[WEVU_JSX_ISLAND_HANDLER_MAP_KEY] ?? runtime?.proxy?.[WEVU_JSX_ISLAND_HANDLER_MAP_KEY])?.[handlerId];
159
+ return typeof handler === "function" ? handler.call(runtime?.proxy ?? target, event) : void 0;
177
160
  }
178
161
 
179
162
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"jsxIsland.mjs","names":["slots"],"sources":["../../../src/runtime/jsxIsland.ts"],"sourcesContent":["import type { WevuJsxVNode } from '../jsxTypes'\nimport { WEVU_JSX_ISLAND_HANDLER_MAP_KEY } from '@weapp-core/constants'\n\nexport const Fragment = Symbol.for('wevu.jsx.fragment')\n\nexport interface WevuJsxIslandNode {\n children?: WevuJsxIslandNode[]\n events?: Record<string, string>\n kind: 'element' | 'fragment' | 'text'\n props?: Record<string, any>\n tag?: string\n text?: string\n}\n\nexport interface WevuJsxIslandAdapters {\n normalizeClass: (value: unknown) => string\n normalizeStyle: (value: unknown) => string\n}\n\nexport function createVNode(type: unknown, props?: Record<string, any> | null, children?: unknown): WevuJsxVNode {\n return { type, props, children }\n}\n\nexport function createTextVNode(text: unknown): WevuJsxVNode {\n return { type: 'text', props: null, children: String(text ?? '') }\n}\n\nexport function isVNode(value: unknown): value is WevuJsxVNode {\n return !!value && typeof value === 'object' && 'type' in value\n}\n\nexport function mergeProps(...sources: Array<Record<string, any> | null | undefined>) {\n const output: Record<string, any> = {}\n for (const source of sources) {\n if (!source) {\n continue\n }\n for (const [key, value] of Object.entries(source)) {\n if (key === 'class' && output.class) {\n output.class = [output.class, value]\n }\n else if (key === 'style' && output.style) {\n output.style = [output.style, value]\n }\n else {\n output[key] = value\n }\n }\n }\n return output\n}\n\nexport function transformOn(events: Record<string, unknown>) {\n const output: Record<string, unknown> = {}\n for (const [name, handler] of Object.entries(events)) {\n output[`on${name.charAt(0).toUpperCase()}${name.slice(1)}`] = handler\n }\n return output\n}\n\nexport function resolveComponent(name: string) {\n return name\n}\n\nexport const vShow = 'show'\nexport const vModelText = 'model-text'\nexport const vModelCheckbox = 'model-checkbox'\nexport const vModelRadio = 'model-radio'\nexport const vModelSelect = 'model-select'\n\nexport function withDirectives(vnode: WevuJsxVNode, directives: unknown[]) {\n const props = { ...(vnode.props ?? {}) }\n for (const raw of directives) {\n if (!Array.isArray(raw)) {\n continue\n }\n const [directive, value, argument] = raw\n if (directive === vShow) {\n props.hidden = !value\n continue\n }\n if (\n directive === vModelText\n || directive === vModelCheckbox\n || directive === vModelRadio\n || directive === vModelSelect\n ) {\n const modelName = typeof argument === 'string' && argument ? argument : 'modelValue'\n const updater = props[`onUpdate:${modelName}`]\n props[modelName === 'modelValue' ? 'value' : modelName] = value\n if (typeof updater === 'function') {\n const eventName = directive === vModelText ? 'onInput' : 'onChange'\n props[eventName] = (event: any) => updater(event?.detail?.value ?? event?.detail)\n }\n }\n }\n return { ...vnode, props }\n}\n\nexport function resolveDirective(name: string) {\n return name\n}\n\nfunction eventNameFromProp(name: string) {\n if (!/^on[A-Z]/.test(name)) {\n return undefined\n }\n return name.slice(2).toLowerCase()\n}\n\nfunction getHandlerMap(target: any): Record<string, (...args: any[]) => any> {\n const existing = target?.[WEVU_JSX_ISLAND_HANDLER_MAP_KEY]\n if (existing && typeof existing === 'object') {\n return existing\n }\n const next: Record<string, (...args: any[]) => any> = Object.create(null)\n if (target && (typeof target === 'object' || typeof target === 'function')) {\n Object.defineProperty(target, WEVU_JSX_ISLAND_HANDLER_MAP_KEY, {\n value: next,\n configurable: true,\n writable: true,\n })\n }\n return next\n}\n\nfunction normalizeChildren(\n value: unknown,\n target: any,\n islandId: string,\n seed: { value: number },\n adapters: WevuJsxIslandAdapters,\n): WevuJsxIslandNode[] {\n const resolved = typeof value === 'function' ? value() : value\n if (resolved == null || resolved === false || resolved === true) {\n return []\n }\n if (Array.isArray(resolved)) {\n const children: WevuJsxIslandNode[] = []\n for (const item of resolved) {\n children.push(...normalizeChildren(item, target, islandId, seed, adapters))\n }\n return children\n }\n if (typeof resolved === 'object' && !isVNode(resolved)) {\n const slots = resolved as Record<string, unknown>\n return normalizeChildren(slots.default, target, islandId, seed, adapters)\n }\n // eslint-disable-next-line ts/no-use-before-define\n const node = normalizeNode(resolved, target, islandId, seed, adapters)\n return node ? [node] : []\n}\n\nfunction normalizeNode(\n value: unknown,\n target: any,\n islandId: string,\n seed: { value: number },\n adapters: WevuJsxIslandAdapters,\n): WevuJsxIslandNode | undefined {\n if (value == null || value === false || value === true) {\n return undefined\n }\n if (Array.isArray(value)) {\n return { kind: 'fragment', children: normalizeChildren(value, target, islandId, seed, adapters) }\n }\n if (typeof value === 'string' || typeof value === 'number') {\n return { kind: 'text', text: String(value) }\n }\n if (!isVNode(value)) {\n return { kind: 'text', text: String(value) }\n }\n if (value.type === Fragment) {\n return { kind: 'fragment', children: normalizeChildren(value.children, target, islandId, seed, adapters) }\n }\n if (value.type === 'text') {\n return { kind: 'text', text: String(value.children ?? '') }\n }\n if (typeof value.type === 'function') {\n return normalizeNode(value.type(value.props ?? {}, value.children), target, islandId, seed, adapters)\n }\n if (value.type && typeof value.type === 'object' && typeof (value.type as any).render === 'function') {\n return normalizeNode((value.type as any).render.call(value.props ?? {}), target, islandId, seed, adapters)\n }\n const tag = typeof value.type === 'string' ? value.type : undefined\n if (!tag) {\n return undefined\n }\n\n const props: Record<string, any> = {}\n const events: Record<string, string> = {}\n const handlers = getHandlerMap(target)\n for (const [name, raw] of Object.entries(value.props ?? {})) {\n const eventName = eventNameFromProp(name)\n if (eventName && typeof raw === 'function') {\n const handlerId = `${islandId}:${seed.value++}`\n handlers[handlerId] = raw as unknown as (...args: unknown[]) => unknown\n events[eventName] = handlerId\n continue\n }\n if (typeof raw === 'function' || raw === undefined) {\n continue\n }\n if (name === 'class' || name === 'className') {\n props.class = adapters.normalizeClass(raw)\n }\n else if (name === 'style') {\n props.style = adapters.normalizeStyle(raw)\n }\n else {\n props[name] = raw\n }\n }\n return {\n kind: 'element',\n tag,\n props,\n events,\n children: normalizeChildren(value.children, target, islandId, seed, adapters),\n }\n}\n\nexport function normalizeJsxIsland(\n this: any,\n value: unknown,\n islandId: string,\n adapters: WevuJsxIslandAdapters,\n): WevuJsxIslandNode | null {\n const handlers = getHandlerMap(this)\n for (const key of Object.keys(handlers)) {\n if (key.startsWith(`${islandId}:`)) {\n delete handlers[key]\n }\n }\n return normalizeNode(value, this, islandId, { value: 0 }, adapters) ?? null\n}\n\nexport function runJsxIslandHandler(target: any, event: any) {\n const handlerId = event?.currentTarget?.dataset?.wvJsxHandler ?? event?.target?.dataset?.wvJsxHandler\n if (typeof handlerId !== 'string' || !handlerId) {\n return undefined\n }\n const runtime = target?.__wevu\n const handlers = target?.[WEVU_JSX_ISLAND_HANDLER_MAP_KEY]\n ?? runtime?.proxy?.[WEVU_JSX_ISLAND_HANDLER_MAP_KEY]\n const handler = handlers?.[handlerId]\n return typeof handler === 'function' ? handler.call(runtime?.proxy ?? target, event) : undefined\n}\n"],"mappings":";;;AAGA,MAAa,WAAW,OAAO,IAAI,mBAAmB;AAgBtD,SAAgB,YAAY,MAAe,OAAoC,UAAkC;CAC/G,OAAO;EAAE;EAAM;EAAO;CAAS;AACjC;AAEA,SAAgB,gBAAgB,MAA6B;CAC3D,OAAO;EAAE,MAAM;EAAQ,OAAO;EAAM,UAAU,OAAO,0CAAQ,EAAE;CAAE;AACnE;AAEA,SAAgB,QAAQ,OAAuC;CAC7D,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,UAAU;AAC3D;AAEA,SAAgB,WAAW,GAAG,SAAwD;CACpF,MAAM,SAA8B,CAAC;CACrC,KAAK,MAAM,UAAU,SAAS;EAC5B,IAAI,CAAC,QACH;EAEF,KAAK,MAA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e,GAAG;OAGzC,MAAM,QAAQ;CAElB;CACA,OAAO;EACL,MAAM;EACN;EACA;EACA;EACA,UAAU,kBAAkB,MAAM,UAAU,QAAQ,UAAU,MAAM,QAAQ;CAC9E;AACF;AAEA,SAAgB,mBAEd,OACA,UACA,UAC0B;;CAC1B,MAAM,WAAW,cAAc,IAAI;CACnC,KAAK,MAAM,OAAO,OAAO,KAAK,QAAQ,GACpC,IAAI,IAAI,WAAW,GAAG,SAAS,EAAE,GAC/B,OAAO,SAAS;CAGpB,yBAAO,cAAc,OAAO,MAAM,UAAU,EAAE,OAAO,EAAE,GAAG,QAAQ,4DAAK;AACzE;AAEA,SAAgB,oBAAoB,QAAa,OAAY;;CAC3D,MAAM,mGAAY,MAAO,2GAAe,qFAAS,4IAAgB,MAAO,+EAAQ,uEAAS;CACzF,IAAI,OAAO,cAAc,YAAY,CAAC,WACpC;CAEF,MAAM,0DAAU,OAAQ;CACxB,MAAM,oFAAW,OAAS,qKACrB,QAAS,uEAAQ;CACtB,MAAM,8DAAU,SAAW;CAC3B,OAAO,OAAO,YAAY,aAAa,QAAQ,0EAAK,QAAS,kEAAS,QAAQ,KAAK,IAAI;AACzF"}
1
+ {"version":3,"file":"jsxIsland.mjs","names":["slots"],"sources":["../../../src/runtime/jsxIsland.ts"],"sourcesContent":["import type { WevuJsxVNode } from '../jsxTypes'\nimport { WEVU_JSX_ISLAND_HANDLER_MAP_KEY } from '@weapp-core/constants'\n\nexport const Fragment = Symbol.for('wevu.jsx.fragment')\n\nexport interface WevuJsxIslandNode {\n children?: WevuJsxIslandNode[]\n events?: Record<string, string>\n kind: 'element' | 'fragment' | 'text'\n props?: Record<string, any>\n tag?: string\n text?: string\n}\n\nexport interface WevuJsxIslandAdapters {\n normalizeClass: (value: unknown) => string\n normalizeStyle: (value: unknown) => string\n}\n\nexport function createVNode(type: unknown, props?: Record<string, any> | null, children?: unknown): WevuJsxVNode {\n return { type, props, children }\n}\n\nexport function createTextVNode(text: unknown): WevuJsxVNode {\n return { type: 'text', props: null, children: String(text ?? '') }\n}\n\nexport function isVNode(value: unknown): value is WevuJsxVNode {\n return !!value && typeof value === 'object' && 'type' in value\n}\n\nexport function mergeProps(...sources: Array<Record<string, any> | null | undefined>) {\n const output: Record<string, any> = {}\n for (const source of sources) {\n if (!source) {\n continue\n }\n for (const [key, value] of Object.entries(source)) {\n if (key === 'class' && output.class) {\n output.class = [output.class, value]\n }\n else if (key === 'style' && output.style) {\n output.style = [output.style, value]\n }\n else {\n output[key] = value\n }\n }\n }\n return output\n}\n\nexport function transformOn(events: Record<string, unknown>) {\n const output: Record<string, unknown> = {}\n for (const [name, handler] of Object.entries(events)) {\n output[`on${name.charAt(0).toUpperCase()}${name.slice(1)}`] = handler\n }\n return output\n}\n\nexport function resolveComponent(name: string) {\n return name\n}\n\nexport const vShow = 'show'\nexport const vModelText = 'model-text'\nexport const vModelCheckbox = 'model-checkbox'\nexport const vModelRadio = 'model-radio'\nexport const vModelSelect = 'model-select'\n\nexport function withDirectives(vnode: WevuJsxVNode, directives: unknown[]) {\n const props = { ...(vnode.props ?? {}) }\n for (const raw of directives) {\n if (!Array.isArray(raw)) {\n continue\n }\n const [directive, value, argument] = raw\n if (directive === vShow) {\n props.hidden = !value\n continue\n }\n if (\n directive === vModelText\n || directive === vModelCheckbox\n || directive === vModelRadio\n || directive === vModelSelect\n ) {\n const modelName = typeof argument === 'string' && argument ? argument : 'modelValue'\n const updater = props[`onUpdate:${modelName}`]\n props[modelName === 'modelValue' ? 'value' : modelName] = value\n if (typeof updater === 'function') {\n const eventName = directive === vModelText ? 'onInput' : 'onChange'\n props[eventName] = (event: any) => updater(event?.detail?.value ?? event?.detail)\n }\n }\n }\n return { ...vnode, props }\n}\n\nexport function resolveDirective(name: string) {\n return name\n}\n\nfunction eventNameFromProp(name: string) {\n if (!/^on[A-Z]/.test(name)) {\n return undefined\n }\n return name.slice(2).toLowerCase()\n}\n\nfunction getHandlerMap(target: any): Record<string, (...args: any[]) => any> {\n const existing = target?.[WEVU_JSX_ISLAND_HANDLER_MAP_KEY]\n if (existing && typeof existing === 'object') {\n return existing\n }\n const next: Record<string, (...args: any[]) => any> = Object.create(null)\n if (target && (typeof target === 'object' || typeof target === 'function')) {\n Object.defineProperty(target, WEVU_JSX_ISLAND_HANDLER_MAP_KEY, {\n value: next,\n configurable: true,\n writable: true,\n })\n }\n return next\n}\n\nfunction normalizeChildren(\n value: unknown,\n target: any,\n islandId: string,\n seed: { value: number },\n adapters: WevuJsxIslandAdapters,\n): WevuJsxIslandNode[] {\n const resolved = typeof value === 'function' ? value() : value\n if (resolved == null || resolved === false || resolved === true) {\n return []\n }\n if (Array.isArray(resolved)) {\n const children: WevuJsxIslandNode[] = []\n for (const item of resolved) {\n children.push(...normalizeChildren(item, target, islandId, seed, adapters))\n }\n return children\n }\n if (typeof resolved === 'object' && !isVNode(resolved)) {\n const slots = resolved as Record<string, unknown>\n return normalizeChildren(slots.default, target, islandId, seed, adapters)\n }\n // eslint-disable-next-line ts/no-use-before-define\n const node = normalizeNode(resolved, target, islandId, seed, adapters)\n return node ? [node] : []\n}\n\nfunction normalizeNode(\n value: unknown,\n target: any,\n islandId: string,\n seed: { value: number },\n adapters: WevuJsxIslandAdapters,\n): WevuJsxIslandNode | undefined {\n if (value == null || value === false || value === true) {\n return undefined\n }\n if (Array.isArray(value)) {\n return { kind: 'fragment', children: normalizeChildren(value, target, islandId, seed, adapters) }\n }\n if (typeof value === 'string' || typeof value === 'number') {\n return { kind: 'text', text: String(value) }\n }\n if (!isVNode(value)) {\n return { kind: 'text', text: String(value) }\n }\n if (value.type === Fragment) {\n return { kind: 'fragment', children: normalizeChildren(value.children, target, islandId, seed, adapters) }\n }\n if (value.type === 'text') {\n return { kind: 'text', text: String(value.children ?? '') }\n }\n if (typeof value.type === 'function') {\n return normalizeNode(value.type(value.props ?? {}, value.children), target, islandId, seed, adapters)\n }\n if (value.type && typeof value.type === 'object' && typeof (value.type as any).render === 'function') {\n return normalizeNode((value.type as any).render.call(value.props ?? {}), target, islandId, seed, adapters)\n }\n const tag = typeof value.type === 'string' ? value.type : undefined\n if (!tag) {\n return undefined\n }\n\n const props: Record<string, any> = {}\n const events: Record<string, string> = {}\n const handlers = getHandlerMap(target)\n for (const [name, raw] of Object.entries(value.props ?? {})) {\n const eventName = eventNameFromProp(name)\n if (eventName && typeof raw === 'function') {\n const handlerId = `${islandId}:${seed.value++}`\n handlers[handlerId] = raw as unknown as (...args: unknown[]) => unknown\n events[eventName] = handlerId\n continue\n }\n if (typeof raw === 'function' || raw === undefined) {\n continue\n }\n if (name === 'class' || name === 'className') {\n props.class = adapters.normalizeClass(raw)\n }\n else if (name === 'style') {\n props.style = adapters.normalizeStyle(raw)\n }\n else {\n props[name] = raw\n }\n }\n return {\n kind: 'element',\n tag,\n props,\n events,\n children: normalizeChildren(value.children, target, islandId, seed, adapters),\n }\n}\n\nexport function normalizeJsxIsland(\n this: any,\n value: unknown,\n islandId: string,\n adapters: WevuJsxIslandAdapters,\n): WevuJsxIslandNode | null {\n const handlers = getHandlerMap(this)\n for (const key of Object.keys(handlers)) {\n if (key.startsWith(`${islandId}:`)) {\n delete handlers[key]\n }\n }\n return normalizeNode(value, this, islandId, { value: 0 }, adapters) ?? null\n}\n\nexport function runJsxIslandHandler(target: any, event: any) {\n const handlerId = event?.currentTarget?.dataset?.wvJsxHandler ?? event?.target?.dataset?.wvJsxHandler\n if (typeof handlerId !== 'string' || !handlerId) {\n return undefined\n }\n const runtime = target?.__wevu\n const handlers = target?.[WEVU_JSX_ISLAND_HANDLER_MAP_KEY]\n ?? runtime?.proxy?.[WEVU_JSX_ISLAND_HANDLER_MAP_KEY]\n const handler = handlers?.[handlerId]\n return typeof handler === 'function' ? handler.call(runtime?.proxy ?? target, event) : undefined\n}\n"],"mappings":";;;AAGA,MAAa,WAAW,OAAO,IAAI,mBAAmB;AAgBtD,SAAgB,YAAY,MAAe,OAAoC,UAAkC;CAC/G,OAAO;EAAE;EAAM;EAAO;CAAS;AACjC;AA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AAO,QAAQ,YAAY;GAC1C,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK;GACtC,SAAS,aAAa;GACtB,OAAO,aAAa;GACpB;EACF;EACA,IAAI,OAAO,QAAQ,cAAc,QAAQ,QACvC;EAEF,IAAI,SAAS,WAAW,SAAS,aAC/B,MAAM,QAAQ,SAAS,eAAe,GAAG;OAEtC,IAAI,SAAS,SAChB,MAAM,QAAQ,SAAS,eAAe,GAAG;OAGzC,MAAM,QAAQ;CAElB;CACA,OAAO;EACL,MAAM;EACN;EACA;EACA;EACA,UAAU,kBAAkB,MAAM,UAAU,QAAQ,UAAU,MAAM,QAAQ;CAC9E;AACF;AAEA,SAAgB,mBAEd,OACA,UACA,UAC0B;CAC1B,MAAM,WAAW,cAAc,IAAI;CACnC,KAAK,MAAM,OAAO,OAAO,KAAK,QAAQ,GACpC,IAAI,IAAI,WAAW,GAAG,SAAS,EAAE,GAC/B,OAAO,SAAS;CAGpB,OAAO,cAAc,OAAO,MAAM,UAAU,EAAE,OAAO,EAAE,GAAG,QAAQ,KAAK;AACzE;AAEA,SAAgB,oBAAoB,QAAa,OAAY;CAC3D,MAAM,YAAY,OAAO,eAAe,SAAS,gBAAgB,OAAO,QAAQ,SAAS;CACzF,IAAI,OAAO,cAAc,YAAY,CAAC,WACpC;CAEF,MAAM,UAAU,QAAQ;CAGxB,MAAM,WAFW,SAAS,oCACrB,SAAS,QAAQ,iCACE,GAAG;CAC3B,OAAO,OAAO,YAAY,aAAa,QAAQ,KAAK,SAAS,SAAS,QAAQ,KAAK,IAAI;AACzF"}
@@ -0,0 +1,55 @@
1
+ import { LayoutHostBinding } from "./capabilities.mjs";
2
+ //#region src/runtime/layoutBridge.d.ts
3
+ type LayoutBridgeContext = Record<string, any>;
4
+ type LayoutBridgeComponentResolver = (selector: string) => any;
5
+ type LayoutHostMap = Record<string, unknown>;
6
+ export type LayoutBridgeInstance<T = LayoutBridgeContext> = T & {
7
+ selectComponent?: LayoutBridgeComponentResolver;
8
+ };
9
+ interface LayoutHostResolveOptions<T = any> {
10
+ context?: T;
11
+ fallbackContext?: T;
12
+ interval?: number;
13
+ retries?: number;
14
+ }
15
+ /**
16
+ * 为当前页面注册 layout bridge,使页面或子组件可消费 layout 内部能力。
17
+ */
18
+ export declare function registerPageLayoutBridge(selectors: string | string[], context?: LayoutBridgeContext): boolean;
19
+ /**
20
+ * 移除当前页面的 layout bridge 注册。
21
+ */
22
+ export declare function unregisterPageLayoutBridge(selectors: string | string[], context?: LayoutBridgeContext): boolean;
23
+ /**
24
+ * 解析当前页面已注册的 layout bridge,找不到时回退到传入上下文。
25
+ */
26
+ export declare function resolveLayoutBridge<T = any>(selector: string, fallbackContext?: T): LayoutBridgeInstance<T> | undefined;
27
+ /**
28
+ * 解析当前页面 layout 内通过指定 key 暴露的宿主实例。
29
+ */
30
+ export declare function resolveLayoutHost<T = any, C = any>(key: string, options?: LayoutHostResolveOptions<C>): NonNullable<T> | null;
31
+ /**
32
+ * 等待当前页面 layout 宿主实例可用,适合页面初次进入时的异步宿主解析。
33
+ */
34
+ export declare function waitForLayoutHost<T = any, C = any>(key: string, options?: LayoutHostResolveOptions<C>): Promise<T | null>;
35
+ /**
36
+ * 在 layout 生命周期内暴露 bridge,使页面或子组件可访问 layout 内部实例。
37
+ */
38
+ export declare function useLayoutBridge(selectors: string | string[], options?: {
39
+ resolveComponent?: LayoutBridgeComponentResolver;
40
+ }): void;
41
+ /**
42
+ * 使用编译期注入的宿主绑定信息,直接从当前 layout 运行时实例解析子组件宿主并注册 bridge。
43
+ */
44
+ export declare function registerRuntimeLayoutHosts(bindings: readonly LayoutHostBinding[], context?: LayoutBridgeContext): any;
45
+ /**
46
+ * 移除运行时自动注册的 layout 宿主 bridge。
47
+ */
48
+ export declare function unregisterRuntimeLayoutHosts(bindings: readonly LayoutHostBinding[], context?: LayoutBridgeContext): boolean;
49
+ /**
50
+ * 使用 key -> 宿主实例的映射批量暴露 layout 内部宿主,适合 toast/dialog 等共享反馈节点。
51
+ */
52
+ export declare function useLayoutHosts(hosts: LayoutHostMap): void;
53
+ //#endregion
54
+ export type { LayoutHostBinding };
55
+ //# sourceMappingURL=layoutBridge.d.mts.map