wevu 6.18.7 → 6.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPrimitive.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPropertyKey.mjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/typeof.mjs +1 -0
- package/dist/{rolldown-runtime-CenpyGzJ.mjs → _virtual/_rolldown/runtime.mjs} +1 -1
- package/dist/dev/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.mjs +14 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPrimitive.mjs +16 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPropertyKey.mjs +11 -0
- package/dist/dev/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/typeof.mjs +12 -0
- package/dist/dev/{rolldown-runtime-BUUfjzRC.mjs → _virtual/_rolldown/runtime.mjs} +1 -1
- package/dist/dev/index.mjs +49 -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} +6 -48
- 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 +212 -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 +176 -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 +121 -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 +22 -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 +66 -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 +172 -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 +269 -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 +313 -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 +140 -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 +77 -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 +159 -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 +95 -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 +80 -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 +128 -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 +164 -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 +438 -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 +17 -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 +254 -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 +118 -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 +49 -11
- 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 +67 -7
- 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/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/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 @@
|
|
|
1
|
+
import{hasOwn as e}from"../../../utils.mjs";function t(e){let t=Object.keys(e).sort();if(t.length<=1)return e;let n={},r=[];for(let i of t){for(;r.length;){let e=r[r.length-1];if(i.startsWith(e))break;r.pop()}r.length||(n[i]=e[i],r.push(`${i}.`))}return n}function n(e,t,r){if(t<=0)return t+1;if(e===null)return 4;let i=typeof e;if(i===`string`)return 2+e.length;if(i===`number`)return Number.isFinite(e)?String(e).length:4;if(i===`boolean`)return e?4:5;if(i===`undefined`||i===`function`||i===`symbol`||i!==`object`||r.has(e))return 4;if(r.add(e),Array.isArray(e)){let i=2;for(let a=0;a<e.length;a++)if(a&&(i+=1),i+=n(e[a],t-i,r),i>t)return i;return i}let a=2;for(let[i,o]of Object.entries(e))if(a>2&&(a+=1),a+=2+i.length+1,a+=n(o,t-a,r),a>t)return a;return a}function r(e,t){if(t===1/0)return{fallback:!1,estimatedBytes:void 0,bytes:void 0};let r=t,i=Object.keys(e).length,a=n(e,r+1,new WeakSet);if(a>r)return{fallback:!0,estimatedBytes:a,bytes:void 0};if(a>=r*.85&&i>2)try{let t=JSON.stringify(e).length;return{fallback:t>r,estimatedBytes:a,bytes:t}}catch(e){return{fallback:!1,estimatedBytes:a,bytes:void 0}}return{fallback:!1,estimatedBytes:a,bytes:void 0}}function i(t){let{input:r,entryMap:i,getPlainByPath:a,mergeSiblingThreshold:o,mergeSiblingSkipArray:s,mergeSiblingMaxParentBytes:c,mergeSiblingMaxInflationRatio:l}=t;if(!o)return{out:r,merged:0};let u=Object.keys(r);if(u.length<o)return{out:r,merged:0};let d=new Map,f=new Set;for(let e of u){var p;let t=i.get(e);if(!t)continue;if(r[e]===null||t.op===`delete`){let t=e.lastIndexOf(`.`);t>0&&f.add(e.slice(0,t));continue}let n=e.lastIndexOf(`.`);if(n<=0)continue;let a=e.slice(0,n),o=(p=d.get(a))==null?[]:p;o.push(e),d.set(a,o)}let m=[...d.entries()].filter(([e,t])=>t.length>=o&&!f.has(e)).sort((e,t)=>t[0].split(`.`).length-e[0].split(`.`).length);if(!m.length)return{out:r,merged:0};let h={};Object.assign(h,r);let g=0,_=new WeakMap,v=e=>{if(e&&typeof e==`object`){let t=_.get(e);if(t!==void 0)return t;let r=n(e,1/0,new WeakSet);return _.set(e,r),r}return n(e,1/0,new WeakSet)},y=(e,t)=>2+e.length+1+v(t);for(let[t,n]of m){if(e(h,t))continue;let r=n.filter(t=>e(h,t));if(r.length<o)continue;let i=a(t);if(!(s&&Array.isArray(i))&&!(c!==1/0&&y(t,i)>c)){if(l!==1/0){let e=0;for(let t of r)e+=y(t,h[t]);if(y(t,i)>e*l)continue}h[t]=i;for(let e of r)delete h[e];g+=1}}return{out:h,merged:g}}export{r as checkPayloadSize,t as collapsePayload,n as estimateJsonSize,i as mergeSiblingPayload};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{getReactiveVersion as t,isReactive as n}from"../../../reactivity/reactive.mjs";import{isRef as r}from"../../../reactivity/ref.mjs";import{hasOwn as i}from"../../../utils.mjs";import{hasTrackableSetupBinding as a}from"../../setupTracking.mjs";import{diffSnapshots as o,toPlain as s}from"../../diff.mjs";import{collectSnapshot as c}from"./snapshot.mjs";import{runPatchUpdate as l}from"./patchScheduler.mjs";function u(u){let{state:d,setupState:f,snapshotOmitKeys:p,computedRefs:m,dirtyComputedKeys:h,includeComputed:g,setDataStrategy:_,computedCompare:v,computedCompareMaxDepth:ee,computedCompareMaxKeys:te,currentAdapter:y,shouldIncludeKey:ne,maxPatchKeys:re,maxPayloadBytes:ie,mergeSiblingThreshold:ae,mergeSiblingMaxInflationRatio:b,mergeSiblingMaxParentBytes:x,mergeSiblingSkipArray:S,elevateTopKeyThreshold:C,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E=!1,functionPaths:D,debug:O,debugWhen:oe,debugSampleRate:k,loopWarning:A,targetLabel:j,runTracker:se,isMounted:M,initialSnapshot:N,initialState:P}=u,F=new WeakMap,I=new WeakMap,L={},R=Object.create(null),z=Object.create(null),B=Object.create(null),V={value:_===`patch`},H=new Map,U=new Set,W=[],G=-1/0,ce=new Set(P&&typeof P==`object`?Object.keys(P):[]),K=e=>{if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},q=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>q(e,t[n]));if(K(e)&&K(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>i(t,n)&&q(e[n],t[n]))}return!1},J=i=>{let o=r(i)?i.value:i;if(typeof o!=`object`||!o)return o;if(!n(o)&&a(o))return{snapshot:s(o,new WeakMap,{cacheEligibility:I,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D})};let c=n(o)?e(o):o;return{raw:c,version:t(c)}},Y=(e,t)=>Object.is(e,t)?!0:!e||!t||typeof e!=`object`||typeof t!=`object`||!i(e,`raw`)||!i(t,`raw`)?e&&t&&typeof e==`object`&&typeof t==`object`&&i(e,`snapshot`)&&i(t,`snapshot`)?q(e.snapshot,t.snapshot):!1:e.raw===t.raw&&e.version===t.version,X=e=>ne(e)&&!(p!=null&&p.has(e));if(N)for(let[e,t]of Object.entries(N))X(e)&&(L[e]=t);let le=()=>{if(!N)return;let t=n(d)?e(d):d,r=f&&typeof f==`object`?n(f)?e(f):f:void 0;for(let e of Object.keys(N))if(X(e)){if(r&&i(r,e)){z[e]=J(r[e]);continue}if(i(t,e)){if(ce.has(e))continue;t[e]=N[e],z[e]=J(t[e])}}},ue=t=>{let a=[],o=f&&typeof f==`object`?n(f)?e(f):f:void 0;for(let n of new Set([...Object.keys(d),...o?Object.keys(o):[]])){if(!X(n))continue;let s=o&&i(o,n)?o[n]:d[n],c=r(s)?s.value:s;!c||typeof c!=`object`||e(c)===t&&a.push(n)}return a},Z=e=>{if(!O)return;let t=e.reason!==`patch`&&e.reason!==`diff`;if(!(oe===`fallback`&&!t)&&!(k<1&&Math.random()>k))try{O(e)}catch(e){}},de=()=>{if(!A)return;let e=Date.now();W.push(e);let t=e-A.sampleWindowMs;for(;W.length&&W[0]<t;)W.shift();W.length<=A.maxFlushes||A.coolDownMs>0&&e-G<A.coolDownMs||(G=e,Z({mode:_,reason:`loopWarning`,pendingPatchKeys:H.size+U.size,payloadKeys:0,computedDirtyKeys:g?h.size:0,flushCount:W.length,windowMs:A.sampleWindowMs,targetLabel:j,message:`${j?`${j} `:``}疑似运行时更新循环:${W.length} 次 setData flush/${A.sampleWindowMs}ms`}))},Q=()=>c({state:d,setupState:f,computedRefs:m,includeComputed:g,shouldIncludeKey:X,plainCache:F,plainCacheEligibility:I,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E,functionPaths:D});le();let fe=()=>{let t=n(d)?e(d):d,r=f&&typeof f==`object`?n(f)?e(f):f:void 0,a={...L},o=new WeakMap,c=new Set,l=new Set,u=new Set;for(let e of new Set([...Object.keys(t),...r?Object.keys(r):[]])){if(!X(e))continue;c.add(e);let n=r&&i(r,e)?r:t,l=J(n[e]),d=z[e];d&&l&&typeof d==`object`&&typeof l==`object`&&i(d,`raw`)&&i(l,`raw`)&&Array.isArray(d.raw)&&Array.isArray(l.raw)&&d.raw!==l.raw&&u.add(e),(!Y(d,l)||!i(L,e))&&(a[e]=s(n[e],o,{cache:F,cacheEligibility:I,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D,_path:e})),z[e]=l}for(let e of Object.keys(z))c.has(e)||(delete z[e],(!g||!i(m,e))&&delete a[e]);if(!g){for(let e of Object.keys(B))delete B[e];return{snapshot:a,replacedTopLevelKeys:u}}for(let e of Object.keys(m)){if(!X(e))continue;l.add(e);let t=m[e].value,n=J(t);(!Y(B[e],n)||!i(L,e))&&(a[e]=s(t,o,{cache:F,cacheEligibility:I,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D,_path:e})),B[e]=n}for(let e of Object.keys(B))l.has(e)||(delete B[e],(!i(t,e)||!X(e))&&delete a[e]);return{snapshot:a,replacedTopLevelKeys:u}},$=(e=`diff`)=>{var t;let n=_===`diff`?fe():void 0,r=(t=n==null?void 0:n.snapshot)==null?Q():t,i=n?(()=>{let e={};for(let t of n.replacedTopLevelKeys)e[t]=r[t];return{...o(L,r,{skipKeys:n.replacedTopLevelKeys}),...e}})():o(L,r);if(L=r,V.value=!1,H.clear(),_===`patch`&&g){R=Object.create(null);for(let e of Object.keys(m))X(e)&&(R[e]=r[e]);h.clear()}if(Object.keys(i).length){if(typeof y.setData==`function`){let e=y.setData(i);if(e&&typeof e.then==`function`)return e.catch(()=>{})}Z({mode:`diff`,reason:e,pendingPatchKeys:0,payloadKeys:Object.keys(i).length})}};return{job:e=>{if(M())return de(),se(),_===`patch`&&!V.value?H.size>0||U.size>0||g&&h.size>0?l({state:d,computedRefs:m,dirtyComputedKeys:h,includeComputed:g,computedCompare:v,computedCompareMaxDepth:ee,computedCompareMaxKeys:te,currentAdapter:y,shouldIncludeKey:X,maxPatchKeys:re,maxPayloadBytes:ie,mergeSiblingThreshold:ae,mergeSiblingMaxInflationRatio:b,mergeSiblingMaxParentBytes:x,mergeSiblingSkipArray:S,elevateTopKeyThreshold:C,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E,functionPaths:D,plainCache:F,plainCacheEligibility:I,pendingPatches:H,fallbackTopKeys:U,latestSnapshot:L,latestComputedSnapshot:R,needsFullSnapshot:V,emitDebug:Z,runDiffUpdate:$}):$(`diff`):$(V.value?`needsFullSnapshot`:`diff`)},mutationRecorder:(e,t)=>{if(!M())return;if(e.root!==t){let t=ue(e.root);if(t.length)for(let e of t)U.add(e);return}if(!e.path){if(Array.isArray(e.fallbackTopKeys)&&e.fallbackTopKeys.length)for(let t of e.fallbackTopKeys)U.add(t);else V.value=!0;return}let n=e.path.split(`.`,1)[0];X(n)&&H.set(e.path,{kind:e.kind,op:e.op})},snapshot:()=>_===`patch`?Q():{...L},cloneLatestSnapshot:()=>({...L}),getLatestSnapshot:()=>L}}export{u as createSetDataScheduler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{isReactive as t}from"../../../reactivity/reactive.mjs";import{hasOwn as n}from"../../../utils.mjs";import{toPlain as r}from"../../diff.mjs";function i(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function a(e){return e===void 0?null:e}function o(e){if(Array.isArray(e))return e.map(e=>o(e));if(!i(e))return e;let t={};for(let n of Object.keys(e))t[n]=o(e[n]);return t}function s(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}if(!i(e)||!i(t))return!1;let r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let i of r)if(!n(t,i)||!Object.is(e[i],t[i]))return!1;return!0}function c(e,t,r,a){if(Object.is(e,t))return!0;if(r<=0)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!c(e[n],t[n],r-1,a))return!1;return!0}if(!i(e)||!i(t))return!1;let o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(let i of o)if(--a.keys,a.keys<=0||!n(t,i)||!c(e[i],t[i],r-1,a))return!1;return!0}function l(e,t,r,i,a){var s;let c=(s=a==null?void 0:a.cloneValue)==null||s,l=t.split(`.`).filter(Boolean);if(!l.length)return;let u=e;for(let e=0;e<l.length-1;e++){let t=l[e];(!n(u,t)||u[t]==null||typeof u[t]!=`object`)&&(u[t]={}),u=u[t]}let d=l[l.length-1];if(i===`delete`)try{delete u[d]}catch(e){u[d]=null}else u[d]=c?o(r):r}function u(n){let{state:i,setupState:a,computedRefs:o,includeComputed:s,shouldIncludeKey:c,plainCache:l,plainCacheEligibility:u,toPlainMaxDepth:d,toPlainMaxKeys:f,includeFunctions:p=!1,functionPaths:m=[]}=n,h=new WeakMap,g={},_=Number.isFinite(f)?{keys:f}:void 0,v=t(i)?e(i):i,y=a&&typeof a==`object`?t(a)?e(a):a:void 0,b=Object.keys(v),x=y?Object.keys(y):[],S=s?Object.keys(o):[];for(let e of b)c(e)&&(g[e]=r(v[e],h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));for(let e of x)c(e)&&(g[e]=r(y[e],h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));for(let e of S)c(e)&&(g[e]=r(o[e].value,h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));return g}export{l as applySnapshotUpdate,o as cloneSnapshotValue,u as collectSnapshot,c as isDeepEqualValue,i as isPlainObjectLike,s as isShallowEqualValue,a as normalizeSetDataValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){var t,n,r,i,a,o,s;let c=(t=e==null?void 0:e.includeComputed)==null||t,l=(n=e==null?void 0:e.suspendWhenHidden)!=null&&n,u=(r=e==null?void 0:e.strategy)==null?`diff`:r,d=typeof(e==null?void 0:e.maxPatchKeys)==`number`?Math.max(0,e.maxPatchKeys):1/0,f=typeof(e==null?void 0:e.maxPayloadBytes)==`number`?Math.max(0,e.maxPayloadBytes):1/0,p=typeof(e==null?void 0:e.mergeSiblingThreshold)==`number`?Math.max(2,Math.floor(e.mergeSiblingThreshold)):0,m=typeof(e==null?void 0:e.mergeSiblingMaxInflationRatio)==`number`?Math.max(0,e.mergeSiblingMaxInflationRatio):1.25,h=typeof(e==null?void 0:e.mergeSiblingMaxParentBytes)==`number`?Math.max(0,e.mergeSiblingMaxParentBytes):1/0,g=(i=e==null?void 0:e.mergeSiblingSkipArray)==null||i,_=(a=e==null?void 0:e.computedCompare)==null?u===`patch`?`deep`:`reference`:a,v=typeof(e==null?void 0:e.computedCompareMaxDepth)==`number`?Math.max(0,Math.floor(e.computedCompareMaxDepth)):4,y=typeof(e==null?void 0:e.computedCompareMaxKeys)==`number`?Math.max(0,Math.floor(e.computedCompareMaxKeys)):200,b=e==null?void 0:e.prelinkMaxDepth,x=e==null?void 0:e.prelinkMaxKeys,S=e==null?void 0:e.debug,C=(o=e==null?void 0:e.diagnostics)==null?`off`:o,w=e==null?void 0:e.loopWarning,T=w===!1||w&&typeof w==`object`&&w.enabled===!1?!1:{sampleWindowMs:typeof w==`object`&&typeof w.sampleWindowMs==`number`?Math.max(100,Math.floor(w.sampleWindowMs)):1e3,maxFlushes:typeof w==`object`&&typeof w.maxFlushes==`number`?Math.max(1,Math.floor(w.maxFlushes)):50,coolDownMs:typeof w==`object`&&typeof w.coolDownMs==`number`?Math.max(0,Math.floor(w.coolDownMs)):5e3},E=(s=e==null?void 0:e.debugWhen)==null?`fallback`:s,D=typeof(e==null?void 0:e.debugSampleRate)==`number`?Math.min(1,Math.max(0,e.debugSampleRate)):1,O=typeof(e==null?void 0:e.elevateTopKeyThreshold)==`number`?Math.max(0,Math.floor(e.elevateTopKeyThreshold)):1/0,k=typeof(e==null?void 0:e.toPlainMaxDepth)==`number`?Math.max(0,Math.floor(e.toPlainMaxDepth)):1/0,A=typeof(e==null?void 0:e.toPlainMaxKeys)==`number`?Math.max(0,Math.floor(e.toPlainMaxKeys)):1/0,j=!!(e!=null&&e.includeFunctions),M=Array.isArray(e==null?void 0:e.functionPaths)?[...new Set(e.functionPaths.filter(e=>typeof e==`string`&&e.length>0))]:[],N=Array.isArray(e==null?void 0:e.pick)&&e.pick.length>0?new Set(e.pick):void 0,P=Array.isArray(e==null?void 0:e.omit)&&e.omit.length>0?new Set(e.omit):void 0;return{includeComputed:c,suspendWhenHidden:l,setDataStrategy:u,maxPatchKeys:d,maxPayloadBytes:f,mergeSiblingThreshold:p,mergeSiblingMaxInflationRatio:m,mergeSiblingMaxParentBytes:h,mergeSiblingSkipArray:g,computedCompare:_,computedCompareMaxDepth:v,computedCompareMaxKeys:y,prelinkMaxDepth:b,prelinkMaxKeys:x,debug:S,diagnostics:C,loopWarning:T,debugWhen:E,debugSampleRate:D,elevateTopKeyThreshold:O,toPlainMaxDepth:k,toPlainMaxKeys:A,includeFunctions:j,functionPaths:M,pickSet:N,omitSet:P,shouldIncludeKey:e=>!(N&&!N.has(e)||P&&P.has(e))}}export{e as resolveSetDataOptions};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComputedDefinitions, MethodDefinitions } from "./types/core.mjs";
|
|
2
|
+
import { RuntimeApp } from "./types/runtime.mjs";
|
|
3
|
+
import { CreateAppOptions } from "./types/options.mjs";
|
|
4
|
+
import "./types.mjs";
|
|
5
|
+
//#region src/runtime/app.d.ts
|
|
6
|
+
declare function createApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(options: CreateAppOptions<D, C, M>): RuntimeApp<D, C, M>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { createApp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getMiniProgramGlobalObject as e}from"./platform.mjs";import{version as t}from"../version.mjs";import{createRuntimeMount as n}from"./app/mount.mjs";import{setPendingRuntimeAppRegistration as r}from"./app/pending.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as i,applyWevuAppDefaults as a}from"./defaults.mjs";import{ensureRuntimeAppProvides as o,setRuntimeAppProvidedValue as s}from"./provideContext.mjs";import{registerApp as c}from"./register/app.mjs";function l(l){let u=l[i],{[i]:d,data:f,computed:p,methods:m,setData:h,watch:g,setup:_,...v}=u===`component`?l:a(l),y=m==null?{}:m,b=p==null?{}:p,x=new Set,S=new Set,C=!1,w={globalProperties:{}},T={mount:n({data:f,resolvedComputed:b,resolvedMethods:y,appConfig:w,setDataOptions:h}),use(e,...t){if(!e||x.has(e))return T;if(x.add(e),typeof e==`function`)e(T,...t);else if(typeof e.install==`function`)e.install(T,...t);else throw TypeError(`插件必须是函数,或包含 install 方法的对象`);return T},provide(e,t){return s(T,e,t),T},onUnmount(e){if(typeof e!=`function`)throw TypeError(`onUnmount 只接受函数`);return C?(e(),T):(S.add(e),T)},unmount(){if(!C){C=!0;for(let e of S)e();S.clear()}},config:w,version:t};try{o(T),Object.defineProperty(T,"__wevuSetDataOptions",{value:h,configurable:!0,enumerable:!1,writable:!1}),Object.defineProperty(T,"__wevuHasTemplateRuntimeBindings",{value:Object.keys(b).some(e=>e.startsWith(`__wv_bind_`)),configurable:!0,enumerable:!1,writable:!1})}catch(e){T.__wevuSetDataOptions=h,T.__wevuHasTemplateRuntimeBindings=Object.keys(b).some(e=>e.startsWith(`__wv_bind_`))}let E=()=>{let t=e(),n=`__wevuAppRegistered`;t&&t[n]||(t&&(t[n]=!0),c(T,m==null?{}:m,g,_,v))};return u!==`component`&&typeof App==`function`?E():u!==`component`&&r({app:T,register:E}),T}export{l as createApp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isRef as e}from"../reactivity/ref.mjs";import{capitalize as t,toPathSegments as n}from"../utils.mjs";import{parseModelEventValue as r,setComputedValue as i}from"./internal.mjs";function a(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];(r[n]==null||typeof r[n]!=`object`)&&(r[n]={}),r=r[n]}r[t[t.length-1]]=n}function o(t,n,r,o,s,c){if(!s.length)return;let[l,...u]=s;if(!u.length){if(r[l])i(o,l,c);else{let r=n&&Object.prototype.hasOwnProperty.call(n,l)?n:t,i=r[l];e(i)?i.value=c:r[l]=c}return}if(r[l]){i(o,l,c);return}let d=n&&Object.prototype.hasOwnProperty.call(n,l)?n:t;(d[l]==null||typeof d[l]!=`object`)&&(d[l]={}),a(d[l],u,c)}function s(e,t){return t.reduce((e,t)=>e==null?e:e[t],e)}function c(e){return r(e)}function l(e,r,i,a,l){return(u,d)=>{let f=n(u);if(!f.length)throw Error(`bindModel 需要非空路径`);let p=()=>s(e,f),m=e=>{o(r,l,i,a,f,e)},h={event:`input`,valueProp:`value`,parser:c,formatter:e=>e,...d};return{get value(){return p()},set value(e){m(e)},update(e){m(e)},model(e){let n={...h,...e},r=`on${t(n.event)}`,i=e=>{let t=n.parser(e);m(t)};return{[n.valueProp]:n.formatter(p()),[r]:i}}}}}export{l as createBindModel,c as defaultParser};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CreateAppOptions, DefineComponentOptions } from "./types/options.mjs";
|
|
2
|
+
import "./types.mjs";
|
|
3
|
+
//#region src/runtime/defaults.d.ts
|
|
4
|
+
interface WevuDefaults {
|
|
5
|
+
app?: Partial<CreateAppOptions<any, any, any>>;
|
|
6
|
+
component?: Partial<DefineComponentOptions<any, any, any, any>>;
|
|
7
|
+
}
|
|
8
|
+
declare function setWevuDefaults(next: WevuDefaults): void;
|
|
9
|
+
declare function resetWevuDefaults(): void;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { WevuDefaults, resetWevuDefaults, setWevuDefaults };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=`__wevuDefaultsScope`;let t={};function n(e){if(!(!e||typeof e!=`object`||Array.isArray(e)))return e}function r(e,t){if(!e)return t;if(!t)return e;let r={...e,...t},i=n(e.setData),a=n(t.setData);(i||a)&&(r.setData={...i==null?{}:i,...a==null?{}:a});let o=n(e.options),s=n(t.options);return(o||s)&&(r.options={...o==null?{}:o,...s==null?{}:s}),r}function i(e,t){return r(e,t)}function a(e,t){return{app:r(e.app,t.app),component:r(e.component,t.component)}}function o(e){t=a(t,e)}function s(){t={}}function c(e){return i(t.app,e)}function l(e){return i(t.component,e)}export{e as INTERNAL_DEFAULTS_SCOPE_KEY,c as applyWevuAppDefaults,l as applyWevuComponentDefaults,s as resetWevuDefaults,o as setWevuDefaults};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hasOwn as e}from"../../utils.mjs";import{toPlain as t}from"../diff.mjs";import{resolveSetDataOptions as n}from"../app/setDataOptions.mjs";import{WEVU_SLOT_OWNER_ID_KEY as r}from"@weapp-core/constants";var i=class extends Error{};function a(e){if(typeof e==`function`)return e;let t=e==null?void 0:e.get;return typeof t==`function`?t:void 0}function o(e){return e.startsWith(`__wv_bind_`)||e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`)}function s(e,t){if(!e.startsWith(`__wv_bind_`))return!1;try{return!/\bthis\b/.test(Function.prototype.toString.call(t))}catch(e){return!1}}function c(e){if(e===r)return``;if(e.startsWith(`__wv_bind_`))return null;if(e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`))return``}function l(t,n){let r=Array.isArray(n==null?void 0:n.pick)?n.pick:[];if(!r.length)return;let i=new Set(Array.isArray(n==null?void 0:n.omit)?n.omit:[]),a={};for(let n of r){if(i.has(n)||e(t,n))continue;let r=c(n);r!==void 0&&(a[n]=r)}return Object.keys(a).length?a:void 0}function u(r){let{data:c,computed:l,setData:u}=r,d=l?Object.keys(l):[];if(!d.length)return;let{includeComputed:f,shouldIncludeKey:p,toPlainMaxDepth:m,toPlainMaxKeys:h,includeFunctions:g,functionPaths:_}=n(u);if(!f)return;let v={},y=new Set,b,x=n=>{if(e(c,n)||!p(n))return{ok:!1};if(e(v,n))return{ok:!0,value:v[n]};if(y.has(n))return{ok:!1};let r=a(l[n]);if(!r)return{ok:!1};y.add(n);try{let e=r.call(b);if(e===void 0)return{ok:!1};let i=t(e,new WeakMap,{maxDepth:m,maxKeys:h,includeFunctions:g,functionPaths:_,_path:n});return i===void 0?{ok:!1}:(v[n]=i,{ok:!0,value:i})}catch(e){return{ok:!1}}finally{y.delete(n)}};b=new Proxy(c,{get(t,n,r){if(typeof n==`string`){if(n===`data`||n===`$state`)return c;if(n===`props`||n===`$props`||n===`$attrs`)throw new i;if(e(c,n))return Reflect.get(t,n,r);if(l&&e(l,n)){let e=x(n);if(e.ok)return e.value;throw new i}throw new i}return Reflect.get(t,n,r)},has(t,n){return Reflect.has(t,n)||typeof n==`string`&&!!(l&&e(l,n))}});for(let e of d){let t=a(l[e]);o(e)&&(!t||!s(e,t))||x(e)}return Object.keys(v).length?v:void 0}function d(e,t,n){if(!e||typeof e!=`object`)return e;let r=u({data:e,computed:t,setData:n}),i=l(e,n);return r||i?{...e,...i,...r}:e}export{u as resolveInitialComputedData,d as resolveNativeInitialData};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=[`components`,`computed`,`directives`,`inject`,`methods`,`props`,`provide`],t=new Set(`activated.attached.beforeCreate.beforeDestroy.beforeMount.beforeUnmount.beforeUpdate.created.deactivated.destroyed.detached.errorCaptured.hide.mounted.moved.onAddToFavorites.onHide.onLoad.onPageScroll.onPullDownRefresh.onReachBottom.onReady.onResize.onRouteDone.onSaveExitState.onShareAppMessage.onShareTimeline.onShow.onTabItemTap.onUnload.ready.renderTracked.renderTriggered.serverPrefetch.show.unmounted.updated`.split(`.`));function n(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:void 0}function r(e,t){return typeof e==`function`?typeof t==`function`?function(...n){return e.apply(this,n),t.apply(this,n)}:e:t}function i(e,t){let i=n(e),a=n(t);if(!i)return a;if(!a)return i;let o={...i,...a};for(let e of new Set([...Object.keys(i),...Object.keys(a)]))o[e]=r(i[e],a[e]);return o}function a(e,t){return e===void 0?t:t===void 0?e:function(){var r,i;let a=typeof e==`function`?e.call(this):e,o=typeof t==`function`?t.call(this):t;return{...(r=n(a))==null?{}:r,...(i=n(o))==null?{}:i}}}function o(e,t){if(typeof e==`function`)return e;if(typeof e==`string`){let n=t[e];return typeof n==`function`?n:void 0}let r=n(e);return r?o(r.handler,t):void 0}function s(e,t){if(e===void 0)return t;if(t===void 0)return e;let r=n(e),i=n(t);return{...r==null?{}:r,...i==null?{}:i,handler(...n){var r,i;return(r=o(e,this))==null||r.apply(this,n),(i=o(t,this))==null?void 0:i.apply(this,n)},immediate:!!(r!=null&&r.immediate||i!=null&&i.immediate),deep:!!(r!=null&&r.deep||i!=null&&i.deep)}}function c(e,t){let r=n(e),i=n(t);if(!r)return i;if(!i)return r;let a={...r,...i};for(let e of new Set([...Object.keys(r),...Object.keys(i)]))a[e]=s(r[e],i[e]);return a}function l(e,t){let n=[...Array.isArray(e)?e:[],...Array.isArray(t)?t:[]];return[...new Set(n)]}function u(o,s){let u={...o,...s};for(let t of e){let e=n(o[t]),r=n(s[t]);(e||r)&&(u[t]={...e==null?{}:e,...r==null?{}:r})}u.data=a(o.data,s.data),u.watch=c(o.watch,s.watch),u.lifetimes=i(o.lifetimes,s.lifetimes),u.pageLifetimes=i(o.pageLifetimes,s.pageLifetimes);for(let e of new Set([...Object.keys(o),...Object.keys(s)]))t.has(e)&&(u[e]=r(o[e],s[e]));return(Array.isArray(o.emits)||Array.isArray(s.emits))&&(u.emits=l(o.emits,s.emits)),(Array.isArray(o.expose)||Array.isArray(s.expose))&&(u.expose=l(o.expose,s.expose)),u}function d(e,t,r){let i=n(t);if(!i||r.has(i))return e;r.add(i);let a=e;if(a=d(a,i.extends,r),Array.isArray(i.mixins))for(let e of i.mixins)a=d(a,e,r);let{extends:o,mixins:s,...c}=i;return u(a,c)}function f(e){return d({},e,new WeakSet)}export{f as resolveVueComponentOptions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hasOwn as e}from"../../utils.mjs";import{inject as t,provide as n}from"../provide.mjs";const r=Symbol(`wevu-missing-options-api-injection`);function i(t){if(typeof t==`string`||typeof t==`symbol`)return{from:t};if(!t||typeof t!=`object`)return;let n=t;return{from:n.from,hasDefault:e(n,`default`),defaultValue:n.default}}function a(e,t){return typeof e==`function`?e.call(t):e}function o(e,n){let o={};if(Array.isArray(e)){for(let n of e)(typeof n==`string`||typeof n==`symbol`)&&(o[n]=t(n));return o}if(!e||typeof e!=`object`)return o;for(let[s,c]of Object.entries(e)){let e=i(c);if(!e||e.from==null)continue;let l=t(e.from,r);o[s]=l===r&&e.hasDefault?a(e.defaultValue,n):l===r?void 0:l}return o}function s(e,t){let r=typeof e==`function`?e.call(t):e;if(!(!r||typeof r!=`object`))for(let e of Reflect.ownKeys(r))n(e,Reflect.get(r,e))}export{s as applyOptionsApiProvide,o as resolveOptionsApiInjections};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hasOwn as e}from"../../utils.mjs";import{WEVU_SLOT_NAMES_PROP as t,WEVU_SLOT_OWNER_ID_PROP as n,WEVU_SLOT_SCOPE_KEY as r}from"@weapp-core/constants";const i=`__wevu_allowNullPropInput`,a=`allowNullPropInput`,o=new Map([[String,String],[Number,Number],[Boolean,Boolean],[Object,Object],[Array,Array],[Function,Function],[`String`,String],[`Number`,Number],[`Boolean`,Boolean],[`Object`,Object],[`Array`,Array],[`Function`,Function],[null,null],[`null`,null],[`Null`,null]]);function s(e){return o.get(e)}function c(e){if(e===void 0)return[];let t=Array.isArray(e)?e:[e],n=[];t.forEach(e=>{let t=s(e);t!==void 0&&(n.includes(t)||n.push(t))});let r=n.filter(e=>e!==null);return r.length>0?r:(n.includes(null),[null])}function l(e,t){let n=c(t);if(n.length!==0&&(e.type=n[0],n.length>1)){let t=[];for(let e of n.slice(1))t.includes(e)||t.push(e);t.length>0&&(e.optionalTypes=t)}}function u(e,t){if(t===void 0||e.type===t)return;let n=Array.isArray(e.optionalTypes)?[...e.optionalTypes]:[];n.includes(t)||(n.push(t),e.optionalTypes=n)}function d(e){if(!Array.isArray(e))return[];let t=[];return e.forEach(e=>{let n=s(e);n==null||t.includes(n)||t.push(n)}),t}function f(t,n){if(t===void 0)return;if(t===null)return{type:null};if(Array.isArray(t)||typeof t==`function`){let r={};return l(r,t),n&&r.type!==null&&u(r,null),e(r,`type`)||(r.type=null),r}if(typeof t!=`object`)return t;let r={...t};if(`type`in r){var i;let e=c(r.type);r.type=(i=e[0])==null?null:i;let t=d(r.optionalTypes);for(let n of e.slice(1))n!==null&&!t.includes(n)&&t.push(n);t.length>0?r.optionalTypes=t:delete r.optionalTypes}return e(r,`type`)||(r.type=null),n&&r.type!==null&&u(r,null),r}function p(e,t){let n={};return Object.entries(e).forEach(([e,r])=>{let i=f(r,t);i!==void 0&&(n[e]=i)}),n}function m(t,n){let r={};return t&&Object.entries(t).forEach(([t,i])=>{if(i!==void 0){if(i===null){r[t]={type:null};return}if(Array.isArray(i)||typeof i==`function`){let a={};l(a,i),n&&a.type!==null&&u(a,null),e(a,`type`)||(a.type=null),r[t]=a;return}if(typeof i==`object`){if(t.endsWith(`Modifiers`)&&Object.keys(i).length===0){r[t]={type:Object,value:{}};return}let a={};if(`type`in i&&i.type!==void 0&&l(a,i.type),Array.isArray(i.optionalTypes)){let e=i.optionalTypes.map(e=>s(e)).filter(e=>e!=null);if(e.length>0){let t=Array.isArray(a.optionalTypes)?a.optionalTypes:[];for(let n of e)n!==a.type&&(t.includes(n)||t.push(n));t.length>0&&(a.optionalTypes=t)}}`observer`in i&&(typeof i.observer==`function`||typeof i.observer==`string`)&&(a.observer=i.observer);let o=`default`in i?i.default:i.value;o!==void 0&&(a.value=typeof o==`function`?o():o),n&&a.type!==null&&u(a,null),e(a,`type`)||(a.type=null),r[t]=a}}}),r}function h(o,s,c){var l;let u=!!((l=o[i])==null?o[a]:l),{[i]:d,[a]:f,...h}=o,g=o.properties,_=g&&typeof g==`object`&&Object.keys(g).length>0?g:void 0,v=c==null?_:c,y=!!(s||v),b=i=>{let a={...i==null?{}:i};return y?(e(a,n)||(a[n]={type:String,value:``}),e(a,r)||(a[r]={type:null,value:null}),e(a,t)||(a[t]={type:null,value:null}),a):a};if(v){let{properties:e,...t}=h,n=v?u?p(v,u):v:void 0,r=m(s,u);return{...t,properties:b({...r,...n})}}return{...h,properties:b(m(s,u))}}export{h as normalizeProps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hasOwn as e}from"../../utils.mjs";import{cloneSnapshotValue as t,isDeepEqualValue as n}from"../app/setData/snapshot.mjs";import{resolveDatasetEventValue as r,runInlineExpression as i}from"../register/inline.mjs";import{getOwnerProxy as a,getOwnerSnapshot as o,getOwnerTarget as s,subscribeOwner as c}from"../scopedSlots.mjs";import{clearTemplateRefs as l,scheduleTemplateRefUpdate as u}from"../templateRefs.mjs";import{WEVU_INLINE_HANDLER as d,WEVU_INLINE_MAP_KEY as f,WEVU_OWNER_HANDLER as p,WEVU_PROPS_DERIVED_KEYS_KEY as m,WEVU_PUBLIC_RUNTIME_KEY as h,WEVU_SLOT_FUNCTION_TOKEN as g,WEVU_SLOT_OWNER_ID_KEY as _,WEVU_SLOT_OWNER_ID_PROP as v,WEVU_SLOT_OWNER_KEY as y,WEVU_SLOT_OWNER_PROXY_KEY as b,WEVU_SLOT_PROPS_DATA_KEY as x,WEVU_SLOT_PROPS_KEY as S,WEVU_SLOT_SCOPE_KEY as C,WEVU_TEMPLATE_REFS_KEY as w}from"@weapp-core/constants";const T=[_,v,b,y,x,S,C],E=/&/g,D=/"/g,O=/"/g,k=/'/g,A=/'/g,j=/</g,M=/>/g;function N(e){return e.replace(E,`&`).replace(D,`"`).replace(O,`"`).replace(k,`'`).replace(A,`'`).replace(j,`<`).replace(M,`>`)}function P(e){var t,n,i,a;let o=r((t=(n=e==null||(i=e.currentTarget)==null?void 0:i.dataset)==null?e==null||(a=e.target)==null?void 0:a.dataset:n)==null?{}:t,`wvArgs`,e),s=[];if(Array.isArray(o))s=o;else if(typeof o==`string`)try{s=JSON.parse(o)}catch(e){try{s=JSON.parse(N(o))}catch(e){s=[]}}return Array.isArray(s)||(s=[]),s.map(t=>t===`$event`?e:t)}function F(e){if(!e||typeof e!=`object`)return{};if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n];typeof r==`string`&&r&&(t[r]=e[n+1])}return t}return e}function I(e){return Array.isArray(e)&&e[0]===g&&typeof e[1]==`string`}function L(e,t){return(...n)=>{var r;let i=e==null||(r=e.selectOwnerComponent)==null?void 0:r.call(e),a=i==null?void 0:i[d];if(typeof a!=`function`)return;let o={wd:1,wi:t[1]},s=Array.isArray(t[2])?t[2]:[],c=Array.isArray(t[3])?t[3]:[];s.forEach((e,t)=>o[`wvS${t}`]=e),c.forEach((e,t)=>o[`wvI${t}`]=e);let l={type:`wv-slot-function`,detail:n,currentTarget:{dataset:o},target:{dataset:o}};return a.call(i,l)}}function R(e,t){return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,I(n)?L(e,n):n]))}function z(e){var t,n,r,i;return(t=(n=e==null||(r=e.__wevu)==null?void 0:r.proxy)==null?e==null||(i=e[h])==null?void 0:i.proxy:n)==null?e:t}function B(e,t){if(!t||Object.keys(t).length===0)return;let n=z(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof(i==null?void 0:i.get)==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch(e){}return r}function V(e){var t,n;e==null||(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)}function H(r,i,a){var o;V(r);let s=B(r,i);if(!s||typeof(r==null?void 0:r.setData)!=`function`)return;let c=e(r,`__wvScopedSlotComputedSnapshot`),l=(o=r.__wvScopedSlotComputedSnapshot)==null?{}:o,u={},d={};for(let[r,i]of Object.entries(s))u[r]=t(i),(a!=null&&a.force||!c||!e(l,r)||!n(l[r],i,20,{keys:1e4}))&&(d[r]=i);for(let t of Object.keys(l))e(s,t)||(d[t]=null);r.__wvScopedSlotComputedSnapshot=u,Object.keys(d).length>0&&r.setData(d)}function U(r,i){var a,o,s,c;let l=e(i==null?{}:i,C)?i[C]:r==null||(a=r.properties)==null?void 0:a[C],u=e(i==null?{}:i,S)?i[S]:r==null||(o=r.properties)==null?void 0:o[S],d=F(l),f=F(u),p={...d,...f},m=!e(r,`__wvSlotPropsSnapshot`)||!n((s=r.__wvSlotPropsSnapshot)==null?{}:s,p,20,{keys:1e4}),h=m||!r[x]?R(r,p):r[x];m&&(r.__wvSlotPropsSnapshot=t(p)),r[x]=h;let g=r==null||(c=r.__wevu)==null?void 0:c.state;return g&&typeof g==`object`&&(g[x]=h),{merged:h,snapshot:p,snapshotChanged:m}}function W(e,t,n){let{snapshot:r,snapshotChanged:i}=U(e,n);i&&typeof(e==null?void 0:e.setData)==`function`&&e.setData({[x]:r}),i&&H(e,t)}function G(e,t){var n;if(e[b]===t)return!1;e[b]=t;let r=e==null?void 0:e.data;if(r&&typeof r==`object`)try{Object.defineProperty(r,b,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){r[b]=t}let i=e==null||(n=e.__wevu)==null?void 0:n.state;return i&&typeof i==`object`&&(i[b]=t),!0}function K(r,i,a,o){var s;let c=G(r,a),{snapshotChanged:l}=U(r),u=i||{},d=!e(r,`__wvOwnerSnapshot`)||!n((s=r.__wvOwnerSnapshot)==null?{}:s,u,20,{keys:1e4});if(d){var f;r.__wvOwnerSnapshot=t(u),r[y]=u;let e=r==null||(f=r.__wevu)==null?void 0:f.state;e&&typeof e==`object`&&(e[y]=u)}d&&typeof(r==null?void 0:r.setData)==`function`&&r.setData({[y]:u}),(d||c||l)&&H(r,o)}function q(e,t,n){if(!t){typeof(e==null?void 0:e.__wvOwnerUnsub)==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerUnsub=void 0,e.__wvOwnerBoundId=``,G(e,void 0);return}let r=(t,r)=>{K(e,t,r,n)};e.__wvOwnerBoundId!==t&&(typeof e.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerBoundId=t,e.__wvOwnerUnsub=c(t,r));let i=o(t);i&&r(i,a(t))}function J(e){var t,n,r,i;return(t=(n=e==null||(r=e.properties)==null?void 0:r[v])==null?e==null||(i=e.properties)==null?void 0:i[_]:n)==null?``:t}function Y(e,t){W(e,t);let n=J(e);n&&q(e,n,t)}function X(){let e={[y]:{},[x]:{}};return Object.defineProperty(e,b,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function Z(e){let t=e==null?void 0:e.computed,n=e==null?void 0:e.templateRefs,a=e=>{let t=J(e);return t?s(t):void 0},o={options:{virtualHost:!0},setData:{omit:T},[m]:T,properties:{[v]:{type:String,value:``,observer(e){q(this,e||``,t)}},[_]:{type:String,value:``,observer(e){q(this,e||``,t)}},[S]:{type:null,value:null,observer(e){W(this,t,{[S]:e})}},[C]:{type:null,value:null,observer(e){W(this,t,{[C]:e})}}},data:X,lifetimes:{attached(){Y(this,t)},ready(){Y(this,t),H(this,t,{force:!0});let e=a(this);e&&u(this,void 0,e)},detached(){let e=a(this);e&&l(this,e),typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub(),this.__wvOwnerUnsub=void 0,this.__wvOwnerBoundId=``,G(this,void 0)}},methods:{[p](e){var t,n,a,o,s;let c=this[b],l=i(c,void 0,e,(t=this.__wevu)==null||(t=t.methods)==null?void 0:t[f]);if(l!==void 0)return l;if(!c)return;let u=r((n=(a=e==null||(o=e.currentTarget)==null?void 0:o.dataset)==null?e==null||(s=e.target)==null?void 0:s.dataset:a)==null?{}:n,`wvHandler`,e);if(typeof u!=`string`||!u)return;let d=c==null?void 0:c[u];if(typeof d!=`function`)return;let p=P(e);return d.apply(c,p)}}};return e!=null&&e.computed&&Object.keys(e.computed).length>0&&(o.computed=e.computed),e!=null&&e.inlineMap&&Object.keys(e.inlineMap).length>0&&(o.methods={...o.methods,[f]:e.inlineMap}),n!=null&&n.length&&(o[w]=n),o}export{Z as createScopedSlotOptions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toRaw as e}from"../../reactivity/reactive/shared.mjs";import{isReactive as t}from"../../reactivity/reactive.mjs";import{isRef as n}from"../../reactivity/ref.mjs";import{hasTrackableSetupBinding as r}from"../setupTracking.mjs";function i(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function a(e){return typeof e!=`object`||!e||n(e)||t(e)||Array.isArray(e)?!0:i(e)}function o(n,i,o,s){var c,l,u;let d=!!(s!=null&&s.includeFunctionsInState),f=s==null?void 0:s.functionPropPaths,p=(c=n==null?void 0:n.methods)==null?Object.create(null):c,m=(l=n==null?void 0:n.state)==null?Object.create(null):l,h=(u=n==null?void 0:n.setupState)==null?Object.create(null):u,g=t(m)?e(m):m,_=!1;if(n&&!n.methods)try{n.methods=p}catch(e){}if(n&&!n.state)try{n.state=m}catch(e){}if(n&&!n.setupState)try{n.setupState=h}catch(e){}if(Object.keys(o).forEach(e=>{let t=o[e];if(typeof t==`function`){let r=(...e)=>{var r;return t.apply((r=n==null?void 0:n.proxy)==null?n:r,e)};p[e]=r,m[e]=r,(d||f!=null&&f.has(e))&&(h[e]=r),_=!0}else{if(r(t)){var s;n==null||(s=n.__wevu_trackSetupReactiveKey)==null||s.call(n,e)}if(m[e]=t,t===i||!a(t))try{Object.defineProperty(g,e,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){}h[e]=t}}),n){var v,y;if(n.methods=(v=n.methods)==null?p:v,n.state=(y=n.state)==null?m:y,_){var b;(b=n.__wevu_touchSetupMethodsVersion)==null||b.call(n)}}}export{o as applySetupResult,a as shouldExposeInSnapshot};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { HostMiniProgramComponentPropertyOption } from "./types/miniprogramHost.mjs";
|
|
2
|
+
import { MiniProgramComponentRawOptions } from "./types/miniprogram.mjs";
|
|
3
|
+
import { ComponentPropsOptions, InferProps } from "./types/props/propTypes.mjs";
|
|
4
|
+
import { ComponentPublicInstance, ComputedDefinitions, MethodDefinitions } from "./types/core.mjs";
|
|
5
|
+
import { RuntimeApp } from "./types/runtime.mjs";
|
|
6
|
+
import { DefineComponent, ShallowUnwrapRef } from "../vue-types.mjs";
|
|
7
|
+
import { SetDataSnapshotOptions } from "./types/setData.mjs";
|
|
8
|
+
import { DefineComponentOptions } from "./types/options.mjs";
|
|
9
|
+
import "./types.mjs";
|
|
10
|
+
import { InlineExpressionMap } from "./register/inline.mjs";
|
|
11
|
+
import { TemplateRefBinding } from "./templateRefs.mjs";
|
|
12
|
+
//#region src/runtime/define.d.ts
|
|
13
|
+
/**
|
|
14
|
+
* defineComponent 返回的组件定义描述,用于手动注册或高级用法。
|
|
15
|
+
*/
|
|
16
|
+
interface ComponentDefinition<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
17
|
+
/**
|
|
18
|
+
* 内部 runtime app(高级能力使用),不对外暴露正式 API。
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
__wevu_runtime: RuntimeApp<D, C, M>;
|
|
22
|
+
/**
|
|
23
|
+
* 内部选项快照(高级能力使用),包含 data/computed/methods 等。
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
__wevu_options: {
|
|
27
|
+
data: () => D;
|
|
28
|
+
computed: C;
|
|
29
|
+
methods: M;
|
|
30
|
+
setData: SetDataSnapshotOptions | undefined;
|
|
31
|
+
watch: Record<string, any> | undefined;
|
|
32
|
+
setup: ((props: any, ctx: any) => any) | undefined;
|
|
33
|
+
mpOptions: MiniProgramComponentRawOptions;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
type SetupBindings<S> = Exclude<S, void> extends never ? Record<string, never> : Exclude<S, void>;
|
|
37
|
+
type ResolveProps<P> = P extends ComponentPropsOptions ? InferProps<P> : P;
|
|
38
|
+
interface WevuComponentConstructor<Props, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
39
|
+
new (): ComponentPublicInstance<D, C, M, Props> & ShallowUnwrapRef<RawBindings>;
|
|
40
|
+
}
|
|
41
|
+
type WevuDefinedComponent<PropsOrPropOptions, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> = DefineComponent<PropsOrPropOptions, RawBindings, D, C, M> & ComponentDefinition<D, C, M>;
|
|
42
|
+
interface SetupContextWithTypeProps<TypeProps> {
|
|
43
|
+
props: TypeProps;
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
}
|
|
46
|
+
type SetupFunctionWithTypeProps<TypeProps> = (props: TypeProps, ctx: SetupContextWithTypeProps<TypeProps>) => Record<string, any> | void;
|
|
47
|
+
interface DefineComponentTypePropsOptions<TypeProps> {
|
|
48
|
+
__typeProps: TypeProps;
|
|
49
|
+
setup?: SetupFunctionWithTypeProps<TypeProps>;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}
|
|
52
|
+
interface DefineComponentWithTypeProps<TypeProps> {
|
|
53
|
+
new (): {
|
|
54
|
+
$props: TypeProps;
|
|
55
|
+
} & Record<string, any>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 按 Vue 3 风格定义一个小程序组件/页面。
|
|
59
|
+
*
|
|
60
|
+
* - 统一注册为 `Component()`
|
|
61
|
+
*
|
|
62
|
+
* @param options 组件定义项
|
|
63
|
+
* @returns 可手动注册的组件定义
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* defineComponent({
|
|
68
|
+
* data: () => ({ count: 0 }),
|
|
69
|
+
* setup() {
|
|
70
|
+
* onMounted(() => console.log('已挂载'))
|
|
71
|
+
* }
|
|
72
|
+
* })
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* defineComponent({
|
|
78
|
+
* setup() {
|
|
79
|
+
* onPageScroll(() => {})
|
|
80
|
+
* }
|
|
81
|
+
* })
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
declare function defineComponent<TypeProps = any>(options: DefineComponentTypePropsOptions<TypeProps>): DefineComponentWithTypeProps<TypeProps>;
|
|
85
|
+
declare function defineComponent<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions, S extends Record<string, any> | void = Record<string, any> | void>(options: DefineComponentOptions<P, D, C, M, S>): WevuComponentConstructor<ResolveProps<P>, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>;
|
|
86
|
+
/**
|
|
87
|
+
* 从 Vue SFC 选项创建 wevu 组件,供 weapp-vite 编译产物直接调用的兼容入口。
|
|
88
|
+
*
|
|
89
|
+
* @param options 组件选项,可能包含小程序特有的 properties
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
declare function createWevuComponent<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions>(options: DefineComponentOptions<P, D, C, M> & {
|
|
93
|
+
properties?: HostMiniProgramComponentPropertyOption;
|
|
94
|
+
}): void;
|
|
95
|
+
/**
|
|
96
|
+
* scoped slot 兼容组件入口(编译产物内部使用)。
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
declare function createWevuScopedSlotComponent(overrides?: {
|
|
100
|
+
computed?: ComputedDefinitions;
|
|
101
|
+
inlineMap?: InlineExpressionMap;
|
|
102
|
+
templateRefs?: TemplateRefBinding[];
|
|
103
|
+
}): void;
|
|
104
|
+
//#endregion
|
|
105
|
+
export { ComponentDefinition, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, SetupContextWithTypeProps, SetupFunctionWithTypeProps, WevuComponentConstructor, WevuDefinedComponent, createWevuComponent, createWevuScopedSlotComponent, defineComponent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getScopedSlotHostGlobalObject as e}from"./platform.mjs";import{hasOwn as t}from"../utils.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as n,applyWevuComponentDefaults as r}from"./defaults.mjs";import{allocateOwnerId as i}from"./scopedSlots.mjs";import{runSetupFunction as a}from"./register/setup.mjs";import{registerComponent as o}from"./register/component.mjs";import{createApp as s}from"./app.mjs";import{resolveNativeInitialData as c}from"./define/initialComputed.mjs";import{resolveVueComponentOptions as l}from"./define/options.mjs";import{applyOptionsApiProvide as u,resolveOptionsApiInjections as d}from"./define/optionsApi.mjs";import{normalizeProps as f}from"./define/props.mjs";import{createScopedSlotOptions as p}from"./define/scopedSlotOptions.mjs";import{applySetupResult as m}from"./define/setupResult.mjs";import{WEVU_FUNCTION_PROP_PATHS_KEY as h,WEVU_SCOPED_SLOT_CREATOR_KEY as g,WEVU_SLOT_OWNER_ID_KEY as _,WEVU_SLOT_OWNER_ID_PROP as v,WEVU_SLOT_SCOPE_KEY as y}from"@weapp-core/constants";let b;function x(){let t=e();if(!t)return;let n=t;b&&n[g]!==b&&(n[g]=b)}function S(e,n){let r={...n==null?{}:n};if(!e||typeof e!=`object`)return r;for(let[n,i]of Object.entries(e))i&&typeof i==`object`&&t(i,`value`)&&(r[n]=i.value);return r}function C(e,t){return!!e.__wevu_isPage&&Array.isArray(t==null?void 0:t.pick)&&t.pick.includes(_)}function w(e){return Array.isArray(e==null?void 0:e.pick)&&e.pick.includes(_)}function T(e){let t=e.properties;return!!(t&&typeof t==`object`&&(v in t||y in t))}function E(e,t){return(t==null?void 0:t.strategy)!==`patch`||!T(e)?t:{...t,strategy:`diff`}}function D(e){x();let{__typeProps:t,data:p,computed:g,methods:v,setData:y,watch:b,setup:T,props:D,inject:O,provide:k,allowFunctionProps:A,...j}=l(r(e)),M=j[h],N=Array.isArray(M)?[...new Set(M.filter(e=>typeof e==`string`&&e.length>0))]:[];delete j[h];let P=E(j,A===!0?{...y==null?{}:y,includeFunctions:!0,functionPaths:N}:A===!1?y:N.length?{...y==null?{}:y,functionPaths:N}:y),F=new Set(N.filter(e=>!e.includes(`.`))),I=f(j,D),L=S(I.properties,v),R=typeof p==`function`?()=>p.call(L):p,z=s({data:R,computed:g,methods:v,setData:P,[n]:`component`}),B=typeof T==`function`||O!=null||k!=null?((e,t)=>{var n,r;let i=(n=(r=t==null?void 0:t.proxy)==null?t==null?void 0:t.instance:r)==null?Object.create(null):n,o=d(O,i);k!=null&&u(k,i);let s=typeof T==`function`?a(T,e,t):void 0,c={...o,...s==null?{}:s};return t&&Object.keys(c).length&&m(t.runtime,t.instance,c,{includeFunctionsInState:A===!0,functionPropPaths:A===!1?void 0:F}),c}):void 0,V=typeof R==`function`?R():R,H=c(w(P)?{...V&&typeof V==`object`?V:{},[_]:C(j,P)?(V==null?void 0:V[_])||i():(V==null?void 0:V[_])||``}:V,g,P),U=H===void 0?I:{...I,data:H},W={data:R,computed:g,methods:v,setData:P,watch:b,setup:B,mpOptions:U};return o(z,v==null?{}:v,b,B,U),{__wevu_runtime:z,__wevu_options:W}}function O(e){var t;x();let{properties:n,props:r,...i}=e;D(f({...i,allowNullPropInput:(t=i.allowNullPropInput)==null||t,__wevu_allowNullPropInput:!0},r,n))}function k(e){O(p(e))}b=k,x();export{O as createWevuComponent,k as createWevuScopedSlotComponent,D as defineComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toRaw as e}from"../reactivity/reactive/shared.mjs";import{getReactiveVersion as t,isReactive as n}from"../reactivity/reactive.mjs";import{unref as r}from"../reactivity/ref.mjs";import{hasOwn as i}from"../utils.mjs";import{hasTrackableSetupBinding as a}from"./setupTracking.mjs";import{isNoSetData as o}from"./noSetData.mjs";function s(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function c(e,t){if(!e||!t)return!1;let n=t;for(;n;){if(e.has(n))return!0;let t=n.lastIndexOf(`.`);if(t<0)return!1;n=n.slice(0,t)}return!1}function l(i,s,u,d,f,p,m,h,g,_){let v=r(i);if(typeof v==`bigint`){let e=Number(v);return Number.isSafeInteger(e)?e:v.toString()}if(typeof v==`symbol`)return v.toString();if(typeof v==`function`)return h||c(g,_)?v:void 0;if(typeof v!=`object`||!v)return v;if(o(v))return;let y=n(v),b=y?e(v):v,x=!!d&&y;if(d&&!x){let e=f==null?void 0:f.get(b);x=e==null?!a(b):e,f==null||f.set(b,x)}let S=x?d:void 0;if(p<=0||m.keys<=0)return b;if(S){let e=t(b),n=S.get(b);if(n&&n.version===e)return n.value}if(u.has(b))return;if(s.has(b))return s.get(b);if(b instanceof Date)return b.getTime();if(b instanceof RegExp)return b.toString();if(b instanceof Map){let e=[];return s.set(b,e),u.add(b),b.forEach((t,n)=>{e.push([l(n,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``),l(t,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``)])}),u.delete(b),e}if(b instanceof Set){let e=[];return s.set(b,e),u.add(b),b.forEach(t=>{e.push(l(t,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``))}),u.delete(b),e}if(typeof ArrayBuffer<`u`){if(b instanceof ArrayBuffer)return b.byteLength;if(ArrayBuffer.isView(b)){let e=b;if(typeof e[Symbol.iterator]==`function`){let t=[...e];return s.set(b,t),t.map(e=>l(e,s,u,void 0,void 0,1/0,{keys:1/0},h,void 0,``))}let t=[...new Uint8Array(e.buffer,e.byteOffset,e.byteLength)];return s.set(b,t),t}}if(b instanceof Error)return{name:b.name,message:b.message};if(Array.isArray(b)){let e=[];s.set(b,e),u.add(b);let n=p-1;for(let t=0;t<b.length;t+=1){let r=_?`${_}.${t}`:String(t),i=l(b[t],s,u,d,f,n,m,h,g,r);e[t]=i===void 0?null:i}return u.delete(b),S&&S.set(b,{version:t(b),value:e}),e}let C={};s.set(b,C),u.add(b);let w=p-1;for(let e of Object.keys(b)){if(--m.keys,m.keys<=0)break;let t=_?`${_}.${e}`:e,n=l(b[e],s,u,d,f,w,m,h,g,t);n!==void 0&&(C[e]=n)}return u.delete(b),S&&S.set(b,{version:t(b),value:C}),C}function u(e,t=new WeakMap,n){var r,i,a;let o=(r=n==null?void 0:n._depth)==null?typeof(n==null?void 0:n.maxDepth)==`number`?Math.max(0,Math.floor(n.maxDepth)):1/0:r,s=(i=n==null?void 0:n._budget)==null?typeof(n==null?void 0:n.maxKeys)==`number`?{keys:Math.max(0,Math.floor(n.maxKeys))}:{keys:1/0}:i,c=Array.isArray(n==null?void 0:n.functionPaths)&&n.functionPaths.length?new Set(n.functionPaths):void 0;return l(e,t,new WeakSet,n==null?void 0:n.cache,n==null?void 0:n.cacheEligibility,o,s,!!(n!=null&&n.includeFunctions),c,(a=n==null?void 0:n._path)==null?``:a)}function d(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function f(e,t,n){let r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let a of r)if(!i(t,a)||!n(e[a],t[a]))return!1;return!0}function p(e,t){return Object.is(e,t)?!0:Array.isArray(e)&&Array.isArray(t)?d(e,t,p):s(e)&&s(t)?f(e,t,p):!1}function m(e){return e===void 0?null:e}function h(e,t,n,r){if(!p(e,t)){if(s(e)&&s(t)){for(let a of Object.keys(t)){if(!i(e,a)){r[`${n}.${a}`]=m(t[a]);continue}h(e[a],t[a],`${n}.${a}`,r)}for(let a of Object.keys(e))i(t,a)||(r[`${n}.${a}`]=null);return}if(Array.isArray(e)&&Array.isArray(t)){d(e,t,p)||(r[n]=m(t));return}r[n]=m(t)}}function g(e,t,n){let r={},a=n==null?void 0:n.skipKeys;for(let n of Object.keys(t))a!=null&&a.has(n)||h(e[n],t[n],n,r);for(let n of Object.keys(e))a!=null&&a.has(n)||i(t,n)||(r[n]=null);return r}export{g as diffSnapshots,u as toPlain};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/runtime/disposables.d.ts
|
|
2
|
+
type DisposableMethodName = 'dispose' | 'abort' | 'cancel' | 'stop' | 'disconnect' | 'destroy' | 'close';
|
|
3
|
+
type DisposableObject = Partial<Record<DisposableMethodName, () => void>>;
|
|
4
|
+
type DisposableLike = (() => void) | DisposableObject;
|
|
5
|
+
interface DisposableBag {
|
|
6
|
+
/**
|
|
7
|
+
* 注册一个清理项,返回“取消注册”函数(不会立即执行清理)。
|
|
8
|
+
*/
|
|
9
|
+
add: (target: DisposableLike | null | undefined) => () => void;
|
|
10
|
+
/**
|
|
11
|
+
* 立即执行并清空当前 bag 中的全部清理项(幂等)。
|
|
12
|
+
*/
|
|
13
|
+
dispose: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* 注册 timeout,并在 bag dispose 时自动 clearTimeout。
|
|
16
|
+
*/
|
|
17
|
+
setTimeout: (handler: (...args: any[]) => void, timeout?: number, ...args: any[]) => ReturnType<typeof setTimeout>;
|
|
18
|
+
/**
|
|
19
|
+
* 注册 interval,并在 bag dispose 时自动 clearInterval。
|
|
20
|
+
*/
|
|
21
|
+
setInterval: (handler: (...args: any[]) => void, timeout?: number, ...args: any[]) => ReturnType<typeof setInterval>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 在 setup() 中创建一个“清理袋”,统一管理副作用释放。
|
|
25
|
+
*
|
|
26
|
+
* 典型用法:注册定时器、请求任务、事件监听退订函数,
|
|
27
|
+
* 在页面/组件卸载时自动批量清理,减少内存泄漏风险。
|
|
28
|
+
*/
|
|
29
|
+
declare function useDisposables(): DisposableBag;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, useDisposables };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentInstance as e}from"./hooks/base.mjs";import{onDetached as t,onUnload as n}from"./hooks/register.mjs";const r=[`dispose`,`abort`,`cancel`,`stop`,`disconnect`,`destroy`,`close`];function i(e){if(e){if(typeof e==`function`)return e;for(let t of r){let n=e[t];if(typeof n==`function`)return()=>n.call(e)}}}function a(){if(!e())throw Error(`useDisposables() 必须在 setup() 的同步阶段调用`);let r=new Set,a=!1,o=e=>{let t=i(e);if(!t)return()=>{};if(a){try{t()}catch(e){}return()=>{}}return r.add(t),()=>{r.delete(t)}},s=()=>{if(a)return;a=!0;let e=[...r];r.clear();for(let t of e)try{t()}catch(e){}};return n(s),t(s),{add:o,dispose:s,setTimeout:(e,t,...n)=>{let r=setTimeout(e,t,...n);return o(()=>{clearTimeout(r)}),r},setInterval:(e,t,...n)=>{let r=setInterval(e,t,...n);return o(()=>{clearInterval(r)}),r}}}export{a as useDisposables};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions } from "./types/miniprogramHost.mjs";
|
|
2
|
+
import { MaybeRefOrGetter } from "../reactivity/ref.mjs";
|
|
3
|
+
import "../reactivity/index.mjs";
|
|
4
|
+
import { InternalRuntimeState } from "./types/runtime.mjs";
|
|
5
|
+
import "./types.mjs";
|
|
6
|
+
//#region src/runtime/elementIntersectionObserver.d.ts
|
|
7
|
+
type ElementIntersectionObserverCallback<T = unknown> = (result: T) => void;
|
|
8
|
+
interface UseElementIntersectionObserverOptions<T = unknown> {
|
|
9
|
+
context?: InternalRuntimeState | null;
|
|
10
|
+
enabled?: MaybeRefOrGetter<boolean>;
|
|
11
|
+
observerOptions?: MaybeRefOrGetter<HostMiniProgramIntersectionObserverOptions>;
|
|
12
|
+
onObserve?: ElementIntersectionObserverCallback<T>;
|
|
13
|
+
relativeToViewport?: boolean | Record<string, number>;
|
|
14
|
+
selector: MaybeRefOrGetter<string | null | undefined>;
|
|
15
|
+
}
|
|
16
|
+
interface UseElementIntersectionObserverReturn {
|
|
17
|
+
disconnect: () => void;
|
|
18
|
+
observe: () => HostMiniProgramIntersectionObserver | null;
|
|
19
|
+
readonly observer: HostMiniProgramIntersectionObserver | null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 观察当前组件或页面内的节点可见性,并在卸载时自动断开。
|
|
23
|
+
*/
|
|
24
|
+
declare function useElementIntersectionObserver<T = unknown>(options: UseElementIntersectionObserverOptions<T>): UseElementIntersectionObserverReturn;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { ElementIntersectionObserverCallback, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, useElementIntersectionObserver };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toValue as e}from"../reactivity/ref.mjs";import{getCurrentMiniProgramRuntimeCapabilities as t,getMiniProgramGlobalObject as n,supportsCurrentMiniProgramRuntimeCapability as r}from"./platform.mjs";import{getCurrentInstance as i,getCurrentSetupContext as a}from"./hooks/base.mjs";import{onDetached as o,onUnload as s}from"./hooks/register.mjs";import{onMounted as c,onUnmounted as l}from"./hooks/vue.mjs";import{watch as u}from"../reactivity/watch.mjs";function d(e,i){let a=e,o=a.createIntersectionObserver;if(typeof o==`function`)return o.call(a,i);if(!r(`globalCreateIntersectionObserver`))return;let s=n(),c=s==null?void 0:s.createIntersectionObserver;if(typeof c==`function`)return t().intersectionObserverScopeByParameter?c.call(s,e,i):c.call(s,i)}function f(e,t){var n;if(t===!1||typeof e.relativeToViewport!=`function`)return e;let r=t&&typeof t==`object`?t:void 0;return(n=e.relativeToViewport(r))==null?e:n}function p(t){var n;let r=(n=t.context)==null?i():n;if(!r||!a())throw Error(`useElementIntersectionObserver() 必须在 setup() 的同步阶段调用`);let p=null,m=()=>{if(p){try{p.disconnect()}catch(e){}p=null}},h=()=>{var n,i;m();let a=e(t.selector);if(!(t.enabled==null||e(t.enabled))||!a)return null;let o=d(r,e((n=t.observerOptions)==null?{}:n));return!o||typeof o.observe!=`function`?null:(p=f(o,(i=t.relativeToViewport)==null||i),p.observe(a,e=>{var n;return(n=t.onObserve)==null?void 0:n.call(t,e)}),p)};return u(()=>{var n;return[e(t.selector),t.enabled==null||e(t.enabled),e((n=t.observerOptions)==null?{}:n),t.relativeToViewport]},()=>{h()},{deep:!0}),c(h),l(m),s(m),o(m),{disconnect:m,observe:h,get observer(){return p}}}export{p as useElementIntersectionObserver};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hasOwn as e}from"../utils.mjs";function t(t){return!t||typeof t!=`object`||Array.isArray(t)?!1:e(t,`bubbles`)||e(t,`composed`)||e(t,`capturePhase`)}function n(e){return e.includes(`:`)?e.replaceAll(`:`,`-`).toLowerCase():e}function r(e){if(e.length===0)return{detail:void 0,options:void 0};if(e.length===1)return{detail:e[0],options:void 0};let n=e[e.length-1];if(t(n)){let t=e.slice(0,-1);return{detail:t.length<=1?t[0]:t,options:n}}return{detail:e,options:void 0}}export{n as normalizeEmitEventName,r as normalizeEmitPayload};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InternalRuntimeState } from "../types/runtime.mjs";
|
|
2
|
+
import "../types.mjs";
|
|
3
|
+
//#region src/runtime/hooks/base.d.ts
|
|
4
|
+
declare function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* 设置当前运行时实例(框架内部使用)。
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
declare function setCurrentInstance(inst: InternalRuntimeState | undefined): void;
|
|
10
|
+
declare function getCurrentSetupContext<T = any>(): T | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 设置当前 setup 上下文(框架内部使用)。
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
declare function setCurrentSetupContext(ctx: any | undefined): void;
|
|
16
|
+
/**
|
|
17
|
+
* 调用批量 hook(框架内部调度入口)。
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
declare function callHookList(target: InternalRuntimeState, name: string, args?: any[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* 调用返回值型 hook(框架内部调度入口)。
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
declare function callHookReturn(target: InternalRuntimeState, name: string, args?: any[]): any;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { callHookList, callHookReturn, getCurrentInstance, getCurrentSetupContext, setCurrentInstance, setCurrentSetupContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentMiniProgramRuntimeCapabilities as e,getMiniProgramGlobalObject as t,supportsCurrentMiniProgramRuntimeCapability as n}from"../platform.mjs";import{WEVU_HOOKS_KEY as r}from"@weapp-core/constants";let i,a;function o(){return i}function s(e){i=e}function c(){return a}function l(e){a=e}function u(e){if(!i)throw Error(`${e}() 必须在 setup() 的同步阶段调用`);return i}function d(e){return e[r]||(e[r]=Object.create(null)),e[r]}function f(t,n){let r=e().shareTimelineRequiresShareAppMessage?t||n:t,i=[];return r&&i.push(`shareAppMessage`),n&&i.push(`shareTimeline`),i}function p(e,t){let n=[{withShareTicket:!0,menus:t},{menus:t},t.includes(`shareTimeline`)?{withShareTicket:!0}:void 0,t.includes(`shareTimeline`)?{}:void 0,void 0];for(let t of n)try{t===void 0?e():e(t);return}catch(e){}}function m(e,t,n,{single:r=!1}={}){let i=d(e);if(r)i[t]=n;else{var a;((a=i[t])==null?i[t]=[]:a).push(n)}}function h(e,t){var n,i;let a=(i=(n=e).__wevuShareHookBridges)==null?n.__wevuShareHookBridges=Object.create(null):i;if(typeof a[t]==`function`)return;let o=e[t],s=function(...e){var n;let i=this[r],a=i==null?void 0:i[t],s=this.__wevu,c=(n=s==null?void 0:s.proxy)==null?this:n,l;if(typeof a==`function`)try{l=a.apply(c,e)}catch(e){l=void 0}else if(Array.isArray(a))for(let t of a)try{l=t.apply(c,e)}catch(e){}if(l!==void 0)return l;if(typeof o==`function`)return o.apply(this,e)};a[t]=s,e[t]=s}function g(e){var i;if(!n(`pageShareMenu`))return;let a=t();if(!a||typeof a.showShareMenu!=`function`)return;let o=(i=e[r])==null?{}:i,s=typeof o.onShareAppMessage==`function`,c=typeof o.onShareTimeline==`function`;if(!s&&!c)return;let l=f(s,c);l.length&&p(a.showShareMenu.bind(a),l)}function _(e,t,n=[]){var i;let a=e[r];if(!a)return;let o=a[t];if(!o)return;let s=e.__wevu,c=(i=s==null?void 0:s.proxy)==null?e:i;if(Array.isArray(o))for(let e of o)try{e.apply(c,n)}catch(e){}else if(typeof o==`function`)try{o.apply(c,n)}catch(e){}}function v(e,t){var n,r;let i=(r=(n=e).__wevuPageHookBridges)==null?n.__wevuPageHookBridges=Object.create(null):r;if(typeof i[t]==`function`)return;let a=e[t],o=function(...e){if(_(this,t,e),typeof a==`function`)return a.apply(this,e)};i[t]=o,e[t]=o}function y(e,t,n=[]){var i;let a=e[r];if(!a)return;let o=a[t];if(!o)return;let s=e.__wevu,c=(i=s==null?void 0:s.proxy)==null?e:i;if(typeof o==`function`)try{return o.apply(c,n)}catch(e){return}if(Array.isArray(o)){let e;for(let t of o)try{e=t.apply(c,n)}catch(e){}return e}}export{u as assertInSetup,_ as callHookList,y as callHookReturn,v as ensurePageHookOnInstance,g as ensurePageShareMenusOnSetup,h as ensureSinglePageHookOnInstance,o as getCurrentInstance,c as getCurrentSetupContext,m as pushHook,s as setCurrentInstance,l as setCurrentSetupContext};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HostMiniProgramAddToFavoritesOption, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramSaveExitState, HostMiniProgramShareAppMessageOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramUnhandledRejectionResult } from "../types/miniprogramHost.mjs";
|
|
2
|
+
import "../types.mjs";
|
|
3
|
+
//#region src/runtime/hooks/register.d.ts
|
|
4
|
+
declare function onLaunch(handler: (options: HostMiniProgramLaunchOptions) => void): void;
|
|
5
|
+
declare function onPageNotFound(handler: (options: HostMiniProgramPageNotFoundOptions) => void): void;
|
|
6
|
+
declare function onUnhandledRejection(handler: (options: HostMiniProgramUnhandledRejectionResult) => void): void;
|
|
7
|
+
declare function onThemeChange(handler: (options: HostMiniProgramThemeChangeResult) => void): void;
|
|
8
|
+
declare function onMemoryWarning(handler: (options: HostMiniProgramMemoryWarningResult) => void): void;
|
|
9
|
+
declare function onShow(handler: () => void): void;
|
|
10
|
+
declare function onShow(handler: (options: HostMiniProgramLaunchOptions) => void): void;
|
|
11
|
+
declare function onLoad(handler: HostMiniProgramPageLifetime['onLoad']): void;
|
|
12
|
+
declare function onHide(handler: () => void): void;
|
|
13
|
+
declare function onUnload(handler: () => void): void;
|
|
14
|
+
declare function onReady(handler: () => void): void;
|
|
15
|
+
declare function onPullDownRefresh(handler: HostMiniProgramPageLifetime['onPullDownRefresh']): void;
|
|
16
|
+
declare function onReachBottom(handler: HostMiniProgramPageLifetime['onReachBottom']): void;
|
|
17
|
+
declare function onPageScroll(handler: (opt: HostMiniProgramPageScrollOption) => void): void;
|
|
18
|
+
declare function onRouteDone(handler: HostMiniProgramPageLifetime['onRouteDone'] | ((opt?: unknown) => void)): void;
|
|
19
|
+
declare function onTabItemTap(handler: (opt: HostMiniProgramTabItemTapOption) => void): void;
|
|
20
|
+
declare function onResize(handler: (opt: HostMiniProgramPageResizeOption) => void): void;
|
|
21
|
+
declare function onMoved(handler: () => void): void;
|
|
22
|
+
declare function onAttached(handler: () => void): void;
|
|
23
|
+
declare function onDetached(handler: () => void): void;
|
|
24
|
+
declare function onError(handler: (err: any) => void): void;
|
|
25
|
+
declare function onSaveExitState(handler: () => HostMiniProgramSaveExitState): void;
|
|
26
|
+
declare function onShareAppMessage(handler: (options: HostMiniProgramShareAppMessageOption) => Record<string, any> | void): void;
|
|
27
|
+
declare function onShareTimeline(handler: HostMiniProgramPageLifetime['onShareTimeline']): void;
|
|
28
|
+
declare function onAddToFavorites(handler: (options: HostMiniProgramAddToFavoritesOption) => Record<string, any> | void): void;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { onAddToFavorites, onAttached, onDetached, onError, onHide, onLaunch, onLoad, onMemoryWarning, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{assertInSetup as e,ensurePageHookOnInstance as t,ensurePageShareMenusOnSetup as n,ensureSinglePageHookOnInstance as r,pushHook as i}from"./base.mjs";function a(t,n,r){i(e(t),t,n,r)}function o(e){a(`onLaunch`,e)}function s(e){a(`onPageNotFound`,e)}function c(e){a(`onUnhandledRejection`,e)}function l(e){a(`onThemeChange`,e)}function u(e){a(`onMemoryWarning`,e)}function d(e){a(`onShow`,e)}function f(e){a(`onLoad`,e)}function p(e){a(`onHide`,e)}function m(e){a(`onUnload`,e)}function h(e){a(`onReady`,e)}function g(e){a(`onPullDownRefresh`,e)}function _(e){a(`onReachBottom`,e)}function v(n){let r=e(`onPageScroll`);i(r,`onPageScroll`,n),t(r,`onPageScroll`)}function y(e){a(`onRouteDone`,e)}function b(e){a(`onTabItemTap`,e)}function x(e){a(`onResize`,e)}function S(e){a(`onMoved`,e)}function C(e){a(`onAttached`,e)}function w(e){a(`onDetached`,e)}function T(e){a(`onError`,e)}function E(e){a(`onSaveExitState`,e,{single:!0})}function D(t){let a=e(`onShareAppMessage`);i(a,`onShareAppMessage`,t,{single:!0}),r(a,`onShareAppMessage`),n(a)}function O(t){let a=e(`onShareTimeline`);i(a,`onShareTimeline`,t,{single:!0}),r(a,`onShareTimeline`),n(a)}function k(t){let n=e(`onAddToFavorites`);i(n,`onAddToFavorites`,t,{single:!0}),r(n,`onAddToFavorites`)}export{k as onAddToFavorites,C as onAttached,w as onDetached,T as onError,p as onHide,o as onLaunch,f as onLoad,u as onMemoryWarning,S as onMoved,s as onPageNotFound,v as onPageScroll,g as onPullDownRefresh,_ as onReachBottom,h as onReady,x as onResize,y as onRouteDone,E as onSaveExitState,D as onShareAppMessage,O as onShareTimeline,d as onShow,b as onTabItemTap,l as onThemeChange,c as onUnhandledRejection,m as onUnload};
|
|
@@ -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};
|