wevu 7.1.2 → 7.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/defineProperty.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/toPrimitive.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/toPropertyKey.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/typeof.mjs +1 -1
- package/dist/dev/macros/shared.d.mts +2 -0
- 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/runtime/define/setupResult.mjs +31 -3
- package/dist/dev/runtime/define/setupResult.mjs.map +1 -1
- package/dist/dev/runtime/define.mjs +4 -5
- package/dist/dev/runtime/define.mjs.map +1 -1
- package/dist/dev/runtime/hooks/base.mjs +11 -8
- package/dist/dev/runtime/hooks/base.mjs.map +1 -1
- package/dist/dev/runtime/platform.mjs +1 -1
- package/dist/dev/runtime/platform.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerDefinition.mjs +7 -0
- package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +16 -7
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
- package/dist/dev/runtime/types/options.d.mts +6 -4
- package/dist/dev/store/define.d.mts +1 -10
- package/dist/dev/store/define.mjs.map +1 -1
- package/dist/dev/store/types.d.mts +12 -2
- package/dist/macros/shared.d.mts +2 -0
- package/dist/package.mjs +1 -1
- package/dist/reactivity/core.mjs +1 -1
- package/dist/reactivity/reactive/mutation.mjs +1 -1
- package/dist/reactivity/reactive/patch.mjs +1 -1
- package/dist/reactivity/reactive/patchState.mjs +1 -1
- package/dist/reactivity/reactive/state.mjs +1 -1
- package/dist/reactivity/reactive.mjs +1 -1
- package/dist/reactivity/ref.mjs +1 -1
- package/dist/reactivity/traverse.mjs +1 -1
- package/dist/router/createRouter.mjs +1 -1
- package/dist/router/initialNavigation.mjs +1 -1
- package/dist/router/routeSync.mjs +1 -1
- package/dist/routerInternal/matching.mjs +1 -1
- package/dist/routerInternal/params.mjs +1 -1
- package/dist/routerInternal/records.mjs +1 -1
- package/dist/routerInternal/recordsWarnings.mjs +1 -1
- package/dist/runtime/app/computed.mjs +1 -1
- package/dist/runtime/app/context.mjs +1 -1
- package/dist/runtime/app/mount.mjs +1 -1
- package/dist/runtime/app/setData/commitTracker.mjs +1 -1
- package/dist/runtime/app/setData/patchScheduler.mjs +1 -1
- package/dist/runtime/app/setData/payload.mjs +1 -1
- package/dist/runtime/app/setData/scheduler.mjs +1 -1
- package/dist/runtime/app/setData/snapshot.mjs +1 -1
- package/dist/runtime/app.mjs +1 -1
- package/dist/runtime/bindingManifest.mjs +1 -1
- package/dist/runtime/define/initialComputed.mjs +1 -1
- package/dist/runtime/define/options.mjs +1 -1
- package/dist/runtime/define/props.mjs +1 -1
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
- package/dist/runtime/define/setupResult.mjs +1 -1
- package/dist/runtime/define.mjs +1 -1
- package/dist/runtime/diff.mjs +1 -1
- package/dist/runtime/disposables.mjs +1 -1
- package/dist/runtime/features/patchStrategy.mjs +1 -1
- package/dist/runtime/hooks/base.mjs +1 -1
- package/dist/runtime/layoutBridge.mjs +1 -1
- package/dist/runtime/platform.mjs +1 -1
- package/dist/runtime/provideStore.mjs +1 -1
- package/dist/runtime/register/component/options.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/runtimeInstance/setupPhase.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/helpers.mjs +1 -1
- package/dist/runtime/templateRefs.mjs +1 -1
- package/dist/runtime/types/options.d.mts +6 -4
- package/dist/runtime/uniAppHost.mjs +1 -1
- package/dist/runtime/vueCompat/model.mjs +1 -1
- package/dist/runtime/vueCompat/router.mjs +1 -1
- package/dist/runtime/vueCompat/templateRef.mjs +1 -1
- package/dist/scheduler.mjs +1 -1
- package/dist/store/base.mjs +1 -1
- package/dist/store/define/setupStyle.mjs +1 -1
- package/dist/store/define.d.mts +1 -10
- package/dist/store/manager.mjs +1 -1
- package/dist/store/types.d.mts +12 -2
- package/package.json +8 -8
- /package/dist/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/defineProperty.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/toPrimitive.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/toPropertyKey.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/typeof.mjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{nextTick as e}from"../../scheduler.mjs";import{toRaw as t}from"../../reactivity/reactive/shared.mjs";import{isRef as n,ref as r}from"../../reactivity/ref.mjs";import{hasOwn as i}from"../../utils.mjs";import{setComputedValue as a}from"../internal.mjs";import{normalizeEmitEventName as o,normalizeEmitPayload as s}from"../emit.mjs";import{isNativeBridgeMethod as c,markNativeBridgeMethod as l}from"../nativeBridge.mjs";import{createComputedAccessors as u}from"./computed.mjs";import{WEVU_COMPONENT_NAME_KEY as d,WEVU_HOST_COMMIT_PROMISE_KEY as f,WEVU_INLINE_MAP_KEY as p,WEVU_NATIVE_INSTANCE_KEY as m,WEVU_PARENT_INSTANCE_KEY as h,WEVU_PROPS_KEY as g,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as _,WEVU_RUNTIME_APP_KEY as v,WEVU_RUNTIME_KEY as y}from"@weapp-core/constants";function b(b){let{state:x,setupState:S,computedDefs:C,methodDefs:w,appConfig:T,includeComputed:E,setDataStrategy:D}=b,O={},{computedRefs:k,computedSetters:A,dirtyComputedKeys:j,createTrackedComputed:M,computedProxy:N}=u({includeComputed:E,setDataStrategy:D}),P=r(0),F=Object.create(null),I=(e,n)=>{let r=t(e),i=r[y],a=i==null?void 0:i.proxy,o=(e,t)=>{let n=e[t];return c(n)},s=t=>!(!t||typeof t!=`object`||t===e||t===n||t===a||o(t,`triggerEvent`)||o(t,`createSelectorQuery`)||o(t,`createIntersectionObserver`)||o(t,`setData`)),l=r[m];if(s(l))return l;let u=i==null?void 0:i.instance;if(s(u))return u},L=e=>{if(i(O,e))return;let t=(...t)=>{let n=I(x,x);if(!n)return;let r=Reflect.get(n,e);if(typeof r==`function`)return r.apply(n,t)};l(t),O[e]=t},R=(e,t)=>{let n
|
|
1
|
+
import{nextTick as e}from"../../scheduler.mjs";import{toRaw as t}from"../../reactivity/reactive/shared.mjs";import{isRef as n,ref as r}from"../../reactivity/ref.mjs";import{hasOwn as i}from"../../utils.mjs";import{setComputedValue as a}from"../internal.mjs";import{normalizeEmitEventName as o,normalizeEmitPayload as s}from"../emit.mjs";import{isNativeBridgeMethod as c,markNativeBridgeMethod as l}from"../nativeBridge.mjs";import{createComputedAccessors as u}from"./computed.mjs";import{WEVU_COMPONENT_NAME_KEY as d,WEVU_HOST_COMMIT_PROMISE_KEY as f,WEVU_INLINE_MAP_KEY as p,WEVU_NATIVE_INSTANCE_KEY as m,WEVU_PARENT_INSTANCE_KEY as h,WEVU_PROPS_KEY as g,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as _,WEVU_RUNTIME_APP_KEY as v,WEVU_RUNTIME_KEY as y}from"@weapp-core/constants";function b(b){let{state:x,setupState:S,computedDefs:C,methodDefs:w,appConfig:T,includeComputed:E,setDataStrategy:D}=b,O={},{computedRefs:k,computedSetters:A,dirtyComputedKeys:j,createTrackedComputed:M,computedProxy:N}=u({includeComputed:E,setDataStrategy:D}),P=r(0),F=Object.create(null),I=(e,n)=>{let r=t(e),i=r[y],a=i==null?void 0:i.proxy,o=(e,t)=>{let n=e[t];return c(n)},s=t=>!(!t||typeof t!=`object`||t===e||t===n||t===a||o(t,`triggerEvent`)||o(t,`createSelectorQuery`)||o(t,`createIntersectionObserver`)||o(t,`setData`)),l=r[m];if(s(l))return l;let u=i==null?void 0:i.instance;if(s(u))return u},L=e=>{if(i(O,e))return;let t=(...t)=>{let n=I(x,x);if(!n)return;let r=Reflect.get(n,e);if(typeof r==`function`)return r.apply(n,t)};l(t),O[e]=t},R=(e,t)=>{let n=/* @__PURE__ */ new Set,r=e;for(;r&&!n.has(r);){var a;n.add(r);let e=(a=r[v])==null||(a=a.config)==null?void 0:a.globalProperties;if(e&&i(e,t))return{found:!0,value:e[t]};r=r[h]}let o=typeof globalThis<`u`?globalThis.getApp:void 0;if(typeof o==`function`)try{var s;let e=o(),n=e==null||(s=e[v])==null||(s=s.config)==null?void 0:s.globalProperties;if(n&&i(n,t))return{found:!0,value:n[t]}}catch(e){}return{found:!1,value:void 0}},z=e=>{let t=e&&Reflect.get(e,`selectOwnerComponent`);if(typeof t==`function`)try{var n,r,i,a;let o=t.call(e);if(!o||typeof o!=`object`)return;let s=Reflect.get(o,_);if(typeof s==`function`){let e=s.call(o);if(e)return e}return(n=(r=(i=o[y])==null?void 0:i.proxy)==null?(a=o.__wevu)==null?void 0:a.proxy:r)==null?o:n}catch(e){return}},B=new Proxy(x,{get(n,r,a){if(typeof r==`string`){if(P.value,i(S,r))return Reflect.get(S,r,a);if(r===`props`){let e=n[g];if(e&&typeof e==`object`)return e}if(r===`$props`){let e=n[g];if(e&&typeof e==`object`)return e}let m=n[g];if(m&&typeof m==`object`&&i(m,r))return Reflect.get(m,r);if(r===`data`||r===`$state`)return x;if(r===`$computed`)return N;if(r===`$emit`)return(e,...t)=>{let r=I(n,a),i=r&&Reflect.get(r,`triggerEvent`);if(typeof i!=`function`)return;let{detail:c,options:l}=s(t);return i.call(r,o(e),c,l)};if(r===`$nextTick`)return async t=>{await e();let r=I(n,a),i=r&&Reflect.get(r,f);if(i&&(typeof i==`object`||typeof i==`function`)&&`then`in i&&typeof i.then==`function`&&await i,t)return t.call(B)};if(r===`$set`)return(e,t,n)=>(Reflect.set(e,t,n),n);if(r===`$delete`)return(e,t)=>Reflect.deleteProperty(e,t);if(r===`$slots`){var c;return(c=t(n).$slots)==null?Object.freeze(Object.create(null)):c}if(r===`$refs`){var l;return(l=t(n).$refs)==null?Object.create(null):l}if(r===`$parent`)return z(I(n,a));if(r===`$options`){var u,p;let e=I(n,a);return{name:(u=(p=e==null?void 0:e[d])==null?e==null?void 0:e.name:p)==null?e==null?void 0:e.is:u}}if(i(F,r))return Reflect.get(F,r);if(i(O,r))return O[r];if(k[r])return k[r].value;if(i(T.globalProperties,r))return T.globalProperties[r];let h=R(I(n,a),r);if(h.found)return h.value}if(!Reflect.has(n,r)){let e=I(n,a);if(e&&Reflect.has(e,r)){let t=Reflect.get(e,r);return typeof t==`function`?t.bind(e):t}}let m=Reflect.get(n,r,a);return typeof r==`string`&&i(S,r)?Reflect.get(S,r,a):m},set(e,t,r,o){if(typeof t==`string`&&k[t])return a(A,t,r),!0;if(i(S,t)){let e=Reflect.get(S,t,o);return n(e)&&!n(r)?(e.value=r,!0):Reflect.set(S,t,r,o)}if(i(F,t))return Reflect.set(F,t,r);if(Reflect.has(e,t)){var s;let a=Reflect.get(e,t,o);return n(a)&&!n(r)?(a.value=r,!0):i((s=e[g])==null?{}:s,t)?Reflect.set(S,t,r,o):Reflect.set(e,t,r,o)}return Reflect.set(F,t,r)},has(e,t){if(t===`data`||t===`$emit`||t===`$nextTick`||t===`$set`||t===`$delete`||t===`$slots`||t===`$refs`||t===`$parent`||t===`$options`||typeof t==`string`&&(i(S,t)||k[t]||i(O,t))||i(F,t))return!0;let n=I(e,e);return typeof t==`string`&&R(n,t).found||n&&Reflect.has(n,t)?!0:Reflect.has(e,t)},ownKeys(e){let t=/* @__PURE__ */ new Set;return Reflect.ownKeys(e).forEach(e=>{t.add(e)}),Reflect.ownKeys(S).forEach(e=>{t.add(e)}),Reflect.ownKeys(F).forEach(e=>t.add(e)),Object.keys(O).forEach(e=>t.add(e)),Object.keys(k).forEach(e=>t.add(e)),[...t]},getOwnPropertyDescriptor(e,t){if(typeof t==`string`&&i(S,t))return Object.getOwnPropertyDescriptor(S,t);if(i(F,t))return Object.getOwnPropertyDescriptor(F,t);if(Reflect.has(e,t))return Object.getOwnPropertyDescriptor(e,t);if(typeof t==`string`){if(t===`data`)return{configurable:!0,enumerable:!1,get(){return x}};if(k[t])return{configurable:!0,enumerable:!0,get(){return k[t].value},set(e){a(A,t,e)}};if(i(O,t))return{configurable:!0,enumerable:!1,value:O[t]}}}});return Object.keys(w).forEach(e=>{let t=w[e];if(typeof t==`function`){O[e]=(...e)=>t.apply(B,e);return}e===p&&t&&typeof t==`object`&&(O[e]=t)}),L(`triggerEvent`),L(`createSelectorQuery`),L(`createIntersectionObserver`),L(`setData`),Object.keys(C).forEach(e=>{let t=C[e];if(typeof t==`function`)k[e]=M(e,()=>t.call(B));else{var n,r;let i=(n=t.get)==null?void 0:n.bind(B);if(!i)throw Error(`计算属性 "${e}" 需要提供 getter`);let a=(r=t.set)==null?void 0:r.bind(B);a?(A[e]=a,k[e]=M(e,i,a)):k[e]=M(e,i)}}),{boundMethods:O,computedRefs:k,computedSetters:A,dirtyComputedKeys:j,computedProxy:N,publicInstance:B,touchSetupMethodsVersion(){P.value+=1}}}export{b as createRuntimeContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{queueJob as e}from"../../scheduler.mjs";import{effect as t,stop as n}from"../../reactivity/core.mjs";import{touchReactive as r}from"../../reactivity/reactive/patch.mjs";import{shallowReactive as i}from"../../reactivity/reactive/shallow.mjs";import{isReactive as a,reactive as o}from"../../reactivity/reactive.mjs";import{watch as ee}from"../../reactivity/watch.mjs";import{requireRuntimeCapability as s}from"../capabilities.mjs";import{hasOwn as c}from"../../utils.mjs";import{createBindModel as te}from"../bindModel.mjs";import{hasTrackableSetupBinding as ne,touchSetupBinding as re}from"../setupTracking.mjs";import{createRuntimeContext as ie}from"./context.mjs";import{createDiagnosticsLogger as l}from"./diagnostics.mjs";import{createSetDataScheduler as u}from"./setData/scheduler.mjs";import{resolveSetDataOptions as ae}from"./setDataOptions.mjs";import{WEVU_ATTRS_KEY as oe,WEVU_PROPS_DERIVED_KEYS_KEY as d,WEVU_PROPS_KEY as f,WEVU_SETUP_STATE_KEY as p}from"@weapp-core/constants";function m(e,t){let n=(()=>{e()});return n.stop=()=>n(),n.pause=()=>{var e;t==null||(e=t.pause)==null||e.call(t)},n.resume=()=>{var e;t==null||(e=t.resume)==null||e.call(t)},n}function se(e){return typeof e==`function`?e():e==null?{}:e}function h(h){let{data:ce,resolvedComputed:le,resolvedMethods:ue,appConfig:de,setDataOptions:g,bindingManifest:_}=h;return h=>{var v;(g==null?void 0:g.strategy)===`patch`&&s(`patchStrategy`,`createRuntimeMount(setData.strategy="patch")`);let y=se(ce),b=h==null?void 0:h.__wevu_initialProps;if(y&&typeof y==`object`&&!c(y,f))try{Object.defineProperty(y,f,{value:i(Object.create(null)),configurable:!0,enumerable:!1,writable:!1})}catch(e){}let x=y&&typeof y==`object`?y[f]:void 0;x&&typeof x==`object`&&b&&typeof b==`object`&&Object.assign(x,b);let S=o(y),C=o(Object.create(null)),w=h==null?void 0:h.__wevu_snapshotOmitKeys,fe=!!(h!=null&&h.__wevu_deferInitialSnapshot),T=h==null?void 0:h.__wevu_initialSnapshot,E=h==null?void 0:h.__wevu_initialState,D=new Set(w instanceof Set||Array.isArray(w)?w:[]);if(y&&typeof y==`object`&&!c(y,p))try{Object.defineProperty(y,p,{value:C,configurable:!0,enumerable:!1,writable:!1})}catch(e){}if(y&&typeof y==`object`&&E&&typeof E==`object`)for(let[e,t]of Object.entries(E))D.has(e)||(y[e]=t);let pe=le,me=ue,O=!0,k=[],A
|
|
1
|
+
import{queueJob as e}from"../../scheduler.mjs";import{effect as t,stop as n}from"../../reactivity/core.mjs";import{touchReactive as r}from"../../reactivity/reactive/patch.mjs";import{shallowReactive as i}from"../../reactivity/reactive/shallow.mjs";import{isReactive as a,reactive as o}from"../../reactivity/reactive.mjs";import{watch as ee}from"../../reactivity/watch.mjs";import{requireRuntimeCapability as s}from"../capabilities.mjs";import{hasOwn as c}from"../../utils.mjs";import{createBindModel as te}from"../bindModel.mjs";import{hasTrackableSetupBinding as ne,touchSetupBinding as re}from"../setupTracking.mjs";import{createRuntimeContext as ie}from"./context.mjs";import{createDiagnosticsLogger as l}from"./diagnostics.mjs";import{createSetDataScheduler as u}from"./setData/scheduler.mjs";import{resolveSetDataOptions as ae}from"./setDataOptions.mjs";import{WEVU_ATTRS_KEY as oe,WEVU_PROPS_DERIVED_KEYS_KEY as d,WEVU_PROPS_KEY as f,WEVU_SETUP_STATE_KEY as p}from"@weapp-core/constants";function m(e,t){let n=(()=>{e()});return n.stop=()=>n(),n.pause=()=>{var e;t==null||(e=t.pause)==null||e.call(t)},n.resume=()=>{var e;t==null||(e=t.resume)==null||e.call(t)},n}function se(e){return typeof e==`function`?e():e==null?{}:e}function h(h){let{data:ce,resolvedComputed:le,resolvedMethods:ue,appConfig:de,setDataOptions:g,bindingManifest:_}=h;return h=>{var v;(g==null?void 0:g.strategy)===`patch`&&s(`patchStrategy`,`createRuntimeMount(setData.strategy="patch")`);let y=se(ce),b=h==null?void 0:h.__wevu_initialProps;if(y&&typeof y==`object`&&!c(y,f))try{Object.defineProperty(y,f,{value:i(Object.create(null)),configurable:!0,enumerable:!1,writable:!1})}catch(e){}let x=y&&typeof y==`object`?y[f]:void 0;x&&typeof x==`object`&&b&&typeof b==`object`&&Object.assign(x,b);let S=o(y),C=o(Object.create(null)),w=h==null?void 0:h.__wevu_snapshotOmitKeys,fe=!!(h!=null&&h.__wevu_deferInitialSnapshot),T=h==null?void 0:h.__wevu_initialSnapshot,E=h==null?void 0:h.__wevu_initialState,D=new Set(w instanceof Set||Array.isArray(w)?w:[]);if(y&&typeof y==`object`&&!c(y,p))try{Object.defineProperty(y,p,{value:C,configurable:!0,enumerable:!1,writable:!1})}catch(e){}if(y&&typeof y==`object`&&E&&typeof E==`object`)for(let[e,t]of Object.entries(E))D.has(e)||(y[e]=t);let pe=le,me=ue,O=!0,k=[],A=/* @__PURE__ */ new Set;Object.keys(S).forEach(e=>{let t=S[e];ne(t)&&A.add(e)});let{includeComputed:j,setDataStrategy:M,maxPatchKeys:N,maxPayloadBytes:P,mergeSiblingThreshold:F,mergeSiblingMaxInflationRatio:I,mergeSiblingMaxParentBytes:L,mergeSiblingSkipArray:R,computedCompare:z,computedCompareMaxDepth:he,computedCompareMaxKeys:ge,prelinkMaxDepth:_e,prelinkMaxKeys:ve,debug:B,diagnostics:V,loopWarning:H,debugWhen:ye,debugSampleRate:be,elevateTopKeyThreshold:xe,toPlainMaxDepth:Se,toPlainMaxKeys:Ce,includeFunctions:we,functionPaths:Te,shouldIncludeKey:Ee}=ae(g),U=l(V),W=V===`off`&&H?l(`fallback`):void 0,De=B||U||W?e=>{if(typeof B==`function`)try{B(e)}catch(e){}U==null||U(e),e.reason===`loopWarning`&&(W==null||W(e))}:void 0,Oe=V===`always`?`always`:ye,{boundMethods:ke,computedRefs:G,computedSetters:Ae,dirtyComputedKeys:je,computedProxy:Me,publicInstance:K,touchSetupMethodsVersion:q}=ie({state:S,setupState:C,computedDefs:pe,methodDefs:me,appConfig:de,includeComputed:j,setDataStrategy:M}),J=h==null?{setData:()=>{}}:h,Ne=J.__wevu_targetLabel,Y,X={state:S,setupState:C,snapshotOmitKeys:D,computedRefs:G,dirtyComputedKeys:je,includeComputed:j,setDataStrategy:M,computedCompare:z,computedCompareMaxDepth:he,computedCompareMaxKeys:ge,currentAdapter:J,shouldIncludeKey:Ee,maxPatchKeys:N,maxPayloadBytes:P,mergeSiblingThreshold:F,mergeSiblingMaxInflationRatio:I,mergeSiblingMaxParentBytes:L,mergeSiblingSkipArray:R,elevateTopKeyThreshold:xe,prelinkMaxDepth:_e,prelinkMaxKeys:ve,toPlainMaxDepth:Se,toPlainMaxKeys:Ce,includeFunctions:we,functionPaths:Te,debug:De,debugWhen:Oe,debugSampleRate:be,bindingManifest:_,loopWarning:H,targetLabel:Ne,runTracker:()=>Y==null?void 0:Y(),isMounted:()=>O,initialSnapshot:T&&typeof T==`object`?T:void 0,initialState:E&&typeof E==`object`?E:void 0},Z=M===`patch`?s(`patchStrategy`,`createRuntimeMount(setData.strategy="patch")`).createScheduler(X):u(X),Q=()=>Z.job();Y=t(()=>{r(S);let e=S[f];a(e)&&r(e);let t=S[oe];a(t)&&r(t),A.forEach(e=>{var t;let n=(t=C[e])==null?S[e]:t;re(n)})},{lazy:!0,scheduler:()=>e(Q)}),fe||Q(),k.push(m(()=>n(Y))),(v=Z.start)==null||v.call(Z),Z.dispose&&k.push(m(Z.dispose));function Pe(e,t,n){let r=ee(e,(e,n)=>t(e,n),n);return k.push(r),m(()=>{r();let e=k.indexOf(r);e>=0&&k.splice(e,1)},r)}let $={get state(){return S},get setupState(){return C},get proxy(){return K},get methods(){return ke},get computed(){return Me},get adapter(){return J},bindModel:te(K,S,G,Ae,C),watch:Pe,snapshot:()=>Z.snapshot(),unmount:()=>{var e;if(O){O=!1,(e=Z.dispose)==null||e.call(Z);try{var t;(t=J.__wevu_disposeSetData)==null||t.call(J)}catch(e){}k.forEach(e=>{try{e()}catch(e){}}),k.length=0}}};try{Object.defineProperty($,"__wevu_touchSetupMethodsVersion",{value:q,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_touchSetupMethodsVersion=q}try{Object.defineProperty($,"__wevu_flushSetupSnapshotSync",{value:Q,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_flushSetupSnapshotSync=Q}try{Object.defineProperty($,"__wevu_cloneDispatchedSnapshot",{value:Z.cloneLatestSnapshot,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_cloneDispatchedSnapshot=Z.cloneLatestSnapshot}try{Object.defineProperty($,"__wevu_trackSetupReactiveKey",{value:e=>{A.add(e)},configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_trackSetupReactiveKey=e=>{A.add(e)}}try{Object.defineProperty($,d,{value:D,configurable:!0,enumerable:!1,writable:!1})}catch(e){$[d]=D}return $}}export{h as createRuntimeMount};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cloneSnapshotValue as e}from"./snapshot.mjs";const t=Promise.resolve();function n(e){return!(!e||typeof e!=`object`&&typeof e!=`function`||typeof e.then!=`function`)}function r(e){try{return e instanceof Error?e.message:String(e)}catch(e){return`<unprintable cause>`}}function i(e,t,n){let i=r(n),a
|
|
1
|
+
import{cloneSnapshotValue as e}from"./snapshot.mjs";const t=Promise.resolve();function n(e){return!(!e||typeof e!=`object`&&typeof e!=`function`||typeof e.then!=`function`)}function r(e){try{return e instanceof Error?e.message:String(e)}catch(e){return`<unprintable cause>`}}function i(e,t,n){let i=r(n),a=/* @__PURE__ */ Error(`[wevu] setData commit failed (${e===`adapter`?`adapter failure`:`out-of-order completion`}, revision=${t.revision}, mode=${t.mode}, kind=${t.kind}): ${i}`);return a.cause=n,a}function a(e){let t=!1,r=!0,i=!1,a=!1,o=(n,r)=>{t||(t=!0,e.settle(n,r))},s=()=>{if(r){i=!0;return}a||e.completion===`callback`&&o(`committed`)};try{let t=e.invoke(s),c=n(t);if(a=c,r=!1,c){t.then(()=>o(`committed`),e=>o(`failed`,e));return}(e.completion===`return`||i)&&o(`committed`)}catch(e){r=!1,o(`failed`,e)}}function o(n){let r=n.initialSnapshot?e(n.initialSnapshot):{},o=new Set(Object.keys(r)),s=0,c=0,l,u;function d(e){return e.inLedger?(e.commitPromise||(e.commitPromise=new Promise(t=>{e.resolveCommit=t})),e.commitPromise):t}let f={preparedSnapshot:r,dispatchedSnapshot:r,committedSnapshot:r,revision:0,committedRevision:0,failedRevision:void 0,needsFullSnapshot:!1,get commitPromise(){return u?d(u):t},disposed:!1},p=(e,t,r)=>{let a=i(e,t,r);try{n.onFailure({kind:e,revision:t.revision,committedRevision:f.committedRevision,mode:t.mode,cause:r,error:a,payloadKeys:t.payloadKeys,pendingPatchKeys:t.pendingPatchKeys})}catch(e){}},m=e=>{var t;(t=e.resolveCommit)==null||t.call(e),e.resolveCommit=void 0},h=e=>{let t=l;for(;t;){let n=t.next;if(t.inLedger=!1,t.next=void 0,m(t),t===e){l=n,l||(u=void 0);return}t=n}},g=()=>{let e=l;for(;e;){let t=e.next;e.inLedger=!1,e.next=void 0,e.physicalSettled||(e.status=`abandoned`),m(e),e=t}l=void 0,u=void 0,s+=1,c=f.committedRevision},_=()=>{f.needsFullSnapshot=!0},v=(e,t,n)=>{t.status=`failed`,f.failedRevision=t.revision,_(),g(),p(e,t,n)},y=()=>{for(;(l==null?void 0:l.status)===`succeeded`;){let e=l;f.committedSnapshot=e.snapshot,f.committedRevision=e.revision,l=e.next,e.inLedger=!1,e.next=void 0,m(e)}l||(u=void 0)},b=e=>{f.committedSnapshot=e.snapshot,f.committedRevision=e.revision,f.failedRevision=void 0,f.needsFullSnapshot=!1,h(e),y()},x=(e,t,n)=>{if(t===`failed`){p(`adapter`,e,n);return}t===`committed`&&f.committedRevision>e.revision&&(l&&g(),_(),p(`out-of-order`,e,`revision ${e.revision} completed after committed revision ${f.committedRevision}`))},S=(e,t,n)=>{if(!(f.disposed||e.physicalSettled)){if(e.physicalSettled=!0,!e.inLedger||e.epoch!==s){x(e,t,n);return}if(t===`abandoned`){e.status=`abandoned`,_(),g();return}if(t===`failed`){v(`adapter`,e,n);return}if(e.status=`succeeded`,c>e.revision){v(`out-of-order`,e,`revision ${e.revision} completed after revision ${c}`);return}if(c=e.revision,e.kind===`full`){b(e);return}y()}};return{state:f,dispatch:t=>{if(f.disposed)return f.revision;let r=f.revision+1;f.revision=r,f.preparedSnapshot=t.snapshot;let i={revision:r,epoch:s,mode:t.mode,kind:t.kind,snapshot:t.snapshot,payloadKeys:Object.keys(t.payload).length,pendingPatchKeys:t.pendingPatchKeys,status:`dispatched`,physicalSettled:!1,inLedger:!0,next:void 0};u?u.next=i:l=i,u=i,f.dispatchedSnapshot=t.snapshot;for(let e of Object.keys(t.payload))o.add(e.split(`.`,1)[0]);let c=(e,t)=>{S(i,e,t)},d=e(t.payload);if(typeof n.adapter.__wevu_dispatchSetData==`function`)try{n.adapter.__wevu_dispatchSetData(d,c)}catch(e){c(`failed`,e)}else a({invoke:()=>{var e,t;return(e=(t=n.adapter).setData)==null?void 0:e.call(t,d)},completion:`return`,settle:c});return r},createFullPayload:e=>{let t={},n=new Set(Object.keys(e));for(let[n,r]of Object.entries(e))t[n]=r===void 0?null:r;for(let e of o)n.has(e)||(t[e]=null);return t},dispose:()=>{f.disposed||(f.disposed=!0,g())}}}export{o as createSetDataCommitTracker,a as observeSetDataCompletion};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toPlain as e}from"../../diff.mjs";import{applySnapshotUpdate as t,cloneSnapshotValue as n,isDeepEqualValue as r,isShallowEqualValue as i,normalizeSetDataValue as a}from"./snapshot.mjs";import{checkPayloadSize as o,collapsePayload as s,mergeSiblingPayload as c}from"./payload.mjs";function l(l){let{state:u,computedRefs:d,dirtyComputedKeys:f,includeComputed:p,computedCompare:m,computedCompareMaxDepth:h,computedCompareMaxKeys:g,shouldIncludeKey:_,maxPatchKeys:v,maxPayloadBytes:y,mergeSiblingThreshold:b,mergeSiblingMaxInflationRatio:x,mergeSiblingMaxParentBytes:S,mergeSiblingSkipArray:C,elevateTopKeyThreshold:w,toPlainMaxDepth:T,toPlainMaxKeys:E,includeFunctions:D=!1,functionPaths:O,plainCache:k,plainCacheEligibility:A,pendingPatches:j,fallbackTopKeys:M,dispatchedSnapshot:N,dispatchedComputedSnapshot:P}=l;if(j.size>v){let e=j.size;return j.clear(),f.clear(),{type:`fallback`,reason:`maxPatchKeys`,debug:{mode:`diff`,reason:`maxPatchKeys`,pendingPatchKeys:e,payloadKeys:0}}}let F
|
|
1
|
+
import{toPlain as e}from"../../diff.mjs";import{applySnapshotUpdate as t,cloneSnapshotValue as n,isDeepEqualValue as r,isShallowEqualValue as i,normalizeSetDataValue as a}from"./snapshot.mjs";import{checkPayloadSize as o,collapsePayload as s,mergeSiblingPayload as c}from"./payload.mjs";function l(l){let{state:u,computedRefs:d,dirtyComputedKeys:f,includeComputed:p,computedCompare:m,computedCompareMaxDepth:h,computedCompareMaxKeys:g,shouldIncludeKey:_,maxPatchKeys:v,maxPayloadBytes:y,mergeSiblingThreshold:b,mergeSiblingMaxInflationRatio:x,mergeSiblingMaxParentBytes:S,mergeSiblingSkipArray:C,elevateTopKeyThreshold:w,toPlainMaxDepth:T,toPlainMaxKeys:E,includeFunctions:D=!1,functionPaths:O,plainCache:k,plainCacheEligibility:A,pendingPatches:j,fallbackTopKeys:M,dispatchedSnapshot:N,dispatchedComputedSnapshot:P}=l;if(j.size>v){let e=j.size;return j.clear(),f.clear(),{type:`fallback`,reason:`maxPatchKeys`,debug:{mode:`diff`,reason:`maxPatchKeys`,pendingPatchKeys:e,payloadKeys:0}}}let F=/* @__PURE__ */ new WeakMap,I=/* @__PURE__ */ new Map,L=Object.create(null),R=[...j.entries()];if(Number.isFinite(w)&&w>0){let e=/* @__PURE__ */ new Map;for(let[t]of R){var z;let n=t.split(`.`,1)[0];e.set(n,((z=e.get(n))==null?0:z)+1)}for(let[t,n]of e)n>=w&&M.add(t)}let B=R.filter(([e])=>{for(let t of M)if(e===t||e.startsWith(`${t}.`))return!1;return!0}),V=new Map(B);j.clear();let H=e=>{let t=e.split(`.`).filter(Boolean),n=u;for(let e of t){if(typeof n!=`object`||!n)return n;n=Reflect.get(n,e)}return n},U=t=>{if(I.has(t))return I.get(t);let n=a(e(H(t),F,{cache:k,cacheEligibility:A,maxDepth:T,maxKeys:E,includeFunctions:D,functionPaths:O,_path:t}));return I.set(t,n),n};if(M.size){for(let e of M)_(e)&&(L[e]=U(e),V.set(e,{kind:`property`,op:`set`}));M.clear()}for(let[e,t]of B)L[e]=(t.kind===`array`?`set`:t.op)===`delete`?null:U(e);let W=0,G=Object.create(null);if(p&&f.size){let t=[...f];f.clear(),W=t.length;for(let o of t){if(!_(o))continue;let t=e(d[o].value,F,{cache:k,cacheEligibility:A,maxDepth:T,maxKeys:E,includeFunctions:D,functionPaths:O,_path:o}),s=P[o];(m===`deep`?r(s,t,h,{keys:g}):m===`shallow`?i(s,t):Object.is(s,t))||(L[o]=a(t),G[o]=n(t))}}let K=s(L),q=0;if(b){let e=c({input:K,entryMap:V,getPlainByPath:U,mergeSiblingThreshold:b,mergeSiblingSkipArray:C,mergeSiblingMaxParentBytes:S,mergeSiblingMaxInflationRatio:x});q=e.merged,K=s(e.out)}let J=o(K,y),Y=Object.keys(K).length,X={mode:J.fallback?`diff`:`patch`,reason:J.fallback?`maxPayloadBytes`:`patch`,pendingPatchKeys:B.length,payloadKeys:Y,mergedSiblingParents:q||void 0,computedDirtyKeys:W||void 0,estimatedBytes:J.estimatedBytes,bytes:J.bytes};if(J.fallback)return{type:`fallback`,reason:`maxPayloadBytes`,debug:X};if(!Y)return;let Z={...N},Q=/* @__PURE__ */ new WeakSet;for(let[e,n]of Object.entries(K)){var $;let r=V.get(e);t(Z,e,n,(r==null?void 0:r.kind)===`array`||($=r==null?void 0:r.op)==null?`set`:$,{cloneValue:!1,clonedParents:Q})}return{type:`patch`,payload:K,snapshot:Z,computedUpdates:Object.keys(G).length?G:void 0,debug:X}}export{l as preparePatchUpdate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasOwn as e}from"../../../utils.mjs";function t(e){let t=Object.keys(e).sort();if(t.length<=1)return e;let n={},r=[];for(let i of t){for(;r.length;){let e=r[r.length-1];if(i.startsWith(e))break;r.pop()}r.length||(n[i]=e[i],r.push(`${i}.`))}return n}function n(e,t,r){if(t<=0)return t+1;if(e===null)return 4;let i=typeof e;if(i===`string`)return 2+e.length;if(i===`number`)return Number.isFinite(e)?String(e).length:4;if(i===`boolean`)return e?4:5;if(i===`undefined`||i===`function`||i===`symbol`||i!==`object`||r.has(e))return 4;if(r.add(e),Array.isArray(e)){let i=2;for(let a=0;a<e.length;a++)if(a&&(i+=1),i+=n(e[a],t-i,r),i>t)return i;return i}let a=2;for(let[i,o]of Object.entries(e))if(a>2&&(a+=1),a+=2+i.length+1,a+=n(o,t-a,r),a>t)return a;return a}function r(e,t){if(t===1/0)return{fallback:!1,estimatedBytes:void 0,bytes:void 0};let r=t,i=Object.keys(e).length,a=n(e,r+1
|
|
1
|
+
import{hasOwn as e}from"../../../utils.mjs";function t(e){let t=Object.keys(e).sort();if(t.length<=1)return e;let n={},r=[];for(let i of t){for(;r.length;){let e=r[r.length-1];if(i.startsWith(e))break;r.pop()}r.length||(n[i]=e[i],r.push(`${i}.`))}return n}function n(e,t,r){if(t<=0)return t+1;if(e===null)return 4;let i=typeof e;if(i===`string`)return 2+e.length;if(i===`number`)return Number.isFinite(e)?String(e).length:4;if(i===`boolean`)return e?4:5;if(i===`undefined`||i===`function`||i===`symbol`||i!==`object`||r.has(e))return 4;if(r.add(e),Array.isArray(e)){let i=2;for(let a=0;a<e.length;a++)if(a&&(i+=1),i+=n(e[a],t-i,r),i>t)return i;return i}let a=2;for(let[i,o]of Object.entries(e))if(a>2&&(a+=1),a+=2+i.length+1,a+=n(o,t-a,r),a>t)return a;return a}function r(e,t){if(t===1/0)return{fallback:!1,estimatedBytes:void 0,bytes:void 0};let r=t,i=Object.keys(e).length,a=n(e,r+1,/* @__PURE__ */ new WeakSet);if(a>r)return{fallback:!0,estimatedBytes:a,bytes:void 0};if(a>=r*.85&&i>2)try{let t=JSON.stringify(e).length;return{fallback:t>r,estimatedBytes:a,bytes:t}}catch(e){return{fallback:!1,estimatedBytes:a,bytes:void 0}}return{fallback:!1,estimatedBytes:a,bytes:void 0}}function i(t){let{input:r,entryMap:i,getPlainByPath:a,mergeSiblingThreshold:o,mergeSiblingSkipArray:s,mergeSiblingMaxParentBytes:c,mergeSiblingMaxInflationRatio:l}=t;if(!o)return{out:r,merged:0};let u=Object.keys(r);if(u.length<o)return{out:r,merged:0};let d=/* @__PURE__ */ new Map,f=/* @__PURE__ */ new Set;for(let e of u){var p;let t=i.get(e);if(!t)continue;if(r[e]===null||t.op===`delete`){let t=e.lastIndexOf(`.`);t>0&&f.add(e.slice(0,t));continue}let n=e.lastIndexOf(`.`);if(n<=0)continue;let a=e.slice(0,n),o=(p=d.get(a))==null?[]:p;o.push(e),d.set(a,o)}let m=[...d.entries()].filter(([e,t])=>t.length>=o&&!f.has(e)).sort((e,t)=>t[0].split(`.`).length-e[0].split(`.`).length);if(!m.length)return{out:r,merged:0};let h={};Object.assign(h,r);let g=0,_=/* @__PURE__ */ new WeakMap,v=e=>{if(e&&typeof e==`object`){let t=_.get(e);if(t!==void 0)return t;let r=n(e,1/0,/* @__PURE__ */ new WeakSet);return _.set(e,r),r}return n(e,1/0,/* @__PURE__ */ new WeakSet)},y=(e,t)=>2+e.length+1+v(t);for(let[t,n]of m){if(e(h,t))continue;let r=n.filter(t=>e(h,t));if(r.length<o)continue;let i=a(t);if(!(s&&Array.isArray(i))&&!(c!==1/0&&y(t,i)>c)){if(l!==1/0){let e=0;for(let t of r)e+=y(t,h[t]);if(y(t,i)>e*l)continue}h[t]=i;for(let e of r)delete h[e];g+=1}}return{out:h,merged:g}}export{r as checkPayloadSize,t as collapsePayload,n as estimateJsonSize,i as mergeSiblingPayload};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{getReactiveVersion as t,isReactive as n}from"../../../reactivity/reactive.mjs";import{isRef as r}from"../../../reactivity/ref.mjs";import{hasOwn as i}from"../../../utils.mjs";import{hasTrackableSetupBinding as a}from"../../setupTracking.mjs";import{resolveBindingDiagnostics as o}from"../../bindingManifest.mjs";import{diffSnapshots as s,toPlain as c}from"../../diff.mjs";import{collectSnapshot as l}from"./snapshot.mjs";import{createSetDataCommitTracker as u}from"./commitTracker.mjs";function d(d){let{state:f,setupState:p,snapshotOmitKeys:m,computedRefs:h,dirtyComputedKeys:g,includeComputed:_,setDataStrategy:v,currentAdapter:y,shouldIncludeKey:b,toPlainMaxDepth:x,toPlainMaxKeys:S,includeFunctions:C=!1,functionPaths:w,debug:T,debugWhen:E,debugSampleRate:D,bindingManifest:O,loopWarning:k,targetLabel:A,runTracker:j,isMounted:M,initialSnapshot:N,initialState:P}=d,F
|
|
1
|
+
import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{getReactiveVersion as t,isReactive as n}from"../../../reactivity/reactive.mjs";import{isRef as r}from"../../../reactivity/ref.mjs";import{hasOwn as i}from"../../../utils.mjs";import{hasTrackableSetupBinding as a}from"../../setupTracking.mjs";import{resolveBindingDiagnostics as o}from"../../bindingManifest.mjs";import{diffSnapshots as s,toPlain as c}from"../../diff.mjs";import{collectSnapshot as l}from"./snapshot.mjs";import{createSetDataCommitTracker as u}from"./commitTracker.mjs";function d(d){let{state:f,setupState:p,snapshotOmitKeys:m,computedRefs:h,dirtyComputedKeys:g,includeComputed:_,setDataStrategy:v,currentAdapter:y,shouldIncludeKey:b,toPlainMaxDepth:x,toPlainMaxKeys:S,includeFunctions:C=!1,functionPaths:w,debug:T,debugWhen:E,debugSampleRate:D,bindingManifest:O,loopWarning:k,targetLabel:A,runTracker:j,isMounted:M,initialSnapshot:N,initialState:P}=d,F=/* @__PURE__ */ new WeakMap,I=/* @__PURE__ */ new WeakMap,L={},R=Object.create(null),z=Object.create(null),B=[],V=-1/0,H=new Set(P&&typeof P==`object`?Object.keys(P):[]),U=e=>{if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},W=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>W(e,t[n]));if(U(e)&&U(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>i(t,n)&&W(e[n],t[n]))}return!1},G=i=>{let o=r(i)?i.value:i;if(typeof o!=`object`||!o)return o;if(!n(o)&&a(o))return{snapshot:c(o,/* @__PURE__ */ new WeakMap,{cacheEligibility:I,maxDepth:x,maxKeys:S,includeFunctions:C,functionPaths:w})};let s=n(o)?e(o):o;return{raw:s,version:t(s)}},K=(e,t)=>Object.is(e,t)?!0:!e||!t||typeof e!=`object`||typeof t!=`object`||!i(e,`raw`)||!i(t,`raw`)?e&&t&&typeof e==`object`&&typeof t==`object`&&i(e,`snapshot`)&&i(t,`snapshot`)?W(e.snapshot,t.snapshot):!1:e.raw===t.raw&&e.version===t.version,q=e=>b(e)&&!(m!=null&&m.has(e));if(N)for(let[e,t]of Object.entries(N))q(e)&&(L[e]=t);let J=()=>{if(!N)return;let t=n(f)?e(f):f,r=p&&typeof p==`object`?n(p)?e(p):p:void 0;for(let e of Object.keys(N))if(q(e)){if(r&&i(r,e)){R[e]=G(r[e]);continue}if(i(t,e)){if(H.has(e))continue;t[e]=N[e],R[e]=G(t[e])}}},ee=t=>{let a=[],o=p&&typeof p==`object`?n(p)?e(p):p:void 0;for(let n of/* @__PURE__ */ new Set([...Object.keys(f),...o?Object.keys(o):[]])){if(!q(n))continue;let s=o&&i(o,n)?o[n]:f[n],c=r(s)?s.value:s;c&&typeof c==`object`&&e(c)===t&&a.push(n)}return a},Y=(e,t)=>{if(!T)return;let n=e.reason!==`patch`&&e.reason!==`diff`;if(E===`fallback`&&!n||e.reason!==`commitFailure`&&D<1&&Math.random()>D)return;let r=e;if(O){let n=typeof t==`function`?t():t==null?[]:t,i=e.reason===`needsFullSnapshot`||e.reason===`maxPatchKeys`||e.reason===`maxPayloadBytes`;r={...e,bindings:o(O,n,i)}}try{T(r)}catch(e){}},X=u({initialSnapshot:L,adapter:y,onFailure:e=>{Y({mode:e.mode,reason:`commitFailure`,pendingPatchKeys:e.pendingPatchKeys,payloadKeys:e.payloadKeys,revision:e.revision,committedRevision:e.committedRevision,targetLabel:A,message:e.error.message});try{var t;(t=y.__wevu_reportSetDataError)==null||t.call(y,e.error)}catch(e){}}}),te=(e=0,t)=>{if(!k)return;let n=Date.now();B.push(n);let r=n-k.sampleWindowMs;for(;B.length&&B[0]<r;)B.shift();B.length<=k.maxFlushes||k.coolDownMs>0&&n-V<k.coolDownMs||(V=n,Y({mode:v,reason:`loopWarning`,pendingPatchKeys:e,payloadKeys:0,computedDirtyKeys:_?g.size:0,flushCount:B.length,windowMs:k.sampleWindowMs,targetLabel:A,message:`${A?`${A} `:``}疑似运行时更新循环:${B.length} 次 setData flush/${k.sampleWindowMs}ms`},t))},Z=()=>l({state:f,setupState:p,computedRefs:h,includeComputed:_,shouldIncludeKey:q,plainCache:F,plainCacheEligibility:I,toPlainMaxDepth:x,toPlainMaxKeys:S,includeFunctions:C,functionPaths:w});J();let ne=()=>{let t=n(f)?e(f):f,r=p&&typeof p==`object`?n(p)?e(p):p:void 0,a=X.state.dispatchedSnapshot,o={...a},s=/* @__PURE__ */ new WeakMap,l=/* @__PURE__ */ new Set,u=/* @__PURE__ */ new Set,d=/* @__PURE__ */ new Set;for(let e of/* @__PURE__ */ new Set([...Object.keys(t),...r?Object.keys(r):[]])){if(!q(e))continue;l.add(e);let n=r&&i(r,e)?r:t,u=G(n[e]),f=R[e];f&&u&&typeof f==`object`&&typeof u==`object`&&i(f,`raw`)&&i(u,`raw`)&&Array.isArray(f.raw)&&Array.isArray(u.raw)&&f.raw!==u.raw&&d.add(e),(!K(f,u)||!i(a,e))&&(o[e]=c(n[e],s,{cache:F,cacheEligibility:I,maxDepth:x,maxKeys:S,includeFunctions:C,functionPaths:w,_path:e})),R[e]=u}for(let e of Object.keys(R))l.has(e)||(delete R[e],(!_||!i(h,e))&&delete o[e]);if(!_){for(let e of Object.keys(z))delete z[e];return{snapshot:o,replacedTopLevelKeys:d}}for(let e of Object.keys(h)){if(!q(e))continue;u.add(e);let t=h[e].value,n=G(t);(!K(z[e],n)||!i(a,e))&&(o[e]=c(t,s,{cache:F,cacheEligibility:I,maxDepth:x,maxKeys:S,includeFunctions:C,functionPaths:w,_path:e})),z[e]=n}for(let e of Object.keys(z))u.has(e)||(delete z[e],(!i(t,e)||!q(e))&&delete o[e]);return{snapshot:o,replacedTopLevelKeys:d}},Q=(e=`diff`,t=0,n)=>{var r;let i=v===`diff`?ne():void 0,a=(r=i==null?void 0:i.snapshot)==null?Z():r,o=X.state.dispatchedSnapshot,c=X.state.needsFullSnapshot,l=c?X.createFullPayload(a):i?(()=>{let e={};for(let t of i.replacedTopLevelKeys)e[t]=a[t];return{...s(o,a,{skipKeys:i.replacedTopLevelKeys}),...e}})():s(o,a);n==null||n(a);let u=Object.keys(l).length;if(!u&&!c)return;let d=c?`needsFullSnapshot`:e;Y({mode:`diff`,reason:d,pendingPatchKeys:t,payloadKeys:u},Object.keys(l)),X.dispatch({mode:`diff`,kind:c?`full`:`delta`,reason:d,snapshot:a,payload:l,pendingPatchKeys:t})},$=(e=0,t)=>M()?(te(e,t),j(),!0):!1;return{collect:Z,emitDebug:Y,getLatestSnapshot:()=>X.state.dispatchedSnapshot,dispatchUpdate:X.dispatch,needsFullSnapshot:()=>X.state.needsFullSnapshot,job:e=>{if($())return Q(`diff`)},plainCache:F,plainCacheEligibility:I,prepareJob:$,resolveTopKeysByRoot:ee,runDiffUpdate:Q,shouldIncludeSnapshotKey:q,snapshot:()=>v===`patch`?Z():{...X.state.dispatchedSnapshot},cloneLatestSnapshot:()=>({...X.state.dispatchedSnapshot}),dispose:X.dispose}}export{d as createSetDataScheduler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{isReactive as t}from"../../../reactivity/reactive.mjs";import{hasOwn as n}from"../../../utils.mjs";import{toPlain as r}from"../../diff.mjs";function i(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function a(e){return e===void 0?null:e}function o(e){if(Array.isArray(e))return e.map(e=>o(e));if(!i(e))return e;let t={};for(let n of Object.keys(e))t[n]=o(e[n]);return t}function s(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}if(!i(e)||!i(t))return!1;let r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let i of r)if(!n(t,i)||!Object.is(e[i],t[i]))return!1;return!0}function c(e,t,r,a){if(Object.is(e,t))return!0;if(r<=0)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!c(e[n],t[n],r-1,a))return!1;return!0}if(!i(e)||!i(t))return!1;let o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(let i of o)if(--a.keys,a.keys<=0||!n(t,i)||!c(e[i],t[i],r-1,a))return!1;return!0}function l(e,t,n,r,i){var a;let s=(a=i==null?void 0:i.cloneValue)==null||a,c=i==null?void 0:i.clonedParents,l=t.split(`.`).filter(Boolean);if(!l.length)return;c==null||c.add(e);let u=e;for(let e=0;e<l.length-1;e++){let t=l[e],n=u[t];if(typeof n!=`object`||!n)u[t]={},c==null||c.add(u[t]);else if(c&&!c.has(n)){let e=Array.isArray(n)?n.slice():{...n};u[t]=e,c.add(e)}u=u[t]}let d=l[l.length-1];if(r===`delete`)try{delete u[d]}catch(e){u[d]=null}else u[d]=s?o(n):n}function u(n){let{state:i,setupState:a,computedRefs:o,includeComputed:s,shouldIncludeKey:c,plainCache:l,plainCacheEligibility:u,toPlainMaxDepth:d,toPlainMaxKeys:f,includeFunctions:p=!1,functionPaths:m=[]}=n,h
|
|
1
|
+
import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{isReactive as t}from"../../../reactivity/reactive.mjs";import{hasOwn as n}from"../../../utils.mjs";import{toPlain as r}from"../../diff.mjs";function i(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function a(e){return e===void 0?null:e}function o(e){if(Array.isArray(e))return e.map(e=>o(e));if(!i(e))return e;let t={};for(let n of Object.keys(e))t[n]=o(e[n]);return t}function s(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}if(!i(e)||!i(t))return!1;let r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let i of r)if(!n(t,i)||!Object.is(e[i],t[i]))return!1;return!0}function c(e,t,r,a){if(Object.is(e,t))return!0;if(r<=0)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!c(e[n],t[n],r-1,a))return!1;return!0}if(!i(e)||!i(t))return!1;let o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(let i of o)if(--a.keys,a.keys<=0||!n(t,i)||!c(e[i],t[i],r-1,a))return!1;return!0}function l(e,t,n,r,i){var a;let s=(a=i==null?void 0:i.cloneValue)==null||a,c=i==null?void 0:i.clonedParents,l=t.split(`.`).filter(Boolean);if(!l.length)return;c==null||c.add(e);let u=e;for(let e=0;e<l.length-1;e++){let t=l[e],n=u[t];if(typeof n!=`object`||!n)u[t]={},c==null||c.add(u[t]);else if(c&&!c.has(n)){let e=Array.isArray(n)?n.slice():{...n};u[t]=e,c.add(e)}u=u[t]}let d=l[l.length-1];if(r===`delete`)try{delete u[d]}catch(e){u[d]=null}else u[d]=s?o(n):n}function u(n){let{state:i,setupState:a,computedRefs:o,includeComputed:s,shouldIncludeKey:c,plainCache:l,plainCacheEligibility:u,toPlainMaxDepth:d,toPlainMaxKeys:f,includeFunctions:p=!1,functionPaths:m=[]}=n,h=/* @__PURE__ */ new WeakMap,g={},_=Number.isFinite(f)?{keys:f}:void 0,v=t(i)?e(i):i,y=a&&typeof a==`object`?t(a)?e(a):a:void 0,b=Object.keys(v),x=y?Object.keys(y):[],S=s?Object.keys(o):[];for(let e of b)c(e)&&(g[e]=r(v[e],h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));for(let e of x)c(e)&&(g[e]=r(y[e],h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));for(let e of S)c(e)&&(g[e]=r(o[e].value,h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));return g}export{l as applySnapshotUpdate,o as cloneSnapshotValue,u as collectSnapshot,c as isDeepEqualValue,i as isPlainObjectLike,s as isShallowEqualValue,a as normalizeSetDataValue};
|
package/dist/runtime/app.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getMiniProgramGlobalObject as e}from"./platform.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as t,applyWevuAppDefaults as n}from"./defaults.mjs";import{isSetDataHighFrequencyWarningRequested as r,requireRuntimeCapability as i}from"./capabilities.mjs";import{ensureRuntimeAppProvides as a,setRuntimeAppProvidedValue as o}from"./provideContext.mjs";import{version as s}from"../version.mjs";import{resolveBindingManifest as c}from"./bindingManifest.mjs";import{createRuntimeMount as l}from"./app/mount.mjs";import{setPendingRuntimeAppRegistration as u}from"./app/pending.mjs";import{registerApp as d}from"./register/app.mjs";import{WEVU_BINDING_MANIFEST_KEY as f,WEVU_INLINE_HANDLER as p,WEVU_INLINE_MAP_KEY as m,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as h,WEVU_SLOT_OWNER_ID_KEY as g}from"@weapp-core/constants";function _(_){let v=_[t],{[t]:y,[f]:b,[h]:x,data:S,computed:C,methods:w,setData:T,watch:E,setup:D,...O}=v===`component`?_:n(_),k=c(b),A=w==null?{}:w,j=C==null?{}:C,M=x===!0||Array.isArray(T==null?void 0:T.pick)&&T.pick.includes(g),N=A,P=N[m];Object.prototype.hasOwnProperty.call(N,m)&&P&&typeof P==`object`&&Object.keys(P).length>0&&typeof N[p]!=`function`&&typeof O[p]!=`function`&&i(`inlineEvents`,`createApp(inline event metadata)`),(T==null?void 0:T.strategy)===`patch`&&i(`patchStrategy`,`createApp(setData.strategy="patch")`),r(T==null?void 0:T.highFrequencyWarning)&&i(`setDataHighFrequencyWarning`,`createApp(setData.highFrequencyWarning)`),M&&i(`scopedSlots`,`createApp(scoped-slot bindings)`);let F
|
|
1
|
+
import{getMiniProgramGlobalObject as e}from"./platform.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as t,applyWevuAppDefaults as n}from"./defaults.mjs";import{isSetDataHighFrequencyWarningRequested as r,requireRuntimeCapability as i}from"./capabilities.mjs";import{ensureRuntimeAppProvides as a,setRuntimeAppProvidedValue as o}from"./provideContext.mjs";import{version as s}from"../version.mjs";import{resolveBindingManifest as c}from"./bindingManifest.mjs";import{createRuntimeMount as l}from"./app/mount.mjs";import{setPendingRuntimeAppRegistration as u}from"./app/pending.mjs";import{registerApp as d}from"./register/app.mjs";import{WEVU_BINDING_MANIFEST_KEY as f,WEVU_INLINE_HANDLER as p,WEVU_INLINE_MAP_KEY as m,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as h,WEVU_SLOT_OWNER_ID_KEY as g}from"@weapp-core/constants";function _(_){let v=_[t],{[t]:y,[f]:b,[h]:x,data:S,computed:C,methods:w,setData:T,watch:E,setup:D,...O}=v===`component`?_:n(_),k=c(b),A=w==null?{}:w,j=C==null?{}:C,M=x===!0||Array.isArray(T==null?void 0:T.pick)&&T.pick.includes(g),N=A,P=N[m];Object.prototype.hasOwnProperty.call(N,m)&&P&&typeof P==`object`&&Object.keys(P).length>0&&typeof N[p]!=`function`&&typeof O[p]!=`function`&&i(`inlineEvents`,`createApp(inline event metadata)`),(T==null?void 0:T.strategy)===`patch`&&i(`patchStrategy`,`createApp(setData.strategy="patch")`),r(T==null?void 0:T.highFrequencyWarning)&&i(`setDataHighFrequencyWarning`,`createApp(setData.highFrequencyWarning)`),M&&i(`scopedSlots`,`createApp(scoped-slot bindings)`);let F=/* @__PURE__ */ new Set,I=/* @__PURE__ */ new Set,L=!1,R={globalProperties:{}},z={mount:l({data:S,resolvedComputed:j,resolvedMethods:A,appConfig:R,setDataOptions:T,bindingManifest:k}),use(e,...t){if(!e||F.has(e))return z;if(F.add(e),typeof e==`function`)e(z,...t);else if(typeof e.install==`function`)e.install(z,...t);else throw TypeError(`插件必须是函数,或包含 install 方法的对象`);return z},provide(e,t){return o(z,e,t,{syncGlobal:v!==`component`}),z},onUnmount(e){if(typeof e!=`function`)throw TypeError(`onUnmount 只接受函数`);return L?(e(),z):(I.add(e),z)},unmount(){if(!L){L=!0;for(let e of I)e();I.clear()}},config:R,version:s};try{a(z),Object.defineProperty(z,"__wevuSetDataOptions",{value:T,configurable:!0,enumerable:!1,writable:!1}),Object.defineProperty(z,"__wevuHasTemplateRuntimeBindings",{value:M,configurable:!0,enumerable:!1,writable:!1})}catch(e){z.__wevuSetDataOptions=T,z.__wevuHasTemplateRuntimeBindings=M}let B=()=>{let t=e(),n=`__wevuAppRegistered`;t&&t[n]||(t&&(t[n]=!0),d(z,w==null?{}:w,E,D,O))};return v!==`component`&&typeof App==`function`?B():v!==`component`&&u({app:z,register:B}),z}export{_ as createApp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={"exact-path":!0,"snapshot-fallback":!0,"top-level":!0};function t(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function n(e){return typeof e==`number`&&Number.isFinite(e)&&Number.isInteger(e)}function r(e){if(!e||typeof e!=`object`)return!1;let t=e;return n(t.offset)&&t.offset>=0&&n(t.line)&&t.line>=1&&n(t.column)&&t.column>=1}function i(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.start,i=t.end;return r(n)&&r(i)&&i.offset>=n.offset}function a(e){return Object.values(e).every(e=>e===!0)}function o(n){if(!n||typeof n!=`object`)return!1;let r=n;return typeof r.id==`string`&&r.id.length>0&&typeof r.outputPath==`string`&&r.outputPath.length>0&&(r.sourceFile===void 0||typeof r.sourceFile==`string`&&r.sourceFile.length>0)&&(r.updateMode===void 0||typeof r.updateMode==`string`&&e[r.updateMode]===!0)&&(r.sourceRoots===void 0||t(r.sourceRoots))&&(r.sourceLocation===void 0||i(r.sourceLocation))}function s(e){if(!e||typeof e!=`object`)return;let t=e;if(t.version===1&&typeof t.sourceFile==`string`&&Array.isArray(t.bindings)&&t.bindings.every(o)&&(t.features===void 0||t.features&&typeof t.features==`object`&&!Array.isArray(t.features)&&a(t.features)))return t}function c(e,t){var n;return(n=e==null?void 0:e.bindings.some(e=>e.outputPath===t))!=null&&n}function l(e){return e.replace(/\[(?:'([^']+)'|"([^"]+)"|([^\]]+))\]/g,(e,t,n,r)=>{var i;return`.${(i=t==null?n:t)==null?r:i}`}).replace(/^\./,``)}function u(e){var t;return(t=l(e).split(`.`,1)[0])==null?``:t}function d(e,t){let n=l(e),r=l(t);return n===r||n.startsWith(`${r}.`)||r.startsWith(`${n}.`)}function f(e){var t;return(t=e.updateMode)==null?`exact-path`:t}function p(e,t){var n;if(!t)return!1;let r=f(e);if(r===`snapshot-fallback`&&e.outputPath===`*`)return!0;if(r===`exact-path`)return d(e.outputPath,t);let i=u(t);return u(e.outputPath)===i||r===`snapshot-fallback`&&((n=e.sourceRoots)==null?[]:n).some(e=>u(e)===i)}function m(e,t,n=!1){let r=[...t],i
|
|
1
|
+
const e={"exact-path":!0,"snapshot-fallback":!0,"top-level":!0};function t(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function n(e){return typeof e==`number`&&Number.isFinite(e)&&Number.isInteger(e)}function r(e){if(!e||typeof e!=`object`)return!1;let t=e;return n(t.offset)&&t.offset>=0&&n(t.line)&&t.line>=1&&n(t.column)&&t.column>=1}function i(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.start,i=t.end;return r(n)&&r(i)&&i.offset>=n.offset}function a(e){return Object.values(e).every(e=>e===!0)}function o(n){if(!n||typeof n!=`object`)return!1;let r=n;return typeof r.id==`string`&&r.id.length>0&&typeof r.outputPath==`string`&&r.outputPath.length>0&&(r.sourceFile===void 0||typeof r.sourceFile==`string`&&r.sourceFile.length>0)&&(r.updateMode===void 0||typeof r.updateMode==`string`&&e[r.updateMode]===!0)&&(r.sourceRoots===void 0||t(r.sourceRoots))&&(r.sourceLocation===void 0||i(r.sourceLocation))}function s(e){if(!e||typeof e!=`object`)return;let t=e;if(t.version===1&&typeof t.sourceFile==`string`&&Array.isArray(t.bindings)&&t.bindings.every(o)&&(t.features===void 0||t.features&&typeof t.features==`object`&&!Array.isArray(t.features)&&a(t.features)))return t}function c(e,t){var n;return(n=e==null?void 0:e.bindings.some(e=>e.outputPath===t))!=null&&n}function l(e){return e.replace(/\[(?:'([^']+)'|"([^"]+)"|([^\]]+))\]/g,(e,t,n,r)=>{var i;return`.${(i=t==null?n:t)==null?r:i}`}).replace(/^\./,``)}function u(e){var t;return(t=l(e).split(`.`,1)[0])==null?``:t}function d(e,t){let n=l(e),r=l(t);return n===r||n.startsWith(`${r}.`)||r.startsWith(`${n}.`)}function f(e){var t;return(t=e.updateMode)==null?`exact-path`:t}function p(e,t){var n;if(!t)return!1;let r=f(e);if(r===`snapshot-fallback`&&e.outputPath===`*`)return!0;if(r===`exact-path`)return d(e.outputPath,t);let i=u(t);return u(e.outputPath)===i||r===`snapshot-fallback`&&((n=e.sourceRoots)==null?[]:n).some(e=>u(e)===i)}function m(e,t,n=!1){let r=[...t],i=/* @__PURE__ */ new Set,a=[];for(let t of e.bindings){var o;if(i.has(t.id))continue;let s=f(t);if(!(r.length>0?r.some(e=>p(t,e)):n&&s===`snapshot-fallback`))continue;i.add(t.id);let c={id:t.id,outputPath:t.outputPath,updateMode:s,sourceFile:(o=t.sourceFile)==null?e.sourceFile:o};t.sourceLocation&&(c.sourceLocation=t.sourceLocation),a.push(c)}return a}export{c as hasBindingOutputPath,m as resolveBindingDiagnostics,s as resolveBindingManifest};
|
|
@@ -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
|
|
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=/* @__PURE__ */ 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,/* @__PURE__ */ 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
|
-
const e=[`components`,`computed`,`directives`,`inject`,`methods`,`props`,`provide`],t
|
|
1
|
+
const e=[`components`,`computed`,`directives`,`inject`,`methods`,`props`,`provide`],t=/* @__PURE__ */ new Set(/* @__PURE__ */ `activated.attached.beforeCreate.beforeDestroy.beforeMount.beforeUnmount.beforeUpdate.created.deactivated.destroyed.detached.errorCaptured.hide.mounted.moved.onAddToFavorites.onHide.onLoad.onPageScroll.onPullDownRefresh.onReachBottom.onReady.onResize.onRouteDone.onSaveExitState.onShareAppMessage.onShareTimeline.onShow.onTabItemTap.onUnload.ready.renderTracked.renderTriggered.serverPrefetch.show.unmounted.updated`.split(`.`));function n(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:void 0}function r(e,t){return typeof e==`function`?typeof t==`function`?function(...n){return e.apply(this,n),t.apply(this,n)}:e:t}function i(e,t){let i=n(e),a=n(t);if(!i)return a;if(!a)return i;let o={...i,...a};for(let e of/* @__PURE__ */ new Set([...Object.keys(i),...Object.keys(a)]))o[e]=r(i[e],a[e]);return o}function a(e,t){return e===void 0?t:t===void 0?e:function(){var r,i;let a=typeof e==`function`?e.call(this):e,o=typeof t==`function`?t.call(this):t;return{...(r=n(a))==null?{}:r,...(i=n(o))==null?{}:i}}}function o(e,t){if(typeof e==`function`)return e;if(typeof e==`string`){let n=t[e];return typeof n==`function`?n:void 0}let r=n(e);return r?o(r.handler,t):void 0}function s(e,t){if(e===void 0)return t;if(t===void 0)return e;let r=n(e),i=n(t);return{...r==null?{}:r,...i==null?{}:i,handler(...n){var r,i;return(r=o(e,this))==null||r.apply(this,n),(i=o(t,this))==null?void 0:i.apply(this,n)},immediate:!!(r!=null&&r.immediate||i!=null&&i.immediate),deep:!!(r!=null&&r.deep||i!=null&&i.deep)}}function c(e,t){let r=n(e),i=n(t);if(!r)return i;if(!i)return r;let a={...r,...i};for(let e of/* @__PURE__ */ new Set([...Object.keys(r),...Object.keys(i)]))a[e]=s(r[e],i[e]);return a}function l(e,t){let n=[...Array.isArray(e)?e:[],...Array.isArray(t)?t:[]];return[...new Set(n)]}function u(o,s){let u={...o,...s};for(let t of e){let e=n(o[t]),r=n(s[t]);(e||r)&&(u[t]={...e==null?{}:e,...r==null?{}:r})}u.data=a(o.data,s.data),u.watch=c(o.watch,s.watch),u.lifetimes=i(o.lifetimes,s.lifetimes),u.pageLifetimes=i(o.pageLifetimes,s.pageLifetimes);for(let e of/* @__PURE__ */ new Set([...Object.keys(o),...Object.keys(s)]))t.has(e)&&(u[e]=r(o[e],s[e]));return(Array.isArray(o.emits)||Array.isArray(s.emits))&&(u.emits=l(o.emits,s.emits)),(Array.isArray(o.expose)||Array.isArray(s.expose))&&(u.expose=l(o.expose,s.expose)),u}function d(e,t,r){let i=n(t);if(!i||r.has(i))return e;r.add(i);let a=e;if(a=d(a,i.extends,r),Array.isArray(i.mixins))for(let e of i.mixins)a=d(a,e,r);let{extends:o,mixins:s,...c}=i;return u(a,c)}function f(e){return d({},e,/* @__PURE__ */ new WeakSet)}export{f as resolveVueComponentOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasOwn as e}from"../../utils.mjs";import{WEVU_SLOT_NAMES_PROP as t,WEVU_SLOT_OWNER_ID_PROP as n,WEVU_SLOT_SCOPE_KEY as r}from"@weapp-core/constants";const i=`__wevu_allowNullPropInput`,a=`allowNullPropInput`,o
|
|
1
|
+
import{hasOwn as e}from"../../utils.mjs";import{WEVU_SLOT_NAMES_PROP as t,WEVU_SLOT_OWNER_ID_PROP as n,WEVU_SLOT_SCOPE_KEY as r}from"@weapp-core/constants";const i=`__wevu_allowNullPropInput`,a=`allowNullPropInput`,o=/* @__PURE__ */ new Map([[String,String],[Number,Number],[Boolean,Boolean],[Object,Object],[Array,Array],[Function,Function],[`String`,String],[`Number`,Number],[`Boolean`,Boolean],[`Object`,Object],[`Array`,Array],[`Function`,Function],[null,null],[`null`,null],[`Null`,null]]);function s(e){return o.get(e)}function c(e,t=[]){if(Array.isArray(e)){for(let n of e)c(n,t);return t}let n=s(e);return n!==void 0&&!t.includes(n)&&t.push(n),t}function l(e){if(e===void 0)return[];let t=c(e).filter(e=>e!==null);return t.length>0?t:[null]}function u(e,t){let n=l(t);if(n.length!==0&&(e.type=n[0],n.length>1)){let t=[];for(let e of n.slice(1))t.includes(e)||t.push(e);t.length>0&&(e.optionalTypes=t)}}function d(t){e(t,`value`)||(t.type===String?t.value=``:t.type===Number?t.value=0:t.type===Boolean?t.value=!1:t.type===Array&&(t.value=[]))}function f(e,t,n){if(!n||e.type===null)return;let r=t&&typeof t==`object`&&!Array.isArray(t)?t:void 0,i=c(r?[r.type,r.optionalTypes]:t),a=i.includes(null),o=i.filter(e=>e!==null).length>1,s=(r==null?void 0:r.required)!==!0;(a||o||s)&&(a||d(e),e.type=null,delete e.optionalTypes)}function p(t,n){let r={};return t&&Object.entries(t).forEach(([t,i])=>{if(i!==void 0){if(i===null){r[t]={type:null};return}if(Array.isArray(i)||typeof i==`function`){let a={};u(a,i),e(a,`type`)||(a.type=null),f(a,i,n),r[t]=a;return}if(typeof i==`object`){if(t.endsWith(`Modifiers`)&&Object.keys(i).length===0){r[t]={type:Object,value:{}};return}let a={};if(`type`in i&&i.type!==void 0&&u(a,i.type),Array.isArray(i.optionalTypes)){let e=i.optionalTypes.map(e=>s(e)).filter(e=>e!=null);if(e.length>0){let t=Array.isArray(a.optionalTypes)?a.optionalTypes:[];for(let n of e)n!==a.type&&(t.includes(n)||t.push(n));t.length>0&&(a.optionalTypes=t)}}`observer`in i&&(typeof i.observer==`function`||typeof i.observer==`string`)&&(a.observer=i.observer);let o=`default`in i?i.default:i.value;o!==void 0&&(a.value=typeof o==`function`?o():o),e(a,`type`)||(a.type=null),f(a,i,n),r[t]=a}}}),r}function m(o,s,c){var l;let u=!!((l=o[i])==null?o[a]:l),{[i]:d,[a]:f,...m}=o,h=o.properties,g=h&&typeof h==`object`&&Object.keys(h).length>0?h:void 0,_=c==null?g:c,v=!!(s||_),y=i=>{let a={...i==null?{}:i};return v?(e(a,n)||(a[n]={type:String,value:``}),e(a,r)||(a[r]={type:null,value:null}),e(a,t)||(a[t]={type:null,value:null}),a):a};if(_){let{properties:e,...t}=m,n=_,r=p(s,u);return{...t,properties:y({...r,...n})}}return{...m,properties:y(p(s,u))}}export{m as normalizeProps};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requireRuntimeCapability as e,runtimeCapabilityRegistry as t}from"../capabilities.mjs";import{runTeardownSteps as n}from"../teardown.mjs";import{hasOwn as r}from"../../utils.mjs";import{cloneSnapshotValue as i,isDeepEqualValue as a}from"../app/setData/snapshot.mjs";import{decodeWxmlEntities as o,resolveDatasetEventValue as s}from"../inlineDataset.mjs";import{getOwnerProxy as c,getOwnerSnapshot as l,getOwnerTarget as u,subscribeOwner as d}from"../scopedSlots.mjs";import{WEVU_BINDING_MANIFEST_KEY as f,WEVU_INLINE_HANDLER as p,WEVU_INLINE_MAP_KEY as m,WEVU_LAYOUT_HOSTS_KEY as h,WEVU_OWNER_HANDLER as g,WEVU_PROPS_DERIVED_KEYS_KEY as _,WEVU_PUBLIC_RUNTIME_KEY as v,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as y,WEVU_SLOT_FUNCTION_TOKEN as b,WEVU_SLOT_OWNER_ID_KEY as x,WEVU_SLOT_OWNER_ID_PROP as S,WEVU_SLOT_OWNER_KEY as C,WEVU_SLOT_OWNER_PROXY_KEY as w,WEVU_SLOT_PROPS_DATA_KEY as T,WEVU_SLOT_PROPS_KEY as E,WEVU_SLOT_SCOPE_KEY as D,WEVU_TEMPLATE_REFS_KEY as O}from"@weapp-core/constants";const k=[x,S,w,C,T,E,D];function A(e){var t,n,r,i;let a=(t=(n=e==null||(r=e.currentTarget)==null?void 0:r.dataset)==null?e==null||(i=e.target)==null?void 0:i.dataset:n)==null?{}:t,c=s(a,`wvArgs`,e),l=[];if(Array.isArray(c))l=c;else if(typeof c==`string`)try{l=JSON.parse(c)}catch(e){try{l=JSON.parse(o(c))}catch(e){l=[]}}return Array.isArray(l)||(l=[]),l.map(t=>t===`$event`?e:t)}function j(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 M(e){return Array.isArray(e)&&e[0]===b&&typeof e[1]==`string`}function N(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[p];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 P(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]=M(i)?N(e,i):i;return n}function F(e){var t,n,r,i;return(t=(n=e==null||(r=e.__wevu)==null?void 0:r.proxy)==null?e==null||(i=e[v])==null?void 0:i.proxy:n)==null?e:t}function I(e,t){if(!t||Object.keys(t).length===0)return;let n=F(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 L(e){var t,n;e==null||(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)}function R(e,t,n){var o;L(e);let s=I(e,t);if(!s||typeof(e==null?void 0:e.setData)!=`function`)return;let c=r(e,`__wvScopedSlotComputedSnapshot`),l=(o=e.__wvScopedSlotComputedSnapshot)==null?{}:o,u={},d={};for(let[e,t]of Object.entries(s))u[e]=i(t),(n!=null&&n.force||!c||!r(l,e)||!a(l[e],t,20,{keys:1e4}))&&(d[e]=t);for(let e of Object.keys(l))r(s,e)||(d[e]=null);e.__wvScopedSlotComputedSnapshot=u,Object.keys(d).length>0&&e.setData(d)}function z(e,t){var n,o,s,c,l;let u=r(t==null?{}:t,D)?t[D]:e==null||(n=e.properties)==null?void 0:n[D],d=r(t==null?{}:t,E)?t[E]:e==null||(o=e.properties)==null?void 0:o[E],f=j(u),p=j(d),m={...f,...p},h=!r(e,`__wvSlotPropsSnapshot`)||!a((s=e.__wvSlotPropsSnapshot)==null?{}:s,m,20,{keys:1e4}),g=h||!e[T]?P(e,m):e[T];h&&(e.__wvSlotPropsSnapshot=i(m)),e[T]=g;let _=e==null||(c=e.__wevu)==null?void 0:c.state,v=!(!_||typeof _!=`object`||r(_,T)&&a((l=_[T])==null?{}:l,m,20,{keys:1e4}));return _&&typeof _==`object`&&(_[T]=g),{merged:g,runtimeSnapshotChanged:v,snapshot:m,snapshotChanged:h}}function B(e,t,n){let{runtimeSnapshotChanged:r,snapshot:i,snapshotChanged:a}=z(e,n);(a||r)&&typeof(e==null?void 0:e.setData)==`function`&&e.setData({[T]:i}),a&&R(e,t)}function V(e,t){var n;let r=!1;e[w]!==t&&(e[w]=t,r=!0);let i=e==null?void 0:e.data;if(i&&typeof i==`object`&&i[w]!==t){try{Object.defineProperty(i,w,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[w]=t}r=!0}let a=e==null||(n=e.__wevu)==null?void 0:n.state;return a&&typeof a==`object`&&a[w]!==t&&(a[w]=t,r=!0),r}function H(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function U(e,t,n,r){if(typeof e==`function`){n[t]=e;return}if(typeof e!=`object`||!e)return e;if(r.has(e))return;if(Array.isArray(e)){r.add(e);let i=e.map((e,i)=>{let a=U(e,`${t}.${i}`,n,r);return a===void 0?null:a});return r.delete(e),i}if(!H(e))return i(e);r.add(e);let a={};for(let[i,o]of Object.entries(e)){let e=U(o,`${t}.${i}`,n,r);e!==void 0&&(a[i]=e)}return r.delete(e),a}function W(e){let t={},n=U(e,C,t
|
|
1
|
+
import{requireRuntimeCapability as e,runtimeCapabilityRegistry as t}from"../capabilities.mjs";import{runTeardownSteps as n}from"../teardown.mjs";import{hasOwn as r}from"../../utils.mjs";import{cloneSnapshotValue as i,isDeepEqualValue as a}from"../app/setData/snapshot.mjs";import{decodeWxmlEntities as o,resolveDatasetEventValue as s}from"../inlineDataset.mjs";import{getOwnerProxy as c,getOwnerSnapshot as l,getOwnerTarget as u,subscribeOwner as d}from"../scopedSlots.mjs";import{WEVU_BINDING_MANIFEST_KEY as f,WEVU_INLINE_HANDLER as p,WEVU_INLINE_MAP_KEY as m,WEVU_LAYOUT_HOSTS_KEY as h,WEVU_OWNER_HANDLER as g,WEVU_PROPS_DERIVED_KEYS_KEY as _,WEVU_PUBLIC_RUNTIME_KEY as v,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as y,WEVU_SLOT_FUNCTION_TOKEN as b,WEVU_SLOT_OWNER_ID_KEY as x,WEVU_SLOT_OWNER_ID_PROP as S,WEVU_SLOT_OWNER_KEY as C,WEVU_SLOT_OWNER_PROXY_KEY as w,WEVU_SLOT_PROPS_DATA_KEY as T,WEVU_SLOT_PROPS_KEY as E,WEVU_SLOT_SCOPE_KEY as D,WEVU_TEMPLATE_REFS_KEY as O}from"@weapp-core/constants";const k=[x,S,w,C,T,E,D];function A(e){var t,n,r,i;let a=(t=(n=e==null||(r=e.currentTarget)==null?void 0:r.dataset)==null?e==null||(i=e.target)==null?void 0:i.dataset:n)==null?{}:t,c=s(a,`wvArgs`,e),l=[];if(Array.isArray(c))l=c;else if(typeof c==`string`)try{l=JSON.parse(c)}catch(e){try{l=JSON.parse(o(c))}catch(e){l=[]}}return Array.isArray(l)||(l=[]),l.map(t=>t===`$event`?e:t)}function j(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 M(e){return Array.isArray(e)&&e[0]===b&&typeof e[1]==`string`}function N(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[p];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 P(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]=M(i)?N(e,i):i;return n}function F(e){var t,n,r,i;return(t=(n=e==null||(r=e.__wevu)==null?void 0:r.proxy)==null?e==null||(i=e[v])==null?void 0:i.proxy:n)==null?e:t}function I(e,t){if(!t||Object.keys(t).length===0)return;let n=F(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 L(e){var t,n;e==null||(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)}function R(e,t,n){var o;L(e);let s=I(e,t);if(!s||typeof(e==null?void 0:e.setData)!=`function`)return;let c=r(e,`__wvScopedSlotComputedSnapshot`),l=(o=e.__wvScopedSlotComputedSnapshot)==null?{}:o,u={},d={};for(let[e,t]of Object.entries(s))u[e]=i(t),(n!=null&&n.force||!c||!r(l,e)||!a(l[e],t,20,{keys:1e4}))&&(d[e]=t);for(let e of Object.keys(l))r(s,e)||(d[e]=null);e.__wvScopedSlotComputedSnapshot=u,Object.keys(d).length>0&&e.setData(d)}function z(e,t){var n,o,s,c,l;let u=r(t==null?{}:t,D)?t[D]:e==null||(n=e.properties)==null?void 0:n[D],d=r(t==null?{}:t,E)?t[E]:e==null||(o=e.properties)==null?void 0:o[E],f=j(u),p=j(d),m={...f,...p},h=!r(e,`__wvSlotPropsSnapshot`)||!a((s=e.__wvSlotPropsSnapshot)==null?{}:s,m,20,{keys:1e4}),g=h||!e[T]?P(e,m):e[T];h&&(e.__wvSlotPropsSnapshot=i(m)),e[T]=g;let _=e==null||(c=e.__wevu)==null?void 0:c.state,v=!(!_||typeof _!=`object`||r(_,T)&&a((l=_[T])==null?{}:l,m,20,{keys:1e4}));return _&&typeof _==`object`&&(_[T]=g),{merged:g,runtimeSnapshotChanged:v,snapshot:m,snapshotChanged:h}}function B(e,t,n){let{runtimeSnapshotChanged:r,snapshot:i,snapshotChanged:a}=z(e,n);(a||r)&&typeof(e==null?void 0:e.setData)==`function`&&e.setData({[T]:i}),a&&R(e,t)}function V(e,t){var n;let r=!1;e[w]!==t&&(e[w]=t,r=!0);let i=e==null?void 0:e.data;if(i&&typeof i==`object`&&i[w]!==t){try{Object.defineProperty(i,w,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[w]=t}r=!0}let a=e==null||(n=e.__wevu)==null?void 0:n.state;return a&&typeof a==`object`&&a[w]!==t&&(a[w]=t,r=!0),r}function H(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function U(e,t,n,r){if(typeof e==`function`){n[t]=e;return}if(typeof e!=`object`||!e)return e;if(r.has(e))return;if(Array.isArray(e)){r.add(e);let i=e.map((e,i)=>{let a=U(e,`${t}.${i}`,n,r);return a===void 0?null:a});return r.delete(e),i}if(!H(e))return i(e);r.add(e);let a={};for(let[i,o]of Object.entries(e)){let e=U(o,`${t}.${i}`,n,r);e!==void 0&&(a[i]=e)}return r.delete(e),a}function W(e){let t={},n=U(e,C,t,/* @__PURE__ */ new WeakSet);return{[C]:n,...t}}function G(e,t,n,o){var s;let c=V(e,n),{snapshotChanged:l}=z(e),u=t||{},d=!r(e,`__wvOwnerSnapshot`)||!a((s=e.__wvOwnerSnapshot)==null?{}:s,u,20,{keys:1e4});if(d){var f;e.__wvOwnerSnapshot=i(u),e[C]=u;let t=e==null||(f=e.__wevu)==null?void 0:f.state;t&&typeof t==`object`&&(t[C]=u)}d&&typeof(e==null?void 0:e.setData)==`function`&&e.setData(W(u)),(d||c||l)&&R(e,o)}function K(e,t,n){if(!t){typeof(e==null?void 0:e.__wvOwnerUnsub)==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerUnsub=void 0,e.__wvOwnerBoundId=``,V(e,void 0);return}let r=(t,r)=>{G(e,t,r,n)};e.__wvOwnerBoundId!==t&&(typeof e.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerBoundId=t,e.__wvOwnerUnsub=d(t,r));let i=l(t);i&&r(i,c(t))}function q(e){var t,n,r,i;return(t=(n=e==null||(r=e.properties)==null?void 0:r[S])==null?e==null||(i=e.properties)==null?void 0:i[x]:n)==null?``:t}function J(e,t){B(e,t);let n=q(e);n&&K(e,n,t)}function Y(){let e={[C]:{},[T]:{}};return Object.defineProperty(e,w,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function X(r){let i=r==null?void 0:r.computed,a=r==null?void 0:r.layoutHosts,o=r==null?void 0:r.templateRefs;o!=null&&o.length&&e(`templateRefs`,`createWevuScopedSlotComponent(templateRefs)`);let c=!!(r!=null&&r.inlineMap&&Object.keys(r.inlineMap).length);c&&e(`inlineEvents`,`createWevuScopedSlotComponent(inlineMap)`),a!=null&&a.length&&e(`layout`,`createWevuScopedSlotComponent(layoutHosts)`);let l=e=>{let t=q(e);return t?u(t):void 0},d={[y]:!0,options:{virtualHost:!0},setData:{omit:k},[_]:k,properties:{[S]:{type:String,value:``,observer(e){K(this,e||``,i)}},[x]:{type:String,value:``,observer(e){K(this,e||``,i)}},[E]:{type:null,value:null,observer(e){B(this,i,{[E]:e})}},[D]:{type:null,value:null,observer(e){B(this,i,{[D]:e})}}},data:Y,lifetimes:{attached(){J(this,i)},ready(){J(this,i),R(this,i,{force:!0});let e=l(this);if(e&&o!=null&&o.length){var n;(n=t.templateRefs)==null||n.schedule(this,void 0,e)}},detached(){let e=l(this);n([()=>{if(e&&o!=null&&o.length){var n;(n=t.templateRefs)==null||n.clear(this,e)}},()=>{typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub()},()=>{this.__wvOwnerUnsub=void 0,this.__wvOwnerBoundId=``},()=>V(this,void 0)])}},methods:{[g](e){var n,r,i,a,o;let l=this[w],u=(n=this.__wevu)==null||(n=n.methods)==null?void 0:n[m];if(c){var d;let n=(d=t.inlineEvents)==null?void 0:d.run(l,void 0,e,u);if(n!==void 0)return n}if(!l)return;let f=(r=(i=e==null||(a=e.currentTarget)==null?void 0:a.dataset)==null?e==null||(o=e.target)==null?void 0:o.dataset:i)==null?{}:r,p=s(f,`wvHandler`,e);if(typeof p!=`string`||!p)return;let h=l==null?void 0:l[p];if(typeof h!=`function`)return;let g=A(e);return h.apply(l,g)}}};return r!=null&&r.computed&&Object.keys(r.computed).length>0&&(d.computed=r.computed),r!=null&&r.inlineMap&&Object.keys(r.inlineMap).length>0&&(d.methods={...d.methods,[m]:r.inlineMap}),o!=null&&o.length&&(d[O]=o),a!=null&&a.length&&(d[h]=a),r!=null&&r[f]&&(d[f]=r[f]),d}export{X as createScopedSlotOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toRaw as e}from"../../reactivity/reactive/shared.mjs";import{isReactive as t}from"../../reactivity/reactive.mjs";import{isRef as n}from"../../reactivity/ref.mjs";import{hasTrackableSetupBinding as r}from"../setupTracking.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 typeof e!=`object`||!e||n(e)||t(e)||Array.isArray(e)?!0:i(e)}function o(n,i,o,
|
|
1
|
+
import{toRaw as e}from"../../reactivity/reactive/shared.mjs";import{isReactive as t}from"../../reactivity/reactive.mjs";import{isRef as n}from"../../reactivity/ref.mjs";import{hasTrackableSetupBinding as r}from"../setupTracking.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 typeof e!=`object`||!e||n(e)||t(e)||Array.isArray(e)?!0:i(e)}function o(e,t){if(!t)return e;for(let n of Object.keys(t)){let r=Object.getOwnPropertyDescriptor(t,n);typeof(r==null?void 0:r.get)==`function`&&typeof r.set==`function`?Object.defineProperty(e,n,r):Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:t[n],writable:!0})}return e}function s(e,t,n){let r=Object.getOwnPropertyDescriptor(t,n);return typeof(r==null?void 0:r.get)!=`function`||typeof r.set!=`function`?!1:(Object.defineProperty(e,n,r),!0)}function c(n,i,o,c){var l,u,d;let f=!!(c!=null&&c.includeFunctionsInState),p=c==null?void 0:c.functionPropPaths,m=(l=n==null?void 0:n.methods)==null?Object.create(null):l,h=(u=n==null?void 0:n.state)==null?Object.create(null):u,g=(d=n==null?void 0:n.setupState)==null?Object.create(null):d,_=t(h)?e(h):h,v=t(g)?e(g):g,y=!1;if(n&&!n.methods)try{n.methods=m}catch(e){}if(n&&!n.state)try{n.state=h}catch(e){}if(n&&!n.setupState)try{n.setupState=g}catch(e){}if(Object.keys(o).forEach(e=>{let t=o[e],c=s(v,o,e);if(typeof t==`function`&&!c){let r=(...e)=>{var r;return t.apply((r=n==null?void 0:n.proxy)==null?n:r,e)};m[e]=r,h[e]=r,(f||p!=null&&p.has(e))&&(g[e]=r),y=!0}else{if(r(t)){var l;n==null||(l=n.__wevu_trackSetupReactiveKey)==null||l.call(n,e)}if(h[e]=t,t===i||!a(t))try{Object.defineProperty(_,e,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){}c||(g[e]=t)}}),n){var b,x;if(n.methods=(b=n.methods)==null?m:b,n.state=(x=n.state)==null?h:x,y){var S;(S=n.__wevu_touchSetupMethodsVersion)==null||S.call(n)}}}export{c as applySetupResult,o as mergeSetupResultDescriptors,s as preserveSetupAccessor,a as shouldExposeInSnapshot};
|
package/dist/runtime/define.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyWevuComponentDefaults as e}from"./defaults.mjs";import{requireRuntimeCapability as t}from"./capabilities.mjs";import{hasOwn as n}from"../utils.mjs";import{hasBindingOutputPath as r,resolveBindingManifest as i}from"./bindingManifest.mjs";import{
|
|
1
|
+
import{applyWevuComponentDefaults as e}from"./defaults.mjs";import{requireRuntimeCapability as t}from"./capabilities.mjs";import{hasOwn as n}from"../utils.mjs";import{hasBindingOutputPath as r,resolveBindingManifest as i}from"./bindingManifest.mjs";import{applySetupResult as a,mergeSetupResultDescriptors as o}from"./define/setupResult.mjs";import{runSetupFunction as s}from"./register/setup.mjs";import{createRuntimeComponentDefinition as c}from"./define/componentDefinition.mjs";import{resolveNativeInitialData as l}from"./define/initialComputed.mjs";import{resolveVueComponentOptions as u}from"./define/options.mjs";import{applyOptionsApiProvide as d,resolveOptionsApiInjections as f}from"./define/optionsApi.mjs";import{normalizeProps as p}from"./define/props.mjs";import{WEVU_BINDING_MANIFEST_KEY as m,WEVU_CSS_MODULES_KEY as h,WEVU_FUNCTION_PROP_PATHS_KEY as g,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as _,WEVU_SLOT_OWNER_ID_KEY as v,WEVU_SLOT_OWNER_ID_PROP as y,WEVU_SLOT_SCOPE_KEY as b}from"@weapp-core/constants";const x=/* @__PURE__ */ new WeakMap;function S(e,t){let r={...t==null?{}:t};if(!e||typeof e!=`object`)return r;for(let[t,i]of Object.entries(e))i&&typeof i==`object`&&n(i,`value`)&&(r[t]=i.value);return r}function C(e,t){var n;return Array.isArray(e==null?void 0:e.pick)&&e.pick.includes(v)||(t==null||(n=t.features)==null?void 0:n.scopedSlots)===!0&&r(t,v)}function w(e){return!!e.__wevu_isPage}function T(e){let t=e.properties;return!!(t&&typeof t==`object`&&(y in t||b in t))}function E(e,t){return(t==null?void 0:t.strategy)!==`patch`||!T(e)?t:{...t,strategy:`diff`}}function D(e,t=!1){let{lifecycleDefinition:n,runtimeApp:r}=c(e,t),i={__wevu_runtime:r,__wevu_options:e};return x.set(i,n),i}function O(e){return k(e,!0)}function k(n,r){let{__typeProps:c,[_]:y,data:b,computed:x,methods:T,setData:O,watch:k,setup:A,props:j,inject:M,provide:N,allowFunctionProps:P,[m]:F,[h]:I,...L}=u(e(n)),R=i(F),z=L[g],B=Array.isArray(z)?[...new Set(z.filter(e=>typeof e==`string`&&e.length>0))]:[];delete L[g];let V=E(L,P===!0?{...O==null?{}:O,includeFunctions:!0,functionPaths:B}:P===!1?O:B.length?{...O==null?{}:O,functionPaths:B}:O),H=new Set(B.filter(e=>!e.includes(`.`))),U=p(L,j,L.properties),W=S(U.properties,T),G=typeof b==`function`?()=>b.call(W):b,K=typeof A==`function`||M!=null||N!=null||I?((e,t)=>{var n,r;I&&typeof I==`object`&&(t.instance[h]=I);let i=(n=(r=t==null?void 0:t.proxy)==null?t==null?void 0:t.instance:r)==null?Object.create(null):n,c=f(M,i);N!=null&&d(N,i);let l=typeof A==`function`?s(A,e,t):void 0,u=o({...c,...I==null?{}:I},l);return t&&Object.keys(u).length&&a(t.runtime,t.instance,u,{includeFunctionsInState:P===!0,functionPropPaths:P===!1?void 0:H}),u}):void 0,q=typeof G==`function`?G():G,J=q&&typeof q==`object`?Reflect.get(q,v):void 0,Y=C(V,R),X=Y?t(`scopedSlots`,`defineComponent(scoped-slot owner metadata)`):void 0,Z=Y?{...q&&typeof q==`object`?q:{},[v]:w(L)?J||(X==null?void 0:X.allocateOwnerId()):J||``}:q,Q=l(Z,x,V,T),$=Q===void 0?U:{...U,data:Q};return D({scopedSlotOwnerRequired:y===!0,data:G,computed:x,methods:T,setData:V,bindingManifest:R,watch:k,setup:K,mpOptions:$},r)}function A(e){return k(e,!1)}function j(e){let t=e.__wevu_options;if(!t)throw TypeError(`无法从非 Wevu 组件定义创建独立运行时`);return D(t)}function M(e){return x.get(e)}function N(e){var t;let n=(t=e.allowNullPropInput)==null||t;O({...e,allowNullPropInput:n,__wevu_allowNullPropInput:n})}export{j as createIsolatedWevuComponentDefinition,N as createWevuComponent,A as createWevuComponentDefinition,O as defineComponent,M as getWevuComponentLifecycleDefinition};
|
package/dist/runtime/diff.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toRaw as e}from"../reactivity/reactive/shared.mjs";import{getReactiveVersion as t,isReactive as n}from"../reactivity/reactive.mjs";import{unref as r}from"../reactivity/ref.mjs";import{isNoSetData as i}from"./noSetData.mjs";import{hasOwn as a}from"../utils.mjs";import{hasTrackableSetupBinding as o}from"./setupTracking.mjs";function s(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function c(e,t){if(!e||!t)return!1;let n=t;for(;n;){if(e.has(n))return!0;let t=n.lastIndexOf(`.`);if(t<0)return!1;n=n.slice(0,t)}return!1}function l(a,s,u,d,f,p,m,h,g,_){let v=r(a);if(typeof v==`bigint`){let e=Number(v);return Number.isSafeInteger(e)?e:v.toString()}if(typeof v==`symbol`)return v.toString();if(typeof v==`function`)return h||c(g,_)?v:void 0;if(typeof v!=`object`||!v)return v;if(i(v))return;let y=n(v),b=y?e(v):v,x=!!d&&y;if(d&&!x){let e=f==null?void 0:f.get(b);x=e==null?!o(b):e,f==null||f.set(b,x)}let S=x?d:void 0;if(p<=0||m.keys<=0)return b;if(S){let e=t(b),n=S.get(b);if(n&&n.version===e)return n.value}if(u.has(b))return;if(s.has(b))return s.get(b);if(b instanceof Date)return b.getTime();if(b instanceof RegExp)return b.toString();if(b instanceof Map){let e=[];return s.set(b,e),u.add(b),b.forEach((t,n)=>{e.push([l(n,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``),l(t,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``)])}),u.delete(b),e}if(b instanceof Set){let e=[];return s.set(b,e),u.add(b),b.forEach(t=>{e.push(l(t,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``))}),u.delete(b),e}if(typeof ArrayBuffer<`u`){if(b instanceof ArrayBuffer)return b.byteLength;if(ArrayBuffer.isView(b)){let e=b;if(typeof e[Symbol.iterator]==`function`){let t=[...e];return s.set(b,t),t.map(e=>l(e,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``))}let t=[...new Uint8Array(e.buffer,e.byteOffset,e.byteLength)];return s.set(b,t),t}}if(b instanceof Error)return{name:b.name,message:b.message};if(Array.isArray(b)){let e=[];s.set(b,e),u.add(b);let n=p-1;for(let t=0;t<b.length;t+=1){let r=_?`${_}.${t}`:String(t),i=l(b[t],s,u,d,f,n,m,h,g,r);e[t]=i===void 0?null:i}return u.delete(b),S&&S.set(b,{version:t(b),value:e}),e}let C={};s.set(b,C),u.add(b);let w=p-1;for(let e of Object.keys(b)){if(--m.keys,m.keys<=0)break;let t=_?`${_}.${e}`:e,n=l(b[e],s,u,d,f,w,m,h,g,t);n!==void 0&&(C[e]=n)}return u.delete(b),S&&S.set(b,{version:t(b),value:C}),C}function u(e,t
|
|
1
|
+
import{toRaw as e}from"../reactivity/reactive/shared.mjs";import{getReactiveVersion as t,isReactive as n}from"../reactivity/reactive.mjs";import{unref as r}from"../reactivity/ref.mjs";import{isNoSetData as i}from"./noSetData.mjs";import{hasOwn as a}from"../utils.mjs";import{hasTrackableSetupBinding as o}from"./setupTracking.mjs";function s(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function c(e,t){if(!e||!t)return!1;let n=t;for(;n;){if(e.has(n))return!0;let t=n.lastIndexOf(`.`);if(t<0)return!1;n=n.slice(0,t)}return!1}function l(a,s,u,d,f,p,m,h,g,_){let v=r(a);if(typeof v==`bigint`){let e=Number(v);return Number.isSafeInteger(e)?e:v.toString()}if(typeof v==`symbol`)return v.toString();if(typeof v==`function`)return h||c(g,_)?v:void 0;if(typeof v!=`object`||!v)return v;if(i(v))return;let y=n(v),b=y?e(v):v,x=!!d&&y;if(d&&!x){let e=f==null?void 0:f.get(b);x=e==null?!o(b):e,f==null||f.set(b,x)}let S=x?d:void 0;if(p<=0||m.keys<=0)return b;if(S){let e=t(b),n=S.get(b);if(n&&n.version===e)return n.value}if(u.has(b))return;if(s.has(b))return s.get(b);if(b instanceof Date)return b.getTime();if(b instanceof RegExp)return b.toString();if(b instanceof Map){let e=[];return s.set(b,e),u.add(b),b.forEach((t,n)=>{e.push([l(n,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``),l(t,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``)])}),u.delete(b),e}if(b instanceof Set){let e=[];return s.set(b,e),u.add(b),b.forEach(t=>{e.push(l(t,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``))}),u.delete(b),e}if(typeof ArrayBuffer<`u`){if(b instanceof ArrayBuffer)return b.byteLength;if(ArrayBuffer.isView(b)){let e=b;if(typeof e[Symbol.iterator]==`function`){let t=[...e];return s.set(b,t),t.map(e=>l(e,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``))}let t=[...new Uint8Array(e.buffer,e.byteOffset,e.byteLength)];return s.set(b,t),t}}if(b instanceof Error)return{name:b.name,message:b.message};if(Array.isArray(b)){let e=[];s.set(b,e),u.add(b);let n=p-1;for(let t=0;t<b.length;t+=1){let r=_?`${_}.${t}`:String(t),i=l(b[t],s,u,d,f,n,m,h,g,r);e[t]=i===void 0?null:i}return u.delete(b),S&&S.set(b,{version:t(b),value:e}),e}let C={};s.set(b,C),u.add(b);let w=p-1;for(let e of Object.keys(b)){if(--m.keys,m.keys<=0)break;let t=_?`${_}.${e}`:e,n=l(b[e],s,u,d,f,w,m,h,g,t);n!==void 0&&(C[e]=n)}return u.delete(b),S&&S.set(b,{version:t(b),value:C}),C}function u(e,t=/* @__PURE__ */ new WeakMap,n){var r,i,a;let o=(r=n==null?void 0:n._depth)==null?typeof(n==null?void 0:n.maxDepth)==`number`?Math.max(0,Math.floor(n.maxDepth)):1/0:r,s=(i=n==null?void 0:n._budget)==null?typeof(n==null?void 0:n.maxKeys)==`number`?{keys:Math.max(0,Math.floor(n.maxKeys))}:{keys:1/0}:i,c=Array.isArray(n==null?void 0:n.functionPaths)&&n.functionPaths.length?new Set(n.functionPaths):void 0;return l(e,t,/* @__PURE__ */ new WeakSet,n==null?void 0:n.cache,n==null?void 0:n.cacheEligibility,o,s,!!(n!=null&&n.includeFunctions),c,(a=n==null?void 0:n._path)==null?``:a)}function d(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function f(e,t,n){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let i of r)if(!a(t,i)||!n(e[i],t[i]))return!1;return!0}function p(e,t){return Object.is(e,t)?!0:Array.isArray(e)&&Array.isArray(t)?d(e,t,p):s(e)&&s(t)?f(e,t,p):!1}function m(e){return e===void 0?null:e}function h(e,t,n,r){if(!p(e,t)){if(s(e)&&s(t)){for(let i of Object.keys(t)){if(!a(e,i)){r[`${n}.${i}`]=m(t[i]);continue}h(e[i],t[i],`${n}.${i}`,r)}for(let i of Object.keys(e))a(t,i)||(r[`${n}.${i}`]=null);return}if(Array.isArray(e)&&Array.isArray(t)){d(e,t,p)||(r[n]=m(t));return}r[n]=m(t)}}function g(e,t,n){let r={},i=n==null?void 0:n.skipKeys;for(let n of Object.keys(t))i!=null&&i.has(n)||h(e[n],t[n],n,r);for(let n of Object.keys(e))i!=null&&i.has(n)||a(t,n)||(r[n]=null);return r}export{g as diffSnapshots,u as toPlain};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentInstance as e}from"./hooks/base.mjs";import{onDetached as t,onUnload as n}from"./hooks/register.mjs";const r=[`dispose`,`abort`,`cancel`,`stop`,`disconnect`,`destroy`,`close`];function i(e){if(e){if(typeof e==`function`)return e;for(let t of r){let n=e[t];if(typeof n==`function`)return()=>n.call(e)}}}function a(){if(!e())throw Error(`useDisposables() 必须在 setup() 的同步阶段调用`);let r
|
|
1
|
+
import{getCurrentInstance as e}from"./hooks/base.mjs";import{onDetached as t,onUnload as n}from"./hooks/register.mjs";const r=[`dispose`,`abort`,`cancel`,`stop`,`disconnect`,`destroy`,`close`];function i(e){if(e){if(typeof e==`function`)return e;for(let t of r){let n=e[t];if(typeof n==`function`)return()=>n.call(e)}}}function a(){if(!e())throw Error(`useDisposables() 必须在 setup() 的同步阶段调用`);let r=/* @__PURE__ */ new Set,a=!1,o=e=>{let t=i(e);if(!t)return()=>{};if(a){try{t()}catch(e){}return()=>{}}return r.add(t),()=>{r.delete(t)}},s=()=>{if(a)return;a=!0;let e=[...r];r.clear();for(let t of e)try{t()}catch(e){}};return n(s),t(s),{add:o,dispose:s,setTimeout:(e,t,...n)=>{let r=setTimeout(e,t,...n);return o(()=>{clearTimeout(r)}),r},setInterval:(e,t,...n)=>{let r=setInterval(e,t,...n);return o(()=>{clearInterval(r)}),r}}}export{a as useDisposables};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{addMutationRecorder as e,removeMutationRecorder as t}from"../../reactivity/reactive/mutation.mjs";import{toRaw as n}from"../../reactivity/reactive/shared.mjs";import{clearPatchIndices as r,prelinkReactiveTree as i}from"../../reactivity/reactive/patch.mjs";import{registerRuntimeCapability as a}from"../capabilities.mjs";import{createSetDataScheduler as o}from"../app/setData/scheduler.mjs";import{preparePatchUpdate as s}from"../app/setData/patchScheduler.mjs";function c(a){let c=o(a),l=n(a.state),u
|
|
1
|
+
import{addMutationRecorder as e,removeMutationRecorder as t}from"../../reactivity/reactive/mutation.mjs";import{toRaw as n}from"../../reactivity/reactive/shared.mjs";import{clearPatchIndices as r,prelinkReactiveTree as i}from"../../reactivity/reactive/patch.mjs";import{registerRuntimeCapability as a}from"../capabilities.mjs";import{createSetDataScheduler as o}from"../app/setData/scheduler.mjs";import{preparePatchUpdate as s}from"../app/setData/patchScheduler.mjs";function c(a){let c=o(a),l=n(a.state),u=/* @__PURE__ */ new Map,d=/* @__PURE__ */ new Set,f=Object.create(null),p=!0,m=!1,h=!1,g=e=>{if(a.includeComputed){for(let e of Object.keys(f))delete f[e];for(let t of Object.keys(a.computedRefs))c.shouldIncludeSnapshotKey(t)&&(f[t]=e[t]);a.dirtyComputedKeys.clear()}},_=(e=`diff`)=>{let t=u.size+d.size;u.clear(),d.clear(),p=!1,c.runDiffUpdate(e,t,g)},v=e=>{if(!a.isMounted())return;if(e.root!==l){let t=c.resolveTopKeysByRoot(e.root);for(let e of t)d.add(e);return}if(!e.path){if(Array.isArray(e.fallbackTopKeys)&&e.fallbackTopKeys.length)for(let t of e.fallbackTopKeys)d.add(t);else p=!0;return}let t=e.path.split(`.`,1)[0];c.shouldIncludeSnapshotKey(t)&&u.set(e.path,{kind:e.kind,op:e.op})};return{job(){if(!c.prepareJob(u.size+d.size,()=>[...u.keys(),...d,...a.includeComputed?a.dirtyComputedKeys:[]]))return;if(p||c.needsFullSnapshot())return _(`needsFullSnapshot`);if(!(u.size>0||d.size>0||a.includeComputed&&a.dirtyComputedKeys.size>0))return _(`diff`);let e=s({state:a.state,computedRefs:a.computedRefs,dirtyComputedKeys:a.dirtyComputedKeys,includeComputed:a.includeComputed,computedCompare:a.computedCompare,computedCompareMaxDepth:a.computedCompareMaxDepth,computedCompareMaxKeys:a.computedCompareMaxKeys,shouldIncludeKey:c.shouldIncludeSnapshotKey,maxPatchKeys:a.maxPatchKeys,maxPayloadBytes:a.maxPayloadBytes,mergeSiblingThreshold:a.mergeSiblingThreshold,mergeSiblingMaxInflationRatio:a.mergeSiblingMaxInflationRatio,mergeSiblingMaxParentBytes:a.mergeSiblingMaxParentBytes,mergeSiblingSkipArray:a.mergeSiblingSkipArray,elevateTopKeyThreshold:a.elevateTopKeyThreshold,toPlainMaxDepth:a.toPlainMaxDepth,toPlainMaxKeys:a.toPlainMaxKeys,includeFunctions:a.includeFunctions,functionPaths:a.functionPaths,plainCache:c.plainCache,plainCacheEligibility:c.plainCacheEligibility,pendingPatches:u,fallbackTopKeys:d,dispatchedSnapshot:c.getLatestSnapshot(),dispatchedComputedSnapshot:f});if(e){if(c.emitDebug(e.debug,e.type===`patch`?Object.keys(e.payload):void 0),e.type===`fallback`)return _(e.reason);e.computedUpdates&&Object.assign(f,e.computedUpdates),c.dispatchUpdate({mode:`patch`,kind:`delta`,reason:`patch`,snapshot:e.snapshot,payload:e.payload,pendingPatchKeys:e.debug.pendingPatchKeys})}},snapshot:c.snapshot,cloneLatestSnapshot:c.cloneLatestSnapshot,start(){m||h||(m=!0,i(a.state,{shouldIncludeTopKey:a.shouldIncludeKey,maxDepth:a.prelinkMaxDepth,maxKeys:a.prelinkMaxKeys}),e(v))},dispose(){h||(h=!0,c.dispose(),m&&t(v),r(a.state))}}}const l={createScheduler:c};function u(){a(`patchStrategy`,l)}export{u as installPatchStrategy};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentMiniProgramRuntimeCapabilities as e,getMiniProgramGlobalObject as t,supportsCurrentMiniProgramRuntimeCapability as n}from"../platform.mjs";import{WEVU_HOOKS_KEY as r}from"@weapp-core/constants";
|
|
1
|
+
import{getCurrentMiniProgramRuntimeCapabilities as e,getMiniProgramGlobalObject as t,supportsCurrentMiniProgramRuntimeCapability as n}from"../platform.mjs";import{WEVU_HOOKS_KEY as r}from"@weapp-core/constants";const i=(()=>{var e;let t=globalThis;return(e=t.__wevuCurrentSetupState__)==null?t.__wevuCurrentSetupState__={}:e})();function a(){return i.instance}function o(e){i.instance=e}function s(){return i.context}function c(e){i.context=e}function l(e){if(!i.instance)throw Error(`${e}() 必须在 setup() 的同步阶段调用`);return i.instance}function u(e){return e[r]||(e[r]=Object.create(null)),e[r]}function d(t,n){let r=e().shareTimelineRequiresShareAppMessage?t||n:t,i=[];return r&&i.push(`shareAppMessage`),n&&i.push(`shareTimeline`),i}function f(e,t){let n=[{withShareTicket:!0,menus:t},{menus:t},t.includes(`shareTimeline`)?{withShareTicket:!0}:void 0,t.includes(`shareTimeline`)?{}:void 0,void 0];for(let t of n)try{t===void 0?e():e(t);return}catch(e){}}function p(e,t,n,{single:r=!1}={}){let i=u(e);if(r)i[t]=n;else{var a;((a=i[t])==null?i[t]=[]:a).push(n)}}function m(e,t){var n,i;let a=(i=(n=e).__wevuShareHookBridges)==null?n.__wevuShareHookBridges=Object.create(null):i;if(typeof a[t]==`function`)return;let o=e[t],s=function(...e){var n;let i=this[r],a=i==null?void 0:i[t],s=this.__wevu,c=(n=s==null?void 0:s.proxy)==null?this:n,l;if(typeof a==`function`)try{l=a.apply(c,e)}catch(e){l=void 0}else if(Array.isArray(a))for(let t of a)try{l=t.apply(c,e)}catch(e){}if(l!==void 0)return l;if(typeof o==`function`)return o.apply(this,e)};a[t]=s,e[t]=s}function h(e){var i;if(!n(`pageShareMenu`))return;let a=t();if(!a||typeof a.showShareMenu!=`function`)return;let o=(i=e[r])==null?{}:i,s=typeof o.onShareAppMessage==`function`,c=typeof o.onShareTimeline==`function`;if(!s&&!c)return;let l=d(s,c);l.length&&f(a.showShareMenu.bind(a),l)}function g(e,t,n=[]){var i;let a=e[r];if(!a)return;let o=a[t];if(!o)return;let s=e.__wevu,c=(i=s==null?void 0:s.proxy)==null?e:i;if(Array.isArray(o))for(let e of o)try{e.apply(c,n)}catch(e){}else if(typeof o==`function`)try{o.apply(c,n)}catch(e){}}function _(e,t){var n,r;let i=(r=(n=e).__wevuPageHookBridges)==null?n.__wevuPageHookBridges=Object.create(null):r;if(typeof i[t]==`function`)return;let a=e[t],o=function(...e){if(g(this,t,e),typeof a==`function`)return a.apply(this,e)};i[t]=o,e[t]=o}function v(e,t,n=[]){var i;let a=e[r];if(!a)return;let o=a[t];if(!o)return;let s=e.__wevu,c=(i=s==null?void 0:s.proxy)==null?e:i;if(typeof o==`function`)try{return o.apply(c,n)}catch(e){return}if(Array.isArray(o)){let e;for(let t of o)try{e=t.apply(c,n)}catch(e){}return e}}export{l as assertInSetup,g as callHookList,v as callHookReturn,_ as ensurePageHookOnInstance,h as ensurePageShareMenusOnSetup,m as ensureSinglePageHookOnInstance,a as getCurrentInstance,s as getCurrentSetupContext,p as pushHook,o as setCurrentInstance,c as setCurrentSetupContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isRef as e}from"../reactivity/ref.mjs";import{getCurrentMiniProgramPages as t}from"./platform.mjs";import{getCurrentInstance as n,getCurrentSetupContext as r}from"./hooks/base.mjs";import{onAttached as i,onDetached as a}from"./hooks/register.mjs";import{getTemplateRefMap as o}from"./templateRefs/helpers.mjs";import{WEVU_LAYOUT_BRIDGE_PAGE_KEYS as s,WEVU_NATIVE_INSTANCE_KEY as c,WEVU_PUBLIC_RUNTIME_KEY as l}from"@weapp-core/constants";function u(e){return Array.from(new Set(Array.isArray(e)?e:[e])).filter(e=>typeof e==`string`&&e.length>0)}function d(e){if(!e||typeof e!=`object`)return[];let t=[],n=typeof e.route==`string`?e.route.replace(/^\/+/,``):``;n&&t.push(`route:${n}`);for(let[n,r]of[[`webview`,`__wxWebviewId__`],[`exparser`,`__wxExparserNodeId__`]]){let i=e[r];(typeof i==`number`||typeof i==`string`)&&t.push(`${n}:${String(i)}`)}return Array.from(new Set(t))}function f(){let e
|
|
1
|
+
import{isRef as e}from"../reactivity/ref.mjs";import{getCurrentMiniProgramPages as t}from"./platform.mjs";import{getCurrentInstance as n,getCurrentSetupContext as r}from"./hooks/base.mjs";import{onAttached as i,onDetached as a}from"./hooks/register.mjs";import{getTemplateRefMap as o}from"./templateRefs/helpers.mjs";import{WEVU_LAYOUT_BRIDGE_PAGE_KEYS as s,WEVU_NATIVE_INSTANCE_KEY as c,WEVU_PUBLIC_RUNTIME_KEY as l}from"@weapp-core/constants";function u(e){return Array.from(new Set(Array.isArray(e)?e:[e])).filter(e=>typeof e==`string`&&e.length>0)}function d(e){if(!e||typeof e!=`object`)return[];let t=[],n=typeof e.route==`string`?e.route.replace(/^\/+/,``):``;n&&t.push(`route:${n}`);for(let[n,r]of[[`webview`,`__wxWebviewId__`],[`exparser`,`__wxExparserNodeId__`]]){let i=e[r];(typeof i==`number`||typeof i==`string`)&&t.push(`${n}:${String(i)}`)}return Array.from(new Set(t))}function f(){let e=/* @__PURE__ */ new Map;function t(t,n,r){let i=u(t);if(i.length===0||r.length===0)return null;for(let t of r){var a;let r=(a=e.get(t))==null?/* @__PURE__ */ new Map:a;for(let e of i)r.set(e,n);e.set(t,r)}return i}function n(t,n,r){let i=u(t);if(i.length===0||r.length===0)return!1;let a=!1;for(let t of r){let r=e.get(t);if(r){for(let e of i)r.get(e)===n&&(r.delete(e),a=!0);r.size===0&&e.delete(t)}}return a}function r(t,n){return n.map(n=>{var r;return(r=e.get(n))==null?void 0:r.get(t)}).find(Boolean)}function i(e,t,n){var i;let a=r(e,t);return a?(i=n(a,e))==null?null:i:null}function a(e,t,n,r={}){var o,s;let c=(o=r.retries)==null?20:o,l=(s=r.interval)==null?16:s,u=i(e,t(),n);return u||c<=0?Promise.resolve(u):new Promise(i=>{setTimeout(()=>{i(a(e,t,n,{...r,retries:c-1}))},l)})}return{register:t,resolveBridge:r,resolveHost:i,unregister:n,waitForHost:a}}const p=f();function m(){let e=t();return e[e.length-1]}function h(e){return d(e)}function g(e){var t,n;if(!e||typeof e!=`object`)return;let r=(t=e[l])==null||(t=t.state)==null?void 0:t[c];if(r&&typeof r==`object`)return r;let i=(n=e.$state)==null?void 0:n[c];return i&&typeof i==`object`?i:e[c]&&typeof e[c]==`object`?e[c]:e}function _(e,t=/* @__PURE__ */ new Set){if(!e||typeof e!=`object`||t.has(e))return m();if(t.add(e),typeof e.__wevuSetPageLayout==`function`)return e;let n=g(e);if(n&&n!==e){let e=_(n,t);if(e)return e}let r=e.$;if(r&&typeof r==`object`){let e=_(r,t);if(e)return e}let i=n==null?e:n,a=i.selectOwnerComponent;if(typeof a==`function`)try{let e=a.call(i);if(e&&e!==i){let n=_(e,t);if(n)return n}}catch(e){}return m()}function v(t){return typeof t==`function`?t():e(t)?t.value:t}function y(e,t){return e.find(e=>e.key===t)}function b(e,t){let n=e==null?void 0:e.selectComponent;if(typeof n!=`function`)return null;try{var r;return(r=n.call(e,t))==null?null:r}catch(e){return null}}function x(e,t){var n,r,i,a,s,c,u,d;if(!e.refName)return null;let f=o(t),p=(n=(r=(i=(a=t[l])==null||(a=a.state)==null?void 0:a.$refs)==null?(s=t.__wevu)==null||(s=s.state)==null?void 0:s.$refs:i)==null?(c=t.$state)==null?void 0:c.$refs:r)==null?t.$refs:n,m=(u=f==null||(d=f.get(e.refName))==null?void 0:d.value)==null?p==null?void 0:p[e.refName]:u;if(Array.isArray(m)){var h;return(h=m[0])==null?null:h}return m==null?null:m}function S(e,t){let n=g(t),r=n&&typeof n==`object`?Object.create(n):{};return Object.assign(r,{selectComponent(r){let i=y(e,r);if(!i)return null;if(i.kind===`component`||!i.kind){var a,o;return x(i,t)||((a=(o=b(n,i.selector))==null?b(m(),i.selector):o)==null?null:a)}return null}})}function C(e,t){let r=t==null?n():t,i=_(r),a=h(i);return!r||!i||a.length===0||!p.register(e,r,a)?!1:(r[s]=a,!0)}function w(e,t){var r;let i=t==null?n():t,a=_(i),o=(r=i==null?void 0:i[s])==null?h(a):r;if(!i||!Array.isArray(o)||o.length===0)return!1;let c=p.unregister(e,i,o);return delete i[s],c}function T(e,t){var r,i;let a=(r=m())==null?_(t):r,o=p.resolveBridge(e,h(a));return(i=o==null?t:o)==null?n():i}function E(e,t={}){var n,r;let i=(n=t.context)==null?t.fallbackContext:n,a=(r=m())==null?_(i):r;return p.resolveHost(e,h(a),(e,t)=>{var n;return(n=e.selectComponent)==null?void 0:n.call(e,t)})}function D(e,t={}){var n;let r=(n=t.context)==null?t.fallbackContext:n;return p.waitForHost(e,()=>{var e;return h((e=m())==null?_(r):e)},(e,t)=>{var n;return(n=e.selectComponent)==null?void 0:n.call(e,t)},t)}function O(e,t={}){if(!r())throw Error(`useLayoutBridge() 必须在 setup() 的同步阶段调用`);let o=n(),s=u(e),c=t.resolveComponent,l=g(o),d=l&&typeof l==`object`?Object.create(l):{},f=Object.assign(d,{selectComponent(e){var t,n,r;if(!s.includes(e))return null;let i=c==null?void 0:c(e);if(i!==void 0)return i;let a=g(o),l=a==null||(t=a.selectComponent)==null?void 0:t.call(a,e);if(l)return l;let u=m();return(n=u==null||(r=u.selectComponent)==null?void 0:r.call(u,e))==null?null:n}});C(s,f),i(()=>{C(s,f)}),a(()=>{w(s,f)})}function k(e,t){if(!e.length)return null;let r=t==null?n():t;if(!r)return null;let i=S(e,r);return C(e.map(e=>e.key),i),i}function A(e,t){if(!e.length)return!1;let r=t==null?n():t;return r?w(e.map(e=>e.key),r):!1}function j(e){O(Object.keys(e),{resolveComponent(t){return v(e[t])}})}export{C as registerPageLayoutBridge,k as registerRuntimeLayoutHosts,T as resolveLayoutBridge,E as resolveLayoutHost,w as unregisterPageLayoutBridge,A as unregisterRuntimeLayoutHosts,O as useLayoutBridge,j as useLayoutHosts,D as waitForLayoutHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getMiniProgramPlatformByRuntimeGlobalKey as e,getMiniProgramRuntimeCapabilities as t,getMiniProgramRuntimeGlobalKey as n,getMiniProgramRuntimeGlobalKeys as r,getMiniProgramRuntimeHostConfigKey as i,resolveMiniProgramPlatform as a,supportsMiniProgramRuntimeCapability as o}from"@weapp-core/shared/platforms";const s=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`];function c(){if(
|
|
1
|
+
import{getMiniProgramPlatformByRuntimeGlobalKey as e,getMiniProgramRuntimeCapabilities as t,getMiniProgramRuntimeGlobalKey as n,getMiniProgramRuntimeGlobalKeys as r,getMiniProgramRuntimeHostConfigKey as i,resolveMiniProgramPlatform as a,supportsMiniProgramRuntimeCapability as o}from"@weapp-core/shared/platforms";const s=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`];function c(){if(typeof globalThis<`u`)return globalThis}function l(){if(typeof my<`u`)return my}function u(){var t;let n=c(),i=(t=import.meta.env)==null?void 0:t.PLATFORM,o=a(i);if(o)return o;for(let t of r())if(n!=null&&n[t])return e(t)}function d(){return t(u())}function f(e){return o(u(),e)}function p(){var e,t,r,i;if(!f(`globalPageStack`))return[];let a=c(),o=u(),s=o?n(o):void 0,d=(e=(t=s?a==null||(r=a[s])==null?void 0:r.getCurrentPages:void 0)==null?(i=l())==null?void 0:i.getCurrentPages:t)==null?a==null?void 0:a.getCurrentPages:e;if(typeof d!=`function`)return[];try{let e=d();return Array.isArray(e)?e:[]}catch(e){return[]}}function m(){let e=c(),t=i(u()),n=e==null?void 0:e[t];return n&&typeof n==`object`?n:void 0}function h(e){var t;let i=c(),o=e==null?(t=import.meta.env)==null?void 0:t.PLATFORM:e,s=a(o);if(s){var u;let e=n(s);return(u=i==null?void 0:i[e])==null?s===`alipay`?l():void 0:u}for(let e of r()){let t=i==null?void 0:i[e];if(t)return t}}function g(){var e;return(e=h())==null?c():e}function _(){var e;return(e=g())==null||(e=e.console)==null?void 0:e.warn}function v(){if(!f(`globalRouterApi`))return;let e=h();if(!e)return;let t=Object.create(null);for(let n of s){let r=e[n];if(typeof r!=`function`)return;t[n]=(...t)=>r.apply(e,t)}return t}function y(){let e=m(),t=e==null?void 0:e.tabBar;if(!t||typeof t!=`object`||!(`list`in t)||!Array.isArray(t.list))return[];let n=[];for(let e of t.list){if(!e||typeof e!=`object`||!(`pagePath`in e))continue;let t=e.pagePath;typeof t==`string`&&t&&n.push(t.replace(/\.html$/,``))}return n}function b(){var e;return(e=h())==null?c():e}export{v as getCurrentMiniProgramGlobalRouter,m as getCurrentMiniProgramHostConfig,p as getCurrentMiniProgramPages,d as getCurrentMiniProgramRuntimeCapabilities,y as getCurrentMiniProgramTabBarPagePaths,h as getMiniProgramGlobalObject,_ as getMiniProgramRuntimeConsoleWarn,g as getMiniProgramRuntimeGlobalObject,b as getScopedSlotHostGlobalObject,u as resolveCurrentMiniProgramPlatform,f as supportsCurrentMiniProgramRuntimeCapability};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e
|
|
1
|
+
const e=/* @__PURE__ */ new Map;function t(t,n){e.set(t,n)}function n(t){return e.has(t)}function r(t){return e.get(t)}export{r as getGlobalProvidedValue,n as hasGlobalProvidedValue,t as setGlobalProvidedValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasOwn as e}from"../../../utils.mjs";import{WEVU_COMPONENT_NAME_KEY as t,WEVU_PROPS_ALIASES_KEY as n,WEVU_PROPS_DERIVED_KEYS_KEY as r}from"@weapp-core/constants";function i(e,t
|
|
1
|
+
import{hasOwn as e}from"../../../utils.mjs";import{WEVU_COMPONENT_NAME_KEY as t,WEVU_PROPS_ALIASES_KEY as n,WEVU_PROPS_DERIVED_KEYS_KEY as r}from"@weapp-core/constants";function i(e,t=/* @__PURE__ */ 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(i(r,t));return n}let n={};t.set(e,n);for(let[r,a]of Object.entries(e))n[r]=i(a,t);return n}function a(e){let t=e.route;if(typeof t==`string`&&t)return t;let n=e.is;return typeof n==`string`&&n?n:`unknown`}function o(a){var o;let{methods:s={},lifetimes:c={},pageLifetimes:l={},options:u={},...d}=a,f=d.onLoad,p=d.onUnload,m=d.onShow,h=d.onHide,g=d.onReady,_=d.onSaveExitState,v=d.onPullDownRefresh,y=d.onReachBottom,b=d.onPageScroll,x=d.onRouteDone,S=d.onTabItemTap,C=d.onResize,w=d.onShareAppMessage,T=d.onShareTimeline,E=d.onAddToFavorites,D=(o=d.features)==null?{}:o,O=[f,p,m,h,g,_,v,y,b,x,S,C,w,T,E].some(e=>typeof e==`function`),k=e(d,`__wevu_isPage`)?d.__wevu_isPage===!0:Object.keys(D==null?{}:D).length>0||O,A={...d},j=/* @__PURE__ */ new Set([`data`,`behaviors`,`relations`,`externalClasses`,`options`,`properties`,`observers`,`pureDataPattern`,`virtualHost`,`definitionFilter`,`export`,`__wevuTemplateRefs`,`__wevuLayoutHosts`,n,r,`setupLifecycle`,`features`,`__wevu_isPage`]),M=[];for(let[e,t]of Object.entries(A))j.has(e)||typeof t!=`function`&&(M.push([e,t]),delete A[e]);let N=n=>{let r=a.name;typeof r==`string`&&r&&Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value:r});for(let[t,r]of M)if(!e(n,t))try{n[t]=i(r)}catch(e){}},P=/* @__PURE__ */ new Set(/* @__PURE__ */ `data.export.definitionFilter.onLoad.onUnload.onShow.onHide.onReady.onSaveExitState.onPullDownRefresh.onReachBottom.onPageScroll.onRouteDone.onTabItemTap.onResize.onShareAppMessage.onShareTimeline.onAddToFavorites.beforeCreate.created.beforeMount.mounted.beforeUnmount.beforeDestroy.unmounted.destroyed`.split(`.`)),F={};for(let[e,t]of Object.entries(A))typeof t!=`function`||P.has(e)||(F[e]=t,delete A[e]);let I=A.__wevuTemplateRefs;delete A.__wevuTemplateRefs;let L=A.__wevuLayoutHosts;delete A.__wevuLayoutHosts;let R=A[n];delete A[n];let z=A[r];delete A[r];let B=A.observers,V=A.setupLifecycle===`created`?`created`:`attached`;delete A.setupLifecycle;let H={};for(let e of[`beforeCreate`,`created`,`beforeMount`,`mounted`,`beforeUnmount`,`beforeDestroy`,`unmounted`,`destroyed`])H[e]=A[e];delete A.features;for(let e of Object.keys(H))delete A[e];return delete A.onLoad,delete A.onUnload,delete A.onShow,delete A.onHide,delete A.onReady,{userMethods:s,userLifetimes:c,userPageLifetimes:l,userOptions:u,restOptions:A,topLevelMethods:F,templateRefs:I,layoutHosts:L,propsAliases:R,propsDerivedKeys:z,userObservers:B,setupLifecycle:V,vueLifecycles:H,isPage:k,features:D,userOnLoad:f,userOnUnload:p,userOnShow:m,userOnHide:h,userOnReady:g,userOnSaveExitState:_,userOnPullDownRefresh:v,userOnReachBottom:y,userOnPageScroll:b,userOnRouteDone:x,userOnTabItemTap:S,userOnResize:C,userOnShareAppMessage:w,userOnShareTimeline:T,userOnAddToFavorites:E,applyExtraInstanceFields:N}}export{a as getRuntimeOwnerLabel,o as prepareComponentOptions};
|
|
@@ -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
|
|
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=/* @__PURE__ */ new Set([c,l,u]),x=g.filter(e=>!b.has(e)),S=/* @__PURE__ */ 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?/* @__PURE__ */ 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{requireRuntimeCapability as n,runtimeCapabilityRegistry as r}from"../../capabilities.mjs";import{runTeardownSteps as i}from"../../teardown.mjs";import{enableDeferredSetData as a,mountRuntimeInstance as o,refreshRuntimeInstance as s,setRuntimeSetDataVisibility as c,teardownRuntimeInstance as l}from"../runtimeInstance.mjs";import{ensureInitialNavigation as u}from"../../../router/initialNavigation.mjs";import{registerNativeComponentDefinition as d}from"./registerNativeDefinition.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as f,WEVU_PUBLIC_RUNTIME_KEY as p,WEVU_READY_CALLED_KEY as m,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as
|
|
1
|
+
import{getMiniProgramRuntimeGlobalObject as e}from"../../platform.mjs";import{callHookList as t}from"../../hooks/base.mjs";import{requireRuntimeCapability as n,runtimeCapabilityRegistry as r}from"../../capabilities.mjs";import{runTeardownSteps as i}from"../../teardown.mjs";import{enableDeferredSetData as a,mountRuntimeInstance as o,refreshRuntimeInstance as s,setRuntimeSetDataVisibility as c,teardownRuntimeInstance as l}from"../runtimeInstance.mjs";import{ensureInitialNavigation as u}from"../../../router/initialNavigation.mjs";import{registerNativeComponentDefinition as d}from"./registerNativeDefinition.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as f,WEVU_PUBLIC_RUNTIME_KEY as p,WEVU_READY_CALLED_KEY as m,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as ee,WEVU_RUNTIME_KEY as te}from"@weapp-core/constants";function h(h){var g;let{runtimeApp:_,watch:v,setup:y,restOptions:b,pageLifecycleHooks:x,finalObservers:S,userLifetimes:C,userPageLifetimes:w,finalMethods:T,finalOptions:E,applyExtraInstanceFields:D,templateRefs:O,layoutHosts:k,attachWevuPropKeys:A,setupLifecycle:j,syncWevuPropsFromInstance:M,directPropsDerivedKeys:N,isPage:P,vueLifecycles:F,getRuntimeOwnerLabel:I,registerNative:L=!0}=h,R=Array.isArray(O)&&O.length>0?O:void 0,z=/* @__PURE__ */ new WeakSet;R&&n(`templateRefs`,`registerComponentDefinition(template refs)`);let B=Array.isArray(k)&&k.length>0?k:void 0,V=B?n(`layout`,`registerComponentDefinition(layout hosts)`):void 0,H=(e,t)=>{if(R){var n;(n=r.templateRefs)==null||n.schedule(e,t);return}t==null||t()},U=e=>{var t;let n=(t=e.__wevu)==null?e[p]:t;if(n)return n;let r=e.$state;if(r&&typeof r==`object`)return r[te]},W=e=>{var t,n,i;return((t=U(e))==null?void 0:t.proxy)||((n=(i=r.scopedSlots)==null?void 0:i.resolveLifecycleProxy(e))==null?e:n)},G=e=>{let t=U(e);return t?{runtime:t,mounted:!1}:(D(e),A(e),o(e,_,v,y,{deferSetData:!0,snapshotOmitKeys:N}),M(e),a(e),{runtime:U(e),mounted:!0})},K=(e,t,n)=>{let r=F[t];if(typeof r==`function`)return r.apply(W(e),n)},q=(e,t)=>{if(!P){t();return}u(e,void 0,{start:!1,onComplete:e=>{e&&t()}})||t()},J=e=>{U(e)||typeof F.mounted!=`function`||G(e).mounted&&(K(e,`created`,[]),K(e,`beforeMount`,[]))},Y={},X=e=>{B&&(V==null||V.attachHosts(B,e))},Z=e=>{P&&V&&(V==null||V.attachPageSetter(e))};if(P)for(let e of[`onPullDownRefresh`,`onReachBottom`,`onShareAppMessage`,`onShareTimeline`,`onAddToFavorites`]){let t=x[e];typeof t==`function`&&typeof T[e]!=`function`&&(Y[e]=function(...e){return t.apply(this,e)})}let Q={...b,...P?x:{},observers:S,lifetimes:{...C,created:function(...e){if(z.add(this),D(this),A(this),R){var t;(t=r.templateRefs)==null||t.attachBindings(this,R)}q(this,()=>{if(K(this,`beforeCreate`,e),j===`created`){try{o(this,_,v,y,{deferSetData:!0,snapshotOmitKeys:N})}catch(e){let t=I(this);throw Error(`[wevu] mount runtime failed in created (${t}): ${e instanceof Error?e.message:String(e)}`)}M(this),Z(this)}typeof C.created==`function`&&C.created.apply(this,e)})},moved:function(...e){t(this,`onMoved`,e),typeof C.moved==`function`&&C.moved.apply(this,e)},attached:function(...e){var n;if(z.delete(this),D(this),A(this),R&&!((n=r.templateRefs)!=null&&n.hasBindings(this))){var i;(i=r.templateRefs)==null||i.attachBindings(this,R)}q(this,()=>{if(j!==`created`||!this.__wevu)try{o(this,_,v,y,{deferSetData:!0,snapshotOmitKeys:N})}catch(e){let t=I(this);throw Error(`[wevu] mount runtime failed in attached (${t}): ${e instanceof Error?e.message:String(e)}`)}M(this),K(this,`created`,e),K(this,`beforeMount`,e),Z(this),X(this),a(this),t(this,`onAttached`,e),typeof C.attached==`function`&&C.attached.apply(this,e)})},ready:function(...e){if(z.has(this)){var n;return(n=C.ready)==null?void 0:n.apply(this,e)}if(!P||this[m]||!u(this,void 0,{start:!0,onComplete:t=>{t&&!this.__wevuInitialNavigationReady&&(this.__wevuInitialNavigationReady=!0,Q.lifetimes.ready.call(this,...e))}})||this.__wevuInitialNavigationReady){if(J(this),P&&typeof x.onReady==`function`){let t=!!this[m];if(x.onReady.call(this,...e),!t){let t=()=>K(this,`mounted`,e);u(this,void 0,{start:!1,onComplete:e=>{e&&t()}})||t()}typeof C.ready==`function`&&C.ready.apply(this,e);return}if(!this[m]){var i;this[m]=!0,M(this),(i=r.templateRefs)==null||i.scheduleOwner(this),H(this,()=>{t(this,`onReady`,e),K(this,`mounted`,e),typeof C.ready==`function`&&C.ready.apply(this,e)});return}typeof C.ready==`function`&&C.ready.apply(this,e)}},detached:function(...e){if(P&&typeof x.onUnload==`function`){i([()=>K(this,`beforeUnmount`,e),()=>K(this,`beforeDestroy`,e),()=>{var e;return(e=r.templateRefs)==null?void 0:e.scheduleOwner(this)},()=>t(this,`onDetached`,e),()=>x.onUnload.call(this,...e),()=>{typeof C.detached==`function`&&C.detached.apply(this,e)},()=>K(this,`unmounted`,e),()=>K(this,`destroyed`,e)]);return}i([()=>K(this,`beforeUnmount`,e),()=>K(this,`beforeDestroy`,e),()=>{var e;return(e=r.templateRefs)==null?void 0:e.scheduleOwner(this)},()=>t(this,`onDetached`,e),()=>{B&&(V==null||V.detachHosts(B,this))},()=>l(this),()=>K(this,`unmounted`,e),()=>K(this,`destroyed`,e),()=>{typeof C.detached==`function`&&C.detached.apply(this,e)}])},error:function(...e){t(this,`onError`,e),typeof C.error==`function`&&C.error.apply(this,e)}},pageLifetimes:{...w,show:function(...e){if(P&&typeof x.onShow==`function`){x.onShow.call(this,...e),typeof w.show==`function`&&w.show.apply(this,e);return}c(this,!0),t(this,`onShow`,e),typeof w.show==`function`&&w.show.apply(this,e)},hide:function(...e){if(P&&typeof x.onHide==`function`){x.onHide.call(this,...e),typeof w.hide==`function`&&w.hide.apply(this,e);return}c(this,!1),t(this,`onHide`,e),typeof w.hide==`function`&&w.hide.apply(this,e)},resize:function(...e){if(P&&typeof x.onResize==`function`){x.onResize.call(this,...e),typeof w.resize==`function`&&w.resize.apply(this,e);return}t(this,`onResize`,e),typeof w.resize==`function`&&w.resize.apply(this,e)},routeDone:function(...e){if(P&&typeof x.onRouteDone==`function`){x.onRouteDone.call(this,...e),typeof w.routeDone==`function`&&w.routeDone.apply(this,e);return}t(this,`onRouteDone`,e),typeof w.routeDone==`function`&&w.routeDone.apply(this,e)}},methods:{...Y,...T,[ee]:function(){var e;let t=G(this);return t.mounted&&(K(this,`created`,[]),K(this,`beforeMount`,[])),(e=t.runtime)==null?void 0:e.proxy}},options:E};if(!L)return Q;let $=(g=e())==null?void 0:g[f];if(typeof($==null?void 0:$.trackWevuComponent)==`function`){let e=$.trackWevuComponent(Q,(e,t)=>{s(e,_,v,y,{snapshotOmitKeys:N,stateSnapshot:t}),M(e),Z(e),X(e),a(e,{rehydrateSetupState:!0})});return $.isApplying()||d(e,P),e}return d(Q,P),Q}export{h as registerComponentDefinition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{effectScope as e}from"../../../reactivity/core.mjs";import{toRaw as t}from"../../../reactivity/reactive/shared.mjs";import{shallowReactive as n}from"../../../reactivity/reactive/shallow.mjs";import{isReactive as r}from"../../../reactivity/reactive.mjs";import{
|
|
1
|
+
import{effectScope as e}from"../../../reactivity/core.mjs";import{toRaw as t}from"../../../reactivity/reactive/shared.mjs";import{shallowReactive as n}from"../../../reactivity/reactive/shallow.mjs";import{isReactive as r}from"../../../reactivity/reactive.mjs";import{getCurrentInstance as i,getCurrentSetupContext as a,setCurrentInstance as o,setCurrentSetupContext as s}from"../../hooks/base.mjs";import{hasOwn as c}from"../../../utils.mjs";import{hasTrackableSetupBinding as l}from"../../setupTracking.mjs";import{normalizeEmitEventName as u,normalizeEmitPayload as d}from"../../emit.mjs";import{attachRuntimeSlots as f,ensureSetupContextInstance as p,safeMarkNoSetData as m}from"./setupContext.mjs";import{preserveSetupAccessor as h}from"../../define/setupResult.mjs";import{runSetupFunction as g}from"../setup.mjs";import{attachRuntimeSetupState as _,ensureRuntimeProps as v}from"./utils.mjs";import{WEVU_ATTRS_KEY as y,WEVU_EFFECT_SCOPE_KEY as b,WEVU_EXPOSED_KEY as x,WEVU_PROP_KEYS_KEY as S}from"@weapp-core/constants";let C=0;function w(e,t){let n=e,r={proxy:{configurable:!0,enumerable:!1,value:t,writable:!1},$:{configurable:!0,enumerable:!1,value:e,writable:!1},uid:{configurable:!0,enumerable:!1,value:++C,writable:!1},exposed:{configurable:!0,enumerable:!1,get:()=>e[x]}};for(let[e,t]of Object.entries(r))try{Object.defineProperty(n,e,t)}catch(r){`value`in t&&(n[e]=t.value)}let i={$:{configurable:!0,enumerable:!1,value:e,writable:!1},$el:{configurable:!0,enumerable:!1,value:e,writable:!1}};for(let[e,n]of Object.entries(i))try{Object.defineProperty(t,e,n)}catch(r){t[e]=n.value}}function T(e){return e.startsWith(`__wv_`)}function E(C){var E;let{target:D,runtime:O,runtimeWithDefaults:k,runtimeState:A,runtimeProxy:j,setup:M}=C,N=D.properties||{},P=v(D,A,N),F=n(Object.create(null)),I=new Set(Array.isArray(D[S])?D[S]:[]),L=e=>typeof A==`object`&&!!A&&c(A,e);(()=>{let e=D.properties&&typeof D.properties==`object`?D.properties:void 0;for(let t of Object.keys(F))(!e||!c(e,t)||T(t)||I.has(t)||L(t))&&delete F[t];if(e)for(let[t,n]of Object.entries(e))T(t)||I.has(t)||L(t)||(F[t]=n)})();try{Object.defineProperty(D,y,{value:F,configurable:!0,enumerable:!1,writable:!1})}catch(e){D[y]=F}let R=p(D,k);w(D,R);let z=f(A,P),B=(E=k.setupState)==null?Object.create(null):E;_(A,B);let V=m({props:P,runtime:k,state:A,proxy:j,bindModel:O.bindModel.bind(k),watch:O.watch.bind(k),instance:R,emit:(e,...t)=>{let{detail:n,options:r}=d(t),i=u(e);R.triggerEvent(i,n,r)},expose:e=>{D[x]=e},attrs:F,slots:z}),H=e(!0),U=i(),W=a(),G=()=>{i()===D&&a()===V&&(s(W),o(U))};D[b]=H,o(D),s(V);try{let e=H.run(()=>g(M,P,V)),n=!1;if(e&&typeof e==`object`){let i=e,a=O.setupState&&typeof O.setupState==`object`?r(O.setupState)?t(O.setupState):O.setupState:Object.create(null);Object.keys(i).forEach(e=>{let t=i[e],r=h(a,i,e);if(typeof t==`function`&&!r){let r=(...e)=>t.apply(O.proxy,e);O.methods[e]=r,O.state[e]=r,a[e]=r,n=!0}else{if(l(t)){var o;(o=O.__wevu_trackSetupReactiveKey)==null||o.call(O,e)}O.state[e]=t,r||(a[e]=t)}})}if(n){var K;(K=O.__wevu_touchSetupMethodsVersion)==null||K.call(O)}}finally{G()}}export{E as runRuntimeSetupPhase};
|