wevu 7.6.0 → 7.7.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.
- package/dist/alipay/jsx-runtime.d.mts +0 -2
- package/dist/config/defaults.d.mts +1 -3
- package/dist/config/pageFeatures.d.mts +1 -3
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/defineProperty.mjs +1 -2
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPrimitive.mjs +1 -2
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPropertyKey.mjs +1 -2
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/typeof.mjs +1 -2
- package/dist/dev/api/vitest/setup.mjs +1 -2
- package/dist/dev/package.mjs +2 -3
- package/dist/dev/reactivity/asyncDerivation.mjs +1 -2
- package/dist/dev/reactivity/computed.mjs +1 -2
- package/dist/dev/reactivity/core.mjs +2 -3
- package/dist/dev/reactivity/reactive/mutation.mjs +1 -2
- package/dist/dev/reactivity/reactive/patch.mjs +1 -2
- package/dist/dev/reactivity/reactive/patchState.mjs +1 -2
- package/dist/dev/reactivity/reactive/shallow.mjs +1 -2
- package/dist/dev/reactivity/reactive/shared.mjs +1 -2
- package/dist/dev/reactivity/reactive/state.mjs +1 -2
- package/dist/dev/reactivity/reactive.mjs +1 -2
- package/dist/dev/reactivity/readonly.mjs +1 -2
- package/dist/dev/reactivity/ref.mjs +2 -3
- package/dist/dev/reactivity/shallowRef.mjs +1 -2
- package/dist/dev/reactivity/toRefs.mjs +1 -2
- package/dist/dev/reactivity/traverse.mjs +1 -2
- package/dist/dev/reactivity/watch/helpers.mjs +1 -2
- package/dist/dev/reactivity/watch/types.mjs +1 -2
- package/dist/dev/reactivity/watch.mjs +1 -2
- package/dist/dev/router/auto-routes.mjs +1 -2
- package/dist/dev/router/backNavigation.mjs +1 -2
- package/dist/dev/router/createRouter.mjs +1 -2
- package/dist/dev/router/initialNavigation.mjs +1 -2
- package/dist/dev/router/instance.mjs +1 -2
- package/dist/dev/router/navigationApi.mjs +1 -2
- package/dist/dev/router/navigationCore.mjs +1 -2
- package/dist/dev/router/navigationResult.mjs +1 -2
- package/dist/dev/router/navigationTarget.mjs +1 -2
- package/dist/dev/router/navigationTargetHelpers.mjs +1 -2
- package/dist/dev/router/resolve.mjs +1 -2
- package/dist/dev/router/routeRegistry.mjs +1 -2
- package/dist/dev/router/routeSync.mjs +1 -2
- package/dist/dev/router/scrollRestoration/adapters.mjs +1 -2
- package/dist/dev/router/scrollRestoration/controller.mjs +1 -2
- package/dist/dev/router/scrollRestoration/host.mjs +1 -2
- package/dist/dev/router/scrollRestoration/index.mjs +1 -2
- package/dist/dev/router/types.mjs +1 -2
- package/dist/dev/router/useRoute.mjs +1 -2
- package/dist/dev/router/useRouter.mjs +1 -2
- package/dist/dev/routerInternal/location.mjs +1 -2
- package/dist/dev/routerInternal/matching.mjs +1 -2
- package/dist/dev/routerInternal/params.mjs +1 -2
- package/dist/dev/routerInternal/path.mjs +1 -2
- package/dist/dev/routerInternal/query.mjs +1 -2
- package/dist/dev/routerInternal/records.mjs +1 -2
- package/dist/dev/routerInternal/recordsWarnings.mjs +1 -2
- package/dist/dev/routerInternal/snapshots.mjs +1 -2
- package/dist/dev/runtime/app/computed.mjs +1 -2
- package/dist/dev/runtime/app/context.mjs +1 -2
- package/dist/dev/runtime/app/diagnostics.mjs +1 -2
- package/dist/dev/runtime/app/mount.mjs +1 -2
- package/dist/dev/runtime/app/pending.mjs +1 -2
- package/dist/dev/runtime/app/setData/commitTracker.mjs +1 -2
- package/dist/dev/runtime/app/setData/observation.mjs +1 -2
- package/dist/dev/runtime/app/setData/patchScheduler.mjs +1 -2
- package/dist/dev/runtime/app/setData/payload.mjs +1 -2
- package/dist/dev/runtime/app/setData/scheduler.mjs +1 -2
- package/dist/dev/runtime/app/setData/snapshot.mjs +1 -2
- package/dist/dev/runtime/app/setDataOptions.mjs +1 -2
- package/dist/dev/runtime/app.mjs +1 -2
- package/dist/dev/runtime/bindModel.mjs +1 -2
- package/dist/dev/runtime/bindingManifest.mjs +1 -2
- package/dist/dev/runtime/capabilities.mjs +1 -2
- package/dist/dev/runtime/css.mjs +1 -2
- package/dist/dev/runtime/defaults.mjs +1 -2
- package/dist/dev/runtime/define/componentDefinition.mjs +1 -2
- package/dist/dev/runtime/define/initialComputed.mjs +1 -2
- package/dist/dev/runtime/define/options.mjs +1 -2
- package/dist/dev/runtime/define/optionsApi.mjs +1 -2
- package/dist/dev/runtime/define/props.mjs +1 -2
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +1 -2
- package/dist/dev/runtime/define/setupResult.mjs +1 -2
- package/dist/dev/runtime/define.mjs +1 -2
- package/dist/dev/runtime/diff.mjs +1 -2
- package/dist/dev/runtime/disposables.mjs +1 -2
- package/dist/dev/runtime/elementIntersectionObserver.mjs +1 -2
- package/dist/dev/runtime/emit.mjs +1 -2
- package/dist/dev/runtime/features/inlineEvents.mjs +1 -2
- package/dist/dev/runtime/features/jsxIslands.mjs +1 -2
- package/dist/dev/runtime/features/layout.mjs +1 -2
- package/dist/dev/runtime/features/patchStrategy.mjs +1 -2
- package/dist/dev/runtime/features/publicLayout.mjs +1 -2
- package/dist/dev/runtime/features/scopedSlots.mjs +1 -2
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.mjs +1 -2
- package/dist/dev/runtime/features/templateRefs.mjs +1 -2
- package/dist/dev/runtime/hooks/base.mjs +1 -2
- package/dist/dev/runtime/hooks/pageScroll.mjs +1 -2
- package/dist/dev/runtime/hooks/register.mjs +1 -2
- package/dist/dev/runtime/hooks/vue.mjs +1 -2
- package/dist/dev/runtime/inlineDataset.mjs +1 -2
- package/dist/dev/runtime/internal.mjs +1 -2
- package/dist/dev/runtime/intersectionObserver.mjs +1 -2
- package/dist/dev/runtime/jsxIsland.mjs +1 -2
- package/dist/dev/runtime/layoutBridge.mjs +1 -2
- package/dist/dev/runtime/layoutComponentMatcher.mjs +1 -2
- package/dist/dev/runtime/nativeBridge.mjs +1 -2
- package/dist/dev/runtime/navigationLifecycle.mjs +1 -2
- package/dist/dev/runtime/noSetData.mjs +1 -2
- package/dist/dev/runtime/pageEnvironment.mjs +1 -2
- package/dist/dev/runtime/pageLayout.mjs +1 -2
- package/dist/dev/runtime/pageScroll.mjs +1 -2
- package/dist/dev/runtime/platform/current.mjs +1 -2
- package/dist/dev/runtime/platform/generic.mjs +1 -2
- package/dist/dev/runtime/platform/globals.mjs +1 -2
- package/dist/dev/runtime/platform.mjs +1 -2
- package/dist/dev/runtime/provide.mjs +1 -2
- package/dist/dev/runtime/provideContext.mjs +1 -2
- package/dist/dev/runtime/provideStore.mjs +1 -2
- package/dist/dev/runtime/publicRuntime.mjs +1 -2
- package/dist/dev/runtime/pullDownRefresh.mjs +1 -2
- package/dist/dev/runtime/register/app.mjs +1 -2
- package/dist/dev/runtime/register/component/alipay.mjs +1 -2
- package/dist/dev/runtime/register/component/alipayRegistration.mjs +1 -2
- package/dist/dev/runtime/register/component/features.mjs +1 -2
- package/dist/dev/runtime/register/component/hmrRegistration.mjs +1 -2
- package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs +1 -2
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs +1 -2
- package/dist/dev/runtime/register/component/lifecycle.mjs +1 -2
- package/dist/dev/runtime/register/component/methods.mjs +1 -2
- package/dist/dev/runtime/register/component/options.mjs +1 -2
- package/dist/dev/runtime/register/component/props.mjs +1 -2
- package/dist/dev/runtime/register/component/registerDefinition.mjs +1 -2
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +1 -2
- package/dist/dev/runtime/register/component.mjs +1 -2
- package/dist/dev/runtime/register/inline.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/nativeDeclaration.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance.mjs +1 -2
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +1 -2
- package/dist/dev/runtime/register/setup.mjs +1 -2
- package/dist/dev/runtime/register/snapshot.mjs +1 -2
- package/dist/dev/runtime/register/watch.mjs +1 -2
- package/dist/dev/runtime/scopedSlots.mjs +1 -2
- package/dist/dev/runtime/selectorQuery.mjs +1 -2
- package/dist/dev/runtime/setupTracking.mjs +1 -2
- package/dist/dev/runtime/teardown.mjs +1 -2
- package/dist/dev/runtime/template.mjs +1 -2
- package/dist/dev/runtime/templateRefs/helpers.mjs +1 -2
- package/dist/dev/runtime/templateRefs.mjs +1 -2
- package/dist/dev/runtime/uniAppHost.mjs +1 -2
- package/dist/dev/runtime/updatePerformance.mjs +1 -2
- package/dist/dev/runtime/use.mjs +1 -2
- package/dist/dev/runtime/vueCompat/context.mjs +1 -2
- package/dist/dev/runtime/vueCompat/model.mjs +1 -2
- package/dist/dev/runtime/vueCompat/router.mjs +1 -2
- package/dist/dev/runtime/vueCompat/templateRef.mjs +1 -2
- package/dist/dev/scheduler.mjs +1 -2
- package/dist/dev/store/actions.mjs +1 -2
- package/dist/dev/store/base.mjs +1 -2
- package/dist/dev/store/define/create.mjs +1 -2
- package/dist/dev/store/define.mjs +1 -2
- package/dist/dev/store/manager.mjs +1 -2
- package/dist/dev/store/storeToRefs.mjs +1 -2
- package/dist/dev/store/subscriptions.mjs +1 -2
- package/dist/dev/store/types.mjs +1 -2
- package/dist/dev/store/utils.mjs +1 -2
- package/dist/dev/store/view.mjs +1 -2
- package/dist/dev/utils.mjs +1 -2
- package/dist/dev/version.mjs +1 -2
- package/dist/dev/vue-demi.mjs +1 -2
- package/dist/fetch.d.mts +0 -2
- package/dist/jsx-runtime.d.mts +0 -2
- package/dist/jsxTypes.d.mts +1 -3
- package/dist/macros/shared.d.mts +0 -2
- package/dist/macros.d.mts +0 -2
- package/dist/miniprogram/jsx-runtime.d.mts +0 -2
- package/dist/package.mjs +1 -1
- package/dist/reactivity/asyncDerivation.d.mts +0 -2
- package/dist/reactivity/computed.d.mts +0 -2
- package/dist/reactivity/core.d.mts +1 -3
- package/dist/reactivity/core.mjs +1 -1
- package/dist/reactivity/reactive/mutation.d.mts +0 -2
- package/dist/reactivity/reactive/patch.d.mts +1 -3
- package/dist/reactivity/reactive/patchState.mjs +1 -1
- package/dist/reactivity/reactive/shallow.d.mts +1 -3
- package/dist/reactivity/reactive/shared.d.mts +1 -3
- package/dist/reactivity/reactive.d.mts +0 -2
- package/dist/reactivity/readonly.d.mts +1 -3
- package/dist/reactivity/ref.d.mts +1 -3
- package/dist/reactivity/ref.mjs +1 -1
- package/dist/reactivity/shallowRef.d.mts +1 -3
- package/dist/reactivity/toRefs.d.mts +0 -2
- package/dist/reactivity/traverse.d.mts +1 -3
- package/dist/reactivity/watch/types.d.mts +0 -2
- package/dist/reactivity/watch.d.mts +0 -2
- package/dist/router/auto-routes.d.mts +0 -2
- package/dist/router/createRouter.d.mts +1 -3
- package/dist/router/navigationCore.d.mts +1 -3
- package/dist/router/resolve.d.mts +1 -3
- package/dist/router/scrollRestoration/adapters.d.mts +1 -3
- package/dist/router/scrollRestoration/controller.d.mts +1 -3
- package/dist/router/scrollRestoration/index.d.mts +0 -2
- package/dist/router/scrollRestoration/index.mjs +1 -1
- package/dist/router/scrollRestoration/types.d.mts +1 -3
- package/dist/router/types.d.mts +0 -2
- package/dist/router/useRoute.d.mts +1 -3
- package/dist/router/useRouter.d.mts +1 -3
- package/dist/router.d.mts +0 -2
- package/dist/routerInternal/query.d.mts +1 -3
- package/dist/routerInternal/types.d.mts +1 -3
- package/dist/runtime/app/pending.d.mts +1 -3
- package/dist/runtime/app/setData/commitTracker.d.mts +1 -3
- package/dist/runtime/app/setData/observation.d.mts +0 -2
- package/dist/runtime/app/setData/scheduler.d.mts +1 -3
- package/dist/runtime/app/setData/scheduler.mjs +1 -1
- package/dist/runtime/app.d.mts +1 -3
- package/dist/runtime/capabilities.d.mts +0 -2
- package/dist/runtime/css.d.mts +1 -3
- package/dist/runtime/defaults.d.mts +1 -3
- package/dist/runtime/define/props.mjs +1 -1
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
- package/dist/runtime/define.d.mts +0 -2
- package/dist/runtime/disposables.d.mts +1 -3
- package/dist/runtime/elementIntersectionObserver.d.mts +1 -3
- package/dist/runtime/features/inlineEvents.d.mts +1 -3
- package/dist/runtime/features/jsxIslands.d.mts +1 -3
- package/dist/runtime/features/layout.d.mts +1 -3
- package/dist/runtime/features/patchStrategy.d.mts +1 -3
- package/dist/runtime/features/publicLayout.d.mts +0 -2
- package/dist/runtime/features/scopedSlots.d.mts +1 -3
- package/dist/runtime/features/setDataHighFrequencyWarning.d.mts +1 -3
- package/dist/runtime/features/templateRefs.d.mts +1 -3
- package/dist/runtime/hooks/base.d.mts +1 -3
- package/dist/runtime/hooks/register.d.mts +1 -3
- package/dist/runtime/hooks/vue.d.mts +1 -3
- package/dist/runtime/intersectionObserver.d.mts +1 -3
- package/dist/runtime/jsxIsland.d.mts +1 -3
- package/dist/runtime/layoutBridge.d.mts +0 -2
- package/dist/runtime/noSetData.d.mts +1 -3
- package/dist/runtime/pageEnvironment.d.mts +1 -3
- package/dist/runtime/pageLayout.d.mts +0 -2
- package/dist/runtime/pageScroll.d.mts +1 -3
- package/dist/runtime/provide.d.mts +0 -2
- package/dist/runtime/provideStore.d.mts +1 -3
- package/dist/runtime/publicRuntime.d.mts +1 -3
- package/dist/runtime/pullDownRefresh.d.mts +1 -3
- package/dist/runtime/register/app.d.mts +1 -3
- package/dist/runtime/register/component.d.mts +1 -3
- package/dist/runtime/register/inline.d.mts +0 -2
- package/dist/runtime/register/runtimeInstance.d.mts +0 -2
- package/dist/runtime/register/runtimeInstance.mjs +1 -1
- package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -1
- package/dist/runtime/register/setup.d.mts +0 -2
- package/dist/runtime/register/watch.d.mts +0 -2
- package/dist/runtime/selectorQuery.d.mts +1 -3
- package/dist/runtime/template.d.mts +1 -3
- package/dist/runtime/templateRefTypes.d.mts +0 -2
- package/dist/runtime/types/core.d.mts +0 -2
- package/dist/runtime/types/miniprogram.d.mts +0 -2
- package/dist/runtime/types/miniprogramHost.d.mts +0 -2
- package/dist/runtime/types/miniprogramHostSources.d.mts +1 -3
- package/dist/runtime/types/options.d.mts +0 -2
- package/dist/runtime/types/props/propTypes.d.mts +0 -2
- package/dist/runtime/types/props/router.d.mts +0 -2
- package/dist/runtime/types/props/setup.d.mts +1 -3
- package/dist/runtime/types/runtime.d.mts +1 -3
- package/dist/runtime/types/setData.d.mts +1 -3
- package/dist/runtime/types.d.mts +0 -2
- package/dist/runtime/uniAppHost.d.mts +0 -2
- package/dist/runtime/updatePerformance.d.mts +1 -3
- package/dist/runtime/use.d.mts +1 -3
- package/dist/runtime/vueCompat/context.d.mts +1 -3
- package/dist/runtime/vueCompat/model.d.mts +0 -2
- package/dist/runtime/vueCompat/router.d.mts +0 -2
- package/dist/runtime/vueCompat/templateRef.d.mts +1 -3
- package/dist/scheduler.d.mts +1 -3
- package/dist/store/define.d.mts +1 -3
- package/dist/store/manager.d.mts +1 -3
- package/dist/store/storeToRefs.d.mts +0 -2
- package/dist/store/types.d.mts +0 -2
- package/dist/tt/jsx-runtime.d.mts +0 -2
- package/dist/types/definitions.d.mts +1 -3
- package/dist/types/pageLayout.d.mts +1 -3
- package/dist/types/pageMeta.d.mts +1 -3
- package/dist/types/reactivity.d.mts +0 -2
- package/dist/version.d.mts +1 -3
- package/dist/vue-augment.d.mts +1 -3
- package/dist/vue-demi.d.mts +0 -2
- package/dist/vue-types.d.mts +0 -2
- package/dist/weapp/jsx-runtime.d.mts +0 -2
- package/package.json +8 -8
- /package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/defineProperty.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPrimitive.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPropertyKey.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/typeof.mjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{onScopeDispose as e}from"../../reactivity/core.mjs";import{assertInSetup as t,getCurrentSetupContext as n}from"../../runtime/hooks/base.mjs";import{getInitialNavigationPromise as r}from"../initialNavigation.mjs";import{addScrollHook as i,currentScrollPage as a,resolveScrollPage as o}from"./host.mjs";import{createScrollRestoration as s,resolveScrollController as c}from"./controller.mjs";import{WEVU_READY_CALLED_KEY as l}from"@weapp-core/constants";function u(){let e=t(`useScrollRestoration`),r=n()?.proxy;if(typeof r?.$nextTick!=`function`)throw TypeError(`scroll restoration 需要具有宿主提交屏障的 wevu setup 实例。`);return{instance:e,commit:()=>r.$nextTick()}}function d(t,n){let{instance:s,commit:d}=u(),f=c(t.controller),p=[],m,h,g=!1,_=!0,v=!1,y=!1,b=0,x=!!s[l],S=!1,C,w,T;function E(){(g||x&&S)&&w?.()}function D(){if(m||g)return;let e=o(s);if(!e)return;let r=f.resolveRoute(e);T.key=typeof t.key==`function`?t.key(r):t.key??r.fullPath;let a=f.register(e,T);m=e,h=r,p.push(a),S=!!e[l],p.push(i(e,`onReady`,()=>{S=!0,E(),T.restoreAutomatic()})),n?.onBindPage?.(e)}async function O(){if(g||f.disposed)return!1;if(D(),!m||!h)throw Error(`无法确定 scroll restoration 的原生归属页面,请在页面 attached 后恢复。`);if(!_||a()!==m)return!1;let e=++b,n=f.generation,i={route:h,routeEventId:f.transition?.page===m?f.transition.event.routeEventId:void 0,isActive:()=>!g&&!f.disposed&&_&&e===b&&n===f.generation&&a()===m};if(
|
|
1
|
+
import{onScopeDispose as e}from"../../reactivity/core.mjs";import{assertInSetup as t,getCurrentSetupContext as n}from"../../runtime/hooks/base.mjs";import{getInitialNavigationPromise as r}from"../initialNavigation.mjs";import{addScrollHook as i,currentScrollPage as a,resolveScrollPage as o}from"./host.mjs";import{createScrollRestoration as s,resolveScrollController as c}from"./controller.mjs";import{WEVU_READY_CALLED_KEY as l}from"@weapp-core/constants";function u(){let e=t(`useScrollRestoration`),r=n()?.proxy;if(typeof r?.$nextTick!=`function`)throw TypeError(`scroll restoration 需要具有宿主提交屏障的 wevu setup 实例。`);return{instance:e,commit:()=>r.$nextTick()}}function d(t,n){let{instance:s,commit:d}=u(),f=c(t.controller),p=[],m,h,g=!1,_=!0,v=!1,y=!1,b=0,x=!!s[l],S=!1,C,w,T;function E(){(g||x&&S)&&w?.()}function D(){if(m||g)return;let e=o(s);if(!e)return;let r=f.resolveRoute(e);T.key=typeof t.key==`function`?t.key(r):t.key??r.fullPath;let a=f.register(e,T);m=e,h=r,p.push(a),S=!!e[l],p.push(i(e,`onReady`,()=>{S=!0,E(),T.restoreAutomatic()})),n?.onBindPage?.(e)}async function O(){if(g||f.disposed)return!1;if(D(),!m||!h)throw Error(`无法确定 scroll restoration 的原生归属页面,请在页面 attached 后恢复。`);if(!_||a()!==m)return!1;let e=++b,n=f.generation,i={route:h,routeEventId:f.transition?.page===m?f.transition.event.routeEventId:void 0,isActive:()=>!g&&!f.disposed&&_&&e===b&&n===f.generation&&a()===m};if(x&&S||(C??(C=new Promise(e=>{w=e})),await C),!i.isActive()||await r(m)===!1||!i.isActive()||(await d(),!i.isActive()))return!1;let o=f.read(T.key,T.id);return await t.restore(o,i),i.isActive()}T={key:``,id:t.id??`default`,capture(){if(!(g||f.disposed||!m||!_||v)){v=!0;try{let e=t.capture();if(e!==null&&`then`in e&&typeof e.then==`function`)throw TypeError(`scroll restoration capture 必须同步返回快照,不能返回 Promise。`);f.save(T.key,T.id,e)}catch(e){f.clear(T.key,T.id),f.report(e)}}},invalidate(){b++,w?.(),C=void 0,w=void 0},restoreAutomatic(){let e=f.transition;!g&&!t.manual&&!y&&x&&S&&e?.fresh&&e.done&&e.page===m&&(y=!0,O().catch(f.report))},stop(){if(!g){g=!0,b++,E();for(let e of p)e();p.length=0,n?.onStop?.()}}};function k(){T.capture(),T.stop()}return p.push(i(s,`onAttached`,D),i(s,`onReady`,()=>{D(),x=!0,E(),T.restoreAutomatic()}),i(s,`onShow`,()=>{D(),_=!0,v=!1}),i(s,`onHide`,()=>{T.capture(),_=!1,T.invalidate()}),i(s,`onDetached`,k),i(s,`onUnload`,k)),e(k),D(),T.restoreAutomatic(),{automatic:f.controller.automatic&&!t.manual,scroll:O,clear:()=>{D(),m&&f.clear(T.key,T.id)},stop:T.stop}}function f(e){return d(e)}export{s as createScrollRestoration,u as getScrollSetupScope,d as registerScrollRestoration,f as useScrollRestoration};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Ref } from "../../reactivity/ref.mjs";
|
|
2
2
|
import "../../reactivity/index.mjs";
|
|
3
3
|
import { RouteLocationNormalizedLoaded, RouterNavigation } from "../types.mjs";
|
|
4
|
-
//#region src/router/scrollRestoration/types.d.ts
|
|
5
4
|
export interface ScrollRestorationController {
|
|
6
5
|
/** 当前宿主是否支持带 routeEventId 的自动路由关联。 */
|
|
7
6
|
readonly automatic: boolean;
|
|
@@ -56,5 +55,4 @@ export interface ScrollViewRestorationHandle extends ScrollRestorationHandle {
|
|
|
56
55
|
scrollLeft: number;
|
|
57
56
|
};
|
|
58
57
|
}) => void;
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
58
|
+
}
|
package/dist/router/types.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SetupContextRouter, TypedRouterTabBarUrl } from "../runtime/types/props/router.mjs";
|
|
2
2
|
import "../runtime/types/props.mjs";
|
|
3
3
|
import { WevuNamedRouteMap } from "../router.mjs";
|
|
4
|
-
//#region src/router/types.d.ts
|
|
5
4
|
export type LocationQueryValue = string | null;
|
|
6
5
|
export type LocationQueryValueRaw = LocationQueryValue | number | boolean | undefined;
|
|
7
6
|
export type LocationQuery = Record<string, LocationQueryValue | LocationQueryValue[]>;
|
|
@@ -263,5 +262,4 @@ export type WevuAutoRoute<TRouteMap extends object = WevuNamedRouteMap> = IsBroa
|
|
|
263
262
|
readonly path: WevuNamedRoutePath<TRouteMap, TName>;
|
|
264
263
|
readonly meta: StrictRouteRecordMeta<TRouteMap, TName>;
|
|
265
264
|
}; }[WevuRouteName<TRouteMap>];
|
|
266
|
-
//#endregion
|
|
267
265
|
export {};
|
|
@@ -3,7 +3,6 @@ import "../runtime/types/props.mjs";
|
|
|
3
3
|
import { RouteLocationNormalizedLoaded } from "./types.mjs";
|
|
4
4
|
import "./routeSync.mjs";
|
|
5
5
|
import { WevuNamedRouteMap } from "../router.mjs";
|
|
6
|
-
//#region src/router/useRoute.d.ts
|
|
7
6
|
export interface UseRouteOptions<TRouteMap extends object = WevuNamedRouteMap> {
|
|
8
7
|
resolveRoute?: (route: RouteLocationNormalizedLoaded<TRouteMap>) => RouteLocationNormalizedLoaded<TRouteMap>;
|
|
9
8
|
}
|
|
@@ -15,5 +14,4 @@ export declare function useNativeRouter(): SetupContextRouter;
|
|
|
15
14
|
/**
|
|
16
15
|
* @description 获取当前页面路径语义的原生 Page Router
|
|
17
16
|
*/
|
|
18
|
-
export declare function useNativePageRouter(): SetupContextRouter;
|
|
19
|
-
//#endregion
|
|
17
|
+
export declare function useNativePageRouter(): SetupContextRouter;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { RouterNavigation } from "./types.mjs";
|
|
2
2
|
import { WevuNamedRouteMap } from "../router.mjs";
|
|
3
|
-
//#region src/router/useRouter.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* @description 获取当前已创建的路由实例。
|
|
6
5
|
*/
|
|
7
|
-
export declare function useRouter<TRouteMap extends object = WevuNamedRouteMap>(): RouterNavigation<TRouteMap>;
|
|
8
|
-
//#endregion
|
|
6
|
+
export declare function useRouter<TRouteMap extends object = WevuNamedRouteMap>(): RouterNavigation<TRouteMap>;
|
package/dist/router.d.mts
CHANGED
|
@@ -13,7 +13,6 @@ import { useScrollRestoration } from "./router/scrollRestoration/index.mjs";
|
|
|
13
13
|
import { UseRouteOptions, useNativePageRouter, useNativeRouter, useRoute } from "./router/useRoute.mjs";
|
|
14
14
|
import { useRouter } from "./router/useRouter.mjs";
|
|
15
15
|
import { StaticPageDeclaration, StaticPageDeclaration as StaticPageDeclaration$1, StaticRouteValue } from "@wevu/compiler/page-route";
|
|
16
|
-
//#region src/router.d.ts
|
|
17
16
|
/**
|
|
18
17
|
* 由 weapp-vite 生成的项目级命名路由声明会扩展此接口。
|
|
19
18
|
*/
|
|
@@ -25,5 +24,4 @@ export interface WevuNamedRouteMap {}
|
|
|
25
24
|
* 参数只接受 `name` 与 `meta`;页面布局继续使用 `definePageMeta`,页面路径由构建工具推导。
|
|
26
25
|
*/
|
|
27
26
|
export declare function definePage(route: StaticPageDeclaration$1): void;
|
|
28
|
-
//#endregion
|
|
29
27
|
export { type AddRoute, type InitialNavigationMode, type LocationQuery, type LocationQueryRaw, type LocationQueryValue, type LocationQueryValueRaw, type NamedRouteRecord, type NamedRoutes, type NavigationAfterEach, type NavigationAfterEachContext, type NavigationErrorContext, type NavigationErrorHandler, type NavigationFailure, NavigationFailureType, type NavigationFailureTypeValue, type NavigationGuard, type NavigationGuardContext, type NavigationGuardResult, type NavigationMode, type NavigationRedirect, type RouteLocationNamedRaw, type RouteLocationNormalizedByName, type RouteLocationNormalizedLoaded, type RouteLocationRaw, type RouteLocationRedirectedFrom, type RouteMeta, type RouteParamValue, type RouteParamValueRaw, type RouteParams, type RouteParamsMode, type RouteParamsRaw, type RouteQueryParser, type RouteQueryStringifier, type RouteRecordInput, type RouteRecordMatched, type RouteRecordRaw, type RouteRecordRedirect, type RouterNavigateToOption, type RouterNavigation, type RouterReLaunchOption, type RouterRedirectToOption, type RouterResolve, type RouterSwitchTabOption, type ScrollRestorationContext, type ScrollRestorationController, type ScrollRestorationHandle, type ScrollRestorationOptions, type ScrollRestorationRegistrationOptions, type ScrollViewRestorationHandle, type SetupContextRouter, type StaticPageDeclaration, type StaticRouteValue, type TypedRouterTabBarUrl, type TypedRouterUrl, type UseRouteOptions, type UseRouterOptions, type UseScrollRestorationOptions, type WevuAutoRoute, type WevuBroadRouteMap, type WevuNamedRouteDefinition, type WevuNamedRouteMeta, type WevuNamedRoutePath, type WevuRouteName, type WevuTypedRouterRouteMap, createNavigationFailure, createRouter, createScrollRestoration, isNavigationFailure, parseQuery, resolveRouteLocation, stringifyQuery, useNativePageRouter, useNativeRouter, usePageScrollRestoration, useRoute, useRouter, useScrollRestoration, useScrollViewRestoration };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { LocationQuery, LocationQueryRaw } from "../router/types.mjs";
|
|
2
2
|
import "../router.mjs";
|
|
3
|
-
//#region src/routerInternal/query.d.ts
|
|
4
3
|
export declare function parseQuery(search: string): LocationQuery;
|
|
5
|
-
export declare function stringifyQuery(query?: LocationQueryRaw | LocationQuery): string;
|
|
6
|
-
//#endregion
|
|
4
|
+
export declare function stringifyQuery(query?: LocationQueryRaw | LocationQuery): string;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { RouteQueryParser, RouteQueryStringifier } from "../router/types.mjs";
|
|
2
2
|
import "../router.mjs";
|
|
3
|
-
//#region src/routerInternal/types.d.ts
|
|
4
3
|
export interface RouteResolveCodec {
|
|
5
4
|
parseQuery: RouteQueryParser;
|
|
6
5
|
stringifyQuery: RouteQueryStringifier;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
6
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { RuntimeApp } from "../types/runtime.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/app/pending.d.ts
|
|
4
3
|
export interface PendingRuntimeAppRegistration {
|
|
5
4
|
app: RuntimeApp<any, any, any>;
|
|
6
5
|
register: () => void;
|
|
7
6
|
}
|
|
8
|
-
export declare function takePendingRuntimeAppRegistration(): PendingRuntimeAppRegistration | undefined;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare function takePendingRuntimeAppRegistration(): PendingRuntimeAppRegistration | undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MiniProgramAdapter } from "../../types/miniprogram.mjs";
|
|
2
2
|
import "../../types.mjs";
|
|
3
3
|
import { PhysicalSetDataObserver } from "./observation.mjs";
|
|
4
|
-
//#region src/runtime/app/setData/commitTracker.d.ts
|
|
5
4
|
export type SetDataPayload = Record<string, unknown>;
|
|
6
5
|
export type SetDataAdapterSettlement = 'committed' | 'failed' | 'abandoned';
|
|
7
6
|
export type SetDataAdapterSettler = (settlement: SetDataAdapterSettlement, cause?: unknown) => void;
|
|
@@ -9,5 +8,4 @@ export interface CommitAwareSetDataAdapter extends MiniProgramAdapter {
|
|
|
9
8
|
__wevu_dispatchSetData?: (payload: SetDataPayload, settle: SetDataAdapterSettler, observer?: PhysicalSetDataObserver) => void;
|
|
10
9
|
__wevu_reportSetDataError?: (error: Error) => void;
|
|
11
10
|
__wevu_disposeSetData?: () => void;
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
11
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SetDataDebugInfo } from "../../types/setData.mjs";
|
|
2
2
|
import "../../types.mjs";
|
|
3
3
|
import "./commitTracker.mjs";
|
|
4
|
-
//#region src/runtime/app/setData/observation.d.ts
|
|
5
4
|
type Phase = NonNullable<SetDataDebugInfo['phase']>;
|
|
6
5
|
export type SetDataCompletionBoundary = Phase['completion'];
|
|
7
6
|
export interface PhysicalSetDataObserver {
|
|
@@ -9,5 +8,4 @@ export interface PhysicalSetDataObserver {
|
|
|
9
8
|
returned: (returnedAt: number) => void;
|
|
10
9
|
complete: (boundary: SetDataCompletionBoundary) => void;
|
|
11
10
|
}
|
|
12
|
-
//#endregion
|
|
13
11
|
export {};
|
|
@@ -3,7 +3,6 @@ import "../../types.mjs";
|
|
|
3
3
|
import { CommitAwareSetDataAdapter } from "./commitTracker.mjs";
|
|
4
4
|
import "../../capabilities.mjs";
|
|
5
5
|
import { WevuRuntimeBindingManifestV1 } from "@weapp-core/constants";
|
|
6
|
-
//#region src/runtime/app/setData/scheduler.d.ts
|
|
7
6
|
export interface SetDataSchedulerOptions {
|
|
8
7
|
state: Record<string, any>;
|
|
9
8
|
setupState?: Record<string, any>;
|
|
@@ -47,5 +46,4 @@ export interface SetDataSchedulerOptions {
|
|
|
47
46
|
isMounted: () => boolean;
|
|
48
47
|
initialSnapshot?: Record<string, any>;
|
|
49
48
|
initialState?: Record<string, any>;
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
49
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{getReactiveVersion as t,isReactive as n}from"../../../reactivity/reactive.mjs";import{isRef as r}from"../../../reactivity/ref.mjs";import{hasOwn as i}from"../../../utils.mjs";import{hasTrackableSetupBinding as a}from"../../setupTracking.mjs";import{resolveBindingDiagnostics as o}from"../../bindingManifest.mjs";import{diffSnapshots as s,toPlain as c}from"../../diff.mjs";import{createSetDataObservation as l}from"./observation.mjs";import{collectSnapshot as u}from"./snapshot.mjs";import{createSetDataCommitTracker as d}from"./commitTracker.mjs";function f(f){let{state:p,setupState:m,snapshotOmitKeys:h,computedRefs:g,dirtyComputedKeys:_,includeComputed:v,setDataStrategy:y,currentAdapter:b,shouldIncludeKey:x,toPlainMaxDepth:S,toPlainMaxKeys:C,includeFunctions:w=!1,functionPaths:T,debug:E,debugWhen:D,debugSampleRate:O,bindingManifest:k,loopWarning:A,targetLabel:j,runTracker:M,isMounted:ee,initialSnapshot:N,initialState:P}=f,F=/* @__PURE__ */ new WeakMap,I=/* @__PURE__ */ new WeakMap,L={},R=Object.create(null),z=Object.create(null),B=[],V=-1/0,H=new Set(P&&typeof P==`object`?Object.keys(P):[]),U=e=>{if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},W=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>W(e,t[n]));if(U(e)&&U(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>i(t,n)&&W(e[n],t[n]))}return!1},G=i=>{let o=r(i)?i.value:i;if(typeof o!=`object`||!o)return o;if(!n(o)&&a(o))return{snapshot:c(o,/* @__PURE__ */ new WeakMap,{cacheEligibility:I,maxDepth:S,maxKeys:C,includeFunctions:w,functionPaths:T})};let s=n(o)?e(o):o;return{raw:s,version:t(s)}},K=(e,t)=>Object.is(e,t)?!0:!e||!t||typeof e!=`object`||typeof t!=`object`||!i(e,`raw`)||!i(t,`raw`)?e&&t&&typeof e==`object`&&typeof t==`object`&&i(e,`snapshot`)&&i(t,`snapshot`)?W(e.snapshot,t.snapshot):!1:e.raw===t.raw&&e.version===t.version,q=e=>x(e)&&!h?.has(e);if(N)for(let[e,t]of Object.entries(N))q(e)&&(L[e]=t);let te=()=>{if(!N)return;let t=n(p)?e(p):p,r=m&&typeof m==`object`?n(m)?e(m):m:void 0;for(let e of Object.keys(N))if(q(e)){if(r&&i(r,e))R[e]=G(r[e]);else if(i(t,e)){if(H.has(e))continue;t[e]=N[e],R[e]=G(t[e])}}},ne=t=>{let a=[],o=m&&typeof m==`object`?n(m)?e(m):m:void 0;for(let n of/* @__PURE__ */ new Set([...Object.keys(p),...o?Object.keys(o):[]])){if(!q(n))continue;let s=o&&i(o,n)?o[n]:p[n],c=r(s)?s.value:s;c&&typeof c==`object`&&e(c)===t&&a.push(n)}return a},J=(e,t)=>{if(!E)return;let n=e.reason!==`patch`&&e.reason!==`diff`;if(D===`fallback`&&!n||e.reason!==`commitFailure`&&O<1&&Math.random()>O)return;let r=e;if(k){let n=typeof t==`function`?t():t??[],i=e.reason===`needsFullSnapshot`||e.reason===`maxPatchKeys`||e.reason===`maxPayloadBytes`;r={...e,bindings:o(k,n,i)}}try{E(r)}catch{}},Y,X=f.debugPhases&&E?l({debug:E,debugWhen:D,debugSampleRate:O,targetLabel:j,committedRevision:()=>Y.state.committedRevision}):void 0;Y=d({observe:X?.revision,initialSnapshot:L,adapter:b,onFailure:e=>{J({mode:e.mode,reason:`commitFailure`,pendingPatchKeys:e.pendingPatchKeys,payloadKeys:e.payloadKeys,revision:e.revision,committedRevision:e.committedRevision,targetLabel:j,message:e.error.message});try{b.__wevu_reportSetDataError?.(e.error)}catch{}}});let re=(e=0,t)=>{if(!A)return;let n=Date.now();B.push(n);let r=n-A.sampleWindowMs;for(;B.length&&B[0]<r;)B.shift();B.length<=A.maxFlushes||A.coolDownMs>0&&n-V<A.coolDownMs||(V=n,J({mode:y,reason:`loopWarning`,pendingPatchKeys:e,payloadKeys:0,computedDirtyKeys:v?_.size:0,flushCount:B.length,windowMs:A.sampleWindowMs,targetLabel:j,message:`${j?`${j} `:``}疑似运行时更新循环:${B.length} 次 setData flush/${A.sampleWindowMs}ms`},t))},Z=()=>u({state:p,setupState:m,computedRefs:g,includeComputed:v,shouldIncludeKey:q,plainCache:F,plainCacheEligibility:I,toPlainMaxDepth:S,toPlainMaxKeys:C,includeFunctions:w,functionPaths:T});te();let ie=()=>{let t=n(p)?e(p):p,r=m&&typeof m==`object`?n(m)?e(m):m:void 0,a=Y.state.dispatchedSnapshot,o={...a},s=/* @__PURE__ */ new WeakMap,l=/* @__PURE__ */ new Set,u=/* @__PURE__ */ new Set,d=/* @__PURE__ */ new Set;for(let e of/* @__PURE__ */ new Set([...Object.keys(t),...r?Object.keys(r):[]])){if(!q(e))continue;l.add(e);let n=r&&i(r,e)?r:t,u=G(n[e]),f=R[e];f&&u&&typeof f==`object`&&typeof u==`object`&&i(f,`raw`)&&i(u,`raw`)&&Array.isArray(f.raw)&&Array.isArray(u.raw)&&f.raw!==u.raw&&d.add(e),
|
|
1
|
+
import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{getReactiveVersion as t,isReactive as n}from"../../../reactivity/reactive.mjs";import{isRef as r}from"../../../reactivity/ref.mjs";import{hasOwn as i}from"../../../utils.mjs";import{hasTrackableSetupBinding as a}from"../../setupTracking.mjs";import{resolveBindingDiagnostics as o}from"../../bindingManifest.mjs";import{diffSnapshots as s,toPlain as c}from"../../diff.mjs";import{createSetDataObservation as l}from"./observation.mjs";import{collectSnapshot as u}from"./snapshot.mjs";import{createSetDataCommitTracker as d}from"./commitTracker.mjs";function f(f){let{state:p,setupState:m,snapshotOmitKeys:h,computedRefs:g,dirtyComputedKeys:_,includeComputed:v,setDataStrategy:y,currentAdapter:b,shouldIncludeKey:x,toPlainMaxDepth:S,toPlainMaxKeys:C,includeFunctions:w=!1,functionPaths:T,debug:E,debugWhen:D,debugSampleRate:O,bindingManifest:k,loopWarning:A,targetLabel:j,runTracker:M,isMounted:ee,initialSnapshot:N,initialState:P}=f,F=/* @__PURE__ */ new WeakMap,I=/* @__PURE__ */ new WeakMap,L={},R=Object.create(null),z=Object.create(null),B=[],V=-1/0,H=new Set(P&&typeof P==`object`?Object.keys(P):[]),U=e=>{if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},W=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>W(e,t[n]));if(U(e)&&U(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>i(t,n)&&W(e[n],t[n]))}return!1},G=i=>{let o=r(i)?i.value:i;if(typeof o!=`object`||!o)return o;if(!n(o)&&a(o))return{snapshot:c(o,/* @__PURE__ */ new WeakMap,{cacheEligibility:I,maxDepth:S,maxKeys:C,includeFunctions:w,functionPaths:T})};let s=n(o)?e(o):o;return{raw:s,version:t(s)}},K=(e,t)=>Object.is(e,t)?!0:!e||!t||typeof e!=`object`||typeof t!=`object`||!i(e,`raw`)||!i(t,`raw`)?e&&t&&typeof e==`object`&&typeof t==`object`&&i(e,`snapshot`)&&i(t,`snapshot`)?W(e.snapshot,t.snapshot):!1:e.raw===t.raw&&e.version===t.version,q=e=>x(e)&&!h?.has(e);if(N)for(let[e,t]of Object.entries(N))q(e)&&(L[e]=t);let te=()=>{if(!N)return;let t=n(p)?e(p):p,r=m&&typeof m==`object`?n(m)?e(m):m:void 0;for(let e of Object.keys(N))if(q(e)){if(r&&i(r,e))R[e]=G(r[e]);else if(i(t,e)){if(H.has(e))continue;t[e]=N[e],R[e]=G(t[e])}}},ne=t=>{let a=[],o=m&&typeof m==`object`?n(m)?e(m):m:void 0;for(let n of/* @__PURE__ */ new Set([...Object.keys(p),...o?Object.keys(o):[]])){if(!q(n))continue;let s=o&&i(o,n)?o[n]:p[n],c=r(s)?s.value:s;c&&typeof c==`object`&&e(c)===t&&a.push(n)}return a},J=(e,t)=>{if(!E)return;let n=e.reason!==`patch`&&e.reason!==`diff`;if(D===`fallback`&&!n||e.reason!==`commitFailure`&&O<1&&Math.random()>O)return;let r=e;if(k){let n=typeof t==`function`?t():t??[],i=e.reason===`needsFullSnapshot`||e.reason===`maxPatchKeys`||e.reason===`maxPayloadBytes`;r={...e,bindings:o(k,n,i)}}try{E(r)}catch{}},Y,X=f.debugPhases&&E?l({debug:E,debugWhen:D,debugSampleRate:O,targetLabel:j,committedRevision:()=>Y.state.committedRevision}):void 0;Y=d({observe:X?.revision,initialSnapshot:L,adapter:b,onFailure:e=>{J({mode:e.mode,reason:`commitFailure`,pendingPatchKeys:e.pendingPatchKeys,payloadKeys:e.payloadKeys,revision:e.revision,committedRevision:e.committedRevision,targetLabel:j,message:e.error.message});try{b.__wevu_reportSetDataError?.(e.error)}catch{}}});let re=(e=0,t)=>{if(!A)return;let n=Date.now();B.push(n);let r=n-A.sampleWindowMs;for(;B.length&&B[0]<r;)B.shift();B.length<=A.maxFlushes||A.coolDownMs>0&&n-V<A.coolDownMs||(V=n,J({mode:y,reason:`loopWarning`,pendingPatchKeys:e,payloadKeys:0,computedDirtyKeys:v?_.size:0,flushCount:B.length,windowMs:A.sampleWindowMs,targetLabel:j,message:`${j?`${j} `:``}疑似运行时更新循环:${B.length} 次 setData flush/${A.sampleWindowMs}ms`},t))},Z=()=>u({state:p,setupState:m,computedRefs:g,includeComputed:v,shouldIncludeKey:q,plainCache:F,plainCacheEligibility:I,toPlainMaxDepth:S,toPlainMaxKeys:C,includeFunctions:w,functionPaths:T});te();let ie=()=>{let t=n(p)?e(p):p,r=m&&typeof m==`object`?n(m)?e(m):m:void 0,a=Y.state.dispatchedSnapshot,o={...a},s=/* @__PURE__ */ new WeakMap,l=/* @__PURE__ */ new Set,u=/* @__PURE__ */ new Set,d=/* @__PURE__ */ new Set;for(let e of/* @__PURE__ */ new Set([...Object.keys(t),...r?Object.keys(r):[]])){if(!q(e))continue;l.add(e);let n=r&&i(r,e)?r:t,u=G(n[e]),f=R[e];f&&u&&typeof f==`object`&&typeof u==`object`&&i(f,`raw`)&&i(u,`raw`)&&Array.isArray(f.raw)&&Array.isArray(u.raw)&&f.raw!==u.raw&&d.add(e),K(f,u)&&i(a,e)||(o[e]=c(n[e],s,{cache:F,cacheEligibility:I,maxDepth:S,maxKeys:C,includeFunctions:w,functionPaths:T,_path:e})),R[e]=u}for(let e of Object.keys(R))l.has(e)||(delete R[e],v&&i(g,e)||delete o[e]);if(!v){for(let e of Object.keys(z))delete z[e];return{snapshot:o,replacedTopLevelKeys:d}}for(let e of Object.keys(g)){if(!q(e))continue;u.add(e);let t=g[e].value,n=G(t);K(z[e],n)&&i(a,e)||(o[e]=c(t,s,{cache:F,cacheEligibility:I,maxDepth:S,maxKeys:C,includeFunctions:w,functionPaths:T,_path:e})),z[e]=n}for(let e of Object.keys(z))u.has(e)||(delete z[e],i(t,e)&&q(e)||delete o[e]);return{snapshot:o,replacedTopLevelKeys:d}},Q=(e=`diff`,t=0,n)=>{let r=y===`diff`?ie():void 0,i=r?.snapshot??Z(),a=Y.state.dispatchedSnapshot,o=Y.state.needsFullSnapshot,c=o?Y.createFullPayload(i):r?(()=>{let e={};for(let t of r.replacedTopLevelKeys)e[t]=i[t];return{...s(a,i,{skipKeys:r.replacedTopLevelKeys}),...e}})():s(a,i);n?.(i);let l=Object.keys(c).length;if(!l&&!o)return;let u=o?`needsFullSnapshot`:e;J({mode:`diff`,reason:u,pendingPatchKeys:t,payloadKeys:l},Object.keys(c)),Y.dispatch({mode:`diff`,kind:o?`full`:`delta`,reason:u,snapshot:i,payload:c,pendingPatchKeys:t})},$=(e=0,t)=>ee()?(X?.prepare(),re(e,t),M(),!0):!1;return{collect:Z,emitDebug:J,getLatestSnapshot:()=>Y.state.dispatchedSnapshot,dispatchUpdate:Y.dispatch,needsFullSnapshot:()=>Y.state.needsFullSnapshot,job:e=>{if($())return Q(`diff`)},plainCache:F,plainCacheEligibility:I,prepareJob:$,resolveTopKeysByRoot:ne,runDiffUpdate:Q,shouldIncludeSnapshotKey:q,snapshot:()=>y===`patch`?Z():{...Y.state.dispatchedSnapshot},cloneLatestSnapshot:()=>({...Y.state.dispatchedSnapshot}),dispose:Y.dispose}}export{f as createSetDataScheduler};
|
package/dist/runtime/app.d.mts
CHANGED
|
@@ -2,6 +2,4 @@ import { ComputedDefinitions, MethodDefinitions } from "../types/definitions.mjs
|
|
|
2
2
|
import { RuntimeApp } from "./types/runtime.mjs";
|
|
3
3
|
import { CreateAppOptions } from "./types/options.mjs";
|
|
4
4
|
import "./types.mjs";
|
|
5
|
-
|
|
6
|
-
export declare function createApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(options: CreateAppOptions<D, C, M>): RuntimeApp<D, C, M>;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare function createApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(options: CreateAppOptions<D, C, M>): RuntimeApp<D, C, M>;
|
|
@@ -4,7 +4,6 @@ import { InternalRuntimeState, RuntimeInstance } from "./types/runtime.mjs";
|
|
|
4
4
|
import "./types.mjs";
|
|
5
5
|
import { SetDataSchedulerOptions } from "./app/setData/scheduler.mjs";
|
|
6
6
|
import { InlineExpressionMap } from "./register/inline.mjs";
|
|
7
|
-
//#region src/runtime/capabilities.d.ts
|
|
8
7
|
export type RuntimeCapabilityName = 'patchStrategy' | 'templateRefs' | 'inlineEvents' | 'setDataHighFrequencyWarning' | 'scopedSlots' | 'layout' | 'jsxIslands';
|
|
9
8
|
export interface TemplateRefBinding {
|
|
10
9
|
selector: string;
|
|
@@ -73,5 +72,4 @@ export interface RuntimeCapabilityRegistry {
|
|
|
73
72
|
attachMethods: (methods: Record<string, (...args: any[]) => any>) => void;
|
|
74
73
|
};
|
|
75
74
|
}
|
|
76
|
-
//#endregion
|
|
77
75
|
export type { SetDataSchedulerOptions };
|
package/dist/runtime/css.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComputedRef } from "../reactivity/computed.mjs";
|
|
2
2
|
import "../reactivity/index.mjs";
|
|
3
|
-
//#region src/runtime/css.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* 读取当前 SFC 的 CSS Modules 映射。
|
|
6
5
|
*/
|
|
@@ -9,5 +8,4 @@ export declare function useCssModule(name?: string): Record<string, string>;
|
|
|
9
8
|
* 注册编译器生成的响应式 CSS 变量。
|
|
10
9
|
* @internal
|
|
11
10
|
*/
|
|
12
|
-
export declare function useCssVars(getter: (context: Record<string, any>) => Record<string, unknown>): ComputedRef<string>;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare function useCssVars(getter: (context: Record<string, any>) => Record<string, unknown>): ComputedRef<string>;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { CreateAppOptions, DefineComponentOptions } from "./types/options.mjs";
|
|
2
2
|
import "./types.mjs";
|
|
3
|
-
//#region src/runtime/defaults.d.ts
|
|
4
3
|
export declare const INTERNAL_DEFAULTS_SCOPE_KEY = "__wevuDefaultsScope";
|
|
5
4
|
export interface WevuDefaults {
|
|
6
5
|
app?: Partial<CreateAppOptions<any, any, any>>;
|
|
7
6
|
component?: Partial<DefineComponentOptions<any, any, any, any>>;
|
|
8
7
|
}
|
|
9
8
|
export declare function setWevuDefaults(next: WevuDefaults): void;
|
|
10
|
-
export declare function resetWevuDefaults(): void;
|
|
11
|
-
//#endregion
|
|
9
|
+
export declare function resetWevuDefaults(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasOwn as e}from"../../utils.mjs";import{WEVU_NATIVE_DECLARATION_ADDRESS_PROP as t,WEVU_NATIVE_SLOT_CONTEXT_KEY as n,WEVU_SLOT_NAMES_PROP as r,WEVU_SLOT_OWNER_ID_PROP as i,WEVU_SLOT_SCOPE_KEY as a}from"@weapp-core/constants";const o=`__wevu_allowNullPropInput`,s=`allowNullPropInput`,c=/* @__PURE__ */ new Map([[String,String],[Number,Number],[Boolean,Boolean],[Object,Object],[Array,Array],[Function,Function],[`String`,String],[`Number`,Number],[`Boolean`,Boolean],[`Object`,Object],[`Array`,Array],[`Function`,Function],[null,null],[`null`,null],[`Null`,null]]);function l(e){return c.get(e)}function u(e,t=[]){if(Array.isArray(e)){for(let n of e)u(n,t);return t}let n=l(e);return n!==void 0&&!t.includes(n)&&t.push(n),t}function d(e){if(e===void 0)return[];let t=u(e).filter(e=>e!==null);return t.length>0?t:[null]}function f(e,t){let n=d(t);if(n.length!==0&&(e.type=n[0],n.length>1)){let t=[];for(let e of n.slice(1))t.includes(e)||t.push(e);t.length>0&&(e.optionalTypes=t)}}function p(t){e(t,`value`)||(t.type===String?t.value=``:t.type===Number?t.value=0:t.type===Boolean?t.value=!1:t.type===Array&&(t.value=[]))}function m(e,t,n){if(!n||e.type===null)return;let r=t&&typeof t==`object`&&!Array.isArray(t)?t:void 0,i=u(r?[r.type,r.optionalTypes]:t),a=i.includes(null),o=i.filter(e=>e!==null).length>1,s=r?.required!==!0;(a||o||s)&&(a||p(e),e.type=null,delete e.optionalTypes)}function h(t,n){let r={};return t&&Object.entries(t).forEach(([t,i])=>{if(i!==void 0){if(i===null)r[t]={type:null};else if(Array.isArray(i)||typeof i==`function`){let a={};f(a,i),e(a,`type`)||(a.type=null),m(a,i,n),r[t]=a}else if(typeof i==`object`){if(t.endsWith(`Modifiers`)&&Object.keys(i).length===0){r[t]={type:Object,value:{}};return}let a={};if(`type`in i&&i.type!==void 0&&f(a,i.type),Array.isArray(i.optionalTypes)){let e=i.optionalTypes.map(e=>l(e)).filter(e=>e!=null);if(e.length>0){let t=Array.isArray(a.optionalTypes)?a.optionalTypes:[];for(let n of e)n!==a.type&&(t.includes(n)||t.push(n));t.length>0&&(a.optionalTypes=t)}}`observer`in i&&(typeof i.observer==`function`||typeof i.observer==`string`)&&(a.observer=i.observer);let o=`default`in i?i.default:i.value;o!==void 0&&(a.value=typeof o==`function`?o():o),e(a,`type`)||(a.type=null),m(a,i,n),r[t]=a}}}),r}function g(c,l,u){let d=!!(c[o]??c[s]),{[o]:f,[s]:p,...m}=c,g=c.properties,_=g&&typeof g==`object`&&Object.keys(g).length>0?g:void 0,v=u??_,y=!!(l||v),b=o=>{let s={...o??{}};return
|
|
1
|
+
import{hasOwn as e}from"../../utils.mjs";import{WEVU_NATIVE_DECLARATION_ADDRESS_PROP as t,WEVU_NATIVE_SLOT_CONTEXT_KEY as n,WEVU_SLOT_NAMES_PROP as r,WEVU_SLOT_OWNER_ID_PROP as i,WEVU_SLOT_SCOPE_KEY as a}from"@weapp-core/constants";const o=`__wevu_allowNullPropInput`,s=`allowNullPropInput`,c=/* @__PURE__ */ new Map([[String,String],[Number,Number],[Boolean,Boolean],[Object,Object],[Array,Array],[Function,Function],[`String`,String],[`Number`,Number],[`Boolean`,Boolean],[`Object`,Object],[`Array`,Array],[`Function`,Function],[null,null],[`null`,null],[`Null`,null]]);function l(e){return c.get(e)}function u(e,t=[]){if(Array.isArray(e)){for(let n of e)u(n,t);return t}let n=l(e);return n!==void 0&&!t.includes(n)&&t.push(n),t}function d(e){if(e===void 0)return[];let t=u(e).filter(e=>e!==null);return t.length>0?t:[null]}function f(e,t){let n=d(t);if(n.length!==0&&(e.type=n[0],n.length>1)){let t=[];for(let e of n.slice(1))t.includes(e)||t.push(e);t.length>0&&(e.optionalTypes=t)}}function p(t){e(t,`value`)||(t.type===String?t.value=``:t.type===Number?t.value=0:t.type===Boolean?t.value=!1:t.type===Array&&(t.value=[]))}function m(e,t,n){if(!n||e.type===null)return;let r=t&&typeof t==`object`&&!Array.isArray(t)?t:void 0,i=u(r?[r.type,r.optionalTypes]:t),a=i.includes(null),o=i.filter(e=>e!==null).length>1,s=r?.required!==!0;(a||o||s)&&(a||p(e),e.type=null,delete e.optionalTypes)}function h(t,n){let r={};return t&&Object.entries(t).forEach(([t,i])=>{if(i!==void 0){if(i===null)r[t]={type:null};else if(Array.isArray(i)||typeof i==`function`){let a={};f(a,i),e(a,`type`)||(a.type=null),m(a,i,n),r[t]=a}else if(typeof i==`object`){if(t.endsWith(`Modifiers`)&&Object.keys(i).length===0){r[t]={type:Object,value:{}};return}let a={};if(`type`in i&&i.type!==void 0&&f(a,i.type),Array.isArray(i.optionalTypes)){let e=i.optionalTypes.map(e=>l(e)).filter(e=>e!=null);if(e.length>0){let t=Array.isArray(a.optionalTypes)?a.optionalTypes:[];for(let n of e)n!==a.type&&(t.includes(n)||t.push(n));t.length>0&&(a.optionalTypes=t)}}`observer`in i&&(typeof i.observer==`function`||typeof i.observer==`string`)&&(a.observer=i.observer);let o=`default`in i?i.default:i.value;o!==void 0&&(a.value=typeof o==`function`?o():o),e(a,`type`)||(a.type=null),m(a,i,n),r[t]=a}}}),r}function g(c,l,u){let d=!!(c[o]??c[s]),{[o]:f,[s]:p,...m}=c,g=c.properties,_=g&&typeof g==`object`&&Object.keys(g).length>0?g:void 0,v=u??_,y=!!(l||v),b=o=>{let s={...o??{}};return import.meta.env?.PLATFORM&&import.meta.env?.PLATFORM!==`weapp`||c[n]!==!0||(s[t]={type:Array,value:[]}),y&&(e(s,i)||(s[i]={type:String,value:``}),e(s,a)||(s[a]={type:null,value:null}),e(s,r)||(s[r]={type:null,value:null})),s};if(v){let{properties:e,...t}=m,n=v,r=h(l,d);return{...t,properties:b({...r,...n})}}return{...m,properties:b(h(l,d))}}export{g as normalizeProps};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requireRuntimeCapability as e,runtimeCapabilityRegistry as t}from"../capabilities.mjs";import{runTeardownSteps as n}from"../teardown.mjs";import{hasOwn as r}from"../../utils.mjs";import{cloneSnapshotValue as i,isDeepEqualValue as a}from"../app/setData/snapshot.mjs";import{decodeWxmlEntities as o,resolveDatasetEventValue as s}from"../inlineDataset.mjs";import{getOwnerProxy as c,getOwnerSnapshot as l,getOwnerTarget as u,subscribeOwner as d}from"../scopedSlots.mjs";import{WEVU_BINDING_MANIFEST_KEY as f,WEVU_INLINE_HANDLER as p,WEVU_INLINE_MAP_KEY as m,WEVU_LAYOUT_HOSTS_KEY as h,WEVU_NATIVE_SLOT_CONTEXT_KEY as g,WEVU_OWNER_HANDLER as _,WEVU_PROPS_DERIVED_KEYS_KEY as v,WEVU_PUBLIC_RUNTIME_KEY as y,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as b,WEVU_SLOT_FUNCTION_TOKEN as x,WEVU_SLOT_OWNER_ID_KEY as S,WEVU_SLOT_OWNER_ID_PROP as C,WEVU_SLOT_OWNER_KEY as w,WEVU_SLOT_OWNER_PROXY_KEY as T,WEVU_SLOT_PROPS_DATA_KEY as E,WEVU_SLOT_PROPS_KEY as D,WEVU_SLOT_SCOPE_KEY as O,WEVU_TEMPLATE_REFS_KEY as k}from"@weapp-core/constants";const A=[S,C,T,w,E,D,O];function j(e){let t=e?.currentTarget?.dataset??e?.target?.dataset??{},n=s(t,`wvArgs`,e),r=[];if(Array.isArray(n))r=n;else if(typeof n==`string`)try{r=JSON.parse(n)}catch{try{r=JSON.parse(o(n))}catch{r=[]}}return Array.isArray(r)||(r=[]),r.map(t=>t===`$event`?e:t)}function M(e){if(!e||typeof e!=`object`)return{};if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n];typeof r==`string`&&r&&(t[r]=e[n+1])}return t}return e}function N(e){return Array.isArray(e)&&e[0]===x&&typeof e[1]==`string`}function P(e,t){return(...n)=>{let r=e?.selectOwnerComponent?.(),i=r?.[p];if(typeof i!=`function`)return;let a={wd:1,wi:t[1]},o=Array.isArray(t[2])?t[2]:[],s=Array.isArray(t[3])?t[3]:[];o.forEach((e,t)=>a[`wvS${t}`]=e),s.forEach((e,t)=>a[`wvI${t}`]=e);let c={type:`wv-slot-function`,detail:n,currentTarget:{dataset:a},target:{dataset:a}};return i.call(r,c)}}function F(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]=N(i)?P(e,i):i;return n}function I(e){return e?.__wevu?.proxy??e?.[y]?.proxy??e}function L(e,t){if(!t||Object.keys(t).length===0)return;let n=I(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof i?.get==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch{}return r}function R(e){e?.__wevu?.__wevu_flushSetupSnapshotSync?.()}function z(e,t,n){R(e);let o=L(e,t);if(!o||typeof e?.setData!=`function`)return;let s=r(e,`__wvScopedSlotComputedSnapshot`),c=e.__wvScopedSlotComputedSnapshot??{},l={},u={};for(let[e,t]of Object.entries(o))l[e]=i(t)
|
|
1
|
+
import{requireRuntimeCapability as e,runtimeCapabilityRegistry as t}from"../capabilities.mjs";import{runTeardownSteps as n}from"../teardown.mjs";import{hasOwn as r}from"../../utils.mjs";import{cloneSnapshotValue as i,isDeepEqualValue as a}from"../app/setData/snapshot.mjs";import{decodeWxmlEntities as o,resolveDatasetEventValue as s}from"../inlineDataset.mjs";import{getOwnerProxy as c,getOwnerSnapshot as l,getOwnerTarget as u,subscribeOwner as d}from"../scopedSlots.mjs";import{WEVU_BINDING_MANIFEST_KEY as f,WEVU_INLINE_HANDLER as p,WEVU_INLINE_MAP_KEY as m,WEVU_LAYOUT_HOSTS_KEY as h,WEVU_NATIVE_SLOT_CONTEXT_KEY as g,WEVU_OWNER_HANDLER as _,WEVU_PROPS_DERIVED_KEYS_KEY as v,WEVU_PUBLIC_RUNTIME_KEY as y,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as b,WEVU_SLOT_FUNCTION_TOKEN as x,WEVU_SLOT_OWNER_ID_KEY as S,WEVU_SLOT_OWNER_ID_PROP as C,WEVU_SLOT_OWNER_KEY as w,WEVU_SLOT_OWNER_PROXY_KEY as T,WEVU_SLOT_PROPS_DATA_KEY as E,WEVU_SLOT_PROPS_KEY as D,WEVU_SLOT_SCOPE_KEY as O,WEVU_TEMPLATE_REFS_KEY as k}from"@weapp-core/constants";const A=[S,C,T,w,E,D,O];function j(e){let t=e?.currentTarget?.dataset??e?.target?.dataset??{},n=s(t,`wvArgs`,e),r=[];if(Array.isArray(n))r=n;else if(typeof n==`string`)try{r=JSON.parse(n)}catch{try{r=JSON.parse(o(n))}catch{r=[]}}return Array.isArray(r)||(r=[]),r.map(t=>t===`$event`?e:t)}function M(e){if(!e||typeof e!=`object`)return{};if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n];typeof r==`string`&&r&&(t[r]=e[n+1])}return t}return e}function N(e){return Array.isArray(e)&&e[0]===x&&typeof e[1]==`string`}function P(e,t){return(...n)=>{let r=e?.selectOwnerComponent?.(),i=r?.[p];if(typeof i!=`function`)return;let a={wd:1,wi:t[1]},o=Array.isArray(t[2])?t[2]:[],s=Array.isArray(t[3])?t[3]:[];o.forEach((e,t)=>a[`wvS${t}`]=e),s.forEach((e,t)=>a[`wvI${t}`]=e);let c={type:`wv-slot-function`,detail:n,currentTarget:{dataset:a},target:{dataset:a}};return i.call(r,c)}}function F(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]=N(i)?P(e,i):i;return n}function I(e){return e?.__wevu?.proxy??e?.[y]?.proxy??e}function L(e,t){if(!t||Object.keys(t).length===0)return;let n=I(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof i?.get==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch{}return r}function R(e){e?.__wevu?.__wevu_flushSetupSnapshotSync?.()}function z(e,t,n){R(e);let o=L(e,t);if(!o||typeof e?.setData!=`function`)return;let s=r(e,`__wvScopedSlotComputedSnapshot`),c=e.__wvScopedSlotComputedSnapshot??{},l={},u={};for(let[e,t]of Object.entries(o))l[e]=i(t),!n?.force&&s&&r(c,e)&&a(c[e],t,20,{keys:1e4})||(u[e]=t);for(let e of Object.keys(c))r(o,e)||(u[e]=null);e.__wvScopedSlotComputedSnapshot=l,Object.keys(u).length>0&&e.setData(u)}function B(e,t){let n=r(t??{},O)?t[O]:e?.properties?.[O],o=r(t??{},D)?t[D]:e?.properties?.[D],s=M(n),c=M(o),l={...s,...c},u=!r(e,`__wvSlotPropsSnapshot`)||!a(e.__wvSlotPropsSnapshot??{},l,20,{keys:1e4}),d=u||!e[E]?F(e,l):e[E];u&&(e.__wvSlotPropsSnapshot=i(l)),e[E]=d;let f=e?.__wevu?.state,p=!(!f||typeof f!=`object`||r(f,E)&&a(f[E]??{},l,20,{keys:1e4}));return f&&typeof f==`object`&&(f[E]=d),{merged:d,runtimeSnapshotChanged:p,snapshot:l,snapshotChanged:u}}function V(e,t,n){let{runtimeSnapshotChanged:r,snapshot:i,snapshotChanged:a}=B(e,n);(a||r)&&typeof e?.setData==`function`&&e.setData({[E]:i}),a&&z(e,t)}function H(e,t){let n=!1;e[T]!==t&&(e[T]=t,n=!0);let r=e?.data;if(r&&typeof r==`object`&&r[T]!==t){try{Object.defineProperty(r,T,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch{r[T]=t}n=!0}let i=e?.__wevu?.state;return i&&typeof i==`object`&&i[T]!==t&&(i[T]=t,n=!0),n}function U(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function W(e,t,n,r){if(typeof e==`function`){n[t]=e;return}if(typeof e!=`object`||!e)return e;if(r.has(e))return;if(Array.isArray(e)){r.add(e);let i=e.map((e,i)=>{let a=W(e,`${t}.${i}`,n,r);return a===void 0?null:a});return r.delete(e),i}if(!U(e))return i(e);r.add(e);let a={};for(let[i,o]of Object.entries(e)){let e=W(o,`${t}.${i}`,n,r);e!==void 0&&(a[i]=e)}return r.delete(e),a}function G(e){let t={},n=W(e,w,t,/* @__PURE__ */ new WeakSet);return{[w]:n,...t}}function K(e,t,n,o){let s=H(e,n),{snapshotChanged:c}=B(e),l=t||{},u=!r(e,`__wvOwnerSnapshot`)||!a(e.__wvOwnerSnapshot??{},l,20,{keys:1e4});if(u){e.__wvOwnerSnapshot=i(l),e[w]=l;let t=e?.__wevu?.state;t&&typeof t==`object`&&(t[w]=l)}u&&typeof e?.setData==`function`&&e.setData(G(l)),(u||s||c)&&z(e,o)}function q(e,t,n){if(!t){typeof e?.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerUnsub=void 0,e.__wvOwnerBoundId=``,H(e,void 0);return}let r=(t,r)=>{K(e,t,r,n)};e.__wvOwnerBoundId!==t&&(typeof e.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerBoundId=t,e.__wvOwnerUnsub=d(t,r));let i=l(t);i&&r(i,c(t))}function J(e){return e?.properties?.[C]??e?.properties?.[S]??``}function Y(e,t){V(e,t);let n=J(e);n&&q(e,n,t)}function X(){let e={[w]:{},[E]:{}};return Object.defineProperty(e,T,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function Z(r){let i=r?.computed,a=r?.layoutHosts,o=r?.templateRefs;o?.length&&e(`templateRefs`,`createWevuScopedSlotComponent(templateRefs)`);let c=!!(r?.inlineMap&&Object.keys(r.inlineMap).length);c&&e(`inlineEvents`,`createWevuScopedSlotComponent(inlineMap)`),a?.length&&e(`layout`,`createWevuScopedSlotComponent(layoutHosts)`);let l=e=>{let t=J(e);return t?u(t):void 0},d={[g]:r?.[g],[b]:!0,options:{virtualHost:!0},setData:{omit:A},[v]:A,properties:{[C]:{type:String,value:``,observer(e){q(this,e||``,i)}},[S]:{type:String,value:``,observer(e){q(this,e||``,i)}},[D]:{type:null,value:null,observer(e){V(this,i,{[D]:e})}},[O]:{type:null,value:null,observer(e){V(this,i,{[O]:e})}}},data:X,lifetimes:{attached(){Y(this,i)},ready(){Y(this,i),z(this,i,{force:!0});let e=l(this);e&&o?.length&&t.templateRefs?.schedule(this,void 0,e)},detached(){let e=l(this);n([()=>{e&&o?.length&&t.templateRefs?.clear(this,e)},()=>{typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub()},()=>{this.__wvOwnerUnsub=void 0,this.__wvOwnerBoundId=``},()=>H(this,void 0)])}},methods:{[_](e){let n=this[T],r=this.__wevu?.methods?.[m];if(c){let i=t.inlineEvents?.run(n,void 0,e,r);if(i!==void 0)return i}if(!n)return;let i=e?.currentTarget?.dataset??e?.target?.dataset??{},a=s(i,`wvHandler`,e);if(typeof a!=`string`||!a)return;let o=n?.[a];if(typeof o!=`function`)return;let l=j(e);return o.apply(n,l)}}};return r?.computed&&Object.keys(r.computed).length>0&&(d.computed=r.computed),r?.inlineMap&&Object.keys(r.inlineMap).length>0&&(d.methods={...d.methods,[m]:r.inlineMap}),o?.length&&(d[k]=o),a?.length&&(d[h]=a),r?.[f]&&(d[f]=r[f]),d}export{Z as createScopedSlotOptions};
|
|
@@ -9,7 +9,6 @@ import { DefineComponent, ShallowUnwrapRef } from "../vue-types.mjs";
|
|
|
9
9
|
import { DefineComponentOptions } from "./types/options.mjs";
|
|
10
10
|
import "./types.mjs";
|
|
11
11
|
import { WevuRuntimeBindingManifestV1 } from "@weapp-core/constants";
|
|
12
|
-
//#region src/runtime/define.d.ts
|
|
13
12
|
/**
|
|
14
13
|
* defineComponent 返回的组件定义描述,用于手动注册或高级用法。
|
|
15
14
|
*/
|
|
@@ -115,5 +114,4 @@ export declare function getWevuComponentLifecycleDefinition(definition: object):
|
|
|
115
114
|
export declare function createWevuComponent<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions>(options: DefineComponentOptions<P, D, C, M> & {
|
|
116
115
|
properties?: HostMiniProgramComponentPropertyOption;
|
|
117
116
|
}): void;
|
|
118
|
-
//#endregion
|
|
119
117
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/runtime/disposables.d.ts
|
|
2
1
|
export type DisposableMethodName = 'dispose' | 'abort' | 'cancel' | 'stop' | 'disconnect' | 'destroy' | 'close';
|
|
3
2
|
export type DisposableObject = Partial<Record<DisposableMethodName, () => void>>;
|
|
4
3
|
export type DisposableLike = (() => void) | DisposableObject;
|
|
@@ -26,5 +25,4 @@ export interface DisposableBag {
|
|
|
26
25
|
* 典型用法:注册定时器、请求任务、事件监听退订函数,
|
|
27
26
|
* 在页面/组件卸载时自动批量清理,减少内存泄漏风险。
|
|
28
27
|
*/
|
|
29
|
-
export declare function useDisposables(): DisposableBag;
|
|
30
|
-
//#endregion
|
|
28
|
+
export declare function useDisposables(): DisposableBag;
|
|
@@ -3,7 +3,6 @@ import { MaybeRefOrGetter } from "../reactivity/ref.mjs";
|
|
|
3
3
|
import "../reactivity/index.mjs";
|
|
4
4
|
import { InternalRuntimeState } from "./types/runtime.mjs";
|
|
5
5
|
import "./types.mjs";
|
|
6
|
-
//#region src/runtime/elementIntersectionObserver.d.ts
|
|
7
6
|
export type ElementIntersectionObserverCallback<T = unknown> = (result: T) => void;
|
|
8
7
|
export interface UseElementIntersectionObserverOptions<T = unknown> {
|
|
9
8
|
context?: InternalRuntimeState | null;
|
|
@@ -21,5 +20,4 @@ export interface UseElementIntersectionObserverReturn {
|
|
|
21
20
|
/**
|
|
22
21
|
* 观察当前组件或页面内的节点可见性,并在卸载时自动断开。
|
|
23
22
|
*/
|
|
24
|
-
export declare function useElementIntersectionObserver<T = unknown>(options: UseElementIntersectionObserverOptions<T>): UseElementIntersectionObserverReturn;
|
|
25
|
-
//#endregion
|
|
23
|
+
export declare function useElementIntersectionObserver<T = unknown>(options: UseElementIntersectionObserverOptions<T>): UseElementIntersectionObserverReturn;
|
|
@@ -2,7 +2,6 @@ import { WevuPageLayoutMap } from "../../types/pageLayout.mjs";
|
|
|
2
2
|
import { PageLayoutState, resolveRuntimePageLayoutName as resolveRuntimePageLayoutName$1, syncRuntimePageLayoutState as syncRuntimePageLayoutState$1, syncRuntimePageLayoutStateFromRuntime as syncRuntimePageLayoutStateFromRuntime$1, usePageLayout as usePageLayout$1 } from "../pageLayout.mjs";
|
|
3
3
|
import { LayoutHostBinding } from "../capabilities.mjs";
|
|
4
4
|
import { LayoutBridgeInstance, registerPageLayoutBridge as registerPageLayoutBridge$1, registerRuntimeLayoutHosts as registerRuntimeLayoutHosts$1, resolveLayoutBridge as resolveLayoutBridge$1, resolveLayoutHost as resolveLayoutHost$1, unregisterPageLayoutBridge as unregisterPageLayoutBridge$1, unregisterRuntimeLayoutHosts as unregisterRuntimeLayoutHosts$1, useLayoutBridge as useLayoutBridge$1, useLayoutHosts as useLayoutHosts$1, waitForLayoutHost as waitForLayoutHost$1 } from "../layoutBridge.mjs";
|
|
5
|
-
//#region src/runtime/features/publicLayout.d.ts
|
|
6
5
|
export declare const registerPageLayoutBridge: typeof registerPageLayoutBridge$1;
|
|
7
6
|
export declare const unregisterPageLayoutBridge: typeof unregisterPageLayoutBridge$1;
|
|
8
7
|
export declare const resolveLayoutBridge: typeof resolveLayoutBridge$1;
|
|
@@ -20,5 +19,4 @@ export declare function setPageLayout<Name extends PublicPageLayoutName>(layout:
|
|
|
20
19
|
export declare const syncRuntimePageLayoutState: typeof syncRuntimePageLayoutState$1;
|
|
21
20
|
export declare const syncRuntimePageLayoutStateFromRuntime: typeof syncRuntimePageLayoutStateFromRuntime$1;
|
|
22
21
|
export declare const resolveRuntimePageLayoutName: typeof resolveRuntimePageLayoutName$1;
|
|
23
|
-
//#endregion
|
|
24
22
|
export type { LayoutBridgeInstance, LayoutHostBinding, PageLayoutState, WevuPageLayoutMap };
|
|
@@ -3,7 +3,6 @@ import "../types.mjs";
|
|
|
3
3
|
import { InlineExpressionMap } from "../register/inline.mjs";
|
|
4
4
|
import { LayoutHostBinding, TemplateRefBinding } from "../capabilities.mjs";
|
|
5
5
|
import { WEVU_BINDING_MANIFEST_KEY, WEVU_NATIVE_SLOT_CONTEXT_KEY, WevuRuntimeBindingManifestV1 } from "@weapp-core/constants";
|
|
6
|
-
//#region src/runtime/features/scopedSlots.d.ts
|
|
7
6
|
export interface CreateWevuScopedSlotComponentOptions {
|
|
8
7
|
computed?: ComputedDefinitions;
|
|
9
8
|
inlineMap?: InlineExpressionMap;
|
|
@@ -19,5 +18,4 @@ export declare function createWevuScopedSlotComponent(overrides?: CreateWevuScop
|
|
|
19
18
|
/**
|
|
20
19
|
* 安装作用域插槽的 owner 生命周期与组件创建能力。
|
|
21
20
|
*/
|
|
22
|
-
export declare function installScopedSlots(): void;
|
|
23
|
-
//#endregion
|
|
21
|
+
export declare function installScopedSlots(): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { InternalRuntimeState } from "../types/runtime.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/hooks/base.d.ts
|
|
4
3
|
export declare function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined;
|
|
5
4
|
/**
|
|
6
5
|
* 设置当前运行时实例(框架内部使用)。
|
|
@@ -22,5 +21,4 @@ export declare function callHookList(target: InternalRuntimeState, name: string,
|
|
|
22
21
|
* 调用返回值型 hook(框架内部调度入口)。
|
|
23
22
|
* @internal
|
|
24
23
|
*/
|
|
25
|
-
export declare function callHookReturn(target: InternalRuntimeState, name: string, args?: any[]): any;
|
|
26
|
-
//#endregion
|
|
24
|
+
export declare function callHookReturn(target: InternalRuntimeState, name: string, args?: any[]): any;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HostMiniProgramAddToFavoritesOption, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramSaveExitState, HostMiniProgramShareAppMessageOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramUnhandledRejectionResult } from "../types/miniprogramHost.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/hooks/register.d.ts
|
|
4
3
|
export declare function onLaunch(handler: (options: HostMiniProgramLaunchOptions) => void): void;
|
|
5
4
|
export declare function onPageNotFound(handler: (options: HostMiniProgramPageNotFoundOptions) => void): void;
|
|
6
5
|
export declare function onUnhandledRejection(handler: (options: HostMiniProgramUnhandledRejectionResult) => void): void;
|
|
@@ -25,5 +24,4 @@ export declare function onError(handler: (err: any) => void): void;
|
|
|
25
24
|
export declare function onSaveExitState(handler: () => HostMiniProgramSaveExitState): void;
|
|
26
25
|
export declare function onShareAppMessage(handler: (options: HostMiniProgramShareAppMessageOption) => Record<string, any> | void): void;
|
|
27
26
|
export declare function onShareTimeline(handler: HostMiniProgramPageLifetime['onShareTimeline']): void;
|
|
28
|
-
export declare function onAddToFavorites(handler: (options: HostMiniProgramAddToFavoritesOption) => Record<string, any> | void): void;
|
|
29
|
-
//#endregion
|
|
27
|
+
export declare function onAddToFavorites(handler: (options: HostMiniProgramAddToFavoritesOption) => Record<string, any> | void): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { InternalRuntimeState } from "../types/runtime.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/hooks/vue.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Vue 3 对齐:组件/页面已挂载,映射小程序 onReady
|
|
6
5
|
*/
|
|
@@ -47,5 +46,4 @@ export declare function onServerPrefetch(_handler: () => void): void;
|
|
|
47
46
|
* 派发更新阶段钩子(框架内部调度入口)。
|
|
48
47
|
* @internal
|
|
49
48
|
*/
|
|
50
|
-
export declare function callUpdateHooks(target: InternalRuntimeState, phase: 'before' | 'after'): void;
|
|
51
|
-
//#endregion
|
|
49
|
+
export declare function callUpdateHooks(target: InternalRuntimeState, phase: 'before' | 'after'): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions } from "./types/miniprogramHost.mjs";
|
|
2
2
|
import "./types.mjs";
|
|
3
|
-
//#region src/runtime/intersectionObserver.d.ts
|
|
4
3
|
export type UseIntersectionObserverOptions = HostMiniProgramIntersectionObserverOptions;
|
|
5
4
|
export type UseIntersectionObserverResult = HostMiniProgramIntersectionObserver;
|
|
6
5
|
/**
|
|
@@ -9,5 +8,4 @@ export type UseIntersectionObserverResult = HostMiniProgramIntersectionObserver;
|
|
|
9
8
|
* - 优先使用 `ctx.instance.createIntersectionObserver(options)`。
|
|
10
9
|
* - 不可用时回退到宿主全局对象的 `createIntersectionObserver(...)`。
|
|
11
10
|
*/
|
|
12
|
-
export declare function useIntersectionObserver(options?: UseIntersectionObserverOptions): UseIntersectionObserverResult;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare function useIntersectionObserver(options?: UseIntersectionObserverOptions): UseIntersectionObserverResult;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WevuJsxVNode } from "../jsxTypes.mjs";
|
|
2
|
-
//#region src/runtime/jsxIsland.d.ts
|
|
3
2
|
export declare const Fragment: unique symbol;
|
|
4
3
|
export interface WevuJsxIslandNode {
|
|
5
4
|
children?: WevuJsxIslandNode[];
|
|
@@ -32,5 +31,4 @@ export declare function withDirectives(vnode: WevuJsxVNode, directives: unknown[
|
|
|
32
31
|
type: unknown;
|
|
33
32
|
};
|
|
34
33
|
export declare function resolveDirective(name: string): string;
|
|
35
|
-
export declare function normalizeJsxIsland(this: any, value: unknown, islandId: string, adapters: WevuJsxIslandAdapters): WevuJsxIslandNode | null;
|
|
36
|
-
//#endregion
|
|
34
|
+
export declare function normalizeJsxIsland(this: any, value: unknown, islandId: string, adapters: WevuJsxIslandAdapters): WevuJsxIslandNode | null;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LayoutHostBinding } from "./capabilities.mjs";
|
|
2
|
-
//#region src/runtime/layoutBridge.d.ts
|
|
3
2
|
type LayoutBridgeContext = Record<string, any>;
|
|
4
3
|
type LayoutBridgeComponentResolver = (selector: string) => any;
|
|
5
4
|
type LayoutHostMap = Record<string, unknown>;
|
|
@@ -50,5 +49,4 @@ export declare function unregisterRuntimeLayoutHosts(bindings: readonly LayoutHo
|
|
|
50
49
|
* 使用 key -> 宿主实例的映射批量暴露 layout 内部宿主,适合 toast/dialog 等共享反馈节点。
|
|
51
50
|
*/
|
|
52
51
|
export declare function useLayoutHosts(hosts: LayoutHostMap): void;
|
|
53
|
-
//#endregion
|
|
54
52
|
export type { LayoutHostBinding };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Ref } from "../reactivity/ref.mjs";
|
|
2
2
|
import { ComputedRef } from "../reactivity/computed.mjs";
|
|
3
3
|
import "../index.mjs";
|
|
4
|
-
//#region src/runtime/pageEnvironment.d.ts
|
|
5
4
|
export interface PageStackSnapshot {
|
|
6
5
|
canGoBack: boolean;
|
|
7
6
|
currentRoute: string;
|
|
@@ -45,5 +44,4 @@ export declare function useNavigationBarMetrics(options?: UseNavigationBarMetric
|
|
|
45
44
|
navigationHeight: ComputedRef<number>;
|
|
46
45
|
refresh: () => void;
|
|
47
46
|
statusBarHeight: Ref<number, number>;
|
|
48
|
-
};
|
|
49
|
-
//#endregion
|
|
47
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WevuPageLayoutMap } from "../types/pageLayout.mjs";
|
|
2
|
-
//#region src/runtime/pageLayout.d.ts
|
|
3
2
|
type PageLayoutProps = object;
|
|
4
3
|
type ResolveTypedPageLayoutName = keyof WevuPageLayoutMap extends never ? string : Extract<keyof WevuPageLayoutMap, string>;
|
|
5
4
|
type ResolveTypedPageLayoutProps<Name extends string> = Name extends keyof WevuPageLayoutMap ? WevuPageLayoutMap[Name] : PageLayoutProps;
|
|
@@ -21,5 +20,4 @@ export declare function usePageLayout(): Readonly<PageLayoutState>;
|
|
|
21
20
|
export declare function syncRuntimePageLayoutState(target: Record<string, any>, layout: string | false, props: PageLayoutProps): void;
|
|
22
21
|
export declare function syncRuntimePageLayoutStateFromRuntime(target: Record<string, any>): void;
|
|
23
22
|
export declare function resolveRuntimePageLayoutName(layout: string | false): string;
|
|
24
|
-
//#endregion
|
|
25
23
|
export type { WevuPageLayoutMap };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HostMiniProgramPageScrollOption } from "./types/miniprogramHost.mjs";
|
|
2
2
|
import "./types.mjs";
|
|
3
|
-
//#region src/runtime/pageScroll.d.ts
|
|
4
3
|
export interface UsePageScrollThrottleOptions {
|
|
5
4
|
/**
|
|
6
5
|
* 节流间隔(毫秒),默认 80ms。
|
|
@@ -24,5 +23,4 @@ export type UsePageScrollThrottleStopHandle = () => void;
|
|
|
24
23
|
/**
|
|
25
24
|
* 在 setup 中注册节流后的 onPageScroll 监听,并在卸载时自动清理。
|
|
26
25
|
*/
|
|
27
|
-
export declare function usePageScrollThrottle(handler: (opt: HostMiniProgramPageScrollOption) => void, options?: UsePageScrollThrottleOptions): UsePageScrollThrottleStopHandle;
|
|
28
|
-
//#endregion
|
|
26
|
+
export declare function usePageScrollThrottle(handler: (opt: HostMiniProgramPageScrollOption) => void, options?: UsePageScrollThrottleOptions): UsePageScrollThrottleStopHandle;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { setGlobalProvidedValue } from "./provideStore.mjs";
|
|
2
|
-
//#region src/runtime/provide.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* 判断当前是否存在可用的注入上下文。
|
|
5
4
|
*
|
|
@@ -55,5 +54,4 @@ export declare function provideGlobal<T>(key: any, value: T): void;
|
|
|
55
54
|
* 在无实例上下文时 `inject()` 会自动从全局存储读取。
|
|
56
55
|
*/
|
|
57
56
|
export declare function injectGlobal<T>(key: any, defaultValue?: T): T;
|
|
58
|
-
//#endregion
|
|
59
57
|
export { setGlobalProvidedValue };
|