wevu 6.18.7 → 6.19.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/dist/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/defineProperty.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/toPrimitive.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/toPropertyKey.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/typeof.mjs +1 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/defineProperty.mjs +14 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/toPrimitive.mjs +16 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/toPropertyKey.mjs +11 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.142.0/helpers/esm/typeof.mjs +12 -0
- package/dist/dev/index.mjs +48 -10
- package/dist/dev/internal-reactivity.mjs +15 -5
- package/dist/dev/internal-runtime.mjs +32 -4
- package/dist/dev/internal-template.mjs +1 -1
- package/dist/dev/package.mjs +6 -0
- package/dist/dev/package.mjs.map +1 -0
- package/dist/dev/reactivity/computed.mjs +49 -0
- package/dist/dev/reactivity/computed.mjs.map +1 -0
- package/dist/dev/reactivity/core.mjs +184 -0
- package/dist/dev/reactivity/core.mjs.map +1 -0
- package/dist/dev/reactivity/reactive/mutation.mjs +12 -0
- package/dist/dev/reactivity/reactive/mutation.mjs.map +1 -0
- package/dist/dev/{computed-BxRsUJgi.mjs → reactivity/reactive/patch.mjs} +8 -49
- package/dist/dev/reactivity/reactive/patch.mjs.map +1 -0
- package/dist/dev/reactivity/reactive/patchState.mjs +138 -0
- package/dist/dev/reactivity/reactive/patchState.mjs.map +1 -0
- package/dist/dev/reactivity/reactive/shallow.mjs +77 -0
- package/dist/dev/reactivity/reactive/shallow.mjs.map +1 -0
- package/dist/dev/reactivity/reactive/shared.mjs +40 -0
- package/dist/dev/reactivity/reactive/shared.mjs.map +1 -0
- package/dist/dev/reactivity/reactive/state.mjs +8 -0
- package/dist/dev/reactivity/reactive/state.mjs.map +1 -0
- package/dist/dev/reactivity/reactive.mjs +213 -0
- package/dist/dev/reactivity/reactive.mjs.map +1 -0
- package/dist/dev/reactivity/readonly.mjs +69 -0
- package/dist/dev/reactivity/readonly.mjs.map +1 -0
- package/dist/dev/reactivity/ref.mjs +97 -0
- package/dist/dev/reactivity/ref.mjs.map +1 -0
- package/dist/dev/reactivity/shallowRef.mjs +71 -0
- package/dist/dev/reactivity/shallowRef.mjs.map +1 -0
- package/dist/dev/{toRefs-D06VmFK2.mjs → reactivity/toRefs.mjs} +4 -3
- package/dist/dev/reactivity/toRefs.mjs.map +1 -0
- package/dist/dev/reactivity/traverse.mjs +40 -0
- package/dist/dev/reactivity/traverse.mjs.map +1 -0
- package/dist/dev/reactivity/watch/helpers.mjs +78 -0
- package/dist/dev/reactivity/watch/helpers.mjs.map +1 -0
- package/dist/dev/reactivity/watch/types.mjs +20 -0
- package/dist/dev/reactivity/watch/types.mjs.map +1 -0
- package/dist/dev/reactivity/watch.mjs +167 -0
- package/dist/dev/reactivity/watch.mjs.map +1 -0
- package/dist/dev/router/backNavigation.mjs +32 -0
- package/dist/dev/router/backNavigation.mjs.map +1 -0
- package/dist/dev/router/createRouter.mjs +179 -0
- package/dist/dev/router/createRouter.mjs.map +1 -0
- package/dist/dev/router/instance.mjs +17 -0
- package/dist/dev/router/instance.mjs.map +1 -0
- package/dist/dev/router/navigationApi.mjs +94 -0
- package/dist/dev/router/navigationApi.mjs.map +1 -0
- package/dist/dev/router/navigationCore.mjs +139 -0
- package/dist/dev/router/navigationCore.mjs.map +1 -0
- package/dist/dev/router/navigationResult.mjs +54 -0
- package/dist/dev/router/navigationResult.mjs.map +1 -0
- package/dist/dev/router/navigationTarget.mjs +122 -0
- package/dist/dev/router/navigationTarget.mjs.map +1 -0
- package/dist/dev/router/navigationTargetHelpers.mjs +38 -0
- package/dist/dev/router/navigationTargetHelpers.mjs.map +1 -0
- package/dist/dev/router/resolve.mjs +29 -0
- package/dist/dev/router/resolve.mjs.map +1 -0
- package/dist/dev/router/routeRegistry.mjs +78 -0
- package/dist/dev/router/routeRegistry.mjs.map +1 -0
- package/dist/dev/router/routeSync.mjs +72 -0
- package/dist/dev/router/routeSync.mjs.map +1 -0
- package/dist/dev/router/types.mjs +11 -0
- package/dist/dev/router/types.mjs.map +1 -0
- package/dist/dev/router/useRoute.mjs +106 -0
- package/dist/dev/router/useRoute.mjs.map +1 -0
- package/dist/dev/router/useRouter.mjs +15 -0
- package/dist/dev/router/useRouter.mjs.map +1 -0
- package/dist/dev/router.mjs +9 -1378
- package/dist/dev/routerInternal/location.mjs +68 -0
- package/dist/dev/routerInternal/location.mjs.map +1 -0
- package/dist/dev/routerInternal/matching.mjs +149 -0
- package/dist/dev/routerInternal/matching.mjs.map +1 -0
- package/dist/dev/routerInternal/params.mjs +95 -0
- package/dist/dev/routerInternal/params.mjs.map +1 -0
- package/dist/dev/routerInternal/path.mjs +42 -0
- package/dist/dev/routerInternal/path.mjs.map +1 -0
- package/dist/dev/routerInternal/query.mjs +113 -0
- package/dist/dev/routerInternal/query.mjs.map +1 -0
- package/dist/dev/routerInternal/records.mjs +173 -0
- package/dist/dev/routerInternal/records.mjs.map +1 -0
- package/dist/dev/routerInternal/recordsWarnings.mjs +49 -0
- package/dist/dev/routerInternal/recordsWarnings.mjs.map +1 -0
- package/dist/dev/routerInternal/snapshots.mjs +126 -0
- package/dist/dev/routerInternal/snapshots.mjs.map +1 -0
- package/dist/dev/runtime/app/computed.mjs +68 -0
- package/dist/dev/runtime/app/computed.mjs.map +1 -0
- package/dist/dev/runtime/app/context.mjs +275 -0
- package/dist/dev/runtime/app/context.mjs.map +1 -0
- package/dist/dev/runtime/app/diagnostics.mjs +34 -0
- package/dist/dev/runtime/app/diagnostics.mjs.map +1 -0
- package/dist/dev/runtime/app/mount.mjs +270 -0
- package/dist/dev/runtime/app/mount.mjs.map +1 -0
- package/dist/dev/runtime/app/pending.mjs +14 -0
- package/dist/dev/runtime/app/pending.mjs.map +1 -0
- package/dist/dev/runtime/app/setData/patchScheduler.mjs +158 -0
- package/dist/dev/runtime/app/setData/patchScheduler.mjs.map +1 -0
- package/dist/dev/runtime/app/setData/payload.mjs +161 -0
- package/dist/dev/runtime/app/setData/payload.mjs.map +1 -0
- package/dist/dev/runtime/app/setData/scheduler.mjs +313 -0
- package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -0
- package/dist/dev/runtime/app/setData/snapshot.mjs +129 -0
- package/dist/dev/runtime/app/setData/snapshot.mjs.map +1 -0
- package/dist/dev/runtime/app/setDataOptions.mjs +73 -0
- package/dist/dev/runtime/app/setDataOptions.mjs.map +1 -0
- package/dist/dev/runtime/app.mjs +93 -0
- package/dist/dev/runtime/app.mjs.map +1 -0
- package/dist/dev/runtime/bindModel.mjs +92 -0
- package/dist/dev/runtime/bindModel.mjs.map +1 -0
- package/dist/dev/runtime/defaults.mjs +61 -0
- package/dist/dev/runtime/defaults.mjs.map +1 -0
- package/dist/dev/runtime/define/initialComputed.mjs +125 -0
- package/dist/dev/runtime/define/initialComputed.mjs.map +1 -0
- package/dist/dev/runtime/define/options.mjs +169 -0
- package/dist/dev/runtime/define/options.mjs.map +1 -0
- package/dist/dev/runtime/define/optionsApi.mjs +48 -0
- package/dist/dev/runtime/define/optionsApi.mjs.map +1 -0
- package/dist/dev/runtime/define/props.mjs +194 -0
- package/dist/dev/runtime/define/props.mjs.map +1 -0
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +316 -0
- package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -0
- package/dist/dev/runtime/define/setupResult.mjs +78 -0
- package/dist/dev/runtime/define/setupResult.mjs.map +1 -0
- package/dist/dev/runtime/define.mjs +142 -0
- package/dist/dev/runtime/define.mjs.map +1 -0
- package/dist/dev/runtime/diff.mjs +193 -0
- package/dist/dev/runtime/diff.mjs.map +1 -0
- package/dist/dev/runtime/disposables.mjs +81 -0
- package/dist/dev/runtime/disposables.mjs.map +1 -0
- package/dist/dev/runtime/elementIntersectionObserver.mjs +80 -0
- package/dist/dev/runtime/elementIntersectionObserver.mjs.map +1 -0
- package/dist/dev/runtime/emit.mjs +36 -0
- package/dist/dev/runtime/emit.mjs.map +1 -0
- package/dist/dev/{base-CYkvI7w8.mjs → runtime/hooks/base.mjs} +3 -140
- package/dist/dev/runtime/hooks/base.mjs.map +1 -0
- package/dist/dev/runtime/hooks/register.mjs +92 -0
- package/dist/dev/runtime/hooks/register.mjs.map +1 -0
- package/dist/dev/runtime/hooks/vue.mjs +81 -0
- package/dist/dev/runtime/hooks/vue.mjs.map +1 -0
- package/dist/dev/runtime/internal.mjs +18 -0
- package/dist/dev/runtime/internal.mjs.map +1 -0
- package/dist/dev/runtime/intersectionObserver.mjs +46 -0
- package/dist/dev/runtime/intersectionObserver.mjs.map +1 -0
- package/dist/dev/runtime/layoutBridge.mjs +303 -0
- package/dist/dev/runtime/layoutBridge.mjs.map +1 -0
- package/dist/dev/runtime/layoutComponentMatcher.mjs +11 -0
- package/dist/dev/runtime/layoutComponentMatcher.mjs.map +1 -0
- package/dist/dev/runtime/nativeBridge.mjs +21 -0
- package/dist/dev/runtime/nativeBridge.mjs.map +1 -0
- package/dist/dev/runtime/noSetData.mjs +18 -0
- package/dist/dev/runtime/noSetData.mjs.map +1 -0
- package/dist/dev/runtime/pageEnvironment.mjs +100 -0
- package/dist/dev/runtime/pageEnvironment.mjs.map +1 -0
- package/dist/dev/runtime/pageLayout.mjs +71 -0
- package/dist/dev/runtime/pageLayout.mjs.map +1 -0
- package/dist/dev/runtime/pageScroll.mjs +110 -0
- package/dist/dev/runtime/pageScroll.mjs.map +1 -0
- package/dist/dev/runtime/platform.mjs +79 -0
- package/dist/dev/runtime/platform.mjs.map +1 -0
- package/dist/dev/runtime/provide.mjs +71 -0
- package/dist/dev/runtime/provide.mjs.map +1 -0
- package/dist/dev/runtime/provideContext.mjs +101 -0
- package/dist/dev/runtime/provideContext.mjs.map +1 -0
- package/dist/dev/runtime/provideStore.mjs +18 -0
- package/dist/dev/runtime/provideStore.mjs.map +1 -0
- package/dist/dev/runtime/pullDownRefresh.mjs +24 -0
- package/dist/dev/runtime/pullDownRefresh.mjs.map +1 -0
- package/dist/dev/runtime/register/app.mjs +161 -0
- package/dist/dev/runtime/register/app.mjs.map +1 -0
- package/dist/dev/runtime/register/component/features.mjs +43 -0
- package/dist/dev/runtime/register/component/features.mjs.map +1 -0
- package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs +64 -0
- package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs.map +1 -0
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs +96 -0
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs.map +1 -0
- package/dist/dev/runtime/register/component/lifecycle.mjs +122 -0
- package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -0
- package/dist/dev/runtime/register/component/methods.mjs +82 -0
- package/dist/dev/runtime/register/component/methods.mjs.map +1 -0
- package/dist/dev/runtime/register/component/options.mjs +204 -0
- package/dist/dev/runtime/register/component/options.mjs.map +1 -0
- package/dist/dev/runtime/register/component/props.mjs +218 -0
- package/dist/dev/runtime/register/component/props.mjs.map +1 -0
- package/dist/dev/runtime/register/component/registerDefinition.mjs +290 -0
- package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -0
- package/dist/dev/runtime/register/component.mjs +129 -0
- package/dist/dev/runtime/register/component.mjs.map +1 -0
- package/dist/dev/runtime/register/inline.mjs +145 -0
- package/dist/dev/runtime/register/inline.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +53 -0
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +34 -0
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +230 -0
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +166 -0
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs +122 -0
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance.mjs +441 -0
- package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -0
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +95 -0
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs.map +1 -0
- package/dist/dev/runtime/register/setup.mjs +22 -0
- package/dist/dev/runtime/register/setup.mjs.map +1 -0
- package/dist/dev/runtime/register/snapshot.mjs +18 -0
- package/dist/dev/runtime/register/snapshot.mjs.map +1 -0
- package/dist/dev/runtime/register/watch.mjs +57 -0
- package/dist/dev/runtime/register/watch.mjs.map +1 -0
- package/dist/dev/runtime/scopedSlots.mjs +115 -0
- package/dist/dev/runtime/scopedSlots.mjs.map +1 -0
- package/dist/dev/runtime/selectorQuery.mjs +49 -0
- package/dist/dev/runtime/selectorQuery.mjs.map +1 -0
- package/dist/dev/runtime/setupTracking.mjs +59 -0
- package/dist/dev/runtime/setupTracking.mjs.map +1 -0
- package/dist/dev/{template-n_iVr0ey.mjs → runtime/template.mjs} +7 -4
- package/dist/dev/runtime/template.mjs.map +1 -0
- package/dist/dev/runtime/templateRefs/helpers.mjs +259 -0
- package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -0
- package/dist/dev/runtime/templateRefs.mjs +162 -0
- package/dist/dev/runtime/templateRefs.mjs.map +1 -0
- package/dist/dev/runtime/uniAppHost.mjs +119 -0
- package/dist/dev/runtime/uniAppHost.mjs.map +1 -0
- package/dist/dev/runtime/updatePerformance.mjs +41 -0
- package/dist/dev/runtime/updatePerformance.mjs.map +1 -0
- package/dist/dev/runtime/use.mjs +25 -0
- package/dist/dev/runtime/use.mjs.map +1 -0
- package/dist/dev/runtime/vueCompat/context.mjs +25 -0
- package/dist/dev/runtime/vueCompat/context.mjs.map +1 -0
- package/dist/dev/runtime/vueCompat/model.mjs +119 -0
- package/dist/dev/runtime/vueCompat/model.mjs.map +1 -0
- package/dist/dev/runtime/vueCompat/router.mjs +124 -0
- package/dist/dev/runtime/vueCompat/router.mjs.map +1 -0
- package/dist/dev/runtime/vueCompat/templateRef.mjs +37 -0
- package/dist/dev/runtime/vueCompat/templateRef.mjs.map +1 -0
- package/dist/dev/scheduler.mjs +75 -0
- package/dist/dev/scheduler.mjs.map +1 -0
- package/dist/dev/store/actions.mjs +40 -0
- package/dist/dev/store/actions.mjs.map +1 -0
- package/dist/dev/store/base.mjs +56 -0
- package/dist/dev/store/base.mjs.map +1 -0
- package/dist/dev/store/define/optionsStyle.mjs +125 -0
- package/dist/dev/store/define/optionsStyle.mjs.map +1 -0
- package/dist/dev/store/define/setupStyle.mjs +145 -0
- package/dist/dev/store/define/setupStyle.mjs.map +1 -0
- package/dist/dev/store/define/shared.mjs +38 -0
- package/dist/dev/store/define/shared.mjs.map +1 -0
- package/dist/dev/store/define.mjs +23 -0
- package/dist/dev/store/define.mjs.map +1 -0
- package/dist/dev/store/manager.mjs +21 -0
- package/dist/dev/store/manager.mjs.map +1 -0
- package/dist/dev/store/storeToRefs.mjs +29 -0
- package/dist/dev/store/storeToRefs.mjs.map +1 -0
- package/dist/dev/store/utils.mjs +49 -0
- package/dist/dev/store/utils.mjs.map +1 -0
- package/dist/dev/store.mjs +3 -1
- package/dist/dev/utils.mjs +16 -0
- package/dist/dev/utils.mjs.map +1 -0
- package/dist/dev/version.mjs +8 -0
- package/dist/dev/version.mjs.map +1 -0
- package/dist/dev/vue-demi.mjs +48 -168
- package/dist/dev/vue-demi.mjs.map +1 -1
- package/dist/index.d.mts +71 -7
- package/dist/index.mjs +1 -1
- package/dist/internal-reactivity.d.mts +16 -2
- package/dist/internal-reactivity.mjs +1 -1
- package/dist/internal-runtime.d.mts +35 -2
- package/dist/internal-runtime.mjs +1 -1
- package/dist/internal-template.d.mts +1 -1
- package/dist/internal-template.mjs +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/macros/shared.d.mts +81 -0
- package/dist/macros.d.mts +70 -0
- package/dist/package.mjs +1 -0
- package/dist/reactivity/computed.d.mts +21 -0
- package/dist/reactivity/computed.mjs +1 -0
- package/dist/reactivity/core.d.mts +34 -0
- package/dist/reactivity/core.mjs +1 -0
- package/dist/reactivity/index.d.mts +15 -0
- package/dist/reactivity/reactive/mutation.d.mts +21 -0
- package/dist/reactivity/reactive/mutation.mjs +1 -0
- package/dist/reactivity/reactive/patch.d.mts +18 -0
- package/dist/reactivity/reactive/patch.mjs +1 -0
- package/dist/reactivity/reactive/patchState.mjs +1 -0
- package/dist/reactivity/reactive/shallow.d.mts +22 -0
- package/dist/reactivity/reactive/shallow.mjs +1 -0
- package/dist/reactivity/reactive/shared.d.mts +4 -0
- package/dist/reactivity/reactive/shared.mjs +1 -0
- package/dist/reactivity/reactive/state.mjs +1 -0
- package/dist/reactivity/reactive.d.mts +41 -0
- package/dist/reactivity/reactive.mjs +1 -0
- package/dist/reactivity/readonly.d.mts +27 -0
- package/dist/reactivity/readonly.mjs +1 -0
- package/dist/reactivity/ref.d.mts +27 -0
- package/dist/reactivity/ref.mjs +1 -0
- package/dist/reactivity/shallowRef.d.mts +19 -0
- package/dist/reactivity/shallowRef.mjs +1 -0
- package/dist/reactivity/toRefs.d.mts +43 -0
- package/dist/reactivity/toRefs.mjs +1 -0
- package/dist/reactivity/traverse.d.mts +8 -0
- package/dist/reactivity/traverse.mjs +1 -0
- package/dist/reactivity/watch/helpers.mjs +1 -0
- package/dist/reactivity/watch/types.d.mts +43 -0
- package/dist/reactivity/watch/types.mjs +1 -0
- package/dist/reactivity/watch.d.mts +21 -0
- package/dist/reactivity/watch.mjs +1 -0
- package/dist/router/backNavigation.mjs +1 -0
- package/dist/router/createRouter.d.mts +8 -0
- package/dist/router/createRouter.mjs +1 -0
- package/dist/router/instance.mjs +1 -0
- package/dist/router/navigationApi.mjs +1 -0
- package/dist/router/navigationCore.d.mts +6 -0
- package/dist/router/navigationCore.mjs +1 -0
- package/dist/router/navigationResult.mjs +1 -0
- package/dist/router/navigationTarget.mjs +1 -0
- package/dist/router/navigationTargetHelpers.mjs +1 -0
- package/dist/router/resolve.d.mts +6 -0
- package/dist/router/resolve.mjs +1 -0
- package/dist/router/routeRegistry.mjs +1 -0
- package/dist/router/routeSync.d.mts +1 -0
- package/dist/router/routeSync.mjs +1 -0
- package/dist/router/types.d.mts +163 -0
- package/dist/router/types.mjs +1 -0
- package/dist/router/useRoute.d.mts +19 -0
- package/dist/router/useRoute.mjs +1 -0
- package/dist/router/useRouter.d.mts +8 -0
- package/dist/router/useRouter.mjs +1 -0
- package/dist/router.d.mts +9 -204
- package/dist/router.mjs +1 -1
- package/dist/routerInternal/location.mjs +1 -0
- package/dist/routerInternal/matching.mjs +1 -0
- package/dist/routerInternal/params.mjs +1 -0
- package/dist/routerInternal/path.mjs +1 -0
- package/dist/routerInternal/query.d.mts +7 -0
- package/dist/routerInternal/query.mjs +1 -0
- package/dist/routerInternal/records.mjs +1 -0
- package/dist/routerInternal/recordsWarnings.mjs +1 -0
- package/dist/routerInternal/snapshots.mjs +1 -0
- package/dist/routerInternal/types.d.mts +9 -0
- package/dist/runtime/app/computed.mjs +1 -0
- package/dist/runtime/app/context.mjs +1 -0
- package/dist/runtime/app/diagnostics.mjs +1 -0
- package/dist/runtime/app/mount.mjs +1 -0
- package/dist/runtime/app/pending.d.mts +10 -0
- package/dist/runtime/app/pending.mjs +1 -0
- package/dist/runtime/app/setData/patchScheduler.mjs +1 -0
- package/dist/runtime/app/setData/payload.mjs +1 -0
- package/dist/runtime/app/setData/scheduler.mjs +1 -0
- package/dist/runtime/app/setData/snapshot.mjs +1 -0
- package/dist/runtime/app/setDataOptions.mjs +1 -0
- package/dist/runtime/app.d.mts +8 -0
- package/dist/runtime/app.mjs +1 -0
- package/dist/runtime/bindModel.mjs +1 -0
- package/dist/runtime/defaults.d.mts +11 -0
- package/dist/runtime/defaults.mjs +1 -0
- package/dist/runtime/define/initialComputed.mjs +1 -0
- package/dist/runtime/define/options.mjs +1 -0
- package/dist/runtime/define/optionsApi.mjs +1 -0
- package/dist/runtime/define/props.mjs +1 -0
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -0
- package/dist/runtime/define/setupResult.mjs +1 -0
- package/dist/runtime/define.d.mts +105 -0
- package/dist/runtime/define.mjs +1 -0
- package/dist/runtime/diff.mjs +1 -0
- package/dist/runtime/disposables.d.mts +31 -0
- package/dist/runtime/disposables.mjs +1 -0
- package/dist/runtime/elementIntersectionObserver.d.mts +26 -0
- package/dist/runtime/elementIntersectionObserver.mjs +1 -0
- package/dist/runtime/emit.mjs +1 -0
- package/dist/runtime/hooks/base.d.mts +27 -0
- package/dist/runtime/hooks/base.mjs +1 -0
- package/dist/runtime/hooks/register.d.mts +30 -0
- package/dist/runtime/hooks/register.mjs +1 -0
- package/dist/runtime/hooks/vue.d.mts +53 -0
- package/dist/runtime/hooks/vue.mjs +1 -0
- package/dist/runtime/hooks.d.mts +4 -0
- package/dist/runtime/index.d.mts +47 -0
- package/dist/runtime/internal.mjs +1 -0
- package/dist/runtime/intersectionObserver.d.mts +14 -0
- package/dist/runtime/intersectionObserver.mjs +1 -0
- package/dist/runtime/layoutBridge.d.mts +59 -0
- package/dist/runtime/layoutBridge.mjs +1 -0
- package/dist/runtime/layoutComponentMatcher.mjs +1 -0
- package/dist/runtime/nativeBridge.mjs +1 -0
- package/dist/runtime/noSetData.d.mts +5 -0
- package/dist/runtime/noSetData.mjs +1 -0
- package/dist/runtime/pageEnvironment.d.mts +50 -0
- package/dist/runtime/pageEnvironment.mjs +1 -0
- package/dist/runtime/pageLayout.d.mts +26 -0
- package/dist/runtime/pageLayout.mjs +1 -0
- package/dist/runtime/pageScroll.d.mts +29 -0
- package/dist/runtime/pageScroll.mjs +1 -0
- package/dist/runtime/platform.mjs +1 -0
- package/dist/runtime/provide.d.mts +59 -0
- package/dist/runtime/provide.mjs +1 -0
- package/dist/runtime/provideContext.mjs +1 -0
- package/dist/runtime/provideStore.d.mts +7 -0
- package/dist/runtime/provideStore.mjs +1 -0
- package/dist/runtime/pullDownRefresh.d.mts +12 -0
- package/dist/runtime/pullDownRefresh.mjs +1 -0
- package/dist/runtime/register/app.d.mts +14 -0
- package/dist/runtime/register/app.mjs +1 -0
- package/dist/runtime/register/component/features.mjs +1 -0
- package/dist/runtime/register/component/lifecycle/optionalHooks.mjs +1 -0
- package/dist/runtime/register/component/lifecycle/platform.mjs +1 -0
- package/dist/runtime/register/component/lifecycle.mjs +1 -0
- package/dist/runtime/register/component/methods.mjs +1 -0
- package/dist/runtime/register/component/options.mjs +1 -0
- package/dist/runtime/register/component/props.mjs +1 -0
- package/dist/runtime/register/component/registerDefinition.mjs +1 -0
- package/dist/runtime/register/component.d.mts +15 -0
- package/dist/runtime/register/component.mjs +1 -0
- package/dist/runtime/register/inline.d.mts +15 -0
- package/dist/runtime/register/inline.mjs +1 -0
- package/dist/runtime/register/runtimeInstance/methodBridge.mjs +1 -0
- package/dist/runtime/register/runtimeInstance/provideContext.mjs +1 -0
- package/dist/runtime/register/runtimeInstance/setupContext.mjs +1 -0
- package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -0
- package/dist/runtime/register/runtimeInstance/utils.mjs +1 -0
- package/dist/runtime/register/runtimeInstance.d.mts +26 -0
- package/dist/runtime/register/runtimeInstance.mjs +1 -0
- package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -0
- package/dist/runtime/register/setup.d.mts +11 -0
- package/dist/runtime/register/setup.mjs +1 -0
- package/dist/runtime/register/snapshot.mjs +1 -0
- package/dist/runtime/register/watch.d.mts +12 -0
- package/dist/runtime/register/watch.mjs +1 -0
- package/dist/runtime/register.d.mts +5 -0
- package/dist/runtime/scopedSlots.mjs +1 -0
- package/dist/runtime/selectorQuery.d.mts +54 -0
- package/dist/runtime/selectorQuery.mjs +1 -0
- package/dist/runtime/setupTracking.mjs +1 -0
- package/dist/{template-DE8e5dj_.d.mts → runtime/template.d.mts} +1 -1
- package/dist/runtime/template.mjs +1 -0
- package/dist/runtime/templateRefTypes.d.mts +7 -0
- package/dist/runtime/templateRefs/helpers.mjs +1 -0
- package/dist/runtime/templateRefs.d.mts +11 -0
- package/dist/runtime/templateRefs.mjs +1 -0
- package/dist/runtime/types/core.d.mts +35 -0
- package/dist/runtime/types/miniprogram.d.mts +80 -0
- package/dist/runtime/types/miniprogramHost.d.mts +44 -0
- package/dist/runtime/types/miniprogramHostSources.d.mts +112 -0
- package/dist/runtime/types/options.d.mts +136 -0
- package/dist/runtime/types/props/propTypes.d.mts +79 -0
- package/dist/runtime/types/props/router.d.mts +51 -0
- package/dist/runtime/types/props/setup.d.mts +96 -0
- package/dist/runtime/types/props.d.mts +4 -0
- package/dist/runtime/types/runtime.d.mts +59 -0
- package/dist/runtime/types/setData.d.mts +220 -0
- package/dist/runtime/types.d.mts +28 -0
- package/dist/runtime/uniAppHost.d.mts +8 -0
- package/dist/runtime/uniAppHost.mjs +1 -0
- package/dist/runtime/updatePerformance.d.mts +13 -0
- package/dist/runtime/updatePerformance.mjs +1 -0
- package/dist/runtime/use.d.mts +13 -0
- package/dist/runtime/use.mjs +1 -0
- package/dist/runtime/vueCompat/context.d.mts +8 -0
- package/dist/runtime/vueCompat/context.mjs +1 -0
- package/dist/runtime/vueCompat/model.d.mts +30 -0
- package/dist/runtime/vueCompat/model.mjs +1 -0
- package/dist/runtime/vueCompat/router.d.mts +28 -0
- package/dist/runtime/vueCompat/router.mjs +1 -0
- package/dist/runtime/vueCompat/templateRef.d.mts +9 -0
- package/dist/runtime/vueCompat/templateRef.mjs +1 -0
- package/dist/runtime/vueCompat.d.mts +5 -0
- package/dist/scheduler.d.mts +4 -0
- package/dist/scheduler.mjs +1 -0
- package/dist/store/actions.mjs +1 -0
- package/dist/store/base.mjs +1 -0
- package/dist/store/define/optionsStyle.mjs +1 -0
- package/dist/store/define/setupStyle.mjs +1 -0
- package/dist/store/define/shared.mjs +1 -0
- package/dist/store/define.d.mts +26 -0
- package/dist/store/define.mjs +1 -0
- package/dist/store/manager.d.mts +8 -0
- package/dist/store/manager.mjs +1 -0
- package/dist/store/storeToRefs.d.mts +13 -0
- package/dist/store/storeToRefs.mjs +1 -0
- package/dist/store/types.d.mts +70 -0
- package/dist/store/utils.mjs +1 -0
- package/dist/store.d.mts +4 -1
- package/dist/store.mjs +1 -1
- package/dist/utils.mjs +1 -0
- package/dist/version.d.mts +4 -0
- package/dist/version.mjs +1 -0
- package/dist/vue-augment.d.mts +6 -0
- package/dist/vue-demi.d.mts +68 -10
- package/dist/vue-demi.mjs +1 -1
- package/dist/vue-types.d.mts +18 -0
- package/dist/weappIntrinsicElements/base.d.mts +22 -0
- package/dist/weappIntrinsicElements/elements/ad-custom.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/ad.d.mts +16 -0
- package/dist/weappIntrinsicElements/elements/audio.d.mts +20 -0
- package/dist/weappIntrinsicElements/elements/block.d.mts +8 -0
- package/dist/weappIntrinsicElements/elements/button.d.mts +40 -0
- package/dist/weappIntrinsicElements/elements/camera.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/canvas.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/checkbox-group.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/checkbox.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/cover-image.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/cover-view.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/editor.d.mts +22 -0
- package/dist/weappIntrinsicElements/elements/form.d.mts +16 -0
- package/dist/weappIntrinsicElements/elements/functional-page-navigator.d.mts +15 -0
- package/dist/weappIntrinsicElements/elements/icon.d.mts +12 -0
- package/dist/weappIntrinsicElements/elements/image.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/import.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/include.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/input.d.mts +47 -0
- package/dist/weappIntrinsicElements/elements/keyboard-accessory.d.mts +8 -0
- package/dist/weappIntrinsicElements/elements/label.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/live-player.d.mts +35 -0
- package/dist/weappIntrinsicElements/elements/live-pusher.d.mts +57 -0
- package/dist/weappIntrinsicElements/elements/map.d.mts +105 -0
- package/dist/weappIntrinsicElements/elements/match-media.d.mts +16 -0
- package/dist/weappIntrinsicElements/elements/movable-area.d.mts +26 -0
- package/dist/weappIntrinsicElements/elements/movable-view.d.mts +26 -0
- package/dist/weappIntrinsicElements/elements/navigation-bar.d.mts +15 -0
- package/dist/weappIntrinsicElements/elements/navigator.d.mts +25 -0
- package/dist/weappIntrinsicElements/elements/official-account.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/open-data.d.mts +15 -0
- package/dist/weappIntrinsicElements/elements/page-container.d.mts +25 -0
- package/dist/weappIntrinsicElements/elements/page-meta.d.mts +23 -0
- package/dist/weappIntrinsicElements/elements/picker-view-column.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/picker-view.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/picker.d.mts +23 -0
- package/dist/weappIntrinsicElements/elements/progress.d.mts +21 -0
- package/dist/weappIntrinsicElements/elements/radio-group.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/radio.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/rich-text.d.mts +17 -0
- package/dist/weappIntrinsicElements/elements/scroll-view.d.mts +68 -0
- package/dist/weappIntrinsicElements/elements/share-element.d.mts +18 -0
- package/dist/weappIntrinsicElements/elements/slider.d.mts +23 -0
- package/dist/weappIntrinsicElements/elements/slot.d.mts +10 -0
- package/dist/weappIntrinsicElements/elements/swiper-item.d.mts +42 -0
- package/dist/weappIntrinsicElements/elements/swiper.d.mts +42 -0
- package/dist/weappIntrinsicElements/elements/switch.d.mts +14 -0
- package/dist/weappIntrinsicElements/elements/template.d.mts +12 -0
- package/dist/weappIntrinsicElements/elements/text.d.mts +15 -0
- package/dist/weappIntrinsicElements/elements/textarea.d.mts +40 -0
- package/dist/weappIntrinsicElements/elements/video.d.mts +71 -0
- package/dist/weappIntrinsicElements/elements/view.d.mts +13 -0
- package/dist/weappIntrinsicElements/elements/voip-room.d.mts +14 -0
- package/dist/weappIntrinsicElements/elements/web-view.d.mts +13 -0
- package/dist/weappIntrinsicElements.d.mts +153 -0
- package/package.json +6 -6
- package/dist/base-BxKbbKVO.mjs +0 -1
- package/dist/computed-Xoi9XEUx.mjs +0 -1
- package/dist/dev/base-CYkvI7w8.mjs.map +0 -1
- package/dist/dev/computed-BxRsUJgi.mjs.map +0 -1
- package/dist/dev/ref-DRZC3Kc5.mjs +0 -695
- package/dist/dev/ref-DRZC3Kc5.mjs.map +0 -1
- package/dist/dev/rolldown-runtime-BUUfjzRC.mjs +0 -36
- package/dist/dev/router-D0JQfgyN.mjs +0 -754
- package/dist/dev/router-D0JQfgyN.mjs.map +0 -1
- package/dist/dev/router.mjs.map +0 -1
- package/dist/dev/store-HNsiQJ4d.mjs +0 -479
- package/dist/dev/store-HNsiQJ4d.mjs.map +0 -1
- package/dist/dev/template-n_iVr0ey.mjs.map +0 -1
- package/dist/dev/templateRef-BLnYcEH0.mjs +0 -6439
- package/dist/dev/templateRef-BLnYcEH0.mjs.map +0 -1
- package/dist/dev/toRefs-D06VmFK2.mjs.map +0 -1
- package/dist/dev/watch-jrgL5ald.mjs +0 -445
- package/dist/dev/watch-jrgL5ald.mjs.map +0 -1
- package/dist/index-BiHILcmb.d.mts +0 -1215
- package/dist/index-CCET_bCY.d.mts +0 -111
- package/dist/ref-D37CknuD.mjs +0 -1
- package/dist/rolldown-runtime-CenpyGzJ.mjs +0 -1
- package/dist/router-D4W4lEXM.mjs +0 -1
- package/dist/store-eHrHBQiv.mjs +0 -1
- package/dist/template-CNzlwH-E.mjs +0 -1
- package/dist/templateRef-DOTHWzZ5.mjs +0 -1
- package/dist/toRefs-CoytPyo0.mjs +0 -1
- package/dist/traverse-B4Ez44Gd.d.mts +0 -108
- package/dist/vue-types-B3N60cGV.d.mts +0 -757
- package/dist/watch-Bbd-gmEg.mjs +0 -1
- package/dist/weappIntrinsicElements-BgDtC53_.d.mts +0 -1257
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { InternalRuntimeState } from "../types/runtime.mjs";
|
|
2
|
+
import "../types.mjs";
|
|
3
|
+
//#region src/runtime/hooks/vue.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Vue 3 对齐:组件/页面已挂载,映射小程序 onReady
|
|
6
|
+
*/
|
|
7
|
+
declare function onMounted(handler: () => void): void;
|
|
8
|
+
/**
|
|
9
|
+
* Vue 3 对齐:组件/页面更新后触发。
|
|
10
|
+
* 小程序没有专用 update 生命周期,这里在每次 setData 完成后调用。
|
|
11
|
+
*/
|
|
12
|
+
declare function onUpdated(handler: () => void): void;
|
|
13
|
+
/**
|
|
14
|
+
* Vue 3 对齐:卸载前触发。
|
|
15
|
+
* 小程序无 before-unload 生命周期,setup 时同步执行以保持语义。
|
|
16
|
+
*/
|
|
17
|
+
declare function onBeforeUnmount(handler: () => void): void;
|
|
18
|
+
/**
|
|
19
|
+
* Vue 3 对齐:组件/页面卸载;映射到页面 onUnload 或组件 detached
|
|
20
|
+
*/
|
|
21
|
+
declare function onUnmounted(handler: () => void): void;
|
|
22
|
+
/**
|
|
23
|
+
* Vue 3 对齐:挂载前;setup 时同步触发以模拟 beforeMount 语义
|
|
24
|
+
*/
|
|
25
|
+
declare function onBeforeMount(handler: () => void): void;
|
|
26
|
+
/**
|
|
27
|
+
* Vue 3 对齐:更新前;在每次 setData 前触发
|
|
28
|
+
*/
|
|
29
|
+
declare function onBeforeUpdate(handler: () => void): void;
|
|
30
|
+
/**
|
|
31
|
+
* Vue 3 对齐:错误捕获;映射到小程序 onError
|
|
32
|
+
*/
|
|
33
|
+
declare function onErrorCaptured(handler: (err: any, instance: any, info: string) => void): void;
|
|
34
|
+
/**
|
|
35
|
+
* Vue 3 对齐:组件激活;映射到小程序 onShow
|
|
36
|
+
*/
|
|
37
|
+
declare function onActivated(handler: () => void): void;
|
|
38
|
+
/**
|
|
39
|
+
* Vue 3 对齐:组件失活;映射到小程序 onHide
|
|
40
|
+
*/
|
|
41
|
+
declare function onDeactivated(handler: () => void): void;
|
|
42
|
+
/**
|
|
43
|
+
* Vue 3 对齐:服务端渲染前置钩子。
|
|
44
|
+
* 小程序无此场景,保留空实现以保持 API 兼容。
|
|
45
|
+
*/
|
|
46
|
+
declare function onServerPrefetch(_handler: () => void): void;
|
|
47
|
+
/**
|
|
48
|
+
* 派发更新阶段钩子(框架内部调度入口)。
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
declare function callUpdateHooks(target: InternalRuntimeState, phase: 'before' | 'after'): void;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { callUpdateHooks, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{assertInSetup as e,callHookList as t,pushHook as n}from"./base.mjs";import{WEVU_ON_BEFORE_UPDATE_HOOK as r,WEVU_ON_UPDATED_HOOK as i}from"@weapp-core/constants";function a(t){n(e(`onMounted`),`onReady`,t)}function o(t){n(e(`onUpdated`),i,t)}function s(t){e(`onBeforeUnmount`),t()}function c(t){n(e(`onUnmounted`),`onUnload`,t)}function l(t){e(`onBeforeMount`),t()}function u(t){n(e(`onBeforeUpdate`),r,t)}function d(t){let r=e(`onErrorCaptured`);n(r,`onError`,e=>t(e,r,``))}function f(t){n(e(`onActivated`),`onShow`,t)}function p(t){n(e(`onDeactivated`),`onHide`,t)}function m(t){e(`onServerPrefetch`)}function h(e,n){t(e,n===`before`?r:i)}export{h as callUpdateHooks,f as onActivated,l as onBeforeMount,s as onBeforeUnmount,u as onBeforeUpdate,p as onDeactivated,d as onErrorCaptured,a as onMounted,m as onServerPrefetch,c as onUnmounted,o as onUpdated};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { callHookList, callHookReturn, getCurrentInstance, getCurrentSetupContext, setCurrentInstance, setCurrentSetupContext } from "./hooks/base.mjs";
|
|
2
|
+
import { onAddToFavorites, onAttached, onDetached, onError, onHide, onLaunch, onLoad, onMemoryWarning, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload } from "./hooks/register.mjs";
|
|
3
|
+
import { callUpdateHooks, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated } from "./hooks/vue.mjs";
|
|
4
|
+
export { callHookList, callHookReturn, callUpdateHooks, getCurrentInstance, getCurrentSetupContext, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, setCurrentInstance, setCurrentSetupContext };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { MiniProgramCSSProperties, MiniProgramDatasetAttributes, MiniProgramIntrinsicElementBaseAttributes, MiniProgramIntrinsicEventHandler, WeappCSSProperties, WeappDatasetAttributes, WeappIntrinsicElementBaseAttributes, WeappIntrinsicEventHandler } from "../weappIntrinsicElements/base.mjs";
|
|
2
|
+
import { MiniProgramHtmlAliasIntrinsicElements, MiniProgramIntrinsicElements, WeappHtmlAliasIntrinsicElements, WeappIntrinsicElements } from "../weappIntrinsicElements.mjs";
|
|
3
|
+
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";
|
|
4
|
+
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";
|
|
5
|
+
import { MiniProgramAdapter, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, MiniProgramComponentInstance, MiniProgramComponentOptions, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, MiniProgramInstance, MiniProgramPageLifetimes } from "./types/miniprogram.mjs";
|
|
6
|
+
import { ComponentPropsOptions, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InferNativePropType, InferNativeProps, InferPropType, InferProps, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, PropConstructor, PropOptions, PropType } from "./types/props/propTypes.mjs";
|
|
7
|
+
import { MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, SetupContextRouter, WevuTypedRouterRouteMap } from "./types/props/router.mjs";
|
|
8
|
+
import { ComponentPublicInstance, ComputedDefinitions, ExtractComputed, ExtractMethods, MethodDefinitions, ModelBinding, ModelBindingOptions, ModelBindingPayload } from "./types/core.mjs";
|
|
9
|
+
import { AppConfig, InternalRuntimeState, InternalRuntimeStateFields, RuntimeApp, RuntimeInstance, WevuPlugin } from "./types/runtime.mjs";
|
|
10
|
+
import { SetupContext, SetupContextNativeInstance, SetupFunction } from "./types/props/setup.mjs";
|
|
11
|
+
import { AllowedComponentProps, ComponentCustomProps, ComponentOptionsMixin, DefineComponent, NativeComponent, ObjectDirective, PublicProps, ShallowUnwrapRef, VNode, VNodeProps } from "../vue-types.mjs";
|
|
12
|
+
import { SetDataDebugInfo, SetDataSnapshotOptions } from "./types/setData.mjs";
|
|
13
|
+
import { CreateAppOptions, DataOption, DefineAppOptions, DefineComponentOptions, PageFeatures } from "./types/options.mjs";
|
|
14
|
+
import { GlobalComponents, GlobalDirectives, MiniProgramTemplateRefValue, TemplateRefValue, TemplateRefs, WevuGlobalComponents, WevuGlobalDirectives } from "./types.mjs";
|
|
15
|
+
import { createApp } from "./app.mjs";
|
|
16
|
+
import { WevuDefaults, resetWevuDefaults, setWevuDefaults } from "./defaults.mjs";
|
|
17
|
+
import { ComponentDefinition, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, SetupContextWithTypeProps, SetupFunctionWithTypeProps, WevuComponentConstructor, WevuDefinedComponent, createWevuComponent, createWevuScopedSlotComponent, defineComponent } from "./define.mjs";
|
|
18
|
+
import { DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, useDisposables } from "./disposables.mjs";
|
|
19
|
+
import { ElementIntersectionObserverCallback, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, useElementIntersectionObserver } from "./elementIntersectionObserver.mjs";
|
|
20
|
+
import { callHookList, callHookReturn, getCurrentInstance, getCurrentSetupContext, setCurrentInstance, setCurrentSetupContext } from "./hooks/base.mjs";
|
|
21
|
+
import { onAddToFavorites, onAttached, onDetached, onError, onHide, onLaunch, onLoad, onMemoryWarning, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload } from "./hooks/register.mjs";
|
|
22
|
+
import { callUpdateHooks, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onServerPrefetch, onUnmounted, onUpdated } from "./hooks/vue.mjs";
|
|
23
|
+
import "./hooks.mjs";
|
|
24
|
+
import { UseIntersectionObserverOptions, UseIntersectionObserverResult, useIntersectionObserver } from "./intersectionObserver.mjs";
|
|
25
|
+
import { LayoutBridgeInstance, LayoutHostBinding, registerPageLayoutBridge, registerRuntimeLayoutHosts, resolveLayoutBridge, resolveLayoutHost, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, useLayoutBridge, useLayoutHosts, waitForLayoutHost } from "./layoutBridge.mjs";
|
|
26
|
+
import { isNoSetData, markNoSetData } from "./noSetData.mjs";
|
|
27
|
+
import { NavigationBarMetrics, PageStackSnapshot, UseNavigationBarMetricsOptions, UsePageStackOptions, getCurrentPageStackSnapshot, getNavigationBarMetrics, useNavigationBarMetrics, usePageStack } from "./pageEnvironment.mjs";
|
|
28
|
+
import { PageLayoutState, WevuPageLayoutMap, resolveRuntimePageLayoutName, setPageLayout, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, usePageLayout } from "./pageLayout.mjs";
|
|
29
|
+
import { UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, usePageScrollThrottle } from "./pageScroll.mjs";
|
|
30
|
+
import { setGlobalProvidedValue } from "./provideStore.mjs";
|
|
31
|
+
import { hasInjectionContext, inject, injectGlobal, provide, provideGlobal } from "./provide.mjs";
|
|
32
|
+
import { PullDownRefreshHandler, UseAsyncPullDownRefreshOptions, useAsyncPullDownRefresh } from "./pullDownRefresh.mjs";
|
|
33
|
+
import { registerApp } from "./register/app.mjs";
|
|
34
|
+
import { registerComponent } from "./register/component.mjs";
|
|
35
|
+
import { mountRuntimeInstance, setRuntimeSetDataVisibility, teardownRuntimeInstance } from "./register/runtimeInstance.mjs";
|
|
36
|
+
import { runSetupFunction } from "./register/setup.mjs";
|
|
37
|
+
import "./register.mjs";
|
|
38
|
+
import { UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, UseBoundingClientRectOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, useBoundingClientRect, useScrollOffset, useSelectorFields, useSelectorQuery } from "./selectorQuery.mjs";
|
|
39
|
+
import { normalizeClass, normalizeStyle, resolvePropValue } from "./template.mjs";
|
|
40
|
+
import { UpdatePerformanceListener, UpdatePerformanceListenerResult, UseUpdatePerformanceListenerStopHandle, useUpdatePerformanceListener } from "./updatePerformance.mjs";
|
|
41
|
+
import { defineAppSetup, use } from "./use.mjs";
|
|
42
|
+
import { useAttrs, useNativeInstance, useSlots } from "./vueCompat/context.mjs";
|
|
43
|
+
import { ModelModifiers, UseModelOptions, mergeModels, useBindModel, useChangeModel, useModel } from "./vueCompat/model.mjs";
|
|
44
|
+
import { useNativePageRouter, useNativeRouter } from "./vueCompat/router.mjs";
|
|
45
|
+
import { TemplateRef, useTemplateRef } from "./vueCompat/templateRef.mjs";
|
|
46
|
+
import "./vueCompat.mjs";
|
|
47
|
+
export { type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type ComponentCustomProps, ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComputedDefinitions, type CreateAppOptions, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, ElementIntersectionObserverCallback, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, LayoutBridgeInstance, LayoutHostBinding, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type MiniProgramCSSProperties, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramDatasetAttributes, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramHtmlAliasIntrinsicElements, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type MiniProgramIntrinsicElementBaseAttributes, type MiniProgramIntrinsicElements, type MiniProgramIntrinsicEventHandler, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type PageFeatures, PageLayoutState, PageStackSnapshot, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type RuntimeApp, type RuntimeInstance, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextNativeInstance, type SetupContextRouter, SetupContextWithTypeProps, type SetupFunction, SetupFunctionWithTypeProps, type ShallowUnwrapRef, type TemplateRef, TemplateRefValue, TemplateRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WeappCSSProperties, type WeappDatasetAttributes, type WeappHtmlAliasIntrinsicElements, type WeappIntrinsicElementBaseAttributes, type WeappIntrinsicElements, type WeappIntrinsicEventHandler, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, WevuComponentConstructor, type WevuDefaults, WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, callHookList, callHookReturn, callUpdateHooks, createApp, createWevuComponent, createWevuScopedSlotComponent, defineAppSetup, defineComponent, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentSetupContext, getNavigationBarMetrics, hasInjectionContext, inject, injectGlobal, isNoSetData, markNoSetData, mergeModels, mountRuntimeInstance, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, provide, provideGlobal, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, waitForLayoutHost };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,n){let r=e[t];if(!r)throw Error(`计算属性 "${t}" 是只读的`);r(n)}function t(e){if(e==null)return e;if(typeof e==`object`){if(`detail`in e&&e.detail&&`value`in e.detail)return e.detail.value;if(`target`in e&&e.target&&`value`in e.target)return e.target.value}return e}export{t as parseModelEventValue,e as setComputedValue};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions } from "./types/miniprogramHost.mjs";
|
|
2
|
+
import "./types.mjs";
|
|
3
|
+
//#region src/runtime/intersectionObserver.d.ts
|
|
4
|
+
type UseIntersectionObserverOptions = HostMiniProgramIntersectionObserverOptions;
|
|
5
|
+
type UseIntersectionObserverResult = HostMiniProgramIntersectionObserver;
|
|
6
|
+
/**
|
|
7
|
+
* 在 setup 中创建 IntersectionObserver,并在卸载时自动断开。
|
|
8
|
+
*
|
|
9
|
+
* - 优先使用 `ctx.instance.createIntersectionObserver(options)`。
|
|
10
|
+
* - 不可用时回退到宿主全局对象的 `createIntersectionObserver(...)`。
|
|
11
|
+
*/
|
|
12
|
+
declare function useIntersectionObserver(options?: UseIntersectionObserverOptions): UseIntersectionObserverResult;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { UseIntersectionObserverOptions, UseIntersectionObserverResult, useIntersectionObserver };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentMiniProgramRuntimeCapabilities as e,getMiniProgramGlobalObject as t,supportsCurrentMiniProgramRuntimeCapability as n}from"./platform.mjs";import{getCurrentInstance as r}from"./hooks/base.mjs";import{onDetached as i,onUnload as a}from"./hooks/register.mjs";function o(e,t){let n=e,r=n.createIntersectionObserver;if(typeof r==`function`)return r.call(n,t)}function s(r,i){if(!n(`globalCreateIntersectionObserver`))return;let a=t(),o=a==null?void 0:a.createIntersectionObserver;if(typeof o==`function`)return e().intersectionObserverScopeByParameter?o.call(a,r,i):o.call(a,i)}function c(e={}){var t;let n=r();if(!n)throw Error(`useIntersectionObserver() 必须在 setup() 的同步阶段调用`);let c=(t=o(n,e))==null?s(n,e):t;if(!c||typeof c.disconnect!=`function`)throw Error(`当前运行环境不支持 IntersectionObserver,请检查基础库版本或平台能力`);let l=!1,u=()=>{if(!l){l=!0;try{c.disconnect()}catch(e){}}};return a(u),i(u),c}export{c as useIntersectionObserver};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//#region src/runtime/layoutBridge.d.ts
|
|
2
|
+
type LayoutBridgeContext = Record<string, any>;
|
|
3
|
+
type LayoutBridgeComponentResolver = (selector: string) => any;
|
|
4
|
+
type LayoutHostMap = Record<string, unknown>;
|
|
5
|
+
type LayoutBridgeInstance<T = LayoutBridgeContext> = T & {
|
|
6
|
+
selectComponent?: LayoutBridgeComponentResolver;
|
|
7
|
+
};
|
|
8
|
+
interface LayoutHostBinding {
|
|
9
|
+
key: string;
|
|
10
|
+
refName?: string;
|
|
11
|
+
selector: string;
|
|
12
|
+
kind?: 'component';
|
|
13
|
+
}
|
|
14
|
+
interface LayoutHostResolveOptions<T = any> {
|
|
15
|
+
context?: T;
|
|
16
|
+
fallbackContext?: T;
|
|
17
|
+
interval?: number;
|
|
18
|
+
retries?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 为当前页面注册 layout bridge,使页面或子组件可消费 layout 内部能力。
|
|
22
|
+
*/
|
|
23
|
+
declare function registerPageLayoutBridge(selectors: string | string[], context?: LayoutBridgeContext): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 移除当前页面的 layout bridge 注册。
|
|
26
|
+
*/
|
|
27
|
+
declare function unregisterPageLayoutBridge(selectors: string | string[], context?: LayoutBridgeContext): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 解析当前页面已注册的 layout bridge,找不到时回退到传入上下文。
|
|
30
|
+
*/
|
|
31
|
+
declare function resolveLayoutBridge<T = any>(selector: string, fallbackContext?: T): LayoutBridgeInstance<T> | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* 解析当前页面 layout 内通过指定 key 暴露的宿主实例。
|
|
34
|
+
*/
|
|
35
|
+
declare function resolveLayoutHost<T = any, C = any>(key: string, options?: LayoutHostResolveOptions<C>): NonNullable<T> | null;
|
|
36
|
+
/**
|
|
37
|
+
* 等待当前页面 layout 宿主实例可用,适合页面初次进入时的异步宿主解析。
|
|
38
|
+
*/
|
|
39
|
+
declare function waitForLayoutHost<T = any, C = any>(key: string, options?: LayoutHostResolveOptions<C>): Promise<T | null>;
|
|
40
|
+
/**
|
|
41
|
+
* 在 layout 生命周期内暴露 bridge,使页面或子组件可访问 layout 内部实例。
|
|
42
|
+
*/
|
|
43
|
+
declare function useLayoutBridge(selectors: string | string[], options?: {
|
|
44
|
+
resolveComponent?: LayoutBridgeComponentResolver;
|
|
45
|
+
}): void;
|
|
46
|
+
/**
|
|
47
|
+
* 使用编译期注入的宿主绑定信息,直接从当前 layout 运行时实例解析子组件宿主并注册 bridge。
|
|
48
|
+
*/
|
|
49
|
+
declare function registerRuntimeLayoutHosts(bindings: LayoutHostBinding[], context?: LayoutBridgeContext): any;
|
|
50
|
+
/**
|
|
51
|
+
* 移除运行时自动注册的 layout 宿主 bridge。
|
|
52
|
+
*/
|
|
53
|
+
declare function unregisterRuntimeLayoutHosts(bindings: LayoutHostBinding[], context?: LayoutBridgeContext): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* 使用 key -> 宿主实例的映射批量暴露 layout 内部宿主,适合 toast/dialog 等共享反馈节点。
|
|
56
|
+
*/
|
|
57
|
+
declare function useLayoutHosts(hosts: LayoutHostMap): void;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { LayoutBridgeInstance, LayoutHostBinding, registerPageLayoutBridge, registerRuntimeLayoutHosts, resolveLayoutBridge, resolveLayoutHost, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, useLayoutBridge, useLayoutHosts, waitForLayoutHost };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isRef as e}from"../reactivity/ref.mjs";import{getCurrentMiniProgramPages as t}from"./platform.mjs";import{getCurrentInstance as n,getCurrentSetupContext as r}from"./hooks/base.mjs";import{onAttached as i,onDetached as a}from"./hooks/register.mjs";import{getTemplateRefMap as o}from"./templateRefs/helpers.mjs";import{WEVU_LAYOUT_BRIDGE_PAGE_KEYS as s,WEVU_NATIVE_INSTANCE_KEY as c,WEVU_PUBLIC_RUNTIME_KEY as l}from"@weapp-core/constants";function u(e){return Array.from(new Set(Array.isArray(e)?e:[e])).filter(e=>typeof e==`string`&&e.length>0)}function d(e){if(!e||typeof e!=`object`)return[];let t=[],n=typeof e.route==`string`?e.route.replace(/^\/+/,``):``;n&&t.push(`route:${n}`);for(let[n,r]of[[`webview`,`__wxWebviewId__`],[`exparser`,`__wxExparserNodeId__`]]){let i=e[r];(typeof i==`number`||typeof i==`string`)&&t.push(`${n}:${String(i)}`)}return Array.from(new Set(t))}function f(){let e=new Map;function t(t,n,r){let i=u(t);if(i.length===0||r.length===0)return null;for(let t of r){var a;let r=(a=e.get(t))==null?new Map:a;for(let e of i)r.set(e,n);e.set(t,r)}return i}function n(t,n,r){let i=u(t);if(i.length===0||r.length===0)return!1;let a=!1;for(let t of r){let r=e.get(t);if(r){for(let e of i)r.get(e)===n&&(r.delete(e),a=!0);r.size===0&&e.delete(t)}}return a}function r(t,n){return n.map(n=>{var r;return(r=e.get(n))==null?void 0:r.get(t)}).find(Boolean)}function i(e,t,n){var i;let a=r(e,t);return a?(i=n(a,e))==null?null:i:null}function a(e,t,n,r={}){var o,s;let c=(o=r.retries)==null?20:o,l=(s=r.interval)==null?16:s,u=i(e,t(),n);return u||c<=0?Promise.resolve(u):new Promise(i=>{setTimeout(()=>{i(a(e,t,n,{...r,retries:c-1}))},l)})}return{register:t,resolveBridge:r,resolveHost:i,unregister:n,waitForHost:a}}const p=f();function m(){let e=t();return e[e.length-1]}function h(e){return d(e)}function g(e){var t,n;if(!e||typeof e!=`object`)return;let r=(t=e[l])==null||(t=t.state)==null?void 0:t[c];if(r&&typeof r==`object`)return r;let i=(n=e.$state)==null?void 0:n[c];return i&&typeof i==`object`?i:e[c]&&typeof e[c]==`object`?e[c]:e}function _(e,t=new Set){if(!e||typeof e!=`object`||t.has(e))return m();if(t.add(e),typeof e.__wevuSetPageLayout==`function`)return e;let n=g(e);if(n&&n!==e){let e=_(n,t);if(e)return e}let r=e.$;if(r&&typeof r==`object`){let e=_(r,t);if(e)return e}let i=n==null?e:n,a=i.selectOwnerComponent;if(typeof a==`function`)try{let e=a.call(i);if(e&&e!==i){let n=_(e,t);if(n)return n}}catch(e){}return m()}function v(t){return typeof t==`function`?t():e(t)?t.value:t}function y(e,t){return e.find(e=>e.key===t)}function b(e,t){let n=e==null?void 0:e.selectComponent;if(typeof n!=`function`)return null;try{var r;return(r=n.call(e,t))==null?null:r}catch(e){return null}}function x(e,t){var n,r,i,a,s,c,u,d;if(!e.refName)return null;let f=o(t),p=(n=(r=(i=(a=t[l])==null||(a=a.state)==null?void 0:a.$refs)==null?(s=t.__wevu)==null||(s=s.state)==null?void 0:s.$refs:i)==null?(c=t.$state)==null?void 0:c.$refs:r)==null?t.$refs:n,m=(u=f==null||(d=f.get(e.refName))==null?void 0:d.value)==null?p==null?void 0:p[e.refName]:u;if(Array.isArray(m)){var h;return(h=m[0])==null?null:h}return m==null?null:m}function S(e,t){let n=g(t),r=n&&typeof n==`object`?Object.create(n):{};return Object.assign(r,{selectComponent(r){let i=y(e,r);if(!i)return null;if(i.kind===`component`||!i.kind){var a,o;return x(i,t)||((a=(o=b(n,i.selector))==null?b(m(),i.selector):o)==null?null:a)}return null}})}function C(e,t){let r=t==null?n():t,i=_(r),a=h(i);return!r||!i||a.length===0||!p.register(e,r,a)?!1:(r[s]=a,!0)}function w(e,t){var r;let i=t==null?n():t,a=_(i),o=(r=i==null?void 0:i[s])==null?h(a):r;if(!i||!Array.isArray(o)||o.length===0)return!1;let c=p.unregister(e,i,o);return delete i[s],c}function T(e,t){var r,i;let a=(r=m())==null?_(t):r,o=p.resolveBridge(e,h(a));return(i=o==null?t:o)==null?n():i}function E(e,t={}){var n,r;let i=(n=t.context)==null?t.fallbackContext:n,a=(r=m())==null?_(i):r;return p.resolveHost(e,h(a),(e,t)=>{var n;return(n=e.selectComponent)==null?void 0:n.call(e,t)})}function D(e,t={}){var n;let r=(n=t.context)==null?t.fallbackContext:n;return p.waitForHost(e,()=>{var e;return h((e=m())==null?_(r):e)},(e,t)=>{var n;return(n=e.selectComponent)==null?void 0:n.call(e,t)},t)}function O(e,t={}){if(!r())throw Error(`useLayoutBridge() 必须在 setup() 的同步阶段调用`);let o=n(),s=u(e),c=t.resolveComponent,l=g(o),d=l&&typeof l==`object`?Object.create(l):{},f=Object.assign(d,{selectComponent(e){var t,n,r;if(!s.includes(e))return null;let i=c==null?void 0:c(e);if(i!==void 0)return i;let a=g(o),l=a==null||(t=a.selectComponent)==null?void 0:t.call(a,e);if(l)return l;let u=m();return(n=u==null||(r=u.selectComponent)==null?void 0:r.call(u,e))==null?null:n}});C(s,f),i(()=>{C(s,f)}),a(()=>{w(s,f)})}function k(e,t){if(!e.length)return null;let r=t==null?n():t;if(!r)return null;let i=S(e,r);return C(e.map(e=>e.key),i),i}function A(e,t){if(!e.length)return!1;let r=t==null?n():t;return r?w(e.map(e=>e.key),r):!1}function j(e){O(Object.keys(e),{resolveComponent(t){return v(e[t])}})}export{C as registerPageLayoutBridge,k as registerRuntimeLayoutHosts,T as resolveLayoutBridge,E as resolveLayoutHost,w as unregisterPageLayoutBridge,A as unregisterRuntimeLayoutHosts,O as useLayoutBridge,j as useLayoutHosts,D as waitForLayoutHost};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=e=>e.startsWith(`layouts/`);function t(t){let n=t.is;return typeof n==`string`&&e(n,t)}export{t as isRuntimeLayoutComponentTarget};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=`__wevu_native_bridge__`;function t(t){try{Object.defineProperty(t,e,{value:!0,configurable:!1,enumerable:!1,writable:!1})}catch(n){t[e]=!0}}function n(t){return typeof t==`function`&&!!t[e]}export{n as isNativeBridgeMethod,t as markNativeBridgeMethod};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=Symbol(`wevu.noSetData`);function t(t){return Object.defineProperty(t,e,{value:!0,configurable:!0,enumerable:!1,writable:!1}),t}function n(t){return typeof t==`object`&&!!t&&t[e]===!0}export{n as isNoSetData,t as markNoSetData};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Ref } from "../reactivity/ref.mjs";
|
|
2
|
+
import { ComputedRef } from "../reactivity/computed.mjs";
|
|
3
|
+
import "../index.mjs";
|
|
4
|
+
//#region src/runtime/pageEnvironment.d.ts
|
|
5
|
+
interface PageStackSnapshot {
|
|
6
|
+
canGoBack: boolean;
|
|
7
|
+
currentRoute: string;
|
|
8
|
+
stackLength: number;
|
|
9
|
+
}
|
|
10
|
+
interface UsePageStackOptions {
|
|
11
|
+
autoRefresh?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface NavigationBarMetrics {
|
|
14
|
+
navigationBarHeight: number;
|
|
15
|
+
navigationHeight: number;
|
|
16
|
+
statusBarHeight: number;
|
|
17
|
+
}
|
|
18
|
+
interface UseNavigationBarMetricsOptions {
|
|
19
|
+
autoRefresh?: boolean;
|
|
20
|
+
defaultNavigationBarHeight?: number;
|
|
21
|
+
defaultStatusBarHeight?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 获取当前小程序页面栈的稳定快照。
|
|
25
|
+
*/
|
|
26
|
+
declare function getCurrentPageStackSnapshot(): PageStackSnapshot;
|
|
27
|
+
/**
|
|
28
|
+
* 在 setup 中跟踪当前小程序页面栈状态。
|
|
29
|
+
*/
|
|
30
|
+
declare function usePageStack(options?: UsePageStackOptions): {
|
|
31
|
+
canGoBack: ComputedRef<boolean>;
|
|
32
|
+
currentRoute: Ref<string, string>;
|
|
33
|
+
refresh: () => void;
|
|
34
|
+
stackLength: Ref<number, number>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* 计算自定义导航栏所需的状态栏和胶囊占位高度。
|
|
38
|
+
*/
|
|
39
|
+
declare function getNavigationBarMetrics(options?: Omit<UseNavigationBarMetricsOptions, 'autoRefresh'>): NavigationBarMetrics;
|
|
40
|
+
/**
|
|
41
|
+
* 在 setup 中跟踪自定义导航栏尺寸。
|
|
42
|
+
*/
|
|
43
|
+
declare function useNavigationBarMetrics(options?: UseNavigationBarMetricsOptions): {
|
|
44
|
+
navigationBarHeight: Ref<number, number>;
|
|
45
|
+
navigationHeight: ComputedRef<number>;
|
|
46
|
+
refresh: () => void;
|
|
47
|
+
statusBarHeight: Ref<number, number>;
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { NavigationBarMetrics, PageStackSnapshot, UseNavigationBarMetricsOptions, UsePageStackOptions, getCurrentPageStackSnapshot, getNavigationBarMetrics, useNavigationBarMetrics, usePageStack };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ref as e}from"../reactivity/ref.mjs";import{computed as t}from"../reactivity/computed.mjs";import{getCurrentMiniProgramPages as n,getMiniProgramGlobalObject as r}from"./platform.mjs";import{getCurrentSetupContext as i}from"./hooks/base.mjs";import{onAttached as a,onShow as o}from"./hooks/register.mjs";function s(e){var t,n;return e?(t=(n=e.split(`?`)[0])==null?void 0:n.replace(/^\/+/,``))==null?``:t:``}function c(){let e=n(),t=e[e.length-1],r=e.length||1;return{canGoBack:r>1,currentRoute:s(t==null?void 0:t.route),stackLength:r}}function l(n={}){var r;if(!i())throw Error(`usePageStack() 必须在 setup() 的同步阶段调用`);let s=c(),l=e(s.currentRoute),u=e(s.stackLength),d=t(()=>u.value>1),f=()=>{let e=c();l.value=e.currentRoute,u.value=e.stackLength};return((r=n.autoRefresh)==null||r)&&(a(f),o(f)),{canGoBack:d,currentRoute:l,refresh:f,stackLength:u}}function u(e={}){var t,n;let i=(t=e.defaultStatusBarHeight)==null?20:t,a=(n=e.defaultNavigationBarHeight)==null?44:n,o=r(),s=typeof(o==null?void 0:o.getSystemInfoSync)==`function`?o.getSystemInfoSync():{},c=Number((s==null?void 0:s.statusBarHeight)||i),l;try{l=typeof(o==null?void 0:o.getMenuButtonBoundingClientRect)==`function`?o.getMenuButtonBoundingClientRect():void 0}catch(e){}let u=Number((l==null?void 0:l.top)||0),d=Number((l==null?void 0:l.height)||0),f=u>c&&d>0?(u-c)*2+d:a;return{navigationBarHeight:f,navigationHeight:c+f,statusBarHeight:c}}function d(n={}){var r;if(!i())throw Error(`useNavigationBarMetrics() 必须在 setup() 的同步阶段调用`);let o=u(n),s=e(o.statusBarHeight),c=e(o.navigationBarHeight),l=t(()=>s.value+c.value),d=()=>{let e=u(n);s.value=e.statusBarHeight,c.value=e.navigationBarHeight};return((r=n.autoRefresh)==null||r)&&a(d),{navigationBarHeight:c,navigationHeight:l,refresh:d,statusBarHeight:s}}export{c as getCurrentPageStackSnapshot,u as getNavigationBarMetrics,d as useNavigationBarMetrics,l as usePageStack};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/runtime/pageLayout.d.ts
|
|
2
|
+
interface WevuPageLayoutMap {}
|
|
3
|
+
type ResolveTypedPageLayoutName = keyof WevuPageLayoutMap extends never ? string : Extract<keyof WevuPageLayoutMap, string>;
|
|
4
|
+
type ResolveTypedPageLayoutProps<Name extends string> = Name extends keyof WevuPageLayoutMap ? WevuPageLayoutMap[Name] : Record<string, any>;
|
|
5
|
+
type PageLayoutNamedState = { [Name in ResolveTypedPageLayoutName]: {
|
|
6
|
+
name: Name;
|
|
7
|
+
props: ResolveTypedPageLayoutProps<Name>;
|
|
8
|
+
}; }[ResolveTypedPageLayoutName];
|
|
9
|
+
type PageLayoutState = PageLayoutNamedState | {
|
|
10
|
+
name: false;
|
|
11
|
+
props: Record<string, any>;
|
|
12
|
+
} | {
|
|
13
|
+
name: undefined;
|
|
14
|
+
props: Record<string, any>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 获取当前页面 layout 状态。
|
|
18
|
+
*/
|
|
19
|
+
declare function usePageLayout(): Readonly<PageLayoutState>;
|
|
20
|
+
declare function syncRuntimePageLayoutState(target: Record<string, any>, layout: string | false, props: Record<string, any>): void;
|
|
21
|
+
declare function syncRuntimePageLayoutStateFromRuntime(target: Record<string, any>): void;
|
|
22
|
+
declare function setPageLayout(layout: false): void;
|
|
23
|
+
declare function setPageLayout<Name extends ResolveTypedPageLayoutName>(layout: Name, props?: ResolveTypedPageLayoutProps<Name>): void;
|
|
24
|
+
declare function resolveRuntimePageLayoutName(layout: string | false): string;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { PageLayoutState, WevuPageLayoutMap, resolveRuntimePageLayoutName, setPageLayout, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, usePageLayout };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{getCurrentMiniProgramPages as n}from"./platform.mjs";import{getCurrentInstance as r,getCurrentSetupContext as i}from"./hooks/base.mjs";import{getCurrentPageInstance as a}from"./register/component/lifecycle/platform.mjs";import{WEVU_PAGE_LAYOUT_NAME_KEY as o,WEVU_PAGE_LAYOUT_NONE as s,WEVU_PAGE_LAYOUT_PROPS_KEY as c,WEVU_PAGE_LAYOUT_SETTER_KEY as l}from"@weapp-core/constants";function u(){let e=a();if(e)return e;let t=n();return t[t.length-1]}function d(e){return e!==s&&e}function f(){var n,a;if(!i())throw Error(`usePageLayout() 必须在 setup() 的同步阶段调用`);let s=r(),l=s==null||(n=s.__wevu)==null?void 0:n.state,u=e({name:d(l==null?void 0:l[o]),props:{...(a=l==null?void 0:l[c])==null?{}:a}});return s&&(s.__wevuPageLayoutState=u),t(u)}function p(e,t,n){let r=e.__wevuPageLayoutState;r&&(r.name=t,r.props={...n})}function m(e){var t,n;let r=e.__wevuPageLayoutState,i=(t=e.__wevu)==null?void 0:t.state;!r||!i||(r.name=d(i[o]),r.props={...(n=i[c])==null?{}:n})}function h(e,t){let n=r(),i=n==null?void 0:n[l];if(typeof i==`function`){i(e,t);return}let a=u(),o=a==null?void 0:a[l];if(typeof o==`function`){o(e,t);return}throw Error(`setPageLayout() 未找到当前页面实例。请在页面 setup()、事件回调或当前页面上下文中调用。`)}function g(e){return e===!1?s:e}export{g as resolveRuntimePageLayoutName,h as setPageLayout,p as syncRuntimePageLayoutState,m as syncRuntimePageLayoutStateFromRuntime,f as usePageLayout};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HostMiniProgramPageScrollOption } from "./types/miniprogramHost.mjs";
|
|
2
|
+
import "./types.mjs";
|
|
3
|
+
//#region src/runtime/pageScroll.d.ts
|
|
4
|
+
interface UsePageScrollThrottleOptions {
|
|
5
|
+
/**
|
|
6
|
+
* 节流间隔(毫秒),默认 80ms。
|
|
7
|
+
*/
|
|
8
|
+
interval?: number;
|
|
9
|
+
/**
|
|
10
|
+
* 是否在窗口起始边缘立即触发,默认 true。
|
|
11
|
+
*/
|
|
12
|
+
leading?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 是否在窗口结束边缘补一次回调,默认 true。
|
|
15
|
+
*/
|
|
16
|
+
trailing?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 持续滚动时的最大等待时间(毫秒)。
|
|
19
|
+
* 当 trailing 为 false 时,可用于兜底触发一次回调。
|
|
20
|
+
*/
|
|
21
|
+
maxWait?: number;
|
|
22
|
+
}
|
|
23
|
+
type UsePageScrollThrottleStopHandle = () => void;
|
|
24
|
+
/**
|
|
25
|
+
* 在 setup 中注册节流后的 onPageScroll 监听,并在卸载时自动清理。
|
|
26
|
+
*/
|
|
27
|
+
declare function usePageScrollThrottle(handler: (opt: HostMiniProgramPageScrollOption) => void, options?: UsePageScrollThrottleOptions): UsePageScrollThrottleStopHandle;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, usePageScrollThrottle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentInstance as e}from"./hooks/base.mjs";import{onDetached as t,onPageScroll as n,onUnload as r}from"./hooks/register.mjs";function i(e){return typeof e!=`number`||!Number.isFinite(e)?80:Math.max(0,e)}function a(e){if(!(typeof e!=`number`||!Number.isFinite(e)))return Math.max(0,e)}function o(o,s={}){var c,l;if(!e())throw Error(`usePageScrollThrottle() 必须在 setup() 的同步阶段调用`);if(typeof o!=`function`)throw TypeError(`usePageScrollThrottle() 需要传入回调函数`);let u=i(s.interval),d=(c=s.leading)==null||c,f=(l=s.trailing)==null||l,p=a(s.maxWait),m,h,g=!1,_=0,v,y=()=>{m&&(clearTimeout(m),m=void 0)},b=()=>{h&&(clearTimeout(h),h=void 0)},x=e=>{y(),b(),v=void 0,_=Date.now(),o(e)},S=()=>{let e=v;v=void 0,m=void 0,!(!e||g)&&x(e)},C=()=>{let e=v;h=void 0,!(!e||g)&&x(e)},w=e=>{if(!f||m)return;let t=Math.max(0,u-(e-(_===0?e:_)));m=setTimeout(S,t)},T=e=>{if(typeof p!=`number`||h)return;let t=p-(e-(_===0?e:_));if(t<=0){C();return}h=setTimeout(C,t)};n(e=>{if(g)return;if(u===0){x(e);return}let t=Date.now();if(v=e,d&&(_===0||t-_>=u)){x(e);return}if(typeof p==`number`&&t-(_===0?t:_)>=p){x(e);return}!f&&typeof p!=`number`||(w(t),T(t))});let E=()=>{g||(g=!0,v=void 0,y(),b())};return r(E),t(E),E}export{o as usePageScrollThrottle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getMiniProgramPlatformByRuntimeGlobalKey as e,getMiniProgramRuntimeCapabilities as t,getMiniProgramRuntimeGlobalKey as n,getMiniProgramRuntimeGlobalKeys as r,getMiniProgramRuntimeHostConfigKey as i,resolveMiniProgramPlatform as a,supportsMiniProgramRuntimeCapability as o}from"@weapp-core/shared/platforms";const s=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`];function c(){if(!(typeof globalThis>`u`))return globalThis}function l(){var t;let n=c(),i=(t=import.meta.env)==null?void 0:t.PLATFORM,o=a(i);if(o)return o;for(let t of r())if(n!=null&&n[t])return e(t)}function u(){return t(l())}function d(e){return o(l(),e)}function f(){if(!d(`globalPageStack`))return[];let e=globalThis.getCurrentPages;if(typeof e!=`function`)return[];try{let t=e();return Array.isArray(t)?t:[]}catch(e){return[]}}function p(){let e=c(),t=i(l()),n=e==null?void 0:e[t];return n&&typeof n==`object`?n:void 0}function m(e){var t;let i=c(),o=e==null?(t=import.meta.env)==null?void 0:t.PLATFORM:e,s=a(o);if(s){let e=n(s);return i==null?void 0:i[e]}for(let e of r()){let t=i==null?void 0:i[e];if(t)return t}}function h(){if(!d(`globalRouterApi`))return;let e=m();if(!e)return;let t=Object.create(null);for(let n of s){let r=e[n];if(typeof r!=`function`)return;t[n]=(...t)=>r.apply(e,t)}return t}function g(){var e;return(e=m())==null?c():e}export{h as getCurrentMiniProgramGlobalRouter,p as getCurrentMiniProgramHostConfig,f as getCurrentMiniProgramPages,u as getCurrentMiniProgramRuntimeCapabilities,m as getMiniProgramGlobalObject,g as getScopedSlotHostGlobalObject,l as resolveCurrentMiniProgramPlatform,d as supportsCurrentMiniProgramRuntimeCapability};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { setGlobalProvidedValue } from "./provideStore.mjs";
|
|
2
|
+
//#region src/runtime/provide.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* 判断当前是否存在可用的注入上下文。
|
|
5
|
+
*
|
|
6
|
+
* wevu 的依赖注入上下文来自同步 `setup()` 阶段的当前实例。
|
|
7
|
+
*/
|
|
8
|
+
declare function hasInjectionContext(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 在组件上下文中向后代注入值(与 Vue 3 行为兼容),若没有当前实例则回落到全局存储。
|
|
11
|
+
*
|
|
12
|
+
* @param key 注入键,可为字符串、Symbol 或对象
|
|
13
|
+
* @param value 提供的值
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* defineComponent({
|
|
18
|
+
* setup() {
|
|
19
|
+
* provide(TOKEN_KEY, { data: 'value' })
|
|
20
|
+
* }
|
|
21
|
+
* })
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function provide<T>(key: any, value: T): void;
|
|
25
|
+
/**
|
|
26
|
+
* 从祖先组件(或全局存储)读取提供的值。
|
|
27
|
+
*
|
|
28
|
+
* @param key 注入键,需与 provide 使用的键保持一致
|
|
29
|
+
* @param defaultValue 未找到提供者时的默认值
|
|
30
|
+
* @returns 匹配到的值或默认值
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* defineComponent({
|
|
35
|
+
* setup() {
|
|
36
|
+
* const data = inject(TOKEN_KEY)
|
|
37
|
+
* const value = inject('key', 'default')
|
|
38
|
+
* }
|
|
39
|
+
* })
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function inject<T>(key: any, defaultValue: T): T;
|
|
43
|
+
declare function inject<T>(key: any): T | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* 全局注入值,适用于历史兼容场景。
|
|
46
|
+
*
|
|
47
|
+
* @deprecated 已弃用,仅用于兼容/过渡。推荐优先使用 `provide()`,
|
|
48
|
+
* 在无实例上下文时 `provide()` 会自动回落到全局存储。
|
|
49
|
+
*/
|
|
50
|
+
declare function provideGlobal<T>(key: any, value: T): void;
|
|
51
|
+
/**
|
|
52
|
+
* 从全局存储读取值,适用于历史兼容场景。
|
|
53
|
+
*
|
|
54
|
+
* @deprecated 已弃用,仅用于兼容/过渡。推荐优先使用 `inject()`,
|
|
55
|
+
* 在无实例上下文时 `inject()` 会自动从全局存储读取。
|
|
56
|
+
*/
|
|
57
|
+
declare function injectGlobal<T>(key: any, defaultValue?: T): T;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { hasInjectionContext, inject, injectGlobal, provide, provideGlobal, setGlobalProvidedValue };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentInstance as e}from"./hooks/base.mjs";import{getGlobalProvidedValue as t,hasGlobalProvidedValue as n,setGlobalProvidedValue as r}from"./provideStore.mjs";import{getInstanceProvides as i,isRuntimeAppInstance as a}from"./provideContext.mjs";function o(){return!!e()}function s(t,n){let o=e();o?(i(o)[t]=n,a(o)&&r(t,n)):r(t,n)}function c(r,a){var o;let s=e();if(s){let e=i(s);if(r in e)return e[r]}if(n(r))return t(r);if(arguments.length>=2)return a;let c=(o=globalThis.console)==null?void 0:o.warn;typeof c==`function`&&c(`wevu.inject:未找到对应 key 的值:${String(r)}`)}function l(e,t){r(e,t)}function u(e,r){if(n(e))return t(e);if(arguments.length>=2)return r;throw Error(`injectGlobal():未找到对应 key 的 provider:${String(e)}`)}export{o as hasInjectionContext,c as inject,u as injectGlobal,s as provide,l as provideGlobal,r as setGlobalProvidedValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{setGlobalProvidedValue as e}from"./provideStore.mjs";import{WEVU_APP_PROVIDES_KEY as t,WEVU_IS_APP_INSTANCE_KEY as n,WEVU_PARENT_INSTANCE_KEY as r,WEVU_PROVIDES_KEY as i,WEVU_RUNTIME_APP_KEY as a}from"@weapp-core/constants";function o(e){return!!(e&&typeof e==`object`&&e[n]===!0)}function s(e){return Object.create(e==null?null:e)}function c(e){if(!e)return s();let n=e[t];if(n&&typeof n==`object`)return n;let r=s();try{Object.defineProperty(e,t,{value:r,configurable:!0,enumerable:!1,writable:!1})}catch(n){e[t]=r}return r}function l(e,t){try{Object.defineProperty(e,i,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(n){e[i]=t}}function u(e){var t,n;let u=e[i];if(u&&typeof u==`object`)return u;let d=e[a],f=(t=(n=e[r])==null?void 0:n[i])==null?c(d):t,p=o(e)?c(d):s(f);return l(e,p),p}function d(e){return c(e)}function f(t,n,r){c(t)[n]=r,e(n,r)}function p(e,t,n){var a;let u=c(t),d=(a=n==null?void 0:n[i])==null?u:a,f=o(e)?u:s(d);if(n)try{Object.defineProperty(e,r,{value:n,configurable:!0,enumerable:!1,writable:!0})}catch(t){e[r]=n}l(e,f)}function m(e,t){let n=Object.getPrototypeOf(e);for(;n;){if(n===t)return!0;n=Object.getPrototypeOf(n)}return!1}function h(e,t){let n=u(e),i=u(t);if(!(n===i||m(n,i)||m(i,n))){Object.setPrototypeOf(i,n);try{Object.defineProperty(t,r,{value:e,configurable:!0,enumerable:!1,writable:!0})}catch(n){t[r]=e}}}export{l as attachInstanceProvides,h as attachRuntimeLayoutProvideContext,p as attachRuntimeProvideContext,d as ensureRuntimeAppProvides,u as getInstanceProvides,o as isRuntimeAppInstance,f as setRuntimeAppProvidedValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=new Map;function t(t,n){e.set(t,n)}function n(t){return e.has(t)}function r(t){return e.get(t)}export{r as getGlobalProvidedValue,n as hasGlobalProvidedValue,t as setGlobalProvidedValue};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/runtime/pullDownRefresh.d.ts
|
|
2
|
+
type PullDownRefreshHandler = () => void | Promise<void>;
|
|
3
|
+
interface UseAsyncPullDownRefreshOptions {
|
|
4
|
+
onError?: (error: unknown) => void | Promise<void>;
|
|
5
|
+
stopPullDownRefresh?: () => unknown | Promise<unknown>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 注册下拉刷新回调,并在回调结束后自动停止宿主下拉刷新状态。
|
|
9
|
+
*/
|
|
10
|
+
declare function useAsyncPullDownRefresh(refresh: PullDownRefreshHandler, options?: UseAsyncPullDownRefreshOptions): void;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PullDownRefreshHandler, UseAsyncPullDownRefreshOptions, useAsyncPullDownRefresh };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{onPullDownRefresh as e}from"./hooks/register.mjs";import{wpi as t}from"@wevu/api";function n(n,r={}){e(async()=>{try{await n()}catch(t){var e;await((e=r.onError)==null?void 0:e.call(r,t))}finally{var i;await((i=r.stopPullDownRefresh)==null?(()=>t.stopPullDownRefresh()):i)()}})}export{n as useAsyncPullDownRefresh};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MiniProgramAppOptions } from "../types/miniprogram.mjs";
|
|
2
|
+
import { ComputedDefinitions, MethodDefinitions } from "../types/core.mjs";
|
|
3
|
+
import { RuntimeApp } from "../types/runtime.mjs";
|
|
4
|
+
import { DefineAppOptions } from "../types/options.mjs";
|
|
5
|
+
import "../types.mjs";
|
|
6
|
+
import { WatchMap } from "./watch.mjs";
|
|
7
|
+
//#region src/runtime/register/app.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* 注册 App 入口(框架内部使用)。
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
declare function registerApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineAppOptions<D, C, M>['setup'], mpOptions: MiniProgramAppOptions): void;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { registerApp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getMiniProgramGlobalObject as e,supportsCurrentMiniProgramRuntimeCapability as t}from"../platform.mjs";import{callHookList as n}from"../hooks/base.mjs";import{runInlineExpression as r}from"./inline.mjs";import{mountRuntimeInstance as i}from"./runtimeInstance.mjs";import{WEVU_HOOKS_KEY as a,WEVU_INLINE_HANDLER as o,WEVU_INLINE_MAP_KEY as s,WEVU_IS_APP_INSTANCE_KEY as c}from"@weapp-core/constants";const l=`__wevuAppGlobalListeners`,u=`__wevuOnMemoryWarningListener`;function d(r){let i=r[a],o=!!(i!=null&&i.onMemoryWarning);if(!t(`appMemoryWarningListener`)){delete r[u];return}let s=e(),c=s==null?void 0:s.onMemoryWarning,l=s==null?void 0:s.offMemoryWarning;if(typeof c!=`function`)return;let d=r[u];if(typeof d==`function`&&typeof l==`function`)try{l(d)}catch(e){}if(!o){delete r[u];return}let f=e=>{n(r,`onMemoryWarning`,[e])};r[u]=f,c(f)}function f(r,i){var o,s;let{hookName:c,onApiName:u,offApiName:d,capabilityName:f,userHandler:p}=i,m=r[a],h=!!(m!=null&&m[c]),g=(s=(o=r)[l])==null?o[l]=Object.create(null):s,_=g[c];if(!t(f)){delete g[c],delete r[c];return}let v=e(),y=v==null?void 0:v[u],b=v==null?void 0:v[d];if(typeof _==`function`&&typeof b==`function`)try{b(_)}catch(e){}if(!h&&typeof p!=`function`){delete g[c];return}let x=(...e)=>{n(r,c,e),typeof p==`function`&&p.apply(r,e)};r[c]=x,g[c]=x,typeof y==`function`&&y(x)}function p(e,t){f(e,{hookName:`onError`,onApiName:`onError`,offApiName:`offError`,capabilityName:`appErrorListener`,userHandler:t.onError}),f(e,{hookName:`onPageNotFound`,onApiName:`onPageNotFound`,offApiName:`offPageNotFound`,capabilityName:`appPageNotFoundListener`,userHandler:t.onPageNotFound}),f(e,{hookName:`onUnhandledRejection`,onApiName:`onUnhandledRejection`,offApiName:`offUnhandledRejection`,capabilityName:`appUnhandledRejectionListener`,userHandler:t.onUnhandledRejection}),f(e,{hookName:`onThemeChange`,onApiName:`onThemeChange`,offApiName:`offThemeChange`,capabilityName:`appThemeChangeListener`,userHandler:t.onThemeChange})}function m(e,t,a,l,u){var f;if(typeof App!=`function`)throw TypeError(`createApp 需要全局 App 构造器可用`);let m=Object.keys(t==null?{}:t),h={...u};h.globalData=(f=h.globalData)==null?{}:f,h[o]||(h[o]=function(e){var t,n;let i=this.__wevu,a=(t=i==null?void 0:i.proxy)==null?this:t,o=i==null||(n=i.methods)==null?void 0:n[s];return r(a,void 0,e,o)});let g=h.onLaunch,_=h.onError,v=h.onPageNotFound,y=h.onUnhandledRejection,b=h.onThemeChange;h.onLaunch=function(...t){this[c]=!0,i(this,e,a,l),d(this),p(this,{onError:_,onPageNotFound:v,onUnhandledRejection:y,onThemeChange:b}),n(this,`onLaunch`,t),typeof g==`function`&&g.apply(this,t)};let x=h.onShow;h.onShow=function(...e){n(this,`onShow`,e),typeof x==`function`&&x.apply(this,e)};let S=h.onHide;h.onHide=function(...e){n(this,`onHide`,e),typeof S==`function`&&S.apply(this,e)},delete h.onError,delete h.onPageNotFound,delete h.onUnhandledRejection,delete h.onThemeChange;for(let e of m){let t=h[e];h[e]=function(...n){var r;let i=this.__wevu,a,o=i==null||(r=i.methods)==null?void 0:r[e];return o&&(a=o.apply(i.proxy,n)),typeof t==`function`?t.apply(this,n):a}}App(h)}export{m as registerApp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let{features:t,userOnSaveExitState:n,userOnPullDownRefresh:r,userOnReachBottom:i,userOnPageScroll:a,userOnRouteDone:o,userOnTabItemTap:s,userOnResize:c,userOnShareAppMessage:l,userOnShareTimeline:u,userOnAddToFavorites:d}=e,f=typeof r==`function`||!!t.enableOnPullDownRefresh,p=typeof i==`function`||!!t.enableOnReachBottom,m=typeof a==`function`||!!t.enableOnPageScroll,h=typeof o==`function`||!!t.enableOnRouteDone,g=!!t.enableOnRouteDoneFallback,_=typeof s==`function`||!!t.enableOnTabItemTap,v=typeof c==`function`||!!t.enableOnResize,y=typeof u==`function`||!!t.enableOnShareTimeline,b=typeof l==`function`||!!t.enableOnShareAppMessage,x=typeof d==`function`||!!t.enableOnAddToFavorites,S=typeof n==`function`||!!t.enableOnSaveExitState,C=()=>{};return{enableOnPullDownRefresh:f,enableOnReachBottom:p,enableOnPageScroll:m,enableOnRouteDone:h,enableOnRouteDoneFallback:g,enableOnTabItemTap:_,enableOnResize:v,enableOnShareAppMessage:b,enableOnShareTimeline:y,enableOnAddToFavorites:x,enableOnSaveExitState:S,effectiveOnSaveExitState:typeof n==`function`?n:(()=>({data:void 0})),effectiveOnPullDownRefresh:typeof r==`function`?r:C,effectiveOnReachBottom:typeof i==`function`?i:C,effectiveOnPageScroll:typeof a==`function`?a:C,effectiveOnRouteDone:typeof o==`function`?o:C,effectiveOnTabItemTap:typeof s==`function`?s:C,effectiveOnResize:typeof c==`function`?c:C,effectiveOnShareAppMessage:typeof l==`function`?l:C,effectiveOnShareTimeline:typeof u==`function`?u:C,effectiveOnAddToFavorites:typeof d==`function`?d:(()=>({}))}}export{e as resolveComponentFeatures};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{callHookList as e,callHookReturn as t}from"../../../hooks/base.mjs";import{runInPageScrollHook as n}from"./platform.mjs";import{WEVU_ROUTE_DONE_CALLED_KEY as r,WEVU_ROUTE_DONE_IN_TICK_KEY as i}from"@weapp-core/constants";function a(a,o){let{enableOnSaveExitState:s,enableOnPullDownRefresh:c,enableOnReachBottom:l,enableOnPageScroll:u,enableOnRouteDone:d,enableOnTabItemTap:f,enableOnResize:p,enableOnShareAppMessage:m,enableOnShareTimeline:h,enableOnAddToFavorites:g,effectiveOnSaveExitState:_,effectiveOnPullDownRefresh:v,effectiveOnReachBottom:y,effectiveOnPageScroll:b,effectiveOnRouteDone:x,effectiveOnTabItemTap:S,effectiveOnResize:C,effectiveOnShareAppMessage:w,effectiveOnShareTimeline:T,effectiveOnAddToFavorites:E,hasHook:D}=o;s&&(a.onSaveExitState=function(...e){let n=t(this,`onSaveExitState`,e);return n===void 0?_.apply(this,e):n}),c&&(a.onPullDownRefresh=function(...t){if(e(this,`onPullDownRefresh`,t),!D(this,`onPullDownRefresh`))return v.apply(this,t)}),l&&(a.onReachBottom=function(...t){if(e(this,`onReachBottom`,t),!D(this,`onReachBottom`))return y.apply(this,t)}),u&&(a.onPageScroll=function(...t){return n(this,()=>{if(e(this,`onPageScroll`,t),!D(this,`onPageScroll`))return b.apply(this,t)})}),d&&(a.onRouteDone=function(...t){if(!this[i]&&(this[i]=!0,Promise.resolve().then(()=>{this[i]=!1}),this[r]=!0,e(this,`onRouteDone`,t),!D(this,`onRouteDone`)))return x.apply(this,t)}),f&&(a.onTabItemTap=function(...t){if(e(this,`onTabItemTap`,t),!D(this,`onTabItemTap`))return S.apply(this,t)}),p&&(a.onResize=function(...t){if(e(this,`onResize`,t),!D(this,`onResize`))return C.apply(this,t)}),m&&(a.onShareAppMessage=function(...e){let n=t(this,`onShareAppMessage`,e);return n===void 0?w.apply(this,e):n}),h&&(a.onShareTimeline=function(...e){let n=t(this,`onShareTimeline`,e);return n===void 0?T.apply(this,e):n}),g&&(a.onAddToFavorites=function(...e){let n=t(this,`onAddToFavorites`,e);return n===void 0?E.apply(this,e):n})}export{a as attachOptionalPageLifecycleHooks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentMiniProgramPages as e,getCurrentMiniProgramRuntimeCapabilities as t,getMiniProgramGlobalObject as n,supportsCurrentMiniProgramRuntimeCapability as r}from"../../../platform.mjs";import{callHookList as i}from"../../../hooks/base.mjs";import{WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as a}from"@weapp-core/constants";let o=!1,s;function c(){return s}function l(e){s=e}function u(e){s===e&&(s=void 0)}function d(e,t){var n;let r=Number((n=e[a])==null?0:n);e[a]=r+1;try{return t()}finally{var i;let t=Number((i=e[a])==null?1:i)-1;t<=0?delete e[a]:e[a]=t}}function f(t){let n=t.options;if(n&&typeof n==`object`)return n;let r=e(),i=r[r.length-1],a=i&&typeof i==`object`?i.options:void 0;return a&&typeof a==`object`?a:{}}function p(){if(o)return;o=!0;let e=n();if(!(!e||typeof e!=`object`)){if(r(`pullDownRefreshApi`)){let t=e.startPullDownRefresh;typeof t==`function`&&(e.startPullDownRefresh=function(...e){let n=t.apply(this,e);return s&&i(s,`onPullDownRefresh`,[]),n})}if(r(`pageScrollApi`)){let t=e.pageScrollTo;typeof t==`function`&&(e.pageScrollTo=function(e,...n){let r=t.apply(this,[e,...n]);if(s){let t=s;d(t,()=>{i(t,`onPageScroll`,[e==null?{}:e])})}return r})}}}function m(e){let{enableOnShareAppMessage:i,enableOnShareTimeline:a}=e;if(!i&&!a||!r(`pageShareMenu`))return;let o=n();if(!o||typeof o.showShareMenu!=`function`)return;let s=t().shareTimelineRequiresShareAppMessage?i||a:i;if(!s&&!a)return;let c=[];s&&c.push(`shareAppMessage`),a&&c.push(`shareTimeline`);let l=[{withShareTicket:!0,menus:c},{menus:c},a?{withShareTicket:!0}:void 0,a?{}:void 0,void 0];for(let e of l)try{e===void 0?o.showShareMenu():o.showShareMenu(e);break}catch(e){}}export{l as bindCurrentPageInstance,p as ensureMiniProgramGlobalPatched,m as ensurePageShareMenus,c as getCurrentPageInstance,u as releaseCurrentPageInstance,f as resolvePageOptions,d as runInPageScrollHook};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{callHookList as e}from"../../hooks/base.mjs";import{bindCurrentPageInstance as t,ensureMiniProgramGlobalPatched as n,ensurePageShareMenus as r,releaseCurrentPageInstance as i,resolvePageOptions as a}from"./lifecycle/platform.mjs";import{scheduleTemplateRefUpdate as o}from"../../templateRefs.mjs";import{enableDeferredSetData as s,mountRuntimeInstance as c,setRuntimeSetDataVisibility as l,teardownRuntimeInstance as u}from"../runtimeInstance.mjs";import{notifyRouteStateSync as d}from"../../../router/routeSync.mjs";import{attachOptionalPageLifecycleHooks as f}from"./lifecycle/optionalHooks.mjs";import{WEVU_ON_LOAD_CALLED_KEY as p,WEVU_READY_CALLED_KEY as m,WEVU_ROUTE_DONE_CALLED_KEY as h}from"@weapp-core/constants";function g(g){let{runtimeApp:_,watch:v,setup:y,userOnLoad:b,userOnUnload:x,userOnShow:S,userOnHide:C,userOnReady:w,isPage:T,enableOnSaveExitState:E,enableOnPullDownRefresh:D,enableOnReachBottom:O,enableOnPageScroll:k,enableOnRouteDone:A,enableOnRouteDoneFallback:j,enableOnTabItemTap:M,enableOnResize:N,enableOnShareAppMessage:P,enableOnShareTimeline:F,enableOnAddToFavorites:I,syncWevuPropsFromValues:L,effectiveOnSaveExitState:R,effectiveOnPullDownRefresh:z,effectiveOnReachBottom:B,effectiveOnPageScroll:V,effectiveOnRouteDone:H,effectiveOnTabItemTap:U,effectiveOnResize:W,effectiveOnShareAppMessage:G,effectiveOnShareTimeline:K,effectiveOnAddToFavorites:q,hasHook:J}=g,Y=e=>{var t,n;(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)},X={onLoad(...t){if(this[p])return;this[p]=!0,c(this,_,v,y);let n=t[0]&&typeof t[0]==`object`?t[0]:a(this);if(L==null||L(this,n),Y(this),s(this),T&&r({enableOnShareAppMessage:P,enableOnShareTimeline:F}),e(this,`onLoad`,t),typeof b==`function`)return b.apply(this,t.length?t:[n])},onUnload(...e){if(T&&i(this),u(this),typeof x==`function`)return x.apply(this,e)},onShow(...i){if(T&&(n(),t(this),this[p]||X.onLoad.call(this,a(this)),L==null||L(this,a(this)),Y(this),r({enableOnShareAppMessage:P,enableOnShareTimeline:F}),this[h]=!1),l(this,!0),T&&d({page:this,source:`page`}),e(this,`onShow`,i),typeof S==`function`)return S.apply(this,i)},onHide(...t){if(T&&i(this),l(this,!1),e(this,`onHide`,t),typeof C==`function`)return C.apply(this,t)},onReady(...t){if(T&&(this[p]||X.onLoad.call(this,a(this)),L==null||L(this,a(this)),Y(this),r({enableOnShareAppMessage:P,enableOnShareTimeline:F})),!this[m]){if(this[m]=!0,T&&A&&j){let e=this;setTimeout(()=>{if(!e[h]){var t;(t=X.onRouteDone)==null||t.call(e)}},0)}o(this,()=>{e(this,`onReady`,t),typeof w==`function`&&w.apply(this,t)});return}if(typeof w==`function`)return w.apply(this,t)}};return f(X,{enableOnSaveExitState:E,enableOnPullDownRefresh:D,enableOnReachBottom:O,enableOnPageScroll:k,enableOnRouteDone:A,enableOnTabItemTap:M,enableOnResize:N,enableOnShareAppMessage:P,enableOnShareTimeline:F,enableOnAddToFavorites:I,effectiveOnSaveExitState:R,effectiveOnPullDownRefresh:z,effectiveOnReachBottom:B,effectiveOnPageScroll:V,effectiveOnRouteDone:H,effectiveOnTabItemTap:U,effectiveOnResize:W,effectiveOnShareAppMessage:G,effectiveOnShareTimeline:K,effectiveOnAddToFavorites:q,hasHook:J}),X}export{g as createPageLifecycleHooks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseModelEventValue as e}from"../../internal.mjs";import{runInlineExpression as t}from"../inline.mjs";import{WEVU_INLINE_HANDLER as n,WEVU_INLINE_MAP_KEY as r,WEVU_MODEL_HANDLER as i,WEVU_NATIVE_INSTANCE_KEY as a,WEVU_OWNER_HANDLER as o,WEVU_RESERVED_METHOD_PREFIX as s,WEVU_RUNTIME_KEY as c}from"@weapp-core/constants";function l(l){let{userMethods:u,runtimeMethods:d}=l,f={...u};f[n]||(f[n]=function(e){var n,i;let a=this.__wevu,o=(n=a==null?void 0:a.proxy)==null?this:n,s=a==null||(i=a.methods)==null?void 0:i[r];return t(o,void 0,e,s)}),f[i]||(f[i]=function(t){var n,r,i;let a=(n=t==null||(r=t.currentTarget)==null||(r=r.dataset)==null?void 0:r.wvModel)==null?t==null||(i=t.target)==null||(i=i.dataset)==null?void 0:i.wvModel:n;if(typeof a!=`string`||!a)return;let o=this.__wevu;if(!o||typeof o.bindModel!=`function`)return;let s=e(t);try{o.bindModel(a).update(s)}catch(e){}}),!f[o]&&typeof(d==null?void 0:d[o])==`function`&&(f[o]=d[o]);let p=Object.keys(d==null?{}:d);function m(e){let t=e.__wevu;if(t)return t;let n=e.$state;if(n&&typeof n==`object`)return n[c]}function h(e,t){if((e==null?void 0:e.proxy)===t)return;let n=e==null?void 0:e.proxy,r=e=>{let r=t[e];if(typeof r!=`function`)return!1;let i=n==null?void 0:n[e];return typeof i==`function`&&r===i};if(r(`triggerEvent`)||r(`createSelectorQuery`)||r(`createIntersectionObserver`)||r(`setData`)||typeof t.triggerEvent!=`function`&&typeof t.createSelectorQuery!=`function`&&typeof t.createIntersectionObserver!=`function`&&typeof t.setData!=`function`)return;let i=e==null?void 0:e.state;if(!(!i||typeof i!=`object`)&&t.$state!==i)try{Object.defineProperty(i,a,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[a]=t}}for(let e of p){if(e===r||e.startsWith(s))continue;let t=f[e];f[e]=function(...n){var r;let i=m(this);h(i,this);let a,o=i==null||(r=i.methods)==null?void 0:r[e];if(o&&(a=o.apply(i.proxy,n)),typeof t==`function`){let e=t.apply(this,n);return e===void 0?a:e}return a}}return{finalMethods:f}}export{l as createComponentMethods};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hasOwn as e}from"../../../utils.mjs";import{WEVU_COMPONENT_NAME_KEY as t,WEVU_PROPS_ALIASES_KEY as n,WEVU_PROPS_DERIVED_KEYS_KEY as r}from"@weapp-core/constants";function i(e,t=new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(i(r,t));return n}let n={};t.set(e,n);for(let[r,a]of Object.entries(e))n[r]=i(a,t);return n}function a(e){let t=e.route;if(typeof t==`string`&&t)return t;let n=e.is;return typeof n==`string`&&n?n:`unknown`}function o(a){var o;let{methods:s={},lifetimes:c={},pageLifetimes:l={},options:u={},...d}=a,f=d.onLoad,p=d.onUnload,m=d.onShow,h=d.onHide,g=d.onReady,_=d.onSaveExitState,v=d.onPullDownRefresh,y=d.onReachBottom,b=d.onPageScroll,x=d.onRouteDone,S=d.onTabItemTap,C=d.onResize,w=d.onShareAppMessage,T=d.onShareTimeline,E=d.onAddToFavorites,D=(o=d.features)==null?{}:o,O=[f,p,m,h,g,_,v,y,b,x,S,C,w,T,E].some(e=>typeof e==`function`),k=e(d,`__wevu_isPage`)?d.__wevu_isPage===!0:Object.keys(D==null?{}:D).length>0||O,A={...d},j=new Set([`data`,`behaviors`,`relations`,`externalClasses`,`options`,`properties`,`observers`,`pureDataPattern`,`virtualHost`,`definitionFilter`,`export`,`__wevuTemplateRefs`,`__wevuLayoutHosts`,n,r,`setupLifecycle`,`features`,`__wevu_isPage`]),M=[];for(let[e,t]of Object.entries(A))j.has(e)||typeof t!=`function`&&(M.push([e,t]),delete A[e]);let N=n=>{let r=a.name;typeof r==`string`&&r&&Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value:r});for(let[t,r]of M)if(!e(n,t))try{n[t]=i(r)}catch(e){}},P=new Set(`data.export.definitionFilter.onLoad.onUnload.onShow.onHide.onReady.onSaveExitState.onPullDownRefresh.onReachBottom.onPageScroll.onRouteDone.onTabItemTap.onResize.onShareAppMessage.onShareTimeline.onAddToFavorites.beforeCreate.created.beforeMount.mounted.beforeUnmount.beforeDestroy.unmounted.destroyed`.split(`.`)),F={};for(let[e,t]of Object.entries(A))typeof t!=`function`||P.has(e)||(F[e]=t,delete A[e]);let I=A.__wevuTemplateRefs;delete A.__wevuTemplateRefs;let L=A.__wevuLayoutHosts;delete A.__wevuLayoutHosts;let R=A[n];delete A[n];let z=A[r];delete A[r];let B=A.observers,V=A.setupLifecycle===`created`?`created`:`attached`;delete A.setupLifecycle;let H=Object.fromEntries([`beforeCreate`,`created`,`beforeMount`,`mounted`,`beforeUnmount`,`beforeDestroy`,`unmounted`,`destroyed`].map(e=>[e,A[e]]));delete A.features;for(let e of Object.keys(H))delete A[e];return delete A.onLoad,delete A.onUnload,delete A.onShow,delete A.onHide,delete A.onReady,{userMethods:s,userLifetimes:c,userPageLifetimes:l,userOptions:u,restOptions:A,topLevelMethods:F,templateRefs:I,layoutHosts:L,propsAliases:R,propsDerivedKeys:z,userObservers:B,setupLifecycle:V,vueLifecycles:H,isPage:k,features:D,userOnLoad:f,userOnUnload:p,userOnShow:m,userOnHide:h,userOnReady:g,userOnSaveExitState:_,userOnPullDownRefresh:v,userOnReachBottom:y,userOnPageScroll:b,userOnRouteDone:x,userOnTabItemTap:S,userOnResize:C,userOnShareAppMessage:w,userOnShareTimeline:T,userOnAddToFavorites:E,applyExtraInstanceFields:N}}export{a as getRuntimeOwnerLabel,o as prepareComponentOptions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hasOwn as e}from"../../../utils.mjs";import{isDeepEqualValue as t}from"../../app/setData/snapshot.mjs";import{refreshOwnerSnapshotFromInstance as n}from"../snapshot.mjs";import{WEVU_ATTRS_KEY as r,WEVU_PENDING_PROP_VALUES_KEY as i,WEVU_PROPS_DERIVED_KEYS_KEY as a,WEVU_PROPS_KEY as o,WEVU_PROP_KEYS_KEY as s,WEVU_SLOT_NAMES_PROP as c,WEVU_SLOT_OWNER_ID_PROP as l,WEVU_SLOT_SCOPE_KEY as u}from"@weapp-core/constants";function d(d){let{restOptions:f,propsAliases:p,propsDerivedKeys:m,userObservers:h}=d,g=f.properties&&typeof f.properties==`object`?Object.keys(f.properties):[],_=new Set(g),v=new Set(m==null?[]:m),y=Object.entries(p==null?{}:p).filter(([e,t])=>e&&t),b=new Set([c,l,u]),x=g.filter(e=>!b.has(e)),S=new WeakMap,C=e=>e.startsWith(`__wv_`),w=e=>{let t=e.__wevu,n=t==null?void 0:t[a];if(n instanceof Set)for(let e of x)n.add(e)},T=(t,n,r)=>e(t,n)&&Object.is(t[n],r)?!1:(t[n]=r,!0),E=(n,r,i)=>b.has(r)&&e(n,r)&&t(n[r],i,20,{keys:1e4})?!1:T(n,r,i),D=(e,t,n)=>{var r;if(!b.has(t))return;let i=!1,a=(r=e.__wevu)==null?void 0:r.state;try{a&&typeof a==`object`&&E(a,t,n);let r=e.data;r&&typeof r==`object`&&(i=E(r,t,n))}catch(e){}if(!(!i||typeof e.setData!=`function`))try{e.setData({[t]:n})}catch(e){}},O=(t,n)=>{var r;if(!y.length)return;let i=t.__wevu,a=i==null?void 0:i.setupState,o=i==null?void 0:i.state;if(!a||typeof a!=`object`)return;w(t);let s=(r=S.get(t))==null?new Set:r;S.set(t,s);for(let[t,r]of y){if(e(a,t)&&!s.has(t))continue;let i=n[r];try{T(a,t,i),s.add(t)}catch(e){}if(o&&typeof o==`object`&&(!e(o,t)||s.has(t)))try{T(o,t,i)}catch(e){}}},k=(t,n)=>{if(!v.size)return;let r=t.__wevu,i=r==null?void 0:r.setupState;if(!i||typeof i!=`object`)return;w(t);let a=new Map(y);for(let t of v){var o;let r=(o=a.get(t))==null?t:o;if(e(n,r))try{T(i,t,n[r])}catch(e){}}},A=e=>{try{Object.defineProperty(e,s,{value:g,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[s]=g}},j=t=>{let i=t[r];if(!i||typeof i!=`object`)return;let a=n=>{var r;let i=(r=t.__wevu)==null?void 0:r.state;return typeof i==`object`&&!!i&&e(i,n)},o=t.properties,s=o&&typeof o==`object`?o:void 0,c=Object.keys(i);for(let t of c)if(!s||!e(s,t)||C(t)||_.has(t)||a(t))try{delete i[t]}catch(e){}if(!s){n(t);return}for(let[e,t]of Object.entries(s))if(!(C(e)||_.has(e)||a(e)))try{i[e]=t}catch(e){}n(t)},M=t=>{let r=t[o],a=t.properties,s=t[i];if(r&&typeof r==`object`&&a&&typeof a==`object`){let i=a,o=Object.keys(r);for(let t of o)if(!_.has(t)||!e(i,t))try{delete r[t]}catch(e){}for(let n of g){let a=s&&e(s,n);if(!a&&!e(i,n))continue;let o=a?s[n]:i[n];try{E(r,n,o)}catch(e){}D(t,n,o)}k(t,r),O(t,r),n(t)}s&&delete t[i],j(t)},N=(t,r)=>{if(!r||typeof r!=`object`)return;let i=t[o];if(!i||typeof i!=`object`)return;let a=!1;for(let n of g)if(e(r,n)){try{a=E(i,n,r[n])||a}catch(e){}D(t,n,r[n])}a&&(k(t,i),O(t,i),n(t),j(t))},P=(e,t,r)=>{var a,s;let c=e[o];if(!c||typeof c!=`object`)return;try{if(!E(c,t,r)){D(e,t,r);return}}catch(e){}D(e,t,r);let l=(s=(a=e)[i])==null?a[i]=Object.create(null):s;l[t]=r,k(e,c),O(e,c),n(e),j(e)},F={};if(g.length)for(let e of g)F[e]=function(t){P(this,e,t)};let I={...h==null?{}:h};for(let[e,t]of Object.entries(F)){let n=I[e];I[e]=typeof n==`function`?function(...e){n.apply(this,e),t.apply(this,e)}:t}let L=I[`**`];return I[`**`]=function(...e){typeof L==`function`&&L.apply(this,e),M(this)},{attachWevuPropKeys:A,directPropsDerivedKeys:x,syncWevuPropsFromInstance:M,syncWevuPropsFromValues:N,finalObservers:I}}export{d as createPropsSync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{callHookList as e}from"../../hooks/base.mjs";import{resolveRuntimePageLayoutName as t,syncRuntimePageLayoutState as n}from"../../pageLayout.mjs";import{getOwnerProxy as r}from"../../scopedSlots.mjs";import{clearTemplateRefs as i,scheduleTemplateRefUpdate as a}from"../../templateRefs.mjs";import{enableDeferredSetData as o,mountRuntimeInstance as s,refreshRuntimeInstance as ee,setRuntimeSetDataVisibility as c,teardownRuntimeInstance as l}from"../runtimeInstance.mjs";import{registerRuntimeLayoutHosts as u,unregisterRuntimeLayoutHosts as d}from"../../layoutBridge.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as f,WEVU_LAYOUT_HOST_BRIDGE_KEY as p,WEVU_PAGE_LAYOUT_NAME_KEY as m,WEVU_PAGE_LAYOUT_PROPS_KEY as h,WEVU_PAGE_LAYOUT_SETTER_KEY as g,WEVU_PUBLIC_RUNTIME_KEY as te,WEVU_READY_CALLED_KEY as _,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as ne,WEVU_RUNTIME_KEY as v,WEVU_RUNTIME_OWNER_ID_KEY as re,WEVU_SLOT_OWNER_ID_KEY as y,WEVU_TEMPLATE_REFS_KEY as b}from"@weapp-core/constants";function x(e){let t=e.selectOwnerComponent;if(typeof t==`function`)try{let n=t.call(e);n&&n!==e&&a(n)}catch(e){}}function S(S){let{runtimeApp:C,watch:w,setup:T,restOptions:E,pageLifecycleHooks:D,finalObservers:O,userLifetimes:k,userPageLifetimes:A,finalMethods:j,finalOptions:M,applyExtraInstanceFields:N,templateRefs:P,layoutHosts:F,attachWevuPropKeys:I,setupLifecycle:L,syncWevuPropsFromInstance:R,directPropsDerivedKeys:z,isPage:B,vueLifecycles:V,getRuntimeOwnerLabel:H}=S,U=e=>{var t;let n=(t=e.__wevu)==null?e[te]:t;if(n)return n;let r=e.$state;if(r&&typeof r==`object`)return r[v]},W=e=>{var t,n,r,i,a;return(t=(n=(r=e[re])==null?e[y]:r)==null?(i=e.data)==null?void 0:i[y]:n)==null?(a=e.properties)==null?void 0:a[y]:t},G=e=>{var t;let n=(t=U(e))==null?void 0:t.proxy;if(n)return n;let i=W(e);if(typeof i==`string`&&i){var a;return(a=r(i))==null?e:a}return e},K=e=>{let t=U(e);return t?{runtime:t,mounted:!1}:(N(e),I(e),s(e,C,w,T,{deferSetData:!0,snapshotOmitKeys:z}),R(e),o(e),{runtime:U(e),mounted:!0})},q=(e,t,n)=>{let r=V[t];if(typeof r==`function`)return r.apply(G(e),n)},J=e=>{U(e)||typeof V.mounted!=`function`||K(e).mounted&&(q(e,`created`,[]),q(e,`beforeMount`,[]))},Y={},X=e=>{if(!Array.isArray(F)||!F.length||e[p])return;let t=u(F,e);t&&(e[p]=t)},Z=e=>{B&&(e[g]=(r,i)=>{var a;let o=(a=e.__wevu)==null?void 0:a.state;if(!o||typeof o!=`object`)return;o[m]=t(r);let s=r===!1||i==null?{}:i;o[h]=s,n(e,r,s)})};if(B)for(let e of[`onPullDownRefresh`,`onReachBottom`,`onShareAppMessage`,`onShareTimeline`,`onAddToFavorites`]){let t=D[e];typeof t==`function`&&typeof j[e]!=`function`&&(Y[e]=function(...e){return t.apply(this,e)})}let Q={...E,...B?D:{},observers:O,lifetimes:{...k,created:function(...e){if(q(this,`beforeCreate`,e),N(this),Array.isArray(P)&&P.length&&Object.defineProperty(this,b,{value:P,configurable:!0,enumerable:!1,writable:!1}),I(this),L===`created`){try{s(this,C,w,T,{deferSetData:!0,snapshotOmitKeys:z})}catch(e){let t=H(this);throw Error(`[wevu] mount runtime failed in created (${t}): ${e instanceof Error?e.message:String(e)}`)}R(this),Z(this)}typeof k.created==`function`&&k.created.apply(this,e)},moved:function(...t){e(this,`onMoved`,t),typeof k.moved==`function`&&k.moved.apply(this,t)},attached:function(...t){if(N(this),Array.isArray(P)&&P.length&&!this[b]&&Object.defineProperty(this,b,{value:P,configurable:!0,enumerable:!1,writable:!1}),I(this),L!==`created`||!this.__wevu)try{s(this,C,w,T,{deferSetData:!0,snapshotOmitKeys:z})}catch(e){let t=H(this);throw Error(`[wevu] mount runtime failed in attached (${t}): ${e instanceof Error?e.message:String(e)}`)}R(this),q(this,`created`,t),q(this,`beforeMount`,t),Z(this),X(this),o(this),e(this,`onAttached`,t),typeof k.attached==`function`&&k.attached.apply(this,t)},ready:function(...t){if(J(this),B&&typeof D.onReady==`function`){let e=!!this[_];D.onReady.call(this,...t),e||q(this,`mounted`,t),typeof k.ready==`function`&&k.ready.apply(this,t);return}if(!this[_]){this[_]=!0,R(this),x(this),a(this,()=>{e(this,`onReady`,t),q(this,`mounted`,t),typeof k.ready==`function`&&k.ready.apply(this,t)});return}typeof k.ready==`function`&&k.ready.apply(this,t)},detached:function(...t){if(q(this,`beforeUnmount`,t),q(this,`beforeDestroy`,t),x(this),e(this,`onDetached`,t),B&&typeof D.onUnload==`function`){D.onUnload.call(this,...t),typeof k.detached==`function`&&k.detached.apply(this,t),q(this,`unmounted`,t),q(this,`destroyed`,t);return}i(this),Array.isArray(F)&&F.length&&this[p]&&(d(F,this[p]),delete this[p]),l(this),q(this,`unmounted`,t),q(this,`destroyed`,t),typeof k.detached==`function`&&k.detached.apply(this,t)},error:function(...t){e(this,`onError`,t),typeof k.error==`function`&&k.error.apply(this,t)}},pageLifetimes:{...A,show:function(...t){if(B&&typeof D.onShow==`function`){D.onShow.call(this,...t),typeof A.show==`function`&&A.show.apply(this,t);return}c(this,!0),e(this,`onShow`,t),typeof A.show==`function`&&A.show.apply(this,t)},hide:function(...t){if(B&&typeof D.onHide==`function`){D.onHide.call(this,...t),typeof A.hide==`function`&&A.hide.apply(this,t);return}c(this,!1),e(this,`onHide`,t),typeof A.hide==`function`&&A.hide.apply(this,t)},resize:function(...t){if(B&&typeof D.onResize==`function`){D.onResize.call(this,...t),typeof A.resize==`function`&&A.resize.apply(this,t);return}e(this,`onResize`,t),typeof A.resize==`function`&&A.resize.apply(this,t)},routeDone:function(...t){if(B&&typeof D.onRouteDone==`function`){D.onRouteDone.call(this,...t),typeof A.routeDone==`function`&&A.routeDone.apply(this,t);return}e(this,`onRouteDone`,t),typeof A.routeDone==`function`&&A.routeDone.apply(this,t)}},methods:{...Y,...j,[ne]:function(){var e;let t=K(this);return t.mounted&&(q(this,`created`,[]),q(this,`beforeMount`,[])),(e=t.runtime)==null?void 0:e.proxy}},options:M},$=globalThis[f];if(typeof($==null?void 0:$.trackWevuComponent)==`function`){let e=$.trackWevuComponent(Q,(e,t)=>{ee(e,C,w,T,{snapshotOmitKeys:z,stateSnapshot:t}),R(e),Z(e),X(e),o(e,{rehydrateSetupState:!0})});$.isApplying()||Component(e)}else Component(Q)}export{S as registerComponentDefinition};
|