wevu 7.2.2 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +1 -1
- package/dist/dev/internal-runtime.d.mts +2 -1
- package/dist/dev/internal-runtime.mjs +3 -2
- package/dist/dev/package.mjs +1 -1
- package/dist/dev/reactivity/asyncDerivation.mjs +8 -10
- package/dist/dev/reactivity/asyncDerivation.mjs.map +1 -1
- package/dist/dev/reactivity/core.mjs +5 -8
- package/dist/dev/reactivity/core.mjs.map +1 -1
- package/dist/dev/reactivity/reactive/patch.mjs +3 -3
- package/dist/dev/reactivity/reactive/patch.mjs.map +1 -1
- package/dist/dev/reactivity/reactive/patchState.mjs +4 -8
- package/dist/dev/reactivity/reactive/patchState.mjs.map +1 -1
- package/dist/dev/reactivity/reactive/shared.mjs +1 -2
- package/dist/dev/reactivity/reactive/shared.mjs.map +1 -1
- package/dist/dev/reactivity/reactive.mjs +5 -10
- package/dist/dev/reactivity/reactive.mjs.map +1 -1
- package/dist/dev/reactivity/ref.mjs +2 -2
- package/dist/dev/reactivity/ref.mjs.map +1 -1
- package/dist/dev/reactivity/shallowRef.mjs +1 -1
- package/dist/dev/reactivity/shallowRef.mjs.map +1 -1
- package/dist/dev/reactivity/watch/helpers.mjs +1 -1
- package/dist/dev/reactivity/watch/helpers.mjs.map +1 -1
- package/dist/dev/reactivity/watch.mjs +6 -8
- package/dist/dev/reactivity/watch.mjs.map +1 -1
- package/dist/dev/router/createRouter.mjs +17 -24
- package/dist/dev/router/createRouter.mjs.map +1 -1
- package/dist/dev/router/initialNavigation.mjs +18 -16
- package/dist/dev/router/initialNavigation.mjs.map +1 -1
- package/dist/dev/router/instance.mjs +1 -2
- package/dist/dev/router/instance.mjs.map +1 -1
- package/dist/dev/router/navigationCore.mjs +2 -2
- package/dist/dev/router/navigationCore.mjs.map +1 -1
- package/dist/dev/router/navigationResult.mjs +7 -10
- package/dist/dev/router/navigationResult.mjs.map +1 -1
- package/dist/dev/router/navigationTarget.mjs +1 -3
- package/dist/dev/router/navigationTarget.mjs.map +1 -1
- package/dist/dev/router/resolve.mjs +3 -4
- package/dist/dev/router/resolve.mjs.map +1 -1
- package/dist/dev/router/routeRegistry.mjs +1 -1
- package/dist/dev/router/routeRegistry.mjs.map +1 -1
- package/dist/dev/router/routeSync.mjs +1 -1
- package/dist/dev/router/routeSync.mjs.map +1 -1
- package/dist/dev/router/useRoute.mjs +12 -19
- package/dist/dev/router/useRoute.mjs.map +1 -1
- package/dist/dev/routerInternal/location.mjs +2 -3
- package/dist/dev/routerInternal/location.mjs.map +1 -1
- package/dist/dev/routerInternal/params.mjs +2 -3
- package/dist/dev/routerInternal/params.mjs.map +1 -1
- package/dist/dev/routerInternal/records.mjs +1 -1
- package/dist/dev/routerInternal/records.mjs.map +1 -1
- package/dist/dev/routerInternal/recordsWarnings.mjs +1 -2
- package/dist/dev/routerInternal/recordsWarnings.mjs.map +1 -1
- package/dist/dev/runtime/app/context.mjs +13 -26
- package/dist/dev/runtime/app/context.mjs.map +1 -1
- package/dist/dev/runtime/app/diagnostics.mjs +2 -4
- package/dist/dev/runtime/app/diagnostics.mjs.map +1 -1
- package/dist/dev/runtime/app/mount.mjs +27 -33
- package/dist/dev/runtime/app/mount.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/commitTracker.mjs +5 -9
- package/dist/dev/runtime/app/setData/commitTracker.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/patchScheduler.mjs +2 -4
- package/dist/dev/runtime/app/setData/patchScheduler.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/payload.mjs +2 -3
- package/dist/dev/runtime/app/setData/payload.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/scheduler.mjs +7 -9
- package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/snapshot.mjs +5 -6
- package/dist/dev/runtime/app/setData/snapshot.mjs.map +1 -1
- package/dist/dev/runtime/app/setDataOptions.mjs +26 -27
- package/dist/dev/runtime/app/setDataOptions.mjs.map +1 -1
- package/dist/dev/runtime/app.mjs +9 -9
- package/dist/dev/runtime/app.mjs.map +1 -1
- package/dist/dev/runtime/bindingManifest.mjs +6 -14
- package/dist/dev/runtime/bindingManifest.mjs.map +1 -1
- package/dist/dev/runtime/capabilities.d.mts +4 -1
- package/dist/dev/runtime/capabilities.mjs.map +1 -1
- package/dist/dev/runtime/css.mjs +4 -8
- package/dist/dev/runtime/css.mjs.map +1 -1
- package/dist/dev/runtime/defaults.mjs +4 -4
- package/dist/dev/runtime/defaults.mjs.map +1 -1
- package/dist/dev/runtime/define/initialComputed.mjs +5 -5
- package/dist/dev/runtime/define/initialComputed.mjs.map +1 -1
- package/dist/dev/runtime/define/options.mjs +10 -12
- package/dist/dev/runtime/define/options.mjs.map +1 -1
- package/dist/dev/runtime/define/props.mjs +4 -5
- package/dist/dev/runtime/define/props.mjs.map +1 -1
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +43 -61
- package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
- package/dist/dev/runtime/define/setupResult.mjs +17 -28
- package/dist/dev/runtime/define/setupResult.mjs.map +1 -1
- package/dist/dev/runtime/define.mjs +9 -12
- package/dist/dev/runtime/define.mjs.map +1 -1
- package/dist/dev/runtime/diff.mjs +9 -11
- package/dist/dev/runtime/diff.mjs.map +1 -1
- package/dist/dev/runtime/disposables.mjs +2 -2
- package/dist/dev/runtime/disposables.mjs.map +1 -1
- package/dist/dev/runtime/elementIntersectionObserver.mjs +16 -24
- package/dist/dev/runtime/elementIntersectionObserver.mjs.map +1 -1
- package/dist/dev/runtime/features/inlineEvents.mjs +2 -3
- package/dist/dev/runtime/features/inlineEvents.mjs.map +1 -1
- package/dist/dev/runtime/features/jsxIslands.d.mts +7 -0
- package/dist/dev/runtime/features/jsxIslands.mjs +20 -0
- package/dist/dev/runtime/features/jsxIslands.mjs.map +1 -0
- package/dist/dev/runtime/features/layout.mjs +2 -3
- package/dist/dev/runtime/features/layout.mjs.map +1 -1
- package/dist/dev/runtime/features/publicLayout.mjs +2 -6
- package/dist/dev/runtime/features/publicLayout.mjs.map +1 -1
- package/dist/dev/runtime/features/scopedSlots.mjs +5 -9
- package/dist/dev/runtime/features/scopedSlots.mjs.map +1 -1
- package/dist/dev/runtime/features/templateRefs.mjs +1 -1
- package/dist/dev/runtime/features/templateRefs.mjs.map +1 -1
- package/dist/dev/runtime/hooks/base.mjs +21 -32
- package/dist/dev/runtime/hooks/base.mjs.map +1 -1
- package/dist/dev/runtime/inlineDataset.mjs +1 -2
- package/dist/dev/runtime/inlineDataset.mjs.map +1 -1
- package/dist/dev/runtime/intersectionObserver.mjs +6 -6
- package/dist/dev/runtime/intersectionObserver.mjs.map +1 -1
- package/dist/dev/runtime/jsxIsland.mjs +16 -33
- package/dist/dev/runtime/jsxIsland.mjs.map +1 -1
- package/dist/dev/runtime/layoutBridge.mjs +32 -62
- package/dist/dev/runtime/layoutBridge.mjs.map +1 -1
- package/dist/dev/runtime/nativeBridge.mjs +1 -1
- package/dist/dev/runtime/nativeBridge.mjs.map +1 -1
- package/dist/dev/runtime/navigationLifecycle.mjs +24 -0
- package/dist/dev/runtime/navigationLifecycle.mjs.map +1 -0
- package/dist/dev/runtime/pageEnvironment.mjs +15 -18
- package/dist/dev/runtime/pageEnvironment.mjs.map +1 -1
- package/dist/dev/runtime/pageLayout.mjs +7 -11
- package/dist/dev/runtime/pageLayout.mjs.map +1 -1
- package/dist/dev/runtime/pageScroll.mjs +2 -3
- package/dist/dev/runtime/pageScroll.mjs.map +1 -1
- package/dist/dev/runtime/platform/current.mjs +12 -0
- package/dist/dev/runtime/platform/current.mjs.map +1 -0
- package/dist/dev/runtime/platform/generic.mjs +36 -0
- package/dist/dev/runtime/platform/generic.mjs.map +1 -0
- package/dist/dev/runtime/platform/globals.mjs +29 -0
- package/dist/dev/runtime/platform/globals.mjs.map +1 -0
- package/dist/dev/runtime/platform.mjs +15 -60
- package/dist/dev/runtime/platform.mjs.map +1 -1
- package/dist/dev/runtime/provideContext.mjs +7 -9
- package/dist/dev/runtime/provideContext.mjs.map +1 -1
- package/dist/dev/runtime/publicRuntime.mjs +4 -0
- package/dist/dev/runtime/publicRuntime.mjs.map +1 -1
- package/dist/dev/runtime/pullDownRefresh.mjs +2 -4
- package/dist/dev/runtime/pullDownRefresh.mjs.map +1 -1
- package/dist/dev/runtime/register/app.mjs +18 -19
- package/dist/dev/runtime/register/app.mjs.map +1 -1
- package/dist/dev/runtime/register/component/alipay.mjs +9 -18
- package/dist/dev/runtime/register/component/alipay.mjs.map +1 -1
- package/dist/dev/runtime/register/component/alipayRegistration.mjs +60 -0
- package/dist/dev/runtime/register/component/alipayRegistration.mjs.map +1 -0
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs +8 -9
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs.map +1 -1
- package/dist/dev/runtime/register/component/lifecycle.mjs +7 -12
- package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -1
- package/dist/dev/runtime/register/component/methods.mjs +13 -18
- package/dist/dev/runtime/register/component/methods.mjs.map +1 -1
- package/dist/dev/runtime/register/component/options.mjs +3 -4
- package/dist/dev/runtime/register/component/options.mjs.map +1 -1
- package/dist/dev/runtime/register/component/props.mjs +25 -31
- package/dist/dev/runtime/register/component/props.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerDefinition.mjs +18 -40
- package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +18 -60
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs.map +1 -1
- package/dist/dev/runtime/register/component.mjs +3 -5
- package/dist/dev/runtime/register/component.mjs.map +1 -1
- package/dist/dev/runtime/register/inline.mjs +8 -10
- package/dist/dev/runtime/register/inline.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +7 -8
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +1 -1
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +25 -34
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +6 -13
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +2 -2
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs +9 -9
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance.mjs +74 -100
- package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +12 -15
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs.map +1 -1
- package/dist/dev/runtime/register/setup.mjs +2 -3
- package/dist/dev/runtime/register/setup.mjs.map +1 -1
- package/dist/dev/runtime/register/snapshot.mjs +1 -4
- package/dist/dev/runtime/register/snapshot.mjs.map +1 -1
- package/dist/dev/runtime/register/watch.mjs +3 -5
- package/dist/dev/runtime/register/watch.mjs.map +1 -1
- package/dist/dev/runtime/scopedSlots.mjs +14 -21
- package/dist/dev/runtime/scopedSlots.mjs.map +1 -1
- package/dist/dev/runtime/selectorQuery.mjs +5 -9
- package/dist/dev/runtime/selectorQuery.mjs.map +1 -1
- package/dist/dev/runtime/template.mjs +1 -1
- package/dist/dev/runtime/template.mjs.map +1 -1
- package/dist/dev/runtime/templateRefs/helpers.mjs +14 -24
- package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -1
- package/dist/dev/runtime/templateRefs.mjs +8 -15
- package/dist/dev/runtime/templateRefs.mjs.map +1 -1
- package/dist/dev/runtime/uniAppHost.mjs +6 -14
- package/dist/dev/runtime/uniAppHost.mjs.map +1 -1
- package/dist/dev/runtime/updatePerformance.mjs +1 -1
- package/dist/dev/runtime/updatePerformance.mjs.map +1 -1
- package/dist/dev/runtime/use.mjs +1 -1
- package/dist/dev/runtime/use.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/context.mjs +3 -5
- package/dist/dev/runtime/vueCompat/context.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/model.mjs +9 -13
- package/dist/dev/runtime/vueCompat/model.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/router.mjs +4 -4
- package/dist/dev/runtime/vueCompat/router.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/templateRef.mjs +1 -1
- package/dist/dev/runtime/vueCompat/templateRef.mjs.map +1 -1
- package/dist/dev/scheduler.mjs +3 -4
- package/dist/dev/scheduler.mjs.map +1 -1
- package/dist/dev/store/base.mjs +1 -2
- package/dist/dev/store/base.mjs.map +1 -1
- package/dist/dev/store/define/create.mjs +11 -22
- package/dist/dev/store/define/create.mjs.map +1 -1
- package/dist/dev/store/define.mjs +1 -1
- package/dist/dev/store/define.mjs.map +1 -1
- package/dist/dev/store/view.mjs +1 -1
- package/dist/dev/store/view.mjs.map +1 -1
- package/dist/internal-runtime.d.mts +2 -1
- package/dist/internal-runtime.mjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/reactivity/asyncDerivation.mjs +1 -1
- package/dist/reactivity/core.mjs +1 -1
- package/dist/reactivity/reactive/patch.mjs +1 -1
- package/dist/reactivity/reactive/patchState.mjs +1 -1
- package/dist/reactivity/reactive/shared.mjs +1 -1
- package/dist/reactivity/reactive.mjs +1 -1
- package/dist/reactivity/ref.mjs +1 -1
- package/dist/reactivity/shallowRef.mjs +1 -1
- package/dist/reactivity/watch/helpers.mjs +1 -1
- package/dist/reactivity/watch.mjs +1 -1
- package/dist/router/createRouter.mjs +1 -1
- package/dist/router/initialNavigation.mjs +1 -1
- package/dist/router/instance.mjs +1 -1
- package/dist/router/navigationCore.mjs +1 -1
- package/dist/router/navigationResult.mjs +1 -1
- package/dist/router/navigationTarget.mjs +1 -1
- package/dist/router/resolve.mjs +1 -1
- package/dist/router/routeRegistry.mjs +1 -1
- package/dist/router/routeSync.mjs +1 -1
- package/dist/router/useRoute.mjs +1 -1
- package/dist/routerInternal/location.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/context.mjs +1 -1
- package/dist/runtime/app/diagnostics.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/setDataOptions.mjs +1 -1
- package/dist/runtime/app.mjs +1 -1
- package/dist/runtime/bindingManifest.mjs +1 -1
- package/dist/runtime/capabilities.d.mts +4 -1
- package/dist/runtime/css.mjs +1 -1
- package/dist/runtime/defaults.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/elementIntersectionObserver.mjs +1 -1
- package/dist/runtime/features/inlineEvents.mjs +1 -1
- package/dist/runtime/features/jsxIslands.d.mts +6 -0
- package/dist/runtime/features/jsxIslands.mjs +1 -0
- package/dist/runtime/features/layout.mjs +1 -1
- package/dist/runtime/features/publicLayout.mjs +1 -1
- package/dist/runtime/features/scopedSlots.mjs +1 -1
- package/dist/runtime/features/templateRefs.mjs +1 -1
- package/dist/runtime/hooks/base.mjs +1 -1
- package/dist/runtime/inlineDataset.mjs +1 -1
- package/dist/runtime/intersectionObserver.mjs +1 -1
- package/dist/runtime/jsxIsland.mjs +1 -1
- package/dist/runtime/layoutBridge.mjs +1 -1
- package/dist/runtime/nativeBridge.mjs +1 -1
- package/dist/runtime/navigationLifecycle.mjs +1 -0
- package/dist/runtime/pageEnvironment.mjs +1 -1
- package/dist/runtime/pageLayout.mjs +1 -1
- package/dist/runtime/pageScroll.mjs +1 -1
- package/dist/runtime/platform/current.mjs +1 -0
- package/dist/runtime/platform/generic.mjs +1 -0
- package/dist/runtime/platform/globals.mjs +1 -0
- package/dist/runtime/platform.mjs +1 -1
- package/dist/runtime/provideContext.mjs +1 -1
- package/dist/runtime/publicRuntime.mjs +1 -1
- package/dist/runtime/pullDownRefresh.mjs +1 -1
- package/dist/runtime/register/app.mjs +1 -1
- package/dist/runtime/register/component/alipay.mjs +1 -1
- package/dist/runtime/register/component/alipayRegistration.mjs +1 -0
- package/dist/runtime/register/component/lifecycle/platform.mjs +1 -1
- package/dist/runtime/register/component/lifecycle.mjs +1 -1
- package/dist/runtime/register/component/methods.mjs +1 -1
- package/dist/runtime/register/component/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/component/registerNativeDefinition.mjs +1 -1
- package/dist/runtime/register/component.mjs +1 -1
- package/dist/runtime/register/inline.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/methodBridge.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/provideContext.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupContext.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupSnapshot.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/utils.mjs +1 -1
- package/dist/runtime/register/runtimeInstance.mjs +1 -1
- package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -1
- package/dist/runtime/register/setup.mjs +1 -1
- package/dist/runtime/register/snapshot.mjs +1 -1
- package/dist/runtime/register/watch.mjs +1 -1
- package/dist/runtime/scopedSlots.mjs +1 -1
- package/dist/runtime/selectorQuery.mjs +1 -1
- package/dist/runtime/template.mjs +1 -1
- package/dist/runtime/templateRefs/helpers.mjs +1 -1
- package/dist/runtime/templateRefs.mjs +1 -1
- package/dist/runtime/uniAppHost.mjs +1 -1
- package/dist/runtime/updatePerformance.mjs +1 -1
- package/dist/runtime/use.mjs +1 -1
- package/dist/runtime/vueCompat/context.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/create.mjs +1 -1
- package/dist/store/define.mjs +1 -1
- package/dist/store/view.mjs +1 -1
- package/package.json +7 -7
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{callHookList as e,callHookReturn as t,getCurrentInstance as n,getCurrentSetupContext as r,setCurrentInstance as i,setCurrentSetupContext as a}from"./runtime/hooks/base.mjs";import{onAddToFavorites as o,onAttached as s,onDetached as c,onError as l,onHide as u,onLaunch as d,onLoad as f,onMemoryWarning as p,onMoved as m,onPageNotFound as h,onPageScroll as g,onPullDownRefresh as _,onReachBottom as v,onReady as y,onResize as b,onRouteDone as x,onSaveExitState as S,onShareAppMessage as C,onShareTimeline as w,onShow as T,onTabItemTap as E,onThemeChange as D,onUnhandledRejection as O,onUnload as k}from"./runtime/hooks/register.mjs";import{onActivated as A,onBeforeMount as j,onBeforeUnmount as M,onBeforeUpdate as N,onDeactivated as P,onErrorCaptured as F,onMounted as I,onServerPrefetch as L,onUnmounted as R,onUpdated as z}from"./runtime/hooks/vue.mjs";import{useCssModule as B,useCssVars as V}from"./runtime/css.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as H,resetWevuDefaults as U,setWevuDefaults as W}from"./runtime/defaults.mjs";import{useDisposables as G}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as K}from"./runtime/elementIntersectionObserver.mjs";import{isNoSetData as q,markNoSetData as J}from"./runtime/noSetData.mjs";import{installTemplateRefs as Y}from"./runtime/features/templateRefs.mjs";import{installLayout as X}from"./runtime/features/layout.mjs";import{resolveLayoutBridge as Z,resolveLayoutHost as Q,resolveRuntimePageLayoutName as $,setPageLayout as ee,syncRuntimePageLayoutState as te,syncRuntimePageLayoutStateFromRuntime as ne,useLayoutBridge as re,useLayoutHosts as ie,usePageLayout as ae,waitForLayoutHost as oe}from"./runtime/features/publicLayout.mjs";import{useIntersectionObserver as se}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as ce,getNavigationBarMetrics as le,useNavigationBarMetrics as ue,usePageStack as de}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as fe}from"./runtime/pageScroll.mjs";import{setGlobalProvidedValue as pe}from"./runtime/provideStore.mjs";import{hasInjectionContext as me,inject as he,injectGlobal as ge,provide as _e,provideGlobal as ve}from"./runtime/provide.mjs";import{version as ye}from"./version.mjs";import{takePendingRuntimeAppRegistration as be}from"./runtime/app/pending.mjs";import{runSetupFunction as xe}from"./runtime/register/setup.mjs";import{mountRuntimeInstance as Se,setRuntimeSetDataVisibility as Ce,teardownRuntimeInstance as we}from"./runtime/register/runtimeInstance.mjs";import{registerApp as Te}from"./runtime/register/app.mjs";import{
|
|
1
|
+
import{callHookList as e,callHookReturn as t,getCurrentInstance as n,getCurrentSetupContext as r,setCurrentInstance as i,setCurrentSetupContext as a}from"./runtime/hooks/base.mjs";import{onAddToFavorites as o,onAttached as s,onDetached as c,onError as l,onHide as u,onLaunch as d,onLoad as f,onMemoryWarning as p,onMoved as m,onPageNotFound as h,onPageScroll as g,onPullDownRefresh as _,onReachBottom as v,onReady as y,onResize as b,onRouteDone as x,onSaveExitState as S,onShareAppMessage as C,onShareTimeline as w,onShow as T,onTabItemTap as E,onThemeChange as D,onUnhandledRejection as O,onUnload as k}from"./runtime/hooks/register.mjs";import{onActivated as A,onBeforeMount as j,onBeforeUnmount as M,onBeforeUpdate as N,onDeactivated as P,onErrorCaptured as F,onMounted as I,onServerPrefetch as L,onUnmounted as R,onUpdated as z}from"./runtime/hooks/vue.mjs";import{useCssModule as B,useCssVars as V}from"./runtime/css.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as H,resetWevuDefaults as U,setWevuDefaults as W}from"./runtime/defaults.mjs";import{useDisposables as G}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as K}from"./runtime/elementIntersectionObserver.mjs";import{isNoSetData as q,markNoSetData as J}from"./runtime/noSetData.mjs";import{installTemplateRefs as Y}from"./runtime/features/templateRefs.mjs";import{installLayout as X}from"./runtime/features/layout.mjs";import{resolveLayoutBridge as Z,resolveLayoutHost as Q,resolveRuntimePageLayoutName as $,setPageLayout as ee,syncRuntimePageLayoutState as te,syncRuntimePageLayoutStateFromRuntime as ne,useLayoutBridge as re,useLayoutHosts as ie,usePageLayout as ae,waitForLayoutHost as oe}from"./runtime/features/publicLayout.mjs";import{useIntersectionObserver as se}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as ce,getNavigationBarMetrics as le,useNavigationBarMetrics as ue,usePageStack as de}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as fe}from"./runtime/pageScroll.mjs";import{setGlobalProvidedValue as pe}from"./runtime/provideStore.mjs";import{hasInjectionContext as me,inject as he,injectGlobal as ge,provide as _e,provideGlobal as ve}from"./runtime/provide.mjs";import{version as ye}from"./version.mjs";import{takePendingRuntimeAppRegistration as be}from"./runtime/app/pending.mjs";import{runSetupFunction as xe}from"./runtime/register/setup.mjs";import{mountRuntimeInstance as Se,setRuntimeSetDataVisibility as Ce,teardownRuntimeInstance as we}from"./runtime/register/runtimeInstance.mjs";import{registerApp as Te}from"./runtime/register/app.mjs";import{registerComponent as Ee}from"./runtime/register/component.mjs";import{createApp as De}from"./runtime/app.mjs";import{createIsolatedWevuComponentDefinition as Oe,createWevuComponent as ke,createWevuComponentDefinition as Ae,defineComponent as je,getWevuComponentLifecycleDefinition as Me}from"./runtime/define.mjs";import{installInlineEvents as Ne}from"./runtime/features/inlineEvents.mjs";import{Fragment as Pe,createTextVNode as Fe,createVNode as Ie,isVNode as Le,mergeProps as Re,normalizeJsxIsland as ze,resolveComponent as Be,resolveDirective as Ve,transformOn as He,vModelCheckbox as Ue,vModelRadio as We,vModelSelect as Ge,vModelText as Ke,vShow as qe,withDirectives as Je}from"./runtime/jsxIsland.mjs";import{installJsxIslands as Ye}from"./runtime/features/jsxIslands.mjs";import{installPatchStrategy as Xe}from"./runtime/features/patchStrategy.mjs";import{createWevuScopedSlotComponent as Ze,installScopedSlots as Qe}from"./runtime/features/scopedSlots.mjs";import{installSetDataHighFrequencyWarning as $e}from"./runtime/features/setDataHighFrequencyWarning.mjs";import{useAsyncPullDownRefresh as et}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as tt,useScrollOffset as nt,useSelectorFields as rt,useSelectorQuery as it}from"./runtime/selectorQuery.mjs";import{useUpdatePerformanceListener as at}from"./runtime/updatePerformance.mjs";import{defineAppSetup as ot,use as st}from"./runtime/use.mjs";import{useAttrs as ct,useNativeInstance as lt,useSlots as ut}from"./runtime/vueCompat/context.mjs";import{mergeModels as dt,useBindModel as ft,useChangeModel as pt,useModel as mt}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as ht,useNativeRouter as gt}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as _t}from"./runtime/vueCompat/templateRef.mjs";import{createUniAppHost as vt}from"./runtime/uniAppHost.mjs";export{Pe as Fragment,H as INTERNAL_DEFAULTS_SCOPE_KEY,e as callHookList,t as callHookReturn,De as createApp,Oe as createIsolatedWevuComponentDefinition,Fe as createTextVNode,vt as createUniAppHost,Ie as createVNode,ke as createWevuComponent,Ae as createWevuComponentDefinition,Ze as createWevuScopedSlotComponent,ot as defineAppSetup,je as defineComponent,n as getCurrentInstance,ce as getCurrentPageStackSnapshot,r as getCurrentSetupContext,le as getNavigationBarMetrics,Me as getWevuComponentLifecycleDefinition,me as hasInjectionContext,he as inject,ge as injectGlobal,Ne as installInlineEvents,Ye as installJsxIslands,X as installLayout,Xe as installPatchStrategy,Qe as installScopedSlots,$e as installSetDataHighFrequencyWarning,Y as installTemplateRefs,q as isNoSetData,Le as isVNode,J as markNoSetData,dt as mergeModels,Re as mergeProps,Se as mountRuntimeInstance,ze as normalizeJsxIsland,A as onActivated,o as onAddToFavorites,s as onAttached,j as onBeforeMount,M as onBeforeUnmount,N as onBeforeUpdate,P as onDeactivated,c as onDetached,l as onError,F as onErrorCaptured,u as onHide,d as onLaunch,f as onLoad,p as onMemoryWarning,I as onMounted,m as onMoved,h as onPageNotFound,g as onPageScroll,_ as onPullDownRefresh,v as onReachBottom,y as onReady,b as onResize,x as onRouteDone,S as onSaveExitState,L as onServerPrefetch,C as onShareAppMessage,w as onShareTimeline,T as onShow,E as onTabItemTap,D as onThemeChange,O as onUnhandledRejection,k as onUnload,R as onUnmounted,z as onUpdated,_e as provide,ve as provideGlobal,Te as registerApp,Ee as registerComponent,U as resetWevuDefaults,Be as resolveComponent,Ve as resolveDirective,Z as resolveLayoutBridge,Q as resolveLayoutHost,$ as resolveRuntimePageLayoutName,xe as runSetupFunction,i as setCurrentInstance,a as setCurrentSetupContext,pe as setGlobalProvidedValue,ee as setPageLayout,Ce as setRuntimeSetDataVisibility,W as setWevuDefaults,te as syncRuntimePageLayoutState,ne as syncRuntimePageLayoutStateFromRuntime,be as takePendingRuntimeAppRegistration,we as teardownRuntimeInstance,He as transformOn,st as use,et as useAsyncPullDownRefresh,ct as useAttrs,ft as useBindModel,tt as useBoundingClientRect,pt as useChangeModel,B as useCssModule,V as useCssVars,G as useDisposables,K as useElementIntersectionObserver,se as useIntersectionObserver,re as useLayoutBridge,ie as useLayoutHosts,mt as useModel,lt as useNativeInstance,ht as useNativePageRouter,gt as useNativeRouter,ue as useNavigationBarMetrics,ae as usePageLayout,fe as usePageScrollThrottle,de as usePageStack,nt as useScrollOffset,rt as useSelectorFields,it as useSelectorQuery,ut as useSlots,_t as useTemplateRef,at as useUpdatePerformanceListener,Ue as vModelCheckbox,We as vModelRadio,Ge as vModelSelect,Ke as vModelText,qe as vShow,ye as version,oe as waitForLayoutHost,Je as withDirectives};
|
package/dist/package.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`7.
|
|
1
|
+
var e=`7.3.0`;export{e as version};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{batch as e,onScopeDispose as t,runWithoutTracking as n}from"./core.mjs";import{reactive as r}from"./reactive.mjs";import{readonly as i}from"./readonly.mjs";import{AbortControllerPolyfill as a}from"@wevu/web-apis/abort";const o=Promise.resolve();function s(){let e;return{promise:new Promise(t=>{e=t}),resolve:e}}function c(c,l={}){
|
|
1
|
+
import{batch as e,onScopeDispose as t,runWithoutTracking as n}from"./core.mjs";import{reactive as r}from"./reactive.mjs";import{readonly as i}from"./readonly.mjs";import{AbortControllerPolyfill as a}from"@wevu/web-apis/abort";const o=Promise.resolve();function s(){let e;return{promise:new Promise(t=>{e=t}),resolve:e}}function c(c,l={}){let u={status:`idle`,value:void 0,error:void 0},d=r(u),f,p,m=0,h=!1,g=!1;function _(e){if(g||e!==m)return;let t=p;p=void 0,t?.resolve()}function v(t,n){if(!(g||t!==m)){f=void 0,h=!0;try{e(()=>{d.status=`ready`,d.value=n,d.error=void 0})}finally{_(t)}}}function y(t,n){if(!(g||t!==m)){f=void 0;try{e(()=>{d.status=`error`,d.error=n,h||(d.value=void 0)})}finally{_(t)}}}function b(){if(g)return o;let t=p??s();p=t;let r=++m,i=f,l=new(typeof AbortController==`function`?AbortController:a);f=l;try{i?.abort()}catch{}return g||r!==m||(e(()=>{d.status=h?`refreshing`:`initial-pending`,d.error=void 0}),g||r!==m)||n(()=>{new Promise(e=>{e(c({signal:l.signal}))}).then(e=>v(r,e),e=>y(r,e)).catch(e=>{setTimeout(()=>{throw e},0)})}),t.promise}function x(){if(g)return;g=!0,m+=1;let t=f;f=void 0;try{t?.abort()}catch{}try{e(()=>{d.status=`disposed`,d.value=void 0,d.error=void 0})}finally{h=!1;let e=p;p=void 0,e?.resolve()}}Object.defineProperties(u,{refresh:{value:b},dispose:{value:x}});let S=i(d);return t(x),(l.immediate??!0)&&b(),S}export{c as useAsyncDerivation};
|
package/dist/reactivity/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{queueJob as e}from"../scheduler.mjs";import t from"../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import{queueJob as e}from"../scheduler.mjs";import t from"../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.mjs";const n=/* @__PURE__ */ new WeakMap;let r=null;const i=[];let a=!0,o,s=0,c=!1;const l=/* @__PURE__ */ new Set,u=/* @__PURE__ */ new Set;function d(e){if(e.active){if(e.scheduler){let t=o;o=e._scope;try{e.scheduler()}finally{o=t}return}e()}}function f(e){if(s>0||c){u.add(e);return}u.delete(e),e()}function p(){s++}function m(e){let t=e.values().next();if(!t.done)return e.delete(t.value),t.value}function h(){let e,t=!1;c=!0;try{for(;l.size;){let n=m(l);if(n)try{d(n)}catch(n){t||(e=n,t=!0)}}}finally{c=!1}for(;u.size;){let n=u.values().next().value;u.delete(n);try{n()}catch(n){t||(e=n,t=!0)}}if(t)throw e}function g(){s!==0&&(s--,s===0&&!c&&h())}function _(e){p();try{return e()}finally{g()}}function v(e){let{deps:t}=e;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}function y(e){e.active&&(e.active=!1,v(e),e.onStop?.())}var b=class{constructor(e=!1){if(this.detached=e,t(this,`active`,!0),t(this,`effects`,[]),t(this,`cleanups`,[]),t(this,`parent`,void 0),t(this,`scopes`,void 0),!e&&o){var n;if(!o.active){this.active=!1;return}this.parent=o,((n=o).scopes||(n.scopes=[])).push(this)}}run(e){if(!this.active)return;let t=o;o=this;try{return e()}finally{o=t}}stop(){if(!this.active)return;this.active=!1;let e=o;o=this;let t,n=!1,r=e=>{n||(t=e,n=!0)};try{let e=this.effects.splice(0);for(let t of e)try{y(t)}catch(e){r(e)}let t=this.cleanups.splice(0);for(let e of t)try{e()}catch(e){r(e)}let n=this.scopes;if(this.scopes=void 0,n){for(let e of n)try{e.stop()}catch(e){r(e)}n.length=0}}finally{if(this.parent?.scopes){let e=this.parent.scopes.indexOf(this);e>=0&&this.parent.scopes.splice(e,1)}this.parent=void 0,o=e}if(n)throw t}};function x(e=!1){return new b(e)}function S(){return o}function C(e){o?.active&&o.cleanups.push(e)}function w(e){let t=a;a=!1;try{return e()}finally{a=t}}function T(e){if(o){if(o.active){o.effects.push(e);return}y(e)}}function E(e,t={}){let n=function(){if(!n.active||n._running)return e();v(n);let t=o;o=n._scope;let s=a;try{return a=!0,n._running=!0,i.push(n),r=n,e()}finally{i.pop(),r=i[i.length-1]??null,n._running=!1,o=t,a=s}};return n.deps=[],n.scheduler=t.scheduler,n.onStop=t.onStop,n.active=!0,n._running=!1,n._fn=e,n._scope=o,n}function D(e,t,n){let r=E(e,t);return r._computed=n,T(r),t.lazy||r(),r}function O(e,t={}){return D(e,t,!1)}function k(e,t={}){return D(e,t,!0)}function A(e,t){if(!a||!r)return;let i=n.get(e);i||(i=/* @__PURE__ */ new Map,n.set(e,i));let o=i.get(t);o||(o=/* @__PURE__ */ new Set,i.set(t,o)),o.has(r)||(o.add(r),r.deps.push(o))}function j(e){if(!e._running){if(e._computed){d(e);return}if(s>0||c){l.add(e);return}d(e)}}function M(e,t){let i=n.get(e);if(!i)return;let a=i.get(t);if(!a)return;let o=/* @__PURE__ */ new Set;a.forEach(e=>{e!==r&&o.add(e)}),o.forEach(j)}function N(e){a&&r&&(e.has(r)||(e.add(r),r.deps.push(e)))}function P(e){new Set(e).forEach(j)}export{_ as batch,k as createComputedEffect,E as createReactiveEffect,O as effect,x as effectScope,g as endBatch,S as getCurrentScope,C as onScopeDispose,f as queueBatchCallback,e as queueJob,w as runWithoutTracking,p as startBatch,y as stop,A as track,N as trackEffects,M as trigger,P as triggerEffects};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{track as e}from"../core.mjs";import{adoptReactiveRoot as t,indexPatchNode as n,rawMultiParentSet as r,rawParentMap as i,rawParentsMap as a,rawPathMap as o,rawRootMap as s,rawVersionMap as c,recordParentLink as l,rootPatchNodesMap as u}from"./patchState.mjs";import{VERSION_KEY as d,isObject as f,toRaw as p}from"./shared.mjs";function m(e,i){let a=p(e);o.set(a,``),n(a,a);let s=i
|
|
1
|
+
import{track as e}from"../core.mjs";import{adoptReactiveRoot as t,indexPatchNode as n,rawMultiParentSet as r,rawParentMap as i,rawParentsMap as a,rawPathMap as o,rawRootMap as s,rawVersionMap as c,recordParentLink as l,rootPatchNodesMap as u}from"./patchState.mjs";import{VERSION_KEY as d,isObject as f,toRaw as p}from"./shared.mjs";function m(e,i){let a=p(e);o.set(a,``),n(a,a);let s=i?.shouldIncludeTopKey,c=typeof i?.maxDepth==`number`?Math.max(0,Math.floor(i.maxDepth)):1/0,u=typeof i?.maxKeys==`number`?Math.max(0,Math.floor(i.maxKeys)):1/0,d=/* @__PURE__ */ new WeakSet,m=[{current:a,path:``,depth:0}],h=0;for(;m.length;){let e=m.pop();if(d.has(e.current)||(d.add(e.current),o.set(e.current,e.path),n(a,e.current),h+=1,h>=u)||e.depth>=c||Array.isArray(e.current))continue;let i=Object.entries(e.current);for(let[c,u]of i){if(e.path===``&&s&&!s(c)||!f(u)||u.__r_skip)continue;let i=p(u);if(t(i,e.current),l(i,e.current,c),!r.has(i)){let t=e.path?`${e.path}.${c}`:c;o.set(i,t)}n(a,i),m.push({current:i,path:e.path?`${e.path}.${c}`:c,depth:e.depth+1})}}}function h(e){let t=p(e),n=u.get(t);if(!n){o.delete(t);return}for(let e of n)i.delete(e),a.delete(e),o.delete(e),r.delete(e),s.delete(e),c.delete(e);u.delete(t)}function g(t){let n=p(t);e(n,d)}export{h as clearPatchIndices,m as prelinkReactiveTree,g as touchReactive};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mutationRecorders as e}from"./mutation.mjs";const t=/* @__PURE__ */ new WeakMap,n=/* @__PURE__ */ new WeakMap,r=/* @__PURE__ */ new WeakMap,i=/* @__PURE__ */ new WeakMap,a=/* @__PURE__ */ new WeakSet,o=/* @__PURE__ */ new WeakMap,s=/* @__PURE__ */ new WeakMap;function c(e){let t=s.get(e);return t||(t=/* @__PURE__ */ new Set,s.set(e,t)),t}function l(e,t){c(e).add(t)}function u(e){
|
|
1
|
+
import{mutationRecorders as e}from"./mutation.mjs";const t=/* @__PURE__ */ new WeakMap,n=/* @__PURE__ */ new WeakMap,r=/* @__PURE__ */ new WeakMap,i=/* @__PURE__ */ new WeakMap,a=/* @__PURE__ */ new WeakSet,o=/* @__PURE__ */ new WeakMap,s=/* @__PURE__ */ new WeakMap;function c(e){let t=s.get(e);return t||(t=/* @__PURE__ */ new Set,s.set(e,t)),t}function l(e,t){c(e).add(t)}function u(e){n.set(e,(n.get(e)??0)+1)}function d(e){return n.get(e)??0}function f(e,n){let r=t.get(n)??n,i=t.get(e);(!i||i===e||i===n)&&t.set(e,r)}function p(e){let t=/* @__PURE__ */ new Set,n=[e];for(let e=0;e<2e3&&n.length;e++){let e=n.pop(),r=i.get(e);if(r)for(let e of r.keys())t.has(e)||(t.add(e),u(e),n.push(e))}}function m(e){let t=i.get(e);if(!t){a.delete(e),r.delete(e);return}let n,o,s=0;for(let[e,r]of t){for(let t of r){if(s+=1,s>1)break;n=e,o=t}if(s>1)break}if(s===1&&n&&o){a.delete(e),r.set(e,{parent:n,key:o});return}a.add(e),r.delete(e)}function h(n,o,s){if(typeof s!=`string`){a.add(n),r.delete(n);return}if(e.size){let e=t.get(o)??o;l(e,o),l(e,n)}let c=i.get(n);c||(c=/* @__PURE__ */ new Map,i.set(n,c));let u=c.get(o);u||(u=/* @__PURE__ */ new Set,c.set(o,u)),u.add(s),m(n)}function g(e,t,n){let r=i.get(e);if(!r)return;let a=r.get(t);a&&(a.delete(n),a.size||r.delete(t),r.size||i.delete(e),m(e))}function _(e,t){if(t===e)return[];if(a.has(t))return;let n=[],i=t;for(let t=0;t<2e3;t++){if(i===e)return n.reverse();if(a.has(i))return;let t=r.get(i);if(!t||typeof t.key!=`string`)return;n.push(t.key),i=t.parent}}export{f as adoptReactiveRoot,p as bumpAncestorVersions,u as bumpRawVersion,d as getRawVersion,l as indexPatchNode,a as rawMultiParentSet,r as rawParentMap,i as rawParentsMap,o as rawPathMap,t as rawRootMap,n as rawVersionMap,h as recordParentLink,g as removeParentLink,_ as resolvePathToTarget,s as rootPatchNodesMap};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return typeof e==`object`&&!!e}function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e){return Object.prototype.toString.call(e).slice(8,-1)}function r(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 0;default:return 0}}function i(e){return e.__r_skip?0:r(n(e))}const a=Symbol(`wevu.version`);function o(e){if(!e)return!1;let t=e.charCodeAt(0);if(t<48||t>57)return!1;let n=Number(e);return Number.isInteger(n)&&n>=0&&String(n)===e}function s(e){
|
|
1
|
+
function e(e){return typeof e==`object`&&!!e}function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e){return Object.prototype.toString.call(e).slice(8,-1)}function r(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 0;default:return 0}}function i(e){return e.__r_skip?0:r(n(e))}const a=Symbol(`wevu.version`);function o(e){if(!e)return!1;let t=e.charCodeAt(0);if(t<48||t>57)return!1;let n=Number(e);return Number.isInteger(n)&&n>=0&&String(n)===e}function s(e){return e?.__r_raw??e}export{a as VERSION_KEY,i as getTargetType,t as hasOwn,o as isArrayIndexKey,e as isObject,s as toRaw,n as toRawType};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{batch as e,track as t,trigger as n}from"./core.mjs";import{addMutationRecorder as r,mutationRecorders as i,removeMutationRecorder as a}from"./reactive/mutation.mjs";import{adoptReactiveRoot as o,bumpAncestorVersions as s,bumpRawVersion as c,getRawVersion as l,rawMultiParentSet as u,rawParentsMap as d,rawPathMap as f,rawRootMap as p,rawVersionMap as m,recordParentLink as h,removeParentLink as g,resolvePathToTarget as _}from"./reactive/patchState.mjs";import{VERSION_KEY as v,getTargetType as y,hasOwn as b,isArrayIndexKey as x,isObject as S,toRaw as C}from"./reactive/shared.mjs";import{rawMap as w,reactiveMap as T}from"./reactive/state.mjs";import{clearPatchIndices as E,prelinkReactiveTree as D,touchReactive as O}from"./reactive/patch.mjs";import{isShallowReactive as k,shallowReactive as A}from"./reactive/shallow.mjs";function j(e){let t=C(e);return l(t)}function M(e,t,n){
|
|
1
|
+
import{batch as e,track as t,trigger as n}from"./core.mjs";import{addMutationRecorder as r,mutationRecorders as i,removeMutationRecorder as a}from"./reactive/mutation.mjs";import{adoptReactiveRoot as o,bumpAncestorVersions as s,bumpRawVersion as c,getRawVersion as l,rawMultiParentSet as u,rawParentsMap as d,rawPathMap as f,rawRootMap as p,rawVersionMap as m,recordParentLink as h,removeParentLink as g,resolvePathToTarget as _}from"./reactive/patchState.mjs";import{VERSION_KEY as v,getTargetType as y,hasOwn as b,isArrayIndexKey as x,isObject as S,toRaw as C}from"./reactive/shared.mjs";import{rawMap as w,reactiveMap as T}from"./reactive/state.mjs";import{clearPatchIndices as E,prelinkReactiveTree as D,touchReactive as O}from"./reactive/patch.mjs";import{isShallowReactive as k,shallowReactive as A}from"./reactive/shallow.mjs";function j(e){let t=C(e);return l(t)}function M(e,t,n){if(!i.size||typeof t!=`string`||t.startsWith(`__r_`))return;let r=p.get(e)??e,a=Array.isArray(e)&&(t===`length`||x(t))?`array`:`property`,o=_(r,e);if(!o){let o=/* @__PURE__ */ new Set,s=d.get(e);if(s)for(let[e,t]of s){let n=f.get(e),i=n?n.split(`.`,1)[0]:void 0,a=i?void 0:_(r,e)?.[0];for(let e of t)typeof e==`string`&&o.add(i??a??e)}else o.add(t);for(let e of i)e({root:r,kind:a,op:n,path:void 0,fallbackTopKeys:o.size?[...o]:void 0});return}let s=o.findIndex(e=>x(e));if(s!==-1){let e=o.slice(0,s).join(`.`)||void 0;for(let t of i)t({root:r,kind:`array`,op:n,path:e});return}let c=o.length?o.join(`.`):``,l=a===`array`?c||void 0:c?`${c}.${t}`:t;for(let e of i)e({root:r,kind:a,op:n,path:l})}const N={get(e,n,r){if(n===`__r_isReactive`)return!0;if(n===`__r_raw`)return e;let a=Reflect.get(e,n,r);if(t(e,n),S(a)){if(a.__r_skip)return a;let t=a?.__r_raw??a;o(t,e),h(t,e,n);let r=f.get(e);if(i.size&&typeof n==`string`&&r!=null&&!u.has(t)){let e=r?`${r}.${n}`:n;f.set(t,e)}return P(a)}return a},set(t,r,a,l){let d=b(t,r),m=Array.isArray(t),_=m?t.length:0,y=Reflect.get(t,r,l),w=S(y)?C(y):y,T=S(a)?C(a):a;if(Object.is(w,T))return!0;let E=Reflect.set(t,r,a,l);if(E){let a=S(w)?w:void 0;if(a&&g(a,t,r),S(T)&&!T.__r_skip){let e=T;o(e,t),h(e,t,r);let n=f.get(t);if(i.size&&typeof r==`string`&&n!=null&&!u.has(e)){let t=n?`${n}.${r}`:r;f.set(e,t)}}e(()=>{n(t,r),m&&typeof r==`string`&&x(r)&&Number(r)>=_&&n(t,`length`),n(t,v),c(t),s(t);let e=p.get(t);e&&e!==t&&(n(e,v),c(e)),d||n(t,Symbol.iterator)}),M(t,r,`set`)}return E},deleteProperty(t,r){let i=b(t,r),a=i?t[r]:void 0,o=Reflect.deleteProperty(t,r);if(i&&o){let i=S(a)?a?.__r_raw??a:void 0;i&&g(i,t,r),e(()=>{n(t,r),n(t,v),c(t),s(t);let e=p.get(t);e&&e!==t&&(n(e,v),c(e)),n(t,Symbol.iterator)}),M(t,r,`delete`)}return o},ownKeys(e){return t(e,Symbol.iterator),t(e,v),Reflect.ownKeys(e)}};function P(e){if(!S(e)||e.__r_isReactive)return e;let t=T.get(e);if(t)return t;if(y(e)===0)return e;let n=new Proxy(e,N);return T.set(e,n),w.set(n,e),m.has(e)||m.set(e,0),p.has(e)||p.set(e,e),n}function F(e){return!!(e&&e.__r_isReactive)}function I(e){return S(e)?P(e):e}function L(e){return S(e)&&Object.defineProperty(e,"__r_skip",{value:!0,configurable:!0,enumerable:!1,writable:!0}),e}function R(e){return S(e)&&`__r_skip`in e}export{r as addMutationRecorder,E as clearPatchIndices,I as convertToReactive,j as getReactiveVersion,S as isObject,R as isRaw,F as isReactive,k as isShallowReactive,L as markRaw,D as prelinkReactiveTree,P as reactive,a as removeMutationRecorder,A as shallowReactive,C as toRaw,O as touchReactive};
|
package/dist/reactivity/ref.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import e from"../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.mjs";import{trackEffects as t,triggerEffects as n}from"./core.mjs";import{convertToReactive as r,markRaw as i}from"./reactive.mjs";const a=`__v_isRef`;function o(e){try{Object.defineProperty(e,a,{value:!0,configurable:!0})}catch{e[a]=!0}return e}function s(e){return!!(e&&typeof e==`object`&&e.__v_isRef===!0)}var c=class{constructor(t){e(this,`_value`,void 0),e(this,`_rawValue`,void 0),e(this,`dep`,void 0),o(this),this._rawValue=t,this._value=r(t)}get value(){return this.dep||(this.dep=/* @__PURE__ */ new Set),t(this.dep),this._value}set value(e){Object.is(e,this._rawValue)||(this._rawValue=e,this._value=r(e),this.dep&&n(this.dep))}};function l(e){return s(e)?e:i(new c(e))}function u(e){return s(e)?e.value:e}function d(e){return typeof e==`function`?e():u(e)}var f=class{constructor(r,i){e(this,`_getValue`,void 0),e(this,`_setValue`,void 0),e(this,`dep`,void 0),o(this);let a=i,s=()=>{this.dep||(this.dep=/* @__PURE__ */ new Set),t(this.dep)},c=()=>{this.dep&&n(this.dep)},l=e=>e===void 0&&a!==void 0?a:e;if(typeof r==`function`){let e=r(s,c);this._getValue=()=>l(e.get()),this._setValue=t=>e.set(t);return}let u=r;this._getValue=()=>(s(),l(u.get())),this._setValue=e=>{u.set(e),c()}}get value(){return this._getValue()}set value(e){this._setValue(e)}};function p(e,t){return i(new f(e,t))}export{a as RefFlag,p as customRef,s as isRef,o as markAsRef,l as ref,d as toValue,u as unref};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{triggerEffects as e}from"./core.mjs";import{customRef as t,isRef as n}from"./ref.mjs";const r=`__v_isShallow`;function i(e){try{Object.defineProperty(e,r,{value:!0,configurable:!0})}catch
|
|
1
|
+
import{triggerEffects as e}from"./core.mjs";import{customRef as t,isRef as n}from"./ref.mjs";const r=`__v_isShallow`;function i(e){try{Object.defineProperty(e,r,{value:!0,configurable:!0})}catch{e[r]=!0}return e}function a(e,n){return i(t((t,n)=>({get(){return t(),e},set(t){Object.is(e,t)||(e=t,n())}}),n))}function o(e){return n(e)&&e[r]===!0}function s(t){if(n(t)){let n=t.dep;if(n){e(n);return}t.value=t.value}}export{o as isShallowRef,a as shallowRef,s as triggerRef};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{nextTick as e,queueJob as t}from"../../scheduler.mjs";import{touchReactive as n}from"../reactive/patch.mjs";import{isReactive as r}from"../reactive.mjs";import{isRef as i}from"../ref.mjs";import{isShallowRef as a}from"../shallowRef.mjs";import{traverse as o}from"../traverse.mjs";import{getDeepWatchStrategy as s}from"./types.mjs";function c(e){if(typeof e==`function`)return e();if(i(e))return e.value;if(r(e))return e;throw Error(`无效的 watch 源`)}function l(e){let t=Array.isArray(e),n=!t&&r(e),o=t?e.some(e=>r(e)):n,s=t?e.some(e=>a(e)):a(e),l;if(t){let t=e;l=()=>t.map(e=>c(e))}else if(typeof e==`function`)l=e;else if(i(e))l=()=>e.value;else if(n)l=()=>e;else throw Error(`无效的 watch 源`);return{getter:l,hasReactiveSource:o,hasShallowSource:s,isMultiSource:t,isReactiveSource:n}}function u(e,t,i,a,c){let l=i?t.some(e=>r(e)):a,u=c
|
|
1
|
+
import{nextTick as e,queueJob as t}from"../../scheduler.mjs";import{touchReactive as n}from"../reactive/patch.mjs";import{isReactive as r}from"../reactive.mjs";import{isRef as i}from"../ref.mjs";import{isShallowRef as a}from"../shallowRef.mjs";import{traverse as o}from"../traverse.mjs";import{getDeepWatchStrategy as s}from"./types.mjs";function c(e){if(typeof e==`function`)return e();if(i(e))return e.value;if(r(e))return e;throw Error(`无效的 watch 源`)}function l(e){let t=Array.isArray(e),n=!t&&r(e),o=t?e.some(e=>r(e)):n,s=t?e.some(e=>a(e)):a(e),l;if(t){let t=e;l=()=>t.map(e=>c(e))}else if(typeof e==`function`)l=e;else if(i(e))l=()=>e.value;else if(n)l=()=>e;else throw Error(`无效的 watch 源`);return{getter:l,hasReactiveSource:o,hasShallowSource:s,isMultiSource:t,isReactiveSource:n}}function u(e,t,i,a,c){let l=i?t.some(e=>r(e)):a,u=c??l;if(u!==!0&&typeof u!=`number`)return e;let d=typeof u==`number`?u:u?1/0:0;return()=>{let t=e(),a=s();return i&&Array.isArray(t)?t.map(e=>a===`version`&&r(e)?(n(e),e):o(e,d)):a===`version`&&r(t)?(n(t),t):o(t,d)}}function d(n,r,i,a){if(a){a(n,i);return}if(r===`sync`){n();return}if(r===`post`){e(()=>t(n));return}i?n():t(n)}export{u as applyDeepWatchGetter,l as createWatchGetter,d as dispatchScheduledJob};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{effect as e,onScopeDispose as t,stop as n}from"./core.mjs";import{getCurrentInstance as r,setCurrentInstance as i}from"../runtime/hooks/base.mjs";import{getDeepWatchStrategy as a,setDeepWatchStrategy as o}from"./watch/types.mjs";import{applyDeepWatchGetter as s,createWatchGetter as c,dispatchScheduledJob as l}from"./watch/helpers.mjs";function u(a,o,u={}){
|
|
1
|
+
import{effect as e,onScopeDispose as t,stop as n}from"./core.mjs";import{getCurrentInstance as r,setCurrentInstance as i}from"../runtime/hooks/base.mjs";import{getDeepWatchStrategy as a,setDeepWatchStrategy as o}from"./watch/types.mjs";import{applyDeepWatchGetter as s,createWatchGetter as c,dispatchScheduledJob as l}from"./watch/helpers.mjs";function u(a,o,u={}){let d=r(),f=c(a),p=s(f.getter,a,f.isMultiSource,f.isReactiveSource,u.deep),m=u.deep===!0||typeof u.deep==`number`||u.deep===void 0&&f.hasReactiveSource||f.hasShallowSource,h,g=e=>{h=e},_=f.isMultiSource?[]:void 0,v,y=!1,b=0,x=b,S,C=u.once?(e,t,n)=>{o(e,t,n),S()}:o,w=u.flush??`pre`,T=(e,t)=>!f.isMultiSource||!Array.isArray(e)||!Array.isArray(t)?!Object.is(e,t):e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n])),E=(e,t=!1)=>{if(!v.active||y||e!==b)return;let n=v();if(!t&&!m&&!T(n,_))return;h?.();let a=r();i(d);try{C(n,_,g)}finally{i(a)}_=n},D=()=>E(x),O=e=>{x=b,l(D,w,e,u.scheduler)};v=e(()=>p(),{scheduler:()=>{y||O(!1)},lazy:!0});let k=()=>{h?.(),h=void 0,n(v)};return S=k,S.stop=k,S.pause=()=>{y||(y=!0,b+=1)},S.resume=()=>{y&&v.active&&(y=!1,_=v())},u.immediate?E(b,!0):_=v(),t(S),S}function d(a,o={}){let s=r(),c,u=e=>{c=e},d,f=!1,p=0,m=p,h=o.flush??`pre`,g=e=>{d.active&&!f&&e===p&&d()},_=()=>g(m),v=e=>{m=p,l(_,h,e)};d=e(()=>{c?.(),c=void 0;let e=r();i(s);try{a(u)}finally{i(e)}},{lazy:!0,scheduler:()=>{f||v(!1)}}),v(!0);let y=()=>{c?.(),c=void 0,n(d)},b=y;return b.stop=y,b.pause=()=>{f||(f=!0,p+=1)},b.resume=()=>{f&&d.active&&(f=!1,v(!0))},t(b),b}function f(e,t={}){return d(e,{...t,flush:`post`})}function p(e,t={}){return d(e,{...t,flush:`sync`})}export{a as getDeepWatchStrategy,o as setDeepWatchStrategy,u as watch,d as watchEffect,f as watchPostEffect,p as watchSyncEffect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getCurrentMiniProgramGlobalObject as e}from"../runtime/platform/current.mjs";import{getCurrentMiniProgramTabBarPagePaths as t}from"../runtime/platform.mjs";import{installRouteStateSyncOnNativeRouter as n,notifyRouteStateSync as r}from"./routeSync.mjs";import{resolvePath as i}from"../routerInternal/path.mjs";import{parseQuery as a,stringifyQuery as o}from"../routerInternal/query.mjs";import{resolveCurrentRoute as ee}from"../routerInternal/location.mjs";import{resolveNamedRouteLocation as te}from"../routerInternal/params.mjs";import{mergeMatchedRouteMeta as ne,resolveMatchedRouteRecord as re}from"../routerInternal/matching.mjs";import{warnDuplicateRouteEntries as s}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteLookup as c,resolveRouteOptionEntries as l}from"../routerInternal/records.mjs";import{cloneRouteMeta as u,cloneRouteParams as d,createNativeRouteUrl as ie,createRouterOptionsSnapshot as ae,normalizeRouteRecordMatched as oe,snapshotRouteLocation as f}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as se}from"./types.mjs";import{createNavigationFailure as ce,executeNavigationMethod as le}from"./navigationCore.mjs";import{createNavigationResultController as ue}from"./navigationResult.mjs";import{resolveBackNavigationTarget as p,runBackNavigationGuards as m}from"./backNavigation.mjs";import{setActiveRouter as h}from"./instance.mjs";import{DEFAULT_INITIAL_NAVIGATION_TIMEOUT as de,registerInitialNavigationRunner as fe}from"./initialNavigation.mjs";import{navigateWithTarget as pe}from"./navigationTarget.mjs";import{createNavigationApi as g}from"./navigationApi.mjs";import{resolveRouteLocation as _}from"./resolve.mjs";import{createRouteRegistry as v}from"./routeRegistry.mjs";import{createRouteStateController as y,useNativeRouter as b}from"./useRoute.mjs";function x(x={}){let S=x,C=b();n(e());let w=/* @__PURE__ */ new Set,T=/* @__PURE__ */ new Set,E=/* @__PURE__ */ new Set,D=/* @__PURE__ */ new Set,O=S.maxRedirects??10,k=S.initialNavigationMode===`blocking`?`blocking`:`eager`,A=Number.isFinite(S.initialNavigationTimeout)&&(S.initialNavigationTimeout??0)>0?Math.max(1,Math.trunc(S.initialNavigationTimeout)):de,j=S.paramsMode??`loose`,M=S.rejectOnError??!0,N={parseQuery:S.parseQuery??a,stringifyQuery:S.stringifyQuery??o},P=Promise.resolve(),F=l(S);s(F);let I=c(F),L=(S.tabBarEntries??t()).map(e=>i(e,``)).filter(Boolean),R=new Set(L),z=v(I),B=0,V,H,U,me=ae(L,z.getRoutes(),j,O,k,A,N,M);function W(e){let t={...e};t.href=t.fullPath;let n=re(t,I);if(n){let e=n.record;t.name===void 0&&(t.name=e.name);let r=ne(n.matchedRecords);r!==void 0&&(t.meta=u(r)),n.params&&Object.keys(t.params).length===0&&(t.params=d(n.params)),t.matched=n.matchedRecords.map((e,t,r)=>{let i=t===r.length-1?n.matchedPath:void 0;return oe(e,i)})}else t.matched=[];return t}function G(e,t){let n=typeof e==`string`?e:te(e,I,j);return W(_(n,t,N))}let K,q;function he(e){return e.source===`page`||e.source===`native`&&e.method===`navigateBack`}function J(e,t){if(B>0||!he(t)||U!==void 0)return;if(H!==void 0){let t=H;if(H=void 0,e.fullPath===t)return}if(e.fullPath===K.fullPath)return;U=e.fullPath;let n=f(K);m({target:e,from:n,nativeRouter:C,beforeEachGuards:w,beforeResolveGuards:T,resolveWithCodec:G}).then(e=>q?.(e)).finally(()=>{U=void 0})}K=y({beforeRouteStateSync:J,resolveRoute:W}).route;let ge=e=>G(e,K.path),Y=ue({afterEachHooks:E,errorHandlers:D,nativeRouter:C,rejectOnError:M});q=Y.emitNavigationAfterEach;let X=g({nativeRouter:C,route:K,routeResolveCodec:N,namedRouteLookup:I,beforeEachGuards:w,beforeResolveGuards:T,maxRedirects:O,tabBarPathSet:R,resolveWithCodec:G,settleNavigationResult:Y.settleNavigationResult});async function Z(e,t){let n=K.fullPath;t&&(V=t),B+=1;try{let t=await e();return K.fullPath!==n&&(H=K.fullPath),t}finally{--B,B<=0&&(V=void 0)}}function Q(e){try{return G(e,K.path).fullPath}catch{return}}async function _e(e,t,n=()=>!0){return Z(async()=>{let i=f(K),a=W(ee(t,e));if(!a.path)return;if(V===a.fullPath){r({route:a,source:`router`});return}let o=await pe({mode:`push`,target:a,from:i,nativeRouter:C,routeResolveCodec:N,namedRouteLookup:I,beforeEachGuards:w,beforeResolveGuards:T,maxRedirects:O,tabBarPathSet:R,resolveWithCodec:G,executeNative:!1,allowSameLocation:!0});if(n()){if(k===`blocking`&&o.to&&o.to.fullPath!==a.fullPath){let e=o.to,t=R.has(e.path)?C.switchTab:C.redirectTo;return await le(t,{url:ie(e,N.stringifyQuery)},e,i)||(r({route:e,source:`router`}),ce(se.cancelled,e,i))}return Y.settleNavigationResult(o)}})}function ve(e){return w.add(e),()=>{w.delete(e)}}function ye(e){return T.add(e),()=>{T.delete(e)}}function be(e){return E.add(e),()=>{E.delete(e)}}function xe(e){return D.add(e),()=>{D.delete(e)}}let $={nativeRouter:C,options:me,currentRoute:K,install(e){h($);let t=e?.config?.globalProperties;t&&(t.$router=$)},resolve:ge,isReady(){return P},push:e=>Z(()=>X.push(e),Q(e)),replace:e=>Z(()=>X.replace(e),Q(e)),back:e=>Z(()=>X.back(e),p(e??1,K,G)?.fullPath),go:e=>Z(()=>X.go(e),e<0?p(Math.abs(e),K,G)?.fullPath:void 0),forward:()=>Z(()=>X.forward()),hasRoute:z.hasRoute,getRoutes:z.getRoutes,addRoute:z.addRoute,removeRoute:z.removeRoute,clearRoutes:z.clearRoutes,beforeEach:ve,beforeResolve:ye,afterEach:be,onError:xe};return h($),fe($,_e,A,k),$}export{x as createRouter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{registerInitialNavigationLifecycle as e}from"../runtime/navigationLifecycle.mjs";import{getActiveRouter as t}from"./instance.mjs";import{WEVU_INITIAL_NAVIGATION_TIMEOUT_MARKER as n}from"@weapp-core/constants";import{queueMicrotaskPolyfill as r}from"@wevu/web-apis";const i=1e4,a=/* @__PURE__ */ new WeakMap,o=/* @__PURE__ */ new WeakMap;function s(e){return Number.isFinite(e)&&e>0?Math.max(1,Math.trunc(e)):i}function c(e){return{route:typeof e.route==`string`?e.route:void 0,__route__:typeof e.__route__==`string`?e.__route__:void 0,options:e.options&&typeof e.options==`object`?{...e.options}:void 0}}function l(e){if(!e||typeof e!=`object`)return;let t={};for(let[n,r]of Object.entries(e))t[n]=Array.isArray(r)?[...r]:r;return t}function u(){let e=t();return e?a.get(e)?.timeoutMs??1e4:i}function d(e){return!!(e&&typeof e==`object`&&e.__wevuNavigationFailure)}function f(e,i,s={}){let f=o.get(e);if(f)return s.onComplete&&f.blocking&&f.subscribe(s.onComplete),s.start!==!1&&f.start(i),f.blocking?f.promise:void 0;let p=t(),m=p?a.get(p):void 0,h=m?.runner;if(!h)return;let g=m?.mode===`blocking`,_=c(e),v=l(i),y=`idle`,b,x=u(),S,C=/* @__PURE__ */ new Set,w=new Promise(e=>{S=e}),T=(e,t)=>{if(y!==`idle`&&y!==`running`)return;y=e,b!==void 0&&(clearTimeout(b),b=void 0);let n=[...C];C.clear(),h=void 0,_=void 0,v=void 0,S(t),r(()=>{if(y===`allowed`||y===`timed-out`)for(let e of n)e.active&&(e.callback(t),e.active=!1)})},E={promise:w,blocking:g,status:()=>y,subscribe(e){let t={callback:e,active:!0};return y!==`idle`&&y!==`running`?r(()=>{t.active&&(y===`allowed`||y===`timed-out`)&&(e(y===`allowed`||y===`timed-out`),t.active=!1)}):C.add(t),()=>{t.active=!1,C.delete(t)}},start(e){if(y!==`idle`)return;y=`running`,g&&(b=setTimeout(()=>{y===`running`&&(console.warn(`${n} initial navigation exceeded ${x}ms; mounting page`,_?.route??_?.__route__??``),T(`timed-out`,!0))},x));let t=_,r=l(e??v),i=h;if(h=void 0,!i||!t){T(`aborted`,!1);return}i(t,r,()=>y===`running`).then(e=>{let t=d(e);T(t?`aborted`:`allowed`,!t)},()=>{T(`aborted`,!1)})},cancel(){T(`cancelled`,!1)}};return o.set(e,E),s.onComplete&&g&&E.subscribe(s.onComplete),s.start!==!1&&E.start(i),g?w:void 0}function p(e){o.get(e)?.cancel()}function m(t,n,r=i,o=`blocking`){e({ensure:f,cancel:p}),a.set(t,{runner:n,mode:o,timeoutMs:s(r)})}export{i as DEFAULT_INITIAL_NAVIGATION_TIMEOUT,p as cancelInitialNavigation,f as ensureInitialNavigation,u as getInitialNavigationTimeout,m as registerInitialNavigationRunner};
|
package/dist/router/instance.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{injectGlobal as e,provideGlobal as t}from"../runtime/provide.mjs";const n=Symbol(`wevu.router.instance`);let r;function i(e){r=e,t(n,e)}function a(){
|
|
1
|
+
import{injectGlobal as e,provideGlobal as t}from"../runtime/provide.mjs";const n=Symbol(`wevu.router.instance`);let r;function i(e){r=e,t(n,e)}function a(){return r??e(n,void 0)}export{a as getActiveRouter,i as setActiveRouter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NavigationFailureType as e}from"./types.mjs";const t=/already|same|duplicat|重复/,n=/cancel|取消/,r=/abort|interrupt|中断/;function i(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function a(a){let o=i(a).toLowerCase();return t.test(o)?e.duplicated:n.test(o)?e.cancelled:r.test(o)?e.aborted:e.unknown}function o(e,t,n,r){let a=i(r)||`Navigation failed`;return Object.assign(Error(a),{__wevuNavigationFailure:!0,type:e,to:t,from:n,cause:r})}function s(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0||n.type===t:!1}function c(e){return!e||typeof e!=`object`?!1:`to`in e}function l(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function u(t,n,r){for(let i of t)try{let t=await i(n.to,n.from,n);if(s(t))return{status:`failure`,failure:t};if(t===!1)return{status:`failure`,failure:o(e.aborted,n.to,n.from,`Navigation aborted by guard`)};if(c(t))return n.to?{status:`redirect`,target:r(t.to,n.to.path),replace:t.replace}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)};if(l(t))return n.to?{status:`redirect`,target:r(t,n.to.path)}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)}}catch(t){return{status:`failure`,failure:o(e.aborted,n.to,n.from,t)}}return{status:`continue`}}function d(e,t,n,r){return new Promise(i=>{let s=!1,c=e=>{s||(s=!0,i(e))};try{let i=e({...t,success:()=>c(),fail:e=>{c(o(a(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>c(),e=>c(o(a(e),n,r,e)))}catch(e){c(o(a(e),n,r,e))}})}async function f(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch
|
|
1
|
+
import{NavigationFailureType as e}from"./types.mjs";const t=/already|same|duplicat|重复/,n=/cancel|取消/,r=/abort|interrupt|中断/;function i(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function a(a){let o=i(a).toLowerCase();return t.test(o)?e.duplicated:n.test(o)?e.cancelled:r.test(o)?e.aborted:e.unknown}function o(e,t,n,r){let a=i(r)||`Navigation failed`;return Object.assign(Error(a),{__wevuNavigationFailure:!0,type:e,to:t,from:n,cause:r})}function s(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0||n.type===t:!1}function c(e){return!e||typeof e!=`object`?!1:`to`in e}function l(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function u(t,n,r){for(let i of t)try{let t=await i(n.to,n.from,n);if(s(t))return{status:`failure`,failure:t};if(t===!1)return{status:`failure`,failure:o(e.aborted,n.to,n.from,`Navigation aborted by guard`)};if(c(t))return n.to?{status:`redirect`,target:r(t.to,n.to.path),replace:t.replace}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)};if(l(t))return n.to?{status:`redirect`,target:r(t,n.to.path)}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)}}catch(t){return{status:`failure`,failure:o(e.aborted,n.to,n.from,t)}}return{status:`continue`}}function d(e,t,n,r){return new Promise(i=>{let s=!1,c=e=>{s||(s=!0,i(e))};try{let i=e({...t,success:()=>c(),fail:e=>{c(o(a(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>c(),e=>c(o(a(e),n,r,e)))}catch(e){c(o(a(e),n,r,e))}})}async function f(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch{}}async function p(e,t,n){for(let r of e)try{await r(t,n)}catch{}}function m(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function h(t){return t.type===e.unknown||t.cause instanceof Error||t.type===e.aborted&&t.cause!==void 0&&!(typeof t.cause==`string`||m(t.cause))}export{o as createNavigationFailure,d as executeNavigationMethod,s as isNavigationFailure,c as isNavigationRedirectCandidate,f as runAfterEachHooks,p as runNavigationErrorHooks,u as runNavigationGuards,h as shouldEmitNavigationError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{notifyRouteStateSync as e}from"./routeSync.mjs";import{runAfterEachHooks as t,runNavigationErrorHooks as n,shouldEmitNavigationError as r}from"./navigationCore.mjs";function i(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function a(i){let{afterEachHooks:a,errorHandlers:o,nativeRouter:s,rejectOnError:c}=i;async function l(e){
|
|
1
|
+
import{notifyRouteStateSync as e}from"./routeSync.mjs";import{runAfterEachHooks as t,runNavigationErrorHooks as n,shouldEmitNavigationError as r}from"./navigationCore.mjs";function i(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function a(i){let{afterEachHooks:a,errorHandlers:o,nativeRouter:s,rejectOnError:c}=i;async function l(e){await t(a,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure}),e.failure&&r(e.failure)&&await n(o,e.failure.cause??e.failure,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure})}function u(e){return c&&r(e)}async function d(t){if(t.failure||e(t.to?{route:t.to,source:`router`}:void 0),await l(t),t.failure&&u(t.failure))throw t.failure;return t.failure}return{emitNavigationAfterEach:l,settleNavigationResult:d}}export{a as createNavigationResultController,i as createNavigationRunResult};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{resolveMatchedRouteRecord as t}from"../routerInternal/matching.mjs";import{createNativeRouteUrl as n,hasLocationQuery as r}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as i}from"./types.mjs";import{createNavigationFailure as a,executeNavigationMethod as o,isNavigationFailure as s,runNavigationGuards as c}from"./navigationCore.mjs";import{createNavigationRunResult as l}from"./navigationResult.mjs";import{applyRedirectedFrom as u,createDuplicatedFailure as d,createHashOnlyNavigationFailure as f,createTabBarQueryFailure as p,createTooManyRedirectsFailure as m,resolveRouteRecordRedirect as h}from"./navigationTargetHelpers.mjs";async function g(g){let{mode:_,target:v,from:y,nativeRouter:b,routeResolveCodec:x,namedRouteLookup:S,beforeEachGuards:C,beforeResolveGuards:w,maxRedirects:T,tabBarPathSet:E,resolveWithCodec:D,executeNative:O=!0,allowSameLocation:k=!1}=g,A=v,j=_,M=0;for(;;){
|
|
1
|
+
import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{resolveMatchedRouteRecord as t}from"../routerInternal/matching.mjs";import{createNativeRouteUrl as n,hasLocationQuery as r}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as i}from"./types.mjs";import{createNavigationFailure as a,executeNavigationMethod as o,isNavigationFailure as s,runNavigationGuards as c}from"./navigationCore.mjs";import{createNavigationRunResult as l}from"./navigationResult.mjs";import{applyRedirectedFrom as u,createDuplicatedFailure as d,createHashOnlyNavigationFailure as f,createTabBarQueryFailure as p,createTooManyRedirectsFailure as m,resolveRouteRecordRedirect as h}from"./navigationTargetHelpers.mjs";async function g(g){let{mode:_,target:v,from:y,nativeRouter:b,routeResolveCodec:x,namedRouteLookup:S,beforeEachGuards:C,beforeResolveGuards:w,maxRedirects:T,tabBarPathSet:E,resolveWithCodec:D,executeNative:O=!0,allowSameLocation:k=!1}=g,A=v,j=_,M=0;for(;;){let g=E.has(A.path);if(n(A,x.stringifyQuery)===n(y,x.stringifyQuery)&&A.hash!==y.hash)return l(j,y,A,f(A,y));if(!k&&(g?A.path===y.path:A.fullPath===y.fullPath))return l(j,y,A,d(A,y));if(g&&r(A.query))return l(j,y,A,p(A,y));let _=await c(C,{mode:j,to:A,from:y,nativeRouter:b},D);if(_.status===`failure`)return l(j,y,A,_.failure);if(_.status===`redirect`){let e=_.target,t=_.replace===!0?`replace`:_.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}let v=t(A,S)?.matchedRecords??[],N=!1;for(let e of v){if(e.redirect===void 0)continue;let t;try{t=await h(e.redirect,A,y,D)}catch(e){return l(j,y,A,a(i.aborted,A,y,e))}let n=t.replace===!1?`push`:`replace`,r=t.target;if(r.fullPath!==A.fullPath||n!==j){if(u(r,A),A=r,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));N=!0;break}}if(N)continue;let P=!1;for(let e of v){if(e.beforeEnterGuards.length===0)continue;let t=await c(new Set(e.beforeEnterGuards),{mode:j,to:A,from:y,nativeRouter:b},D);if(t.status===`failure`)return l(j,y,A,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||n!==j){if(u(e,A),A=e,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));P=!0;break}}}if(P)continue;let F=await c(w,{mode:j,to:A,from:y,nativeRouter:b},D);if(F.status===`failure`)return l(j,y,A,F.failure);if(F.status===`redirect`){let e=F.target,t=F.replace===!0?`replace`:F.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}if(!O)return l(j,y,A);if(g){let t=await o(b.switchTab,{url:e(A.path)},A,y);return s(t)?l(j,y,A,t):l(j,y,A)}let I=j===`push`?b.navigateTo:b.redirectTo,L=await o(I,{url:n(A,x.stringifyQuery)},A,y);return s(L)?l(j,y,A,L):l(j,y,A)}}export{g as navigateWithTarget};
|
package/dist/router/resolve.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolvePath as e}from"../routerInternal/path.mjs";import{normalizeHash as t,normalizeQuery as n,normalizeRouteParams as r,parseQuery as i,stringifyQuery as a}from"../routerInternal/query.mjs";import{createRouteLocation as o,parsePathInput as s}from"../routerInternal/location.mjs";const c={parseQuery:i,stringifyQuery:a};function l(i,a=``,l=c){
|
|
1
|
+
import{resolvePath as e}from"../routerInternal/path.mjs";import{normalizeHash as t,normalizeQuery as n,normalizeRouteParams as r,parseQuery as i,stringifyQuery as a}from"../routerInternal/query.mjs";import{createRouteLocation as o,parsePathInput as s}from"../routerInternal/location.mjs";const c={parseQuery:i,stringifyQuery:a};function l(i,a=``,l=c){if(typeof i==`string`){let t=s(i,l),n=e(t.path,a);return o(n,t.query,t.hash,void 0,{},l.stringifyQuery)}let u=typeof i.fullPath==`string`?s(i.fullPath,l):void 0,d=i.path??u?.path??a,f=e(d,a),p=i.query?n(i.query):u?.query??{},m=t(i.hash??u?.hash),h=typeof i.name==`string`?i.name:void 0,g=i.params?r(i.params):{};return o(f,p,m,h,g,l.stringifyQuery)}export{c as DEFAULT_ROUTE_RESOLVE_CODEC,l as resolveRouteLocation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{collectRouteNamesForRemoval as t}from"../routerInternal/matching.mjs";import{assertValidAddRouteInput as n,warnRouteConfig as r}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteNameByStaticPath as i,flattenNamedRouteRecords as a,normalizeRouteRecordRaw as o}from"../routerInternal/records.mjs";import{cloneRouteMeta as s}from"../routerInternal/snapshots.mjs";function c(t){let n={name:t.name,path:t.path?`/${t.path}`:`/`};return t.meta!==void 0&&(n.meta=s(t.meta)),t.aliasPaths.length===1?n.alias=e(t.aliasPaths[0]):t.aliasPaths.length>1&&(n.alias=t.aliasPaths.map(t=>e(t))),t.beforeEnterGuards.length===1?n.beforeEnter=t.beforeEnterGuards[0]:t.beforeEnterGuards.length>1&&(n.beforeEnter=t.beforeEnterGuards.slice()),t.redirect!==void 0&&(n.redirect=t.redirect),n}function l(s){let l=e=>s.recordByName.has(e),u=()=>Array.from(s.recordByName.values(),c),d=((c,l)=>{let u=typeof c==`string`?l:c;if(!u)throw Error(`Route record is required when adding a child route`);n(u);let d=typeof c==`string`?c:void 0,f=d?s.recordByName.get(d):void 0;if(d&&!f)throw Error(`Parent route "${d}" is not defined in createRouter({ routes | namedRoutes })`);let p=a([u],f
|
|
1
|
+
import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{collectRouteNamesForRemoval as t}from"../routerInternal/matching.mjs";import{assertValidAddRouteInput as n,warnRouteConfig as r}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteNameByStaticPath as i,flattenNamedRouteRecords as a,normalizeRouteRecordRaw as o}from"../routerInternal/records.mjs";import{cloneRouteMeta as s}from"../routerInternal/snapshots.mjs";function c(t){let n={name:t.name,path:t.path?`/${t.path}`:`/`};return t.meta!==void 0&&(n.meta=s(t.meta)),t.aliasPaths.length===1?n.alias=e(t.aliasPaths[0]):t.aliasPaths.length>1&&(n.alias=t.aliasPaths.map(t=>e(t))),t.beforeEnterGuards.length===1?n.beforeEnter=t.beforeEnterGuards[0]:t.beforeEnterGuards.length>1&&(n.beforeEnter=t.beforeEnterGuards.slice()),t.redirect!==void 0&&(n.redirect=t.redirect),n}function l(s){let l=e=>s.recordByName.has(e),u=()=>Array.from(s.recordByName.values(),c),d=((c,l)=>{let u=typeof c==`string`?l:c;if(!u)throw Error(`Route record is required when adding a child route`);n(u);let d=typeof c==`string`?c:void 0,f=d?s.recordByName.get(d):void 0;if(d&&!f)throw Error(`Parent route "${d}" is not defined in createRouter({ routes | namedRoutes })`);let p=a([u],f?.path,d,f?.aliasPaths,void 0,`addRoute`);if(p.length===0)throw Error(`Route name and path are required when adding a named route`);let m=[];for(let n of p){let i=o(n.route,n.parentName);if(!i)continue;let a=s.recordByName.get(i.name);if(a){let n=t(a.name,s.recordByName);for(let e of n)s.recordByName.delete(e);r(`addRoute() replaced existing route "${i.name}" (${e(a.path)} -> ${e(i.path)}) and removed ${n.size-1} nested route(s)`)}s.recordByName.set(i.name,i),m.push(i)}return s.nameByStaticPath=i(s.recordByName),()=>{let e=!1;for(let t of m)s.recordByName.get(t.name)===t&&(s.recordByName.delete(t.name),e=!0);e&&(s.nameByStaticPath=i(s.recordByName))}});function f(e){let n=t(e,s.recordByName);if(n.size===0)return;let r=!1;for(let e of n)r=s.recordByName.delete(e)||r;r&&(s.nameByStaticPath=i(s.recordByName))}function p(){s.recordByName.clear(),s.nameByStaticPath.clear()}return{hasRoute:l,getRoutes:u,addRoute:d,removeRoute:f,clearRoutes:p}}export{l as createRouteRegistry};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";const t=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new WeakSet;function i(e){return n.add(e),()=>{n.delete(e)}}function a(e){for(let t of n)try{t(e)}catch
|
|
1
|
+
import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";const t=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new WeakSet;function i(e){return n.add(e),()=>{n.delete(e)}}function a(e){for(let t of n)try{t(e)}catch{}}function o(e,t,n){if(e===`navigateBack`)return{method:e,source:`native`};if(t&&typeof t==`object`){let r=t.url;if(typeof r==`string`)return{method:e,page:n,source:`native`,url:r}}return{method:e,page:n,source:`native`}}function s(n){if(!n||typeof n!=`object`)return;let i=n;if(!r.has(i)){r.add(i);for(let n of t){let t=i[n];typeof t==`function`&&(i[n]=function(r,...i){let s=e(),c=s[s.length-1],l=!1,u=()=>{l||(l=!0,a(o(n,r,c)))},d=r&&typeof r==`object`?{...r,success:(...e)=>{u();let t=r.success;return typeof t==`function`?t(...e):void 0}}:r,f=t.call(this,d,...i);return f&&typeof f.then==`function`&&f.then(u,()=>{}),f})}}}export{s as installRouteStateSyncOnNativeRouter,a as notifyRouteStateSync,i as registerRouteStateSyncHandler};
|
package/dist/router/useRoute.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{getCurrentMiniProgramPages as n}from"../runtime/platform.mjs";import{getCurrentSetupContext as r}from"../runtime/hooks/base.mjs";import{onLoad as i,onReady as a,onRouteDone as o,onShow as s,onUnload as c}from"../runtime/hooks/register.mjs";import{
|
|
1
|
+
import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{getCurrentMiniProgramPages as n}from"../runtime/platform.mjs";import{getCurrentSetupContext as r}from"../runtime/hooks/base.mjs";import{onLoad as i,onReady as a,onRouteDone as o,onShow as s,onUnload as c}from"../runtime/hooks/register.mjs";import{registerRouteStateSyncHandler as l}from"./routeSync.mjs";import{resolveCurrentRoute as u,resolvePageRoute as d}from"../routerInternal/location.mjs";import{cloneLocationQuery as f,cloneRouteLocationRedirectedFrom as p,cloneRouteMeta as m,cloneRouteParams as h,cloneRouteRecordMatchedList as g}from"../routerInternal/snapshots.mjs";import{useNativePageRouter as _,useNativeRouter as v}from"../runtime/vueCompat/router.mjs";import{getActiveRouter as y}from"./instance.mjs";import{resolveRouteLocation as b}from"./resolve.mjs";import{WEVU_NATIVE_INSTANCE_KEY as x}from"@weapp-core/constants";function S(e){return typeof e.route==`string`||typeof e.__route__==`string`}function C(e){let t=e[x];return t&&typeof t==`object`?t:e}function w(e,t,r){if(r?.source===`router`||!t)return!0;let i=C(e);if(r?.page)return r.page===i;let a=n();return a[a.length-1]===i}function T(e,t){e.path=t.path,e.fullPath=t.fullPath,e.query=f(t.query),e.hash=t.hash,e.params=h(t.params),t.name===void 0?delete e.name:e.name=t.name,t.meta===void 0?delete e.meta:e.meta=m(t.meta),t.href===void 0?delete e.href:e.href=t.href,t.matched===void 0?delete e.matched:e.matched=g(t.matched),t.redirectedFrom===void 0?delete e.redirectedFrom:e.redirectedFrom=p(t.redirectedFrom)}function E(p={}){let m=r(),g=m?.instance&&typeof m.instance==`object`?m.instance:void 0,_=p.resolveRoute??(e=>y()?.resolve(e)??e),v=_(u(void 0,g)),x=e({path:v.path,fullPath:v.fullPath,query:f(v.query),hash:v.hash,params:h(v.params)});T(x,v);function E(e,t,n){let r=_(t||u(e,g));n&&p.beforeRouteStateSync?.(r,n),T(x,r)}if(!g)return l(e=>{if(e?.route){E(void 0,e.route,e);return}if(e?.url){E(void 0,b(e.url,x.path),e);return}if(e?.page){E(void 0,d(e.page),e);return}E(void 0,void 0,e)}),{route:t(x)};let D=g,O=C(D),k=S(O)||n().includes(O);i(e=>{E(e)}),a(()=>{E()}),s(()=>{E()}),o(()=>{E()});let A=l(e=>{if(w(D,k,e)){if(e?.route){E(void 0,e.route,e);return}if(e?.url){E(void 0,b(e.url,x.path),e);return}if(e?.page){E(void 0,d(e.page),e);return}E(void 0,void 0,e)}});return c(()=>{A()}),{route:t(x)}}function D(e={}){return E(e).route}function O(){return v()}function k(){return _()}export{E as createRouteStateController,k as useNativePageRouter,O as useNativeRouter,D as useRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";import{getCurrentPageInstance as t}from"../runtime/register/component/lifecycle/platform.mjs";import{createAbsoluteRoutePath as n,resolvePath as r}from"./path.mjs";import{normalizeHash as i,normalizeQuery as a,parseQuery as o,stringifyQuery as s}from"./query.mjs";const c={parseQuery:o,stringifyQuery:s};function l(e,t=c){let n=e.indexOf(`#`),r=n>=0?e.slice(0,n):e,o=n>=0?i(e.slice(n+1)):``,s=r.indexOf(`?`);return s<0?{path:r,query:{},hash:o}:{path:r.slice(0,s),query:a(t.parseQuery(r.slice(s+1))),hash:o}}function u(e,t,a=``,o,c={},l=s){let u=r(e,``),d=l(t),f=n(u),p=i(a),m=d?`${f}?${d}`:f,h={path:u,fullPath:p?`${m}${p}`:m,query:t,hash:p,params:c};return o!==void 0&&(h.name=o),h}function d(e){return typeof
|
|
1
|
+
import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";import{getCurrentPageInstance as t}from"../runtime/register/component/lifecycle/platform.mjs";import{createAbsoluteRoutePath as n,resolvePath as r}from"./path.mjs";import{normalizeHash as i,normalizeQuery as a,parseQuery as o,stringifyQuery as s}from"./query.mjs";const c={parseQuery:o,stringifyQuery:s};function l(e,t=c){let n=e.indexOf(`#`),r=n>=0?e.slice(0,n):e,o=n>=0?i(e.slice(n+1)):``,s=r.indexOf(`?`);return s<0?{path:r,query:{},hash:o}:{path:r.slice(0,s),query:a(t.parseQuery(r.slice(s+1))),hash:o}}function u(e,t,a=``,o,c={},l=s){let u=r(e,``),d=l(t),f=n(u),p=i(a),m=d?`${f}?${d}`:f,h={path:u,fullPath:p?`${m}${p}`:m,query:t,hash:p,params:c};return o!==void 0&&(h.name=o),h}function d(e){return typeof e?.route==`string`&&e.route.length>0||typeof e?.__route__==`string`&&e.__route__.length>0}function f(n){let r=e();if(Array.isArray(r)&&r.length>0){let e=r[r.length-1];if(d(e))return e}let i=t();return d(i)?i:n}function p(e,t){if(!e)return u(``,{});let n=typeof e.route==`string`?e.route:typeof e.__route__==`string`?e.__route__:``,r=t??e.options??{};return u(n,a(r),``,void 0,{})}function m(e,t){return p(f(t),e)}export{u as createRouteLocation,l as parsePathInput,m as resolveCurrentRoute,p as resolvePageRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeRouteParams as e}from"./query.mjs";const t=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function n(e){
|
|
1
|
+
import{normalizeRouteParams as e}from"./query.mjs";const t=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function n(e){let n=t.exec(e);if(n)return{key:n[1],modifier:n[2]??``}}function r(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function i(e){return encodeURIComponent(e)}function a(e){try{return decodeURIComponent(e)}catch{return e}}function o(e,t,a){let o=[],s=/* @__PURE__ */ new Set;for(let c of e.split(`/`)){if(!c)continue;let e=n(c);if(!e){o.push(c);continue}let l=r(t[e.key]);if(e.modifier===``){if(l.length!==1)throw Error(`Missing required param "${e.key}" for named route "${a}"`);s.add(e.key),o.push(i(l[0]));continue}if(e.modifier===`?`){if(l.length===0)continue;if(l.length>1)throw Error(`Param "${e.key}" for named route "${a}" must be a single value`);s.add(e.key),o.push(i(l[0]));continue}if(e.modifier===`+`){if(l.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${a}"`);s.add(e.key);for(let e of l)o.push(i(e));continue}l.length>0&&s.add(e.key);for(let e of l)o.push(i(e))}return{path:o.join(`/`),consumedKeys:s}}function s(e){return e===void 0?!1:!Array.isArray(e)||e.length>0}function c(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>s(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function l(t,n,r){let i=t.name;if(typeof i!=`string`||!i||t.path!==void 0||t.fullPath!==void 0)return t;let a=n.recordByName.get(i);if(!a)throw Error(`Named route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let s=t.params?e(t.params):{},l=o(a.path,s,i);return r===`strict`&&c(s,l.consumedKeys,i),{...t,path:l.path?`/${l.path}`:`/`,params:s}}export{a as decodeRouteParamSegment,n as parsePathParamToken,l as resolveNamedRouteLocation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbsoluteRoutePath as e,isDynamicRoutePath as t,resolvePath as n}from"./path.mjs";import{warnRouteConfig as r}from"./recordsWarnings.mjs";function i(e){return e?Array.isArray(e)?e:[e]:[]}function a(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function o(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){if(typeof e!=`string`)continue;let r=n(e,``);r&&r!==t&&(i.includes(r)||i.push(r))}return i}function s(e,t,r=`namedRoutes`){let s=n(e.path,``);if(!s&&e.path!==`/`)return;let c=a(e,s,r);if(c)return{name:c,path:s,aliasPaths:o(e.alias,s),parentName:t,meta:e.meta,beforeEnterGuards:i(e.beforeEnter),redirect:e.redirect}}function c(t,r){return!r||t.startsWith(`/`)?n(t,``):n(`${e(r)}/${t}`,``)}function l(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function u(e){let t=[];for(let n of e)n&&!t.includes(n)&&t.push(n);return t}function d(t){if(t.length!==0)return t.length===1?e(t[0]):t.map(t=>e(t))}function f(t,n,i,o=[],s,p=`namedRoutes`,m=/* @__PURE__ */ new Set){let h=[];for(let[g,_]of t.entries()){let t=`${p}[${g}]`;if(m.has(_)){r(`ignored route record at ${t}: detected circular children reference`);continue}if(typeof _.path!=`string`||!_.path){let e=typeof
|
|
1
|
+
import{createAbsoluteRoutePath as e,isDynamicRoutePath as t,resolvePath as n}from"./path.mjs";import{warnRouteConfig as r}from"./recordsWarnings.mjs";function i(e){return e?Array.isArray(e)?e:[e]:[]}function a(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function o(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){if(typeof e!=`string`)continue;let r=n(e,``);r&&r!==t&&(i.includes(r)||i.push(r))}return i}function s(e,t,r=`namedRoutes`){let s=n(e.path,``);if(!s&&e.path!==`/`)return;let c=a(e,s,r);if(c)return{name:c,path:s,aliasPaths:o(e.alias,s),parentName:t,meta:e.meta,beforeEnterGuards:i(e.beforeEnter),redirect:e.redirect}}function c(t,r){return!r||t.startsWith(`/`)?n(t,``):n(`${e(r)}/${t}`,``)}function l(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function u(e){let t=[];for(let n of e)n&&!t.includes(n)&&t.push(n);return t}function d(t){if(t.length!==0)return t.length===1?e(t[0]):t.map(t=>e(t))}function f(t,n,i,o=[],s,p=`namedRoutes`,m=/* @__PURE__ */ new Set){let h=[];for(let[g,_]of t.entries()){let t=`${p}[${g}]`;if(m.has(_)){r(`ignored route record at ${t}: detected circular children reference`);continue}if(typeof _.path!=`string`||!_.path){let e=typeof _?.name==`string`?_.name.trim():``;r(`ignored route record "${e}" at ${t}: route path is required`);continue}let v=c(_.path,n),y=a(_,v,s);if(!y){r(`ignored route record at ${t}: route name is required`);continue}let b=[],x=/* @__PURE__ */ new Map;for(let i of l(_.alias)){let a=c(i,n);if(!a)continue;if(a===v){r(`ignored alias "${e(a)}" for route "${y}" at ${t}: alias is same as route path`);continue}let o=x.get(a);if(o){r(`ignored duplicate alias "${e(a)}" for route "${y}" at ${t}: already declared by "${o}"`);continue}x.set(a,i),b.push(a)}let S=_.path.startsWith(`/`)?[]:o.map(e=>c(_.path,e)).filter(Boolean).filter(e=>e!==v),C=u([...b,...S]),w={name:y,path:v?e(v):`/`,alias:d(C),meta:_.meta,beforeEnter:_.beforeEnter,redirect:_.redirect};if(h.push({route:w,parentName:i,source:s}),Array.isArray(_.children)&&_.children.length>0){let e=new Set(m);e.add(_),h.push(...f(_.children,v,y,C,s,`${t}.children`,e))}}return h}function p(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return f(e,void 0,void 0,[],t,t);let n=[];for(let[i,a]of Object.entries(e)){let e=typeof i==`string`?i.trim():``;if(!e){r(`ignored route record at ${t}: route name is required`);continue}if(typeof a!=`string`||!a){r(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:a},source:t})}return n}function m(e){return[...p(e.routes,`routes`),...p(e.namedRoutes,`namedRoutes`)]}function h(e){let n=/* @__PURE__ */ new Map;for(let[r,i]of e.entries()){!t(i.path)&&!n.has(i.path)&&n.set(i.path,r);for(let e of i.aliasPaths)!t(e)&&!n.has(e)&&n.set(e,r)}return n}function g(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=s(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:h(t)}}export{g as createNamedRouteLookup,h as createNamedRouteNameByStaticPath,d as createRouteRecordAliasValue,f as flattenNamedRouteRecords,s as normalizeRouteRecordRaw,m as resolveRouteOptionEntries};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbsoluteRoutePath as e,resolvePath as t}from"./path.mjs";function n(e){typeof console<`u`&&typeof console.warn==`function`&&console.warn(`[wevu/router] ${e}`)}function r(n){let r=t(n,``);return r?e(r):`/`}function i(e,t=/* @__PURE__ */ new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(i(t,n))return!0;return!1}function a(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(i(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function o(e){let t=/* @__PURE__ */ new Map,i=[];for(let n of e){
|
|
1
|
+
import{createAbsoluteRoutePath as e,resolvePath as t}from"./path.mjs";function n(e){typeof console<`u`&&typeof console.warn==`function`&&console.warn(`[wevu/router] ${e}`)}function r(n){let r=t(n,``);return r?e(r):`/`}function i(e,t=/* @__PURE__ */ new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(i(t,n))return!0;return!1}function a(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(i(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function o(e){let t=/* @__PURE__ */ new Map,i=[];for(let n of e){let e=typeof n.route.name==`string`?n.route.name.trim():``;if(!e)continue;let a=n.source??`namedRoutes`,o=r(n.route.path),s=t.get(e);s&&i.push(`"${e}" (${s.source}:${s.path} -> ${a}:${o})`),t.set(e,{source:a,path:o})}i.length!==0&&n(`duplicate route names detected, later entries override earlier ones: ${i.join(`, `)}`)}export{a as assertValidAddRouteInput,o as warnDuplicateRouteEntries,n as warnRouteConfig};
|
|
@@ -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
|
|
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?.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?.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);){n.add(r);let e=r[v]?.config?.globalProperties;if(e&&i(e,t))return{found:!0,value:e[t]};r=r[h]}let a=typeof globalThis<`u`?globalThis.getApp:void 0;if(typeof a==`function`)try{let e=a()?.[v]?.config?.globalProperties;if(e&&i(e,t))return{found:!0,value:e[t]}}catch{}return{found:!1,value:void 0}},z=e=>{let t=e&&Reflect.get(e,`selectOwnerComponent`);if(typeof t==`function`)try{let n=t.call(e);if(!n||typeof n!=`object`)return;let r=Reflect.get(n,_);if(typeof r==`function`){let e=r.call(n);if(e)return e}return n[y]?.proxy??n.__wevu?.proxy??n}catch{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 c=n[g];if(c&&typeof c==`object`&&i(c,r))return Reflect.get(c,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`)return t(n).$slots??Object.freeze(Object.create(null));if(r===`$refs`)return t(n).$refs??Object.create(null);if(r===`$parent`)return z(I(n,a));if(r===`$options`){let e=I(n,a);return{name:e?.[d]??e?.name??e?.is}}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 l=R(I(n,a),r);if(l.found)return l.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 c=Reflect.get(n,r,a);return typeof r==`string`&&i(S,r)?Reflect.get(S,r,a):c},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)){let a=Reflect.get(e,t,o);return n(a)&&!n(r)?(a.value=r,!0):i(e[g]??{},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{let n=t.get?.bind(B);if(!n)throw Error(`计算属性 "${e}" 需要提供 getter`);let r=t.set?.bind(B);r?(A[e]=r,k[e]=M(e,n,r)):k[e]=M(e,n)}}),{boundMethods:O,computedRefs:k,computedSetters:A,dirtyComputedKeys:j,computedProxy:N,publicInstance:B,touchSetupMethodsVersion(){P.value+=1}}}export{b as createRuntimeContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return e!==`patch`&&e!==`diff`}function t(t){if(t!==`off`)return n=>{
|
|
1
|
+
function e(e){return e!==`patch`&&e!==`diff`}function t(t){if(t!==`off`)return n=>{if(t===`fallback`&&!e(n.reason))return;let r=typeof n.bytes==`number`?n.bytes:n.estimatedBytes,i=typeof r==`number`?`${r}B`:`unknown`,a=[`mode=${n.mode}`,`reason=${n.reason}`,`pending=${n.pendingPatchKeys}`,`keys=${n.payloadKeys}`,`bytes=${i}`];if(typeof n.revision==`number`&&a.push(`revision=${n.revision}`),typeof n.committedRevision==`number`&&a.push(`committedRevision=${n.committedRevision}`),typeof n.mergedSiblingParents==`number`&&a.push(`mergedParents=${n.mergedSiblingParents}`),typeof n.computedDirtyKeys==`number`&&a.push(`computedDirty=${n.computedDirtyKeys}`),typeof n.flushCount==`number`&&a.push(`flushes=${n.flushCount}`),typeof n.windowMs==`number`&&a.push(`window=${n.windowMs}ms`),n.targetLabel&&a.push(`target=${n.targetLabel}`),n.bindings?.length){let e=n.bindings.map(e=>{let t=e.sourceLocation?.start;return t?`${e.id}@${e.sourceFile}:${t.line}:${t.column}`:`${e.id}@${e.sourceFile}`});a.push(`bindings=${e.join(`,`)}`)}n.message&&a.push(`message=${n.message}`);let o=`[wevu:setData] ${a.join(` `)}`;if(e(n.reason)){console.warn(o);return}console.info(o)}}export{t as createDiagnosticsLogger};
|
|
@@ -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
|
|
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 ae}from"./setData/scheduler.mjs";import{resolveSetDataOptions as oe}from"./setDataOptions.mjs";import{WEVU_ATTRS_KEY as se,WEVU_PROPS_DERIVED_KEYS_KEY as u,WEVU_PROPS_KEY as d,WEVU_SETUP_STATE_KEY as f}from"@weapp-core/constants";function p(e,t){let n=(()=>{e()});return n.stop=()=>n(),n.pause=()=>{t?.pause?.()},n.resume=()=>{t?.resume?.()},n}function ce(e){return typeof e==`function`?e():e??{}}function m(m){let{data:le,resolvedComputed:ue,resolvedMethods:de,appConfig:h,setDataOptions:g,bindingManifest:_}=m;return m=>{g?.strategy===`patch`&&s(`patchStrategy`,`createRuntimeMount(setData.strategy="patch")`);let v=ce(le),y=m?.__wevu_initialProps;if(v&&typeof v==`object`&&!c(v,d))try{Object.defineProperty(v,d,{value:i(Object.create(null)),configurable:!0,enumerable:!1,writable:!1})}catch{}let b=v&&typeof v==`object`?v[d]:void 0;b&&typeof b==`object`&&y&&typeof y==`object`&&Object.assign(b,y);let x=o(v),S=o(Object.create(null)),C=m?.__wevu_snapshotOmitKeys,fe=!!m?.__wevu_deferInitialSnapshot,w=m?.__wevu_initialSnapshot,T=m?.__wevu_initialState,E=new Set(C instanceof Set||Array.isArray(C)?C:[]);if(v&&typeof v==`object`&&!c(v,f))try{Object.defineProperty(v,f,{value:S,configurable:!0,enumerable:!1,writable:!1})}catch{}if(v&&typeof v==`object`&&T&&typeof T==`object`)for(let[e,t]of Object.entries(T))E.has(e)||(v[e]=t);let pe=ue,me=de,D=!0,O=[],k=/* @__PURE__ */ new Set;Object.keys(x).forEach(e=>{let t=x[e];ne(t)&&k.add(e)});let{includeComputed:A,setDataStrategy:j,maxPatchKeys:M,maxPayloadBytes:N,mergeSiblingThreshold:P,mergeSiblingMaxInflationRatio:F,mergeSiblingMaxParentBytes:I,mergeSiblingSkipArray:L,computedCompare:R,computedCompareMaxDepth:z,computedCompareMaxKeys:he,prelinkMaxDepth:ge,prelinkMaxKeys:_e,debug:B,diagnostics:V,loopWarning:H,debugWhen:ve,debugSampleRate:ye,elevateTopKeyThreshold:be,toPlainMaxDepth:xe,toPlainMaxKeys:Se,includeFunctions:Ce,functionPaths:we,shouldIncludeKey:Te}=oe(g),U=l(V),W=V===`off`&&H?l(`fallback`):void 0,Ee=B||U||W?e=>{if(typeof B==`function`)try{B(e)}catch{}U?.(e),e.reason===`loopWarning`&&W?.(e)}:void 0,De=V===`always`?`always`:ve,{boundMethods:Oe,computedRefs:G,computedSetters:ke,dirtyComputedKeys:Ae,computedProxy:je,publicInstance:K,touchSetupMethodsVersion:q}=ie({state:x,setupState:S,computedDefs:pe,methodDefs:me,appConfig:h,includeComputed:A,setDataStrategy:j}),J=m??{setData:()=>{}},Me=J.__wevu_targetLabel,Y,X={state:x,setupState:S,snapshotOmitKeys:E,computedRefs:G,dirtyComputedKeys:Ae,includeComputed:A,setDataStrategy:j,computedCompare:R,computedCompareMaxDepth:z,computedCompareMaxKeys:he,currentAdapter:J,shouldIncludeKey:Te,maxPatchKeys:M,maxPayloadBytes:N,mergeSiblingThreshold:P,mergeSiblingMaxInflationRatio:F,mergeSiblingMaxParentBytes:I,mergeSiblingSkipArray:L,elevateTopKeyThreshold:be,prelinkMaxDepth:ge,prelinkMaxKeys:_e,toPlainMaxDepth:xe,toPlainMaxKeys:Se,includeFunctions:Ce,functionPaths:we,debug:Ee,debugWhen:De,debugSampleRate:ye,bindingManifest:_,loopWarning:H,targetLabel:Me,runTracker:()=>Y?.(),isMounted:()=>D,initialSnapshot:w&&typeof w==`object`?w:void 0,initialState:T&&typeof T==`object`?T:void 0},Z=j===`patch`?s(`patchStrategy`,`createRuntimeMount(setData.strategy="patch")`).createScheduler(X):ae(X),Q=()=>Z.job();Y=t(()=>{r(x);let e=x[d];a(e)&&r(e);let t=x[se];a(t)&&r(t),k.forEach(e=>{let t=S[e]??x[e];re(t)})},{lazy:!0,scheduler:()=>e(Q)}),fe||Q(),O.push(p(()=>n(Y))),Z.start?.(),Z.dispose&&O.push(p(Z.dispose));function Ne(e,t,n){let r=ee(e,(e,n)=>t(e,n),n);return O.push(r),p(()=>{r();let e=O.indexOf(r);e>=0&&O.splice(e,1)},r)}let $={get state(){return x},get setupState(){return S},get proxy(){return K},get methods(){return Oe},get computed(){return je},get adapter(){return J},bindModel:te(K,x,G,ke,S),watch:Ne,snapshot:()=>Z.snapshot(),unmount:()=>{if(D){D=!1,Z.dispose?.();try{J.__wevu_disposeSetData?.()}catch{}O.forEach(e=>{try{e()}catch{}}),O.length=0}}};try{Object.defineProperty($,"__wevu_touchSetupMethodsVersion",{value:q,configurable:!0,enumerable:!1,writable:!1})}catch{$.__wevu_touchSetupMethodsVersion=q}try{Object.defineProperty($,"__wevu_flushSetupSnapshotSync",{value:Q,configurable:!0,enumerable:!1,writable:!1})}catch{$.__wevu_flushSetupSnapshotSync=Q}try{Object.defineProperty($,"__wevu_cloneDispatchedSnapshot",{value:Z.cloneLatestSnapshot,configurable:!0,enumerable:!1,writable:!1})}catch{$.__wevu_cloneDispatchedSnapshot=Z.cloneLatestSnapshot}try{Object.defineProperty($,"__wevu_trackSetupReactiveKey",{value:e=>{k.add(e)},configurable:!0,enumerable:!1,writable:!1})}catch{$.__wevu_trackSetupReactiveKey=e=>{k.add(e)}}try{Object.defineProperty($,u,{value:E,configurable:!0,enumerable:!1,writable:!1})}catch{$[u]=E}return $}}export{m 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
|
|
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{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{}},m=e=>{e.resolveCommit?.(),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?.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:()=>n.adapter.setData?.(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=/* @__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){
|
|
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){let n=t.split(`.`,1)[0];e.set(n,(e.get(n)??0)+1)}for(let[t,n]of e)n>=w&&M.add(t)}let z=R.filter(([e])=>{for(let t of M)if(e===t||e.startsWith(`${t}.`))return!1;return!0}),B=new Map(z);j.clear();let V=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},H=t=>{if(I.has(t))return I.get(t);let n=a(e(V(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]=H(e),B.set(e,{kind:`property`,op:`set`}));M.clear()}for(let[e,t]of z)L[e]=(t.kind===`array`?`set`:t.op)===`delete`?null:H(e);let U=0,W=Object.create(null);if(p&&f.size){let t=[...f];f.clear(),U=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),W[o]=n(t))}}let G=s(L),K=0;if(b){let e=c({input:G,entryMap:B,getPlainByPath:H,mergeSiblingThreshold:b,mergeSiblingSkipArray:C,mergeSiblingMaxParentBytes:S,mergeSiblingMaxInflationRatio:x});K=e.merged,G=s(e.out)}let q=o(G,y),J=Object.keys(G).length,Y={mode:q.fallback?`diff`:`patch`,reason:q.fallback?`maxPayloadBytes`:`patch`,pendingPatchKeys:z.length,payloadKeys:J,mergedSiblingParents:K||void 0,computedDirtyKeys:U||void 0,estimatedBytes:q.estimatedBytes,bytes:q.bytes};if(q.fallback)return{type:`fallback`,reason:`maxPayloadBytes`,debug:Y};if(!J)return;let X={...N},Z=/* @__PURE__ */ new WeakSet;for(let[e,n]of Object.entries(G)){let r=B.get(e);t(X,e,n,r?.kind===`array`?`set`:r?.op??`set`,{cloneValue:!1,clonedParents:Z})}return{type:`patch`,payload:G,snapshot:X,computedUpdates:Object.keys(W).length?W:void 0,debug:Y}}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,/* @__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
|
|
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{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){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=d.get(a)??[];o.push(e),d.set(a,o)}let p=[...d.entries()].filter(([e,t])=>t.length>=o&&!f.has(e)).sort((e,t)=>t[0].split(`.`).length-e[0].split(`.`).length);if(!p.length)return{out:r,merged:0};let m={};Object.assign(m,r);let h=0,g=/* @__PURE__ */ new WeakMap,_=e=>{if(e&&typeof e==`object`){let t=g.get(e);if(t!==void 0)return t;let r=n(e,1/0,/* @__PURE__ */ new WeakSet);return g.set(e,r),r}return n(e,1/0,/* @__PURE__ */ new WeakSet)},v=(e,t)=>2+e.length+1+_(t);for(let[t,n]of p){if(e(m,t))continue;let r=n.filter(t=>e(m,t));if(r.length<o)continue;let i=a(t);if(!(s&&Array.isArray(i))&&!(c!==1/0&&v(t,i)>c)){if(l!==1/0){let e=0;for(let t of r)e+=v(t,m[t]);if(v(t,i)>e*l)continue}m[t]=i;for(let e of r)delete m[e];h+=1}}return{out:m,merged:h}}export{r as checkPayloadSize,t as collapsePayload,n as estimateJsonSize,i as mergeSiblingPayload};
|