wevu 7.0.0 → 7.0.2
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/dev/_virtual/{_@oxc-project_runtime@0.147.0 → _@oxc-project_runtime@0.148.0}/helpers/esm/defineProperty.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.147.0 → _@oxc-project_runtime@0.148.0}/helpers/esm/toPrimitive.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.147.0 → _@oxc-project_runtime@0.148.0}/helpers/esm/toPropertyKey.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.147.0 → _@oxc-project_runtime@0.148.0}/helpers/esm/typeof.mjs +1 -1
- package/dist/dev/package.mjs +1 -1
- package/dist/dev/reactivity/core.mjs +1 -1
- package/dist/dev/reactivity/ref.mjs +1 -1
- package/dist/dev/router/backNavigation.mjs +1 -1
- package/dist/dev/router/createRouter.mjs +55 -14
- package/dist/dev/router/createRouter.mjs.map +1 -1
- package/dist/dev/router/initialNavigation.mjs +131 -5
- package/dist/dev/router/initialNavigation.mjs.map +1 -1
- package/dist/dev/router/navigationApi.mjs +1 -1
- package/dist/dev/router/navigationResult.mjs +1 -1
- package/dist/dev/router/navigationTarget.mjs +2 -2
- package/dist/dev/router/navigationTargetHelpers.mjs +1 -1
- package/dist/dev/router/types.mjs.map +1 -1
- package/dist/dev/router/useRoute.mjs +13 -0
- package/dist/dev/router/useRoute.mjs.map +1 -1
- package/dist/dev/router.mjs +1 -1
- package/dist/dev/routerInternal/snapshots.mjs +3 -1
- package/dist/dev/routerInternal/snapshots.mjs.map +1 -1
- package/dist/dev/runtime/register/component/lifecycle.mjs +13 -55
- package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerDefinition.mjs +19 -21
- package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
- package/dist/package.mjs +1 -1
- package/dist/reactivity/core.mjs +1 -1
- package/dist/reactivity/ref.mjs +1 -1
- package/dist/reactivity/watch.mjs +1 -1
- package/dist/router/backNavigation.mjs +1 -1
- package/dist/router/createRouter.mjs +1 -1
- package/dist/router/initialNavigation.mjs +1 -1
- package/dist/router/navigationApi.mjs +1 -1
- package/dist/router/navigationResult.mjs +1 -1
- package/dist/router/navigationTarget.mjs +1 -1
- package/dist/router/navigationTargetHelpers.mjs +1 -1
- package/dist/router/types.d.mts +10 -1
- package/dist/router/useRoute.mjs +1 -1
- package/dist/router.d.mts +2 -2
- package/dist/router.mjs +1 -1
- package/dist/routerInternal/matching.mjs +1 -1
- package/dist/routerInternal/path.mjs +1 -1
- package/dist/routerInternal/records.mjs +1 -1
- package/dist/routerInternal/snapshots.mjs +1 -1
- package/dist/runtime/app/setData/scheduler.mjs +1 -1
- package/dist/runtime/defaults.mjs +1 -1
- package/dist/runtime/define/initialComputed.mjs +1 -1
- package/dist/runtime/define/optionsApi.mjs +1 -1
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
- package/dist/runtime/pageLayout.mjs +1 -1
- package/dist/runtime/pageScroll.mjs +1 -1
- package/dist/runtime/register/component/lifecycle/platform.mjs +1 -1
- package/dist/runtime/register/component/lifecycle.mjs +1 -1
- package/dist/runtime/register/component/methods.mjs +1 -1
- package/dist/runtime/register/component/props.mjs +1 -1
- package/dist/runtime/register/component/registerDefinition.mjs +1 -1
- package/dist/runtime/register/inline.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/methodBridge.mjs +1 -1
- package/dist/runtime/register/runtimeInstance.mjs +1 -1
- package/dist/runtime/scopedSlots.mjs +1 -1
- package/dist/runtime/setupTracking.mjs +1 -1
- package/dist/runtime/templateRefs.mjs +1 -1
- package/dist/runtime/vueCompat/router.mjs +1 -1
- package/dist/store/define/setupStyle.mjs +1 -1
- package/package.json +6 -6
- /package/dist/_virtual/{_@oxc-project_runtime@0.147.0 → _@oxc-project_runtime@0.148.0}/helpers/esm/defineProperty.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.147.0 → _@oxc-project_runtime@0.148.0}/helpers/esm/toPrimitive.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.147.0 → _@oxc-project_runtime@0.148.0}/helpers/esm/toPropertyKey.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.147.0 → _@oxc-project_runtime@0.148.0}/helpers/esm/typeof.mjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{snapshotRouteLocation as e}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as t}from"./types.mjs";import{createNavigationFailure as n,executeNavigationMethod as r,isNavigationFailure as i}from"./navigationCore.mjs";import{createNavigationRunResult as a}from"./navigationResult.mjs";import{resolveBackNavigationTarget as o,runBackNavigationGuards as s}from"./backNavigation.mjs";import{createForwardNotSupportedFailure as c}from"./navigationTargetHelpers.mjs";import{navigateWithTarget as l}from"./navigationTarget.mjs";function u(u){let{nativeRouter:d,route:f,routeResolveCodec:p,namedRouteLookup:m,beforeEachGuards:h,beforeResolveGuards:g,maxRedirects:_,tabBarPathSet:v,resolveWithCodec:y,settleNavigationResult:b}=u;async function x(r){let i=e(f),o;try{o=y(r,i.path)}catch(e){return b(a(`push`,i,void 0,n(t.unknown,void 0,i,e)))}let s=await l({mode:`push`,target:o,from:i,nativeRouter:d,routeResolveCodec:p,namedRouteLookup:m,beforeEachGuards:h,beforeResolveGuards:g,maxRedirects:_,tabBarPathSet:v,resolveWithCodec:y});return b(s)}async function S(r){let i=e(f),o;try{o=y(r,i.path)}catch(e){return b(a(`replace`,i,void 0,n(t.unknown,void 0,i,e)))}let s=await l({mode:`replace`,target:o,from:i,nativeRouter:d,routeResolveCodec:p,namedRouteLookup:m,beforeEachGuards:h,beforeResolveGuards:g,maxRedirects:_,tabBarPathSet:v,resolveWithCodec:y});return b(s)}async function C(t=1){let n=e(f),c=o(t,n,y),l=await s({target:c,from:n,nativeRouter:d,beforeEachGuards:h,beforeResolveGuards:g,resolveWithCodec:y});if(l.failure)return b(l);let u=await r(d.navigateBack,{delta:t},c,n),p=i(u)?a(`back`,n,c,u):l;return b(p)}async function w(t){if(t<0)return C(Math.abs(t));if(t===0)return;let n=e(f);return b(a(`back`,n,void 0,c(n)))}async function T(){return w(1)}return{push:x,replace:S,back:C,go:w,forward:T}}export{u as createNavigationApi};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{notifyRouteStateSync as e}from"./routeSync.mjs";import{runAfterEachHooks as t,runNavigationErrorHooks as n,shouldEmitNavigationError as r}from"./navigationCore.mjs";function i(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function a(i){let{afterEachHooks:a,errorHandlers:o,nativeRouter:s,rejectOnError:c}=i;async function l(e){if(await t(a,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure}),e.failure&&r(e.failure)){var i;await n(o,(i=e.failure.cause)==null?e.failure:i,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure})}}function u(e){return c&&r(e)}async function d(t){if(t.failure||e(t.to?{route:t.to,source:`router`}:void 0),await l(t),t.failure&&u(t.failure))throw t.failure;return t.failure}return{emitNavigationAfterEach:l,settleNavigationResult:d}}export{a as createNavigationResultController,i as createNavigationRunResult};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{resolveMatchedRouteRecord as t}from"../routerInternal/matching.mjs";import{createNativeRouteUrl as n,hasLocationQuery as r}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as i}from"./types.mjs";import{createNavigationFailure as a,executeNavigationMethod as o,isNavigationFailure as s,runNavigationGuards as c}from"./navigationCore.mjs";import{createNavigationRunResult as l}from"./navigationResult.mjs";import{applyRedirectedFrom as u,createDuplicatedFailure as d,createHashOnlyNavigationFailure as f,createTabBarQueryFailure as p,createTooManyRedirectsFailure as m,resolveRouteRecordRedirect as h}from"./navigationTargetHelpers.mjs";async function g(g){let{mode:_,target:v,from:y,nativeRouter:b,routeResolveCodec:x,namedRouteLookup:S,beforeEachGuards:C,beforeResolveGuards:w,maxRedirects:T,tabBarPathSet:E,resolveWithCodec:D,executeNative:O=!0,allowSameLocation:k=!1}=g,A=v,j=_,M=0;for(;;){var N;let g=E.has(A.path);if(n(A,x.stringifyQuery)===n(y,x.stringifyQuery)&&A.hash!==y.hash)return l(j,y,A,f(A,y));if(!k&&(g?A.path===y.path:A.fullPath===y.fullPath))return l(j,y,A,d(A,y));if(g&&r(A.query))return l(j,y,A,p(A,y));let _=await c(C,{mode:j,to:A,from:y,nativeRouter:b},D);if(_.status===`failure`)return l(j,y,A,_.failure);if(_.status===`redirect`){let e=_.target,t=_.replace===!0?`replace`:_.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}let v=t(A,S),P=(N=v==null?void 0:v.matchedRecords)==null?[]:N,F=!1;for(let e of P){if(e.redirect===void 0)continue;let t;try{t=await h(e.redirect,A,y,D)}catch(e){return l(j,y,A,a(i.aborted,A,y,e))}let n=t.replace===!1?`push`:`replace`,r=t.target;if(r.fullPath!==A.fullPath||n!==j){if(u(r,A),A=r,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));F=!0;break}}if(F)continue;let I=!1;for(let e of P){if(e.beforeEnterGuards.length===0)continue;let t=await c(new Set(e.beforeEnterGuards),{mode:j,to:A,from:y,nativeRouter:b},D);if(t.status===`failure`)return l(j,y,A,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||n!==j){if(u(e,A),A=e,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));I=!0;break}}}if(I)continue;let L=await c(w,{mode:j,to:A,from:y,nativeRouter:b},D);if(L.status===`failure`)return l(j,y,A,L.failure);if(L.status===`redirect`){let e=L.target,t=L.replace===!0?`replace`:L.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}if(!O)return l(j,y,A);if(g){let t=await o(b.switchTab,{url:e(A.path)},A,y);return s(t)?l(j,y,A,t):l(j,y,A)}let R=j===`push`?b.navigateTo:b.redirectTo,z=await o(R,{url:n(A,x.stringifyQuery)},A,y);return s(z)?l(j,y,A,z):l(j,y,A)}}export{g as navigateWithTarget};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{cloneRouteLocationRedirectedFrom as e,createRedirectedFromSnapshot as t}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as n}from"./types.mjs";import{createNavigationFailure as r,isNavigationRedirectCandidate as i}from"./navigationCore.mjs";function a(e,t){return r(n.duplicated,e,t,`Avoided redundant navigation to current location`)}function o(e,t){return r(n.aborted,e,t,`switchTab does not support query parameters`)}function s(e,t,i){return r(n.aborted,e,t,`Navigation redirected more than ${i} times`)}function c(e,t){return r(n.aborted,e,t,`Hash-only navigation is not supported in mini-program router`)}function l(e){return r(n.aborted,void 0,e,`Forward navigation is not supported in mini-program router`)}function u(n,r){n.redirectedFrom=r.redirectedFrom?e(r.redirectedFrom):t(r)}async function d(e,t,n,r){let a=typeof e==`function`?await e(t,n):e;return i(a)?{target:r(a.to,t.path),replace:a.replace}:{target:r(a,t.path),replace:!0}}export{u as applyRedirectedFrom,a as createDuplicatedFailure,l as createForwardNotSupportedFailure,c as createHashOnlyNavigationFailure,o as createTabBarQueryFailure,s as createTooManyRedirectsFailure,d as resolveRouteRecordRedirect};
|
package/dist/router/types.d.mts
CHANGED
|
@@ -62,6 +62,7 @@ interface NavigationFailure extends Error {
|
|
|
62
62
|
readonly cause?: unknown;
|
|
63
63
|
}
|
|
64
64
|
type NavigationMode = 'push' | 'replace' | 'back';
|
|
65
|
+
type InitialNavigationMode = 'eager' | 'blocking';
|
|
65
66
|
interface NavigationRedirect {
|
|
66
67
|
to: RouteLocationRaw;
|
|
67
68
|
replace?: boolean;
|
|
@@ -123,6 +124,14 @@ interface UseRouterOptions {
|
|
|
123
124
|
namedRoutes?: NamedRoutes;
|
|
124
125
|
paramsMode?: RouteParamsMode;
|
|
125
126
|
maxRedirects?: number;
|
|
127
|
+
/**
|
|
128
|
+
* 首屏导航守卫模式。默认立即挂载页面,只有明确配置 `blocking` 时才等待守卫完成。
|
|
129
|
+
*/
|
|
130
|
+
initialNavigationMode?: InitialNavigationMode;
|
|
131
|
+
/**
|
|
132
|
+
* blocking 首屏导航守卫的最大等待时间(毫秒),超时后放行页面挂载。
|
|
133
|
+
*/
|
|
134
|
+
initialNavigationTimeout?: number;
|
|
126
135
|
parseQuery?: RouteQueryParser;
|
|
127
136
|
stringifyQuery?: RouteQueryStringifier;
|
|
128
137
|
/**
|
|
@@ -160,4 +169,4 @@ interface AddRoute {
|
|
|
160
169
|
(parentName: string, route: RouteRecordRaw): () => void;
|
|
161
170
|
}
|
|
162
171
|
//#endregion
|
|
163
|
-
export { AddRoute, LocationQuery, LocationQueryRaw, LocationQueryValue, LocationQueryValueRaw, NamedRouteRecord, NamedRoutes, NavigationAfterEach, NavigationAfterEachContext, NavigationErrorContext, NavigationErrorHandler, NavigationFailure, NavigationFailureType, NavigationFailureTypeValue, NavigationGuard, NavigationGuardContext, NavigationGuardResult, NavigationMode, NavigationRedirect, RouteLocationNormalizedLoaded, RouteLocationRaw, RouteLocationRedirectedFrom, RouteMeta, RouteParamValue, RouteParamValueRaw, RouteParams, RouteParamsMode, RouteParamsRaw, RouteQueryParser, RouteQueryStringifier, RouteRecordInput, RouteRecordMatched, RouteRecordRaw, RouteRecordRedirect, RouterNavigation, UseRouterOptions };
|
|
172
|
+
export { AddRoute, InitialNavigationMode, LocationQuery, LocationQueryRaw, LocationQueryValue, LocationQueryValueRaw, NamedRouteRecord, NamedRoutes, NavigationAfterEach, NavigationAfterEachContext, NavigationErrorContext, NavigationErrorHandler, NavigationFailure, NavigationFailureType, NavigationFailureTypeValue, NavigationGuard, NavigationGuardContext, NavigationGuardResult, NavigationMode, NavigationRedirect, RouteLocationNormalizedLoaded, RouteLocationRaw, RouteLocationRedirectedFrom, RouteMeta, RouteParamValue, RouteParamValueRaw, RouteParams, RouteParamsMode, RouteParamsRaw, RouteQueryParser, RouteQueryStringifier, RouteRecordInput, RouteRecordMatched, RouteRecordRaw, RouteRecordRedirect, RouterNavigation, UseRouterOptions };
|
package/dist/router/useRoute.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{
|
|
1
|
+
import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{getCurrentMiniProgramPages as n}from"../runtime/platform.mjs";import{getCurrentSetupContext as r}from"../runtime/hooks/base.mjs";import{onLoad as i,onReady as a,onRouteDone as o,onShow as s,onUnload as c}from"../runtime/hooks/register.mjs";import{getActiveRouter as l}from"./instance.mjs";import{registerRouteStateSyncHandler as u}from"./routeSync.mjs";import{resolveCurrentRoute as d,resolvePageRoute as f}from"../routerInternal/location.mjs";import{cloneLocationQuery as p,cloneRouteLocationRedirectedFrom as m,cloneRouteMeta as h,cloneRouteParams as g,cloneRouteRecordMatchedList as _}from"../routerInternal/snapshots.mjs";import{useNativePageRouter as v,useNativeRouter as y}from"../runtime/vueCompat/router.mjs";import{resolveRouteLocation as b}from"./resolve.mjs";function x(e){return typeof e.route==`string`||typeof e.__route__==`string`}function S(e,t,r){if((r==null?void 0:r.source)===`router`||!t)return!0;if(r!=null&&r.page)return r.page===e;let i=n();return i[i.length-1]===e}function C(e,t){e.path=t.path,e.fullPath=t.fullPath,e.query=p(t.query),e.hash=t.hash,e.params=g(t.params),t.name===void 0?delete e.name:e.name=t.name,t.meta===void 0?delete e.meta:e.meta=h(t.meta),t.href===void 0?delete e.href:e.href=t.href,t.matched===void 0?delete e.matched:e.matched=_(t.matched),t.redirectedFrom===void 0?delete e.redirectedFrom:e.redirectedFrom=m(t.redirectedFrom)}function w(m={}){var h;let _=r();if(!_)throw Error(`useRoute() 必须在 setup() 的同步阶段调用`);let v=_.instance,y=(h=m.resolveRoute)==null?(e=>{var t,n;return(t=(n=l())==null?void 0:n.resolve(e))==null?e:t}):h,w=y(d(void 0,v)),T=x(v)||n().includes(v),E=e({path:w.path,fullPath:w.fullPath,query:p(w.query),hash:w.hash,params:g(w.params)});C(E,w);function D(e,t,n){let r=y(t||d(e,v));if(n){var i;(i=m.beforeRouteStateSync)==null||i.call(m,r,n)}C(E,r)}i(e=>{D(e)}),a(()=>{D()}),s(()=>{D()}),o(()=>{D()});let O=u(e=>{if(S(v,T,e)){if(e!=null&&e.route){D(void 0,e.route,e);return}if(e!=null&&e.page){D(void 0,f(e.page),e);return}if(e!=null&&e.url){D(void 0,b(e.url,E.path),e);return}D(void 0,void 0,e)}});return c(()=>{O()}),{route:t(E)}}function T(e={}){return w(e).route}function E(){return y()}function D(){return v()}export{w as createRouteStateController,D as useNativePageRouter,E as useNativeRouter,T as useRoute};
|
package/dist/router.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { RouterNavigateToOption, RouterReLaunchOption, RouterRedirectToOption, RouterSwitchTabOption, SetupContextRouter, TypedRouterTabBarUrl, TypedRouterUrl, WevuTypedRouterRouteMap } from "./runtime/types/props/router.mjs";
|
|
2
2
|
import "./runtime/types/props.mjs";
|
|
3
3
|
import { parseQuery, stringifyQuery } from "./routerInternal/query.mjs";
|
|
4
|
-
import { AddRoute, LocationQuery, LocationQueryRaw, LocationQueryValue, LocationQueryValueRaw, NamedRouteRecord, NamedRoutes, NavigationAfterEach, NavigationAfterEachContext, NavigationErrorContext, NavigationErrorHandler, NavigationFailure, NavigationFailureType, NavigationFailureTypeValue, NavigationGuard, NavigationGuardContext, NavigationGuardResult, NavigationMode, NavigationRedirect, RouteLocationNormalizedLoaded, RouteLocationRaw, RouteLocationRedirectedFrom, RouteMeta, RouteParamValue, RouteParamValueRaw, RouteParams, RouteParamsMode, RouteParamsRaw, RouteQueryParser, RouteQueryStringifier, RouteRecordInput, RouteRecordMatched, RouteRecordRaw, RouteRecordRedirect, RouterNavigation, UseRouterOptions } from "./router/types.mjs";
|
|
4
|
+
import { AddRoute, InitialNavigationMode, LocationQuery, LocationQueryRaw, LocationQueryValue, LocationQueryValueRaw, NamedRouteRecord, NamedRoutes, NavigationAfterEach, NavigationAfterEachContext, NavigationErrorContext, NavigationErrorHandler, NavigationFailure, NavigationFailureType, NavigationFailureTypeValue, NavigationGuard, NavigationGuardContext, NavigationGuardResult, NavigationMode, NavigationRedirect, RouteLocationNormalizedLoaded, RouteLocationRaw, RouteLocationRedirectedFrom, RouteMeta, RouteParamValue, RouteParamValueRaw, RouteParams, RouteParamsMode, RouteParamsRaw, RouteQueryParser, RouteQueryStringifier, RouteRecordInput, RouteRecordMatched, RouteRecordRaw, RouteRecordRedirect, RouterNavigation, UseRouterOptions } from "./router/types.mjs";
|
|
5
5
|
import { createRouter } from "./router/createRouter.mjs";
|
|
6
6
|
import { createNavigationFailure, isNavigationFailure } from "./router/navigationCore.mjs";
|
|
7
7
|
import { resolveRouteLocation } from "./router/resolve.mjs";
|
|
8
8
|
import { useNativePageRouter, useNativeRouter, useRoute } from "./router/useRoute.mjs";
|
|
9
9
|
import { useRouter } from "./router/useRouter.mjs";
|
|
10
|
-
export { type AddRoute, 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 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 RouterSwitchTabOption, type SetupContextRouter, type TypedRouterTabBarUrl, type TypedRouterUrl, type UseRouterOptions, type WevuTypedRouterRouteMap, createNavigationFailure, createRouter, isNavigationFailure, parseQuery, resolveRouteLocation, stringifyQuery, useNativePageRouter, useNativeRouter, useRoute, useRouter };
|
|
10
|
+
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 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 RouterSwitchTabOption, type SetupContextRouter, type TypedRouterTabBarUrl, type TypedRouterUrl, type UseRouterOptions, type WevuTypedRouterRouteMap, createNavigationFailure, createRouter, isNavigationFailure, parseQuery, resolveRouteLocation, stringifyQuery, useNativePageRouter, useNativeRouter, useRoute, useRouter };
|
package/dist/router.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{parseQuery as e,stringifyQuery as t}from"./routerInternal/query.mjs";import{NavigationFailureType as n}from"./router/types.mjs";import{createNavigationFailure as r,isNavigationFailure as i}from"./router/navigationCore.mjs";import{resolveRouteLocation as a}from"./router/resolve.mjs";import{useNativePageRouter as o,useNativeRouter as s,useRoute as c}from"./router/useRoute.mjs";import{createRouter as l}from"./router/createRouter.mjs";import{useRouter as u}from"./router/useRouter.mjs";export{n as NavigationFailureType,r as createNavigationFailure,l as createRouter,i as isNavigationFailure,e as parseQuery,a as resolveRouteLocation,t as stringifyQuery,o as useNativePageRouter,s as useNativeRouter,c as useRoute,u as useRouter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isDynamicRoutePath as e}from"./path.mjs";import{decodeRouteParamSegment as t,parsePathParamToken as n}from"./params.mjs";function r(e){return e.split(`/`).filter(Boolean)}function i(e){return[e.path,...e.aliasPaths]}function a(e,t){let n=[],r=new Set,i=e;for(;i&&!(r.has(i.name)||(r.add(i.name),n.unshift(i),!i.parentName));)i=t.recordByName.get(i.parentName);return n}function o(e){let t;for(let n of e)n.meta&&(t||(t={}),Object.assign(t,n.meta));return t}function s(e,t){let n=new Set;if(!t.has(e))return n;n.add(e);let r=!0;for(;r;){r=!1;for(let[e,i]of t.entries())
|
|
1
|
+
import{isDynamicRoutePath as e}from"./path.mjs";import{decodeRouteParamSegment as t,parsePathParamToken as n}from"./params.mjs";function r(e){return e.split(`/`).filter(Boolean)}function i(e){return[e.path,...e.aliasPaths]}function a(e,t){let n=[],r=new Set,i=e;for(;i&&!(r.has(i.name)||(r.add(i.name),n.unshift(i),!i.parentName));)i=t.recordByName.get(i.parentName);return n}function o(e){let t;for(let n of e)n.meta&&(t||(t={}),Object.assign(t,n.meta));return t}function s(e,t){let n=new Set;if(!t.has(e))return n;n.add(e);let r=!0;for(;r;){r=!1;for(let[e,i]of t.entries())i.parentName&&!n.has(e)&&n.has(i.parentName)&&(n.add(e),r=!0)}return n}function c(e){let t={};for(let[n,r]of e.entries())r.length!==0&&(t[n]=r.length===1?r[0]:r);return t}function l(e,i){let a=r(e),o=r(i),s=new Map,l=(e,t)=>{let n=s.get(e);if(n){n.push(t);return}s.set(e,[t])},u=e=>{let t=s.get(e);t&&t.length!==0&&(t.pop(),t.length===0&&s.delete(e))},d=(e,n,r)=>{for(let i=0;i<r;i+=1)l(e,t(o[n+i]));return()=>{for(let t=0;t<r;t+=1)u(e)}},f=(e,r)=>{if(e>=a.length)return r>=o.length;let i=a[e],s=n(i);if(!s)return r>=o.length||i!==o[r]?!1:f(e+1,r+1);if(s.modifier===``){if(r>=o.length)return!1;l(s.key,t(o[r]));let n=f(e+1,r+1);return n||u(s.key),n}if(s.modifier===`?`){if(r<o.length){if(l(s.key,t(o[r])),f(e+1,r+1))return!0;u(s.key)}return f(e+1,r)}let c=+(s.modifier===`+`),p=o.length-r;for(let t=p;t>=c;--t){let n=d(s.key,r,t);if(f(e+1,r+t))return!0;n()}return!1};if(f(0,0))return c(s)}function u(t,n){if(t.name){let e=n.recordByName.get(t.name);if(e)return{record:e,matchedRecords:a(e,n)}}let r=n.nameByStaticPath.get(t.path);if(r){let e=n.recordByName.get(r);if(e)return{record:e,matchedRecords:a(e,n),matchedPath:t.path}}for(let r of n.recordByName.values())for(let o of i(r)){if(!e(o))continue;let i=l(o,t.path);if(i)return{record:r,matchedRecords:a(r,n),matchedPath:o,params:i}}}export{s as collectRouteNamesForRemoval,o as mergeMatchedRouteMeta,u as resolveMatchedRouteRecord};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){let t=[];for(let n of e.split(`/`))if(
|
|
1
|
+
function e(e){let t=[];for(let n of e.split(`/`))if(n&&n!==`.`){if(n===`..`){t.length>0&&t.pop();continue}t.push(n)}return t}function t(t,n){if(!t)return e(n).join(`/`);if(t.startsWith(`/`))return e(t).join(`/`);if(t.startsWith(`./`)||t.startsWith(`../`)){let r=e(n);r.length>0&&r.pop();for(let e of t.split(`/`))if(e&&e!==`.`){if(e===`..`){r.length>0&&r.pop();continue}r.push(e)}return r.join(`/`)}return e(t).join(`/`)}function n(e){return e?`/${e}`:`/`}const r=/(?:^|\/):/;function i(e){return r.test(e)}export{n as createAbsoluteRoutePath,i as isDynamicRoutePath,t as resolvePath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbsoluteRoutePath as e,isDynamicRoutePath as t,resolvePath as n}from"./path.mjs";import{warnRouteConfig as r}from"./recordsWarnings.mjs";function i(e){return e?Array.isArray(e)?e:[e]:[]}function a(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function o(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){if(typeof e!=`string`)continue;let r=n(e,``)
|
|
1
|
+
import{createAbsoluteRoutePath as e,isDynamicRoutePath as t,resolvePath as n}from"./path.mjs";import{warnRouteConfig as r}from"./recordsWarnings.mjs";function i(e){return e?Array.isArray(e)?e:[e]:[]}function a(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function o(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){if(typeof e!=`string`)continue;let r=n(e,``);r&&r!==t&&(i.includes(r)||i.push(r))}return i}function s(e,t,r=`namedRoutes`){let s=n(e.path,``);if(!s&&e.path!==`/`)return;let c=a(e,s,r);if(c)return{name:c,path:s,aliasPaths:o(e.alias,s),parentName:t,meta:e.meta,beforeEnterGuards:i(e.beforeEnter),redirect:e.redirect}}function c(t,r){return!r||t.startsWith(`/`)?n(t,``):n(`${e(r)}/${t}`,``)}function l(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function u(e){let t=[];for(let n of e)n&&!t.includes(n)&&t.push(n);return t}function d(t){if(t.length!==0)return t.length===1?e(t[0]):t.map(t=>e(t))}function f(t,n,i,o=[],s,p=`namedRoutes`,m=new Set){let h=[];for(let[g,_]of t.entries()){let t=`${p}[${g}]`;if(m.has(_)){r(`ignored route record at ${t}: detected circular children reference`);continue}if(typeof _.path!=`string`||!_.path){let e=typeof(_==null?void 0:_.name)==`string`?_.name.trim():``;r(`ignored route record "${e}" at ${t}: route path is required`);continue}let v=c(_.path,n),y=a(_,v,s);if(!y){r(`ignored route record at ${t}: route name is required`);continue}let b=[],x=new Map;for(let i of l(_.alias)){let a=c(i,n);if(!a)continue;if(a===v){r(`ignored alias "${e(a)}" for route "${y}" at ${t}: alias is same as route path`);continue}let o=x.get(a);if(o){r(`ignored duplicate alias "${e(a)}" for route "${y}" at ${t}: already declared by "${o}"`);continue}x.set(a,i),b.push(a)}let S=_.path.startsWith(`/`)?[]:o.map(e=>c(_.path,e)).filter(Boolean).filter(e=>e!==v),C=u([...b,...S]),w={name:y,path:v?e(v):`/`,alias:d(C),meta:_.meta,beforeEnter:_.beforeEnter,redirect:_.redirect};if(h.push({route:w,parentName:i,source:s}),Array.isArray(_.children)&&_.children.length>0){let e=new Set(m);e.add(_),h.push(...f(_.children,v,y,C,s,`${t}.children`,e))}}return h}function p(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return f(e,void 0,void 0,[],t,t);let n=[];for(let[i,a]of Object.entries(e)){let e=typeof i==`string`?i.trim():``;if(!e){r(`ignored route record at ${t}: route name is required`);continue}if(typeof a!=`string`||!a){r(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:a},source:t})}return n}function m(e){return[...p(e.routes,`routes`),...p(e.namedRoutes,`namedRoutes`)]}function h(e){let n=new Map;for(let[r,i]of e.entries()){!t(i.path)&&!n.has(i.path)&&n.set(i.path,r);for(let e of i.aliasPaths)!t(e)&&!n.has(e)&&n.set(e,r)}return n}function g(e){let t=new Map;for(let n of e){let e=s(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:h(t)}}export{g as createNamedRouteLookup,h as createNamedRouteNameByStaticPath,d as createRouteRecordAliasValue,f as flattenNamedRouteRecords,s as normalizeRouteRecordRaw,m as resolveRouteOptionEntries};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbsoluteRoutePath as e,resolvePath as t}from"./path.mjs";import{stringifyQuery as n}from"./query.mjs";function r(e){if(e)return{...e}}function i(e){let t={name:e.name,path:e.path};return e.meta!==void 0&&(t.meta=r(e.meta)),Array.isArray(e.alias)?t.alias=Object.freeze(e.alias.slice()):e.alias!==void 0&&(t.alias=e.alias),Array.isArray(e.beforeEnter)?t.beforeEnter=Object.freeze(e.beforeEnter.slice()):e.beforeEnter!==void 0&&(t.beforeEnter=e.beforeEnter),e.redirect!==void 0&&(t.redirect=e.redirect),Object.freeze(t)}function a(t,n,r,a,o,s){let
|
|
1
|
+
import{createAbsoluteRoutePath as e,resolvePath as t}from"./path.mjs";import{stringifyQuery as n}from"./query.mjs";function r(e){if(e)return{...e}}function i(e){let t={name:e.name,path:e.path};return e.meta!==void 0&&(t.meta=r(e.meta)),Array.isArray(e.alias)?t.alias=Object.freeze(e.alias.slice()):e.alias!==void 0&&(t.alias=e.alias),Array.isArray(e.beforeEnter)?t.beforeEnter=Object.freeze(e.beforeEnter.slice()):e.beforeEnter!==void 0&&(t.beforeEnter=e.beforeEnter),e.redirect!==void 0&&(t.redirect=e.redirect),Object.freeze(t)}function a(t,n,r,a,o,s,c,l){let u=Object.freeze(t.map(t=>e(t))),d=Object.freeze(n.map(i));return Object.freeze({tabBarEntries:u,routes:d,namedRoutes:d,paramsMode:r,maxRedirects:a,initialNavigationMode:o,initialNavigationTimeout:s,parseQuery:c.parseQuery,stringifyQuery:c.stringifyQuery,rejectOnError:l})}function o(n,i){let a={name:n.name,path:e(n.path)},o=typeof i==`string`&&i?e(t(i,``)):void 0;return o&&o!==a.path&&(a.aliasPath=o),n.meta!==void 0&&(a.meta=r(n.meta)),a}function s(e){if(e)return e.map(e=>({name:e.name,path:e.path,aliasPath:e.aliasPath,meta:r(e.meta)}))}function c(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function l(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function u(e){if(!e)return;let t={path:e.path,fullPath:e.fullPath,query:c(e.query),hash:e.hash,params:l(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=r(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=s(e.matched)),t}function d(e){let t={path:e.path,fullPath:e.fullPath,query:c(e.query),hash:e.hash,params:l(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=r(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=s(e.matched)),t}function f(e){let t={path:e.path,fullPath:e.fullPath,query:c(e.query),hash:e.hash,params:l(e.params)};return e.meta!==void 0&&(t.meta=r(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=s(e.matched)),e.redirectedFrom!==void 0&&(t.redirectedFrom=u(e.redirectedFrom)),e.name!==void 0&&(t.name=e.name),t}function p(t,r=n){let i=e(t.path),a=r(t.query);return a?`${i}?${a}`:i}function m(e){return Object.keys(e).length>0}export{c as cloneLocationQuery,u as cloneRouteLocationRedirectedFrom,r as cloneRouteMeta,l as cloneRouteParams,s as cloneRouteRecordMatchedList,p as createNativeRouteUrl,d as createRedirectedFromSnapshot,a as createRouterOptionsSnapshot,m as hasLocationQuery,o as normalizeRouteRecordMatched,f as snapshotRouteLocation};
|
|
@@ -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{diffSnapshots as o,toPlain as s}from"../../diff.mjs";import{collectSnapshot as c}from"./snapshot.mjs";import{runPatchUpdate as l}from"./patchScheduler.mjs";function u(u){let{state:d,setupState:f,snapshotOmitKeys:p,computedRefs:m,dirtyComputedKeys:h,includeComputed:g,setDataStrategy:_,computedCompare:v,computedCompareMaxDepth:ee,computedCompareMaxKeys:te,currentAdapter:y,shouldIncludeKey:ne,maxPatchKeys:re,maxPayloadBytes:ie,mergeSiblingThreshold:ae,mergeSiblingMaxInflationRatio:b,mergeSiblingMaxParentBytes:x,mergeSiblingSkipArray:S,elevateTopKeyThreshold:C,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E=!1,functionPaths:D,debug:O,debugWhen:oe,debugSampleRate:k,loopWarning:A,targetLabel:j,runTracker:se,isMounted:M,initialSnapshot:N,initialState:P}=u,F=new WeakMap,I=new WeakMap,L={},R=Object.create(null),z=Object.create(null),B=Object.create(null),V={value:_===`patch`},H=new Map,U=new Set,W=[],G=-1/0,ce=new Set(P&&typeof P==`object`?Object.keys(P):[]),K=e=>{if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},q=(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)=>q(e,t[n]));if(K(e)&&K(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>i(t,n)&&q(e[n],t[n]))}return!1},J=i=>{let o=r(i)?i.value:i;if(typeof o!=`object`||!o)return o;if(!n(o)&&a(o))return{snapshot:s(o,new WeakMap,{cacheEligibility:I,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D})};let c=n(o)?e(o):o;return{raw:c,version:t(c)}},Y=(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`)?q(e.snapshot,t.snapshot):!1:e.raw===t.raw&&e.version===t.version,X=e=>ne(e)&&!(p!=null&&p.has(e));if(N)for(let[e,t]of Object.entries(N))X(e)&&(L[e]=t);let le=()=>{if(!N)return;let t=n(d)?e(d):d,r=f&&typeof f==`object`?n(f)?e(f):f:void 0;for(let e of Object.keys(N))if(X(e)){if(r&&i(r,e)){z[e]=J(r[e]);continue}if(i(t,e)){if(ce.has(e))continue;t[e]=N[e],z[e]=J(t[e])}}},ue=t=>{let a=[],o=f&&typeof f==`object`?n(f)?e(f):f:void 0;for(let n of new Set([...Object.keys(d),...o?Object.keys(o):[]])){if(!X(n))continue;let s=o&&i(o,n)?o[n]:d[n],c=r(s)?s.value:s
|
|
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{diffSnapshots as o,toPlain as s}from"../../diff.mjs";import{collectSnapshot as c}from"./snapshot.mjs";import{runPatchUpdate as l}from"./patchScheduler.mjs";function u(u){let{state:d,setupState:f,snapshotOmitKeys:p,computedRefs:m,dirtyComputedKeys:h,includeComputed:g,setDataStrategy:_,computedCompare:v,computedCompareMaxDepth:ee,computedCompareMaxKeys:te,currentAdapter:y,shouldIncludeKey:ne,maxPatchKeys:re,maxPayloadBytes:ie,mergeSiblingThreshold:ae,mergeSiblingMaxInflationRatio:b,mergeSiblingMaxParentBytes:x,mergeSiblingSkipArray:S,elevateTopKeyThreshold:C,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E=!1,functionPaths:D,debug:O,debugWhen:oe,debugSampleRate:k,loopWarning:A,targetLabel:j,runTracker:se,isMounted:M,initialSnapshot:N,initialState:P}=u,F=new WeakMap,I=new WeakMap,L={},R=Object.create(null),z=Object.create(null),B=Object.create(null),V={value:_===`patch`},H=new Map,U=new Set,W=[],G=-1/0,ce=new Set(P&&typeof P==`object`?Object.keys(P):[]),K=e=>{if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},q=(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)=>q(e,t[n]));if(K(e)&&K(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>i(t,n)&&q(e[n],t[n]))}return!1},J=i=>{let o=r(i)?i.value:i;if(typeof o!=`object`||!o)return o;if(!n(o)&&a(o))return{snapshot:s(o,new WeakMap,{cacheEligibility:I,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D})};let c=n(o)?e(o):o;return{raw:c,version:t(c)}},Y=(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`)?q(e.snapshot,t.snapshot):!1:e.raw===t.raw&&e.version===t.version,X=e=>ne(e)&&!(p!=null&&p.has(e));if(N)for(let[e,t]of Object.entries(N))X(e)&&(L[e]=t);let le=()=>{if(!N)return;let t=n(d)?e(d):d,r=f&&typeof f==`object`?n(f)?e(f):f:void 0;for(let e of Object.keys(N))if(X(e)){if(r&&i(r,e)){z[e]=J(r[e]);continue}if(i(t,e)){if(ce.has(e))continue;t[e]=N[e],z[e]=J(t[e])}}},ue=t=>{let a=[],o=f&&typeof f==`object`?n(f)?e(f):f:void 0;for(let n of new Set([...Object.keys(d),...o?Object.keys(o):[]])){if(!X(n))continue;let s=o&&i(o,n)?o[n]:d[n],c=r(s)?s.value:s;c&&typeof c==`object`&&e(c)===t&&a.push(n)}return a},Z=e=>{if(!O)return;let t=e.reason!==`patch`&&e.reason!==`diff`;if((oe!==`fallback`||t)&&!(k<1&&Math.random()>k))try{O(e)}catch(e){}},de=()=>{if(!A)return;let e=Date.now();W.push(e);let t=e-A.sampleWindowMs;for(;W.length&&W[0]<t;)W.shift();W.length<=A.maxFlushes||A.coolDownMs>0&&e-G<A.coolDownMs||(G=e,Z({mode:_,reason:`loopWarning`,pendingPatchKeys:H.size+U.size,payloadKeys:0,computedDirtyKeys:g?h.size:0,flushCount:W.length,windowMs:A.sampleWindowMs,targetLabel:j,message:`${j?`${j} `:``}疑似运行时更新循环:${W.length} 次 setData flush/${A.sampleWindowMs}ms`}))},Q=()=>c({state:d,setupState:f,computedRefs:m,includeComputed:g,shouldIncludeKey:X,plainCache:F,plainCacheEligibility:I,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E,functionPaths:D});le();let fe=()=>{let t=n(d)?e(d):d,r=f&&typeof f==`object`?n(f)?e(f):f:void 0,a={...L},o=new WeakMap,c=new Set,l=new Set,u=new Set;for(let e of new Set([...Object.keys(t),...r?Object.keys(r):[]])){if(!X(e))continue;c.add(e);let n=r&&i(r,e)?r:t,l=J(n[e]),d=z[e];d&&l&&typeof d==`object`&&typeof l==`object`&&i(d,`raw`)&&i(l,`raw`)&&Array.isArray(d.raw)&&Array.isArray(l.raw)&&d.raw!==l.raw&&u.add(e),(!Y(d,l)||!i(L,e))&&(a[e]=s(n[e],o,{cache:F,cacheEligibility:I,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D,_path:e})),z[e]=l}for(let e of Object.keys(z))c.has(e)||(delete z[e],(!g||!i(m,e))&&delete a[e]);if(!g){for(let e of Object.keys(B))delete B[e];return{snapshot:a,replacedTopLevelKeys:u}}for(let e of Object.keys(m)){if(!X(e))continue;l.add(e);let t=m[e].value,n=J(t);(!Y(B[e],n)||!i(L,e))&&(a[e]=s(t,o,{cache:F,cacheEligibility:I,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D,_path:e})),B[e]=n}for(let e of Object.keys(B))l.has(e)||(delete B[e],(!i(t,e)||!X(e))&&delete a[e]);return{snapshot:a,replacedTopLevelKeys:u}},$=(e=`diff`)=>{var t;let n=_===`diff`?fe():void 0,r=(t=n==null?void 0:n.snapshot)==null?Q():t,i=n?(()=>{let e={};for(let t of n.replacedTopLevelKeys)e[t]=r[t];return{...o(L,r,{skipKeys:n.replacedTopLevelKeys}),...e}})():o(L,r);if(L=r,V.value=!1,H.clear(),_===`patch`&&g){R=Object.create(null);for(let e of Object.keys(m))X(e)&&(R[e]=r[e]);h.clear()}if(Object.keys(i).length){if(typeof y.setData==`function`){let e=y.setData(i);if(e&&typeof e.then==`function`)return e.catch(()=>{})}Z({mode:`diff`,reason:e,pendingPatchKeys:0,payloadKeys:Object.keys(i).length})}};return{job:e=>{if(M())return de(),se(),_===`patch`&&!V.value?H.size>0||U.size>0||g&&h.size>0?l({state:d,computedRefs:m,dirtyComputedKeys:h,includeComputed:g,computedCompare:v,computedCompareMaxDepth:ee,computedCompareMaxKeys:te,currentAdapter:y,shouldIncludeKey:X,maxPatchKeys:re,maxPayloadBytes:ie,mergeSiblingThreshold:ae,mergeSiblingMaxInflationRatio:b,mergeSiblingMaxParentBytes:x,mergeSiblingSkipArray:S,elevateTopKeyThreshold:C,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E,functionPaths:D,plainCache:F,plainCacheEligibility:I,pendingPatches:H,fallbackTopKeys:U,latestSnapshot:L,latestComputedSnapshot:R,needsFullSnapshot:V,emitDebug:Z,runDiffUpdate:$}):$(`diff`):$(V.value?`needsFullSnapshot`:`diff`)},mutationRecorder:(e,t)=>{if(!M())return;if(e.root!==t){let t=ue(e.root);if(t.length)for(let e of t)U.add(e);return}if(!e.path){if(Array.isArray(e.fallbackTopKeys)&&e.fallbackTopKeys.length)for(let t of e.fallbackTopKeys)U.add(t);else V.value=!0;return}let n=e.path.split(`.`,1)[0];X(n)&&H.set(e.path,{kind:e.kind,op:e.op})},snapshot:()=>_===`patch`?Q():{...L},cloneLatestSnapshot:()=>({...L}),getLatestSnapshot:()=>L}}export{u as createSetDataScheduler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=`__wevuDefaultsScope`;let t={};function n(e){if(
|
|
1
|
+
const e=`__wevuDefaultsScope`;let t={};function n(e){if(e&&typeof e==`object`&&!Array.isArray(e))return e}function r(e,t){if(!e)return t;if(!t)return e;let r={...e,...t},i=n(e.setData),a=n(t.setData);(i||a)&&(r.setData={...i==null?{}:i,...a==null?{}:a});let o=n(e.options),s=n(t.options);return(o||s)&&(r.options={...o==null?{}:o,...s==null?{}:s}),r}function i(e,t){return r(e,t)}function a(e,t){return{app:r(e.app,t.app),component:r(e.component,t.component)}}function o(e){t=a(t,e)}function s(){t={}}function c(e){return i(t.app,e)}function l(e){return i(t.component,e)}export{e as INTERNAL_DEFAULTS_SCOPE_KEY,c as applyWevuAppDefaults,l as applyWevuComponentDefaults,s as resetWevuDefaults,o as setWevuDefaults};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasOwn as e}from"../../utils.mjs";import{toPlain as t}from"../diff.mjs";import{resolveSetDataOptions as n}from"../app/setDataOptions.mjs";import{WEVU_SLOT_OWNER_ID_KEY as r}from"@weapp-core/constants";var i=class extends Error{};function a(e){if(typeof e==`function`)return e;let t=e==null?void 0:e.get;return typeof t==`function`?t:void 0}function o(e){return e.startsWith(`__wv_bind_`)||e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`)}function s(e,t){if(!e.startsWith(`__wv_bind_`))return!1;try{return!/\bthis\b/.test(Function.prototype.toString.call(t))}catch(e){return!1}}function c(e){if(e===r)return``;if(e.startsWith(`__wv_bind_`))return null;if(e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`))return``}function l(t,n){let r=Array.isArray(n==null?void 0:n.pick)?n.pick:[];if(!r.length)return;let i=new Set(Array.isArray(n==null?void 0:n.omit)?n.omit:[]),a={};for(let n of r){if(i.has(n)||e(t,n))continue;let r=c(n);r!==void 0&&(a[n]=r)}return Object.keys(a).length?a:void 0}function u(r){let{data:c,computed:l,methods:u,setData:d}=r,f=l?Object.keys(l):[];if(!f.length)return;let{includeComputed:p,shouldIncludeKey:m,toPlainMaxDepth:h,toPlainMaxKeys:g,includeFunctions:_,functionPaths:v}=n(d);if(!p)return;let y={},b=new Set,x,S=n=>{if(e(c,n)||!m(n))return{ok:!1};if(e(y,n))return{ok:!0,value:y[n]};if(b.has(n))return{ok:!1};let r=a(l[n]);if(!r)return{ok:!1};b.add(n);try{let e=r.call(x);if(e===void 0)return{ok:!1};let i=t(e,new WeakMap,{maxDepth:h,maxKeys:g,includeFunctions:_,functionPaths:v,_path:n});return i===void 0?{ok:!1}:(y[n]=i,{ok:!0,value:i})}catch(e){return{ok:!1}}finally{b.delete(n)}};x=new Proxy(c,{get(t,n,r){if(typeof n==`string`){if(n===`data`||n===`$state`)return c;if(n===`props`||n===`$props`||n===`$attrs`)throw new i;if(e(c,n))return Reflect.get(t,n,r);if(u&&e(u,n)){let e=u[n];return typeof e==`function`?e.bind(x):e}if(l&&e(l,n)){let e=S(n);if(e.ok)return e.value;throw new i}throw new i}return Reflect.get(t,n,r)},has(t,n){return Reflect.has(t,n)||typeof n==`string`&&!!(l&&e(l,n))}});for(let e of f){let t=a(l[e]);o(e)&&
|
|
1
|
+
import{hasOwn as e}from"../../utils.mjs";import{toPlain as t}from"../diff.mjs";import{resolveSetDataOptions as n}from"../app/setDataOptions.mjs";import{WEVU_SLOT_OWNER_ID_KEY as r}from"@weapp-core/constants";var i=class extends Error{};function a(e){if(typeof e==`function`)return e;let t=e==null?void 0:e.get;return typeof t==`function`?t:void 0}function o(e){return e.startsWith(`__wv_bind_`)||e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`)}function s(e,t){if(!e.startsWith(`__wv_bind_`))return!1;try{return!/\bthis\b/.test(Function.prototype.toString.call(t))}catch(e){return!1}}function c(e){if(e===r)return``;if(e.startsWith(`__wv_bind_`))return null;if(e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`))return``}function l(t,n){let r=Array.isArray(n==null?void 0:n.pick)?n.pick:[];if(!r.length)return;let i=new Set(Array.isArray(n==null?void 0:n.omit)?n.omit:[]),a={};for(let n of r){if(i.has(n)||e(t,n))continue;let r=c(n);r!==void 0&&(a[n]=r)}return Object.keys(a).length?a:void 0}function u(r){let{data:c,computed:l,methods:u,setData:d}=r,f=l?Object.keys(l):[];if(!f.length)return;let{includeComputed:p,shouldIncludeKey:m,toPlainMaxDepth:h,toPlainMaxKeys:g,includeFunctions:_,functionPaths:v}=n(d);if(!p)return;let y={},b=new Set,x,S=n=>{if(e(c,n)||!m(n))return{ok:!1};if(e(y,n))return{ok:!0,value:y[n]};if(b.has(n))return{ok:!1};let r=a(l[n]);if(!r)return{ok:!1};b.add(n);try{let e=r.call(x);if(e===void 0)return{ok:!1};let i=t(e,new WeakMap,{maxDepth:h,maxKeys:g,includeFunctions:_,functionPaths:v,_path:n});return i===void 0?{ok:!1}:(y[n]=i,{ok:!0,value:i})}catch(e){return{ok:!1}}finally{b.delete(n)}};x=new Proxy(c,{get(t,n,r){if(typeof n==`string`){if(n===`data`||n===`$state`)return c;if(n===`props`||n===`$props`||n===`$attrs`)throw new i;if(e(c,n))return Reflect.get(t,n,r);if(u&&e(u,n)){let e=u[n];return typeof e==`function`?e.bind(x):e}if(l&&e(l,n)){let e=S(n);if(e.ok)return e.value;throw new i}throw new i}return Reflect.get(t,n,r)},has(t,n){return Reflect.has(t,n)||typeof n==`string`&&!!(l&&e(l,n))}});for(let e of f){let t=a(l[e]);(!o(e)||t&&s(e,t))&&S(e)}return Object.keys(y).length?y:void 0}function d(e,t,n,r){if(!e||typeof e!=`object`)return e;let i=u({data:e,computed:t,methods:r,setData:n}),a=l(e,n);return i||a?{...e,...a,...i}:e}export{u as resolveInitialComputedData,d as resolveNativeInitialData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasOwn as e}from"../../utils.mjs";import{inject as t,provide as n}from"../provide.mjs";const r=Symbol(`wevu-missing-options-api-injection`);function i(t){if(typeof t==`string`||typeof t==`symbol`)return{from:t};if(!t||typeof t!=`object`)return;let n=t;return{from:n.from,hasDefault:e(n,`default`),defaultValue:n.default}}function a(e,t){return typeof e==`function`?e.call(t):e}function o(e,n){let o={};if(Array.isArray(e)){for(let n of e)(typeof n==`string`||typeof n==`symbol`)&&(o[n]=t(n));return o}if(!e||typeof e!=`object`)return o;for(let[s,c]of Object.entries(e)){let e=i(c);if(!e||e.from==null)continue;let l=t(e.from,r);o[s]=l===r&&e.hasDefault?a(e.defaultValue,n):l===r?void 0:l}return o}function s(e,t){let r=typeof e==`function`?e.call(t):e;if(
|
|
1
|
+
import{hasOwn as e}from"../../utils.mjs";import{inject as t,provide as n}from"../provide.mjs";const r=Symbol(`wevu-missing-options-api-injection`);function i(t){if(typeof t==`string`||typeof t==`symbol`)return{from:t};if(!t||typeof t!=`object`)return;let n=t;return{from:n.from,hasDefault:e(n,`default`),defaultValue:n.default}}function a(e,t){return typeof e==`function`?e.call(t):e}function o(e,n){let o={};if(Array.isArray(e)){for(let n of e)(typeof n==`string`||typeof n==`symbol`)&&(o[n]=t(n));return o}if(!e||typeof e!=`object`)return o;for(let[s,c]of Object.entries(e)){let e=i(c);if(!e||e.from==null)continue;let l=t(e.from,r);o[s]=l===r&&e.hasDefault?a(e.defaultValue,n):l===r?void 0:l}return o}function s(e,t){let r=typeof e==`function`?e.call(t):e;if(r&&typeof r==`object`)for(let e of Reflect.ownKeys(r))n(e,Reflect.get(r,e))}export{s as applyOptionsApiProvide,o as resolveOptionsApiInjections};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasOwn as e}from"../../utils.mjs";import{cloneSnapshotValue as t,isDeepEqualValue as n}from"../app/setData/snapshot.mjs";import{resolveDatasetEventValue as r,runInlineExpression as i}from"../register/inline.mjs";import{getOwnerProxy as a,getOwnerSnapshot as o,getOwnerTarget as s,subscribeOwner as c}from"../scopedSlots.mjs";import{clearTemplateRefs as l,scheduleTemplateRefUpdate as u}from"../templateRefs.mjs";import{WEVU_INLINE_HANDLER as d,WEVU_INLINE_MAP_KEY as f,WEVU_OWNER_HANDLER as p,WEVU_PROPS_DERIVED_KEYS_KEY as m,WEVU_PUBLIC_RUNTIME_KEY as h,WEVU_SLOT_FUNCTION_TOKEN as g,WEVU_SLOT_OWNER_ID_KEY as _,WEVU_SLOT_OWNER_ID_PROP as v,WEVU_SLOT_OWNER_KEY as y,WEVU_SLOT_OWNER_PROXY_KEY as b,WEVU_SLOT_PROPS_DATA_KEY as x,WEVU_SLOT_PROPS_KEY as S,WEVU_SLOT_SCOPE_KEY as C,WEVU_TEMPLATE_REFS_KEY as w}from"@weapp-core/constants";const T=[_,v,b,y,x,S,C],E=/&/g,D=/"/g,O=/"/g,k=/'/g,A=/'/g,j=/</g,M=/>/g;function N(e){return e.replace(E,`&`).replace(D,`"`).replace(O,`"`).replace(k,`'`).replace(A,`'`).replace(j,`<`).replace(M,`>`)}function P(e){var t,n,i,a;let o=(t=(n=e==null||(i=e.currentTarget)==null?void 0:i.dataset)==null?e==null||(a=e.target)==null?void 0:a.dataset:n)==null?{}:t,s=r(o,`wvArgs`,e),c=[];if(Array.isArray(s))c=s;else if(typeof s==`string`)try{c=JSON.parse(s)}catch(e){try{c=JSON.parse(N(s))}catch(e){c=[]}}return Array.isArray(c)||(c=[]),c.map(t=>t===`$event`?e:t)}function F(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 I(e){return Array.isArray(e)&&e[0]===g&&typeof e[1]==`string`}function L(e,t){return(...n)=>{var r;let i=e==null||(r=e.selectOwnerComponent)==null?void 0:r.call(e),a=i==null?void 0:i[d];if(typeof a!=`function`)return;let o={wd:1,wi:t[1]},s=Array.isArray(t[2])?t[2]:[],c=Array.isArray(t[3])?t[3]:[];s.forEach((e,t)=>o[`wvS${t}`]=e),c.forEach((e,t)=>o[`wvI${t}`]=e);let l={type:`wv-slot-function`,detail:n,currentTarget:{dataset:o},target:{dataset:o}};return a.call(i,l)}}function R(e,t){return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,I(n)?L(e,n):n]))}function z(e){var t,n,r,i;return(t=(n=e==null||(r=e.__wevu)==null?void 0:r.proxy)==null?e==null||(i=e[h])==null?void 0:i.proxy:n)==null?e:t}function B(e,t){if(!t||Object.keys(t).length===0)return;let n=z(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof(i==null?void 0:i.get)==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch(e){}return r}function V(e){var t,n;e==null||(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)}function H(r,i,a){var o;V(r);let s=B(r,i);if(!s||typeof(r==null?void 0:r.setData)!=`function`)return;let c=e(r,`__wvScopedSlotComputedSnapshot`),l=(o=r.__wvScopedSlotComputedSnapshot)==null?{}:o,u={},d={};for(let[r,i]of Object.entries(s))u[r]=t(i),(a!=null&&a.force||!c||!e(l,r)||!n(l[r],i,20,{keys:1e4}))&&(d[r]=i);for(let t of Object.keys(l))e(s,t)||(d[t]=null);r.__wvScopedSlotComputedSnapshot=u,Object.keys(d).length>0&&r.setData(d)}function U(r,i){var a,o,s,c,l;let u=e(i==null?{}:i,C)?i[C]:r==null||(a=r.properties)==null?void 0:a[C],d=e(i==null?{}:i,S)?i[S]:r==null||(o=r.properties)==null?void 0:o[S],f=F(u),p=F(d),m={...f,...p},h=!e(r,`__wvSlotPropsSnapshot`)||!n((s=r.__wvSlotPropsSnapshot)==null?{}:s,m,20,{keys:1e4}),g=h||!r[x]?R(r,m):r[x];h&&(r.__wvSlotPropsSnapshot=t(m)),r[x]=g;let _=r==null||(c=r.__wevu)==null?void 0:c.state,v
|
|
1
|
+
import{hasOwn as e}from"../../utils.mjs";import{cloneSnapshotValue as t,isDeepEqualValue as n}from"../app/setData/snapshot.mjs";import{resolveDatasetEventValue as r,runInlineExpression as i}from"../register/inline.mjs";import{getOwnerProxy as a,getOwnerSnapshot as o,getOwnerTarget as s,subscribeOwner as c}from"../scopedSlots.mjs";import{clearTemplateRefs as l,scheduleTemplateRefUpdate as u}from"../templateRefs.mjs";import{WEVU_INLINE_HANDLER as d,WEVU_INLINE_MAP_KEY as f,WEVU_OWNER_HANDLER as p,WEVU_PROPS_DERIVED_KEYS_KEY as m,WEVU_PUBLIC_RUNTIME_KEY as h,WEVU_SLOT_FUNCTION_TOKEN as g,WEVU_SLOT_OWNER_ID_KEY as _,WEVU_SLOT_OWNER_ID_PROP as v,WEVU_SLOT_OWNER_KEY as y,WEVU_SLOT_OWNER_PROXY_KEY as b,WEVU_SLOT_PROPS_DATA_KEY as x,WEVU_SLOT_PROPS_KEY as S,WEVU_SLOT_SCOPE_KEY as C,WEVU_TEMPLATE_REFS_KEY as w}from"@weapp-core/constants";const T=[_,v,b,y,x,S,C],E=/&/g,D=/"/g,O=/"/g,k=/'/g,A=/'/g,j=/</g,M=/>/g;function N(e){return e.replace(E,`&`).replace(D,`"`).replace(O,`"`).replace(k,`'`).replace(A,`'`).replace(j,`<`).replace(M,`>`)}function P(e){var t,n,i,a;let o=(t=(n=e==null||(i=e.currentTarget)==null?void 0:i.dataset)==null?e==null||(a=e.target)==null?void 0:a.dataset:n)==null?{}:t,s=r(o,`wvArgs`,e),c=[];if(Array.isArray(s))c=s;else if(typeof s==`string`)try{c=JSON.parse(s)}catch(e){try{c=JSON.parse(N(s))}catch(e){c=[]}}return Array.isArray(c)||(c=[]),c.map(t=>t===`$event`?e:t)}function F(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 I(e){return Array.isArray(e)&&e[0]===g&&typeof e[1]==`string`}function L(e,t){return(...n)=>{var r;let i=e==null||(r=e.selectOwnerComponent)==null?void 0:r.call(e),a=i==null?void 0:i[d];if(typeof a!=`function`)return;let o={wd:1,wi:t[1]},s=Array.isArray(t[2])?t[2]:[],c=Array.isArray(t[3])?t[3]:[];s.forEach((e,t)=>o[`wvS${t}`]=e),c.forEach((e,t)=>o[`wvI${t}`]=e);let l={type:`wv-slot-function`,detail:n,currentTarget:{dataset:o},target:{dataset:o}};return a.call(i,l)}}function R(e,t){return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,I(n)?L(e,n):n]))}function z(e){var t,n,r,i;return(t=(n=e==null||(r=e.__wevu)==null?void 0:r.proxy)==null?e==null||(i=e[h])==null?void 0:i.proxy:n)==null?e:t}function B(e,t){if(!t||Object.keys(t).length===0)return;let n=z(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof(i==null?void 0:i.get)==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch(e){}return r}function V(e){var t,n;e==null||(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)}function H(r,i,a){var o;V(r);let s=B(r,i);if(!s||typeof(r==null?void 0:r.setData)!=`function`)return;let c=e(r,`__wvScopedSlotComputedSnapshot`),l=(o=r.__wvScopedSlotComputedSnapshot)==null?{}:o,u={},d={};for(let[r,i]of Object.entries(s))u[r]=t(i),(a!=null&&a.force||!c||!e(l,r)||!n(l[r],i,20,{keys:1e4}))&&(d[r]=i);for(let t of Object.keys(l))e(s,t)||(d[t]=null);r.__wvScopedSlotComputedSnapshot=u,Object.keys(d).length>0&&r.setData(d)}function U(r,i){var a,o,s,c,l;let u=e(i==null?{}:i,C)?i[C]:r==null||(a=r.properties)==null?void 0:a[C],d=e(i==null?{}:i,S)?i[S]:r==null||(o=r.properties)==null?void 0:o[S],f=F(u),p=F(d),m={...f,...p},h=!e(r,`__wvSlotPropsSnapshot`)||!n((s=r.__wvSlotPropsSnapshot)==null?{}:s,m,20,{keys:1e4}),g=h||!r[x]?R(r,m):r[x];h&&(r.__wvSlotPropsSnapshot=t(m)),r[x]=g;let _=r==null||(c=r.__wevu)==null?void 0:c.state,v=!(!_||typeof _!=`object`||e(_,x)&&n((l=_[x])==null?{}:l,m,20,{keys:1e4}));return _&&typeof _==`object`&&(_[x]=g),{merged:g,runtimeSnapshotChanged:v,snapshot:m,snapshotChanged:h}}function W(e,t,n){let{runtimeSnapshotChanged:r,snapshot:i,snapshotChanged:a}=U(e,n);(a||r)&&typeof(e==null?void 0:e.setData)==`function`&&e.setData({[x]:i}),a&&H(e,t)}function G(e,t){var n;let r=!1;e[b]!==t&&(e[b]=t,r=!0);let i=e==null?void 0:e.data;if(i&&typeof i==`object`&&i[b]!==t){try{Object.defineProperty(i,b,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[b]=t}r=!0}let a=e==null||(n=e.__wevu)==null?void 0:n.state;return a&&typeof a==`object`&&a[b]!==t&&(a[b]=t,r=!0),r}function K(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function q(e,n,r,i){if(typeof e==`function`){r[n]=e;return}if(typeof e!=`object`||!e)return e;if(i.has(e))return;if(Array.isArray(e)){i.add(e);let t=e.map((e,t)=>{let a=q(e,`${n}.${t}`,r,i);return a===void 0?null:a});return i.delete(e),t}if(!K(e))return t(e);i.add(e);let a={};for(let[t,o]of Object.entries(e)){let e=q(o,`${n}.${t}`,r,i);e!==void 0&&(a[t]=e)}return i.delete(e),a}function J(e){let t={},n=q(e,y,t,new WeakSet);return{[y]:n,...t}}function Y(r,i,a,o){var s;let c=G(r,a),{snapshotChanged:l}=U(r),u=i||{},d=!e(r,`__wvOwnerSnapshot`)||!n((s=r.__wvOwnerSnapshot)==null?{}:s,u,20,{keys:1e4});if(d){var f;r.__wvOwnerSnapshot=t(u),r[y]=u;let e=r==null||(f=r.__wevu)==null?void 0:f.state;e&&typeof e==`object`&&(e[y]=u)}d&&typeof(r==null?void 0:r.setData)==`function`&&r.setData(J(u)),(d||c||l)&&H(r,o)}function X(e,t,n){if(!t){typeof(e==null?void 0:e.__wvOwnerUnsub)==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerUnsub=void 0,e.__wvOwnerBoundId=``,G(e,void 0);return}let r=(t,r)=>{Y(e,t,r,n)};e.__wvOwnerBoundId!==t&&(typeof e.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerBoundId=t,e.__wvOwnerUnsub=c(t,r));let i=o(t);i&&r(i,a(t))}function Z(e){var t,n,r,i;return(t=(n=e==null||(r=e.properties)==null?void 0:r[v])==null?e==null||(i=e.properties)==null?void 0:i[_]:n)==null?``:t}function Q(e,t){W(e,t);let n=Z(e);n&&X(e,n,t)}function $(){let e={[y]:{},[x]:{}};return Object.defineProperty(e,b,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function ee(e){let t=e==null?void 0:e.computed,n=e==null?void 0:e.templateRefs,a=e=>{let t=Z(e);return t?s(t):void 0},o={options:{virtualHost:!0},setData:{omit:T},[m]:T,properties:{[v]:{type:String,value:``,observer(e){X(this,e||``,t)}},[_]:{type:String,value:``,observer(e){X(this,e||``,t)}},[S]:{type:null,value:null,observer(e){W(this,t,{[S]:e})}},[C]:{type:null,value:null,observer(e){W(this,t,{[C]:e})}}},data:$,lifetimes:{attached(){Q(this,t)},ready(){Q(this,t),H(this,t,{force:!0});let e=a(this);e&&u(this,void 0,e)},detached(){let e=a(this);e&&l(this,e),typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub(),this.__wvOwnerUnsub=void 0,this.__wvOwnerBoundId=``,G(this,void 0)}},methods:{[p](e){var t,n,a,o,s;let c=this[b],l=(t=this.__wevu)==null||(t=t.methods)==null?void 0:t[f],u=i(c,void 0,e,l);if(u!==void 0)return u;if(!c)return;let d=(n=(a=e==null||(o=e.currentTarget)==null?void 0:o.dataset)==null?e==null||(s=e.target)==null?void 0:s.dataset:a)==null?{}:n,p=r(d,`wvHandler`,e);if(typeof p!=`string`||!p)return;let m=c==null?void 0:c[p];if(typeof m!=`function`)return;let h=P(e);return m.apply(c,h)}}};return e!=null&&e.computed&&Object.keys(e.computed).length>0&&(o.computed=e.computed),e!=null&&e.inlineMap&&Object.keys(e.inlineMap).length>0&&(o.methods={...o.methods,[f]:e.inlineMap}),n!=null&&n.length&&(o[w]=n),o}export{ee as createScopedSlotOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{getCurrentMiniProgramPages as n}from"./platform.mjs";import{getCurrentInstance as r,getCurrentSetupContext as i}from"./hooks/base.mjs";import{getCurrentPageInstance as a}from"./register/component/lifecycle/platform.mjs";import{WEVU_PAGE_LAYOUT_NAME_KEY as o,WEVU_PAGE_LAYOUT_NONE as s,WEVU_PAGE_LAYOUT_PROPS_KEY as c,WEVU_PAGE_LAYOUT_SETTER_KEY as l}from"@weapp-core/constants";function u(){let e=a();if(e)return e;let t=n();return t[t.length-1]}function d(e){return e!==s&&e}function f(){var n,a;if(!i())throw Error(`usePageLayout() 必须在 setup() 的同步阶段调用`);let s=r(),l=s==null||(n=s.__wevu)==null?void 0:n.state,u=e({name:d(l==null?void 0:l[o]),props:{...(a=l==null?void 0:l[c])==null?{}:a}});return s&&(s.__wevuPageLayoutState=u),t(u)}function p(e,t,n){let r=e.__wevuPageLayoutState;r&&(r.name=t,r.props={...n})}function m(e){var t,n;let r=e.__wevuPageLayoutState,i=(t=e.__wevu)==null?void 0:t.state
|
|
1
|
+
import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{getCurrentMiniProgramPages as n}from"./platform.mjs";import{getCurrentInstance as r,getCurrentSetupContext as i}from"./hooks/base.mjs";import{getCurrentPageInstance as a}from"./register/component/lifecycle/platform.mjs";import{WEVU_PAGE_LAYOUT_NAME_KEY as o,WEVU_PAGE_LAYOUT_NONE as s,WEVU_PAGE_LAYOUT_PROPS_KEY as c,WEVU_PAGE_LAYOUT_SETTER_KEY as l}from"@weapp-core/constants";function u(){let e=a();if(e)return e;let t=n();return t[t.length-1]}function d(e){return e!==s&&e}function f(){var n,a;if(!i())throw Error(`usePageLayout() 必须在 setup() 的同步阶段调用`);let s=r(),l=s==null||(n=s.__wevu)==null?void 0:n.state,u=e({name:d(l==null?void 0:l[o]),props:{...(a=l==null?void 0:l[c])==null?{}:a}});return s&&(s.__wevuPageLayoutState=u),t(u)}function p(e,t,n){let r=e.__wevuPageLayoutState;r&&(r.name=t,r.props={...n})}function m(e){var t,n;let r=e.__wevuPageLayoutState,i=(t=e.__wevu)==null?void 0:t.state;r&&i&&(r.name=d(i[o]),r.props={...(n=i[c])==null?{}:n})}function h(e,t){let n=r(),i=n==null?void 0:n[l];if(typeof i==`function`){i(e,t);return}let a=u(),o=a==null?void 0:a[l];if(typeof o==`function`){o(e,t);return}throw Error(`setPageLayout() 未找到当前页面实例。请在页面 setup()、事件回调或当前页面上下文中调用。`)}function g(e){return e===!1?s:e}export{g as resolveRuntimePageLayoutName,h as setPageLayout,p as syncRuntimePageLayoutState,m as syncRuntimePageLayoutStateFromRuntime,f as usePageLayout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentInstance as e}from"./hooks/base.mjs";import{onDetached as t,onPageScroll as n,onUnload as r}from"./hooks/register.mjs";function i(e){return typeof e!=`number`||!Number.isFinite(e)?80:Math.max(0,e)}function a(e){if(
|
|
1
|
+
import{getCurrentInstance as e}from"./hooks/base.mjs";import{onDetached as t,onPageScroll as n,onUnload as r}from"./hooks/register.mjs";function i(e){return typeof e!=`number`||!Number.isFinite(e)?80:Math.max(0,e)}function a(e){if(typeof e==`number`&&Number.isFinite(e))return Math.max(0,e)}function o(o,s={}){var c,l;if(!e())throw Error(`usePageScrollThrottle() 必须在 setup() 的同步阶段调用`);if(typeof o!=`function`)throw TypeError(`usePageScrollThrottle() 需要传入回调函数`);let u=i(s.interval),d=(c=s.leading)==null||c,f=(l=s.trailing)==null||l,p=a(s.maxWait),m,h,g=!1,_=0,v,y=()=>{m&&(clearTimeout(m),m=void 0)},b=()=>{h&&(clearTimeout(h),h=void 0)},x=e=>{y(),b(),v=void 0,_=Date.now(),o(e)},S=()=>{let e=v;v=void 0,m=void 0,e&&!g&&x(e)},C=()=>{let e=v;h=void 0,e&&!g&&x(e)},w=e=>{if(!f||m)return;let t=Math.max(0,u-(e-(_===0?e:_)));m=setTimeout(S,t)},T=e=>{if(typeof p!=`number`||h)return;let t=p-(e-(_===0?e:_));if(t<=0){C();return}h=setTimeout(C,t)};n(e=>{if(g)return;if(u===0){x(e);return}let t=Date.now();if(v=e,d&&(_===0||t-_>=u)){x(e);return}if(typeof p==`number`&&t-(_===0?t:_)>=p){x(e);return}(f||typeof p==`number`)&&(w(t),T(t))});let E=()=>{g||(g=!0,v=void 0,y(),b())};return r(E),t(E),E}export{o as usePageScrollThrottle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentMiniProgramPages as e,getCurrentMiniProgramRuntimeCapabilities as t,getMiniProgramGlobalObject as n,supportsCurrentMiniProgramRuntimeCapability as r}from"../../../platform.mjs";import{callHookList as i}from"../../../hooks/base.mjs";import{WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as a}from"@weapp-core/constants";let o=!1,s;function c(){return s}function l(e){s=e}function u(e){s===e&&(s=void 0)}function d(e,t){var n;let r=Number((n=e[a])==null?0:n);e[a]=r+1;try{return t()}finally{var i;let t=Number((i=e[a])==null?1:i)-1;t<=0?delete e[a]:e[a]=t}}function f(t){let n=t.options;if(n&&typeof n==`object`)return n;let r=e(),i=r[r.length-1],a=i&&typeof i==`object`?i.options:void 0;return a&&typeof a==`object`?a:{}}function p(){if(o)return;o=!0;let e=n();if(
|
|
1
|
+
import{getCurrentMiniProgramPages as e,getCurrentMiniProgramRuntimeCapabilities as t,getMiniProgramGlobalObject as n,supportsCurrentMiniProgramRuntimeCapability as r}from"../../../platform.mjs";import{callHookList as i}from"../../../hooks/base.mjs";import{WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as a}from"@weapp-core/constants";let o=!1,s;function c(){return s}function l(e){s=e}function u(e){s===e&&(s=void 0)}function d(e,t){var n;let r=Number((n=e[a])==null?0:n);e[a]=r+1;try{return t()}finally{var i;let t=Number((i=e[a])==null?1:i)-1;t<=0?delete e[a]:e[a]=t}}function f(t){let n=t.options;if(n&&typeof n==`object`)return n;let r=e(),i=r[r.length-1],a=i&&typeof i==`object`?i.options:void 0;return a&&typeof a==`object`?a:{}}function p(){if(o)return;o=!0;let e=n();if(e&&typeof e==`object`){if(r(`pullDownRefreshApi`)){let t=e.startPullDownRefresh;typeof t==`function`&&(e.startPullDownRefresh=function(...e){let n=t.apply(this,e);return s&&i(s,`onPullDownRefresh`,[]),n})}if(r(`pageScrollApi`)){let t=e.pageScrollTo;typeof t==`function`&&(e.pageScrollTo=function(e,...n){let r=t.apply(this,[e,...n]);if(s){let t=s;d(t,()=>{i(t,`onPageScroll`,[e==null?{}:e])})}return r})}}}function m(e){let{enableOnShareAppMessage:i,enableOnShareTimeline:a}=e;if(!i&&!a||!r(`pageShareMenu`))return;let o=n();if(!o||typeof o.showShareMenu!=`function`)return;let s=t().shareTimelineRequiresShareAppMessage?i||a:i;if(!s&&!a)return;let c=[];s&&c.push(`shareAppMessage`),a&&c.push(`shareTimeline`);let l=[{withShareTicket:!0,menus:c},{menus:c},a?{withShareTicket:!0}:void 0,a?{}:void 0,void 0];for(let e of l)try{e===void 0?o.showShareMenu():o.showShareMenu(e);break}catch(e){}}export{l as bindCurrentPageInstance,p as ensureMiniProgramGlobalPatched,m as ensurePageShareMenus,c as getCurrentPageInstance,u as releaseCurrentPageInstance,f as resolvePageOptions,d as runInPageScrollHook};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{callHookList as e}from"../../hooks/base.mjs";import{bindCurrentPageInstance as t,ensureMiniProgramGlobalPatched as n,ensurePageShareMenus as r,releaseCurrentPageInstance as i,resolvePageOptions as a}from"./lifecycle/platform.mjs";import{scheduleTemplateRefUpdate as o}from"../../templateRefs.mjs";import{enableDeferredSetData as s,mountRuntimeInstance as c,setRuntimeSetDataVisibility as l,teardownRuntimeInstance as u}from"../runtimeInstance.mjs";import{
|
|
1
|
+
import{callHookList as e}from"../../hooks/base.mjs";import{bindCurrentPageInstance as t,ensureMiniProgramGlobalPatched as n,ensurePageShareMenus as r,releaseCurrentPageInstance as i,resolvePageOptions as a}from"./lifecycle/platform.mjs";import{scheduleTemplateRefUpdate as o}from"../../templateRefs.mjs";import{enableDeferredSetData as s,mountRuntimeInstance as c,setRuntimeSetDataVisibility as l,teardownRuntimeInstance as u}from"../runtimeInstance.mjs";import{cancelInitialNavigation as d,ensureInitialNavigation as f}from"../../../router/initialNavigation.mjs";import{notifyRouteStateSync as p}from"../../../router/routeSync.mjs";import{attachOptionalPageLifecycleHooks as m}from"./lifecycle/optionalHooks.mjs";import{WEVU_ON_LOAD_CALLED_KEY as h,WEVU_READY_CALLED_KEY as g,WEVU_ROUTE_DONE_CALLED_KEY as _}from"@weapp-core/constants";function v(v){let{runtimeApp:y,watch:b,setup:x,userOnLoad:S,userOnUnload:C,userOnShow:w,userOnHide:T,userOnReady:E,isPage:D,enableOnSaveExitState:O,enableOnPullDownRefresh:k,enableOnReachBottom:A,enableOnPageScroll:j,enableOnRouteDone:M,enableOnRouteDoneFallback:N,enableOnTabItemTap:P,enableOnResize:F,enableOnShareAppMessage:I,enableOnShareTimeline:L,enableOnAddToFavorites:R,syncWevuPropsFromValues:z,effectiveOnSaveExitState:B,effectiveOnPullDownRefresh:V,effectiveOnReachBottom:H,effectiveOnPageScroll:U,effectiveOnRouteDone:W,effectiveOnTabItemTap:G,effectiveOnResize:K,effectiveOnShareAppMessage:q,effectiveOnShareTimeline:J,effectiveOnAddToFavorites:Y,hasHook:X}=v,Z=e=>{var t,n;(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)},Q={onLoad(...t){if(this[h])return;this[h]=!0;let n=()=>{c(this,y,b,x);let n=t[0]&&typeof t[0]==`object`?t[0]:a(this);if(z==null||z(this,n),Z(this),s(this),D&&r({enableOnShareAppMessage:I,enableOnShareTimeline:L}),e(this,`onLoad`,t),typeof S==`function`)return S.apply(this,t.length?t:[n])};return(D?f(this,t[0],{onComplete:e=>{e&&n()}}):void 0)||n()},onUnload(...e){if(d(this),D&&i(this),u(this),typeof C==`function`)return C.apply(this,e)},onShow(...i){if(D&&(n(),t(this),this[h]||Q.onLoad.call(this,a(this)),z==null||z(this,a(this)),Z(this),r({enableOnShareAppMessage:I,enableOnShareTimeline:L}),this[_]=!1),l(this,!0),D&&p({page:this,source:`page`}),e(this,`onShow`,i),typeof w==`function`)return w.apply(this,i)},onHide(...t){if(D&&i(this),l(this,!1),e(this,`onHide`,t),typeof T==`function`)return T.apply(this,t)},onReady(...t){if(D&&(this[h]||Q.onLoad.call(this,a(this)),z==null||z(this,a(this)),Z(this),r({enableOnShareAppMessage:I,enableOnShareTimeline:L})),!this[g]){if(this[g]=!0,D&&M&&N){let e=this;setTimeout(()=>{if(!e[_]){var t;(t=Q.onRouteDone)==null||t.call(e)}},0)}let n=()=>{e(this,`onReady`,t),typeof E==`function`&&E.apply(this,t)},r=()=>o(this,n);D&&f(this,void 0,{start:!1,onComplete:e=>{e&&r()}})||r();return}if(typeof E==`function`)return E.apply(this,t)}};return m(Q,{enableOnSaveExitState:O,enableOnPullDownRefresh:k,enableOnReachBottom:A,enableOnPageScroll:j,enableOnRouteDone:M,enableOnTabItemTap:P,enableOnResize:F,enableOnShareAppMessage:I,enableOnShareTimeline:L,enableOnAddToFavorites:R,effectiveOnSaveExitState:B,effectiveOnPullDownRefresh:V,effectiveOnReachBottom:H,effectiveOnPageScroll:U,effectiveOnRouteDone:W,effectiveOnTabItemTap:G,effectiveOnResize:K,effectiveOnShareAppMessage:q,effectiveOnShareTimeline:J,effectiveOnAddToFavorites:Y,hasHook:X}),Q}export{v as createPageLifecycleHooks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseModelEventValue as e}from"../../internal.mjs";import{runInlineExpression as t}from"../inline.mjs";import{runJsxIslandHandler as n}from"../../jsxIsland.mjs";import{WEVU_INLINE_HANDLER as r,WEVU_INLINE_MAP_KEY as i,WEVU_JSX_ISLAND_HANDLER as a,WEVU_MODEL_HANDLER as o,WEVU_NATIVE_INSTANCE_KEY as s,WEVU_OWNER_HANDLER as c,WEVU_RESERVED_METHOD_PREFIX as l,WEVU_RUNTIME_KEY as u}from"@weapp-core/constants";function d(d){let{userMethods:f,runtimeMethods:p}=d,m={...f};m[r]||(m[r]=function(e){var n,r;let a=this.__wevu,o=(n=a==null?void 0:a.proxy)==null?this:n,s=a==null||(r=a.methods)==null?void 0:r[i];return t(o,void 0,e,s)}),m[o]||(m[o]=function(t){var n,r,i;let a=(n=t==null||(r=t.currentTarget)==null||(r=r.dataset)==null?void 0:r.wvModel)==null?t==null||(i=t.target)==null||(i=i.dataset)==null?void 0:i.wvModel:n;if(typeof a!=`string`||!a)return;let o=this.__wevu;if(!o||typeof o.bindModel!=`function`)return;let s=e(t);try{o.bindModel(a).update(s)}catch(e){}}),m[a]||(m[a]=function(e){return n(this,e)}),!m[c]&&typeof(p==null?void 0:p[c])==`function`&&(m[c]=p[c]);let h=Object.keys(p==null?{}:p);function g(e){let t=e.__wevu;if(t)return t;let n=e.$state;if(n&&typeof n==`object`)return n[u]}function _(e,t){if((e==null?void 0:e.proxy)===t)return;let n=e==null?void 0:e.proxy,r=e=>{let r=t[e];if(typeof r!=`function`)return!1;let i=n==null?void 0:n[e];return typeof i==`function`&&r===i};if(r(`triggerEvent`)||r(`createSelectorQuery`)||r(`createIntersectionObserver`)||r(`setData`)||typeof t.triggerEvent!=`function`&&typeof t.createSelectorQuery!=`function`&&typeof t.createIntersectionObserver!=`function`&&typeof t.setData!=`function`)return;let i=e==null?void 0:e.state;if(
|
|
1
|
+
import{parseModelEventValue as e}from"../../internal.mjs";import{runInlineExpression as t}from"../inline.mjs";import{runJsxIslandHandler as n}from"../../jsxIsland.mjs";import{WEVU_INLINE_HANDLER as r,WEVU_INLINE_MAP_KEY as i,WEVU_JSX_ISLAND_HANDLER as a,WEVU_MODEL_HANDLER as o,WEVU_NATIVE_INSTANCE_KEY as s,WEVU_OWNER_HANDLER as c,WEVU_RESERVED_METHOD_PREFIX as l,WEVU_RUNTIME_KEY as u}from"@weapp-core/constants";function d(d){let{userMethods:f,runtimeMethods:p}=d,m={...f};m[r]||(m[r]=function(e){var n,r;let a=this.__wevu,o=(n=a==null?void 0:a.proxy)==null?this:n,s=a==null||(r=a.methods)==null?void 0:r[i];return t(o,void 0,e,s)}),m[o]||(m[o]=function(t){var n,r,i;let a=(n=t==null||(r=t.currentTarget)==null||(r=r.dataset)==null?void 0:r.wvModel)==null?t==null||(i=t.target)==null||(i=i.dataset)==null?void 0:i.wvModel:n;if(typeof a!=`string`||!a)return;let o=this.__wevu;if(!o||typeof o.bindModel!=`function`)return;let s=e(t);try{o.bindModel(a).update(s)}catch(e){}}),m[a]||(m[a]=function(e){return n(this,e)}),!m[c]&&typeof(p==null?void 0:p[c])==`function`&&(m[c]=p[c]);let h=Object.keys(p==null?{}:p);function g(e){let t=e.__wevu;if(t)return t;let n=e.$state;if(n&&typeof n==`object`)return n[u]}function _(e,t){if((e==null?void 0:e.proxy)===t)return;let n=e==null?void 0:e.proxy,r=e=>{let r=t[e];if(typeof r!=`function`)return!1;let i=n==null?void 0:n[e];return typeof i==`function`&&r===i};if(r(`triggerEvent`)||r(`createSelectorQuery`)||r(`createIntersectionObserver`)||r(`setData`)||typeof t.triggerEvent!=`function`&&typeof t.createSelectorQuery!=`function`&&typeof t.createIntersectionObserver!=`function`&&typeof t.setData!=`function`)return;let i=e==null?void 0:e.state;if(i&&typeof i==`object`&&t.$state!==i)try{Object.defineProperty(i,s,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[s]=t}}for(let e of h){if(e===i||e.startsWith(l))continue;let t=m[e];m[e]=function(...n){var r;let i=g(this);_(i,this);let a,o=i==null||(r=i.methods)==null?void 0:r[e];if(o&&(a=o.apply(i.proxy,n)),typeof t==`function`){let e=t.apply(this,n);return e===void 0?a:e}return a}}return{finalMethods:m}}export{d as createComponentMethods};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasOwn as e}from"../../../utils.mjs";import{isDeepEqualValue as t}from"../../app/setData/snapshot.mjs";import{refreshOwnerSnapshotFromInstance as n}from"../snapshot.mjs";import{WEVU_ATTRS_KEY as r,WEVU_PENDING_PROP_VALUES_KEY as i,WEVU_PROPS_DERIVED_KEYS_KEY as a,WEVU_PROPS_KEY as o,WEVU_PROP_KEYS_KEY as s,WEVU_SLOT_NAMES_PROP as c,WEVU_SLOT_OWNER_ID_PROP as l,WEVU_SLOT_SCOPE_KEY as u}from"@weapp-core/constants";function d(d){let{restOptions:f,propsAliases:p,propsDerivedKeys:m,userObservers:h}=d,g=f.properties&&typeof f.properties==`object`?Object.keys(f.properties):[],_=new Set(g),v=new Set(m==null?[]:m),y=Object.entries(p==null?{}:p).filter(([e,t])=>e&&t),b=new Set([c,l,u]),x=g.filter(e=>!b.has(e)),S=new WeakMap,C=e=>e.startsWith(`__wv_`),w=e=>{let t=e.__wevu,n=t==null?void 0:t[a];if(n instanceof Set)for(let e of x)n.add(e)},T=(t,n,r)=>e(t,n)&&Object.is(t[n],r)?!1:(t[n]=r,!0),E=(n,r,i)=>b.has(r)&&e(n,r)&&t(n[r],i,20,{keys:1e4})?!1:T(n,r,i),D=(e,t,n)=>{var r;if(!b.has(t))return;let i=!1,a=(r=e.__wevu)==null?void 0:r.state;try{a&&typeof a==`object`&&E(a,t,n);let r=e.data;r&&typeof r==`object`&&(i=E(r,t,n))}catch(e){}if(
|
|
1
|
+
import{hasOwn as e}from"../../../utils.mjs";import{isDeepEqualValue as t}from"../../app/setData/snapshot.mjs";import{refreshOwnerSnapshotFromInstance as n}from"../snapshot.mjs";import{WEVU_ATTRS_KEY as r,WEVU_PENDING_PROP_VALUES_KEY as i,WEVU_PROPS_DERIVED_KEYS_KEY as a,WEVU_PROPS_KEY as o,WEVU_PROP_KEYS_KEY as s,WEVU_SLOT_NAMES_PROP as c,WEVU_SLOT_OWNER_ID_PROP as l,WEVU_SLOT_SCOPE_KEY as u}from"@weapp-core/constants";function d(d){let{restOptions:f,propsAliases:p,propsDerivedKeys:m,userObservers:h}=d,g=f.properties&&typeof f.properties==`object`?Object.keys(f.properties):[],_=new Set(g),v=new Set(m==null?[]:m),y=Object.entries(p==null?{}:p).filter(([e,t])=>e&&t),b=new Set([c,l,u]),x=g.filter(e=>!b.has(e)),S=new WeakMap,C=e=>e.startsWith(`__wv_`),w=e=>{let t=e.__wevu,n=t==null?void 0:t[a];if(n instanceof Set)for(let e of x)n.add(e)},T=(t,n,r)=>e(t,n)&&Object.is(t[n],r)?!1:(t[n]=r,!0),E=(n,r,i)=>b.has(r)&&e(n,r)&&t(n[r],i,20,{keys:1e4})?!1:T(n,r,i),D=(e,t,n)=>{var r;if(!b.has(t))return;let i=!1,a=(r=e.__wevu)==null?void 0:r.state;try{a&&typeof a==`object`&&E(a,t,n);let r=e.data;r&&typeof r==`object`&&(i=E(r,t,n))}catch(e){}if(i&&typeof e.setData==`function`)try{e.setData({[t]:n})}catch(e){}},O=(t,n)=>{var r;if(!y.length)return;let i=t.__wevu,a=i==null?void 0:i.setupState,o=i==null?void 0:i.state;if(!a||typeof a!=`object`)return;w(t);let s=(r=S.get(t))==null?new Set:r;S.set(t,s);for(let[t,r]of y){if(e(a,t)&&!s.has(t))continue;let i=n[r];try{T(a,t,i),s.add(t)}catch(e){}if(o&&typeof o==`object`&&(!e(o,t)||s.has(t)))try{T(o,t,i)}catch(e){}}},k=(t,n)=>{if(!v.size)return;let r=t.__wevu,i=r==null?void 0:r.setupState;if(!i||typeof i!=`object`)return;w(t);let a=new Map(y);for(let t of v){var o;let r=(o=a.get(t))==null?t:o;if(e(n,r))try{T(i,t,n[r])}catch(e){}}},A=e=>{try{Object.defineProperty(e,s,{value:g,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[s]=g}},j=t=>{let i=t[r];if(!i||typeof i!=`object`)return;let a=n=>{var r;let i=(r=t.__wevu)==null?void 0:r.state;return typeof i==`object`&&!!i&&e(i,n)},o=t.properties,s=o&&typeof o==`object`?o:void 0,c=Object.keys(i);for(let t of c)if(!s||!e(s,t)||C(t)||_.has(t)||a(t))try{delete i[t]}catch(e){}if(!s){n(t);return}for(let[e,t]of Object.entries(s))if(!(C(e)||_.has(e)||a(e)))try{i[e]=t}catch(e){}n(t)},M=t=>{let r=t[o],a=t.properties,s=t[i];if(r&&typeof r==`object`&&a&&typeof a==`object`){let i=a,o=Object.keys(r);for(let t of o)if(!_.has(t)||!e(i,t))try{delete r[t]}catch(e){}for(let n of g){let a=s&&e(s,n);if(!a&&!e(i,n))continue;let o=a?s[n]:i[n];try{E(r,n,o)}catch(e){}D(t,n,o)}k(t,r),O(t,r),n(t)}s&&delete t[i],j(t)},N=(t,r)=>{if(!r||typeof r!=`object`)return;let i=t[o];if(!i||typeof i!=`object`)return;let a=!1;for(let n of g)if(e(r,n)){try{a=E(i,n,r[n])||a}catch(e){}D(t,n,r[n])}a&&(k(t,i),O(t,i),n(t),j(t))},P=(e,t,r)=>{var a,s;let c=e[o];if(!c||typeof c!=`object`)return;try{if(!E(c,t,r)){D(e,t,r);return}}catch(e){}D(e,t,r);let l=(s=(a=e)[i])==null?a[i]=Object.create(null):s;l[t]=r,k(e,c),O(e,c),n(e),j(e)},F={};if(g.length)for(let e of g)F[e]=function(t){P(this,e,t)};let I={...h==null?{}:h};for(let[e,t]of Object.entries(F)){let n=I[e];I[e]=typeof n==`function`?function(...e){n.apply(this,e),t.apply(this,e)}:t}let L=I[`**`];return I[`**`]=function(...e){typeof L==`function`&&L.apply(this,e),M(this)},{attachWevuPropKeys:A,directPropsDerivedKeys:x,syncWevuPropsFromInstance:M,syncWevuPropsFromValues:N,finalObservers:I}}export{d as createPropsSync};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getMiniProgramRuntimeGlobalObject as e}from"../../platform.mjs";import{callHookList as t}from"../../hooks/base.mjs";import{resolveRuntimePageLayoutName as n,syncRuntimePageLayoutState as r}from"../../pageLayout.mjs";import{getOwnerProxy as i}from"../../scopedSlots.mjs";import{clearTemplateRefs as a,scheduleTemplateRefUpdate as o}from"../../templateRefs.mjs";import{enableDeferredSetData as s,mountRuntimeInstance as c,refreshRuntimeInstance as
|
|
1
|
+
import{getMiniProgramRuntimeGlobalObject as e}from"../../platform.mjs";import{callHookList as t}from"../../hooks/base.mjs";import{resolveRuntimePageLayoutName as n,syncRuntimePageLayoutState as r}from"../../pageLayout.mjs";import{getOwnerProxy as i}from"../../scopedSlots.mjs";import{clearTemplateRefs as a,scheduleTemplateRefUpdate as o}from"../../templateRefs.mjs";import{enableDeferredSetData as s,mountRuntimeInstance as c,refreshRuntimeInstance as ee,setRuntimeSetDataVisibility as l,teardownRuntimeInstance as u}from"../runtimeInstance.mjs";import{ensureInitialNavigation as d}from"../../../router/initialNavigation.mjs";import{registerRuntimeLayoutHosts as te,unregisterRuntimeLayoutHosts as ne}from"../../layoutBridge.mjs";import{registerNativeComponentDefinition as f}from"./registerNativeDefinition.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as re,WEVU_LAYOUT_HOST_BRIDGE_KEY as p,WEVU_PAGE_LAYOUT_NAME_KEY as ie,WEVU_PAGE_LAYOUT_PROPS_KEY as ae,WEVU_PAGE_LAYOUT_SETTER_KEY as m,WEVU_PUBLIC_RUNTIME_KEY as h,WEVU_READY_CALLED_KEY as g,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as _,WEVU_RUNTIME_KEY as oe,WEVU_RUNTIME_OWNER_ID_KEY as se,WEVU_SLOT_OWNER_ID_KEY as v,WEVU_TEMPLATE_REFS_KEY as y}from"@weapp-core/constants";function b(e){let t=e.selectOwnerComponent;if(typeof t==`function`)try{let n=t.call(e);n&&n!==e&&o(n)}catch(e){}}function x(x){var S;let{runtimeApp:C,watch:w,setup:T,restOptions:ce,pageLifecycleHooks:E,finalObservers:D,userLifetimes:O,userPageLifetimes:k,finalMethods:A,finalOptions:j,applyExtraInstanceFields:M,templateRefs:N,layoutHosts:P,attachWevuPropKeys:F,setupLifecycle:I,syncWevuPropsFromInstance:L,directPropsDerivedKeys:R,isPage:z,vueLifecycles:B,getRuntimeOwnerLabel:V,registerNative:H=!0}=x,U=e=>{var t;let n=(t=e.__wevu)==null?e[h]:t;if(n)return n;let r=e.$state;if(r&&typeof r==`object`)return r[oe]},W=e=>{var t,n,r,i,a;return(t=(n=(r=e[se])==null?e[v]:r)==null?(i=e.data)==null?void 0:i[v]:n)==null?(a=e.properties)==null?void 0:a[v]:t},G=e=>{var t;let n=(t=U(e))==null?void 0:t.proxy;if(n)return n;let r=W(e);if(typeof r==`string`&&r){var a;return(a=i(r))==null?e:a}return e},K=e=>{let t=U(e);return t?{runtime:t,mounted:!1}:(M(e),F(e),c(e,C,w,T,{deferSetData:!0,snapshotOmitKeys:R}),L(e),s(e),{runtime:U(e),mounted:!0})},q=(e,t,n)=>{let r=B[t];if(typeof r==`function`)return r.apply(G(e),n)},J=(e,t)=>{if(!z){t();return}d(e,void 0,{start:!1,onComplete:e=>{e&&t()}})||t()},le=e=>{U(e)||typeof B.mounted!=`function`||K(e).mounted&&(q(e,`created`,[]),q(e,`beforeMount`,[]))},Y={},X=e=>{if(!Array.isArray(P)||!P.length||e[p])return;let t=te(P,e);t&&(e[p]=t)},Z=e=>{z&&(e[m]=(t,i)=>{var a;let o=(a=e.__wevu)==null?void 0:a.state;if(!o||typeof o!=`object`)return;o[ie]=n(t);let s=t===!1||i==null?{}:i;o[ae]=s,r(e,t,s)})};if(z)for(let e of[`onPullDownRefresh`,`onReachBottom`,`onShareAppMessage`,`onShareTimeline`,`onAddToFavorites`]){let t=E[e];typeof t==`function`&&typeof A[e]!=`function`&&(Y[e]=function(...e){return t.apply(this,e)})}let Q={...ce,...z?E:{},observers:D,lifetimes:{...O,created:function(...e){M(this),Array.isArray(N)&&N.length&&Object.defineProperty(this,y,{value:N,configurable:!0,enumerable:!1,writable:!1}),F(this),J(this,()=>{if(q(this,`beforeCreate`,e),I===`created`){try{c(this,C,w,T,{deferSetData:!0,snapshotOmitKeys:R})}catch(e){let t=V(this);throw Error(`[wevu] mount runtime failed in created (${t}): ${e instanceof Error?e.message:String(e)}`)}L(this),Z(this)}typeof O.created==`function`&&O.created.apply(this,e)})},moved:function(...e){t(this,`onMoved`,e),typeof O.moved==`function`&&O.moved.apply(this,e)},attached:function(...e){M(this),Array.isArray(N)&&N.length&&!this[y]&&Object.defineProperty(this,y,{value:N,configurable:!0,enumerable:!1,writable:!1}),F(this),J(this,()=>{if(I!==`created`||!this.__wevu)try{c(this,C,w,T,{deferSetData:!0,snapshotOmitKeys:R})}catch(e){let t=V(this);throw Error(`[wevu] mount runtime failed in attached (${t}): ${e instanceof Error?e.message:String(e)}`)}L(this),q(this,`created`,e),q(this,`beforeMount`,e),Z(this),X(this),s(this),t(this,`onAttached`,e),typeof O.attached==`function`&&O.attached.apply(this,e)})},ready:function(...e){if(!z||this[g]||!d(this,void 0,{start:!0,onComplete:t=>{t&&!this.__wevuInitialNavigationReady&&(this.__wevuInitialNavigationReady=!0,Q.lifetimes.ready.call(this,...e))}})||this.__wevuInitialNavigationReady){if(le(this),z&&typeof E.onReady==`function`){let t=!!this[g];if(E.onReady.call(this,...e),!t){let t=()=>q(this,`mounted`,e);d(this,void 0,{start:!1,onComplete:e=>{e&&t()}})||t()}typeof O.ready==`function`&&O.ready.apply(this,e);return}if(!this[g]){this[g]=!0,L(this),b(this),o(this,()=>{t(this,`onReady`,e),q(this,`mounted`,e),typeof O.ready==`function`&&O.ready.apply(this,e)});return}typeof O.ready==`function`&&O.ready.apply(this,e)}},detached:function(...e){if(q(this,`beforeUnmount`,e),q(this,`beforeDestroy`,e),b(this),t(this,`onDetached`,e),z&&typeof E.onUnload==`function`){E.onUnload.call(this,...e),typeof O.detached==`function`&&O.detached.apply(this,e),q(this,`unmounted`,e),q(this,`destroyed`,e);return}a(this),Array.isArray(P)&&P.length&&this[p]&&(ne(P,this[p]),delete this[p]),u(this),q(this,`unmounted`,e),q(this,`destroyed`,e),typeof O.detached==`function`&&O.detached.apply(this,e)},error:function(...e){t(this,`onError`,e),typeof O.error==`function`&&O.error.apply(this,e)}},pageLifetimes:{...k,show:function(...e){if(z&&typeof E.onShow==`function`){E.onShow.call(this,...e),typeof k.show==`function`&&k.show.apply(this,e);return}l(this,!0),t(this,`onShow`,e),typeof k.show==`function`&&k.show.apply(this,e)},hide:function(...e){if(z&&typeof E.onHide==`function`){E.onHide.call(this,...e),typeof k.hide==`function`&&k.hide.apply(this,e);return}l(this,!1),t(this,`onHide`,e),typeof k.hide==`function`&&k.hide.apply(this,e)},resize:function(...e){if(z&&typeof E.onResize==`function`){E.onResize.call(this,...e),typeof k.resize==`function`&&k.resize.apply(this,e);return}t(this,`onResize`,e),typeof k.resize==`function`&&k.resize.apply(this,e)},routeDone:function(...e){if(z&&typeof E.onRouteDone==`function`){E.onRouteDone.call(this,...e),typeof k.routeDone==`function`&&k.routeDone.apply(this,e);return}t(this,`onRouteDone`,e),typeof k.routeDone==`function`&&k.routeDone.apply(this,e)}},methods:{...Y,...A,[_]:function(){var e;let t=K(this);return t.mounted&&(q(this,`created`,[]),q(this,`beforeMount`,[])),(e=t.runtime)==null?void 0:e.proxy}},options:j};if(!H)return Q;let $=(S=e())==null?void 0:S[re];if(typeof($==null?void 0:$.trackWevuComponent)==`function`){let e=$.trackWevuComponent(Q,(e,t)=>{ee(e,C,w,T,{snapshotOmitKeys:R,stateSnapshot:t}),L(e),Z(e),X(e),s(e,{rehydrateSetupState:!0})});return $.isApplying()||f(e,z),e}return f(Q,z),Q}export{x as registerComponentDefinition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isRef as e}from"../../reactivity/ref.mjs";const t=/&/g,n=/"/g,r=/"/g,i=/'/g,a=/'/g,o=/</g,s=/>/g;function c(e){return e.replace(t,`&`).replace(n,`"`).replace(r,`"`).replace(i,`'`).replace(a,`'`).replace(o,`<`).replace(s,`>`)}const l=/^(?:0|[1-9]\d*)$/;function u(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`&&e.trim()){let t=e.trim();return l.test(t)?Number(t):t}}const d=/[^a-z0-9]+/gi,f=/^-+|-+$/g;function p(e){return e.trim().replace(d,`-`).replace(f,``).toLowerCase()}const m=/-([a-z0-9])/g,h=/[-_]/g;function g(e,t){let n=t.replace(h,``).toLowerCase();for(let[t,r]of Object.entries(e==null?{}:e))if(t.replace(h,``).toLowerCase()===n)return r}function _(e,t){let n=p(typeof(t==null?void 0:t.type)==`string`?t.type:``);if(!n)return;let r=n.replace(m,(e,t)=>t.toUpperCase());if(r)return`${e}${r[0].toUpperCase()}${r.slice(1)}`}const v={wvEventDetail:[`wd`,`wvEventDetail`],wvHandler:[`wh`,`wvHandler`],wvInlineId:[`wi`,`wvInlineId`]};function y(e,t,n){var r;let i=(r=v[t])==null?[t]:r;for(let t of i){let r=_(t,n);if(r&&(e==null?void 0:e[r])!==void 0)return e[r];if(r){let t=g(e,r);if(t!==void 0)return t}}for(let t of i){if((e==null?void 0:e[t])!==void 0)return e[t];let n=g(e,t);if(n!==void 0)return n}}function b(e,t,n){return y(e,t,n)}function x(e,t){let n=b(e,`wvEventDetail`,t);return n===!0||n===1||n===`1`||n===`true`}function S(e,t){if(!x(t,e))return e;if(
|
|
1
|
+
import{isRef as e}from"../../reactivity/ref.mjs";const t=/&/g,n=/"/g,r=/"/g,i=/'/g,a=/'/g,o=/</g,s=/>/g;function c(e){return e.replace(t,`&`).replace(n,`"`).replace(r,`"`).replace(i,`'`).replace(a,`'`).replace(o,`<`).replace(s,`>`)}const l=/^(?:0|[1-9]\d*)$/;function u(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`&&e.trim()){let t=e.trim();return l.test(t)?Number(t):t}}const d=/[^a-z0-9]+/gi,f=/^-+|-+$/g;function p(e){return e.trim().replace(d,`-`).replace(f,``).toLowerCase()}const m=/-([a-z0-9])/g,h=/[-_]/g;function g(e,t){let n=t.replace(h,``).toLowerCase();for(let[t,r]of Object.entries(e==null?{}:e))if(t.replace(h,``).toLowerCase()===n)return r}function _(e,t){let n=p(typeof(t==null?void 0:t.type)==`string`?t.type:``);if(!n)return;let r=n.replace(m,(e,t)=>t.toUpperCase());if(r)return`${e}${r[0].toUpperCase()}${r.slice(1)}`}const v={wvEventDetail:[`wd`,`wvEventDetail`],wvHandler:[`wh`,`wvHandler`],wvInlineId:[`wi`,`wvInlineId`]};function y(e,t,n){var r;let i=(r=v[t])==null?[t]:r;for(let t of i){let r=_(t,n);if(r&&(e==null?void 0:e[r])!==void 0)return e[r];if(r){let t=g(e,r);if(t!==void 0)return t}}for(let t of i){if((e==null?void 0:e[t])!==void 0)return e[t];let n=g(e,t);if(n!==void 0)return n}}function b(e,t,n){return y(e,t,n)}function x(e,t){let n=b(e,`wvEventDetail`,t);return n===!0||n===1||n===`1`||n===`true`}function S(e,t){if(!x(t,e))return e;if(e&&typeof e==`object`&&`detail`in e)return e.detail}function C(t,n){if(!n)return;let r=n.split(`.`).filter(Boolean),i=e(t)?t.value:t;for(let t of r){if(e(i)&&(i=i.value),i==null)return;i=i[t]}return e(i)?i.value:i}function w(e){return e}function T(e,t,n,r){var i,a,o,s;let l=(i=(a=n==null||(o=n.currentTarget)==null?void 0:o.dataset)==null?n==null||(s=n.target)==null?void 0:s.dataset:a)==null?{}:i,d=S(n,l),f=b(l,`wvInlineId`,n);if(f&&r){let t=r[f];if(t&&typeof t.fn==`function`){let n={},r=Array.isArray(t.keys)?t.keys:[];for(let e=0;e<r.length;e+=1){let t=r[e];n[t]=l==null?void 0:l[`wvS${e}`]}let i=Array.isArray(t.indexKeys)?t.indexKeys:[];for(let e=0;e<i.length;e+=1){let t=i[e],r=u(l==null?void 0:l[`wvI${e}`]);r!==void 0&&(n[t]=r)}let a=Array.isArray(t.scopeResolvers)?t.scopeResolvers:[];for(let t=0;t<r.length;t+=1){let i=r[t],o=a[t];try{let t;if(typeof o==`function`)t=o(e,n,d);else if(o&&typeof o==`object`&&o.type===`for-item`){let r=n[o.indexKey],i=C(e,o.path);t=i==null?void 0:i[r]}else continue;t!==void 0&&(n[i]=w(t))}catch(e){}}let o=t.fn(e,n,d);return typeof o==`function`?o.call(e,d):o}}let p=b(l,`wvHandler`,n),m=typeof t==`string`&&t?t:typeof p==`string`?p:void 0;if(!m)return;let h=b(l,`wvArgs`,n),g=[];if(Array.isArray(h))g=h;else if(typeof h==`string`)try{g=JSON.parse(h)}catch(e){try{g=JSON.parse(c(h))}catch(e){g=[]}}Array.isArray(g)||(g=[]);let _=g.map(e=>e===`$event`?d:e),v=e==null?void 0:e[m];if(typeof v==`function`)return v.apply(e,_)}export{c as decodeWxmlEntities,b as resolveDatasetEventValue,T as runInlineExpression};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNativeBridgeMethod as e}from"../../nativeBridge.mjs";import{setupInstanceMethodNames as t}from"./setupContext.mjs";import{WEVU_NATIVE_INSTANCE_KEY as n,WEVU_PUBLIC_RUNTIME_KEY as r}from"@weapp-core/constants";function i(e){return!e||typeof e!=`object`?!1:typeof e.triggerEvent==`function`||typeof e.createSelectorQuery==`function`||typeof e.createIntersectionObserver==`function`||typeof e.setData==`function`}function a(t,n,r){let i=n==null?void 0:n[r];if(typeof i!=`function`)return!1;if(e(i))return!0;let a=t==null?void 0:t.proxy;return typeof(a==null?void 0:a[r])==`function`&&i===a[r]}function o(e,t){if(!e||!i(t)||t===e.proxy)return;let r=t;if(a(e,r,`triggerEvent`)||a(e,r,`createSelectorQuery`)||a(e,r,`createIntersectionObserver`)||a(e,r,`setData`))return;let o=e.state;if(
|
|
1
|
+
import{isNativeBridgeMethod as e}from"../../nativeBridge.mjs";import{setupInstanceMethodNames as t}from"./setupContext.mjs";import{WEVU_NATIVE_INSTANCE_KEY as n,WEVU_PUBLIC_RUNTIME_KEY as r}from"@weapp-core/constants";function i(e){return!e||typeof e!=`object`?!1:typeof e.triggerEvent==`function`||typeof e.createSelectorQuery==`function`||typeof e.createIntersectionObserver==`function`||typeof e.setData==`function`}function a(t,n,r){let i=n==null?void 0:n[r];if(typeof i!=`function`)return!1;if(e(i))return!0;let a=t==null?void 0:t.proxy;return typeof(a==null?void 0:a[r])==`function`&&i===a[r]}function o(e,t){if(!e||!i(t)||t===e.proxy)return;let r=t;if(a(e,r,`triggerEvent`)||a(e,r,`createSelectorQuery`)||a(e,r,`createIntersectionObserver`)||a(e,r,`setData`))return;let o=e.state;if(o&&typeof o==`object`)try{Object.defineProperty(o,n,{value:r,configurable:!0,enumerable:!1,writable:!0})}catch(e){o[n]=r}}function s(e,n){try{let i=n.methods;for(let n of Object.keys(i))t.includes(n)||typeof e[n]!=`function`&&(e[n]=function(...t){var i,a;let s=(i=this[r])==null?e[r]:i;o(s,this);let c=s==null||(a=s.methods)==null?void 0:a[n];if(typeof c==`function`)return c.apply(s.proxy,t)})}catch(e){}}export{s as bridgeRuntimeMethodsToTarget};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isRef as e}from"../../reactivity/ref.mjs";import{callHookList as t}from"../hooks/base.mjs";import{isDeepEqualValue as n}from"../app/setData/snapshot.mjs";import{resolveRuntimePageLayoutName as r,syncRuntimePageLayoutState as i}from"../pageLayout.mjs";import{allocateOwnerId as a,attachOwnerSnapshot as o,mergeOwnerSnapshotProps as s,removeOwner as c,resolveOwnerSnapshot as l,updateOwnerSnapshot as ee}from"../scopedSlots.mjs";import{clearTemplateRefs as u,scheduleTemplateRefUpdate as d}from"../templateRefs.mjs";import{attachRuntimeSlots as te,createNoopWatchStopHandle as ne,safeMarkNoSetData as re}from"./runtimeInstance/setupContext.mjs";import{bridgeRuntimeMethodsToTarget as ie}from"./runtimeInstance/methodBridge.mjs";import{attachRuntimeProvideParentContext as ae}from"./runtimeInstance/provideContext.mjs";import{attachNativeInstanceRef as oe,attachRuntimeInstance as se,attachRuntimeRef as f,callNativeSetData as p,ensureRuntimeProps as ce,resolveNativeSetData as m}from"./runtimeInstance/utils.mjs";import{runRuntimeSetupPhase as le}from"./runtimeInstance/setupPhase.mjs";import{createSetDataHighFrequencyWarningMonitor as ue}from"./setDataFrequencyWarning.mjs";import{registerWatches as de}from"./watch.mjs";import{WEVU_EFFECT_SCOPE_KEY as h,WEVU_HOOKS_KEY as g,WEVU_PAGE_LAYOUT_NAME_KEY as _,WEVU_PAGE_LAYOUT_PROPS_KEY as v,WEVU_PAGE_LAYOUT_SETTER_KEY as y,WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as fe,WEVU_PROPS_DERIVED_KEYS_KEY as b,WEVU_PROPS_KEY as x,WEVU_PUBLIC_RUNTIME_KEY as S,WEVU_RUNTIME_OWNER_ID_KEY as C,WEVU_SLOT_OWNER_ID_KEY as w,WEVU_TEMPLATE_REFS_KEY as T,WEVU_WATCH_STOPS_KEY as E}from"@weapp-core/constants";function D(e,t=new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(D(r,t));return n}let n={};t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=D(i,t);return n}function pe(e,t,n){let r=e.data;if((!r||typeof r!=`object`)&&(!n||!Object.keys(n).length))return;let i=Array.isArray(t)&&t.length?new Set(t):void 0,a={};if(r&&typeof r==`object`)for(let[e,t]of Object.entries(r))i!=null&&i.has(e)||(a[e]=D(t));if(n)for(let[e,t]of Object.entries(n))i!=null&&i.has(e)||(a[e]=D(t));return a}function me(e){return!!(e!=null&&e.__wevuHasTemplateRuntimeBindings)}function he(e){typeof e.route
|
|
1
|
+
import{isRef as e}from"../../reactivity/ref.mjs";import{callHookList as t}from"../hooks/base.mjs";import{isDeepEqualValue as n}from"../app/setData/snapshot.mjs";import{resolveRuntimePageLayoutName as r,syncRuntimePageLayoutState as i}from"../pageLayout.mjs";import{allocateOwnerId as a,attachOwnerSnapshot as o,mergeOwnerSnapshotProps as s,removeOwner as c,resolveOwnerSnapshot as l,updateOwnerSnapshot as ee}from"../scopedSlots.mjs";import{clearTemplateRefs as u,scheduleTemplateRefUpdate as d}from"../templateRefs.mjs";import{attachRuntimeSlots as te,createNoopWatchStopHandle as ne,safeMarkNoSetData as re}from"./runtimeInstance/setupContext.mjs";import{bridgeRuntimeMethodsToTarget as ie}from"./runtimeInstance/methodBridge.mjs";import{attachRuntimeProvideParentContext as ae}from"./runtimeInstance/provideContext.mjs";import{attachNativeInstanceRef as oe,attachRuntimeInstance as se,attachRuntimeRef as f,callNativeSetData as p,ensureRuntimeProps as ce,resolveNativeSetData as m}from"./runtimeInstance/utils.mjs";import{runRuntimeSetupPhase as le}from"./runtimeInstance/setupPhase.mjs";import{createSetDataHighFrequencyWarningMonitor as ue}from"./setDataFrequencyWarning.mjs";import{registerWatches as de}from"./watch.mjs";import{WEVU_EFFECT_SCOPE_KEY as h,WEVU_HOOKS_KEY as g,WEVU_PAGE_LAYOUT_NAME_KEY as _,WEVU_PAGE_LAYOUT_PROPS_KEY as v,WEVU_PAGE_LAYOUT_SETTER_KEY as y,WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as fe,WEVU_PROPS_DERIVED_KEYS_KEY as b,WEVU_PROPS_KEY as x,WEVU_PUBLIC_RUNTIME_KEY as S,WEVU_RUNTIME_OWNER_ID_KEY as C,WEVU_SLOT_OWNER_ID_KEY as w,WEVU_TEMPLATE_REFS_KEY as T,WEVU_WATCH_STOPS_KEY as E}from"@weapp-core/constants";function D(e,t=new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(D(r,t));return n}let n={};t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=D(i,t);return n}function pe(e,t,n){let r=e.data;if((!r||typeof r!=`object`)&&(!n||!Object.keys(n).length))return;let i=Array.isArray(t)&&t.length?new Set(t):void 0,a={};if(r&&typeof r==`object`)for(let[e,t]of Object.entries(r))i!=null&&i.has(e)||(a[e]=D(t));if(n)for(let[e,t]of Object.entries(n))i!=null&&i.has(e)||(a[e]=D(t));return a}function me(e){return!!(e!=null&&e.__wevuHasTemplateRuntimeBindings)}function he(e){typeof e.route==`string`&&e.route&&(e[y]=(t,n)=>{var a;let o=(a=e.__wevu)==null?void 0:a.state;if(!o||typeof o!=`object`)return;o[_]=r(t);let s=t===!1||n==null?{}:n;o[v]=s,i(e,t,s)})}function O(e,t,n,r,i){var c,u,h,g,_,v,y,C,O,k,A,j;if(e.__wevu)return e.__wevu;ae(e,t),re(e);let M=(c=e.data)==null?void 0:c[w],N=typeof M==`string`&&M?M:a(),P=typeof M==`string`&&M!==N,F=!!(t!=null&&(u=t.__wevuSetDataOptions)!=null&&u.suspendWhenHidden),I=typeof e.route==`string`&&e.route?`page:${e.route}`:typeof e.is==`string`&&e.is?`component:${e.is}`:`unknown-target`,L=ue({option:t==null||(h=t.__wevuSetDataOptions)==null?void 0:h.highFrequencyWarning,targetLabel:I,isInPageScrollHook:()=>{var t;return Number((t=e[fe])==null?0:t)>0}}),R=i!=null&&i.deferSetData?(e=>{let t,n=[],r=!1,i={setData(i,a){if(!r){var o;t={...(o=t)==null?{}:o,...i},a&&n.push(a);return}let s=m(e);if(s)return p(e,s,i,a)}};return i.__wevu_enableSetData=(i=!1)=>{r=!0,i&&(t=void 0,n=[]);let a=m(e);if(t&&Object.keys(t).length&&a){let r=t,i=n;t=void 0,n=[];let o=i.length?()=>i.forEach(e=>e()):void 0;p(e,a,r,o)}},i})(e):{setData(t,n){let r=m(e);if(r)return p(e,r,t,n)}},z,B=!0,V,ge=(e,t)=>({...e==null?{}:e,...t}),H=()=>{var t;if(!z)return;let n=l(z),r=(t=e[x])==null?e.properties:t;s(n,r),ee(N,n,z.proxy,e)},_e=()=>{if(!P)return;let t=e.data;try{t&&typeof t==`object`&&(t[w]=N)}catch(e){}let n=m(e);n&&p(e,n,{[w]:N})},U={...R,setData(t){if(L==null||L(),F&&!B){V=ge(V,t),H(),d(e);return}let n=Array.isArray(e[T])&&e[T].length>0;if(H(),n&&m(e))return new Promise(n=>{R.setData(t,()=>{H(),d(e),n()})});let r=R.setData(t);return d(e),r},__wevu_setVisibility(t){if(B=t,!B||!V)return;let n=V;V=void 0;let r=Array.isArray(e[T])&&e[T].length>0;if(H(),r&&m(e))return new Promise(t=>{R.setData(n,()=>{H(),d(e),t()})});let i=R.setData(n);return d(e),i}};Object.defineProperty(U,"__wevu_targetLabel",{configurable:!0,enumerable:!1,value:I,writable:!1});let W=e.properties;W&&typeof W==`object`&&Object.defineProperty(U,"__wevu_initialProps",{configurable:!0,enumerable:!1,value:W,writable:!1}),Array.isArray(i==null?void 0:i.snapshotOmitKeys)&&i.snapshotOmitKeys.length&&Object.defineProperty(U,"__wevu_snapshotOmitKeys",{configurable:!0,enumerable:!1,value:i.snapshotOmitKeys,writable:!1});let G=pe(e,i==null?void 0:i.snapshotOmitKeys,me(t)?void 0:{[w]:N});G&&Object.keys(G).length&&Object.defineProperty(U,"__wevu_initialSnapshot",{configurable:!0,enumerable:!1,value:G,writable:!1}),Object.defineProperty(U,"__wevu_initialState",{configurable:!0,enumerable:!1,value:{[w]:N},writable:!1}),(i!=null&&i.deferSetData||r||W&&typeof W==`object`&&Object.keys(W).length>0)&&Object.defineProperty(U,"__wevu_deferInitialSnapshot",{configurable:!0,enumerable:!1,value:!0,writable:!1});let K=t.mount(U);z=K,se(K,e);let q=(g=K==null?void 0:K.proxy)==null?{}:g,J=(_=K==null?void 0:K.state)==null?{}:_,ve=(v=K==null?void 0:K.setupState)==null?Object.create(null):v;J&&typeof J==`object`&&(f(J,K),oe(J,e));let ye=(y=K==null?void 0:K.computed)==null?Object.create(null):y;if(!(K!=null&&K.methods))try{K.methods=Object.create(null)}catch(e){}let be=(C=K==null?void 0:K.methods)==null?Object.create(null):C,xe=(O=K==null?void 0:K.watch)==null?(()=>ne()):O,Se=(k=K==null?void 0:K.bindModel)==null?(()=>{}):k,Y={...K==null?{}:K,state:J,setupState:ve,proxy:q,methods:be,computed:ye,watch:xe,bindModel:Se,snapshot:(A=K==null?void 0:K.snapshot)==null?(()=>Object.create(null)):A,unmount:(j=K==null?void 0:K.unmount)==null?(()=>{}):j};Object.defineProperty(Y,"__wevu_initialRuntimeSnapshot",{configurable:!0,enumerable:!1,value:D(J),writable:!1});let X=Y,Ce={__wevu_flushSetupSnapshotSync:K.__wevu_flushSetupSnapshotSync,__wevu_touchSetupMethodsVersion:K.__wevu_touchSetupMethodsVersion,__wevu_trackSetupReactiveKey:K.__wevu_trackSetupReactiveKey,[b]:K[b]};for(let[e,t]of Object.entries(Ce))t&&Object.defineProperty(Y,e,{configurable:!0,enumerable:!1,value:t,writable:!0});Object.defineProperty(e,S,{value:Y,configurable:!0,enumerable:!1,writable:!1}),e.__wevu=Y,he(e);let we=ce(e,J);te(J,we),o(e,Y,N,{deferSnapshot:i==null?void 0:i.deferSetData}),_e();let Z=n?de(Y,n,e,{deferMissingSourceBaseline:!!r}):[];if(Z.length&&(e[E]=Z),r){if(le({target:e,runtime:K,runtimeWithDefaults:Y,runtimeState:J,runtimeProxy:q,setup:r}),!(i!=null&&i.deferSetData)){var Q;(Q=X.__wevu_flushSetupSnapshotSync)==null||Q.call(X)}i!=null&&i.deferSetData||H();for(let e of Z)e.resume()}else if(!(i!=null&&i.deferSetData)&&e.properties&&typeof e.properties==`object`&&Object.keys(e.properties).length>0){var $;($=X.__wevu_flushSetupSnapshotSync)==null||$.call(X),H()}return ie(e,K),K}function k(e,t,n){for(let e of Reflect.ownKeys(t))if(!Reflect.has(n,e)){let n=Reflect.getOwnPropertyDescriptor(t,e);n!=null&&n.configurable&&Reflect.deleteProperty(t,e)}for(let e of Reflect.ownKeys(n)){let r=Reflect.getOwnPropertyDescriptor(n,e);if(r)try{Reflect.defineProperty(t,e,r)}catch(r){try{t[e]=n[e]}catch(e){}}}return f(t.state,t),e.__wevu=t,Object.defineProperty(e,S,{value:t,configurable:!0,enumerable:!1,writable:!1}),t}function A(t,n,r){let i=t.state,a=t.setupState,o={};for(let t of Object.keys(n==null?{}:n)){if(!Object.prototype.hasOwnProperty.call(i,t))continue;let n=a==null?void 0:a[t];if(!(a&&Object.prototype.hasOwnProperty.call(a,t)&&!e(n))){if(r&&Object.prototype.hasOwnProperty.call(r,t)){o[t]=D(r[t]);continue}o[t]=D(e(n)?n.value:i[t])}}return o}function j(t,n){let r=t.setupState;return!r||!n||typeof n!=`object`?[]:Object.keys(n).filter(t=>{let n=r[t];return Object.prototype.hasOwnProperty.call(r,t)&&!e(n)})}function M(t,r){var i;let a=t.__wevu,o=a==null?void 0:a.state,s=a==null?void 0:a.setupState,c=(i=r==null?void 0:r.nativeData)==null?t.data:i;if(!o||typeof o!=`object`||!c||typeof c!=`object`)return;let l=a==null?void 0:a.__wevu_initialRuntimeSnapshot;for(let[t,i]of Object.entries(c))if(t&&t!==`undefined`&&Object.prototype.hasOwnProperty.call(o,t))try{let a=s==null?void 0:s[t],c=D(i);if(!(r!=null&&r.includeSetupState)&&s&&Object.prototype.hasOwnProperty.call(s,t)||!(r!=null&&r.includeSetupState)&&l&&Object.prototype.hasOwnProperty.call(l,t)&&!n(o[t],l[t],20,{keys:1e4})||!(r!=null&&r.includeSetupState)&&l&&!Object.prototype.hasOwnProperty.call(l,t))continue;if(e(a)){a.value=c;continue}o[t]=c}catch(e){}}function N(e,t){var n,r,i;let a=(n=e.__wevu)==null?void 0:n.adapter;M(e,{includeSetupState:t==null?void 0:t.rehydrateSetupState}),a&&typeof a.__wevu_enableSetData==`function`&&a.__wevu_enableSetData(!0),(r=e.__wevu)==null||(i=r.__wevu_flushSetupSnapshotSync)==null||i.call(r)}function P(e,t){var n;let r=(n=e.__wevu)==null?void 0:n.adapter;r&&typeof r.__wevu_setVisibility==`function`&&r.__wevu_setVisibility(t)}function F(e,n){var r,i;let a=e.__wevu,o=(r=e[C])==null?e[w]:r;o&&c(o),u(e),!(n!=null&&n.skipHooks)&&a&&e[g]&&t(e,`onUnload`,[]),e[g]&&(e[g]=void 0);let s=e[E];if(Array.isArray(s))for(let e of s)try{e()}catch(e){}e[E]=void 0,(i=e[h])==null||i.stop(),e[h]=void 0,a&&a.unmount(),delete e.__wevu,S in e&&delete e[S]}function I(e,t,n,r,i){let a=e.__wevu,o=a?A(a,e.data,i==null?void 0:i.stateSnapshot):void 0,s=a?j(a,e.data):[];F(e,{skipHooks:!0});let c=O(e,t,n,r,{deferSetData:!0,snapshotOmitKeys:i==null?void 0:i.snapshotOmitKeys});if(o){let t=e.data;if(t&&typeof t==`object`){for(let e of s)delete t[e];Object.assign(t,D(o))}M(e,{includeSetupState:!0,nativeData:o})}return!a||a===c?c:k(e,a,c)}export{N as enableDeferredSetData,O as mountRuntimeInstance,I as refreshRuntimeInstance,P as setRuntimeSetDataVisibility,F as teardownRuntimeInstance};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getScopedSlotHostGlobalObject as e}from"./platform.mjs";import{isDeepEqualValue as t}from"./app/setData/snapshot.mjs";import{WEVU_PROPS_KEY as n,WEVU_RUNTIME_OWNER_ID_KEY as r,WEVU_SCOPED_SLOT_OWNER_SEED_KEY as i,WEVU_SCOPED_SLOT_OWNER_STORE_KEY as a,WEVU_SLOT_OWNER_ID_KEY as o,WEVU_SLOT_OWNER_ID_PROP as s,WEVU_SLOT_OWNER_KEY as c,WEVU_SLOT_OWNER_PROXY_KEY as l,WEVU_SLOT_PROPS_DATA_KEY as u,WEVU_SLOT_PROPS_KEY as d,WEVU_SLOT_SCOPE_KEY as f}from"@weapp-core/constants";function p(){var t;let n=(t=e())==null?Object.create(null):t;return n[a]instanceof Map||(n[a]=new Map),typeof n[i]!=`number`&&(n[i]=0),{globalObject:n,ownerStore:n[a]}}function m(){let{globalObject:e}=p();return e[i]+=1,`wv${e[i]}`}function h(e,n,r,i){var a;let{ownerStore:o}=p(),s=(a=o.get(e))==null?{snapshot:{},proxy:r,subscribers:new Set}:a,c=!t(s.snapshot,n,20,{keys:1e4}),l=s.proxy!==r;if(s.snapshot=n,s.proxy=r,s.target=i==null?s.target:i,o.set(e,s),(c||l)&&s.subscribers.size)for(let e of s.subscribers)try{e(n,r)}catch(e){}}function g(e){let{ownerStore:t}=p();t.delete(e)}function _(e,t){var n;let{ownerStore:r}=p(),i=(n=r.get(e))==null?{snapshot:{},proxy:void 0,subscribers:new Set}:n;return i.subscribers.add(t),r.set(e,i),()=>{let n=r.get(e);n&&n.subscribers.delete(t)}}function v(e){var t;let{ownerStore:n}=p();return(t=n.get(e))==null?void 0:t.proxy}function y(e){var t;let{ownerStore:n}=p();return(t=n.get(e))==null?void 0:t.snapshot}function b(e){var t;let{ownerStore:n}=p();return(t=n.get(e))==null?void 0:t.target}function x(e){let t=e.__wevu_cloneLatestSnapshot;return typeof t==`function`?t():typeof e.snapshot==`function`?e.snapshot():{}}const S=new Set([o,s,c,l,u,d,f]);function C(e,t){if(
|
|
1
|
+
import{getScopedSlotHostGlobalObject as e}from"./platform.mjs";import{isDeepEqualValue as t}from"./app/setData/snapshot.mjs";import{WEVU_PROPS_KEY as n,WEVU_RUNTIME_OWNER_ID_KEY as r,WEVU_SCOPED_SLOT_OWNER_SEED_KEY as i,WEVU_SCOPED_SLOT_OWNER_STORE_KEY as a,WEVU_SLOT_OWNER_ID_KEY as o,WEVU_SLOT_OWNER_ID_PROP as s,WEVU_SLOT_OWNER_KEY as c,WEVU_SLOT_OWNER_PROXY_KEY as l,WEVU_SLOT_PROPS_DATA_KEY as u,WEVU_SLOT_PROPS_KEY as d,WEVU_SLOT_SCOPE_KEY as f}from"@weapp-core/constants";function p(){var t;let n=(t=e())==null?Object.create(null):t;return n[a]instanceof Map||(n[a]=new Map),typeof n[i]!=`number`&&(n[i]=0),{globalObject:n,ownerStore:n[a]}}function m(){let{globalObject:e}=p();return e[i]+=1,`wv${e[i]}`}function h(e,n,r,i){var a;let{ownerStore:o}=p(),s=(a=o.get(e))==null?{snapshot:{},proxy:r,subscribers:new Set}:a,c=!t(s.snapshot,n,20,{keys:1e4}),l=s.proxy!==r;if(s.snapshot=n,s.proxy=r,s.target=i==null?s.target:i,o.set(e,s),(c||l)&&s.subscribers.size)for(let e of s.subscribers)try{e(n,r)}catch(e){}}function g(e){let{ownerStore:t}=p();t.delete(e)}function _(e,t){var n;let{ownerStore:r}=p(),i=(n=r.get(e))==null?{snapshot:{},proxy:void 0,subscribers:new Set}:n;return i.subscribers.add(t),r.set(e,i),()=>{let n=r.get(e);n&&n.subscribers.delete(t)}}function v(e){var t;let{ownerStore:n}=p();return(t=n.get(e))==null?void 0:t.proxy}function y(e){var t;let{ownerStore:n}=p();return(t=n.get(e))==null?void 0:t.snapshot}function b(e){var t;let{ownerStore:n}=p();return(t=n.get(e))==null?void 0:t.target}function x(e){let t=e.__wevu_cloneLatestSnapshot;return typeof t==`function`?t():typeof e.snapshot==`function`?e.snapshot():{}}const S=new Set([o,s,c,l,u,d,f]);function C(e,t){if(t&&typeof t==`object`)for(let[n,r]of Object.entries(t))S.has(n)||(e[n]=r)}function w(e,t,i,a){var s;try{e[r]=i}catch(e){}try{t.state[o]=i}catch(e){}try{e[o]=i}catch(e){}try{let t=e.data;t&&typeof t==`object`&&(t[o]=i)}catch(e){}let c=a!=null&&a.deferSnapshot?{}:x(t);C(c,(s=e[n])==null?e.properties:s),h(i,c,t.proxy,e)}export{m as allocateOwnerId,w as attachOwnerSnapshot,v as getOwnerProxy,y as getOwnerSnapshot,b as getOwnerTarget,C as mergeOwnerSnapshotProps,g as removeOwner,x as resolveOwnerSnapshot,_ as subscribeOwner,h as updateOwnerSnapshot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toRaw as e}from"../reactivity/reactive/shared.mjs";import{touchReactive as t}from"../reactivity/reactive/patch.mjs";import{isReactive as n}from"../reactivity/reactive.mjs";import{isRef as r}from"../reactivity/ref.mjs";function i(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function a(e){return Array.isArray(e)||i(e)}function o(e){if(Array.isArray(e))return e;let t=[];for(let n of Object.keys(e)){let r=Object.getOwnPropertyDescriptor(e,n)
|
|
1
|
+
import{toRaw as e}from"../reactivity/reactive/shared.mjs";import{touchReactive as t}from"../reactivity/reactive/patch.mjs";import{isReactive as n}from"../reactivity/reactive.mjs";import{isRef as r}from"../reactivity/ref.mjs";function i(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function a(e){return Array.isArray(e)||i(e)}function o(e){if(Array.isArray(e))return e;let t=[];for(let n of Object.keys(e)){let r=Object.getOwnPropertyDescriptor(e,n);r&&typeof r.get!=`function`&&t.push(r.value)}return t}function s(e,t=new WeakSet){return r(e)||n(e)?!0:!e||typeof e!=`object`||t.has(e)||(t.add(e),!a(e))?!1:o(e).some(e=>s(e,t))}function c(i,s=new WeakSet){if(r(i)){let e=i.value;n(e)&&t(e),c(e,s);return}if(n(i)){t(i),c(e(i),s);return}i&&typeof i==`object`&&!s.has(i)&&a(i)&&(s.add(i),o(i).forEach(e=>c(e,s)))}export{s as hasTrackableSetupBinding,c as touchSetupBinding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{nextTick as e}from"../scheduler.mjs";import{markNoSetData as t}from"./noSetData.mjs";import{buildTemplateRefValue as n,createSelectorQuery as r,ensureRefsContainer as i,getTemplateRefMap as a,isComponentRef as o,resolveComponentRefValue as s,resolveTemplateRefTarget as c,updateTemplateRefMapValue as l}from"./templateRefs/helpers.mjs";import{WEVU_READY_CALLED_KEY as u,WEVU_TEMPLATE_REFS_CALLBACKS_KEY as d,WEVU_TEMPLATE_REFS_KEY as f,WEVU_TEMPLATE_REFS_PENDING_KEY as p}from"@weapp-core/constants";function m(e,d,p=e){let m=e[f];if(!m||!m.length){d==null||d();return}if(!e[u]){d==null||d();return}if(!e.__wevu){d==null||d();return}let h=a(p),g=m.filter(e=>!o(e)),_=m.filter(e=>o(e)).map(t=>({binding:t,value:s(e,t)})),v=n=>{var r,a;let o=i(p),s=new Map,u=new Set,f=(r=(a=e.__wevu)==null?void 0:a.proxy)==null?e:r;n.forEach(t=>{let n=t.binding,r=t.value,i=c(p,n,e);if(i.type===`function`){n.inFor&&Array.isArray(r)?r.length?r.forEach(e=>i.fn.call(f,e)):i.fn.call(f,null):i.fn.call(f,r==null?null:r);return}if(i.type===`ref`){i.ref.value=r;return}if(i.type===`name`){var a;u.add(i.name);let e=(a=s.get(i.name))==null?{values:[],count:0,hasFor:!1}:a;e.count+=1,e.hasFor=e.hasFor||n.inFor,n.inFor?Array.isArray(r)&&e.values.push(...r):r!=null&&e.values.push(r),s.set(i.name,e)}});for(let[e,n]of s){let r;r=n.values.length?n.hasFor||n.values.length>1||n.count>1?t(n.values):n.values[0]:n.hasFor?t([]):null,o[e]=r,l(h,e,r)}for(let e of Object.keys(o))u.has(e)||delete o[e];d==null||d()};if(!g.length){v(_);return}let y=r(e);if(!y){v(_);return}let b=[];for(let e of g)(e.inFor?y.selectAll(e.selector):y.select(e.selector)).boundingClientRect(),b.push({binding:e});y.exec(t=>{let r=b.map((r,i)=>{let a=Array.isArray(t)?t[i]:null;return{binding:r.binding,value:n(e,r.binding,a)}});v([..._,...r])})}function h(t,n,r=t){let i=t[f];if(!i||!i.length){n==null||n();return}if(n){var a;let e=(a=t[d])==null?[]:a;e.push(n),t[d]||Object.defineProperty(t,d,{value:e,configurable:!0,enumerable:!1,writable:!0})}t[p]||(t[p]=!0,e(()=>{t[p]=!1,m(t,()=>{let e=t[d]
|
|
1
|
+
import{nextTick as e}from"../scheduler.mjs";import{markNoSetData as t}from"./noSetData.mjs";import{buildTemplateRefValue as n,createSelectorQuery as r,ensureRefsContainer as i,getTemplateRefMap as a,isComponentRef as o,resolveComponentRefValue as s,resolveTemplateRefTarget as c,updateTemplateRefMapValue as l}from"./templateRefs/helpers.mjs";import{WEVU_READY_CALLED_KEY as u,WEVU_TEMPLATE_REFS_CALLBACKS_KEY as d,WEVU_TEMPLATE_REFS_KEY as f,WEVU_TEMPLATE_REFS_PENDING_KEY as p}from"@weapp-core/constants";function m(e,d,p=e){let m=e[f];if(!m||!m.length){d==null||d();return}if(!e[u]){d==null||d();return}if(!e.__wevu){d==null||d();return}let h=a(p),g=m.filter(e=>!o(e)),_=m.filter(e=>o(e)).map(t=>({binding:t,value:s(e,t)})),v=n=>{var r,a;let o=i(p),s=new Map,u=new Set,f=(r=(a=e.__wevu)==null?void 0:a.proxy)==null?e:r;n.forEach(t=>{let n=t.binding,r=t.value,i=c(p,n,e);if(i.type===`function`){n.inFor&&Array.isArray(r)?r.length?r.forEach(e=>i.fn.call(f,e)):i.fn.call(f,null):i.fn.call(f,r==null?null:r);return}if(i.type===`ref`){i.ref.value=r;return}if(i.type===`name`){var a;u.add(i.name);let e=(a=s.get(i.name))==null?{values:[],count:0,hasFor:!1}:a;e.count+=1,e.hasFor=e.hasFor||n.inFor,n.inFor?Array.isArray(r)&&e.values.push(...r):r!=null&&e.values.push(r),s.set(i.name,e)}});for(let[e,n]of s){let r;r=n.values.length?n.hasFor||n.values.length>1||n.count>1?t(n.values):n.values[0]:n.hasFor?t([]):null,o[e]=r,l(h,e,r)}for(let e of Object.keys(o))u.has(e)||delete o[e];d==null||d()};if(!g.length){v(_);return}let y=r(e);if(!y){v(_);return}let b=[];for(let e of g)(e.inFor?y.selectAll(e.selector):y.select(e.selector)).boundingClientRect(),b.push({binding:e});y.exec(t=>{let r=b.map((r,i)=>{let a=Array.isArray(t)?t[i]:null;return{binding:r.binding,value:n(e,r.binding,a)}});v([..._,...r])})}function h(t,n,r=t){let i=t[f];if(!i||!i.length){n==null||n();return}if(n){var a;let e=(a=t[d])==null?[]:a;e.push(n),t[d]||Object.defineProperty(t,d,{value:e,configurable:!0,enumerable:!1,writable:!0})}t[p]||(t[p]=!0,e(()=>{t[p]=!1,m(t,()=>{let e=t[d];e&&e.length&&e.splice(0).forEach(e=>{try{e()}catch(e){}})},r)}))}function g(e,n=e){var r,o;let s=e[f];if(!s||!s.length)return;let u=i(n),d=(r=(o=e.__wevu)==null?void 0:o.proxy)==null?e:r,p=new Set,m=a(n);for(let r of s){let i=c(n,r,e),a=r.inFor?t([]):null;if(i.type===`function`){i.fn.call(d,null);continue}if(i.type===`ref`){i.ref.value=a;continue}i.type===`name`&&(p.add(i.name),u[i.name]=a,l(m,i.name,a))}for(let e of Object.keys(u))p.has(e)||delete u[e]}export{g as clearTemplateRefs,h as scheduleTemplateRefUpdate,m as updateTemplateRefs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentMiniProgramGlobalRouter as e}from"../platform.mjs";import{getCurrentSetupContext as t}from"../hooks/base.mjs";import{notifyRouteStateSync as n}from"../../router/routeSync.mjs";import{createAbsoluteRoutePath as r,resolvePath as i}from"../../routerInternal/path.mjs";import{stringifyQuery as a}from"../../routerInternal/query.mjs";import{parsePathInput as o}from"../../routerInternal/location.mjs";const s=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],c=new WeakMap;function l(e){return!e||typeof e!=`object`?!1:s.every(t=>typeof e[t]==`function`)}function u(){return e()}function d(e){if(
|
|
1
|
+
import{getCurrentMiniProgramGlobalRouter as e}from"../platform.mjs";import{getCurrentSetupContext as t}from"../hooks/base.mjs";import{notifyRouteStateSync as n}from"../../router/routeSync.mjs";import{createAbsoluteRoutePath as r,resolvePath as i}from"../../routerInternal/path.mjs";import{stringifyQuery as a}from"../../routerInternal/query.mjs";import{parsePathInput as o}from"../../routerInternal/location.mjs";const s=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],c=new WeakMap;function l(e){return!e||typeof e!=`object`?!1:s.every(t=>typeof e[t]==`function`)}function u(){return e()}function d(e){if(typeof e==`string`&&e)return i(e,``)||void 0}function f(e,t){let n=t===`pageRouter`?[e.route,e.__route__,e.is]:[e.is,e.route,e.__route__];for(let e of n){let t=d(e);if(t)return t}}function p(e,t){if(!t||!e.startsWith(`./`)&&!e.startsWith(`../`))return e;let{path:n,query:s,hash:c}=o(e),l=r(i(n,t)),u=a(s);return`${l}${u?`?${u}`:``}${c}`}function m(e,t){let r=t==null?``:t,i=c.get(e),a=i==null?void 0:i.get(r);if(a)return a;let o=Object.create(null);for(let r of s)o[r]=i=>{let a=e[r];if(r===`navigateBack`||!i||typeof i!=`object`)return a.call(e,i);let o=typeof i.url==`string`?p(i.url,t):i.url,s=i.success,c={...i,url:o,success:(...e)=>(typeof o==`string`&&n({method:r,source:`native`,url:o}),typeof s==`function`?s(...e):void 0)};return a.call(e,c)};let l=i==null?new Map:i;return l.set(r,o),c.set(e,l),o}function h(e,n,r){let i=t();if(!(i!=null&&i.instance))throw Error(`${r}() 必须在 setup() 的同步阶段调用`);let a=i.instance,o=f(a,e),s=a[e];if(l(s))return m(s,o);let c=a[n];if(l(c))return m(c,o);let d=u();if(d)return m(d,o);throw Error(`当前运行环境不支持 Router,请升级宿主基础库或检查平台路由能力`)}function g(){return h(`router`,`pageRouter`,`useNativeRouter`)}function _(){return h(`pageRouter`,`router`,`useNativePageRouter`)}export{_ as useNativePageRouter,g as useNativeRouter};
|