wevu 7.0.4 → 7.1.1
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 +20 -4
- package/dist/alipay/jsx-runtime.d.mts +12 -0
- package/dist/alipay/jsx-runtime.mjs +1 -0
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/defineProperty.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/toPrimitive.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/toPropertyKey.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/typeof.mjs +1 -1
- package/dist/dev/api/vitest/setup.d.mts +1 -0
- package/dist/dev/api/vitest.d.mts +1 -0
- package/dist/dev/api.d.mts +1 -0
- package/dist/dev/compiler.d.mts +1 -0
- package/dist/dev/fetch.d.mts +9 -0
- package/dist/dev/index.d.mts +72 -0
- package/dist/dev/index.mjs +12 -15
- package/dist/dev/internal-reactivity.d.mts +18 -0
- package/dist/dev/internal-reactivity.mjs +3 -2
- package/dist/dev/internal-runtime.d.mts +44 -0
- package/dist/dev/internal-runtime.mjs +19 -14
- package/dist/dev/internal-template.d.mts +2 -0
- package/dist/dev/jsxTypes.d.mts +9 -0
- package/dist/dev/macros/shared.d.mts +81 -0
- package/dist/dev/macros.d.mts +71 -0
- package/dist/dev/package.mjs +1 -1
- package/dist/dev/reactivity/asyncDerivation.d.mts +41 -0
- package/dist/dev/reactivity/asyncDerivation.mjs +130 -0
- package/dist/dev/reactivity/asyncDerivation.mjs.map +1 -0
- package/dist/dev/reactivity/computed.d.mts +21 -0
- package/dist/dev/reactivity/computed.mjs +2 -2
- package/dist/dev/reactivity/computed.mjs.map +1 -1
- package/dist/dev/reactivity/core.d.mts +35 -0
- package/dist/dev/reactivity/core.mjs +156 -32
- package/dist/dev/reactivity/core.mjs.map +1 -1
- package/dist/dev/reactivity/index.d.mts +16 -0
- package/dist/dev/reactivity/reactive/mutation.d.mts +21 -0
- package/dist/dev/reactivity/reactive/patch.d.mts +18 -0
- package/dist/dev/reactivity/reactive/shallow.d.mts +22 -0
- package/dist/dev/reactivity/reactive/shared.d.mts +4 -0
- package/dist/dev/reactivity/reactive.d.mts +42 -0
- package/dist/dev/reactivity/readonly.d.mts +27 -0
- package/dist/dev/reactivity/readonly.mjs.map +1 -1
- package/dist/dev/reactivity/ref.d.mts +27 -0
- package/dist/dev/reactivity/ref.mjs +1 -1
- package/dist/dev/reactivity/shallowRef.d.mts +19 -0
- package/dist/dev/reactivity/toRefs.d.mts +43 -0
- package/dist/dev/reactivity/traverse.d.mts +8 -0
- package/dist/dev/reactivity/watch/types.d.mts +43 -0
- package/dist/dev/reactivity/watch.d.mts +22 -0
- package/dist/dev/router/createRouter.d.mts +8 -0
- package/dist/dev/router/createRouter.mjs +16 -3
- package/dist/dev/router/createRouter.mjs.map +1 -1
- package/dist/dev/router/navigationCore.d.mts +6 -0
- package/dist/dev/router/resolve.d.mts +6 -0
- package/dist/dev/router/routeSync.d.mts +1 -0
- package/dist/dev/router/types.d.mts +172 -0
- package/dist/dev/router/useRoute.d.mts +19 -0
- package/dist/dev/router/useRoute.mjs +23 -5
- package/dist/dev/router/useRoute.mjs.map +1 -1
- package/dist/dev/router/useRouter.d.mts +8 -0
- package/dist/dev/router.d.mts +10 -0
- package/dist/dev/routerInternal/query.d.mts +7 -0
- package/dist/dev/routerInternal/types.d.mts +9 -0
- package/dist/dev/runtime/app/computed.mjs +2 -2
- package/dist/dev/runtime/app/computed.mjs.map +1 -1
- package/dist/dev/runtime/app/context.mjs +8 -2
- package/dist/dev/runtime/app/context.mjs.map +1 -1
- package/dist/dev/runtime/app/diagnostics.mjs +12 -0
- package/dist/dev/runtime/app/diagnostics.mjs.map +1 -1
- package/dist/dev/runtime/app/mount.mjs +31 -28
- package/dist/dev/runtime/app/mount.mjs.map +1 -1
- package/dist/dev/runtime/app/pending.d.mts +10 -0
- package/dist/dev/runtime/app/setData/commitTracker.d.mts +13 -0
- package/dist/dev/runtime/app/setData/commitTracker.mjs +265 -0
- package/dist/dev/runtime/app/setData/commitTracker.mjs.map +1 -0
- package/dist/dev/runtime/app/setData/patchScheduler.mjs +47 -51
- package/dist/dev/runtime/app/setData/patchScheduler.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/scheduler.d.mts +51 -0
- package/dist/dev/runtime/app/setData/scheduler.mjs +98 -111
- package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/snapshot.mjs +11 -1
- package/dist/dev/runtime/app/setData/snapshot.mjs.map +1 -1
- package/dist/dev/runtime/app.d.mts +8 -0
- package/dist/dev/runtime/app.mjs +18 -6
- package/dist/dev/runtime/app.mjs.map +1 -1
- package/dist/dev/runtime/bindingManifest.mjs +105 -0
- package/dist/dev/runtime/bindingManifest.mjs.map +1 -0
- package/dist/dev/runtime/capabilities.d.mts +75 -0
- package/dist/dev/runtime/capabilities.mjs +40 -0
- package/dist/dev/runtime/capabilities.mjs.map +1 -0
- package/dist/dev/runtime/css.d.mts +14 -0
- package/dist/dev/runtime/defaults.d.mts +12 -0
- package/dist/dev/runtime/define/componentDefinition.mjs +3 -0
- package/dist/dev/runtime/define/componentDefinition.mjs.map +1 -1
- package/dist/dev/runtime/define/optionsApi.mjs +1 -1
- package/dist/dev/runtime/define/props.mjs +30 -60
- package/dist/dev/runtime/define/props.mjs.map +1 -1
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +37 -21
- package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
- package/dist/dev/runtime/define.d.mts +118 -0
- package/dist/dev/runtime/define.mjs +32 -44
- package/dist/dev/runtime/define.mjs.map +1 -1
- package/dist/dev/runtime/diff.mjs +1 -1
- package/dist/dev/runtime/disposables.d.mts +31 -0
- package/dist/dev/runtime/elementIntersectionObserver.d.mts +26 -0
- package/dist/dev/runtime/features/inlineEvents.d.mts +7 -0
- package/dist/dev/runtime/features/inlineEvents.mjs +25 -0
- package/dist/dev/runtime/features/inlineEvents.mjs.map +1 -0
- package/dist/dev/runtime/features/layout.d.mts +7 -0
- package/dist/dev/runtime/features/layout.mjs +44 -0
- package/dist/dev/runtime/features/layout.mjs.map +1 -0
- package/dist/dev/runtime/features/patchStrategy.d.mts +7 -0
- package/dist/dev/runtime/features/patchStrategy.mjs +129 -0
- package/dist/dev/runtime/features/patchStrategy.mjs.map +1 -0
- package/dist/dev/runtime/features/publicLayout.d.mts +24 -0
- package/dist/dev/runtime/features/publicLayout.mjs +81 -0
- package/dist/dev/runtime/features/publicLayout.mjs.map +1 -0
- package/dist/dev/runtime/features/scopedSlots.d.mts +23 -0
- package/dist/dev/runtime/features/scopedSlots.mjs +88 -0
- package/dist/dev/runtime/features/scopedSlots.mjs.map +1 -0
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.d.mts +7 -0
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.mjs +15 -0
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.mjs.map +1 -0
- package/dist/dev/runtime/features/templateRefs.d.mts +7 -0
- package/dist/dev/runtime/features/templateRefs.mjs +39 -0
- package/dist/dev/runtime/features/templateRefs.mjs.map +1 -0
- package/dist/dev/runtime/hooks/base.d.mts +27 -0
- package/dist/dev/runtime/hooks/register.d.mts +30 -0
- package/dist/dev/runtime/hooks/vue.d.mts +52 -0
- package/dist/dev/runtime/hooks/vue.mjs +3 -5
- package/dist/dev/runtime/hooks/vue.mjs.map +1 -1
- package/dist/dev/runtime/hooks.d.mts +4 -0
- package/dist/dev/runtime/index.d.mts +46 -0
- package/dist/dev/runtime/inlineDataset.mjs +75 -0
- package/dist/dev/runtime/inlineDataset.mjs.map +1 -0
- package/dist/dev/runtime/intersectionObserver.d.mts +14 -0
- package/dist/dev/runtime/jsxIsland.d.mts +37 -0
- package/dist/dev/runtime/jsxIsland.mjs.map +1 -1
- package/dist/dev/runtime/layoutBridge.d.mts +55 -0
- package/dist/dev/runtime/layoutBridge.mjs.map +1 -1
- package/dist/dev/runtime/noSetData.d.mts +5 -0
- package/dist/dev/runtime/pageEnvironment.d.mts +50 -0
- package/dist/dev/runtime/pageLayout.d.mts +25 -0
- package/dist/dev/runtime/pageLayout.mjs.map +1 -1
- package/dist/dev/runtime/pageScroll.d.mts +29 -0
- package/dist/dev/runtime/platform.mjs +18 -1
- package/dist/dev/runtime/platform.mjs.map +1 -1
- package/dist/dev/runtime/provide.d.mts +60 -0
- package/dist/dev/runtime/provideStore.d.mts +7 -0
- package/dist/dev/runtime/publicRuntime.d.mts +22 -0
- package/dist/dev/runtime/publicRuntime.mjs +91 -0
- package/dist/dev/runtime/publicRuntime.mjs.map +1 -0
- package/dist/dev/runtime/pullDownRefresh.d.mts +12 -0
- package/dist/dev/runtime/register/app.d.mts +14 -0
- package/dist/dev/runtime/register/app.mjs +7 -10
- package/dist/dev/runtime/register/app.mjs.map +1 -1
- package/dist/dev/runtime/register/component/lifecycle.mjs +22 -6
- package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -1
- package/dist/dev/runtime/register/component/methods.mjs +7 -10
- package/dist/dev/runtime/register/component/methods.mjs.map +1 -1
- package/dist/dev/runtime/register/component/options.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerDefinition.mjs +64 -69
- package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
- package/dist/dev/runtime/register/component.d.mts +17 -0
- package/dist/dev/runtime/register/inline.d.mts +15 -0
- package/dist/dev/runtime/register/inline.mjs +4 -64
- package/dist/dev/runtime/register/inline.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +4 -6
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +26 -0
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance.d.mts +26 -0
- package/dist/dev/runtime/register/runtimeInstance.mjs +402 -160
- package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs.map +1 -1
- package/dist/dev/runtime/register/setup.d.mts +11 -0
- package/dist/dev/runtime/register/snapshot.mjs +6 -10
- package/dist/dev/runtime/register/snapshot.mjs.map +1 -1
- package/dist/dev/runtime/register/watch.d.mts +12 -0
- package/dist/dev/runtime/register.d.mts +5 -0
- package/dist/dev/runtime/scopedSlots.mjs +1 -1
- package/dist/dev/runtime/scopedSlots.mjs.map +1 -1
- package/dist/dev/runtime/selectorQuery.d.mts +54 -0
- package/dist/dev/runtime/selectorQuery.mjs +5 -0
- package/dist/dev/runtime/selectorQuery.mjs.map +1 -1
- package/dist/dev/runtime/teardown.mjs +18 -0
- package/dist/dev/runtime/teardown.mjs.map +1 -0
- package/dist/dev/runtime/template.d.mts +6 -0
- package/dist/dev/runtime/templateRefTypes.d.mts +12 -0
- package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -1
- package/dist/dev/runtime/templateRefs.mjs +187 -118
- package/dist/dev/runtime/templateRefs.mjs.map +1 -1
- package/dist/dev/runtime/types/core.d.mts +35 -0
- package/dist/dev/runtime/types/miniprogram.d.mts +84 -0
- package/dist/dev/runtime/types/miniprogramHost.d.mts +45 -0
- package/dist/dev/runtime/types/miniprogramHostSources.d.mts +112 -0
- package/dist/dev/runtime/types/options.d.mts +136 -0
- package/dist/dev/runtime/types/props/propTypes.d.mts +79 -0
- package/dist/dev/runtime/types/props/router.d.mts +51 -0
- package/dist/dev/runtime/types/props/setup.d.mts +96 -0
- package/dist/dev/runtime/types/props.d.mts +4 -0
- package/dist/dev/runtime/types/runtime.d.mts +59 -0
- package/dist/dev/runtime/types/setData.d.mts +237 -0
- package/dist/dev/runtime/types.d.mts +29 -0
- package/dist/dev/runtime/uniAppHost.d.mts +8 -0
- package/dist/dev/runtime/updatePerformance.d.mts +13 -0
- package/dist/dev/runtime/use.d.mts +13 -0
- package/dist/dev/runtime/vueCompat/context.d.mts +8 -0
- package/dist/dev/runtime/vueCompat/model.d.mts +30 -0
- package/dist/dev/runtime/vueCompat/router.d.mts +29 -0
- package/dist/dev/runtime/vueCompat/router.mjs +18 -13
- package/dist/dev/runtime/vueCompat/router.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/templateRef.d.mts +9 -0
- package/dist/dev/runtime/vueCompat/templateRef.mjs +2 -0
- package/dist/dev/runtime/vueCompat/templateRef.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat.d.mts +5 -0
- package/dist/dev/scheduler.d.mts +4 -0
- package/dist/dev/store/base.mjs +12 -18
- package/dist/dev/store/base.mjs.map +1 -1
- package/dist/dev/store/define/optionsStyle.mjs +13 -23
- package/dist/dev/store/define/optionsStyle.mjs.map +1 -1
- package/dist/dev/store/define/setupStyle.mjs +14 -24
- package/dist/dev/store/define/setupStyle.mjs.map +1 -1
- package/dist/dev/store/define/shared.mjs +44 -1
- package/dist/dev/store/define/shared.mjs.map +1 -1
- package/dist/dev/store/define.d.mts +28 -0
- package/dist/dev/store/define.mjs.map +1 -1
- package/dist/dev/store/manager.d.mts +8 -0
- package/dist/dev/store/storeToRefs.d.mts +13 -0
- package/dist/dev/store/types.d.mts +70 -0
- package/dist/dev/store.d.mts +5 -0
- package/dist/dev/version.d.mts +4 -0
- package/dist/dev/vue-augment.d.mts +8 -0
- package/dist/dev/vue-demi.d.mts +87 -0
- package/dist/dev/vue-demi.mjs +12 -15
- package/dist/dev/vue-demi.mjs.map +1 -1
- package/dist/dev/vue-types.d.mts +19 -0
- package/dist/dev/web-apis.d.mts +3 -0
- package/dist/index.d.mts +13 -14
- package/dist/index.mjs +1 -1
- package/dist/internal-reactivity.d.mts +2 -1
- package/dist/internal-reactivity.mjs +1 -1
- package/dist/internal-runtime.d.mts +13 -6
- package/dist/internal-runtime.mjs +1 -1
- package/dist/jsx-runtime.d.mts +47 -9
- package/dist/jsxTypes.d.mts +8 -0
- package/dist/miniprogram/jsx-runtime.d.mts +12 -0
- package/dist/miniprogram/jsx-runtime.mjs +1 -0
- package/dist/package.mjs +1 -1
- package/dist/reactivity/asyncDerivation.d.mts +40 -0
- package/dist/reactivity/asyncDerivation.mjs +1 -0
- package/dist/reactivity/computed.mjs +1 -1
- package/dist/reactivity/core.d.mts +1 -0
- package/dist/reactivity/core.mjs +1 -1
- package/dist/reactivity/index.d.mts +2 -1
- package/dist/reactivity/readonly.d.mts +1 -1
- package/dist/reactivity/ref.mjs +1 -1
- package/dist/router/createRouter.mjs +1 -1
- package/dist/router/useRoute.mjs +1 -1
- package/dist/runtime/app/computed.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.d.mts +12 -0
- package/dist/runtime/app/setData/commitTracker.mjs +1 -0
- package/dist/runtime/app/setData/patchScheduler.mjs +1 -1
- package/dist/runtime/app/setData/scheduler.d.mts +50 -0
- package/dist/runtime/app/setData/scheduler.mjs +1 -1
- package/dist/runtime/app/setData/snapshot.mjs +1 -1
- package/dist/runtime/app.mjs +1 -1
- package/dist/runtime/bindingManifest.mjs +1 -0
- package/dist/runtime/capabilities.d.mts +74 -0
- package/dist/runtime/capabilities.mjs +1 -0
- package/dist/runtime/define/componentDefinition.mjs +1 -1
- package/dist/runtime/define/optionsApi.mjs +1 -1
- package/dist/runtime/define/props.mjs +1 -1
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
- package/dist/runtime/define.d.mts +5 -13
- package/dist/runtime/define.mjs +1 -1
- package/dist/runtime/diff.mjs +1 -1
- package/dist/runtime/features/inlineEvents.d.mts +6 -0
- package/dist/runtime/features/inlineEvents.mjs +1 -0
- package/dist/runtime/features/layout.d.mts +6 -0
- package/dist/runtime/features/layout.mjs +1 -0
- package/dist/runtime/features/patchStrategy.d.mts +6 -0
- package/dist/runtime/features/patchStrategy.mjs +1 -0
- package/dist/runtime/features/publicLayout.d.mts +23 -0
- package/dist/runtime/features/publicLayout.mjs +1 -0
- package/dist/runtime/features/scopedSlots.d.mts +22 -0
- package/dist/runtime/features/scopedSlots.mjs +1 -0
- package/dist/runtime/features/setDataHighFrequencyWarning.d.mts +6 -0
- package/dist/runtime/features/setDataHighFrequencyWarning.mjs +1 -0
- package/dist/runtime/features/templateRefs.d.mts +6 -0
- package/dist/runtime/features/templateRefs.mjs +1 -0
- package/dist/runtime/hooks/vue.d.mts +1 -2
- package/dist/runtime/hooks/vue.mjs +1 -1
- package/dist/runtime/index.d.mts +12 -14
- package/dist/runtime/inlineDataset.mjs +1 -0
- package/dist/runtime/jsxIsland.d.mts +2 -6
- package/dist/runtime/layoutBridge.d.mts +5 -9
- package/dist/runtime/pageLayout.d.mts +3 -4
- package/dist/runtime/platform.mjs +1 -1
- package/dist/runtime/publicRuntime.d.mts +21 -0
- package/dist/runtime/publicRuntime.mjs +1 -0
- package/dist/runtime/register/app.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/registerDefinition.mjs +1 -1
- package/dist/runtime/register/inline.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 -0
- package/dist/runtime/register/runtimeInstance.mjs +1 -1
- package/dist/runtime/register/snapshot.mjs +1 -1
- package/dist/runtime/scopedSlots.mjs +1 -1
- package/dist/runtime/selectorQuery.mjs +1 -1
- package/dist/runtime/teardown.mjs +1 -0
- package/dist/runtime/templateRefTypes.d.mts +5 -2
- package/dist/runtime/templateRefs.mjs +1 -1
- package/dist/runtime/types/miniprogram.d.mts +3 -0
- package/dist/runtime/types/options.d.mts +2 -2
- package/dist/runtime/types/props.d.mts +1 -1
- package/dist/runtime/types/setData.d.mts +18 -1
- package/dist/runtime/types.d.mts +3 -3
- package/dist/runtime/vueCompat/router.d.mts +5 -4
- package/dist/runtime/vueCompat/router.mjs +1 -1
- package/dist/runtime/vueCompat/templateRef.mjs +1 -1
- package/dist/store/base.mjs +1 -1
- package/dist/store/define/optionsStyle.mjs +1 -1
- package/dist/store/define/setupStyle.mjs +1 -1
- package/dist/store/define/shared.mjs +1 -1
- package/dist/store/define.d.mts +10 -8
- package/dist/store/types.d.mts +4 -4
- package/dist/tt/jsx-runtime.d.mts +12 -0
- package/dist/tt/jsx-runtime.mjs +1 -0
- package/dist/vue-demi.d.mts +13 -14
- package/dist/vue-demi.mjs +1 -1
- package/dist/weapp/jsx-runtime.d.mts +12 -0
- package/dist/weapp/jsx-runtime.mjs +1 -0
- package/package.json +26 -22
- package/dist/dev/jsx-runtime.mjs +0 -1
- package/dist/runtime/templateRefs.d.mts +0 -10
- package/dist/weappIntrinsicElements/base.d.mts +0 -21
- package/dist/weappIntrinsicElements/elements/ad-custom.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/ad.d.mts +0 -15
- package/dist/weappIntrinsicElements/elements/audio.d.mts +0 -19
- package/dist/weappIntrinsicElements/elements/block.d.mts +0 -7
- package/dist/weappIntrinsicElements/elements/button.d.mts +0 -39
- package/dist/weappIntrinsicElements/elements/camera.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/canvas.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/checkbox-group.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/checkbox.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/cover-image.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/cover-view.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/editor.d.mts +0 -21
- package/dist/weappIntrinsicElements/elements/form.d.mts +0 -15
- package/dist/weappIntrinsicElements/elements/functional-page-navigator.d.mts +0 -14
- package/dist/weappIntrinsicElements/elements/icon.d.mts +0 -11
- package/dist/weappIntrinsicElements/elements/image.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/import.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/include.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/input.d.mts +0 -46
- package/dist/weappIntrinsicElements/elements/keyboard-accessory.d.mts +0 -7
- package/dist/weappIntrinsicElements/elements/label.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/live-player.d.mts +0 -34
- package/dist/weappIntrinsicElements/elements/live-pusher.d.mts +0 -56
- package/dist/weappIntrinsicElements/elements/map.d.mts +0 -104
- package/dist/weappIntrinsicElements/elements/match-media.d.mts +0 -15
- package/dist/weappIntrinsicElements/elements/movable-area.d.mts +0 -25
- package/dist/weappIntrinsicElements/elements/movable-view.d.mts +0 -25
- package/dist/weappIntrinsicElements/elements/navigation-bar.d.mts +0 -14
- package/dist/weappIntrinsicElements/elements/navigator.d.mts +0 -24
- package/dist/weappIntrinsicElements/elements/official-account.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/open-data.d.mts +0 -14
- package/dist/weappIntrinsicElements/elements/page-container.d.mts +0 -24
- package/dist/weappIntrinsicElements/elements/page-meta.d.mts +0 -22
- package/dist/weappIntrinsicElements/elements/picker-view-column.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/picker-view.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/picker.d.mts +0 -22
- package/dist/weappIntrinsicElements/elements/progress.d.mts +0 -20
- package/dist/weappIntrinsicElements/elements/radio-group.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/radio.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/rich-text.d.mts +0 -16
- package/dist/weappIntrinsicElements/elements/scroll-view.d.mts +0 -67
- package/dist/weappIntrinsicElements/elements/share-element.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/slider.d.mts +0 -22
- package/dist/weappIntrinsicElements/elements/slot.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/swiper-item.d.mts +0 -41
- package/dist/weappIntrinsicElements/elements/swiper.d.mts +0 -41
- package/dist/weappIntrinsicElements/elements/switch.d.mts +0 -13
- package/dist/weappIntrinsicElements/elements/template.d.mts +0 -11
- package/dist/weappIntrinsicElements/elements/text.d.mts +0 -14
- package/dist/weappIntrinsicElements/elements/textarea.d.mts +0 -39
- package/dist/weappIntrinsicElements/elements/video.d.mts +0 -70
- package/dist/weappIntrinsicElements/elements/view.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/voip-room.d.mts +0 -13
- package/dist/weappIntrinsicElements/elements/web-view.d.mts +0 -12
- package/dist/weappIntrinsicElements.d.mts +0 -153
- /package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/defineProperty.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/toPrimitive.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/toPropertyKey.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/typeof.mjs +0 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { WevuBindingSourceSpanV1, WevuBindingUpdateMode } from "@weapp-core/constants";
|
|
2
|
+
//#region src/runtime/types/setData.d.ts
|
|
3
|
+
export interface SetDataSnapshotOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 开发态高频 setData 告警。
|
|
6
|
+
*
|
|
7
|
+
* - `undefined`:默认关闭(可通过 `weapp.wevu.preset: 'performance'` 自动开启)
|
|
8
|
+
* - `false`:关闭告警
|
|
9
|
+
* - `true`:启用默认阈值(默认仅开发态生效)
|
|
10
|
+
* - `object`:自定义阈值与开关
|
|
11
|
+
*/
|
|
12
|
+
highFrequencyWarning?: boolean | {
|
|
13
|
+
/**
|
|
14
|
+
* 是否启用告警。
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 是否仅在开发态生效。
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
devOnly?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 统计窗口(毫秒)。
|
|
25
|
+
* @default 1000
|
|
26
|
+
*/
|
|
27
|
+
sampleWindowMs?: number;
|
|
28
|
+
/**
|
|
29
|
+
* 窗口内超过该次数触发告警。
|
|
30
|
+
* @default 30
|
|
31
|
+
*/
|
|
32
|
+
maxCalls?: number;
|
|
33
|
+
/**
|
|
34
|
+
* 告警冷却时间(毫秒),避免刷屏。
|
|
35
|
+
* @default 5000
|
|
36
|
+
*/
|
|
37
|
+
coolDownMs?: number;
|
|
38
|
+
/**
|
|
39
|
+
* 是否在检测到 `onPageScroll` 回调内调用 setData 时输出专项告警。
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
warnOnPageScroll?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* `onPageScroll` 专项告警冷却时间(毫秒)。
|
|
45
|
+
* @default 2000
|
|
46
|
+
*/
|
|
47
|
+
pageScrollCoolDownMs?: number;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* setData 策略:
|
|
51
|
+
* - diff:全量快照 + diff(默认,兼容性最好)
|
|
52
|
+
* - patch:按变更路径增量产出 payload(性能更好;在共享引用等场景会自动回退 diff)
|
|
53
|
+
*/
|
|
54
|
+
strategy?: 'diff' | 'patch';
|
|
55
|
+
/**
|
|
56
|
+
* 仅下发指定的顶层字段(包含 data/setup 返回值与 computed)。
|
|
57
|
+
* 若为空则默认下发所有字段。
|
|
58
|
+
*/
|
|
59
|
+
pick?: string[];
|
|
60
|
+
/**
|
|
61
|
+
* 排除指定的顶层字段(包含 data/setup 返回值与 computed)。
|
|
62
|
+
*/
|
|
63
|
+
omit?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* 是否将 computed 的结果参与 setData(默认 true)。
|
|
66
|
+
*/
|
|
67
|
+
includeComputed?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* 页面/组件处于后台态(onHide 之后)时,是否挂起 setData 下发。
|
|
70
|
+
*
|
|
71
|
+
* - true:后台态仅合并最新 payload,待 onShow 后一次性 flush
|
|
72
|
+
* - false:保持默认行为,后台态也继续 setData
|
|
73
|
+
*
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
suspendWhenHidden?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* patch 模式阈值:当本轮变更路径数量超过该值时,自动回退到 diff。
|
|
79
|
+
* 说明:大量路径变更时,全量快照 diff 往往更快/更小。
|
|
80
|
+
*/
|
|
81
|
+
maxPatchKeys?: number;
|
|
82
|
+
/**
|
|
83
|
+
* patch 模式阈值:当本轮 payload 估算字节数超过该值时,自动回退到 diff。
|
|
84
|
+
* 说明:该估算基于 `JSON.stringify(payload).length`,仅用于启发式降级。
|
|
85
|
+
*/
|
|
86
|
+
maxPayloadBytes?: number;
|
|
87
|
+
/**
|
|
88
|
+
* patch 模式优化:当同一父路径下存在多个子路径变更时,合并为父路径整体下发。
|
|
89
|
+
*
|
|
90
|
+
* 例如:`a.b` 与 `a.c` 同时变更,且 `mergeSiblingThreshold = 2` 时,会下发 `a`。
|
|
91
|
+
*
|
|
92
|
+
* 注意:当子路径包含删除(null)时,为避免删除语义不一致,将不会触发合并。
|
|
93
|
+
*/
|
|
94
|
+
mergeSiblingThreshold?: number;
|
|
95
|
+
/**
|
|
96
|
+
* 同级合并的“负优化”防护:若合并后的父路径估算体积大于子路径体积之和 * ratio,则不合并。
|
|
97
|
+
*/
|
|
98
|
+
mergeSiblingMaxInflationRatio?: number;
|
|
99
|
+
/**
|
|
100
|
+
* 同级合并的“负优化”防护:若父路径估算体积超过该值,则不合并。
|
|
101
|
+
*/
|
|
102
|
+
mergeSiblingMaxParentBytes?: number;
|
|
103
|
+
/**
|
|
104
|
+
* 是否在父值为数组时跳过同级合并(默认 true)。
|
|
105
|
+
*/
|
|
106
|
+
mergeSiblingSkipArray?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* patch 模式优化:computed 变更对比策略。
|
|
109
|
+
*
|
|
110
|
+
* - reference:仅 `Object.is` 比较(最快,可能会多下发)
|
|
111
|
+
* - shallow:仅比较数组/对象第一层(折中)
|
|
112
|
+
* - deep:深比较(可能较慢,适合小对象);会受 `computedCompareMaxDepth/maxKeys` 限制
|
|
113
|
+
*/
|
|
114
|
+
computedCompare?: 'reference' | 'shallow' | 'deep';
|
|
115
|
+
/**
|
|
116
|
+
* computed 深比较最大深度(仅在 `computedCompare = "deep"` 时生效)。
|
|
117
|
+
*/
|
|
118
|
+
computedCompareMaxDepth?: number;
|
|
119
|
+
/**
|
|
120
|
+
* computed 深比较最多比较 key 数(仅在 `computedCompare = "deep"` 时生效)。
|
|
121
|
+
*/
|
|
122
|
+
computedCompareMaxKeys?: number;
|
|
123
|
+
/**
|
|
124
|
+
* 限制 patch 模式的预链接(prelinkReactiveTree)开销:最多向下遍历的深度(root 为 0)。
|
|
125
|
+
*/
|
|
126
|
+
prelinkMaxDepth?: number;
|
|
127
|
+
/**
|
|
128
|
+
* 限制 patch 模式的预链接(prelinkReactiveTree)开销:最多索引的节点数。
|
|
129
|
+
*/
|
|
130
|
+
prelinkMaxKeys?: number;
|
|
131
|
+
/**
|
|
132
|
+
* setData 调试信息回调(用于观测 patch 命中率/回退原因/payload 大小)。
|
|
133
|
+
*/
|
|
134
|
+
debug?: (info: SetDataDebugInfo) => void;
|
|
135
|
+
/**
|
|
136
|
+
* 内建诊断日志开关(默认 off)。
|
|
137
|
+
*
|
|
138
|
+
* - off:关闭内建日志
|
|
139
|
+
* - fallback:仅在回退 diff / 超阈值时输出
|
|
140
|
+
* - always:每次 flush 都输出
|
|
141
|
+
*/
|
|
142
|
+
diagnostics?: 'off' | 'fallback' | 'always';
|
|
143
|
+
/**
|
|
144
|
+
* 疑似运行时更新循环诊断。
|
|
145
|
+
*
|
|
146
|
+
* 在短时间内连续触发 setData flush 时输出告警,帮助定位页面/组件、
|
|
147
|
+
* 调度模式、patch 信号和 computed dirty 状态。
|
|
148
|
+
*/
|
|
149
|
+
loopWarning?: boolean | {
|
|
150
|
+
/**
|
|
151
|
+
* 是否启用告警。
|
|
152
|
+
* @default true
|
|
153
|
+
*/
|
|
154
|
+
enabled?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* 统计窗口(毫秒)。
|
|
157
|
+
* @default 1000
|
|
158
|
+
*/
|
|
159
|
+
sampleWindowMs?: number;
|
|
160
|
+
/**
|
|
161
|
+
* 窗口内超过该次数触发告警。
|
|
162
|
+
* @default 50
|
|
163
|
+
*/
|
|
164
|
+
maxFlushes?: number;
|
|
165
|
+
/**
|
|
166
|
+
* 告警冷却时间(毫秒),避免刷屏。
|
|
167
|
+
* @default 5000
|
|
168
|
+
*/
|
|
169
|
+
coolDownMs?: number;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* debug 触发时机:
|
|
173
|
+
* - fallback:仅在回退 diff / 超阈值时触发(默认)
|
|
174
|
+
* - always:每次 flush 都触发
|
|
175
|
+
*/
|
|
176
|
+
debugWhen?: 'fallback' | 'always';
|
|
177
|
+
/**
|
|
178
|
+
* debug 采样率(0-1),用于降低 debug 频率与开销(默认 1)。
|
|
179
|
+
*/
|
|
180
|
+
debugSampleRate?: number;
|
|
181
|
+
/**
|
|
182
|
+
* patch 模式优化:当某个顶层字段下的变更路径数量过多时,直接提升为顶层字段整体替换。
|
|
183
|
+
*/
|
|
184
|
+
elevateTopKeyThreshold?: number;
|
|
185
|
+
/**
|
|
186
|
+
* setData 序列化上限:最大递归深度(root 为 0)。超过时将停止深拷贝,保留更浅层结构。
|
|
187
|
+
*/
|
|
188
|
+
toPlainMaxDepth?: number;
|
|
189
|
+
/**
|
|
190
|
+
* setData 序列化上限:最多处理的对象 key 数(累计)。超过时将停止深拷贝,保留更浅层结构。
|
|
191
|
+
*/
|
|
192
|
+
toPlainMaxKeys?: number;
|
|
193
|
+
/**
|
|
194
|
+
* 是否允许函数进入 setData 快照。
|
|
195
|
+
*
|
|
196
|
+
* @internal
|
|
197
|
+
*/
|
|
198
|
+
includeFunctions?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* 允许函数进入 setData 快照的状态路径。
|
|
201
|
+
*
|
|
202
|
+
* @internal
|
|
203
|
+
*/
|
|
204
|
+
functionPaths?: string[];
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* 与本次 setData 诊断相关的编译期模板绑定。
|
|
208
|
+
*/
|
|
209
|
+
export interface SetDataBindingDiagnostic {
|
|
210
|
+
id: string;
|
|
211
|
+
outputPath: string;
|
|
212
|
+
updateMode: WevuBindingUpdateMode;
|
|
213
|
+
sourceFile: string;
|
|
214
|
+
sourceLocation?: WevuBindingSourceSpanV1;
|
|
215
|
+
}
|
|
216
|
+
export interface SetDataDebugInfo {
|
|
217
|
+
mode: 'patch' | 'diff';
|
|
218
|
+
reason: 'patch' | 'diff' | 'needsFullSnapshot' | 'maxPatchKeys' | 'maxPayloadBytes' | 'loopWarning' | 'commitFailure';
|
|
219
|
+
pendingPatchKeys: number;
|
|
220
|
+
payloadKeys: number;
|
|
221
|
+
estimatedBytes?: number;
|
|
222
|
+
bytes?: number;
|
|
223
|
+
mergedSiblingParents?: number;
|
|
224
|
+
computedDirtyKeys?: number;
|
|
225
|
+
flushCount?: number;
|
|
226
|
+
windowMs?: number;
|
|
227
|
+
targetLabel?: string;
|
|
228
|
+
message?: string;
|
|
229
|
+
/**
|
|
230
|
+
* 根据实际 payload 或待处理路径解析出的相关编译期绑定。
|
|
231
|
+
*/
|
|
232
|
+
bindings?: SetDataBindingDiagnostic[];
|
|
233
|
+
revision?: number;
|
|
234
|
+
committedRevision?: number;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//# sourceMappingURL=setData.d.mts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract } from "./types/miniprogramHostSources.mjs";
|
|
2
|
+
import { HostMiniProgramAddToFavoritesOption, HostMiniProgramAppOptions, HostMiniProgramAppTrivialInstance, HostMiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray, HostMiniProgramComponentInstance, HostMiniProgramComponentMethodOption, HostMiniProgramComponentPropertyOption, HostMiniProgramComponentPropertyValue, HostMiniProgramComponentShortProperty, HostMiniProgramComponentTrivialInstance, HostMiniProgramComponentTrivialOption, HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption, HostMiniProgramNodesRef, HostMiniProgramNodesRefFields, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramPageTrivialInstance, HostMiniProgramReLaunchOption, HostMiniProgramRedirectToOption, HostMiniProgramRouter, HostMiniProgramSaveExitState, HostMiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramTriggerEventOptions, HostMiniProgramUnhandledRejectionResult } from "./types/miniprogramHost.mjs";
|
|
3
|
+
import { MiniProgramAdapter, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, MiniProgramComponentInstance, MiniProgramComponentOptions, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, MiniProgramInstance, MiniProgramPageLifetimes } from "./types/miniprogram.mjs";
|
|
4
|
+
import { ComponentPropsOptions, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InferNativePropType, InferNativeProps, InferPropType, InferProps, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, PropConstructor, PropOptions, PropType } from "./types/props/propTypes.mjs";
|
|
5
|
+
import { MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, SetupContextRouter, WevuTypedRouterRouteMap } from "./types/props/router.mjs";
|
|
6
|
+
import { ComponentPublicInstance, ComputedDefinitions, ExtractComputed, ExtractMethods, MethodDefinitions, ModelBinding, ModelBindingOptions, ModelBindingPayload } from "./types/core.mjs";
|
|
7
|
+
import { AppConfig, InternalRuntimeState, InternalRuntimeStateFields, RuntimeApp, RuntimeInstance, WevuPlugin } from "./types/runtime.mjs";
|
|
8
|
+
import { SetupContext, SetupContextIntersectionObserver, SetupContextIntersectionObserverOptions, SetupContextNativeInstance, SetupContextSelectorQuery, SetupFunction } from "./types/props/setup.mjs";
|
|
9
|
+
import "./types/props.mjs";
|
|
10
|
+
import { AllowedComponentProps, ComponentCustomProps, ComponentOptionsMixin, DefineComponent, NativeComponent, ObjectDirective, PublicProps, ShallowUnwrapRef, VNode, VNodeProps } from "../vue-types.mjs";
|
|
11
|
+
import { SetDataBindingDiagnostic, SetDataDebugInfo, SetDataSnapshotOptions } from "./types/setData.mjs";
|
|
12
|
+
import { CreateAppOptions, DataOption, DefineAppOptions, DefineComponentOptions, PageFeatures } from "./types/options.mjs";
|
|
13
|
+
//#region src/runtime/types.d.ts
|
|
14
|
+
export interface WevuGlobalComponents {}
|
|
15
|
+
export interface WevuGlobalDirectives {}
|
|
16
|
+
export interface GlobalComponents extends WevuGlobalComponents {}
|
|
17
|
+
export interface GlobalDirectives extends WevuGlobalDirectives {}
|
|
18
|
+
export interface TemplateRefs {}
|
|
19
|
+
export interface TemplateRefValue {
|
|
20
|
+
selector: string;
|
|
21
|
+
boundingClientRect: (cb?: (value: HostMiniProgramBoundingClientRectResult | null) => void) => Promise<HostMiniProgramBoundingClientRectResult | null>;
|
|
22
|
+
scrollOffset: (cb?: (value: HostMiniProgramScrollOffsetResult | null) => void) => Promise<HostMiniProgramScrollOffsetResult | null>;
|
|
23
|
+
fields: (fields: HostMiniProgramNodesRefFields, cb?: (value: any) => void) => Promise<any | null>;
|
|
24
|
+
node: (cb?: (value: any) => void) => Promise<any | null>;
|
|
25
|
+
}
|
|
26
|
+
export type MiniProgramTemplateRefValue = TemplateRefValue;
|
|
27
|
+
//#endregion
|
|
28
|
+
export type { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, AllowedComponentProps, AppConfig, ComponentCustomProps, ComponentOptionsMixin, ComponentPropsOptions, ComponentPublicInstance, ComputedDefinitions, CreateAppOptions, DataOption, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DefineAppOptions, DefineComponent, DefineComponentOptions, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, ExtractComputed, ExtractDefaultPropTypes, ExtractMethods, ExtractPropTypes, ExtractPublicPropTypes, HostMiniProgramAddToFavoritesOption, HostMiniProgramAppOptions, HostMiniProgramAppTrivialInstance, HostMiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray, HostMiniProgramComponentInstance, HostMiniProgramComponentMethodOption, HostMiniProgramComponentPropertyOption, HostMiniProgramComponentPropertyValue, HostMiniProgramComponentShortProperty, HostMiniProgramComponentTrivialInstance, HostMiniProgramComponentTrivialOption, HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption, HostMiniProgramNodesRef, HostMiniProgramNodesRefFields, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramPageTrivialInstance, HostMiniProgramReLaunchOption, HostMiniProgramRedirectToOption, HostMiniProgramRouter, HostMiniProgramSaveExitState, HostMiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramTriggerEventOptions, HostMiniProgramUnhandledRejectionResult, InferNativePropType, InferNativeProps, InferPropType, InferProps, InternalRuntimeState, InternalRuntimeStateFields, MethodDefinitions, MiniProgramAdapter, HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, MiniProgramComponentInstance, HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, MiniProgramComponentOptions, HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramInstance, HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, HostMiniProgramNodesRef as MiniProgramNodesRef, HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, HostMiniProgramPageLifetime as MiniProgramPageLifetime, MiniProgramPageLifetimes, HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, HostMiniProgramRouter as MiniProgramRouter, MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, HostMiniProgramSaveExitState as MiniProgramSaveExitState, HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, ModelBinding, ModelBindingOptions, ModelBindingPayload, NativeComponent, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, ObjectDirective, PageFeatures, PropConstructor, PropOptions, PropType, PublicProps, RuntimeApp, RuntimeInstance, SetDataBindingDiagnostic, SetDataDebugInfo, SetDataSnapshotOptions, SetupContext, SetupContextIntersectionObserver, SetupContextIntersectionObserverOptions, SetupContextNativeInstance, SetupContextRouter, SetupContextSelectorQuery, SetupFunction, ShallowUnwrapRef, HostMiniProgramTriggerEventOptions as TriggerEventOptions, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, VNode, VNodeProps, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract, WevuPlugin, WevuTypedRouterRouteMap };
|
|
29
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/runtime/uniAppHost.d.ts
|
|
2
|
+
type UniAppHost = Record<string, any>;
|
|
3
|
+
/**
|
|
4
|
+
* 在原生小程序宿主上补齐 uni-app 专属 API,并保持未适配 API 继续继承宿主实现。
|
|
5
|
+
*/
|
|
6
|
+
export declare function createUniAppHost(host: UniAppHost): UniAppHost;
|
|
7
|
+
//#endregion
|
|
8
|
+
//# sourceMappingURL=uniAppHost.d.mts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/runtime/updatePerformance.d.ts
|
|
2
|
+
export type UpdatePerformanceListenerResult = Record<string, any>;
|
|
3
|
+
export type UpdatePerformanceListener = (result: UpdatePerformanceListenerResult) => void;
|
|
4
|
+
export type UseUpdatePerformanceListenerStopHandle = () => void;
|
|
5
|
+
/**
|
|
6
|
+
* 在 setup 中注册更新性能监听,并在卸载时自动清理。
|
|
7
|
+
*
|
|
8
|
+
* - 底层能力:`instance.setUpdatePerformanceListener(listener)`。
|
|
9
|
+
* - 清理策略:卸载时回传 `undefined` 作为监听器,平台不支持时静默降级。
|
|
10
|
+
*/
|
|
11
|
+
export declare function useUpdatePerformanceListener(listener: UpdatePerformanceListener): UseUpdatePerformanceListenerStopHandle;
|
|
12
|
+
//#endregion
|
|
13
|
+
//# sourceMappingURL=updatePerformance.d.mts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RuntimeApp, WevuPlugin } from "./types/runtime.mjs";
|
|
2
|
+
import "./types.mjs";
|
|
3
|
+
//#region src/runtime/use.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* 在 `app` 级 `setup()` 中显式获取运行时 app,提供与 `app.use()` / `app.provide()` 对齐的 SFC 写法。
|
|
6
|
+
*/
|
|
7
|
+
export declare function defineAppSetup<T>(setup: (app: RuntimeApp<any, any, any>) => T): T;
|
|
8
|
+
/**
|
|
9
|
+
* 在 `app` 级 `setup()` 中安装插件,提供与 `app.use()` 对齐的 SFC 调用方式。
|
|
10
|
+
*/
|
|
11
|
+
export declare function use(plugin: WevuPlugin, ...options: any[]): RuntimeApp<any, any, any>;
|
|
12
|
+
//#endregion
|
|
13
|
+
//# sourceMappingURL=use.d.mts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SetupContextNativeInstance } from "../types/props/setup.mjs";
|
|
2
|
+
import "../types.mjs";
|
|
3
|
+
//#region src/runtime/vueCompat/context.d.ts
|
|
4
|
+
export declare function useAttrs(): Record<string, any>;
|
|
5
|
+
export declare function useSlots(): Record<string, any>;
|
|
6
|
+
export declare function useNativeInstance(): SetupContextNativeInstance;
|
|
7
|
+
//#endregion
|
|
8
|
+
//# sourceMappingURL=context.d.mts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Ref } from "../../reactivity/ref.mjs";
|
|
2
|
+
import "../../reactivity/index.mjs";
|
|
3
|
+
import { ModelBinding, ModelBindingOptions, ModelBindingPayload } from "../types/core.mjs";
|
|
4
|
+
import "../types.mjs";
|
|
5
|
+
//#region src/runtime/vueCompat/model.d.ts
|
|
6
|
+
export type ModelModifiers<M extends PropertyKey = string> = Record<M, true | undefined>;
|
|
7
|
+
export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [ModelRef<T, M, G, S>, ModelModifiers<M>];
|
|
8
|
+
export interface UseModelOptions<T, M extends PropertyKey = string, G = T, S = T> {
|
|
9
|
+
get?: (value: T, modifiers: ModelModifiers<M>) => G;
|
|
10
|
+
set?: (value: S, modifiers: ModelModifiers<M>) => T;
|
|
11
|
+
}
|
|
12
|
+
export declare function useModel<T = any, M extends PropertyKey = string>(props: Record<string, any>, name: string): ModelRef<T, M, T, T>;
|
|
13
|
+
export declare function useModel<T = any, M extends PropertyKey = string, G = T, S = T>(props: Record<string, any>, name: string, options: UseModelOptions<T, M, G, S>): ModelRef<T, M, G, S>;
|
|
14
|
+
/**
|
|
15
|
+
* useBindModel 返回绑定到当前运行时实例的 bindModel。
|
|
16
|
+
* 该方法必须在 setup() 的同步阶段调用。
|
|
17
|
+
*/
|
|
18
|
+
type BindModelWithHelper<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'> = (<T = any>(path: string, options?: ModelBindingOptions<T>) => ModelBinding<T>) & {
|
|
19
|
+
model: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => ModelBindingPayload<T, Event, ValueProp, Formatted>;
|
|
20
|
+
value: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => Formatted;
|
|
21
|
+
on: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => (event: any) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare function useBindModel<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'>(defaultOptions?: ModelBindingOptions<any, DefaultEvent, DefaultValueProp, any>): BindModelWithHelper<DefaultEvent, DefaultValueProp>;
|
|
24
|
+
/**
|
|
25
|
+
* useChangeModel 返回以 change 事件为默认更新事件的 model 绑定助手。
|
|
26
|
+
*/
|
|
27
|
+
export declare function useChangeModel(): <T = any, ValueProp extends string = "value", Formatted = T>(path: string, options?: ModelBindingOptions<T, "change", ValueProp, Formatted>) => ModelBindingPayload<T, "change", ValueProp, Formatted>;
|
|
28
|
+
export declare function mergeModels<T>(a: T, b: T): T;
|
|
29
|
+
//#endregion
|
|
30
|
+
//# sourceMappingURL=model.d.mts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SetupContextRouter } from "../types/props/router.mjs";
|
|
2
|
+
import "../types.mjs";
|
|
3
|
+
//#region src/runtime/vueCompat/router.d.ts
|
|
4
|
+
type RuntimeRouter = SetupContextRouter;
|
|
5
|
+
/**
|
|
6
|
+
* 获取与当前组件路径语义一致的原生 Router 对象。
|
|
7
|
+
*
|
|
8
|
+
* - 优先使用实例上的 `this.router`(组件路径语义)。
|
|
9
|
+
* - 不可用时回退到 `this.pageRouter`。
|
|
10
|
+
* - App setup 或低版本基础库再回退到宿主全局路由方法。
|
|
11
|
+
* - 无 setup 上下文且宿主全局路由可用时,仍可创建应用级路由器。
|
|
12
|
+
*
|
|
13
|
+
* 如需更贴近 Vue Router 的高阶能力(导航守卫、失败类型、统一解析),
|
|
14
|
+
* 推荐改用 `wevu/router` 子入口的 `useRouter()`。
|
|
15
|
+
*/
|
|
16
|
+
export declare function useNativeRouter(): RuntimeRouter;
|
|
17
|
+
/**
|
|
18
|
+
* 获取与当前页面路径语义一致的原生 Router 对象。
|
|
19
|
+
*
|
|
20
|
+
* - 优先使用实例上的 `this.pageRouter`(页面路径语义)。
|
|
21
|
+
* - 不可用时回退到 `this.router`。
|
|
22
|
+
* - App setup 或低版本基础库再回退到宿主全局路由方法。
|
|
23
|
+
*
|
|
24
|
+
* 如需更贴近 Vue Router 的高阶能力(导航守卫、失败类型、统一解析),
|
|
25
|
+
* 推荐改用 `wevu/router` 子入口的 `useRouter()`。
|
|
26
|
+
*/
|
|
27
|
+
export declare function useNativePageRouter(): RuntimeRouter;
|
|
28
|
+
//#endregion
|
|
29
|
+
//# sourceMappingURL=router.d.mts.map
|
|
@@ -81,23 +81,28 @@ function createScopedRuntimeRouter(rawRouter, basePath) {
|
|
|
81
81
|
}
|
|
82
82
|
function useRuntimeRouterByAccessor(primaryAccessor, fallbackAccessor, helperName) {
|
|
83
83
|
const ctx = getCurrentSetupContext();
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
const nativeInstance = (ctx === null || ctx === void 0 ? void 0 : ctx.instance) && typeof ctx.instance === "object" ? ctx.instance : void 0;
|
|
85
|
+
if (nativeInstance) {
|
|
86
|
+
const basePath = resolveRouterBasePath(nativeInstance, primaryAccessor);
|
|
87
|
+
const primaryRouter = nativeInstance[primaryAccessor];
|
|
88
|
+
if (isRuntimeRouter(primaryRouter)) return createScopedRuntimeRouter(primaryRouter, basePath);
|
|
89
|
+
const fallbackRouter = nativeInstance[fallbackAccessor];
|
|
90
|
+
if (isRuntimeRouter(fallbackRouter)) return createScopedRuntimeRouter(fallbackRouter, basePath);
|
|
91
|
+
const globalFallbackRouter = createGlobalRouterFallback();
|
|
92
|
+
if (globalFallbackRouter) return createScopedRuntimeRouter(globalFallbackRouter, basePath);
|
|
93
|
+
throw new Error("当前运行环境不支持 Router,请升级宿主基础库或检查平台路由能力");
|
|
94
|
+
}
|
|
91
95
|
const globalFallbackRouter = createGlobalRouterFallback();
|
|
92
|
-
if (globalFallbackRouter) return createScopedRuntimeRouter(globalFallbackRouter
|
|
93
|
-
throw new Error(
|
|
96
|
+
if (globalFallbackRouter) return createScopedRuntimeRouter(globalFallbackRouter);
|
|
97
|
+
throw new Error(`${helperName}() 必须在 setup() 的同步阶段调用`);
|
|
94
98
|
}
|
|
95
99
|
/**
|
|
96
|
-
*
|
|
100
|
+
* 获取与当前组件路径语义一致的原生 Router 对象。
|
|
97
101
|
*
|
|
98
102
|
* - 优先使用实例上的 `this.router`(组件路径语义)。
|
|
99
103
|
* - 不可用时回退到 `this.pageRouter`。
|
|
100
|
-
* -
|
|
104
|
+
* - App setup 或低版本基础库再回退到宿主全局路由方法。
|
|
105
|
+
* - 无 setup 上下文且宿主全局路由可用时,仍可创建应用级路由器。
|
|
101
106
|
*
|
|
102
107
|
* 如需更贴近 Vue Router 的高阶能力(导航守卫、失败类型、统一解析),
|
|
103
108
|
* 推荐改用 `wevu/router` 子入口的 `useRouter()`。
|
|
@@ -106,11 +111,11 @@ function useNativeRouter() {
|
|
|
106
111
|
return useRuntimeRouterByAccessor("router", "pageRouter", "useNativeRouter");
|
|
107
112
|
}
|
|
108
113
|
/**
|
|
109
|
-
*
|
|
114
|
+
* 获取与当前页面路径语义一致的原生 Router 对象。
|
|
110
115
|
*
|
|
111
116
|
* - 优先使用实例上的 `this.pageRouter`(页面路径语义)。
|
|
112
117
|
* - 不可用时回退到 `this.router`。
|
|
113
|
-
* -
|
|
118
|
+
* - App setup 或低版本基础库再回退到宿主全局路由方法。
|
|
114
119
|
*
|
|
115
120
|
* 如需更贴近 Vue Router 的高阶能力(导航守卫、失败类型、统一解析),
|
|
116
121
|
* 推荐改用 `wevu/router` 子入口的 `useRouter()`。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.mjs","names":[],"sources":["../../../../src/runtime/vueCompat/router.ts"],"sourcesContent":["import type { SetupContextRouter } from '../types'\nimport { notifyRouteStateSync } from '../../router/routeSync'\nimport { parsePathInput } from '../../routerInternal/location'\nimport { createAbsoluteRoutePath, resolvePath, stringifyQuery } from '../../routerInternal/shared'\nimport { getCurrentSetupContext } from '../hooks'\nimport { getCurrentMiniProgramGlobalRouter } from '../platform'\n\ntype RuntimeRouter = SetupContextRouter\ntype RuntimeRouterMethodName = 'switchTab' | 'reLaunch' | 'redirectTo' | 'navigateTo' | 'navigateBack'\ntype RuntimeRouterAccessor = 'router' | 'pageRouter'\n\nconst RUNTIME_ROUTER_METHODS: RuntimeRouterMethodName[] = ['switchTab', 'reLaunch', 'redirectTo', 'navigateTo', 'navigateBack']\nconst runtimeRouterWrapperCache = new WeakMap<RuntimeRouter, Map<string, RuntimeRouter>>()\n\nfunction isRuntimeRouter(candidate: unknown): candidate is RuntimeRouter {\n if (!candidate || typeof candidate !== 'object') {\n return false\n }\n return RUNTIME_ROUTER_METHODS.every((methodName) => {\n return typeof (candidate as Record<string, any>)[methodName] === 'function'\n })\n}\n\nfunction createGlobalRouterFallback(): RuntimeRouter | undefined {\n return getCurrentMiniProgramGlobalRouter()\n}\n\nfunction resolveBasePathCandidate(candidate: unknown): string | undefined {\n if (typeof candidate !== 'string' || !candidate) {\n return undefined\n }\n const normalized = resolvePath(candidate, '')\n return normalized || undefined\n}\n\nfunction resolveRouterBasePath(\n nativeInstance: Record<string,
|
|
1
|
+
{"version":3,"file":"router.mjs","names":[],"sources":["../../../../src/runtime/vueCompat/router.ts"],"sourcesContent":["import type { SetupContextRouter } from '../types'\nimport { notifyRouteStateSync } from '../../router/routeSync'\nimport { parsePathInput } from '../../routerInternal/location'\nimport { createAbsoluteRoutePath, resolvePath, stringifyQuery } from '../../routerInternal/shared'\nimport { getCurrentSetupContext } from '../hooks'\nimport { getCurrentMiniProgramGlobalRouter } from '../platform'\n\ntype RuntimeRouter = SetupContextRouter\ntype RuntimeRouterMethodName = 'switchTab' | 'reLaunch' | 'redirectTo' | 'navigateTo' | 'navigateBack'\ntype RuntimeRouterAccessor = 'router' | 'pageRouter'\n\nconst RUNTIME_ROUTER_METHODS: RuntimeRouterMethodName[] = ['switchTab', 'reLaunch', 'redirectTo', 'navigateTo', 'navigateBack']\nconst runtimeRouterWrapperCache = new WeakMap<RuntimeRouter, Map<string, RuntimeRouter>>()\n\nfunction isRuntimeRouter(candidate: unknown): candidate is RuntimeRouter {\n if (!candidate || typeof candidate !== 'object') {\n return false\n }\n return RUNTIME_ROUTER_METHODS.every((methodName) => {\n return typeof (candidate as Record<string, any>)[methodName] === 'function'\n })\n}\n\nfunction createGlobalRouterFallback(): RuntimeRouter | undefined {\n return getCurrentMiniProgramGlobalRouter()\n}\n\nfunction resolveBasePathCandidate(candidate: unknown): string | undefined {\n if (typeof candidate !== 'string' || !candidate) {\n return undefined\n }\n const normalized = resolvePath(candidate, '')\n return normalized || undefined\n}\n\nfunction resolveRouterBasePath(\n nativeInstance: Record<string, unknown>,\n accessor: RuntimeRouterAccessor,\n): string | undefined {\n const candidates = accessor === 'pageRouter'\n ? [nativeInstance.route, nativeInstance.__route__, nativeInstance.is]\n : [nativeInstance.is, nativeInstance.route, nativeInstance.__route__]\n\n for (const candidate of candidates) {\n const resolved = resolveBasePathCandidate(candidate)\n if (resolved) {\n return resolved\n }\n }\n\n return undefined\n}\n\nfunction resolveScopedRouterUrl(url: string, basePath?: string): string {\n if (!basePath || (!url.startsWith('./') && !url.startsWith('../'))) {\n return url\n }\n\n const { path, query, hash } = parsePathInput(url)\n const resolvedPath = createAbsoluteRoutePath(resolvePath(path, basePath))\n const queryString = stringifyQuery(query)\n return `${resolvedPath}${queryString ? `?${queryString}` : ''}${hash}`\n}\n\nfunction createScopedRuntimeRouter(rawRouter: RuntimeRouter, basePath?: string): RuntimeRouter {\n const cacheKey = basePath ?? ''\n const cachedByBasePath = runtimeRouterWrapperCache.get(rawRouter)\n const cachedRouter = cachedByBasePath?.get(cacheKey)\n if (cachedRouter) {\n return cachedRouter\n }\n\n const scopedRouter = Object.create(null) as RuntimeRouter\n for (const methodName of RUNTIME_ROUTER_METHODS) {\n ;(scopedRouter as Record<string, any>)[methodName] = (option: Record<string, any>) => {\n const rawMethod = (rawRouter as Record<string, any>)[methodName]\n if (methodName === 'navigateBack' || !option || typeof option !== 'object') {\n return rawMethod.call(rawRouter, option)\n }\n\n const nextUrl = typeof option.url === 'string'\n ? resolveScopedRouterUrl(option.url, basePath)\n : option.url\n const originalSuccess = option.success\n const nextOption = {\n ...option,\n url: nextUrl,\n success: (...args: any[]) => {\n if (typeof nextUrl === 'string') {\n notifyRouteStateSync({\n method: methodName,\n source: 'native',\n url: nextUrl,\n })\n }\n return typeof originalSuccess === 'function'\n ? originalSuccess(...args)\n : undefined\n },\n }\n return rawMethod.call(rawRouter, nextOption)\n }\n }\n\n const nextCache = cachedByBasePath ?? new Map<string, RuntimeRouter>()\n nextCache.set(cacheKey, scopedRouter)\n runtimeRouterWrapperCache.set(rawRouter, nextCache)\n return scopedRouter\n}\n\nfunction useRuntimeRouterByAccessor(\n primaryAccessor: RuntimeRouterAccessor,\n fallbackAccessor: RuntimeRouterAccessor,\n helperName: 'useNativeRouter' | 'useNativePageRouter',\n): RuntimeRouter {\n const ctx = getCurrentSetupContext<Record<string, unknown>>()\n const nativeInstance = ctx?.instance && typeof ctx.instance === 'object'\n ? ctx.instance as Record<string, unknown>\n : undefined\n\n if (nativeInstance) {\n const basePath = resolveRouterBasePath(nativeInstance, primaryAccessor)\n const primaryRouter = nativeInstance[primaryAccessor]\n if (isRuntimeRouter(primaryRouter)) {\n return createScopedRuntimeRouter(primaryRouter, basePath)\n }\n\n const fallbackRouter = nativeInstance[fallbackAccessor]\n if (isRuntimeRouter(fallbackRouter)) {\n return createScopedRuntimeRouter(fallbackRouter, basePath)\n }\n\n const globalFallbackRouter = createGlobalRouterFallback()\n if (globalFallbackRouter) {\n return createScopedRuntimeRouter(globalFallbackRouter, basePath)\n }\n\n throw new Error('当前运行环境不支持 Router,请升级宿主基础库或检查平台路由能力')\n }\n\n const globalFallbackRouter = createGlobalRouterFallback()\n if (globalFallbackRouter) {\n return createScopedRuntimeRouter(globalFallbackRouter)\n }\n\n throw new Error(`${helperName}() 必须在 setup() 的同步阶段调用`)\n}\n\n/**\n * 获取与当前组件路径语义一致的原生 Router 对象。\n *\n * - 优先使用实例上的 `this.router`(组件路径语义)。\n * - 不可用时回退到 `this.pageRouter`。\n * - App setup 或低版本基础库再回退到宿主全局路由方法。\n * - 无 setup 上下文且宿主全局路由可用时,仍可创建应用级路由器。\n *\n * 如需更贴近 Vue Router 的高阶能力(导航守卫、失败类型、统一解析),\n * 推荐改用 `wevu/router` 子入口的 `useRouter()`。\n */\nexport function useNativeRouter(): RuntimeRouter {\n return useRuntimeRouterByAccessor('router', 'pageRouter', 'useNativeRouter')\n}\n\n/**\n * 获取与当前页面路径语义一致的原生 Router 对象。\n *\n * - 优先使用实例上的 `this.pageRouter`(页面路径语义)。\n * - 不可用时回退到 `this.router`。\n * - App setup 或低版本基础库再回退到宿主全局路由方法。\n *\n * 如需更贴近 Vue Router 的高阶能力(导航守卫、失败类型、统一解析),\n * 推荐改用 `wevu/router` 子入口的 `useRouter()`。\n */\nexport function useNativePageRouter(): RuntimeRouter {\n return useRuntimeRouterByAccessor('pageRouter', 'router', 'useNativePageRouter')\n}\n"],"mappings":";;;;;;;;AAWA,MAAM,yBAAoD;CAAC;CAAa;CAAY;CAAc;CAAc;AAAc;AAC9H,MAAM,4CAA4B,IAAI,QAAmD;AAEzF,SAAS,gBAAgB,WAAgD;CACvE,IAAI,CAAC,aAAa,OAAO,cAAc,UACrC,OAAO;CAET,OAAO,uBAAuB,OAAO,eAAe;EAClD,OAAO,OAAQ,UAAkC,gBAAgB;CACnE,CAAC;AACH;AAEA,SAAS,6BAAwD;CAC/D,OAAO,kCAAkC;AAC3C;AAEA,SAAS,yBAAyB,WAAwC;CACxE,IAAI,OAAO,cAAc,YAAY,CAAC,WACpC;CAGF,OADmB,YAAY,WAAW,EAC1B,KAAK;AACvB;AAEA,SAAS,sBACP,gBACA,UACoB;CACpB,MAAM,aAAa,aAAa,eAC5B;EAAC,eAAe;EAAO,eAAe;EAAW,eAAe;CAAE,IAClE;EAAC,eAAe;EAAI,eAAe;EAAO,eAAe;CAAS;CAEtE,KAAK,MAAM,aAAa,YAAY;EAClC,MAAM,WAAW,yBAAyB,SAAS;EACnD,IAAI,UACF,OAAO;CAEX;AAGF;AAEA,SAAS,uBAAuB,KAAa,UAA2B;CACtE,IAAI,CAAC,YAAa,CAAC,IAAI,WAAW,IAAI,KAAK,CAAC,IAAI,WAAW,KAAK,GAC9D,OAAO;CAGT,MAAM,EAAE,MAAM,OAAO,SAAS,eAAe,GAAG;CAChD,MAAM,eAAe,wBAAwB,YAAY,MAAM,QAAQ,CAAC;CACxE,MAAM,cAAc,eAAe,KAAK;CACxC,OAAO,GAAG,eAAe,cAAc,IAAI,gBAAgB,KAAK;AAClE;AAEA,SAAS,0BAA0B,WAA0B,UAAkC;CAC7F,MAAM,WAAW,sDAAY;CAC7B,MAAM,mBAAmB,0BAA0B,IAAI,SAAS;CAChE,MAAM,mFAAe,iBAAkB,IAAI,QAAQ;CACnD,IAAI,cACF,OAAO;CAGT,MAAM,eAAe,OAAO,OAAO,IAAI;CACvC,KAAK,MAAM,cAAc,wBACtB,AAAC,aAAqC,eAAe,WAAgC;EACpF,MAAM,YAAa,UAAkC;EACrD,IAAI,eAAe,kBAAkB,CAAC,UAAU,OAAO,WAAW,UAChE,OAAO,UAAU,KAAK,WAAW,MAAM;EAGzC,MAAM,UAAU,OAAO,OAAO,QAAQ,WAClC,uBAAuB,OAAO,KAAK,QAAQ,IAC3C,OAAO;EACX,MAAM,kBAAkB,OAAO;EAC/B,MAAM,aAAa;GACjB,GAAG;GACH,KAAK;GACL,UAAU,GAAG,SAAgB;IAC3B,IAAI,OAAO,YAAY,UACrB,qBAAqB;KACnB,QAAQ;KACR,QAAQ;KACR,KAAK;IACP,CAAC;IAEH,OAAO,OAAO,oBAAoB,aAC9B,gBAAgB,GAAG,IAAI,IACvB;GACN;EACF;EACA,OAAO,UAAU,KAAK,WAAW,UAAU;CAC7C;CAGF,MAAM,YAAY,8FAAoB,IAAI,IAA2B;CACrE,UAAU,IAAI,UAAU,YAAY;CACpC,0BAA0B,IAAI,WAAW,SAAS;CAClD,OAAO;AACT;AAEA,SAAS,2BACP,iBACA,kBACA,YACe;CACf,MAAM,MAAM,uBAAgD;CAC5D,MAAM,4DAAiB,IAAK,aAAY,OAAO,IAAI,aAAa,WAC5D,IAAI,WACJ;CAEJ,IAAI,gBAAgB;EAClB,MAAM,WAAW,sBAAsB,gBAAgB,eAAe;EACtE,MAAM,gBAAgB,eAAe;EACrC,IAAI,gBAAgB,aAAa,GAC/B,OAAO,0BAA0B,eAAe,QAAQ;EAG1D,MAAM,iBAAiB,eAAe;EACtC,IAAI,gBAAgB,cAAc,GAChC,OAAO,0BAA0B,gBAAgB,QAAQ;EAG3D,MAAM,uBAAuB,2BAA2B;EACxD,IAAI,sBACF,OAAO,0BAA0B,sBAAsB,QAAQ;EAGjE,MAAM,IAAI,MAAM,oCAAoC;CACtD;CAEA,MAAM,uBAAuB,2BAA2B;CACxD,IAAI,sBACF,OAAO,0BAA0B,oBAAoB;CAGvD,MAAM,IAAI,MAAM,GAAG,WAAW,uBAAuB;AACvD;;;;;;;;;;;;AAaA,SAAgB,kBAAiC;CAC/C,OAAO,2BAA2B,UAAU,cAAc,iBAAiB;AAC7E;;;;;;;;;;;AAYA,SAAgB,sBAAqC;CACnD,OAAO,2BAA2B,cAAc,UAAU,qBAAqB;AACjF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ShallowRef } from "../../reactivity/ref.mjs";
|
|
2
|
+
import "../../reactivity/index.mjs";
|
|
3
|
+
import { TemplateRefs } from "../types.mjs";
|
|
4
|
+
//#region src/runtime/vueCompat/templateRef.d.ts
|
|
5
|
+
export type TemplateRef<T = unknown> = Readonly<ShallowRef<T | null>>;
|
|
6
|
+
export declare function useTemplateRef<K extends keyof TemplateRefs>(name: K): TemplateRef<TemplateRefs[K]>;
|
|
7
|
+
export declare function useTemplateRef<T = unknown>(name: string): TemplateRef<T>;
|
|
8
|
+
//#endregion
|
|
9
|
+
//# sourceMappingURL=templateRef.d.mts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { shallowRef } from "../../reactivity/shallowRef.mjs";
|
|
2
2
|
import { getCurrentInstance } from "../hooks/base.mjs";
|
|
3
|
+
import { installTemplateRefs } from "../features/templateRefs.mjs";
|
|
3
4
|
import { WEVU_TEMPLATE_REF_MAP_KEY } from "@weapp-core/constants";
|
|
4
5
|
|
|
5
6
|
//#region src/runtime/vueCompat/templateRef.ts
|
|
@@ -20,6 +21,7 @@ function ensureTemplateRefMap(target) {
|
|
|
20
21
|
return next;
|
|
21
22
|
}
|
|
22
23
|
function useTemplateRef(name) {
|
|
24
|
+
installTemplateRefs();
|
|
23
25
|
const instance = getCurrentInstance();
|
|
24
26
|
if (!instance) throw new Error("useTemplateRef() 必须在 setup() 的同步阶段调用");
|
|
25
27
|
const normalized = typeof name === "string" ? name.trim() : "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateRef.mjs","names":[],"sources":["../../../../src/runtime/vueCompat/templateRef.ts"],"sourcesContent":["import type { Ref, ShallowRef } from '../../reactivity'\nimport type { InternalRuntimeState, TemplateRefs } from '../types'\nimport { WEVU_TEMPLATE_REF_MAP_KEY } from '@weapp-core/constants'\nimport { shallowRef } from '../../reactivity'\nimport { getCurrentInstance } from '../hooks'\n\ntype TemplateRefMap = Map<string, Ref<any>>\n\nfunction ensureTemplateRefMap(target: InternalRuntimeState): TemplateRefMap {\n const existing = (target as any)[WEVU_TEMPLATE_REF_MAP_KEY] as TemplateRefMap | undefined\n if (existing) {\n return existing\n }\n const next = new Map<string, Ref<any>>()\n try {\n Object.defineProperty(target, WEVU_TEMPLATE_REF_MAP_KEY, {\n value: next,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n }\n catch {\n ;(target as any)[WEVU_TEMPLATE_REF_MAP_KEY] = next\n }\n return next\n}\n\nexport type TemplateRef<T = unknown> = Readonly<ShallowRef<T | null>>\n\nexport function useTemplateRef<K extends keyof TemplateRefs>(name: K): TemplateRef<TemplateRefs[K]>\nexport function useTemplateRef<T = unknown>(name: string): TemplateRef<T>\nexport function useTemplateRef<T = unknown>(name: string): TemplateRef<T> {\n const instance = getCurrentInstance()\n if (!instance) {\n throw new Error('useTemplateRef() 必须在 setup() 的同步阶段调用')\n }\n const normalized = typeof name === 'string' ? name.trim() : ''\n if (!normalized) {\n throw new Error('useTemplateRef() 需要传入有效的模板 ref 名称')\n }\n const map = ensureTemplateRefMap(instance)\n const existing = map.get(normalized)\n if (existing) {\n return existing as TemplateRef<T>\n }\n const target = shallowRef<T | null>(null)\n map.set(normalized, target)\n return target as TemplateRef<T>\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"templateRef.mjs","names":[],"sources":["../../../../src/runtime/vueCompat/templateRef.ts"],"sourcesContent":["import type { Ref, ShallowRef } from '../../reactivity'\nimport type { InternalRuntimeState, TemplateRefs } from '../types'\nimport { WEVU_TEMPLATE_REF_MAP_KEY } from '@weapp-core/constants'\nimport { shallowRef } from '../../reactivity'\nimport { installTemplateRefs } from '../features/templateRefs'\nimport { getCurrentInstance } from '../hooks'\n\ntype TemplateRefMap = Map<string, Ref<any>>\n\nfunction ensureTemplateRefMap(target: InternalRuntimeState): TemplateRefMap {\n const existing = (target as any)[WEVU_TEMPLATE_REF_MAP_KEY] as TemplateRefMap | undefined\n if (existing) {\n return existing\n }\n const next = new Map<string, Ref<any>>()\n try {\n Object.defineProperty(target, WEVU_TEMPLATE_REF_MAP_KEY, {\n value: next,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n }\n catch {\n ;(target as any)[WEVU_TEMPLATE_REF_MAP_KEY] = next\n }\n return next\n}\n\nexport type TemplateRef<T = unknown> = Readonly<ShallowRef<T | null>>\n\nexport function useTemplateRef<K extends keyof TemplateRefs>(name: K): TemplateRef<TemplateRefs[K]>\nexport function useTemplateRef<T = unknown>(name: string): TemplateRef<T>\nexport function useTemplateRef<T = unknown>(name: string): TemplateRef<T> {\n installTemplateRefs()\n const instance = getCurrentInstance()\n if (!instance) {\n throw new Error('useTemplateRef() 必须在 setup() 的同步阶段调用')\n }\n const normalized = typeof name === 'string' ? name.trim() : ''\n if (!normalized) {\n throw new Error('useTemplateRef() 需要传入有效的模板 ref 名称')\n }\n const map = ensureTemplateRefMap(instance)\n const existing = map.get(normalized)\n if (existing) {\n return existing as TemplateRef<T>\n }\n const target = shallowRef<T | null>(null)\n map.set(normalized, target)\n return target as TemplateRef<T>\n}\n"],"mappings":";;;;;;AASA,SAAS,qBAAqB,QAA8C;CAC1E,MAAM,WAAY,OAAe;CACjC,IAAI,UACF,OAAO;CAET,MAAM,uBAAO,IAAI,IAAsB;CACvC,IAAI;EACF,OAAO,eAAe,QAAQ,2BAA2B;GACvD,OAAO;GACP,cAAc;GACd,YAAY;GACZ,UAAU;EACZ,CAAC;CACH,kBACM;EACH,AAAC,OAAe,6BAA6B;CAChD;CACA,OAAO;AACT;AAMA,SAAgB,eAA4B,MAA8B;CACxE,oBAAoB;CACpB,MAAM,WAAW,mBAAmB;CACpC,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,sCAAsC;CAExD,MAAM,aAAa,OAAO,SAAS,WAAW,KAAK,KAAK,IAAI;CAC5D,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,mCAAmC;CAErD,MAAM,MAAM,qBAAqB,QAAQ;CACzC,MAAM,WAAW,IAAI,IAAI,UAAU;CACnC,IAAI,UACF,OAAO;CAET,MAAM,SAAS,WAAqB,IAAI;CACxC,IAAI,IAAI,YAAY,MAAM;CAC1B,OAAO;AACT"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { useAttrs, useNativeInstance, useSlots } from "./vueCompat/context.mjs";
|
|
2
|
+
import { ModelModifiers, ModelRef, UseModelOptions, mergeModels, useBindModel, useChangeModel, useModel } from "./vueCompat/model.mjs";
|
|
3
|
+
import { useNativePageRouter, useNativeRouter } from "./vueCompat/router.mjs";
|
|
4
|
+
import { TemplateRef, useTemplateRef } from "./vueCompat/templateRef.mjs";
|
|
5
|
+
export { type ModelModifiers, type TemplateRef, type UseModelOptions, mergeModels, useAttrs, useBindModel, useChangeModel, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useSlots, useTemplateRef };
|
package/dist/dev/store/base.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { batch } from "../reactivity/core.mjs";
|
|
1
2
|
import { isObject, mergeShallow } from "./utils.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/store/base.ts
|
|
@@ -15,25 +16,18 @@ function createBaseApi(id, stateObj, notify, resetImpl) {
|
|
|
15
16
|
}
|
|
16
17
|
});
|
|
17
18
|
api.$patch = (patch) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
patch(stateObj);
|
|
30
|
-
notify("patch function");
|
|
31
|
-
} else {
|
|
32
|
-
mergeShallow(stateObj, patch);
|
|
33
|
-
notify("patch object");
|
|
34
|
-
}
|
|
19
|
+
const mutationType = typeof patch === "function" ? "patch function" : "patch object";
|
|
20
|
+
batch(() => {
|
|
21
|
+
const target = stateObj !== null && stateObj !== void 0 ? stateObj : api;
|
|
22
|
+
if (typeof patch === "function") patch(target);
|
|
23
|
+
else mergeShallow(target, patch);
|
|
24
|
+
});
|
|
25
|
+
notify(mutationType);
|
|
26
|
+
};
|
|
27
|
+
if (resetImpl) api.$reset = () => {
|
|
28
|
+
batch(resetImpl);
|
|
29
|
+
notify("patch object");
|
|
35
30
|
};
|
|
36
|
-
if (resetImpl) api.$reset = () => resetImpl();
|
|
37
31
|
const subs = /* @__PURE__ */ new Set();
|
|
38
32
|
api.$subscribe = (cb, _opts) => {
|
|
39
33
|
subs.add(cb);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.mjs","names":[],"sources":["../../../src/store/base.ts"],"sourcesContent":["import type { ActionSubscriber, MutationType, SubscriptionCallback } from './types'\nimport { isObject, mergeShallow } from './utils'\n\nexport function createBaseApi<S extends Record<string, any>>(\n id: string,\n stateObj: S | undefined,\n notify: (type: MutationType) => void,\n resetImpl?: () => void,\n) {\n const api: any = {\n $id: id,\n }\n Object.defineProperty(api, '$state', {\n get() {\n return stateObj\n },\n set(v: any) {\n if (stateObj && isObject(v)) {\n mergeShallow(stateObj, v)\n notify('patch object')\n }\n },\n })\n api.$patch = (patch: Record<string,
|
|
1
|
+
{"version":3,"file":"base.mjs","names":[],"sources":["../../../src/store/base.ts"],"sourcesContent":["import type { ActionSubscriber, MutationType, SubscriptionCallback } from './types'\nimport { batch } from '../reactivity'\nimport { isObject, mergeShallow } from './utils'\n\nexport function createBaseApi<S extends Record<string, any>>(\n id: string,\n stateObj: S | undefined,\n notify: (type: MutationType) => void,\n resetImpl?: () => void,\n) {\n const api: any = {\n $id: id,\n }\n Object.defineProperty(api, '$state', {\n get() {\n return stateObj\n },\n set(v: any) {\n if (stateObj && isObject(v)) {\n mergeShallow(stateObj, v)\n notify('patch object')\n }\n },\n })\n api.$patch = (patch: Record<string, unknown> | ((state: S) => void)) => {\n const mutationType: MutationType = typeof patch === 'function' ? 'patch function' : 'patch object'\n batch(() => {\n const target = stateObj ?? (api as S)\n if (typeof patch === 'function') {\n patch(target)\n }\n else {\n mergeShallow(target, patch)\n }\n })\n notify(mutationType)\n }\n if (resetImpl) {\n api.$reset = () => {\n batch(resetImpl)\n notify('patch object')\n }\n }\n const subs = new Set<SubscriptionCallback<S>>()\n api.$subscribe = (cb: SubscriptionCallback<S>, _opts?: { detached?: boolean }) => {\n subs.add(cb)\n return () => subs.delete(cb)\n }\n const actionSubs = new Set<ActionSubscriber<any>>()\n api.$onAction = (cb: ActionSubscriber<any>) => {\n actionSubs.add(cb)\n return () => actionSubs.delete(cb)\n }\n return { api, subs, actionSubs }\n}\n"],"mappings":";;;;AAIA,SAAgB,cACd,IACA,UACA,QACA,WACA;CACA,MAAM,MAAW,EACf,KAAK,GACP;CACA,OAAO,eAAe,KAAK,UAAU;EACnC,MAAM;GACJ,OAAO;EACT;EACA,IAAI,GAAQ;GACV,IAAI,YAAY,SAAS,CAAC,GAAG;IAC3B,aAAa,UAAU,CAAC;IACxB,OAAO,cAAc;GACvB;EACF;CACF,CAAC;CACD,IAAI,UAAU,UAA0D;EACtE,MAAM,eAA6B,OAAO,UAAU,aAAa,mBAAmB;EACpF,YAAY;GACV,MAAM,SAAS,sDAAa;GAC5B,IAAI,OAAO,UAAU,YACnB,MAAM,MAAM;QAGZ,aAAa,QAAQ,KAAK;EAE9B,CAAC;EACD,OAAO,YAAY;CACrB;CACA,IAAI,WACF,IAAI,eAAe;EACjB,MAAM,SAAS;EACf,OAAO,cAAc;CACvB;CAEF,MAAM,uBAAO,IAAI,IAA6B;CAC9C,IAAI,cAAc,IAA6B,UAAmC;EAChF,KAAK,IAAI,EAAE;EACX,aAAa,KAAK,OAAO,EAAE;CAC7B;CACA,MAAM,6BAAa,IAAI,IAA2B;CAClD,IAAI,aAAa,OAA8B;EAC7C,WAAW,IAAI,EAAE;EACjB,aAAa,WAAW,OAAO,EAAE;CACnC;CACA,OAAO;EAAE;EAAK;EAAM;CAAW;AACjC"}
|