wevu 6.13.2 → 6.13.3

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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { C as effect, D as onScopeDispose, E as getCurrentScope, N as nextTick, O as startBatch, S as batch, T as endBatch, a as toValue, b as addMutationRecorder, c as isRaw, d as reactive, f as isShallowReactive, g as touchReactive, h as prelinkReactiveTree, i as ref, k as stop, l as isReactive, n as isRef, o as unref, p as shallowReactive, s as getReactiveVersion, t as customRef, u as markRaw, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-DvvlGmiL.mjs";
2
2
  import { i as computed, n as defineStore, r as createStore, t as storeToRefs } from "./store-C-Eil5IU.mjs";
3
- import { A as onThemeChange, B as setCurrentSetupContext, C as onResize, D as onShareTimeline, E as onShareAppMessage, F as callHookReturn, G as readonly, I as getCurrentInstance, K as shallowReadonly, L as getCurrentSetupContext, M as onUnload, O as onShow, P as callHookList, S as onReady, T as onSaveExitState, U as isProxy, W as isReadonly, _ as onMoved, a as injectGlobal, b as onPullDownRefresh, c as setGlobalProvidedValue, d as onDetached, f as onError, g as onMemoryWarning, h as onLoad, i as inject, j as onUnhandledRejection, k as onTabItemTap, l as onAddToFavorites, m as onLaunch, n as useNativeRouter, o as provide, p as onHide, r as hasInjectionContext, s as provideGlobal, t as useNativePageRouter, u as onAttached, v as onPageNotFound, w as onRouteDone, x as onReachBottom, y as onPageScroll, z as setCurrentInstance } from "./router-DJKYJlu_.mjs";
4
- import { $ as onBeforeMount, A as registerApp, B as resetWevuDefaults, C as resolveLayoutBridge, D as useLayoutBridge, E as unregisterRuntimeLayoutHosts, F as resolveRuntimePageLayoutName, G as watch, H as isNoSetData, I as setPageLayout, J as watchSyncEffect, K as watchEffect, L as syncRuntimePageLayoutState, M as setRuntimeSetDataVisibility, N as teardownRuntimeInstance, O as useLayoutHosts, P as runSetupFunction, Q as onActivated, R as syncRuntimePageLayoutStateFromRuntime, S as registerRuntimeLayoutHosts, T as unregisterPageLayoutBridge, U as markNoSetData, V as setWevuDefaults, W as version, X as setDeepWatchStrategy, Y as getDeepWatchStrategy, Z as callUpdateHooks, _ as createWevuScopedSlotComponent, a as useAttrs, at as onServerPrefetch, b as registerComponent, c as defineAppSetup, ct as traverse, d as normalizeClass, dt as isShallowRef, et as onBeforeUnmount, f as normalizeStyle, ft as shallowRef, g as createWevuComponent, h as useDisposables, i as useModel, it as onMounted, j as mountRuntimeInstance, k as waitForLayoutHost, l as use, lt as toRef, m as useIntersectionObserver, n as mergeModels, nt as onDeactivated, o as useNativeInstance, ot as onUnmounted, p as usePageScrollThrottle, pt as triggerRef, q as watchPostEffect, r as useBindModel, rt as onErrorCaptured, s as useSlots, st as onUpdated, t as useTemplateRef, tt as onBeforeUpdate, u as useUpdatePerformanceListener, ut as toRefs, v as defineComponent, w as resolveLayoutHost, x as registerPageLayoutBridge, y as createApp, z as usePageLayout } from "./src-xqSS8INA.mjs";
3
+ import { A as onThemeChange, B as setCurrentSetupContext, C as onResize, D as onShareTimeline, E as onShareAppMessage, F as callHookReturn, G as readonly, I as getCurrentInstance, K as shallowReadonly, L as getCurrentSetupContext, M as onUnload, O as onShow, P as callHookList, S as onReady, T as onSaveExitState, U as isProxy, W as isReadonly, _ as onMoved, a as injectGlobal, b as onPullDownRefresh, c as setGlobalProvidedValue, d as onDetached, f as onError, g as onMemoryWarning, h as onLoad, i as inject, j as onUnhandledRejection, k as onTabItemTap, l as onAddToFavorites, m as onLaunch, n as useNativeRouter, o as provide, p as onHide, r as hasInjectionContext, s as provideGlobal, t as useNativePageRouter, u as onAttached, v as onPageNotFound, w as onRouteDone, x as onReachBottom, y as onPageScroll, z as setCurrentInstance } from "./router-BeMj67ue.mjs";
4
+ import { $ as onBeforeMount, A as registerApp, B as resetWevuDefaults, C as resolveLayoutBridge, D as useLayoutBridge, E as unregisterRuntimeLayoutHosts, F as resolveRuntimePageLayoutName, G as watch, H as isNoSetData, I as setPageLayout, J as watchSyncEffect, K as watchEffect, L as syncRuntimePageLayoutState, M as setRuntimeSetDataVisibility, N as teardownRuntimeInstance, O as useLayoutHosts, P as runSetupFunction, Q as onActivated, R as syncRuntimePageLayoutStateFromRuntime, S as registerRuntimeLayoutHosts, T as unregisterPageLayoutBridge, U as markNoSetData, V as setWevuDefaults, W as version, X as setDeepWatchStrategy, Y as getDeepWatchStrategy, Z as callUpdateHooks, _ as createWevuScopedSlotComponent, a as useAttrs, at as onServerPrefetch, b as registerComponent, c as defineAppSetup, ct as traverse, d as normalizeClass, dt as isShallowRef, et as onBeforeUnmount, f as normalizeStyle, ft as shallowRef, g as createWevuComponent, h as useDisposables, i as useModel, it as onMounted, j as mountRuntimeInstance, k as waitForLayoutHost, l as use, lt as toRef, m as useIntersectionObserver, n as mergeModels, nt as onDeactivated, o as useNativeInstance, ot as onUnmounted, p as usePageScrollThrottle, pt as triggerRef, q as watchPostEffect, r as useBindModel, rt as onErrorCaptured, s as useSlots, st as onUpdated, t as useTemplateRef, tt as onBeforeUpdate, u as useUpdatePerformanceListener, ut as toRefs, v as defineComponent, w as resolveLayoutHost, x as registerPageLayoutBridge, y as createApp, z as usePageLayout } from "./src-ZnVfksSk.mjs";
5
5
  export { addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getReactiveVersion, hasInjectionContext, inject, injectGlobal, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, 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, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAttrs, useBindModel, useDisposables, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, usePageLayout, usePageScrollThrottle, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect };
@@ -182,6 +182,18 @@ function callHookList(target, name, args = []) {
182
182
  list.apply(ctx, args);
183
183
  } catch (_unused5) {}
184
184
  }
185
+ function ensurePageHookOnInstance(target, name) {
186
+ var _ref2, _ref2$__wevuPageHookB;
187
+ const bridges = (_ref2$__wevuPageHookB = (_ref2 = target).__wevuPageHookBridges) !== null && _ref2$__wevuPageHookB !== void 0 ? _ref2$__wevuPageHookB : _ref2.__wevuPageHookBridges = Object.create(null);
188
+ if (typeof bridges[name] === "function") return;
189
+ const original = target[name];
190
+ const bridge = function onWevuPageHookBridge(...args) {
191
+ callHookList(this, name, args);
192
+ if (typeof original === "function") return original.apply(this, args);
193
+ };
194
+ bridges[name] = bridge;
195
+ target[name] = bridge;
196
+ }
185
197
  /**
186
198
  * 调用返回值型 hook(框架内部调度入口)。
187
199
  * @internal
@@ -249,7 +261,9 @@ function onReachBottom(handler) {
249
261
  registerHook("onReachBottom", handler);
250
262
  }
251
263
  function onPageScroll(handler) {
252
- registerHook("onPageScroll", handler);
264
+ const instance = assertInSetup("onPageScroll");
265
+ pushHook(instance, "onPageScroll", handler);
266
+ ensurePageHookOnInstance(instance, "onPageScroll");
253
267
  }
254
268
  function onRouteDone(handler) {
255
269
  registerHook("onRouteDone", handler);
package/dist/router.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { d as reactive } from "./ref-DvvlGmiL.mjs";
2
- import { G as readonly, L as getCurrentSetupContext, O as onShow, a as injectGlobal, h as onLoad, n as useNativeRouter$1, s as provideGlobal, t as useNativePageRouter$1, w as onRouteDone } from "./router-DJKYJlu_.mjs";
2
+ import { G as readonly, L as getCurrentSetupContext, O as onShow, a as injectGlobal, h as onLoad, n as useNativeRouter$1, s as provideGlobal, t as useNativePageRouter$1, w as onRouteDone } from "./router-BeMj67ue.mjs";
3
3
  //#region src/routerInternal/path.ts
4
4
  function normalizePathSegments(path) {
5
5
  const segments = [];
@@ -1,5 +1,5 @@
1
1
  import { A as track, C as effect, D as onScopeDispose, M as triggerEffects, N as nextTick, P as queueJob, _ as ReactiveFlags, b as addMutationRecorder, d as reactive, g as touchReactive, h as prelinkReactiveTree, i as ref, j as trigger, k as stop, l as isReactive, m as clearPatchIndices, n as isRef, o as unref, p as shallowReactive, r as markAsRef, s as getReactiveVersion, t as customRef, v as isObject$1, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-DvvlGmiL.mjs";
2
- import { B as setCurrentSetupContext, F as callHookReturn, G as readonly, H as getScopedSlotHostGlobalObject, I as getCurrentInstance, L as getCurrentSetupContext, M as onUnload, N as assertInSetup, P as callHookList, R as pushHook, V as getMiniProgramGlobalObject, c as setGlobalProvidedValue, d as onDetached, u as onAttached, y as onPageScroll, z as setCurrentInstance } from "./router-DJKYJlu_.mjs";
2
+ import { B as setCurrentSetupContext, F as callHookReturn, G as readonly, H as getScopedSlotHostGlobalObject, I as getCurrentInstance, L as getCurrentSetupContext, M as onUnload, N as assertInSetup, P as callHookList, R as pushHook, V as getMiniProgramGlobalObject, c as setGlobalProvidedValue, d as onDetached, u as onAttached, y as onPageScroll, z as setCurrentInstance } from "./router-BeMj67ue.mjs";
3
3
  //#region src/reactivity/shallowRef.ts
4
4
  /**
5
5
  * 创建一个“浅层” ref:它只在 .value 被整体替换时触发依赖,不会对内部对象做深层响应式处理。
@@ -431,7 +431,7 @@ function watchSyncEffect(effectFn, options = {}) {
431
431
  }
432
432
  //#endregion
433
433
  //#region src/version.ts
434
- const version = "6.13.2";
434
+ const version = "6.13.3";
435
435
  //#endregion
436
436
  //#region src/utils.ts
437
437
  function capitalize(str) {
package/dist/vue-demi.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { C as effect, D as onScopeDispose, E as getCurrentScope, N as nextTick, O as startBatch, S as batch, T as endBatch, a as toValue, b as addMutationRecorder, c as isRaw, d as reactive, f as isShallowReactive, g as touchReactive, h as prelinkReactiveTree, i as ref, k as stop, l as isReactive, n as isRef, o as unref, p as shallowReactive, s as getReactiveVersion, t as customRef, u as markRaw, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-DvvlGmiL.mjs";
2
2
  import { i as computed, n as defineStore, r as createStore, t as storeToRefs } from "./store-C-Eil5IU.mjs";
3
- import { A as onThemeChange, B as setCurrentSetupContext, C as onResize, D as onShareTimeline, E as onShareAppMessage, F as callHookReturn, G as readonly, I as getCurrentInstance, K as shallowReadonly, L as getCurrentSetupContext, M as onUnload, O as onShow, P as callHookList, S as onReady, T as onSaveExitState, U as isProxy, W as isReadonly, _ as onMoved, a as injectGlobal, b as onPullDownRefresh, c as setGlobalProvidedValue, d as onDetached, f as onError, g as onMemoryWarning, h as onLoad, i as inject, j as onUnhandledRejection, k as onTabItemTap, l as onAddToFavorites, m as onLaunch, n as useNativeRouter, o as provide, p as onHide, r as hasInjectionContext, s as provideGlobal, t as useNativePageRouter, u as onAttached, v as onPageNotFound, w as onRouteDone, x as onReachBottom, y as onPageScroll, z as setCurrentInstance } from "./router-DJKYJlu_.mjs";
4
- import { $ as onBeforeMount, A as registerApp, B as resetWevuDefaults, C as resolveLayoutBridge, D as useLayoutBridge, E as unregisterRuntimeLayoutHosts, F as resolveRuntimePageLayoutName, G as watch, H as isNoSetData, I as setPageLayout, J as watchSyncEffect, K as watchEffect, L as syncRuntimePageLayoutState, M as setRuntimeSetDataVisibility, N as teardownRuntimeInstance, O as useLayoutHosts, P as runSetupFunction, Q as onActivated, R as syncRuntimePageLayoutStateFromRuntime, S as registerRuntimeLayoutHosts, T as unregisterPageLayoutBridge, U as markNoSetData, V as setWevuDefaults, W as version, X as setDeepWatchStrategy, Y as getDeepWatchStrategy, Z as callUpdateHooks, _ as createWevuScopedSlotComponent, a as useAttrs, at as onServerPrefetch, b as registerComponent, c as defineAppSetup, ct as traverse, d as normalizeClass, dt as isShallowRef, et as onBeforeUnmount, f as normalizeStyle, ft as shallowRef, g as createWevuComponent, h as useDisposables, i as useModel, it as onMounted, j as mountRuntimeInstance, k as waitForLayoutHost, l as use, lt as toRef, m as useIntersectionObserver, n as mergeModels, nt as onDeactivated, o as useNativeInstance, ot as onUnmounted, p as usePageScrollThrottle, pt as triggerRef, q as watchPostEffect, r as useBindModel, rt as onErrorCaptured, s as useSlots, st as onUpdated, t as useTemplateRef, tt as onBeforeUpdate, u as useUpdatePerformanceListener, ut as toRefs, v as defineComponent, w as resolveLayoutHost, x as registerPageLayoutBridge, y as createApp, z as usePageLayout } from "./src-xqSS8INA.mjs";
3
+ import { A as onThemeChange, B as setCurrentSetupContext, C as onResize, D as onShareTimeline, E as onShareAppMessage, F as callHookReturn, G as readonly, I as getCurrentInstance, K as shallowReadonly, L as getCurrentSetupContext, M as onUnload, O as onShow, P as callHookList, S as onReady, T as onSaveExitState, U as isProxy, W as isReadonly, _ as onMoved, a as injectGlobal, b as onPullDownRefresh, c as setGlobalProvidedValue, d as onDetached, f as onError, g as onMemoryWarning, h as onLoad, i as inject, j as onUnhandledRejection, k as onTabItemTap, l as onAddToFavorites, m as onLaunch, n as useNativeRouter, o as provide, p as onHide, r as hasInjectionContext, s as provideGlobal, t as useNativePageRouter, u as onAttached, v as onPageNotFound, w as onRouteDone, x as onReachBottom, y as onPageScroll, z as setCurrentInstance } from "./router-BeMj67ue.mjs";
4
+ import { $ as onBeforeMount, A as registerApp, B as resetWevuDefaults, C as resolveLayoutBridge, D as useLayoutBridge, E as unregisterRuntimeLayoutHosts, F as resolveRuntimePageLayoutName, G as watch, H as isNoSetData, I as setPageLayout, J as watchSyncEffect, K as watchEffect, L as syncRuntimePageLayoutState, M as setRuntimeSetDataVisibility, N as teardownRuntimeInstance, O as useLayoutHosts, P as runSetupFunction, Q as onActivated, R as syncRuntimePageLayoutStateFromRuntime, S as registerRuntimeLayoutHosts, T as unregisterPageLayoutBridge, U as markNoSetData, V as setWevuDefaults, W as version, X as setDeepWatchStrategy, Y as getDeepWatchStrategy, Z as callUpdateHooks, _ as createWevuScopedSlotComponent, a as useAttrs, at as onServerPrefetch, b as registerComponent, c as defineAppSetup, ct as traverse, d as normalizeClass, dt as isShallowRef, et as onBeforeUnmount, f as normalizeStyle, ft as shallowRef, g as createWevuComponent, h as useDisposables, i as useModel, it as onMounted, j as mountRuntimeInstance, k as waitForLayoutHost, l as use, lt as toRef, m as useIntersectionObserver, n as mergeModels, nt as onDeactivated, o as useNativeInstance, ot as onUnmounted, p as usePageScrollThrottle, pt as triggerRef, q as watchPostEffect, r as useBindModel, rt as onErrorCaptured, s as useSlots, st as onUpdated, t as useTemplateRef, tt as onBeforeUpdate, u as useUpdatePerformanceListener, ut as toRefs, v as defineComponent, w as resolveLayoutHost, x as registerPageLayoutBridge, y as createApp, z as usePageLayout } from "./src-ZnVfksSk.mjs";
5
5
  //#region src/vue-demi.ts
6
6
  /**
7
7
  * 标记当前兼容层运行在 Vue 3 风格分支。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wevu",
3
3
  "type": "module",
4
- "version": "6.13.2",
4
+ "version": "6.13.3",
5
5
  "description": "Vue 3 风格的小程序运行时,包含响应式、diff+setData 与轻量状态管理",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -102,8 +102,8 @@
102
102
  },
103
103
  "dependencies": {
104
104
  "vue": "^3.5.32",
105
- "@wevu/api": "0.2.2",
106
- "@wevu/compiler": "6.13.2"
105
+ "@wevu/compiler": "6.13.3",
106
+ "@wevu/api": "0.2.2"
107
107
  },
108
108
  "scripts": {
109
109
  "dev": "tsdown -w",