wevu 7.2.1 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +1 -1
- package/dist/dev/api/vitest/setup.d.mts +1 -0
- package/dist/dev/api/vitest.d.mts +1 -0
- package/dist/dev/api.d.mts +1 -0
- package/dist/dev/compiler.d.mts +1 -0
- package/dist/dev/fetch.d.mts +9 -0
- package/dist/dev/index.d.mts +72 -0
- package/dist/dev/internal-reactivity.d.mts +18 -0
- package/dist/dev/internal-runtime.d.mts +45 -0
- package/dist/dev/internal-runtime.mjs +3 -2
- package/dist/dev/internal-template.d.mts +2 -0
- package/dist/dev/jsxTypes.d.mts +9 -0
- package/dist/dev/macros/shared.d.mts +83 -0
- package/dist/dev/macros.d.mts +71 -0
- package/dist/dev/package.mjs +1 -1
- package/dist/dev/reactivity/asyncDerivation.d.mts +41 -0
- package/dist/dev/reactivity/asyncDerivation.mjs +8 -10
- package/dist/dev/reactivity/asyncDerivation.mjs.map +1 -1
- package/dist/dev/reactivity/computed.d.mts +25 -0
- package/dist/dev/reactivity/core.d.mts +35 -0
- package/dist/dev/reactivity/core.mjs +5 -8
- package/dist/dev/reactivity/core.mjs.map +1 -1
- package/dist/dev/reactivity/index.d.mts +16 -0
- package/dist/dev/reactivity/reactive/mutation.d.mts +21 -0
- package/dist/dev/reactivity/reactive/patch.d.mts +18 -0
- package/dist/dev/reactivity/reactive/patch.mjs +3 -3
- package/dist/dev/reactivity/reactive/patch.mjs.map +1 -1
- package/dist/dev/reactivity/reactive/patchState.mjs +4 -8
- package/dist/dev/reactivity/reactive/patchState.mjs.map +1 -1
- package/dist/dev/reactivity/reactive/shallow.d.mts +22 -0
- package/dist/dev/reactivity/reactive/shared.d.mts +4 -0
- package/dist/dev/reactivity/reactive/shared.mjs +1 -2
- package/dist/dev/reactivity/reactive/shared.mjs.map +1 -1
- package/dist/dev/reactivity/reactive.d.mts +42 -0
- package/dist/dev/reactivity/reactive.mjs +5 -10
- package/dist/dev/reactivity/reactive.mjs.map +1 -1
- package/dist/dev/reactivity/readonly.d.mts +27 -0
- package/dist/dev/reactivity/ref.d.mts +27 -0
- package/dist/dev/reactivity/ref.mjs +2 -2
- package/dist/dev/reactivity/ref.mjs.map +1 -1
- package/dist/dev/reactivity/shallowRef.d.mts +19 -0
- package/dist/dev/reactivity/shallowRef.mjs +1 -1
- package/dist/dev/reactivity/shallowRef.mjs.map +1 -1
- package/dist/dev/reactivity/toRefs.d.mts +43 -0
- package/dist/dev/reactivity/traverse.d.mts +8 -0
- package/dist/dev/reactivity/watch/helpers.mjs +1 -1
- package/dist/dev/reactivity/watch/helpers.mjs.map +1 -1
- package/dist/dev/reactivity/watch/types.d.mts +43 -0
- package/dist/dev/reactivity/watch.d.mts +22 -0
- package/dist/dev/reactivity/watch.mjs +6 -8
- package/dist/dev/reactivity/watch.mjs.map +1 -1
- package/dist/dev/router/auto-routes.d.mts +8 -0
- package/dist/dev/router/createRouter.d.mts +9 -0
- package/dist/dev/router/createRouter.mjs +17 -24
- package/dist/dev/router/createRouter.mjs.map +1 -1
- package/dist/dev/router/initialNavigation.mjs +18 -16
- package/dist/dev/router/initialNavigation.mjs.map +1 -1
- package/dist/dev/router/instance.mjs +1 -2
- package/dist/dev/router/instance.mjs.map +1 -1
- package/dist/dev/router/navigationCore.d.mts +7 -0
- package/dist/dev/router/navigationCore.mjs +2 -2
- package/dist/dev/router/navigationCore.mjs.map +1 -1
- package/dist/dev/router/navigationResult.mjs +7 -10
- package/dist/dev/router/navigationResult.mjs.map +1 -1
- package/dist/dev/router/navigationTarget.mjs +1 -3
- package/dist/dev/router/navigationTarget.mjs.map +1 -1
- package/dist/dev/router/resolve.d.mts +7 -0
- package/dist/dev/router/resolve.mjs +3 -4
- package/dist/dev/router/resolve.mjs.map +1 -1
- package/dist/dev/router/routeRegistry.mjs +1 -1
- package/dist/dev/router/routeRegistry.mjs.map +1 -1
- package/dist/dev/router/routeSync.d.mts +2 -0
- package/dist/dev/router/routeSync.mjs +1 -1
- package/dist/dev/router/routeSync.mjs.map +1 -1
- package/dist/dev/router/types.d.mts +267 -0
- package/dist/dev/router/useRoute.d.mts +20 -0
- package/dist/dev/router/useRoute.mjs +12 -19
- package/dist/dev/router/useRoute.mjs.map +1 -1
- package/dist/dev/router/useRouter.d.mts +9 -0
- package/dist/dev/router.d.mts +26 -0
- package/dist/dev/routerInternal/location.d.mts +2 -0
- package/dist/dev/routerInternal/location.mjs +2 -3
- package/dist/dev/routerInternal/location.mjs.map +1 -1
- package/dist/dev/routerInternal/matching.d.mts +2 -0
- package/dist/dev/routerInternal/params.d.mts +2 -0
- package/dist/dev/routerInternal/params.mjs +2 -3
- package/dist/dev/routerInternal/params.mjs.map +1 -1
- package/dist/dev/routerInternal/query.d.mts +7 -0
- package/dist/dev/routerInternal/records.d.mts +2 -0
- package/dist/dev/routerInternal/records.mjs +1 -1
- package/dist/dev/routerInternal/records.mjs.map +1 -1
- package/dist/dev/routerInternal/recordsWarnings.d.mts +2 -0
- package/dist/dev/routerInternal/recordsWarnings.mjs +1 -2
- package/dist/dev/routerInternal/recordsWarnings.mjs.map +1 -1
- package/dist/dev/routerInternal/shared.d.mts +9 -0
- package/dist/dev/routerInternal/snapshots.d.mts +2 -0
- package/dist/dev/routerInternal/types.d.mts +9 -0
- package/dist/dev/runtime/app/context.mjs +13 -26
- package/dist/dev/runtime/app/context.mjs.map +1 -1
- package/dist/dev/runtime/app/diagnostics.mjs +2 -4
- package/dist/dev/runtime/app/diagnostics.mjs.map +1 -1
- package/dist/dev/runtime/app/mount.mjs +27 -33
- package/dist/dev/runtime/app/mount.mjs.map +1 -1
- package/dist/dev/runtime/app/pending.d.mts +10 -0
- package/dist/dev/runtime/app/setData/commitTracker.d.mts +13 -0
- package/dist/dev/runtime/app/setData/commitTracker.mjs +5 -9
- package/dist/dev/runtime/app/setData/commitTracker.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/patchScheduler.mjs +2 -4
- package/dist/dev/runtime/app/setData/patchScheduler.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/payload.mjs +2 -3
- package/dist/dev/runtime/app/setData/payload.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/scheduler.d.mts +51 -0
- package/dist/dev/runtime/app/setData/scheduler.mjs +7 -9
- package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/snapshot.mjs +5 -6
- package/dist/dev/runtime/app/setData/snapshot.mjs.map +1 -1
- package/dist/dev/runtime/app/setDataOptions.mjs +26 -27
- package/dist/dev/runtime/app/setDataOptions.mjs.map +1 -1
- package/dist/dev/runtime/app.d.mts +8 -0
- package/dist/dev/runtime/app.mjs +9 -9
- package/dist/dev/runtime/app.mjs.map +1 -1
- package/dist/dev/runtime/bindingManifest.mjs +6 -14
- package/dist/dev/runtime/bindingManifest.mjs.map +1 -1
- package/dist/dev/runtime/capabilities.d.mts +78 -0
- package/dist/dev/runtime/capabilities.mjs.map +1 -1
- package/dist/dev/runtime/css.d.mts +14 -0
- package/dist/dev/runtime/css.mjs +4 -8
- package/dist/dev/runtime/css.mjs.map +1 -1
- package/dist/dev/runtime/defaults.d.mts +12 -0
- package/dist/dev/runtime/defaults.mjs +4 -4
- package/dist/dev/runtime/defaults.mjs.map +1 -1
- package/dist/dev/runtime/define/initialComputed.mjs +5 -5
- package/dist/dev/runtime/define/initialComputed.mjs.map +1 -1
- package/dist/dev/runtime/define/options.mjs +10 -12
- package/dist/dev/runtime/define/options.mjs.map +1 -1
- package/dist/dev/runtime/define/props.mjs +4 -5
- package/dist/dev/runtime/define/props.mjs.map +1 -1
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +43 -61
- package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
- package/dist/dev/runtime/define/setupResult.mjs +17 -28
- package/dist/dev/runtime/define/setupResult.mjs.map +1 -1
- package/dist/dev/runtime/define.d.mts +118 -0
- package/dist/dev/runtime/define.mjs +9 -12
- package/dist/dev/runtime/define.mjs.map +1 -1
- package/dist/dev/runtime/diff.mjs +9 -11
- package/dist/dev/runtime/diff.mjs.map +1 -1
- package/dist/dev/runtime/disposables.d.mts +31 -0
- package/dist/dev/runtime/disposables.mjs +2 -2
- package/dist/dev/runtime/disposables.mjs.map +1 -1
- package/dist/dev/runtime/elementIntersectionObserver.d.mts +26 -0
- package/dist/dev/runtime/elementIntersectionObserver.mjs +16 -24
- package/dist/dev/runtime/elementIntersectionObserver.mjs.map +1 -1
- package/dist/dev/runtime/features/inlineEvents.d.mts +7 -0
- package/dist/dev/runtime/features/inlineEvents.mjs +2 -3
- package/dist/dev/runtime/features/inlineEvents.mjs.map +1 -1
- package/dist/dev/runtime/features/jsxIslands.d.mts +7 -0
- package/dist/dev/runtime/features/jsxIslands.mjs +20 -0
- package/dist/dev/runtime/features/jsxIslands.mjs.map +1 -0
- package/dist/dev/runtime/features/layout.d.mts +7 -0
- package/dist/dev/runtime/features/layout.mjs +2 -3
- package/dist/dev/runtime/features/layout.mjs.map +1 -1
- package/dist/dev/runtime/features/patchStrategy.d.mts +7 -0
- package/dist/dev/runtime/features/publicLayout.d.mts +24 -0
- package/dist/dev/runtime/features/publicLayout.mjs +2 -6
- package/dist/dev/runtime/features/publicLayout.mjs.map +1 -1
- package/dist/dev/runtime/features/scopedSlots.d.mts +23 -0
- package/dist/dev/runtime/features/scopedSlots.mjs +5 -9
- package/dist/dev/runtime/features/scopedSlots.mjs.map +1 -1
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.d.mts +7 -0
- package/dist/dev/runtime/features/templateRefs.d.mts +7 -0
- package/dist/dev/runtime/features/templateRefs.mjs +1 -1
- package/dist/dev/runtime/features/templateRefs.mjs.map +1 -1
- package/dist/dev/runtime/hooks/base.d.mts +27 -0
- package/dist/dev/runtime/hooks/base.mjs +21 -32
- package/dist/dev/runtime/hooks/base.mjs.map +1 -1
- package/dist/dev/runtime/hooks/register.d.mts +30 -0
- package/dist/dev/runtime/hooks/vue.d.mts +52 -0
- package/dist/dev/runtime/hooks.d.mts +4 -0
- package/dist/dev/runtime/index.d.mts +46 -0
- package/dist/dev/runtime/inlineDataset.mjs +1 -2
- package/dist/dev/runtime/inlineDataset.mjs.map +1 -1
- package/dist/dev/runtime/intersectionObserver.d.mts +14 -0
- package/dist/dev/runtime/intersectionObserver.mjs +6 -6
- package/dist/dev/runtime/intersectionObserver.mjs.map +1 -1
- package/dist/dev/runtime/jsxIsland.d.mts +37 -0
- package/dist/dev/runtime/jsxIsland.mjs +16 -33
- package/dist/dev/runtime/jsxIsland.mjs.map +1 -1
- package/dist/dev/runtime/layoutBridge.d.mts +55 -0
- package/dist/dev/runtime/layoutBridge.mjs +32 -62
- package/dist/dev/runtime/layoutBridge.mjs.map +1 -1
- package/dist/dev/runtime/nativeBridge.mjs +1 -1
- package/dist/dev/runtime/nativeBridge.mjs.map +1 -1
- package/dist/dev/runtime/navigationLifecycle.mjs +24 -0
- package/dist/dev/runtime/navigationLifecycle.mjs.map +1 -0
- package/dist/dev/runtime/noSetData.d.mts +5 -0
- package/dist/dev/runtime/pageEnvironment.d.mts +50 -0
- package/dist/dev/runtime/pageEnvironment.mjs +15 -18
- package/dist/dev/runtime/pageEnvironment.mjs.map +1 -1
- package/dist/dev/runtime/pageLayout.d.mts +25 -0
- package/dist/dev/runtime/pageLayout.mjs +7 -11
- package/dist/dev/runtime/pageLayout.mjs.map +1 -1
- package/dist/dev/runtime/pageScroll.d.mts +29 -0
- package/dist/dev/runtime/pageScroll.mjs +2 -3
- package/dist/dev/runtime/pageScroll.mjs.map +1 -1
- package/dist/dev/runtime/platform/current.mjs +12 -0
- package/dist/dev/runtime/platform/current.mjs.map +1 -0
- package/dist/dev/runtime/platform/generic.mjs +36 -0
- package/dist/dev/runtime/platform/generic.mjs.map +1 -0
- package/dist/dev/runtime/platform/globals.mjs +29 -0
- package/dist/dev/runtime/platform/globals.mjs.map +1 -0
- package/dist/dev/runtime/platform.mjs +15 -60
- package/dist/dev/runtime/platform.mjs.map +1 -1
- package/dist/dev/runtime/provide.d.mts +60 -0
- package/dist/dev/runtime/provideContext.mjs +7 -9
- package/dist/dev/runtime/provideContext.mjs.map +1 -1
- package/dist/dev/runtime/provideStore.d.mts +7 -0
- package/dist/dev/runtime/publicRuntime.d.mts +22 -0
- package/dist/dev/runtime/publicRuntime.mjs +4 -0
- package/dist/dev/runtime/publicRuntime.mjs.map +1 -1
- package/dist/dev/runtime/pullDownRefresh.d.mts +12 -0
- package/dist/dev/runtime/pullDownRefresh.mjs +2 -4
- package/dist/dev/runtime/pullDownRefresh.mjs.map +1 -1
- package/dist/dev/runtime/register/app.d.mts +14 -0
- package/dist/dev/runtime/register/app.mjs +18 -19
- package/dist/dev/runtime/register/app.mjs.map +1 -1
- package/dist/dev/runtime/register/component/alipay.mjs +9 -18
- package/dist/dev/runtime/register/component/alipay.mjs.map +1 -1
- package/dist/dev/runtime/register/component/alipayRegistration.mjs +60 -0
- package/dist/dev/runtime/register/component/alipayRegistration.mjs.map +1 -0
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs +8 -9
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs.map +1 -1
- package/dist/dev/runtime/register/component/lifecycle.mjs +7 -12
- package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -1
- package/dist/dev/runtime/register/component/methods.mjs +13 -18
- package/dist/dev/runtime/register/component/methods.mjs.map +1 -1
- package/dist/dev/runtime/register/component/options.mjs +3 -4
- package/dist/dev/runtime/register/component/options.mjs.map +1 -1
- package/dist/dev/runtime/register/component/props.mjs +25 -31
- package/dist/dev/runtime/register/component/props.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerDefinition.mjs +18 -40
- package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +18 -60
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs.map +1 -1
- package/dist/dev/runtime/register/component.d.mts +17 -0
- package/dist/dev/runtime/register/component.mjs +3 -5
- package/dist/dev/runtime/register/component.mjs.map +1 -1
- package/dist/dev/runtime/register/inline.d.mts +15 -0
- package/dist/dev/runtime/register/inline.mjs +8 -10
- package/dist/dev/runtime/register/inline.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +7 -8
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +1 -1
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +25 -34
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +6 -13
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +2 -2
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs +9 -9
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance.d.mts +26 -0
- package/dist/dev/runtime/register/runtimeInstance.mjs +74 -100
- package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +12 -15
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs.map +1 -1
- package/dist/dev/runtime/register/setup.d.mts +11 -0
- package/dist/dev/runtime/register/setup.mjs +2 -3
- package/dist/dev/runtime/register/setup.mjs.map +1 -1
- package/dist/dev/runtime/register/snapshot.mjs +1 -4
- package/dist/dev/runtime/register/snapshot.mjs.map +1 -1
- package/dist/dev/runtime/register/watch.d.mts +12 -0
- package/dist/dev/runtime/register/watch.mjs +3 -5
- package/dist/dev/runtime/register/watch.mjs.map +1 -1
- package/dist/dev/runtime/register.d.mts +5 -0
- package/dist/dev/runtime/scopedSlots.mjs +14 -21
- package/dist/dev/runtime/scopedSlots.mjs.map +1 -1
- package/dist/dev/runtime/selectorQuery.d.mts +54 -0
- package/dist/dev/runtime/selectorQuery.mjs +5 -9
- package/dist/dev/runtime/selectorQuery.mjs.map +1 -1
- package/dist/dev/runtime/template.d.mts +6 -0
- package/dist/dev/runtime/template.mjs +1 -1
- package/dist/dev/runtime/template.mjs.map +1 -1
- package/dist/dev/runtime/templateRefTypes.d.mts +12 -0
- package/dist/dev/runtime/templateRefs/helpers.mjs +14 -24
- package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -1
- package/dist/dev/runtime/templateRefs.mjs +8 -15
- package/dist/dev/runtime/templateRefs.mjs.map +1 -1
- package/dist/dev/runtime/types/core.d.mts +35 -0
- package/dist/dev/runtime/types/miniprogram.d.mts +84 -0
- package/dist/dev/runtime/types/miniprogramHost.d.mts +45 -0
- package/dist/dev/runtime/types/miniprogramHostSources.d.mts +112 -0
- package/dist/dev/runtime/types/options.d.mts +138 -0
- package/dist/dev/runtime/types/props/propTypes.d.mts +79 -0
- package/dist/dev/runtime/types/props/router.d.mts +51 -0
- package/dist/dev/runtime/types/props/setup.d.mts +96 -0
- package/dist/dev/runtime/types/props.d.mts +4 -0
- package/dist/dev/runtime/types/runtime.d.mts +59 -0
- package/dist/dev/runtime/types/setData.d.mts +237 -0
- package/dist/dev/runtime/types.d.mts +29 -0
- package/dist/dev/runtime/uniAppHost.d.mts +8 -0
- package/dist/dev/runtime/uniAppHost.mjs +6 -14
- package/dist/dev/runtime/uniAppHost.mjs.map +1 -1
- package/dist/dev/runtime/updatePerformance.d.mts +13 -0
- package/dist/dev/runtime/updatePerformance.mjs +1 -1
- package/dist/dev/runtime/updatePerformance.mjs.map +1 -1
- package/dist/dev/runtime/use.d.mts +13 -0
- package/dist/dev/runtime/use.mjs +1 -1
- package/dist/dev/runtime/use.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/context.d.mts +8 -0
- package/dist/dev/runtime/vueCompat/context.mjs +3 -5
- package/dist/dev/runtime/vueCompat/context.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/model.d.mts +30 -0
- package/dist/dev/runtime/vueCompat/model.mjs +9 -13
- package/dist/dev/runtime/vueCompat/model.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/router.d.mts +29 -0
- package/dist/dev/runtime/vueCompat/router.mjs +4 -4
- package/dist/dev/runtime/vueCompat/router.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/templateRef.d.mts +9 -0
- package/dist/dev/runtime/vueCompat/templateRef.mjs +1 -1
- package/dist/dev/runtime/vueCompat/templateRef.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat.d.mts +5 -0
- package/dist/dev/scheduler.d.mts +4 -0
- package/dist/dev/scheduler.mjs +3 -4
- package/dist/dev/scheduler.mjs.map +1 -1
- package/dist/dev/store/base.mjs +1 -2
- package/dist/dev/store/base.mjs.map +1 -1
- package/dist/dev/store/define/create.mjs +11 -22
- package/dist/dev/store/define/create.mjs.map +1 -1
- package/dist/dev/store/define.d.mts +8 -0
- package/dist/dev/store/define.mjs +1 -1
- package/dist/dev/store/define.mjs.map +1 -1
- package/dist/dev/store/manager.d.mts +16 -0
- package/dist/dev/store/storeToRefs.d.mts +11 -0
- package/dist/dev/store/types.d.mts +106 -0
- package/dist/dev/store/view.mjs +1 -1
- package/dist/dev/store/view.mjs.map +1 -1
- package/dist/dev/store.d.mts +5 -0
- package/dist/dev/version.d.mts +4 -0
- package/dist/dev/vue-augment.d.mts +8 -0
- package/dist/dev/vue-demi.d.mts +87 -0
- package/dist/dev/vue-types.d.mts +19 -0
- package/dist/dev/web-apis.d.mts +3 -0
- package/dist/internal-runtime.d.mts +2 -1
- package/dist/internal-runtime.mjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/reactivity/asyncDerivation.mjs +1 -1
- package/dist/reactivity/core.mjs +1 -1
- package/dist/reactivity/reactive/patch.mjs +1 -1
- package/dist/reactivity/reactive/patchState.mjs +1 -1
- package/dist/reactivity/reactive/shared.mjs +1 -1
- package/dist/reactivity/reactive.mjs +1 -1
- package/dist/reactivity/ref.mjs +1 -1
- package/dist/reactivity/shallowRef.mjs +1 -1
- package/dist/reactivity/watch/helpers.mjs +1 -1
- package/dist/reactivity/watch.mjs +1 -1
- package/dist/router/createRouter.mjs +1 -1
- package/dist/router/initialNavigation.mjs +1 -1
- package/dist/router/instance.mjs +1 -1
- package/dist/router/navigationCore.mjs +1 -1
- package/dist/router/navigationResult.mjs +1 -1
- package/dist/router/navigationTarget.mjs +1 -1
- package/dist/router/resolve.mjs +1 -1
- package/dist/router/routeRegistry.mjs +1 -1
- package/dist/router/routeSync.mjs +1 -1
- package/dist/router/useRoute.mjs +1 -1
- package/dist/routerInternal/location.mjs +1 -1
- package/dist/routerInternal/params.mjs +1 -1
- package/dist/routerInternal/records.mjs +1 -1
- package/dist/routerInternal/recordsWarnings.mjs +1 -1
- package/dist/runtime/app/context.mjs +1 -1
- package/dist/runtime/app/diagnostics.mjs +1 -1
- package/dist/runtime/app/mount.mjs +1 -1
- package/dist/runtime/app/setData/commitTracker.mjs +1 -1
- package/dist/runtime/app/setData/patchScheduler.mjs +1 -1
- package/dist/runtime/app/setData/payload.mjs +1 -1
- package/dist/runtime/app/setData/scheduler.mjs +1 -1
- package/dist/runtime/app/setData/snapshot.mjs +1 -1
- package/dist/runtime/app/setDataOptions.mjs +1 -1
- package/dist/runtime/app.mjs +1 -1
- package/dist/runtime/bindingManifest.mjs +1 -1
- package/dist/runtime/capabilities.d.mts +4 -1
- package/dist/runtime/css.mjs +1 -1
- package/dist/runtime/defaults.mjs +1 -1
- package/dist/runtime/define/initialComputed.mjs +1 -1
- package/dist/runtime/define/options.mjs +1 -1
- package/dist/runtime/define/props.mjs +1 -1
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
- package/dist/runtime/define/setupResult.mjs +1 -1
- package/dist/runtime/define.mjs +1 -1
- package/dist/runtime/diff.mjs +1 -1
- package/dist/runtime/disposables.mjs +1 -1
- package/dist/runtime/elementIntersectionObserver.mjs +1 -1
- package/dist/runtime/features/inlineEvents.mjs +1 -1
- package/dist/runtime/features/jsxIslands.d.mts +6 -0
- package/dist/runtime/features/jsxIslands.mjs +1 -0
- package/dist/runtime/features/layout.mjs +1 -1
- package/dist/runtime/features/publicLayout.mjs +1 -1
- package/dist/runtime/features/scopedSlots.mjs +1 -1
- package/dist/runtime/features/templateRefs.mjs +1 -1
- package/dist/runtime/hooks/base.mjs +1 -1
- package/dist/runtime/inlineDataset.mjs +1 -1
- package/dist/runtime/intersectionObserver.mjs +1 -1
- package/dist/runtime/jsxIsland.mjs +1 -1
- package/dist/runtime/layoutBridge.mjs +1 -1
- package/dist/runtime/nativeBridge.mjs +1 -1
- package/dist/runtime/navigationLifecycle.mjs +1 -0
- package/dist/runtime/pageEnvironment.mjs +1 -1
- package/dist/runtime/pageLayout.mjs +1 -1
- package/dist/runtime/pageScroll.mjs +1 -1
- package/dist/runtime/platform/current.mjs +1 -0
- package/dist/runtime/platform/generic.mjs +1 -0
- package/dist/runtime/platform/globals.mjs +1 -0
- package/dist/runtime/platform.mjs +1 -1
- package/dist/runtime/provideContext.mjs +1 -1
- package/dist/runtime/publicRuntime.mjs +1 -1
- package/dist/runtime/pullDownRefresh.mjs +1 -1
- package/dist/runtime/register/app.mjs +1 -1
- package/dist/runtime/register/component/alipay.mjs +1 -1
- package/dist/runtime/register/component/alipayRegistration.mjs +1 -0
- package/dist/runtime/register/component/lifecycle/platform.mjs +1 -1
- package/dist/runtime/register/component/lifecycle.mjs +1 -1
- package/dist/runtime/register/component/methods.mjs +1 -1
- package/dist/runtime/register/component/options.mjs +1 -1
- package/dist/runtime/register/component/props.mjs +1 -1
- package/dist/runtime/register/component/registerDefinition.mjs +1 -1
- package/dist/runtime/register/component/registerNativeDefinition.mjs +1 -1
- package/dist/runtime/register/component.mjs +1 -1
- package/dist/runtime/register/inline.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/methodBridge.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/provideContext.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupContext.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupSnapshot.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/utils.mjs +1 -1
- package/dist/runtime/register/runtimeInstance.mjs +1 -1
- package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -1
- package/dist/runtime/register/setup.mjs +1 -1
- package/dist/runtime/register/snapshot.mjs +1 -1
- package/dist/runtime/register/watch.mjs +1 -1
- package/dist/runtime/scopedSlots.mjs +1 -1
- package/dist/runtime/selectorQuery.mjs +1 -1
- package/dist/runtime/template.mjs +1 -1
- package/dist/runtime/templateRefs/helpers.mjs +1 -1
- package/dist/runtime/templateRefs.mjs +1 -1
- package/dist/runtime/uniAppHost.mjs +1 -1
- package/dist/runtime/updatePerformance.mjs +1 -1
- package/dist/runtime/use.mjs +1 -1
- package/dist/runtime/vueCompat/context.mjs +1 -1
- package/dist/runtime/vueCompat/model.mjs +1 -1
- package/dist/runtime/vueCompat/router.mjs +1 -1
- package/dist/runtime/vueCompat/templateRef.mjs +1 -1
- package/dist/scheduler.mjs +1 -1
- package/dist/store/base.mjs +1 -1
- package/dist/store/define/create.mjs +1 -1
- package/dist/store/define.mjs +1 -1
- package/dist/store/view.mjs +1 -1
- package/package.json +7 -7
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementIntersectionObserver.mjs","names":[],"sources":["../../../src/runtime/elementIntersectionObserver.ts"],"sourcesContent":["import type { MaybeRefOrGetter } from '../reactivity'\nimport type {\n InternalRuntimeState,\n MiniProgramIntersectionObserver,\n MiniProgramIntersectionObserverOptions,\n} from './types'\nimport { toValue, watch } from '../reactivity'\nimport { getCurrentInstance, getCurrentSetupContext, onDetached, onMounted, onUnload, onUnmounted } from './hooks'\nimport {
|
|
1
|
+
{"version":3,"file":"elementIntersectionObserver.mjs","names":[],"sources":["../../../src/runtime/elementIntersectionObserver.ts"],"sourcesContent":["import type { MaybeRefOrGetter } from '../reactivity'\nimport type {\n InternalRuntimeState,\n MiniProgramIntersectionObserver,\n MiniProgramIntersectionObserverOptions,\n} from './types'\nimport { toValue, watch } from '../reactivity'\nimport { getCurrentInstance, getCurrentSetupContext, onDetached, onMounted, onUnload, onUnmounted } from './hooks'\nimport { getCurrentMiniProgramGlobalObject, getCurrentMiniProgramRuntimeCapabilities, supportsCurrentMiniProgramRuntimeCapability } from './platform'\n\nexport type ElementIntersectionObserverCallback<T = unknown> = (result: T) => void\n\nexport interface UseElementIntersectionObserverOptions<T = unknown> {\n context?: InternalRuntimeState | null\n enabled?: MaybeRefOrGetter<boolean>\n observerOptions?: MaybeRefOrGetter<MiniProgramIntersectionObserverOptions>\n onObserve?: ElementIntersectionObserverCallback<T>\n relativeToViewport?: boolean | Record<string, number>\n selector: MaybeRefOrGetter<string | null | undefined>\n}\n\nexport interface UseElementIntersectionObserverReturn {\n disconnect: () => void\n observe: () => MiniProgramIntersectionObserver | null\n readonly observer: MiniProgramIntersectionObserver | null\n}\n\nfunction createObserverFromContext(\n context: InternalRuntimeState,\n options: MiniProgramIntersectionObserverOptions,\n) {\n const nativeContext = context as Record<string, any>\n const creator = nativeContext.createIntersectionObserver\n if (typeof creator === 'function') {\n return creator.call(nativeContext, options) as MiniProgramIntersectionObserver | undefined\n }\n\n if (!supportsCurrentMiniProgramRuntimeCapability('globalCreateIntersectionObserver')) {\n return undefined\n }\n\n const miniProgramGlobal = getCurrentMiniProgramGlobalObject()\n const globalCreator = miniProgramGlobal?.createIntersectionObserver\n if (typeof globalCreator !== 'function') {\n return undefined\n }\n\n return getCurrentMiniProgramRuntimeCapabilities().intersectionObserverScopeByParameter\n ? globalCreator.call(miniProgramGlobal, context, options)\n : globalCreator.call(miniProgramGlobal, options)\n}\n\nfunction applyRelativeToViewport(\n observer: MiniProgramIntersectionObserver,\n relativeToViewport: UseElementIntersectionObserverOptions['relativeToViewport'],\n) {\n if (relativeToViewport === false || typeof observer.relativeToViewport !== 'function') {\n return observer\n }\n const margins = relativeToViewport && typeof relativeToViewport === 'object'\n ? relativeToViewport\n : undefined\n return observer.relativeToViewport(margins as any) ?? observer\n}\n\n/**\n * 观察当前组件或页面内的节点可见性,并在卸载时自动断开。\n */\nexport function useElementIntersectionObserver<T = unknown>(\n options: UseElementIntersectionObserverOptions<T>,\n): UseElementIntersectionObserverReturn {\n const context = options.context ?? getCurrentInstance<InternalRuntimeState>()\n if (!context || !getCurrentSetupContext()) {\n throw new Error('useElementIntersectionObserver() 必须在 setup() 的同步阶段调用')\n }\n\n let observer: MiniProgramIntersectionObserver | null = null\n\n const disconnect = () => {\n if (!observer) {\n return\n }\n try {\n observer.disconnect()\n }\n catch {\n // 忽略平台差异导致的断开异常,避免影响页面卸载流程\n }\n observer = null\n }\n\n const observe = () => {\n disconnect()\n\n const selector = toValue(options.selector)\n const enabled = options.enabled == null ? true : toValue(options.enabled)\n if (!enabled || !selector) {\n return null\n }\n\n const nextObserver = createObserverFromContext(\n context,\n toValue(options.observerOptions ?? {}),\n )\n if (!nextObserver || typeof nextObserver.observe !== 'function') {\n return null\n }\n\n observer = applyRelativeToViewport(\n nextObserver,\n options.relativeToViewport ?? true,\n )\n observer.observe(selector, result => options.onObserve?.(result as T))\n return observer\n }\n\n watch(\n () => [\n toValue(options.selector),\n options.enabled == null ? true : toValue(options.enabled),\n toValue(options.observerOptions ?? {}),\n options.relativeToViewport,\n ],\n () => {\n observe()\n },\n {\n deep: true,\n },\n )\n\n onMounted(observe)\n onUnmounted(disconnect)\n onUnload(disconnect)\n onDetached(disconnect)\n\n return {\n disconnect,\n observe,\n get observer() {\n return observer\n },\n }\n}\n"],"mappings":";;;;;;;;;AA2BA,SAAS,0BACP,SACA,SACA;CACA,MAAM,gBAAgB;CACtB,MAAM,UAAU,cAAc;CAC9B,IAAI,OAAO,YAAY,YACrB,OAAO,QAAQ,KAAK,eAAe,OAAO;CAG5C,IAAI,CAAC,4CAA4C,kCAAkC,GACjF;CAGF,MAAM,oBAAoB,kCAAkC;CAC5D,MAAM,gBAAgB,mBAAmB;CACzC,IAAI,OAAO,kBAAkB,YAC3B;CAGF,OAAO,yCAAyC,CAAC,CAAC,uCAC9C,cAAc,KAAK,mBAAmB,SAAS,OAAO,IACtD,cAAc,KAAK,mBAAmB,OAAO;AACnD;AAEA,SAAS,wBACP,UACA,oBACA;CACA,IAAI,uBAAuB,SAAS,OAAO,SAAS,uBAAuB,YACzE,OAAO;CAET,MAAM,UAAU,sBAAsB,OAAO,uBAAuB,WAChE,qBACA;CACJ,OAAO,SAAS,mBAAmB,OAAc,KAAK;AACxD;;;;AAKA,SAAgB,+BACd,SACsC;CACtC,MAAM,UAAU,QAAQ,WAAW,mBAAyC;CAC5E,IAAI,CAAC,WAAW,CAAC,uBAAuB,GACtC,MAAM,IAAI,MAAM,sDAAsD;CAGxE,IAAI,WAAmD;CAEvD,MAAM,mBAAmB;EACvB,IAAI,CAAC,UACH;EAEF,IAAI;GACF,SAAS,WAAW;EACtB,QACM,CAEN;EACA,WAAW;CACb;CAEA,MAAM,gBAAgB;EACpB,WAAW;EAEX,MAAM,WAAW,QAAQ,QAAQ,QAAQ;EAEzC,IAAI,EADY,QAAQ,WAAW,OAAO,OAAO,QAAQ,QAAQ,OAAO,MACxD,CAAC,UACf,OAAO;EAGT,MAAM,eAAe,0BACnB,SACA,QAAQ,QAAQ,mBAAmB,CAAC,CAAC,CACvC;EACA,IAAI,CAAC,gBAAgB,OAAO,aAAa,YAAY,YACnD,OAAO;EAGT,WAAW,wBACT,cACA,QAAQ,sBAAsB,IAChC;EACA,SAAS,QAAQ,WAAU,WAAU,QAAQ,YAAY,MAAW,CAAC;EACrE,OAAO;CACT;CAEA,YACQ;EACJ,QAAQ,QAAQ,QAAQ;EACxB,QAAQ,WAAW,OAAO,OAAO,QAAQ,QAAQ,OAAO;EACxD,QAAQ,QAAQ,mBAAmB,CAAC,CAAC;EACrC,QAAQ;CACV,SACM;EACJ,QAAQ;CACV,GACA,EACE,MAAM,KACR,CACF;CAEA,UAAU,OAAO;CACjB,YAAY,UAAU;CACtB,SAAS,UAAU;CACnB,WAAW,UAAU;CAErB,OAAO;EACL;EACA;EACA,IAAI,WAAW;GACb,OAAO;EACT;CACF;AACF"}
|
|
@@ -5,10 +5,9 @@ import { WEVU_INLINE_MAP_KEY } from "@weapp-core/constants";
|
|
|
5
5
|
//#region src/runtime/features/inlineEvents.ts
|
|
6
6
|
const inlineEventHooks = {
|
|
7
7
|
handler(event) {
|
|
8
|
-
var _runtime$proxy, _runtime$methods;
|
|
9
8
|
const runtime = this.__wevu;
|
|
10
|
-
const context =
|
|
11
|
-
const inlineMap = runtime
|
|
9
|
+
const context = runtime?.proxy ?? this;
|
|
10
|
+
const inlineMap = runtime?.methods?.[WEVU_INLINE_MAP_KEY];
|
|
12
11
|
return runInlineExpression(context, void 0, event, inlineMap && typeof inlineMap === "object" && !Array.isArray(inlineMap) ? inlineMap : void 0);
|
|
13
12
|
},
|
|
14
13
|
run: runInlineExpression
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inlineEvents.mjs","names":[],"sources":["../../../../src/runtime/features/inlineEvents.ts"],"sourcesContent":["import type { RuntimeCapabilityRegistry } from '../capabilities'\nimport type { InlineExpressionMap } from '../register/inline'\nimport type { InternalRuntimeState } from '../types'\nimport { WEVU_INLINE_MAP_KEY } from '@weapp-core/constants'\nimport { registerRuntimeCapability } from '../capabilities'\nimport { runInlineExpression } from '../register/inline'\n\nconst inlineEventHooks: NonNullable<RuntimeCapabilityRegistry['inlineEvents']> = {\n handler(this: InternalRuntimeState, event: unknown) {\n const runtime = this.__wevu\n const context = runtime?.proxy ?? this\n const inlineMap = runtime?.methods?.[WEVU_INLINE_MAP_KEY] as unknown\n return runInlineExpression(\n context,\n undefined,\n event,\n inlineMap && typeof inlineMap === 'object' && !Array.isArray(inlineMap)\n ? inlineMap as InlineExpressionMap\n : undefined,\n )\n },\n run: runInlineExpression,\n}\n\n/**\n * 安装模板内联事件能力。\n */\nexport function installInlineEvents(): void {\n registerRuntimeCapability('inlineEvents', inlineEventHooks)\n}\n"],"mappings":";;;;;AAOA,MAAM,mBAA2E;CAC/E,QAAoC,OAAgB
|
|
1
|
+
{"version":3,"file":"inlineEvents.mjs","names":[],"sources":["../../../../src/runtime/features/inlineEvents.ts"],"sourcesContent":["import type { RuntimeCapabilityRegistry } from '../capabilities'\nimport type { InlineExpressionMap } from '../register/inline'\nimport type { InternalRuntimeState } from '../types'\nimport { WEVU_INLINE_MAP_KEY } from '@weapp-core/constants'\nimport { registerRuntimeCapability } from '../capabilities'\nimport { runInlineExpression } from '../register/inline'\n\nconst inlineEventHooks: NonNullable<RuntimeCapabilityRegistry['inlineEvents']> = {\n handler(this: InternalRuntimeState, event: unknown) {\n const runtime = this.__wevu\n const context = runtime?.proxy ?? this\n const inlineMap = runtime?.methods?.[WEVU_INLINE_MAP_KEY] as unknown\n return runInlineExpression(\n context,\n undefined,\n event,\n inlineMap && typeof inlineMap === 'object' && !Array.isArray(inlineMap)\n ? inlineMap as InlineExpressionMap\n : undefined,\n )\n },\n run: runInlineExpression,\n}\n\n/**\n * 安装模板内联事件能力。\n */\nexport function installInlineEvents(): void {\n registerRuntimeCapability('inlineEvents', inlineEventHooks)\n}\n"],"mappings":";;;;;AAOA,MAAM,mBAA2E;CAC/E,QAAoC,OAAgB;EAClD,MAAM,UAAU,KAAK;EACrB,MAAM,UAAU,SAAS,SAAS;EAClC,MAAM,YAAY,SAAS,UAAU;EACrC,OAAO,oBACL,SACA,QACA,OACA,aAAa,OAAO,cAAc,YAAY,CAAC,MAAM,QAAQ,SAAS,IAClE,YACA,MACN;CACF;CACA,KAAK;AACP;;;;AAKA,SAAgB,sBAA4B;CAC1C,0BAA0B,gBAAgB,gBAAgB;AAC5D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { registerRuntimeCapability } from "../capabilities.mjs";
|
|
2
|
+
import { runJsxIslandHandler } from "../jsxIsland.mjs";
|
|
3
|
+
import { WEVU_JSX_ISLAND_HANDLER } from "@weapp-core/constants";
|
|
4
|
+
|
|
5
|
+
//#region src/runtime/features/jsxIslands.ts
|
|
6
|
+
const jsxIslandHooks = { attachMethods(methods) {
|
|
7
|
+
if (!methods[WEVU_JSX_ISLAND_HANDLER]) methods[WEVU_JSX_ISLAND_HANDLER] = function(event) {
|
|
8
|
+
return runJsxIslandHandler(this, event);
|
|
9
|
+
};
|
|
10
|
+
} };
|
|
11
|
+
/**
|
|
12
|
+
* 安装 JSX 动态岛的宿主事件入口,纯模板组件无需携带分发实现。
|
|
13
|
+
*/
|
|
14
|
+
function installJsxIslands() {
|
|
15
|
+
registerRuntimeCapability("jsxIslands", jsxIslandHooks);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { installJsxIslands };
|
|
20
|
+
//# sourceMappingURL=jsxIslands.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsxIslands.mjs","names":[],"sources":["../../../../src/runtime/features/jsxIslands.ts"],"sourcesContent":["import type { RuntimeCapabilityRegistry } from '../capabilities'\nimport type { InternalRuntimeState } from '../types'\nimport { WEVU_JSX_ISLAND_HANDLER } from '@weapp-core/constants'\nimport { registerRuntimeCapability } from '../capabilities'\nimport { runJsxIslandHandler } from '../jsxIsland'\n\nconst jsxIslandHooks: NonNullable<RuntimeCapabilityRegistry['jsxIslands']> = {\n attachMethods(methods) {\n if (!methods[WEVU_JSX_ISLAND_HANDLER]) {\n methods[WEVU_JSX_ISLAND_HANDLER] = function (this: InternalRuntimeState, event: unknown) {\n return runJsxIslandHandler(this, event)\n }\n }\n },\n}\n\n/**\n * 安装 JSX 动态岛的宿主事件入口,纯模板组件无需携带分发实现。\n */\nexport function installJsxIslands(): void {\n registerRuntimeCapability('jsxIslands', jsxIslandHooks)\n}\n"],"mappings":";;;;;AAMA,MAAM,iBAAuE,EAC3E,cAAc,SAAS;CACrB,IAAI,CAAC,QAAQ,0BACX,QAAQ,2BAA2B,SAAsC,OAAgB;EACvF,OAAO,oBAAoB,MAAM,KAAK;CACxC;AAEJ,EACF;;;;AAKA,SAAgB,oBAA0B;CACxC,0BAA0B,cAAc,cAAc;AACxD"}
|
|
@@ -9,11 +9,10 @@ import { WEVU_LAYOUT_HOST_BRIDGE_KEY, WEVU_PAGE_LAYOUT_NAME_KEY, WEVU_PAGE_LAYOU
|
|
|
9
9
|
const layoutHooks = {
|
|
10
10
|
attachPageSetter(target) {
|
|
11
11
|
target[WEVU_PAGE_LAYOUT_SETTER_KEY] = (layout, props) => {
|
|
12
|
-
|
|
13
|
-
const runtimeState = (_target$__wevu = target.__wevu) === null || _target$__wevu === void 0 ? void 0 : _target$__wevu.state;
|
|
12
|
+
const runtimeState = target.__wevu?.state;
|
|
14
13
|
if (!runtimeState || typeof runtimeState !== "object") return;
|
|
15
14
|
runtimeState[WEVU_PAGE_LAYOUT_NAME_KEY] = resolveRuntimePageLayoutName(layout);
|
|
16
|
-
const nextProps = layout === false ? {} : props
|
|
15
|
+
const nextProps = layout === false ? {} : props ?? {};
|
|
17
16
|
runtimeState[WEVU_PAGE_LAYOUT_PROPS_KEY] = nextProps;
|
|
18
17
|
syncRuntimePageLayoutState(target, layout, nextProps);
|
|
19
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.mjs","names":[],"sources":["../../../../src/runtime/features/layout.ts"],"sourcesContent":["import type { RuntimeCapabilityRegistry } from '../capabilities'\nimport type { InternalRuntimeState } from '../types'\nimport {\n WEVU_LAYOUT_HOST_BRIDGE_KEY,\n WEVU_PAGE_LAYOUT_NAME_KEY,\n WEVU_PAGE_LAYOUT_PROPS_KEY,\n WEVU_PAGE_LAYOUT_SETTER_KEY,\n} from '@weapp-core/constants'\nimport { registerRuntimeCapability } from '../capabilities'\nimport { registerRuntimeLayoutHosts, unregisterRuntimeLayoutHosts } from '../layoutBridge'\nimport { resolveRuntimePageLayoutName, syncRuntimePageLayoutState } from '../pageLayout'\nimport { runTeardownSteps } from '../teardown'\nimport { installTemplateRefs } from './templateRefs'\n\nconst layoutHooks: NonNullable<RuntimeCapabilityRegistry['layout']> = {\n attachPageSetter(target) {\n target[WEVU_PAGE_LAYOUT_SETTER_KEY] = (layout: string | false, props?: object) => {\n const runtimeState = target.__wevu?.state as Record<string, unknown> | undefined\n if (!runtimeState || typeof runtimeState !== 'object') {\n return\n }\n runtimeState[WEVU_PAGE_LAYOUT_NAME_KEY] = resolveRuntimePageLayoutName(layout)\n const nextProps = layout === false ? {} : (props ?? {})\n runtimeState[WEVU_PAGE_LAYOUT_PROPS_KEY] = nextProps\n syncRuntimePageLayoutState(target as InternalRuntimeState & Record<string, unknown>, layout, nextProps)\n }\n },\n attachHosts(bindings, target) {\n if (!bindings.length || target[WEVU_LAYOUT_HOST_BRIDGE_KEY]) {\n return\n }\n const bridge = registerRuntimeLayoutHosts(bindings, target)\n if (bridge) {\n target[WEVU_LAYOUT_HOST_BRIDGE_KEY] = bridge\n }\n },\n detachHosts(bindings, target) {\n const bridge = target[WEVU_LAYOUT_HOST_BRIDGE_KEY]\n if (!bindings.length || !bridge) {\n return\n }\n runTeardownSteps([\n () => unregisterRuntimeLayoutHosts(bindings, bridge),\n () => {\n delete target[WEVU_LAYOUT_HOST_BRIDGE_KEY]\n },\n ])\n },\n}\n\n/**\n * 安装 layout 能力,并直接安装其模板 ref 依赖。\n */\nexport function installLayout(): void {\n installTemplateRefs()\n registerRuntimeCapability('layout', layoutHooks)\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,cAAgE;CACpE,iBAAiB,QAAQ;EACvB,OAAO,gCAAgC,QAAwB,UAAmB
|
|
1
|
+
{"version":3,"file":"layout.mjs","names":[],"sources":["../../../../src/runtime/features/layout.ts"],"sourcesContent":["import type { RuntimeCapabilityRegistry } from '../capabilities'\nimport type { InternalRuntimeState } from '../types'\nimport {\n WEVU_LAYOUT_HOST_BRIDGE_KEY,\n WEVU_PAGE_LAYOUT_NAME_KEY,\n WEVU_PAGE_LAYOUT_PROPS_KEY,\n WEVU_PAGE_LAYOUT_SETTER_KEY,\n} from '@weapp-core/constants'\nimport { registerRuntimeCapability } from '../capabilities'\nimport { registerRuntimeLayoutHosts, unregisterRuntimeLayoutHosts } from '../layoutBridge'\nimport { resolveRuntimePageLayoutName, syncRuntimePageLayoutState } from '../pageLayout'\nimport { runTeardownSteps } from '../teardown'\nimport { installTemplateRefs } from './templateRefs'\n\nconst layoutHooks: NonNullable<RuntimeCapabilityRegistry['layout']> = {\n attachPageSetter(target) {\n target[WEVU_PAGE_LAYOUT_SETTER_KEY] = (layout: string | false, props?: object) => {\n const runtimeState = target.__wevu?.state as Record<string, unknown> | undefined\n if (!runtimeState || typeof runtimeState !== 'object') {\n return\n }\n runtimeState[WEVU_PAGE_LAYOUT_NAME_KEY] = resolveRuntimePageLayoutName(layout)\n const nextProps = layout === false ? {} : (props ?? {})\n runtimeState[WEVU_PAGE_LAYOUT_PROPS_KEY] = nextProps\n syncRuntimePageLayoutState(target as InternalRuntimeState & Record<string, unknown>, layout, nextProps)\n }\n },\n attachHosts(bindings, target) {\n if (!bindings.length || target[WEVU_LAYOUT_HOST_BRIDGE_KEY]) {\n return\n }\n const bridge = registerRuntimeLayoutHosts(bindings, target)\n if (bridge) {\n target[WEVU_LAYOUT_HOST_BRIDGE_KEY] = bridge\n }\n },\n detachHosts(bindings, target) {\n const bridge = target[WEVU_LAYOUT_HOST_BRIDGE_KEY]\n if (!bindings.length || !bridge) {\n return\n }\n runTeardownSteps([\n () => unregisterRuntimeLayoutHosts(bindings, bridge),\n () => {\n delete target[WEVU_LAYOUT_HOST_BRIDGE_KEY]\n },\n ])\n },\n}\n\n/**\n * 安装 layout 能力,并直接安装其模板 ref 依赖。\n */\nexport function installLayout(): void {\n installTemplateRefs()\n registerRuntimeCapability('layout', layoutHooks)\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,cAAgE;CACpE,iBAAiB,QAAQ;EACvB,OAAO,gCAAgC,QAAwB,UAAmB;GAChF,MAAM,eAAe,OAAO,QAAQ;GACpC,IAAI,CAAC,gBAAgB,OAAO,iBAAiB,UAC3C;GAEF,aAAa,6BAA6B,6BAA6B,MAAM;GAC7E,MAAM,YAAY,WAAW,QAAQ,CAAC,IAAK,SAAS,CAAC;GACrD,aAAa,8BAA8B;GAC3C,2BAA2B,QAA0D,QAAQ,SAAS;EACxG;CACF;CACA,YAAY,UAAU,QAAQ;EAC5B,IAAI,CAAC,SAAS,UAAU,OAAO,8BAC7B;EAEF,MAAM,SAAS,2BAA2B,UAAU,MAAM;EAC1D,IAAI,QACF,OAAO,+BAA+B;CAE1C;CACA,YAAY,UAAU,QAAQ;EAC5B,MAAM,SAAS,OAAO;EACtB,IAAI,CAAC,SAAS,UAAU,CAAC,QACvB;EAEF,iBAAiB,OACT,6BAA6B,UAAU,MAAM,SAC7C;GACJ,OAAO,OAAO;EAChB,CACF,CAAC;CACH;AACF;;;;AAKA,SAAgB,gBAAsB;CACpC,oBAAoB;CACpB,0BAA0B,UAAU,WAAW;AACjD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PageLayoutState, WevuPageLayoutMap, resolveRuntimePageLayoutName as resolveRuntimePageLayoutName$1, syncRuntimePageLayoutState as syncRuntimePageLayoutState$1, syncRuntimePageLayoutStateFromRuntime as syncRuntimePageLayoutStateFromRuntime$1, usePageLayout as usePageLayout$1 } from "../pageLayout.mjs";
|
|
2
|
+
import { LayoutHostBinding } from "../capabilities.mjs";
|
|
3
|
+
import { LayoutBridgeInstance, registerPageLayoutBridge as registerPageLayoutBridge$1, registerRuntimeLayoutHosts as registerRuntimeLayoutHosts$1, resolveLayoutBridge as resolveLayoutBridge$1, resolveLayoutHost as resolveLayoutHost$1, unregisterPageLayoutBridge as unregisterPageLayoutBridge$1, unregisterRuntimeLayoutHosts as unregisterRuntimeLayoutHosts$1, useLayoutBridge as useLayoutBridge$1, useLayoutHosts as useLayoutHosts$1, waitForLayoutHost as waitForLayoutHost$1 } from "../layoutBridge.mjs";
|
|
4
|
+
//#region src/runtime/features/publicLayout.d.ts
|
|
5
|
+
export declare const registerPageLayoutBridge: typeof registerPageLayoutBridge$1;
|
|
6
|
+
export declare const unregisterPageLayoutBridge: typeof unregisterPageLayoutBridge$1;
|
|
7
|
+
export declare const resolveLayoutBridge: typeof resolveLayoutBridge$1;
|
|
8
|
+
export declare const resolveLayoutHost: typeof resolveLayoutHost$1;
|
|
9
|
+
export declare const waitForLayoutHost: typeof waitForLayoutHost$1;
|
|
10
|
+
export declare const useLayoutBridge: typeof useLayoutBridge$1;
|
|
11
|
+
export declare const registerRuntimeLayoutHosts: typeof registerRuntimeLayoutHosts$1;
|
|
12
|
+
export declare const unregisterRuntimeLayoutHosts: typeof unregisterRuntimeLayoutHosts$1;
|
|
13
|
+
export declare const useLayoutHosts: typeof useLayoutHosts$1;
|
|
14
|
+
export declare const usePageLayout: typeof usePageLayout$1;
|
|
15
|
+
type PublicPageLayoutName = keyof WevuPageLayoutMap extends never ? string : Extract<keyof WevuPageLayoutMap, string>;
|
|
16
|
+
type PublicPageLayoutProps<Name extends string> = Name extends keyof WevuPageLayoutMap ? WevuPageLayoutMap[Name] : object;
|
|
17
|
+
export declare function setPageLayout(layout: false): void;
|
|
18
|
+
export declare function setPageLayout<Name extends PublicPageLayoutName>(layout: Name, props?: PublicPageLayoutProps<Name>): void;
|
|
19
|
+
export declare const syncRuntimePageLayoutState: typeof syncRuntimePageLayoutState$1;
|
|
20
|
+
export declare const syncRuntimePageLayoutStateFromRuntime: typeof syncRuntimePageLayoutStateFromRuntime$1;
|
|
21
|
+
export declare const resolveRuntimePageLayoutName: typeof resolveRuntimePageLayoutName$1;
|
|
22
|
+
//#endregion
|
|
23
|
+
export type { LayoutBridgeInstance, LayoutHostBinding, PageLayoutState, WevuPageLayoutMap };
|
|
24
|
+
//# sourceMappingURL=publicLayout.d.mts.map
|
|
@@ -48,15 +48,11 @@ const usePageLayout = (...args) => {
|
|
|
48
48
|
return usePageLayout$1(...args);
|
|
49
49
|
};
|
|
50
50
|
function setPageLayout(layout, props) {
|
|
51
|
-
var _getCurrentPageInstan;
|
|
52
51
|
installLayout();
|
|
53
52
|
const pages = getCurrentMiniProgramPages();
|
|
54
53
|
const currentInstance = getCurrentInstance();
|
|
55
|
-
const currentTarget = currentInstance && typeof currentInstance.route === "string" && currentInstance.route ? currentInstance :
|
|
56
|
-
if (currentTarget)
|
|
57
|
-
var _runtimeCapabilityReg;
|
|
58
|
-
(_runtimeCapabilityReg = runtimeCapabilityRegistry.layout) === null || _runtimeCapabilityReg === void 0 || _runtimeCapabilityReg.attachPageSetter(currentTarget);
|
|
59
|
-
}
|
|
54
|
+
const currentTarget = currentInstance && typeof currentInstance.route === "string" && currentInstance.route ? currentInstance : getCurrentPageInstance() ?? pages[pages.length - 1];
|
|
55
|
+
if (currentTarget) runtimeCapabilityRegistry.layout?.attachPageSetter(currentTarget);
|
|
60
56
|
if (layout === false) {
|
|
61
57
|
setPageLayout$1(false);
|
|
62
58
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publicLayout.mjs","names":["registerPageLayoutBridgeImplementation","unregisterPageLayoutBridgeImplementation","resolveLayoutBridgeImplementation","resolveLayoutHostImplementation","waitForLayoutHostImplementation","useLayoutBridgeImplementation","registerRuntimeLayoutHostsImplementation","unregisterRuntimeLayoutHostsImplementation","useLayoutHostsImplementation","usePageLayoutImplementation","syncRuntimePageLayoutStateImplementation","syncRuntimePageLayoutStateFromRuntimeImplementation","resolveRuntimePageLayoutNameImplementation"],"sources":["../../../../src/runtime/features/publicLayout.ts"],"sourcesContent":["import type { WevuPageLayoutMap } from '../pageLayout'\nimport type { InternalRuntimeState } from '../types'\nimport { runtimeCapabilityRegistry } from '../capabilities'\nimport { getCurrentInstance } from '../hooks'\nimport {\n registerPageLayoutBridge as registerPageLayoutBridgeImplementation,\n registerRuntimeLayoutHosts as registerRuntimeLayoutHostsImplementation,\n resolveLayoutBridge as resolveLayoutBridgeImplementation,\n resolveLayoutHost as resolveLayoutHostImplementation,\n unregisterPageLayoutBridge as unregisterPageLayoutBridgeImplementation,\n unregisterRuntimeLayoutHosts as unregisterRuntimeLayoutHostsImplementation,\n useLayoutBridge as useLayoutBridgeImplementation,\n useLayoutHosts as useLayoutHostsImplementation,\n waitForLayoutHost as waitForLayoutHostImplementation,\n} from '../layoutBridge'\nimport {\n resolveRuntimePageLayoutName as resolveRuntimePageLayoutNameImplementation,\n setPageLayout as setPageLayoutImplementation,\n syncRuntimePageLayoutStateFromRuntime as syncRuntimePageLayoutStateFromRuntimeImplementation,\n syncRuntimePageLayoutState as syncRuntimePageLayoutStateImplementation,\n usePageLayout as usePageLayoutImplementation,\n} from '../pageLayout'\nimport { getCurrentMiniProgramPages } from '../platform'\nimport { getCurrentPageInstance } from '../register/component/lifecycle/platform'\nimport { installLayout } from './layout'\n\nexport type { LayoutBridgeInstance, LayoutHostBinding } from '../layoutBridge'\nexport type { PageLayoutState, WevuPageLayoutMap } from '../pageLayout'\n\nexport const registerPageLayoutBridge: typeof registerPageLayoutBridgeImplementation = (...args) => {\n installLayout()\n return registerPageLayoutBridgeImplementation(...args)\n}\n\nexport const unregisterPageLayoutBridge: typeof unregisterPageLayoutBridgeImplementation = (...args) => {\n installLayout()\n return unregisterPageLayoutBridgeImplementation(...args)\n}\n\nexport const resolveLayoutBridge: typeof resolveLayoutBridgeImplementation = (...args) => {\n installLayout()\n return resolveLayoutBridgeImplementation(...args)\n}\n\nexport const resolveLayoutHost: typeof resolveLayoutHostImplementation = (...args) => {\n installLayout()\n return resolveLayoutHostImplementation(...args)\n}\n\nexport const waitForLayoutHost: typeof waitForLayoutHostImplementation = (...args) => {\n installLayout()\n return waitForLayoutHostImplementation(...args)\n}\n\nexport const useLayoutBridge: typeof useLayoutBridgeImplementation = (...args) => {\n installLayout()\n return useLayoutBridgeImplementation(...args)\n}\n\nexport const registerRuntimeLayoutHosts: typeof registerRuntimeLayoutHostsImplementation = (...args) => {\n installLayout()\n return registerRuntimeLayoutHostsImplementation(...args)\n}\n\nexport const unregisterRuntimeLayoutHosts: typeof unregisterRuntimeLayoutHostsImplementation = (...args) => {\n installLayout()\n return unregisterRuntimeLayoutHostsImplementation(...args)\n}\n\nexport const useLayoutHosts: typeof useLayoutHostsImplementation = (...args) => {\n installLayout()\n return useLayoutHostsImplementation(...args)\n}\n\nexport const usePageLayout: typeof usePageLayoutImplementation = (...args) => {\n installLayout()\n return usePageLayoutImplementation(...args)\n}\n\ntype PublicPageLayoutName = keyof WevuPageLayoutMap extends never\n ? string\n : Extract<keyof WevuPageLayoutMap, string>\ntype PublicPageLayoutProps<Name extends string> = Name extends keyof WevuPageLayoutMap\n ? WevuPageLayoutMap[Name]\n : object\n\nexport function setPageLayout(layout: false): void\nexport function setPageLayout<Name extends PublicPageLayoutName>(\n layout: Name,\n props?: PublicPageLayoutProps<Name>,\n): void\nexport function setPageLayout(layout: string | false, props?: object): void {\n installLayout()\n const pages = getCurrentMiniProgramPages()\n const currentInstance = getCurrentInstance()\n const currentTarget = currentInstance && typeof currentInstance.route === 'string' && currentInstance.route\n ? currentInstance\n : getCurrentPageInstance() ?? pages[pages.length - 1]\n if (currentTarget) {\n runtimeCapabilityRegistry.layout?.attachPageSetter(currentTarget as InternalRuntimeState)\n }\n if (layout === false) {\n setPageLayoutImplementation(false)\n return\n }\n setPageLayoutImplementation(layout, props)\n}\n\nexport const syncRuntimePageLayoutState: typeof syncRuntimePageLayoutStateImplementation = (...args) => {\n installLayout()\n return syncRuntimePageLayoutStateImplementation(...args)\n}\n\nexport const syncRuntimePageLayoutStateFromRuntime: typeof syncRuntimePageLayoutStateFromRuntimeImplementation = (...args) => {\n installLayout()\n return syncRuntimePageLayoutStateFromRuntimeImplementation(...args)\n}\n\nexport const resolveRuntimePageLayoutName: typeof resolveRuntimePageLayoutNameImplementation = (...args) => {\n installLayout()\n return resolveRuntimePageLayoutNameImplementation(...args)\n}\n"],"mappings":";;;;;;;;;AA6BA,MAAa,4BAA2E,GAAG,SAAS;CAClG,cAAc;CACd,OAAOA,2BAAuC,GAAG,IAAI;AACvD;AAEA,MAAa,8BAA+E,GAAG,SAAS;CACtG,cAAc;CACd,OAAOC,6BAAyC,GAAG,IAAI;AACzD;AAEA,MAAa,uBAAiE,GAAG,SAAS;CACxF,cAAc;CACd,OAAOC,sBAAkC,GAAG,IAAI;AAClD;AAEA,MAAa,qBAA6D,GAAG,SAAS;CACpF,cAAc;CACd,OAAOC,oBAAgC,GAAG,IAAI;AAChD;AAEA,MAAa,qBAA6D,GAAG,SAAS;CACpF,cAAc;CACd,OAAOC,oBAAgC,GAAG,IAAI;AAChD;AAEA,MAAa,mBAAyD,GAAG,SAAS;CAChF,cAAc;CACd,OAAOC,kBAA8B,GAAG,IAAI;AAC9C;AAEA,MAAa,8BAA+E,GAAG,SAAS;CACtG,cAAc;CACd,OAAOC,6BAAyC,GAAG,IAAI;AACzD;AAEA,MAAa,gCAAmF,GAAG,SAAS;CAC1G,cAAc;CACd,OAAOC,+BAA2C,GAAG,IAAI;AAC3D;AAEA,MAAa,kBAAuD,GAAG,SAAS;CAC9E,cAAc;CACd,OAAOC,iBAA6B,GAAG,IAAI;AAC7C;AAEA,MAAa,iBAAqD,GAAG,SAAS;CAC5E,cAAc;CACd,OAAOC,gBAA4B,GAAG,IAAI;AAC5C;AAcA,SAAgB,cAAc,QAAwB,OAAsB
|
|
1
|
+
{"version":3,"file":"publicLayout.mjs","names":["registerPageLayoutBridgeImplementation","unregisterPageLayoutBridgeImplementation","resolveLayoutBridgeImplementation","resolveLayoutHostImplementation","waitForLayoutHostImplementation","useLayoutBridgeImplementation","registerRuntimeLayoutHostsImplementation","unregisterRuntimeLayoutHostsImplementation","useLayoutHostsImplementation","usePageLayoutImplementation","syncRuntimePageLayoutStateImplementation","syncRuntimePageLayoutStateFromRuntimeImplementation","resolveRuntimePageLayoutNameImplementation"],"sources":["../../../../src/runtime/features/publicLayout.ts"],"sourcesContent":["import type { WevuPageLayoutMap } from '../pageLayout'\nimport type { InternalRuntimeState } from '../types'\nimport { runtimeCapabilityRegistry } from '../capabilities'\nimport { getCurrentInstance } from '../hooks'\nimport {\n registerPageLayoutBridge as registerPageLayoutBridgeImplementation,\n registerRuntimeLayoutHosts as registerRuntimeLayoutHostsImplementation,\n resolveLayoutBridge as resolveLayoutBridgeImplementation,\n resolveLayoutHost as resolveLayoutHostImplementation,\n unregisterPageLayoutBridge as unregisterPageLayoutBridgeImplementation,\n unregisterRuntimeLayoutHosts as unregisterRuntimeLayoutHostsImplementation,\n useLayoutBridge as useLayoutBridgeImplementation,\n useLayoutHosts as useLayoutHostsImplementation,\n waitForLayoutHost as waitForLayoutHostImplementation,\n} from '../layoutBridge'\nimport {\n resolveRuntimePageLayoutName as resolveRuntimePageLayoutNameImplementation,\n setPageLayout as setPageLayoutImplementation,\n syncRuntimePageLayoutStateFromRuntime as syncRuntimePageLayoutStateFromRuntimeImplementation,\n syncRuntimePageLayoutState as syncRuntimePageLayoutStateImplementation,\n usePageLayout as usePageLayoutImplementation,\n} from '../pageLayout'\nimport { getCurrentMiniProgramPages } from '../platform'\nimport { getCurrentPageInstance } from '../register/component/lifecycle/platform'\nimport { installLayout } from './layout'\n\nexport type { LayoutBridgeInstance, LayoutHostBinding } from '../layoutBridge'\nexport type { PageLayoutState, WevuPageLayoutMap } from '../pageLayout'\n\nexport const registerPageLayoutBridge: typeof registerPageLayoutBridgeImplementation = (...args) => {\n installLayout()\n return registerPageLayoutBridgeImplementation(...args)\n}\n\nexport const unregisterPageLayoutBridge: typeof unregisterPageLayoutBridgeImplementation = (...args) => {\n installLayout()\n return unregisterPageLayoutBridgeImplementation(...args)\n}\n\nexport const resolveLayoutBridge: typeof resolveLayoutBridgeImplementation = (...args) => {\n installLayout()\n return resolveLayoutBridgeImplementation(...args)\n}\n\nexport const resolveLayoutHost: typeof resolveLayoutHostImplementation = (...args) => {\n installLayout()\n return resolveLayoutHostImplementation(...args)\n}\n\nexport const waitForLayoutHost: typeof waitForLayoutHostImplementation = (...args) => {\n installLayout()\n return waitForLayoutHostImplementation(...args)\n}\n\nexport const useLayoutBridge: typeof useLayoutBridgeImplementation = (...args) => {\n installLayout()\n return useLayoutBridgeImplementation(...args)\n}\n\nexport const registerRuntimeLayoutHosts: typeof registerRuntimeLayoutHostsImplementation = (...args) => {\n installLayout()\n return registerRuntimeLayoutHostsImplementation(...args)\n}\n\nexport const unregisterRuntimeLayoutHosts: typeof unregisterRuntimeLayoutHostsImplementation = (...args) => {\n installLayout()\n return unregisterRuntimeLayoutHostsImplementation(...args)\n}\n\nexport const useLayoutHosts: typeof useLayoutHostsImplementation = (...args) => {\n installLayout()\n return useLayoutHostsImplementation(...args)\n}\n\nexport const usePageLayout: typeof usePageLayoutImplementation = (...args) => {\n installLayout()\n return usePageLayoutImplementation(...args)\n}\n\ntype PublicPageLayoutName = keyof WevuPageLayoutMap extends never\n ? string\n : Extract<keyof WevuPageLayoutMap, string>\ntype PublicPageLayoutProps<Name extends string> = Name extends keyof WevuPageLayoutMap\n ? WevuPageLayoutMap[Name]\n : object\n\nexport function setPageLayout(layout: false): void\nexport function setPageLayout<Name extends PublicPageLayoutName>(\n layout: Name,\n props?: PublicPageLayoutProps<Name>,\n): void\nexport function setPageLayout(layout: string | false, props?: object): void {\n installLayout()\n const pages = getCurrentMiniProgramPages()\n const currentInstance = getCurrentInstance()\n const currentTarget = currentInstance && typeof currentInstance.route === 'string' && currentInstance.route\n ? currentInstance\n : getCurrentPageInstance() ?? pages[pages.length - 1]\n if (currentTarget) {\n runtimeCapabilityRegistry.layout?.attachPageSetter(currentTarget as InternalRuntimeState)\n }\n if (layout === false) {\n setPageLayoutImplementation(false)\n return\n }\n setPageLayoutImplementation(layout, props)\n}\n\nexport const syncRuntimePageLayoutState: typeof syncRuntimePageLayoutStateImplementation = (...args) => {\n installLayout()\n return syncRuntimePageLayoutStateImplementation(...args)\n}\n\nexport const syncRuntimePageLayoutStateFromRuntime: typeof syncRuntimePageLayoutStateFromRuntimeImplementation = (...args) => {\n installLayout()\n return syncRuntimePageLayoutStateFromRuntimeImplementation(...args)\n}\n\nexport const resolveRuntimePageLayoutName: typeof resolveRuntimePageLayoutNameImplementation = (...args) => {\n installLayout()\n return resolveRuntimePageLayoutNameImplementation(...args)\n}\n"],"mappings":";;;;;;;;;AA6BA,MAAa,4BAA2E,GAAG,SAAS;CAClG,cAAc;CACd,OAAOA,2BAAuC,GAAG,IAAI;AACvD;AAEA,MAAa,8BAA+E,GAAG,SAAS;CACtG,cAAc;CACd,OAAOC,6BAAyC,GAAG,IAAI;AACzD;AAEA,MAAa,uBAAiE,GAAG,SAAS;CACxF,cAAc;CACd,OAAOC,sBAAkC,GAAG,IAAI;AAClD;AAEA,MAAa,qBAA6D,GAAG,SAAS;CACp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
|
+
import "../types.mjs";
|
|
3
|
+
import { InlineExpressionMap } from "../register/inline.mjs";
|
|
4
|
+
import { LayoutHostBinding, TemplateRefBinding } from "../capabilities.mjs";
|
|
5
|
+
import { WEVU_BINDING_MANIFEST_KEY, WevuRuntimeBindingManifestV1 } from "@weapp-core/constants";
|
|
6
|
+
//#region src/runtime/features/scopedSlots.d.ts
|
|
7
|
+
export interface CreateWevuScopedSlotComponentOptions {
|
|
8
|
+
computed?: ComputedDefinitions;
|
|
9
|
+
inlineMap?: InlineExpressionMap;
|
|
10
|
+
layoutHosts?: LayoutHostBinding[];
|
|
11
|
+
templateRefs?: TemplateRefBinding[];
|
|
12
|
+
[WEVU_BINDING_MANIFEST_KEY]?: WevuRuntimeBindingManifestV1;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 创建编译器生成的作用域插槽组件。
|
|
16
|
+
*/
|
|
17
|
+
export declare function createWevuScopedSlotComponent(overrides?: CreateWevuScopedSlotComponentOptions): void;
|
|
18
|
+
/**
|
|
19
|
+
* 安装作用域插槽的 owner 生命周期与组件创建能力。
|
|
20
|
+
*/
|
|
21
|
+
export declare function installScopedSlots(): void;
|
|
22
|
+
//#endregion
|
|
23
|
+
//# sourceMappingURL=scopedSlots.d.mts.map
|
|
@@ -10,10 +10,9 @@ import { WEVU_PROPS_KEY, WEVU_RUNTIME_OWNER_ID_KEY, WEVU_SCOPED_SLOT_CREATOR_KEY
|
|
|
10
10
|
//#region src/runtime/features/scopedSlots.ts
|
|
11
11
|
const scopedSlotHooks = {
|
|
12
12
|
prepareMount(target) {
|
|
13
|
-
var _target$data;
|
|
14
13
|
const existing = getScopedSlotMountState(target);
|
|
15
14
|
if (existing) return existing;
|
|
16
|
-
const initialNativeOwnerId =
|
|
15
|
+
const initialNativeOwnerId = target.data?.[WEVU_SLOT_OWNER_ID_KEY];
|
|
17
16
|
const ownerId = typeof initialNativeOwnerId === "string" && initialNativeOwnerId ? initialNativeOwnerId : allocateOwnerId();
|
|
18
17
|
const state = {
|
|
19
18
|
ownerId,
|
|
@@ -31,11 +30,10 @@ const scopedSlotHooks = {
|
|
|
31
30
|
attachOwnerSnapshot(target, runtime, state.ownerId, { deferSnapshot });
|
|
32
31
|
},
|
|
33
32
|
refresh(target, state) {
|
|
34
|
-
var _WEVU_PROPS_KEY;
|
|
35
33
|
const runtime = target.__wevu;
|
|
36
34
|
if (!runtime) return;
|
|
37
35
|
const snapshot = resolveOwnerSnapshot(runtime);
|
|
38
|
-
const propsSource =
|
|
36
|
+
const propsSource = target[WEVU_PROPS_KEY] ?? target.properties;
|
|
39
37
|
mergeOwnerSnapshotProps(snapshot, propsSource);
|
|
40
38
|
updateOwnerSnapshot(state.ownerId, snapshot, runtime.proxy, target);
|
|
41
39
|
},
|
|
@@ -43,15 +41,14 @@ const scopedSlotHooks = {
|
|
|
43
41
|
if (!state.shouldFlushNativeOwnerId) return;
|
|
44
42
|
try {
|
|
45
43
|
if (target.data && typeof target.data === "object") target.data[WEVU_SLOT_OWNER_ID_KEY] = state.ownerId;
|
|
46
|
-
} catch
|
|
44
|
+
} catch {}
|
|
47
45
|
const setData = resolveNativeSetData(target);
|
|
48
46
|
if (setData) callNativeSetData(target, setData, { [WEVU_SLOT_OWNER_ID_KEY]: state.ownerId });
|
|
49
47
|
},
|
|
50
48
|
teardown(target) {
|
|
51
|
-
var _ref, _state$ownerId;
|
|
52
49
|
const state = getScopedSlotMountState(target);
|
|
53
50
|
const scopedTarget = target;
|
|
54
|
-
const ownerId =
|
|
51
|
+
const ownerId = state?.ownerId ?? scopedTarget[WEVU_RUNTIME_OWNER_ID_KEY] ?? scopedTarget[WEVU_SLOT_OWNER_ID_KEY];
|
|
55
52
|
runTeardownSteps([() => {
|
|
56
53
|
if (typeof ownerId === "string" && ownerId) removeOwner(ownerId);
|
|
57
54
|
}, () => {
|
|
@@ -59,9 +56,8 @@ const scopedSlotHooks = {
|
|
|
59
56
|
}]);
|
|
60
57
|
},
|
|
61
58
|
resolveLifecycleProxy(target) {
|
|
62
|
-
var _ref2, _ref3, _scopedTarget$WEVU_RU, _target$data2, _target$properties;
|
|
63
59
|
const scopedTarget = target;
|
|
64
|
-
const ownerId =
|
|
60
|
+
const ownerId = scopedTarget[WEVU_RUNTIME_OWNER_ID_KEY] ?? scopedTarget[WEVU_SLOT_OWNER_ID_KEY] ?? target.data?.[WEVU_SLOT_OWNER_ID_KEY] ?? target.properties?.[WEVU_SLOT_OWNER_ID_KEY];
|
|
65
61
|
return typeof ownerId === "string" && ownerId ? getOwnerProxy(ownerId) : void 0;
|
|
66
62
|
},
|
|
67
63
|
allocateOwnerId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scopedSlots.mjs","names":[],"sources":["../../../../src/runtime/features/scopedSlots.ts"],"sourcesContent":["import type { WEVU_BINDING_MANIFEST_KEY, WevuRuntimeBindingManifestV1 } from '@weapp-core/constants'\nimport type {\n LayoutHostBinding,\n RuntimeCapabilityRegistry,\n ScopedSlotMountState,\n TemplateRefBinding,\n} from '../capabilities'\nimport type { InlineExpressionMap } from '../register/inline'\nimport type { ComputedDefinitions, InternalRuntimeState } from '../types'\nimport {\n WEVU_PROPS_KEY,\n WEVU_RUNTIME_OWNER_ID_KEY,\n WEVU_SCOPED_SLOT_CREATOR_KEY,\n WEVU_SLOT_OWNER_ID_KEY,\n} from '@weapp-core/constants'\nimport {\n getScopedSlotMountState,\n registerRuntimeCapability,\n requireRuntimeCapability,\n RUNTIME_SCOPED_SLOT_STATE_KEY,\n} from '../capabilities'\nimport { createWevuComponent } from '../define'\nimport { createScopedSlotOptions } from '../define/scopedSlotOptions'\nimport { getScopedSlotHostGlobalObject } from '../platform'\nimport { callNativeSetData, resolveNativeSetData } from '../register/runtimeInstance/utils'\nimport {\n allocateOwnerId,\n attachOwnerSnapshot,\n getOwnerProxy,\n mergeOwnerSnapshotProps,\n removeOwner,\n resolveOwnerSnapshot,\n updateOwnerSnapshot,\n} from '../scopedSlots'\nimport { runTeardownSteps } from '../teardown'\n\nexport interface CreateWevuScopedSlotComponentOptions {\n computed?: ComputedDefinitions\n inlineMap?: InlineExpressionMap\n layoutHosts?: LayoutHostBinding[]\n templateRefs?: TemplateRefBinding[]\n [WEVU_BINDING_MANIFEST_KEY]?: WevuRuntimeBindingManifestV1\n}\n\ntype RuntimeTargetWithScopedSlotState = InternalRuntimeState & {\n [RUNTIME_SCOPED_SLOT_STATE_KEY]?: ScopedSlotMountState\n [WEVU_PROPS_KEY]?: unknown\n [WEVU_RUNTIME_OWNER_ID_KEY]?: unknown\n [WEVU_SLOT_OWNER_ID_KEY]?: unknown\n}\n\nconst scopedSlotHooks: NonNullable<RuntimeCapabilityRegistry['scopedSlots']> = {\n prepareMount(target: InternalRuntimeState) {\n const existing = getScopedSlotMountState(target)\n if (existing) {\n return existing\n }\n const initialNativeOwnerId = target.data?.[WEVU_SLOT_OWNER_ID_KEY]\n const ownerId = typeof initialNativeOwnerId === 'string' && initialNativeOwnerId\n ? initialNativeOwnerId\n : allocateOwnerId()\n const state: ScopedSlotMountState = {\n ownerId,\n shouldFlushNativeOwnerId: typeof initialNativeOwnerId === 'string' && initialNativeOwnerId !== ownerId,\n }\n Object.defineProperty(target, RUNTIME_SCOPED_SLOT_STATE_KEY, {\n value: state,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n return state\n },\n attachMount(target, runtime, state, deferSnapshot) {\n attachOwnerSnapshot(target, runtime, state.ownerId, { deferSnapshot })\n },\n refresh(target: InternalRuntimeState, state: ScopedSlotMountState) {\n const runtime = target.__wevu\n if (!runtime) {\n return\n }\n const snapshot = resolveOwnerSnapshot(runtime)\n const propsSource = (target as RuntimeTargetWithScopedSlotState)[WEVU_PROPS_KEY] ?? target.properties\n mergeOwnerSnapshotProps(snapshot, propsSource)\n updateOwnerSnapshot(state.ownerId, snapshot, runtime.proxy, target)\n },\n syncNativeOwnerId(target: InternalRuntimeState, state: ScopedSlotMountState) {\n if (!state.shouldFlushNativeOwnerId) {\n return\n }\n try {\n if (target.data && typeof target.data === 'object') {\n target.data[WEVU_SLOT_OWNER_ID_KEY] = state.ownerId\n }\n }\n catch {\n // 忽略直接写入失败,后续 setData 仍会尝试同步。\n }\n const setData = resolveNativeSetData(target)\n if (setData) {\n callNativeSetData(target, setData, { [WEVU_SLOT_OWNER_ID_KEY]: state.ownerId })\n }\n },\n teardown(target: InternalRuntimeState) {\n const state = getScopedSlotMountState(target)\n const scopedTarget = target as RuntimeTargetWithScopedSlotState\n const ownerId = state?.ownerId\n ?? scopedTarget[WEVU_RUNTIME_OWNER_ID_KEY]\n ?? scopedTarget[WEVU_SLOT_OWNER_ID_KEY]\n runTeardownSteps([\n () => {\n if (typeof ownerId === 'string' && ownerId) {\n removeOwner(ownerId)\n }\n },\n () => {\n delete scopedTarget[RUNTIME_SCOPED_SLOT_STATE_KEY]\n },\n ])\n },\n resolveLifecycleProxy(target: InternalRuntimeState) {\n const scopedTarget = target as RuntimeTargetWithScopedSlotState\n const ownerId = scopedTarget[WEVU_RUNTIME_OWNER_ID_KEY]\n ?? scopedTarget[WEVU_SLOT_OWNER_ID_KEY]\n ?? target.data?.[WEVU_SLOT_OWNER_ID_KEY]\n ?? target.properties?.[WEVU_SLOT_OWNER_ID_KEY]\n return typeof ownerId === 'string' && ownerId ? getOwnerProxy(ownerId) : undefined\n },\n allocateOwnerId,\n}\n\n/**\n * 创建编译器生成的作用域插槽组件。\n */\nexport function createWevuScopedSlotComponent(\n overrides?: CreateWevuScopedSlotComponentOptions,\n): void {\n requireRuntimeCapability('scopedSlots', 'createWevuScopedSlotComponent')\n const baseOptions = createScopedSlotOptions(overrides)\n // 作用域插槽选项由内部工厂完整构造,动态常量键会丢失静态索引信息。\n const componentOptions = baseOptions as unknown as Parameters<typeof createWevuComponent>[0]\n createWevuComponent(componentOptions)\n}\n/**\n * 安装作用域插槽的 owner 生命周期与组件创建能力。\n */\nexport function installScopedSlots(): void {\n registerRuntimeCapability('scopedSlots', scopedSlotHooks)\n const globalObject = getScopedSlotHostGlobalObject()\n if (globalObject && globalObject[WEVU_SCOPED_SLOT_CREATOR_KEY] !== createWevuScopedSlotComponent) {\n globalObject[WEVU_SCOPED_SLOT_CREATOR_KEY] = createWevuScopedSlotComponent\n }\n}\n"],"mappings":";;;;;;;;;;AAmDA,MAAM,kBAAyE;CAC7E,aAAa,QAA8B
|
|
1
|
+
{"version":3,"file":"scopedSlots.mjs","names":[],"sources":["../../../../src/runtime/features/scopedSlots.ts"],"sourcesContent":["import type { WEVU_BINDING_MANIFEST_KEY, WevuRuntimeBindingManifestV1 } from '@weapp-core/constants'\nimport type {\n LayoutHostBinding,\n RuntimeCapabilityRegistry,\n ScopedSlotMountState,\n TemplateRefBinding,\n} from '../capabilities'\nimport type { InlineExpressionMap } from '../register/inline'\nimport type { ComputedDefinitions, InternalRuntimeState } from '../types'\nimport {\n WEVU_PROPS_KEY,\n WEVU_RUNTIME_OWNER_ID_KEY,\n WEVU_SCOPED_SLOT_CREATOR_KEY,\n WEVU_SLOT_OWNER_ID_KEY,\n} from '@weapp-core/constants'\nimport {\n getScopedSlotMountState,\n registerRuntimeCapability,\n requireRuntimeCapability,\n RUNTIME_SCOPED_SLOT_STATE_KEY,\n} from '../capabilities'\nimport { createWevuComponent } from '../define'\nimport { createScopedSlotOptions } from '../define/scopedSlotOptions'\nimport { getScopedSlotHostGlobalObject } from '../platform'\nimport { callNativeSetData, resolveNativeSetData } from '../register/runtimeInstance/utils'\nimport {\n allocateOwnerId,\n attachOwnerSnapshot,\n getOwnerProxy,\n mergeOwnerSnapshotProps,\n removeOwner,\n resolveOwnerSnapshot,\n updateOwnerSnapshot,\n} from '../scopedSlots'\nimport { runTeardownSteps } from '../teardown'\n\nexport interface CreateWevuScopedSlotComponentOptions {\n computed?: ComputedDefinitions\n inlineMap?: InlineExpressionMap\n layoutHosts?: LayoutHostBinding[]\n templateRefs?: TemplateRefBinding[]\n [WEVU_BINDING_MANIFEST_KEY]?: WevuRuntimeBindingManifestV1\n}\n\ntype RuntimeTargetWithScopedSlotState = InternalRuntimeState & {\n [RUNTIME_SCOPED_SLOT_STATE_KEY]?: ScopedSlotMountState\n [WEVU_PROPS_KEY]?: unknown\n [WEVU_RUNTIME_OWNER_ID_KEY]?: unknown\n [WEVU_SLOT_OWNER_ID_KEY]?: unknown\n}\n\nconst scopedSlotHooks: NonNullable<RuntimeCapabilityRegistry['scopedSlots']> = {\n prepareMount(target: InternalRuntimeState) {\n const existing = getScopedSlotMountState(target)\n if (existing) {\n return existing\n }\n const initialNativeOwnerId = target.data?.[WEVU_SLOT_OWNER_ID_KEY]\n const ownerId = typeof initialNativeOwnerId === 'string' && initialNativeOwnerId\n ? initialNativeOwnerId\n : allocateOwnerId()\n const state: ScopedSlotMountState = {\n ownerId,\n shouldFlushNativeOwnerId: typeof initialNativeOwnerId === 'string' && initialNativeOwnerId !== ownerId,\n }\n Object.defineProperty(target, RUNTIME_SCOPED_SLOT_STATE_KEY, {\n value: state,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n return state\n },\n attachMount(target, runtime, state, deferSnapshot) {\n attachOwnerSnapshot(target, runtime, state.ownerId, { deferSnapshot })\n },\n refresh(target: InternalRuntimeState, state: ScopedSlotMountState) {\n const runtime = target.__wevu\n if (!runtime) {\n return\n }\n const snapshot = resolveOwnerSnapshot(runtime)\n const propsSource = (target as RuntimeTargetWithScopedSlotState)[WEVU_PROPS_KEY] ?? target.properties\n mergeOwnerSnapshotProps(snapshot, propsSource)\n updateOwnerSnapshot(state.ownerId, snapshot, runtime.proxy, target)\n },\n syncNativeOwnerId(target: InternalRuntimeState, state: ScopedSlotMountState) {\n if (!state.shouldFlushNativeOwnerId) {\n return\n }\n try {\n if (target.data && typeof target.data === 'object') {\n target.data[WEVU_SLOT_OWNER_ID_KEY] = state.ownerId\n }\n }\n catch {\n // 忽略直接写入失败,后续 setData 仍会尝试同步。\n }\n const setData = resolveNativeSetData(target)\n if (setData) {\n callNativeSetData(target, setData, { [WEVU_SLOT_OWNER_ID_KEY]: state.ownerId })\n }\n },\n teardown(target: InternalRuntimeState) {\n const state = getScopedSlotMountState(target)\n const scopedTarget = target as RuntimeTargetWithScopedSlotState\n const ownerId = state?.ownerId\n ?? scopedTarget[WEVU_RUNTIME_OWNER_ID_KEY]\n ?? scopedTarget[WEVU_SLOT_OWNER_ID_KEY]\n runTeardownSteps([\n () => {\n if (typeof ownerId === 'string' && ownerId) {\n removeOwner(ownerId)\n }\n },\n () => {\n delete scopedTarget[RUNTIME_SCOPED_SLOT_STATE_KEY]\n },\n ])\n },\n resolveLifecycleProxy(target: InternalRuntimeState) {\n const scopedTarget = target as RuntimeTargetWithScopedSlotState\n const ownerId = scopedTarget[WEVU_RUNTIME_OWNER_ID_KEY]\n ?? scopedTarget[WEVU_SLOT_OWNER_ID_KEY]\n ?? target.data?.[WEVU_SLOT_OWNER_ID_KEY]\n ?? target.properties?.[WEVU_SLOT_OWNER_ID_KEY]\n return typeof ownerId === 'string' && ownerId ? getOwnerProxy(ownerId) : undefined\n },\n allocateOwnerId,\n}\n\n/**\n * 创建编译器生成的作用域插槽组件。\n */\nexport function createWevuScopedSlotComponent(\n overrides?: CreateWevuScopedSlotComponentOptions,\n): void {\n requireRuntimeCapability('scopedSlots', 'createWevuScopedSlotComponent')\n const baseOptions = createScopedSlotOptions(overrides)\n // 作用域插槽选项由内部工厂完整构造,动态常量键会丢失静态索引信息。\n const componentOptions = baseOptions as unknown as Parameters<typeof createWevuComponent>[0]\n createWevuComponent(componentOptions)\n}\n/**\n * 安装作用域插槽的 owner 生命周期与组件创建能力。\n */\nexport function installScopedSlots(): void {\n registerRuntimeCapability('scopedSlots', scopedSlotHooks)\n const globalObject = getScopedSlotHostGlobalObject()\n if (globalObject && globalObject[WEVU_SCOPED_SLOT_CREATOR_KEY] !== createWevuScopedSlotComponent) {\n globalObject[WEVU_SCOPED_SLOT_CREATOR_KEY] = createWevuScopedSlotComponent\n }\n}\n"],"mappings":";;;;;;;;;;AAmDA,MAAM,kBAAyE;CAC7E,aAAa,QAA8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U,aAAa,8BACxB,aAAa,2BACb,OAAO,OAAO,2BACd,OAAO,aAAa;EACzB,OAAO,OAAO,YAAY,YAAY,UAAU,cAAc,OAAO,IAAI;CAC3E;CACA;AACF;;;;AAKA,SAAgB,8BACd,WACM;CACN,yBAAyB,eAAe,+BAA+B;CAGvE,MAAM,mBAFc,wBAAwB,SAET;CACnC,oBAAoB,gBAAgB;AACtC;;;;AAIA,SAAgB,qBAA2B;CACzC,0BAA0B,eAAe,eAAe;CACxD,MAAM,eAAe,8BAA8B;CACnD,IAAI,gBAAgB,aAAa,kCAAkC,+BACjE,aAAa,gCAAgC;AAEjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templateRefs.mjs","names":[],"sources":["../../../../src/runtime/features/templateRefs.ts"],"sourcesContent":["import type { RuntimeCapabilityRegistry, TemplateRefBinding } from '../capabilities'\nimport type { InternalRuntimeState } from '../types'\nimport { WEVU_TEMPLATE_REFS_KEY } from '@weapp-core/constants'\nimport { registerRuntimeCapability } from '../capabilities'\nimport { clearTemplateRefs, scheduleTemplateRefUpdate } from '../templateRefs'\n\nconst templateRefHooks: NonNullable<RuntimeCapabilityRegistry['templateRefs']> = {\n attachBindings(target: InternalRuntimeState, bindings: readonly TemplateRefBinding[]) {\n Object.defineProperty(target, WEVU_TEMPLATE_REFS_KEY, {\n value: bindings,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n },\n hasBindings(target: InternalRuntimeState) {\n const bindings = target[WEVU_TEMPLATE_REFS_KEY]\n return Array.isArray(bindings) && bindings.length > 0\n },\n schedule: scheduleTemplateRefUpdate,\n scheduleOwner(target: InternalRuntimeState) {\n const selectOwnerComponent = target.selectOwnerComponent\n if (typeof selectOwnerComponent !== 'function') {\n return\n }\n try {\n const owner = selectOwnerComponent.call(target) as InternalRuntimeState | null | undefined\n if (owner && owner !== target) {\n scheduleTemplateRefUpdate(owner)\n }\n }\n catch {\n // 宿主不支持 owner 查询时保持当前组件生命周期正常执行。\n }\n },\n clear: clearTemplateRefs,\n}\n\n/**\n * 安装模板 ref 能力。\n */\nexport function installTemplateRefs(): void {\n registerRuntimeCapability('templateRefs', templateRefHooks)\n}\n"],"mappings":";;;;;AAMA,MAAM,mBAA2E;CAC/E,eAAe,QAA8B,UAAyC;EACpF,OAAO,eAAe,QAAQ,wBAAwB;GACpD,OAAO;GACP,cAAc;GACd,YAAY;GACZ,UAAU;EACZ,CAAC;CACH;CACA,YAAY,QAA8B;EACxC,MAAM,WAAW,OAAO;EACxB,OAAO,MAAM,QAAQ,QAAQ,KAAK,SAAS,SAAS;CACtD;CACA,UAAU;CACV,cAAc,QAA8B;EAC1C,MAAM,uBAAuB,OAAO;EACpC,IAAI,OAAO,yBAAyB,YAClC;EAEF,IAAI;GACF,MAAM,QAAQ,qBAAqB,KAAK,MAAM;GAC9C,IAAI,SAAS,UAAU,QACrB,0BAA0B,KAAK;EAEnC,
|
|
1
|
+
{"version":3,"file":"templateRefs.mjs","names":[],"sources":["../../../../src/runtime/features/templateRefs.ts"],"sourcesContent":["import type { RuntimeCapabilityRegistry, TemplateRefBinding } from '../capabilities'\nimport type { InternalRuntimeState } from '../types'\nimport { WEVU_TEMPLATE_REFS_KEY } from '@weapp-core/constants'\nimport { registerRuntimeCapability } from '../capabilities'\nimport { clearTemplateRefs, scheduleTemplateRefUpdate } from '../templateRefs'\n\nconst templateRefHooks: NonNullable<RuntimeCapabilityRegistry['templateRefs']> = {\n attachBindings(target: InternalRuntimeState, bindings: readonly TemplateRefBinding[]) {\n Object.defineProperty(target, WEVU_TEMPLATE_REFS_KEY, {\n value: bindings,\n configurable: true,\n enumerable: false,\n writable: false,\n })\n },\n hasBindings(target: InternalRuntimeState) {\n const bindings = target[WEVU_TEMPLATE_REFS_KEY]\n return Array.isArray(bindings) && bindings.length > 0\n },\n schedule: scheduleTemplateRefUpdate,\n scheduleOwner(target: InternalRuntimeState) {\n const selectOwnerComponent = target.selectOwnerComponent\n if (typeof selectOwnerComponent !== 'function') {\n return\n }\n try {\n const owner = selectOwnerComponent.call(target) as InternalRuntimeState | null | undefined\n if (owner && owner !== target) {\n scheduleTemplateRefUpdate(owner)\n }\n }\n catch {\n // 宿主不支持 owner 查询时保持当前组件生命周期正常执行。\n }\n },\n clear: clearTemplateRefs,\n}\n\n/**\n * 安装模板 ref 能力。\n */\nexport function installTemplateRefs(): void {\n registerRuntimeCapability('templateRefs', templateRefHooks)\n}\n"],"mappings":";;;;;AAMA,MAAM,mBAA2E;CAC/E,eAAe,QAA8B,UAAyC;EACpF,OAAO,eAAe,QAAQ,wBAAwB;GACpD,OAAO;GACP,cAAc;GACd,YAAY;GACZ,UAAU;EACZ,CAAC;CACH;CACA,YAAY,QAA8B;EACxC,MAAM,WAAW,OAAO;EACxB,OAAO,MAAM,QAAQ,QAAQ,KAAK,SAAS,SAAS;CACtD;CACA,UAAU;CACV,cAAc,QAA8B;EAC1C,MAAM,uBAAuB,OAAO;EACpC,IAAI,OAAO,yBAAyB,YAClC;EAEF,IAAI;GACF,MAAM,QAAQ,qBAAqB,KAAK,MAAM;GAC9C,IAAI,SAAS,UAAU,QACrB,0BAA0B,KAAK;EAEnC,QACM,CAEN;CACF;CACA,OAAO;AACT;;;;AAKA,SAAgB,sBAA4B;CAC1C,0BAA0B,gBAAgB,gBAAgB;AAC5D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InternalRuntimeState } from "../types/runtime.mjs";
|
|
2
|
+
import "../types.mjs";
|
|
3
|
+
//#region src/runtime/hooks/base.d.ts
|
|
4
|
+
export declare function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* 设置当前运行时实例(框架内部使用)。
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function setCurrentInstance(inst: InternalRuntimeState | undefined): void;
|
|
10
|
+
export declare function getCurrentSetupContext<T = any>(): T | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 设置当前 setup 上下文(框架内部使用)。
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function setCurrentSetupContext(ctx: any | undefined): void;
|
|
16
|
+
/**
|
|
17
|
+
* 调用批量 hook(框架内部调度入口)。
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function callHookList(target: InternalRuntimeState, name: string, args?: any[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* 调用返回值型 hook(框架内部调度入口)。
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare function callHookReturn(target: InternalRuntimeState, name: string, args?: any[]): any;
|
|
26
|
+
//#endregion
|
|
27
|
+
//# sourceMappingURL=base.d.mts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getCurrentMiniProgramGlobalObject, getCurrentMiniProgramRuntimeCapabilities } from "../platform/current.mjs";
|
|
2
|
+
import { getMiniProgramRuntimeGlobalObject, supportsCurrentMiniProgramRuntimeCapability } from "../platform.mjs";
|
|
2
3
|
import { WEVU_CURRENT_SETUP_STATE_KEY, WEVU_HOOKS_KEY } from "@weapp-core/constants";
|
|
3
4
|
|
|
4
5
|
//#region src/runtime/hooks/base.ts
|
|
5
6
|
const currentSetupState = (() => {
|
|
6
|
-
var _host$WEVU_CURRENT_SE;
|
|
7
7
|
const host = typeof globalThis !== "undefined" ? globalThis : getMiniProgramRuntimeGlobalObject();
|
|
8
|
-
return host ?
|
|
8
|
+
return host ? host[WEVU_CURRENT_SETUP_STATE_KEY] ?? (host[WEVU_CURRENT_SETUP_STATE_KEY] = {}) : {};
|
|
9
9
|
})();
|
|
10
10
|
function getCurrentInstance() {
|
|
11
11
|
return currentSetupState.instance;
|
|
@@ -57,36 +57,30 @@ function tryShowShareMenu(showShareMenu, menus) {
|
|
|
57
57
|
if (payload === void 0) showShareMenu();
|
|
58
58
|
else showShareMenu(payload);
|
|
59
59
|
return;
|
|
60
|
-
} catch
|
|
60
|
+
} catch {}
|
|
61
61
|
}
|
|
62
62
|
function pushHook(target, name, handler, { single = false } = {}) {
|
|
63
63
|
const bucket = ensureHookBucket(target);
|
|
64
64
|
if (single) bucket[name] = handler;
|
|
65
|
-
else
|
|
66
|
-
var _bucket$name;
|
|
67
|
-
((_bucket$name = bucket[name]) !== null && _bucket$name !== void 0 ? _bucket$name : bucket[name] = []).push(handler);
|
|
68
|
-
}
|
|
65
|
+
else (bucket[name] ?? (bucket[name] = [])).push(handler);
|
|
69
66
|
}
|
|
70
67
|
function ensureSinglePageHookOnInstance(target, name) {
|
|
71
|
-
var _ref
|
|
72
|
-
const bridges = (_ref
|
|
68
|
+
var _ref;
|
|
69
|
+
const bridges = (_ref = target).__wevuShareHookBridges ?? (_ref.__wevuShareHookBridges = Object.create(null));
|
|
73
70
|
if (typeof bridges[name] === "function") return;
|
|
74
71
|
const original = target[name];
|
|
75
72
|
const bridge = function onWevuShareHookBridge(...args) {
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const entry = hooks === null || hooks === void 0 ? void 0 : hooks[name];
|
|
79
|
-
const runtime = this.__wevu;
|
|
80
|
-
const ctx = (_runtime$proxy = runtime === null || runtime === void 0 ? void 0 : runtime.proxy) !== null && _runtime$proxy !== void 0 ? _runtime$proxy : this;
|
|
73
|
+
const entry = this[WEVU_HOOKS_KEY]?.[name];
|
|
74
|
+
const ctx = this.__wevu?.proxy ?? this;
|
|
81
75
|
let ret;
|
|
82
76
|
if (typeof entry === "function") try {
|
|
83
77
|
ret = entry.apply(ctx, args);
|
|
84
|
-
} catch
|
|
78
|
+
} catch {
|
|
85
79
|
ret = void 0;
|
|
86
80
|
}
|
|
87
81
|
else if (Array.isArray(entry)) for (const fn of entry) try {
|
|
88
82
|
ret = fn.apply(ctx, args);
|
|
89
|
-
} catch
|
|
83
|
+
} catch {}
|
|
90
84
|
if (ret !== void 0) return ret;
|
|
91
85
|
if (typeof original === "function") return original.apply(this, args);
|
|
92
86
|
};
|
|
@@ -94,11 +88,10 @@ function ensureSinglePageHookOnInstance(target, name) {
|
|
|
94
88
|
target[name] = bridge;
|
|
95
89
|
}
|
|
96
90
|
function ensurePageShareMenusOnSetup(target) {
|
|
97
|
-
var _target$WEVU_HOOKS_KE;
|
|
98
91
|
if (!supportsCurrentMiniProgramRuntimeCapability("pageShareMenu")) return;
|
|
99
|
-
const miniProgramGlobal =
|
|
92
|
+
const miniProgramGlobal = getCurrentMiniProgramGlobalObject();
|
|
100
93
|
if (!miniProgramGlobal || typeof miniProgramGlobal.showShareMenu !== "function") return;
|
|
101
|
-
const hooks =
|
|
94
|
+
const hooks = target[WEVU_HOOKS_KEY] ?? {};
|
|
102
95
|
const hasShareAppMessage = typeof hooks.onShareAppMessage === "function";
|
|
103
96
|
const hasShareTimeline = typeof hooks.onShareTimeline === "function";
|
|
104
97
|
if (!hasShareAppMessage && !hasShareTimeline) return;
|
|
@@ -111,23 +104,21 @@ function ensurePageShareMenusOnSetup(target) {
|
|
|
111
104
|
* @internal
|
|
112
105
|
*/
|
|
113
106
|
function callHookList(target, name, args = []) {
|
|
114
|
-
var _runtime$proxy2;
|
|
115
107
|
const hooks = target[WEVU_HOOKS_KEY];
|
|
116
108
|
if (!hooks) return;
|
|
117
109
|
const list = hooks[name];
|
|
118
110
|
if (!list) return;
|
|
119
|
-
const
|
|
120
|
-
const ctx = (_runtime$proxy2 = runtime === null || runtime === void 0 ? void 0 : runtime.proxy) !== null && _runtime$proxy2 !== void 0 ? _runtime$proxy2 : target;
|
|
111
|
+
const ctx = target.__wevu?.proxy ?? target;
|
|
121
112
|
if (Array.isArray(list)) for (const fn of list) try {
|
|
122
113
|
fn.apply(ctx, args);
|
|
123
|
-
} catch
|
|
114
|
+
} catch {}
|
|
124
115
|
else if (typeof list === "function") try {
|
|
125
116
|
list.apply(ctx, args);
|
|
126
|
-
} catch
|
|
117
|
+
} catch {}
|
|
127
118
|
}
|
|
128
119
|
function ensurePageHookOnInstance(target, name) {
|
|
129
|
-
var _ref2
|
|
130
|
-
const bridges = (_ref2
|
|
120
|
+
var _ref2;
|
|
121
|
+
const bridges = (_ref2 = target).__wevuPageHookBridges ?? (_ref2.__wevuPageHookBridges = Object.create(null));
|
|
131
122
|
if (typeof bridges[name] === "function") return;
|
|
132
123
|
const original = target[name];
|
|
133
124
|
const bridge = function onWevuPageHookBridge(...args) {
|
|
@@ -142,23 +133,21 @@ function ensurePageHookOnInstance(target, name) {
|
|
|
142
133
|
* @internal
|
|
143
134
|
*/
|
|
144
135
|
function callHookReturn(target, name, args = []) {
|
|
145
|
-
var _runtime$proxy3;
|
|
146
136
|
const hooks = target[WEVU_HOOKS_KEY];
|
|
147
137
|
if (!hooks) return;
|
|
148
138
|
const entry = hooks[name];
|
|
149
139
|
if (!entry) return;
|
|
150
|
-
const
|
|
151
|
-
const ctx = (_runtime$proxy3 = runtime === null || runtime === void 0 ? void 0 : runtime.proxy) !== null && _runtime$proxy3 !== void 0 ? _runtime$proxy3 : target;
|
|
140
|
+
const ctx = target.__wevu?.proxy ?? target;
|
|
152
141
|
if (typeof entry === "function") try {
|
|
153
142
|
return entry.apply(ctx, args);
|
|
154
|
-
} catch
|
|
143
|
+
} catch {
|
|
155
144
|
return;
|
|
156
145
|
}
|
|
157
146
|
if (Array.isArray(entry)) {
|
|
158
147
|
let out;
|
|
159
148
|
for (const fn of entry) try {
|
|
160
149
|
out = fn.apply(ctx, args);
|
|
161
|
-
} catch
|
|
150
|
+
} catch {}
|
|
162
151
|
return out;
|
|
163
152
|
}
|
|
164
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.mjs","names":[],"sources":["../../../../src/runtime/hooks/base.ts"],"sourcesContent":["import type { InternalRuntimeState } from '../types'\nimport { WEVU_CURRENT_SETUP_STATE_KEY, WEVU_HOOKS_KEY } from '@weapp-core/constants'\nimport { getCurrentMiniProgramRuntimeCapabilities, getMiniProgramGlobalObject, getMiniProgramRuntimeGlobalObject, supportsCurrentMiniProgramRuntimeCapability } from '../platform'\n\n// 仅供同步 setup() 调用期间使用的当前实例引用。wevu 的根入口与\n// `wevu/router` 可能被打包成多个模块副本,必须通过宿主全局共享状态。\ninterface CurrentSetupState {\n instance?: InternalRuntimeState\n context?: any\n}\n\nconst currentSetupState: CurrentSetupState = (() => {\n // Web 会在模块加载后安装宿主 API;可用时优先使用稳定的执行域全局,\n // 防止不同入口因导入时机不同而持有两份 setup 状态。\n const host = typeof globalThis !== 'undefined'\n ? globalThis as Record<string, any>\n : getMiniProgramRuntimeGlobalObject()\n return host ? host[WEVU_CURRENT_SETUP_STATE_KEY] ??= {} : {}\n})()\n\nexport function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined {\n return currentSetupState.instance as T | undefined\n}\n\n/**\n * 设置当前运行时实例(框架内部使用)。\n * @internal\n */\nexport function setCurrentInstance(inst: InternalRuntimeState | undefined) {\n currentSetupState.instance = inst\n}\n\nexport function getCurrentSetupContext<T = any>(): T | undefined {\n return currentSetupState.context as T | undefined\n}\n\n/**\n * 设置当前 setup 上下文(框架内部使用)。\n * @internal\n */\nexport function setCurrentSetupContext(ctx: any | undefined) {\n currentSetupState.context = ctx\n}\n\nexport function assertInSetup(name: string): InternalRuntimeState {\n if (!currentSetupState.instance) {\n throw new Error(`${name}() 必须在 setup() 的同步阶段调用`)\n }\n return currentSetupState.instance\n}\n\nfunction ensureHookBucket(target: InternalRuntimeState): Record<string, any> {\n if (!target[WEVU_HOOKS_KEY]) {\n target[WEVU_HOOKS_KEY] = Object.create(null)\n }\n return target[WEVU_HOOKS_KEY] as Record<string, any>\n}\n\ntype ShareMenuName = 'shareAppMessage' | 'shareTimeline'\n\nfunction buildShareMenus(\n enableOnShareAppMessage: boolean,\n enableOnShareTimeline: boolean,\n): ShareMenuName[] {\n const runtimeCapabilities = getCurrentMiniProgramRuntimeCapabilities()\n const shouldShowShareAppMessage = runtimeCapabilities.shareTimelineRequiresShareAppMessage\n ? (enableOnShareAppMessage || enableOnShareTimeline)\n : enableOnShareAppMessage\n\n const menus: ShareMenuName[] = []\n if (shouldShowShareAppMessage) {\n menus.push('shareAppMessage')\n }\n if (enableOnShareTimeline) {\n menus.push('shareTimeline')\n }\n return menus\n}\n\nfunction tryShowShareMenu(showShareMenu: (...args: any[]) => unknown, menus: ShareMenuName[]) {\n const payloads = [\n { withShareTicket: true, menus },\n { menus },\n menus.includes('shareTimeline') ? { withShareTicket: true } : undefined,\n menus.includes('shareTimeline') ? {} : undefined,\n undefined,\n ]\n\n for (const payload of payloads) {\n try {\n if (payload === undefined) {\n showShareMenu()\n }\n else {\n showShareMenu(payload as any)\n }\n return\n }\n catch {\n // 继续尝试更保守的 payload,兼容不同宿主的 showShareMenu 参数形态。\n }\n }\n}\n\nexport function pushHook(\n target: InternalRuntimeState,\n name: string,\n handler: (...args: any[]) => any,\n { single = false } = {},\n) {\n const bucket = ensureHookBucket(target)\n if (single) {\n bucket[name] = handler\n }\n else {\n const list: Array<(...args: any[]) => any> = bucket[name] ?? (bucket[name] = [])\n list.push(handler)\n }\n}\n\nexport function ensureSinglePageHookOnInstance(target: InternalRuntimeState, name: 'onShareAppMessage' | 'onShareTimeline' | 'onAddToFavorites') {\n const bridges = ((target as any).__wevuShareHookBridges ??= Object.create(null)) as Record<string, (...args: any[]) => any>\n if (typeof bridges[name] === 'function') {\n return\n }\n\n const original = (target as any)[name]\n const bridge = function onWevuShareHookBridge(this: InternalRuntimeState, ...args: any[]) {\n const hooks = this[WEVU_HOOKS_KEY] as Record<string, any> | undefined\n const entry = hooks?.[name]\n const runtime = this.__wevu\n const ctx = runtime?.proxy ?? this\n let ret: any\n\n if (typeof entry === 'function') {\n try {\n ret = entry.apply(ctx, args)\n }\n catch {\n ret = undefined\n }\n }\n else if (Array.isArray(entry)) {\n for (const fn of entry) {\n try {\n ret = fn.apply(ctx, args)\n }\n catch {\n // 忽略单个 hook 抛出的异常,继续执行后续 hook\n }\n }\n }\n\n if (ret !== undefined) {\n return ret\n }\n if (typeof original === 'function') {\n return original.apply(this, args)\n }\n return undefined\n }\n\n bridges[name] = bridge\n ;(target as any)[name] = bridge\n}\n\nexport function ensurePageShareMenusOnSetup(target: InternalRuntimeState) {\n if (!supportsCurrentMiniProgramRuntimeCapability('pageShareMenu')) {\n return\n }\n const miniProgramGlobal = getMiniProgramGlobalObject()\n if (!miniProgramGlobal || typeof miniProgramGlobal.showShareMenu !== 'function') {\n return\n }\n\n const hooks = (target[WEVU_HOOKS_KEY] ?? {}) as Record<string, any>\n const hasShareAppMessage = typeof hooks.onShareAppMessage === 'function'\n const hasShareTimeline = typeof hooks.onShareTimeline === 'function'\n\n if (!hasShareAppMessage && !hasShareTimeline) {\n return\n }\n\n const menus = buildShareMenus(hasShareAppMessage, hasShareTimeline)\n if (!menus.length) {\n return\n }\n\n tryShowShareMenu(miniProgramGlobal.showShareMenu.bind(miniProgramGlobal), menus)\n}\n\n/**\n * 调用批量 hook(框架内部调度入口)。\n * @internal\n */\nexport function callHookList(target: InternalRuntimeState, name: string, args: any[] = []) {\n const hooks = target[WEVU_HOOKS_KEY]\n if (!hooks) {\n return\n }\n const list = hooks[name]\n if (!list) {\n return\n }\n const runtime = target.__wevu\n const ctx = runtime?.proxy ?? target\n if (Array.isArray(list)) {\n for (const fn of list) {\n try {\n fn.apply(ctx, args)\n }\n catch {\n // 忽略单个 hook 抛出的异常,防止阻塞其他监听\n }\n }\n }\n else if (typeof list === 'function') {\n try {\n list.apply(ctx, args)\n }\n catch {\n // 忽略单个 hook 抛出的异常,防止阻塞其他监听\n }\n }\n}\n\nexport function ensurePageHookOnInstance(target: InternalRuntimeState, name: 'onPageScroll') {\n const bridges = ((target as any).__wevuPageHookBridges ??= Object.create(null)) as Record<string, (...args: any[]) => any>\n if (typeof bridges[name] === 'function') {\n return\n }\n\n const original = (target as any)[name]\n const bridge = function onWevuPageHookBridge(this: InternalRuntimeState, ...args: any[]) {\n callHookList(this, name, args)\n if (typeof original === 'function') {\n return original.apply(this, args)\n }\n return undefined\n }\n\n bridges[name] = bridge\n ;(target as any)[name] = bridge\n}\n\n/**\n * 调用返回值型 hook(框架内部调度入口)。\n * @internal\n */\nexport function callHookReturn(target: InternalRuntimeState, name: string, args: any[] = []) {\n const hooks = target[WEVU_HOOKS_KEY]\n if (!hooks) {\n return undefined\n }\n const entry = hooks[name]\n if (!entry) {\n return undefined\n }\n const runtime = target.__wevu\n const ctx = runtime?.proxy ?? target\n if (typeof entry === 'function') {\n try {\n return entry.apply(ctx, args)\n }\n catch {\n return undefined\n }\n }\n if (Array.isArray(entry)) {\n let out: any\n for (const fn of entry) {\n try {\n out = fn.apply(ctx, args)\n }\n catch {\n // 忽略单个 hook 抛出的异常,继续执行后续 hook\n }\n }\n return out\n }\n return undefined\n}\n"],"mappings":";;;;AAWA,MAAM,2BAA8C;;CAGlD,MAAM,OAAO,OAAO,eAAe,cAC/B,aACA,kCAAkC;CACtC,OAAO,gCAAO,KAAK,sGAAL,KAAK,gCAAkC,CAAC,IAAI,CAAC;AAC7D,EAAC,CAAE;AAEH,SAAgB,qBAA2F;CACzG,OAAO,kBAAkB;AAC3B;;;;;AAMA,SAAgB,mBAAmB,MAAwC;CACzE,kBAAkB,WAAW;AAC/B;AAEA,SAAgB,yBAAiD;CAC/D,OAAO,kBAAkB;AAC3B;;;;;AAMA,SAAgB,uBAAuB,KAAsB;CAC3D,kBAAkB,UAAU;AAC9B;AAEA,SAAgB,cAAc,MAAoC;CAChE,IAAI,CAAC,kBAAkB,UACrB,MAAM,IAAI,MAAM,GAAG,KAAK,uBAAuB;CAEjD,OAAO,kBAAkB;AAC3B;AAEA,SAAS,iBAAiB,QAAmD;CAC3E,IAAI,CAAC,OAAO,iBACV,OAAO,kBAAkB,OAAO,OAAO,IAAI;CAE7C,OAAO,OAAO;AAChB;AAIA,SAAS,gBACP,yBACA,uBACiB;CAEjB,MAAM,4BADsB,yCACwB,CAAC,CAAC,uCACjD,2BAA2B,wBAC5B;CAEJ,MAAM,QAAyB,CAAC;CAChC,IAAI,2BACF,MAAM,KAAK,iBAAiB;C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AAQ,QAAQ;CACf,AAAC,OAAe,QAAQ;AAC3B;;;;;AAMA,SAAgB,eAAe,QAA8B,MAAc,OAAc,CAAC,GAAG;;CAC3F,MAAM,QAAQ,OAAO;CACrB,IAAI,CAAC,OACH;CAEF,MAAM,QAAQ,MAAM;CACpB,IAAI,CAAC,OACH;CAEF,MAAM,UAAU,OAAO;CACvB,MAAM,2EAAM,QAAS,kEAAS;CAC9B,IAAI,OAAO,UAAU,YACnB,IAAI;EACF,OAAO,MAAM,MAAM,KAAK,IAAI;CAC9B,mBACM;EACJ;CACF;CAEF,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,IAAI;EACJ,KAAK,MAAM,MAAM,OACf,IAAI;GACF,MAAM,GAAG,MAAM,KAAK,IAAI;EAC1B,mBACM,CAEN;EAEF,OAAO;CACT;AAEF"}
|
|
1
|
+
{"version":3,"file":"base.mjs","names":[],"sources":["../../../../src/runtime/hooks/base.ts"],"sourcesContent":["import type { InternalRuntimeState } from '../types'\nimport { WEVU_CURRENT_SETUP_STATE_KEY, WEVU_HOOKS_KEY } from '@weapp-core/constants'\nimport { getCurrentMiniProgramGlobalObject, getCurrentMiniProgramRuntimeCapabilities, getMiniProgramRuntimeGlobalObject, supportsCurrentMiniProgramRuntimeCapability } from '../platform'\n\n// 仅供同步 setup() 调用期间使用的当前实例引用。wevu 的根入口与\n// `wevu/router` 可能被打包成多个模块副本,必须通过宿主全局共享状态。\ninterface CurrentSetupState {\n instance?: InternalRuntimeState\n context?: any\n}\n\nconst currentSetupState: CurrentSetupState = (() => {\n // Web 会在模块加载后安装宿主 API;可用时优先使用稳定的执行域全局,\n // 防止不同入口因导入时机不同而持有两份 setup 状态。\n const host = typeof globalThis !== 'undefined'\n ? globalThis as Record<string, any>\n : getMiniProgramRuntimeGlobalObject()\n return host ? host[WEVU_CURRENT_SETUP_STATE_KEY] ??= {} : {}\n})()\n\nexport function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined {\n return currentSetupState.instance as T | undefined\n}\n\n/**\n * 设置当前运行时实例(框架内部使用)。\n * @internal\n */\nexport function setCurrentInstance(inst: InternalRuntimeState | undefined) {\n currentSetupState.instance = inst\n}\n\nexport function getCurrentSetupContext<T = any>(): T | undefined {\n return currentSetupState.context as T | undefined\n}\n\n/**\n * 设置当前 setup 上下文(框架内部使用)。\n * @internal\n */\nexport function setCurrentSetupContext(ctx: any | undefined) {\n currentSetupState.context = ctx\n}\n\nexport function assertInSetup(name: string): InternalRuntimeState {\n if (!currentSetupState.instance) {\n throw new Error(`${name}() 必须在 setup() 的同步阶段调用`)\n }\n return currentSetupState.instance\n}\n\nfunction ensureHookBucket(target: InternalRuntimeState): Record<string, any> {\n if (!target[WEVU_HOOKS_KEY]) {\n target[WEVU_HOOKS_KEY] = Object.create(null)\n }\n return target[WEVU_HOOKS_KEY] as Record<string, any>\n}\n\ntype ShareMenuName = 'shareAppMessage' | 'shareTimeline'\n\nfunction buildShareMenus(\n enableOnShareAppMessage: boolean,\n enableOnShareTimeline: boolean,\n): ShareMenuName[] {\n const runtimeCapabilities = getCurrentMiniProgramRuntimeCapabilities()\n const shouldShowShareAppMessage = runtimeCapabilities.shareTimelineRequiresShareAppMessage\n ? (enableOnShareAppMessage || enableOnShareTimeline)\n : enableOnShareAppMessage\n\n const menus: ShareMenuName[] = []\n if (shouldShowShareAppMessage) {\n menus.push('shareAppMessage')\n }\n if (enableOnShareTimeline) {\n menus.push('shareTimeline')\n }\n return menus\n}\n\nfunction tryShowShareMenu(showShareMenu: (...args: any[]) => unknown, menus: ShareMenuName[]) {\n const payloads = [\n { withShareTicket: true, menus },\n { menus },\n menus.includes('shareTimeline') ? { withShareTicket: true } : undefined,\n menus.includes('shareTimeline') ? {} : undefined,\n undefined,\n ]\n\n for (const payload of payloads) {\n try {\n if (payload === undefined) {\n showShareMenu()\n }\n else {\n showShareMenu(payload as any)\n }\n return\n }\n catch {\n // 继续尝试更保守的 payload,兼容不同宿主的 showShareMenu 参数形态。\n }\n }\n}\n\nexport function pushHook(\n target: InternalRuntimeState,\n name: string,\n handler: (...args: any[]) => any,\n { single = false } = {},\n) {\n const bucket = ensureHookBucket(target)\n if (single) {\n bucket[name] = handler\n }\n else {\n const list: Array<(...args: any[]) => any> = bucket[name] ?? (bucket[name] = [])\n list.push(handler)\n }\n}\n\nexport function ensureSinglePageHookOnInstance(target: InternalRuntimeState, name: 'onShareAppMessage' | 'onShareTimeline' | 'onAddToFavorites') {\n const bridges = ((target as any).__wevuShareHookBridges ??= Object.create(null)) as Record<string, (...args: any[]) => any>\n if (typeof bridges[name] === 'function') {\n return\n }\n\n const original = (target as any)[name]\n const bridge = function onWevuShareHookBridge(this: InternalRuntimeState, ...args: any[]) {\n const hooks = this[WEVU_HOOKS_KEY] as Record<string, any> | undefined\n const entry = hooks?.[name]\n const runtime = this.__wevu\n const ctx = runtime?.proxy ?? this\n let ret: any\n\n if (typeof entry === 'function') {\n try {\n ret = entry.apply(ctx, args)\n }\n catch {\n ret = undefined\n }\n }\n else if (Array.isArray(entry)) {\n for (const fn of entry) {\n try {\n ret = fn.apply(ctx, args)\n }\n catch {\n // 忽略单个 hook 抛出的异常,继续执行后续 hook\n }\n }\n }\n\n if (ret !== undefined) {\n return ret\n }\n if (typeof original === 'function') {\n return original.apply(this, args)\n }\n return undefined\n }\n\n bridges[name] = bridge\n ;(target as any)[name] = bridge\n}\n\nexport function ensurePageShareMenusOnSetup(target: InternalRuntimeState) {\n if (!supportsCurrentMiniProgramRuntimeCapability('pageShareMenu')) {\n return\n }\n const miniProgramGlobal = getCurrentMiniProgramGlobalObject()\n if (!miniProgramGlobal || typeof miniProgramGlobal.showShareMenu !== 'function') {\n return\n }\n\n const hooks = (target[WEVU_HOOKS_KEY] ?? {}) as Record<string, any>\n const hasShareAppMessage = typeof hooks.onShareAppMessage === 'function'\n const hasShareTimeline = typeof hooks.onShareTimeline === 'function'\n\n if (!hasShareAppMessage && !hasShareTimeline) {\n return\n }\n\n const menus = buildShareMenus(hasShareAppMessage, hasShareTimeline)\n if (!menus.length) {\n return\n }\n\n tryShowShareMenu(miniProgramGlobal.showShareMenu.bind(miniProgramGlobal), menus)\n}\n\n/**\n * 调用批量 hook(框架内部调度入口)。\n * @internal\n */\nexport function callHookList(target: InternalRuntimeState, name: string, args: any[] = []) {\n const hooks = target[WEVU_HOOKS_KEY]\n if (!hooks) {\n return\n }\n const list = hooks[name]\n if (!list) {\n return\n }\n const runtime = target.__wevu\n const ctx = runtime?.proxy ?? target\n if (Array.isArray(list)) {\n for (const fn of list) {\n try {\n fn.apply(ctx, args)\n }\n catch {\n // 忽略单个 hook 抛出的异常,防止阻塞其他监听\n }\n }\n }\n else if (typeof list === 'function') {\n try {\n list.apply(ctx, args)\n }\n catch {\n // 忽略单个 hook 抛出的异常,防止阻塞其他监听\n }\n }\n}\n\nexport function ensurePageHookOnInstance(target: InternalRuntimeState, name: 'onPageScroll') {\n const bridges = ((target as any).__wevuPageHookBridges ??= Object.create(null)) as Record<string, (...args: any[]) => any>\n if (typeof bridges[name] === 'function') {\n return\n }\n\n const original = (target as any)[name]\n const bridge = function onWevuPageHookBridge(this: InternalRuntimeState, ...args: any[]) {\n callHookList(this, name, args)\n if (typeof original === 'function') {\n return original.apply(this, args)\n }\n return undefined\n }\n\n bridges[name] = bridge\n ;(target as any)[name] = bridge\n}\n\n/**\n * 调用返回值型 hook(框架内部调度入口)。\n * @internal\n */\nexport function callHookReturn(target: InternalRuntimeState, name: string, args: any[] = []) {\n const hooks = target[WEVU_HOOKS_KEY]\n if (!hooks) {\n return undefined\n }\n const entry = hooks[name]\n if (!entry) {\n return undefined\n }\n const runtime = target.__wevu\n const ctx = runtime?.proxy ?? target\n if (typeof entry === 'function') {\n try {\n return entry.apply(ctx, args)\n }\n catch {\n return undefined\n }\n }\n if (Array.isArray(entry)) {\n let out: any\n for (const fn of entry) {\n try {\n out = fn.apply(ctx, args)\n }\n catch {\n // 忽略单个 hook 抛出的异常,继续执行后续 hook\n }\n }\n return out\n }\n return und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