wevu 7.0.4 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -4
- package/dist/alipay/jsx-runtime.d.mts +12 -0
- package/dist/alipay/jsx-runtime.mjs +1 -0
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/defineProperty.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/toPrimitive.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/toPropertyKey.mjs +1 -1
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/typeof.mjs +1 -1
- package/dist/dev/api/vitest/setup.d.mts +1 -0
- package/dist/dev/api/vitest.d.mts +1 -0
- package/dist/dev/api.d.mts +1 -0
- package/dist/dev/compiler.d.mts +1 -0
- package/dist/dev/fetch.d.mts +9 -0
- package/dist/dev/index.d.mts +72 -0
- package/dist/dev/index.mjs +12 -15
- package/dist/dev/internal-reactivity.d.mts +18 -0
- package/dist/dev/internal-reactivity.mjs +3 -2
- package/dist/dev/internal-runtime.d.mts +44 -0
- package/dist/dev/internal-runtime.mjs +19 -14
- package/dist/dev/internal-template.d.mts +2 -0
- package/dist/dev/jsxTypes.d.mts +9 -0
- package/dist/dev/macros/shared.d.mts +81 -0
- package/dist/dev/macros.d.mts +71 -0
- package/dist/dev/package.mjs +1 -1
- package/dist/dev/reactivity/asyncDerivation.d.mts +41 -0
- package/dist/dev/reactivity/asyncDerivation.mjs +130 -0
- package/dist/dev/reactivity/asyncDerivation.mjs.map +1 -0
- package/dist/dev/reactivity/computed.d.mts +21 -0
- package/dist/dev/reactivity/computed.mjs +2 -2
- package/dist/dev/reactivity/computed.mjs.map +1 -1
- package/dist/dev/reactivity/core.d.mts +35 -0
- package/dist/dev/reactivity/core.mjs +156 -32
- package/dist/dev/reactivity/core.mjs.map +1 -1
- package/dist/dev/reactivity/index.d.mts +16 -0
- package/dist/dev/reactivity/reactive/mutation.d.mts +21 -0
- package/dist/dev/reactivity/reactive/patch.d.mts +18 -0
- package/dist/dev/reactivity/reactive/shallow.d.mts +22 -0
- package/dist/dev/reactivity/reactive/shared.d.mts +4 -0
- package/dist/dev/reactivity/reactive.d.mts +42 -0
- package/dist/dev/reactivity/readonly.d.mts +27 -0
- package/dist/dev/reactivity/readonly.mjs.map +1 -1
- package/dist/dev/reactivity/ref.d.mts +27 -0
- package/dist/dev/reactivity/ref.mjs +1 -1
- package/dist/dev/reactivity/shallowRef.d.mts +19 -0
- package/dist/dev/reactivity/toRefs.d.mts +43 -0
- package/dist/dev/reactivity/traverse.d.mts +8 -0
- package/dist/dev/reactivity/watch/types.d.mts +43 -0
- package/dist/dev/reactivity/watch.d.mts +22 -0
- package/dist/dev/router/createRouter.d.mts +8 -0
- package/dist/dev/router/createRouter.mjs +16 -3
- package/dist/dev/router/createRouter.mjs.map +1 -1
- package/dist/dev/router/navigationCore.d.mts +6 -0
- package/dist/dev/router/resolve.d.mts +6 -0
- package/dist/dev/router/routeSync.d.mts +1 -0
- package/dist/dev/router/types.d.mts +172 -0
- package/dist/dev/router/useRoute.d.mts +19 -0
- package/dist/dev/router/useRoute.mjs +23 -5
- package/dist/dev/router/useRoute.mjs.map +1 -1
- package/dist/dev/router/useRouter.d.mts +8 -0
- package/dist/dev/router.d.mts +10 -0
- package/dist/dev/routerInternal/query.d.mts +7 -0
- package/dist/dev/routerInternal/types.d.mts +9 -0
- package/dist/dev/runtime/app/computed.mjs +2 -2
- package/dist/dev/runtime/app/computed.mjs.map +1 -1
- package/dist/dev/runtime/app/context.mjs +8 -2
- package/dist/dev/runtime/app/context.mjs.map +1 -1
- package/dist/dev/runtime/app/diagnostics.mjs +12 -0
- package/dist/dev/runtime/app/diagnostics.mjs.map +1 -1
- package/dist/dev/runtime/app/mount.mjs +31 -28
- package/dist/dev/runtime/app/mount.mjs.map +1 -1
- package/dist/dev/runtime/app/pending.d.mts +10 -0
- package/dist/dev/runtime/app/setData/commitTracker.d.mts +13 -0
- package/dist/dev/runtime/app/setData/commitTracker.mjs +265 -0
- package/dist/dev/runtime/app/setData/commitTracker.mjs.map +1 -0
- package/dist/dev/runtime/app/setData/patchScheduler.mjs +47 -51
- package/dist/dev/runtime/app/setData/patchScheduler.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/scheduler.d.mts +51 -0
- package/dist/dev/runtime/app/setData/scheduler.mjs +98 -111
- package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -1
- package/dist/dev/runtime/app/setData/snapshot.mjs +11 -1
- package/dist/dev/runtime/app/setData/snapshot.mjs.map +1 -1
- package/dist/dev/runtime/app.d.mts +8 -0
- package/dist/dev/runtime/app.mjs +18 -6
- package/dist/dev/runtime/app.mjs.map +1 -1
- package/dist/dev/runtime/bindingManifest.mjs +105 -0
- package/dist/dev/runtime/bindingManifest.mjs.map +1 -0
- package/dist/dev/runtime/capabilities.d.mts +75 -0
- package/dist/dev/runtime/capabilities.mjs +40 -0
- package/dist/dev/runtime/capabilities.mjs.map +1 -0
- package/dist/dev/runtime/css.d.mts +14 -0
- package/dist/dev/runtime/defaults.d.mts +12 -0
- package/dist/dev/runtime/define/componentDefinition.mjs +3 -0
- package/dist/dev/runtime/define/componentDefinition.mjs.map +1 -1
- package/dist/dev/runtime/define/optionsApi.mjs +1 -1
- package/dist/dev/runtime/define/props.mjs +30 -60
- package/dist/dev/runtime/define/props.mjs.map +1 -1
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +37 -21
- package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
- package/dist/dev/runtime/define.d.mts +118 -0
- package/dist/dev/runtime/define.mjs +32 -44
- package/dist/dev/runtime/define.mjs.map +1 -1
- package/dist/dev/runtime/diff.mjs +1 -1
- package/dist/dev/runtime/disposables.d.mts +31 -0
- package/dist/dev/runtime/elementIntersectionObserver.d.mts +26 -0
- package/dist/dev/runtime/features/inlineEvents.d.mts +7 -0
- package/dist/dev/runtime/features/inlineEvents.mjs +25 -0
- package/dist/dev/runtime/features/inlineEvents.mjs.map +1 -0
- package/dist/dev/runtime/features/layout.d.mts +7 -0
- package/dist/dev/runtime/features/layout.mjs +44 -0
- package/dist/dev/runtime/features/layout.mjs.map +1 -0
- package/dist/dev/runtime/features/patchStrategy.d.mts +7 -0
- package/dist/dev/runtime/features/patchStrategy.mjs +129 -0
- package/dist/dev/runtime/features/patchStrategy.mjs.map +1 -0
- package/dist/dev/runtime/features/publicLayout.d.mts +24 -0
- package/dist/dev/runtime/features/publicLayout.mjs +81 -0
- package/dist/dev/runtime/features/publicLayout.mjs.map +1 -0
- package/dist/dev/runtime/features/scopedSlots.d.mts +23 -0
- package/dist/dev/runtime/features/scopedSlots.mjs +88 -0
- package/dist/dev/runtime/features/scopedSlots.mjs.map +1 -0
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.d.mts +7 -0
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.mjs +15 -0
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.mjs.map +1 -0
- package/dist/dev/runtime/features/templateRefs.d.mts +7 -0
- package/dist/dev/runtime/features/templateRefs.mjs +39 -0
- package/dist/dev/runtime/features/templateRefs.mjs.map +1 -0
- package/dist/dev/runtime/hooks/base.d.mts +27 -0
- package/dist/dev/runtime/hooks/register.d.mts +30 -0
- package/dist/dev/runtime/hooks/vue.d.mts +52 -0
- package/dist/dev/runtime/hooks/vue.mjs +3 -5
- package/dist/dev/runtime/hooks/vue.mjs.map +1 -1
- package/dist/dev/runtime/hooks.d.mts +4 -0
- package/dist/dev/runtime/index.d.mts +46 -0
- package/dist/dev/runtime/inlineDataset.mjs +75 -0
- package/dist/dev/runtime/inlineDataset.mjs.map +1 -0
- package/dist/dev/runtime/intersectionObserver.d.mts +14 -0
- package/dist/dev/runtime/jsxIsland.d.mts +37 -0
- package/dist/dev/runtime/jsxIsland.mjs.map +1 -1
- package/dist/dev/runtime/layoutBridge.d.mts +55 -0
- package/dist/dev/runtime/layoutBridge.mjs.map +1 -1
- package/dist/dev/runtime/noSetData.d.mts +5 -0
- package/dist/dev/runtime/pageEnvironment.d.mts +50 -0
- package/dist/dev/runtime/pageLayout.d.mts +25 -0
- package/dist/dev/runtime/pageLayout.mjs.map +1 -1
- package/dist/dev/runtime/pageScroll.d.mts +29 -0
- package/dist/dev/runtime/platform.mjs +18 -1
- package/dist/dev/runtime/platform.mjs.map +1 -1
- package/dist/dev/runtime/provide.d.mts +60 -0
- package/dist/dev/runtime/provideStore.d.mts +7 -0
- package/dist/dev/runtime/publicRuntime.d.mts +22 -0
- package/dist/dev/runtime/publicRuntime.mjs +91 -0
- package/dist/dev/runtime/publicRuntime.mjs.map +1 -0
- package/dist/dev/runtime/pullDownRefresh.d.mts +12 -0
- package/dist/dev/runtime/register/app.d.mts +14 -0
- package/dist/dev/runtime/register/app.mjs +7 -10
- package/dist/dev/runtime/register/app.mjs.map +1 -1
- package/dist/dev/runtime/register/component/lifecycle.mjs +22 -6
- package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -1
- package/dist/dev/runtime/register/component/methods.mjs +7 -10
- package/dist/dev/runtime/register/component/methods.mjs.map +1 -1
- package/dist/dev/runtime/register/component/options.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerDefinition.mjs +64 -69
- package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
- package/dist/dev/runtime/register/component.d.mts +17 -0
- package/dist/dev/runtime/register/inline.d.mts +15 -0
- package/dist/dev/runtime/register/inline.mjs +4 -64
- package/dist/dev/runtime/register/inline.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +4 -6
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +26 -0
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs.map +1 -0
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance.d.mts +26 -0
- package/dist/dev/runtime/register/runtimeInstance.mjs +402 -160
- package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs.map +1 -1
- package/dist/dev/runtime/register/setup.d.mts +11 -0
- package/dist/dev/runtime/register/snapshot.mjs +6 -10
- package/dist/dev/runtime/register/snapshot.mjs.map +1 -1
- package/dist/dev/runtime/register/watch.d.mts +12 -0
- package/dist/dev/runtime/register.d.mts +5 -0
- package/dist/dev/runtime/scopedSlots.mjs +1 -1
- package/dist/dev/runtime/scopedSlots.mjs.map +1 -1
- package/dist/dev/runtime/selectorQuery.d.mts +54 -0
- package/dist/dev/runtime/selectorQuery.mjs +5 -0
- package/dist/dev/runtime/selectorQuery.mjs.map +1 -1
- package/dist/dev/runtime/teardown.mjs +18 -0
- package/dist/dev/runtime/teardown.mjs.map +1 -0
- package/dist/dev/runtime/template.d.mts +6 -0
- package/dist/dev/runtime/templateRefTypes.d.mts +12 -0
- package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -1
- package/dist/dev/runtime/templateRefs.mjs +187 -118
- package/dist/dev/runtime/templateRefs.mjs.map +1 -1
- package/dist/dev/runtime/types/core.d.mts +35 -0
- package/dist/dev/runtime/types/miniprogram.d.mts +84 -0
- package/dist/dev/runtime/types/miniprogramHost.d.mts +45 -0
- package/dist/dev/runtime/types/miniprogramHostSources.d.mts +112 -0
- package/dist/dev/runtime/types/options.d.mts +136 -0
- package/dist/dev/runtime/types/props/propTypes.d.mts +79 -0
- package/dist/dev/runtime/types/props/router.d.mts +51 -0
- package/dist/dev/runtime/types/props/setup.d.mts +96 -0
- package/dist/dev/runtime/types/props.d.mts +4 -0
- package/dist/dev/runtime/types/runtime.d.mts +59 -0
- package/dist/dev/runtime/types/setData.d.mts +237 -0
- package/dist/dev/runtime/types.d.mts +29 -0
- package/dist/dev/runtime/uniAppHost.d.mts +8 -0
- package/dist/dev/runtime/updatePerformance.d.mts +13 -0
- package/dist/dev/runtime/use.d.mts +13 -0
- package/dist/dev/runtime/vueCompat/context.d.mts +8 -0
- package/dist/dev/runtime/vueCompat/model.d.mts +30 -0
- package/dist/dev/runtime/vueCompat/router.d.mts +29 -0
- package/dist/dev/runtime/vueCompat/router.mjs +18 -13
- package/dist/dev/runtime/vueCompat/router.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat/templateRef.d.mts +9 -0
- package/dist/dev/runtime/vueCompat/templateRef.mjs +2 -0
- package/dist/dev/runtime/vueCompat/templateRef.mjs.map +1 -1
- package/dist/dev/runtime/vueCompat.d.mts +5 -0
- package/dist/dev/scheduler.d.mts +4 -0
- package/dist/dev/store/base.mjs +12 -18
- package/dist/dev/store/base.mjs.map +1 -1
- package/dist/dev/store/define/optionsStyle.mjs +13 -23
- package/dist/dev/store/define/optionsStyle.mjs.map +1 -1
- package/dist/dev/store/define/setupStyle.mjs +14 -24
- package/dist/dev/store/define/setupStyle.mjs.map +1 -1
- package/dist/dev/store/define/shared.mjs +44 -1
- package/dist/dev/store/define/shared.mjs.map +1 -1
- package/dist/dev/store/define.d.mts +28 -0
- package/dist/dev/store/define.mjs.map +1 -1
- package/dist/dev/store/manager.d.mts +8 -0
- package/dist/dev/store/storeToRefs.d.mts +13 -0
- package/dist/dev/store/types.d.mts +70 -0
- package/dist/dev/store.d.mts +5 -0
- package/dist/dev/version.d.mts +4 -0
- package/dist/dev/vue-augment.d.mts +8 -0
- package/dist/dev/vue-demi.d.mts +87 -0
- package/dist/dev/vue-demi.mjs +12 -15
- package/dist/dev/vue-demi.mjs.map +1 -1
- package/dist/dev/vue-types.d.mts +19 -0
- package/dist/dev/web-apis.d.mts +3 -0
- package/dist/index.d.mts +13 -14
- package/dist/index.mjs +1 -1
- package/dist/internal-reactivity.d.mts +2 -1
- package/dist/internal-reactivity.mjs +1 -1
- package/dist/internal-runtime.d.mts +13 -6
- package/dist/internal-runtime.mjs +1 -1
- package/dist/jsx-runtime.d.mts +47 -9
- package/dist/jsxTypes.d.mts +8 -0
- package/dist/miniprogram/jsx-runtime.d.mts +12 -0
- package/dist/miniprogram/jsx-runtime.mjs +1 -0
- package/dist/package.mjs +1 -1
- package/dist/reactivity/asyncDerivation.d.mts +40 -0
- package/dist/reactivity/asyncDerivation.mjs +1 -0
- package/dist/reactivity/computed.mjs +1 -1
- package/dist/reactivity/core.d.mts +1 -0
- package/dist/reactivity/core.mjs +1 -1
- package/dist/reactivity/index.d.mts +2 -1
- package/dist/reactivity/readonly.d.mts +1 -1
- package/dist/reactivity/ref.mjs +1 -1
- package/dist/router/createRouter.mjs +1 -1
- package/dist/router/useRoute.mjs +1 -1
- package/dist/runtime/app/computed.mjs +1 -1
- package/dist/runtime/app/context.mjs +1 -1
- package/dist/runtime/app/diagnostics.mjs +1 -1
- package/dist/runtime/app/mount.mjs +1 -1
- package/dist/runtime/app/setData/commitTracker.d.mts +12 -0
- package/dist/runtime/app/setData/commitTracker.mjs +1 -0
- package/dist/runtime/app/setData/patchScheduler.mjs +1 -1
- package/dist/runtime/app/setData/scheduler.d.mts +50 -0
- package/dist/runtime/app/setData/scheduler.mjs +1 -1
- package/dist/runtime/app/setData/snapshot.mjs +1 -1
- package/dist/runtime/app.mjs +1 -1
- package/dist/runtime/bindingManifest.mjs +1 -0
- package/dist/runtime/capabilities.d.mts +74 -0
- package/dist/runtime/capabilities.mjs +1 -0
- package/dist/runtime/define/componentDefinition.mjs +1 -1
- package/dist/runtime/define/optionsApi.mjs +1 -1
- package/dist/runtime/define/props.mjs +1 -1
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
- package/dist/runtime/define.d.mts +5 -13
- package/dist/runtime/define.mjs +1 -1
- package/dist/runtime/diff.mjs +1 -1
- package/dist/runtime/features/inlineEvents.d.mts +6 -0
- package/dist/runtime/features/inlineEvents.mjs +1 -0
- package/dist/runtime/features/layout.d.mts +6 -0
- package/dist/runtime/features/layout.mjs +1 -0
- package/dist/runtime/features/patchStrategy.d.mts +6 -0
- package/dist/runtime/features/patchStrategy.mjs +1 -0
- package/dist/runtime/features/publicLayout.d.mts +23 -0
- package/dist/runtime/features/publicLayout.mjs +1 -0
- package/dist/runtime/features/scopedSlots.d.mts +22 -0
- package/dist/runtime/features/scopedSlots.mjs +1 -0
- package/dist/runtime/features/setDataHighFrequencyWarning.d.mts +6 -0
- package/dist/runtime/features/setDataHighFrequencyWarning.mjs +1 -0
- package/dist/runtime/features/templateRefs.d.mts +6 -0
- package/dist/runtime/features/templateRefs.mjs +1 -0
- package/dist/runtime/hooks/vue.d.mts +1 -2
- package/dist/runtime/hooks/vue.mjs +1 -1
- package/dist/runtime/index.d.mts +12 -14
- package/dist/runtime/inlineDataset.mjs +1 -0
- package/dist/runtime/jsxIsland.d.mts +2 -6
- package/dist/runtime/layoutBridge.d.mts +5 -9
- package/dist/runtime/pageLayout.d.mts +3 -4
- package/dist/runtime/platform.mjs +1 -1
- package/dist/runtime/publicRuntime.d.mts +21 -0
- package/dist/runtime/publicRuntime.mjs +1 -0
- package/dist/runtime/register/app.mjs +1 -1
- package/dist/runtime/register/component/lifecycle.mjs +1 -1
- package/dist/runtime/register/component/methods.mjs +1 -1
- package/dist/runtime/register/component/registerDefinition.mjs +1 -1
- package/dist/runtime/register/inline.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupContext.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -1
- package/dist/runtime/register/runtimeInstance/setupSnapshot.mjs +1 -0
- package/dist/runtime/register/runtimeInstance.mjs +1 -1
- package/dist/runtime/register/snapshot.mjs +1 -1
- package/dist/runtime/scopedSlots.mjs +1 -1
- package/dist/runtime/selectorQuery.mjs +1 -1
- package/dist/runtime/teardown.mjs +1 -0
- package/dist/runtime/templateRefTypes.d.mts +5 -2
- package/dist/runtime/templateRefs.mjs +1 -1
- package/dist/runtime/types/miniprogram.d.mts +3 -0
- package/dist/runtime/types/options.d.mts +2 -2
- package/dist/runtime/types/props.d.mts +1 -1
- package/dist/runtime/types/setData.d.mts +18 -1
- package/dist/runtime/types.d.mts +3 -3
- package/dist/runtime/vueCompat/router.d.mts +5 -4
- package/dist/runtime/vueCompat/router.mjs +1 -1
- package/dist/runtime/vueCompat/templateRef.mjs +1 -1
- package/dist/store/base.mjs +1 -1
- package/dist/store/define/optionsStyle.mjs +1 -1
- package/dist/store/define/setupStyle.mjs +1 -1
- package/dist/store/define/shared.mjs +1 -1
- package/dist/store/define.d.mts +10 -8
- package/dist/store/types.d.mts +4 -4
- package/dist/tt/jsx-runtime.d.mts +12 -0
- package/dist/tt/jsx-runtime.mjs +1 -0
- package/dist/vue-demi.d.mts +13 -14
- package/dist/vue-demi.mjs +1 -1
- package/dist/weapp/jsx-runtime.d.mts +12 -0
- package/dist/weapp/jsx-runtime.mjs +1 -0
- package/package.json +26 -22
- package/dist/dev/jsx-runtime.mjs +0 -1
- package/dist/runtime/templateRefs.d.mts +0 -10
- package/dist/weappIntrinsicElements/base.d.mts +0 -21
- package/dist/weappIntrinsicElements/elements/ad-custom.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/ad.d.mts +0 -15
- package/dist/weappIntrinsicElements/elements/audio.d.mts +0 -19
- package/dist/weappIntrinsicElements/elements/block.d.mts +0 -7
- package/dist/weappIntrinsicElements/elements/button.d.mts +0 -39
- package/dist/weappIntrinsicElements/elements/camera.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/canvas.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/checkbox-group.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/checkbox.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/cover-image.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/cover-view.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/editor.d.mts +0 -21
- package/dist/weappIntrinsicElements/elements/form.d.mts +0 -15
- package/dist/weappIntrinsicElements/elements/functional-page-navigator.d.mts +0 -14
- package/dist/weappIntrinsicElements/elements/icon.d.mts +0 -11
- package/dist/weappIntrinsicElements/elements/image.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/import.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/include.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/input.d.mts +0 -46
- package/dist/weappIntrinsicElements/elements/keyboard-accessory.d.mts +0 -7
- package/dist/weappIntrinsicElements/elements/label.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/live-player.d.mts +0 -34
- package/dist/weappIntrinsicElements/elements/live-pusher.d.mts +0 -56
- package/dist/weappIntrinsicElements/elements/map.d.mts +0 -104
- package/dist/weappIntrinsicElements/elements/match-media.d.mts +0 -15
- package/dist/weappIntrinsicElements/elements/movable-area.d.mts +0 -25
- package/dist/weappIntrinsicElements/elements/movable-view.d.mts +0 -25
- package/dist/weappIntrinsicElements/elements/navigation-bar.d.mts +0 -14
- package/dist/weappIntrinsicElements/elements/navigator.d.mts +0 -24
- package/dist/weappIntrinsicElements/elements/official-account.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/open-data.d.mts +0 -14
- package/dist/weappIntrinsicElements/elements/page-container.d.mts +0 -24
- package/dist/weappIntrinsicElements/elements/page-meta.d.mts +0 -22
- package/dist/weappIntrinsicElements/elements/picker-view-column.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/picker-view.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/picker.d.mts +0 -22
- package/dist/weappIntrinsicElements/elements/progress.d.mts +0 -20
- package/dist/weappIntrinsicElements/elements/radio-group.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/radio.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/rich-text.d.mts +0 -16
- package/dist/weappIntrinsicElements/elements/scroll-view.d.mts +0 -67
- package/dist/weappIntrinsicElements/elements/share-element.d.mts +0 -17
- package/dist/weappIntrinsicElements/elements/slider.d.mts +0 -22
- package/dist/weappIntrinsicElements/elements/slot.d.mts +0 -9
- package/dist/weappIntrinsicElements/elements/swiper-item.d.mts +0 -41
- package/dist/weappIntrinsicElements/elements/swiper.d.mts +0 -41
- package/dist/weappIntrinsicElements/elements/switch.d.mts +0 -13
- package/dist/weappIntrinsicElements/elements/template.d.mts +0 -11
- package/dist/weappIntrinsicElements/elements/text.d.mts +0 -14
- package/dist/weappIntrinsicElements/elements/textarea.d.mts +0 -39
- package/dist/weappIntrinsicElements/elements/video.d.mts +0 -70
- package/dist/weappIntrinsicElements/elements/view.d.mts +0 -12
- package/dist/weappIntrinsicElements/elements/voip-room.d.mts +0 -13
- package/dist/weappIntrinsicElements/elements/web-view.d.mts +0 -12
- package/dist/weappIntrinsicElements.d.mts +0 -153
- /package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/defineProperty.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/toPrimitive.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/toPropertyKey.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/typeof.mjs +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { INTERNAL_DEFAULTS_SCOPE_KEY } from "../defaults.mjs";
|
|
2
2
|
import { registerComponent } from "../register/component.mjs";
|
|
3
3
|
import { createApp } from "../app.mjs";
|
|
4
|
+
import { WEVU_BINDING_MANIFEST_KEY, WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY } from "@weapp-core/constants";
|
|
4
5
|
|
|
5
6
|
//#region src/runtime/define/componentDefinition.ts
|
|
6
7
|
/**
|
|
@@ -12,6 +13,8 @@ function createRuntimeComponentDefinition(options, registerNative = false) {
|
|
|
12
13
|
computed: options.computed,
|
|
13
14
|
methods: options.methods,
|
|
14
15
|
setData: options.setData,
|
|
16
|
+
[WEVU_BINDING_MANIFEST_KEY]: options.bindingManifest,
|
|
17
|
+
[WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY]: options.scopedSlotOwnerRequired,
|
|
15
18
|
[INTERNAL_DEFAULTS_SCOPE_KEY]: "component"
|
|
16
19
|
});
|
|
17
20
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentDefinition.mjs","names":[],"sources":["../../../../src/runtime/define/componentDefinition.ts"],"sourcesContent":["import type { WatchMap } from '../register/watch'\nimport type {\n ComputedDefinitions,\n MethodDefinitions,\n MiniProgramComponentRawOptions,\n SetDataSnapshotOptions,\n} from '../types'\nimport { createApp } from '../app'\nimport { INTERNAL_DEFAULTS_SCOPE_KEY } from '../defaults'\nimport { registerComponent } from '../register'\n\nexport interface RuntimeComponentDefinitionOptions {\n data: (() => Record<string, any>) | undefined\n computed: ComputedDefinitions\n methods: MethodDefinitions\n setData: SetDataSnapshotOptions | undefined\n watch: WatchMap | undefined\n setup: ((props: any, ctx: any) => any) | undefined\n mpOptions: MiniProgramComponentRawOptions\n}\n\n/**\n * 从稳定的组件选项快照创建独立运行时和宿主生命周期定义。\n */\nexport function createRuntimeComponentDefinition(\n options: RuntimeComponentDefinitionOptions,\n registerNative = false,\n) {\n const runtimeApp = createApp({\n data: options.data,\n computed: options.computed,\n methods: options.methods,\n setData: options.setData,\n [INTERNAL_DEFAULTS_SCOPE_KEY]: 'component',\n } as any)\n const lifecycleDefinition = registerComponent(\n runtimeApp as any,\n options.methods,\n options.watch,\n options.setup,\n options.mpOptions,\n { registerNative },\n )\n\n return {\n lifecycleDefinition,\n runtimeApp,\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"componentDefinition.mjs","names":[],"sources":["../../../../src/runtime/define/componentDefinition.ts"],"sourcesContent":["import type { WevuRuntimeBindingManifestV1 } from '@weapp-core/constants'\nimport type { WatchMap } from '../register/watch'\nimport type {\n ComputedDefinitions,\n MethodDefinitions,\n MiniProgramComponentRawOptions,\n SetDataSnapshotOptions,\n} from '../types'\nimport {\n WEVU_BINDING_MANIFEST_KEY,\n WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY,\n} from '@weapp-core/constants'\nimport { createApp } from '../app'\nimport { INTERNAL_DEFAULTS_SCOPE_KEY } from '../defaults'\nimport { registerComponent } from '../register'\n\nexport interface RuntimeComponentDefinitionOptions {\n scopedSlotOwnerRequired: boolean\n data: (() => Record<string, any>) | undefined\n computed: ComputedDefinitions\n methods: MethodDefinitions\n setData: SetDataSnapshotOptions | undefined\n bindingManifest?: WevuRuntimeBindingManifestV1\n watch: WatchMap | undefined\n setup: ((props: any, ctx: any) => any) | undefined\n mpOptions: MiniProgramComponentRawOptions\n}\n\n/**\n * 从稳定的组件选项快照创建独立运行时和宿主生命周期定义。\n */\nexport function createRuntimeComponentDefinition(\n options: RuntimeComponentDefinitionOptions,\n registerNative = false,\n) {\n const runtimeApp = createApp({\n data: options.data,\n computed: options.computed,\n methods: options.methods,\n setData: options.setData,\n [WEVU_BINDING_MANIFEST_KEY]: options.bindingManifest,\n [WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY]: options.scopedSlotOwnerRequired,\n [INTERNAL_DEFAULTS_SCOPE_KEY]: 'component',\n } as any)\n const lifecycleDefinition = registerComponent(\n runtimeApp as any,\n options.methods,\n options.watch,\n options.setup,\n options.mpOptions,\n { registerNative },\n )\n\n return {\n lifecycleDefinition,\n runtimeApp,\n }\n}\n"],"mappings":";;;;;;;;;AA+BA,SAAgB,iCACd,SACA,iBAAiB,OACjB;CACA,MAAM,aAAa,UAAU;EAC3B,MAAM,QAAQ;EACd,UAAU,QAAQ;EAClB,SAAS,QAAQ;EACjB,SAAS,QAAQ;GAChB,4BAA4B,QAAQ;GACpC,sCAAsC,QAAQ;GAC9C,8BAA8B;CACjC,CAAQ;CAUR,OAAO;EACL,qBAV0B,kBAC1B,YACA,QAAQ,SACR,QAAQ,OACR,QAAQ,OACR,QAAQ,WACR,EAAE,eAAe,CAIC;EAClB;CACF;AACF"}
|
|
@@ -24,18 +24,19 @@ const NATIVE_PROPERTY_TYPE_MAP = /* @__PURE__ */ new Map([
|
|
|
24
24
|
function toNativePropertyType(candidate) {
|
|
25
25
|
return NATIVE_PROPERTY_TYPE_MAP.get(candidate);
|
|
26
26
|
}
|
|
27
|
+
function collectNativePropertyTypeCandidates(raw, normalized = []) {
|
|
28
|
+
if (Array.isArray(raw)) {
|
|
29
|
+
for (const item of raw) collectNativePropertyTypeCandidates(item, normalized);
|
|
30
|
+
return normalized;
|
|
31
|
+
}
|
|
32
|
+
const mapped = toNativePropertyType(raw);
|
|
33
|
+
if (mapped !== void 0 && !normalized.includes(mapped)) normalized.push(mapped);
|
|
34
|
+
return normalized;
|
|
35
|
+
}
|
|
27
36
|
function normalizeTypeCandidates(raw) {
|
|
28
37
|
if (raw === void 0) return [];
|
|
29
|
-
const
|
|
30
|
-
const normalized = [];
|
|
31
|
-
source.forEach((item) => {
|
|
32
|
-
const mapped = toNativePropertyType(item);
|
|
33
|
-
if (mapped === void 0) return;
|
|
34
|
-
if (!normalized.includes(mapped)) normalized.push(mapped);
|
|
35
|
-
});
|
|
36
|
-
const requiredNativeTypes = normalized.filter((item) => item !== null);
|
|
38
|
+
const requiredNativeTypes = collectNativePropertyTypeCandidates(raw).filter((item) => item !== null);
|
|
37
39
|
if (requiredNativeTypes.length > 0) return requiredNativeTypes;
|
|
38
|
-
if (normalized.includes(null)) return [null];
|
|
39
40
|
return [null];
|
|
40
41
|
}
|
|
41
42
|
function applyTypeOptions(target, rawType) {
|
|
@@ -48,55 +49,24 @@ function applyTypeOptions(target, rawType) {
|
|
|
48
49
|
if (optionalTypes.length > 0) target.optionalTypes = optionalTypes;
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
target.
|
|
52
|
+
function preserveImplicitNativeDefault(target) {
|
|
53
|
+
if (hasOwn(target, "value")) return;
|
|
54
|
+
if (target.type === String) target.value = "";
|
|
55
|
+
else if (target.type === Number) target.value = 0;
|
|
56
|
+
else if (target.type === Boolean) target.value = false;
|
|
57
|
+
else if (target.type === Array) target.value = [];
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
if (!
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (definition === void 0) return;
|
|
70
|
-
if (definition === null) return { type: null };
|
|
71
|
-
if (Array.isArray(definition) || typeof definition === "function") {
|
|
72
|
-
const propOptions = {};
|
|
73
|
-
applyTypeOptions(propOptions, definition);
|
|
74
|
-
if (allowNullPropInput && propOptions.type !== null) appendOptionalType(propOptions, null);
|
|
75
|
-
if (!hasOwn(propOptions, "type")) propOptions.type = null;
|
|
76
|
-
return propOptions;
|
|
77
|
-
}
|
|
78
|
-
if (typeof definition !== "object") return definition;
|
|
79
|
-
const propOptions = { ...definition };
|
|
80
|
-
if ("type" in propOptions) {
|
|
81
|
-
var _normalizedTypes$;
|
|
82
|
-
const normalizedTypes = normalizeTypeCandidates(propOptions.type);
|
|
83
|
-
propOptions.type = (_normalizedTypes$ = normalizedTypes[0]) !== null && _normalizedTypes$ !== void 0 ? _normalizedTypes$ : null;
|
|
84
|
-
const existingOptionalTypes = normalizeOptionalTypeCandidates(propOptions.optionalTypes);
|
|
85
|
-
for (const candidate of normalizedTypes.slice(1)) if (candidate !== null && !existingOptionalTypes.includes(candidate)) existingOptionalTypes.push(candidate);
|
|
86
|
-
if (existingOptionalTypes.length > 0) propOptions.optionalTypes = existingOptionalTypes;
|
|
87
|
-
else delete propOptions.optionalTypes;
|
|
88
|
-
}
|
|
89
|
-
if (!hasOwn(propOptions, "type")) propOptions.type = null;
|
|
90
|
-
if (allowNullPropInput && propOptions.type !== null) appendOptionalType(propOptions, null);
|
|
91
|
-
return propOptions;
|
|
92
|
-
}
|
|
93
|
-
function normalizeExplicitProperties(properties, allowNullPropInput) {
|
|
94
|
-
const normalizedProperties = {};
|
|
95
|
-
Object.entries(properties).forEach(([key, definition]) => {
|
|
96
|
-
const normalizedDefinition = normalizeExplicitPropertyDefinition(definition, allowNullPropInput);
|
|
97
|
-
if (normalizedDefinition !== void 0) normalizedProperties[key] = normalizedDefinition;
|
|
98
|
-
});
|
|
99
|
-
return normalizedProperties;
|
|
59
|
+
function applyNullableTransportOptions(target, definition, allowNullPropInput) {
|
|
60
|
+
if (!allowNullPropInput || target.type === null) return;
|
|
61
|
+
const definitionRecord = definition && typeof definition === "object" && !Array.isArray(definition) ? definition : void 0;
|
|
62
|
+
const candidates = collectNativePropertyTypeCandidates(definitionRecord ? [definitionRecord.type, definitionRecord.optionalTypes] : definition);
|
|
63
|
+
const explicitlyNullable = candidates.includes(null);
|
|
64
|
+
const acceptsMultipleNativeTypes = candidates.filter((candidate) => candidate !== null).length > 1;
|
|
65
|
+
const acceptsMissingInput = (definitionRecord === null || definitionRecord === void 0 ? void 0 : definitionRecord.required) !== true;
|
|
66
|
+
if (!explicitlyNullable && !acceptsMultipleNativeTypes && !acceptsMissingInput) return;
|
|
67
|
+
if (!explicitlyNullable) preserveImplicitNativeDefault(target);
|
|
68
|
+
target.type = null;
|
|
69
|
+
delete target.optionalTypes;
|
|
100
70
|
}
|
|
101
71
|
function normalizeVueProps(props, allowNullPropInput) {
|
|
102
72
|
const properties = {};
|
|
@@ -110,8 +80,8 @@ function normalizeVueProps(props, allowNullPropInput) {
|
|
|
110
80
|
if (Array.isArray(definition) || typeof definition === "function") {
|
|
111
81
|
const propOptions = {};
|
|
112
82
|
applyTypeOptions(propOptions, definition);
|
|
113
|
-
if (allowNullPropInput && propOptions.type !== null) appendOptionalType(propOptions, null);
|
|
114
83
|
if (!hasOwn(propOptions, "type")) propOptions.type = null;
|
|
84
|
+
applyNullableTransportOptions(propOptions, definition, allowNullPropInput);
|
|
115
85
|
properties[key] = propOptions;
|
|
116
86
|
return;
|
|
117
87
|
}
|
|
@@ -139,8 +109,8 @@ function normalizeVueProps(props, allowNullPropInput) {
|
|
|
139
109
|
if ("observer" in definition && (typeof definition.observer === "function" || typeof definition.observer === "string")) propOptions.observer = definition.observer;
|
|
140
110
|
const defaultValue = "default" in definition ? definition.default : definition.value;
|
|
141
111
|
if (defaultValue !== void 0) propOptions.value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
142
|
-
if (allowNullPropInput && propOptions.type !== null) appendOptionalType(propOptions, null);
|
|
143
112
|
if (!hasOwn(propOptions, "type")) propOptions.type = null;
|
|
113
|
+
applyNullableTransportOptions(propOptions, definition, allowNullPropInput);
|
|
144
114
|
properties[key] = propOptions;
|
|
145
115
|
}
|
|
146
116
|
});
|
|
@@ -173,7 +143,7 @@ function normalizeProps(baseOptions, props, explicitProperties) {
|
|
|
173
143
|
};
|
|
174
144
|
if (resolvedExplicit) {
|
|
175
145
|
const { properties: _ignored, ...rest } = normalizedBaseOptions;
|
|
176
|
-
const normalizedExplicitProperties = resolvedExplicit
|
|
146
|
+
const normalizedExplicitProperties = resolvedExplicit;
|
|
177
147
|
const normalizedVueProps = normalizeVueProps(props, allowNullPropInput);
|
|
178
148
|
return {
|
|
179
149
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.mjs","names":[],"sources":["../../../../src/runtime/define/props.ts"],"sourcesContent":["import type {\n ComponentPropsOptions,\n MiniProgramComponentPropertyOption,\n MiniProgramComponentShortProperty,\n} from '../types'\nimport {\n WEVU_SLOT_NAMES_PROP,\n WEVU_SLOT_OWNER_ID_PROP,\n WEVU_SLOT_SCOPE_KEY,\n} from '@weapp-core/constants'\nimport { hasOwn } from '../../utils'\n\nconst ALLOW_NULL_PROP_INPUT_KEY = '__wevu_allowNullPropInput'\nconst PUBLIC_ALLOW_NULL_PROP_INPUT_KEY = 'allowNullPropInput'\n\ntype NormalizedNativePropertyType = MiniProgramComponentShortProperty | FunctionConstructor | null\n\nconst NATIVE_PROPERTY_TYPE_MAP = new Map<unknown, NormalizedNativePropertyType>([\n [String, String],\n [Number, Number],\n [Boolean, Boolean],\n [Object, Object],\n [Array, Array],\n [Function, Function],\n ['String', String],\n ['Number', Number],\n ['Boolean', Boolean],\n ['Object', Object],\n ['Array', Array],\n ['Function', Function],\n [null, null],\n ['null', null],\n ['Null', null],\n])\n\nfunction toNativePropertyType(candidate: unknown) {\n return NATIVE_PROPERTY_TYPE_MAP.get(candidate)\n}\n\nfunction normalizeTypeCandidates(raw: unknown) {\n if (raw === undefined) {\n return []\n }\n const source = Array.isArray(raw) ? raw : [raw]\n const normalized: NormalizedNativePropertyType[] = []\n source.forEach((item) => {\n const mapped = toNativePropertyType(item)\n if (mapped === undefined) {\n return\n }\n if (!normalized.includes(mapped)) {\n normalized.push(mapped)\n }\n })\n const requiredNativeTypes = normalized.filter((item): item is Exclude<NormalizedNativePropertyType, null> => item !== null)\n if (requiredNativeTypes.length > 0) {\n return requiredNativeTypes\n }\n if (normalized.includes(null)) {\n return [null]\n }\n return [null]\n}\n\nfunction applyTypeOptions(target: Record<string, any>, rawType: unknown) {\n const candidates = normalizeTypeCandidates(rawType)\n if (candidates.length === 0) {\n return\n }\n\n target.type = candidates[0]\n if (candidates.length > 1) {\n const optionalTypes: any[] = []\n for (const candidate of candidates.slice(1)) {\n if (!optionalTypes.includes(candidate)) {\n optionalTypes.push(candidate)\n }\n }\n if (optionalTypes.length > 0) {\n target.optionalTypes = optionalTypes\n }\n }\n}\n\nfunction appendOptionalType(target: Record<string, any>, candidate: unknown) {\n if (candidate === undefined || target.type === candidate) {\n return\n }\n const optionalTypes = Array.isArray(target.optionalTypes)\n ? [...target.optionalTypes]\n : []\n if (optionalTypes.includes(candidate)) {\n return\n }\n optionalTypes.push(candidate)\n target.optionalTypes = optionalTypes\n}\n\nfunction normalizeOptionalTypeCandidates(raw: unknown) {\n if (!Array.isArray(raw)) {\n return []\n }\n const normalized: Array<Exclude<NormalizedNativePropertyType, null>> = []\n raw.forEach((item) => {\n const mapped = toNativePropertyType(item)\n if (mapped === undefined || mapped === null || normalized.includes(mapped)) {\n return\n }\n normalized.push(mapped)\n })\n return normalized\n}\n\nfunction normalizeExplicitPropertyDefinition(\n definition: unknown,\n allowNullPropInput: boolean,\n) {\n if (definition === undefined) {\n return undefined\n }\n if (definition === null) {\n return { type: null }\n }\n if (Array.isArray(definition) || typeof definition === 'function') {\n const propOptions: Record<string, any> = {}\n applyTypeOptions(propOptions, definition)\n if (allowNullPropInput && propOptions.type !== null) {\n appendOptionalType(propOptions, null)\n }\n if (!hasOwn(propOptions, 'type')) {\n propOptions.type = null\n }\n return propOptions\n }\n if (typeof definition !== 'object') {\n return definition\n }\n\n const propOptions: Record<string, any> = {\n ...(definition as Record<string, any>),\n }\n\n if ('type' in propOptions) {\n const normalizedTypes = normalizeTypeCandidates(propOptions.type)\n propOptions.type = normalizedTypes[0] ?? null\n const existingOptionalTypes = normalizeOptionalTypeCandidates(propOptions.optionalTypes)\n for (const candidate of normalizedTypes.slice(1)) {\n if (candidate !== null && !existingOptionalTypes.includes(candidate)) {\n existingOptionalTypes.push(candidate)\n }\n }\n if (existingOptionalTypes.length > 0) {\n propOptions.optionalTypes = existingOptionalTypes\n }\n else {\n delete propOptions.optionalTypes\n }\n }\n\n if (!hasOwn(propOptions, 'type')) {\n propOptions.type = null\n }\n\n if (allowNullPropInput && propOptions.type !== null) {\n appendOptionalType(propOptions, null)\n }\n\n return propOptions\n}\n\nfunction normalizeExplicitProperties(\n properties: MiniProgramComponentPropertyOption,\n allowNullPropInput: boolean,\n) {\n const normalizedProperties: Record<string, any> = {}\n Object.entries(properties).forEach(([key, definition]) => {\n const normalizedDefinition = normalizeExplicitPropertyDefinition(definition, allowNullPropInput)\n if (normalizedDefinition !== undefined) {\n normalizedProperties[key] = normalizedDefinition\n }\n })\n return normalizedProperties\n}\n\nfunction normalizeVueProps(\n props: ComponentPropsOptions | undefined,\n allowNullPropInput: boolean,\n) {\n const properties: Record<string, any> = {}\n if (!props) {\n return properties\n }\n\n Object.entries(props).forEach(([key, definition]) => {\n if (definition === undefined) {\n return\n }\n if (definition === null) {\n properties[key] = { type: null }\n return\n }\n if (Array.isArray(definition) || typeof definition === 'function') {\n const propOptions: Record<string, any> = {}\n applyTypeOptions(propOptions, definition)\n if (allowNullPropInput && propOptions.type !== null) {\n appendOptionalType(propOptions, null)\n }\n if (!hasOwn(propOptions, 'type')) {\n propOptions.type = null\n }\n properties[key] = propOptions\n return\n }\n if (typeof definition === 'object') {\n // 在 Vue <script setup> 中,defineModel() 会生成空的 modifiers props。\n if (key.endsWith('Modifiers') && Object.keys(definition).length === 0) {\n properties[key] = { type: Object, value: {} }\n return\n }\n const propOptions: Record<string, any> = {}\n if ('type' in definition && definition.type !== undefined) {\n applyTypeOptions(propOptions, (definition as any).type)\n }\n if (Array.isArray((definition as any).optionalTypes)) {\n const optionalTypes = (definition as any).optionalTypes.map((item: unknown) => toNativePropertyType(item)).filter((item: unknown): item is Exclude<NormalizedNativePropertyType, null> => item !== undefined && item !== null)\n if (optionalTypes.length > 0) {\n const existingOptionalTypes = Array.isArray(propOptions.optionalTypes)\n ? propOptions.optionalTypes as any[]\n : []\n for (const optionalType of optionalTypes) {\n if (optionalType === propOptions.type) {\n continue\n }\n if (!existingOptionalTypes.includes(optionalType)) {\n existingOptionalTypes.push(optionalType)\n }\n }\n if (existingOptionalTypes.length > 0) {\n propOptions.optionalTypes = existingOptionalTypes\n }\n }\n }\n if ('observer' in definition && (typeof (definition as any).observer === 'function' || typeof (definition as any).observer === 'string')) {\n propOptions.observer = (definition as any).observer\n }\n const defaultValue = 'default' in definition ? (definition as any).default : (definition as any).value\n if (defaultValue !== undefined) {\n propOptions.value = typeof defaultValue === 'function' ? (defaultValue as any)() : defaultValue\n }\n if (allowNullPropInput && propOptions.type !== null) {\n appendOptionalType(propOptions, null)\n }\n if (!hasOwn(propOptions, 'type')) {\n propOptions.type = null\n }\n properties[key] = propOptions\n }\n })\n\n return properties\n}\n\nexport function normalizeProps(\n baseOptions: Record<string, any>,\n props?: ComponentPropsOptions,\n explicitProperties?: MiniProgramComponentPropertyOption,\n) {\n const allowNullPropInput = Boolean(\n (baseOptions as any)[ALLOW_NULL_PROP_INPUT_KEY]\n ?? (baseOptions as any)[PUBLIC_ALLOW_NULL_PROP_INPUT_KEY],\n )\n const {\n [ALLOW_NULL_PROP_INPUT_KEY]: _ignoredAllowNullPropInput,\n [PUBLIC_ALLOW_NULL_PROP_INPUT_KEY]: _ignoredPublicAllowNullPropInput,\n ...normalizedBaseOptions\n } = baseOptions\n const baseProperties = (baseOptions as any).properties\n const normalizedBaseProperties = baseProperties && typeof baseProperties === 'object' && Object.keys(baseProperties).length > 0\n ? (baseProperties as any)\n : undefined\n const resolvedExplicit = explicitProperties\n ?? normalizedBaseProperties\n const shouldAttachInternalProps = Boolean(props || resolvedExplicit)\n const attachInternalProps = (source?: Record<string, any>) => {\n const next = { ...(source ?? {}) }\n if (!shouldAttachInternalProps) {\n return next\n }\n if (!hasOwn(next, WEVU_SLOT_OWNER_ID_PROP)) {\n next[WEVU_SLOT_OWNER_ID_PROP] = { type: String, value: '' }\n }\n if (!hasOwn(next, WEVU_SLOT_SCOPE_KEY)) {\n next[WEVU_SLOT_SCOPE_KEY] = { type: null, value: null }\n }\n if (!hasOwn(next, WEVU_SLOT_NAMES_PROP)) {\n next[WEVU_SLOT_NAMES_PROP] = { type: null, value: null }\n }\n return next\n }\n\n if (resolvedExplicit) {\n const {\n properties: _ignored,\n ...rest\n } = normalizedBaseOptions\n const normalizedExplicitProperties = resolvedExplicit\n ? allowNullPropInput\n ? normalizeExplicitProperties(resolvedExplicit as any, allowNullPropInput)\n : (resolvedExplicit as any)\n : undefined\n const normalizedVueProps = normalizeVueProps(props, allowNullPropInput)\n return {\n ...rest,\n properties: attachInternalProps({\n ...normalizedVueProps,\n ...normalizedExplicitProperties,\n }),\n }\n }\n\n return {\n ...normalizedBaseOptions,\n properties: attachInternalProps(normalizeVueProps(props, allowNullPropInput)),\n }\n}\n"],"mappings":";;;;AAYA,MAAM,4BAA4B;AAClC,MAAM,mCAAmC;AAIzC,MAAM,2CAA2B,IAAI,IAA2C;CAC9E,CAAC,QAAQ,MAAM;CACf,CAAC,QAAQ,MAAM;CACf,CAAC,SAAS,OAAO;CACjB,CAAC,QAAQ,MAAM;CACf,CAAC,OAAO,KAAK;CACb,CAAC,UAAU,QAAQ;CACnB,CAAC,UAAU,MAAM;CACjB,CAAC,UAAU,MAAM;CACjB,CAAC,WAAW,OAAO;CACnB,CAAC,UAAU,MAAM;CACjB,CAAC,SAAS,KAAK;CACf,CAAC,YAAY,QAAQ;CACrB,CAAC,MAAM,IAAI;CACX,CAAC,QAAQ,IAAI;CACb,CAAC,QAAQ,IAAI;AACf,CAAC;AAED,SAAS,qBAAqB,WAAoB;CAChD,OAAO,yBAAyB,IAAI,SAAS;AAC/C;AAEA,SAAS,wBAAwB,KAAc;CAC7C,IAAI,QAAQ,QACV,OAAO,CAAC;CAEV,MAAM,SAAS,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,GAAG;CAC9C,MAAM,aAA6C,CAAC;CACpD,OAAO,SAAS,SAAS;EACvB,MAAM,SAAS,qBAAqB,IAAI;EACxC,IAAI,WAAW,QACb;EAEF,IAAI,CAAC,WAAW,SAAS,MAAM,GAC7B,WAAW,KAAK,MAAM;CAE1B,CAAC;CACD,MAAM,sBAAsB,WAAW,QAAQ,SAA8D,SAAS,IAAI;CAC1H,IAAI,oBAAoB,SAAS,GAC/B,OAAO;CAET,IAAI,WAAW,SAAS,IAAI,GAC1B,OAAO,CAAC,IAAI;CAEd,OAAO,CAAC,IAAI;AACd;AAEA,SAAS,iBAAiB,QAA6B,SAA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5B,mCAAmC,kCACpC,GAAG,0BACD;CACJ,MAAM,iBAAkB,YAAoB;CAC5C,MAAM,2BAA2B,kBAAkB,OAAO,mBAAmB,YAAY,OAAO,KAAK,cAAc,CAAC,CAAC,SAAS,IACzH,iBACD;CACJ,MAAM,mBAAmB,oFACpB;CACL,MAAM,4BAA4B,QAAQ,SAAS,gBAAgB;CACnE,MAAM,uBAAuB,WAAiC;EAC5D,MAAM,OAAO,EAAE,GAAI,gDAAU,CAAC,EAAG;EACjC,IAAI,CAAC,2BACH,OAAO;EAET,IAAI,CAAC,OAAO,MAAM,uBAAuB,GACvC,KAAK,2BAA2B;GAAE,MAAM;GAAQ,OAAO;EAAG;EAE5D,IAAI,CAAC,OAAO,MAAM,mBAAmB,GACnC,KAAK,uBAAuB;GAAE,MAAM;GAAM,OAAO;EAAK;EAExD,IAAI,CAAC,OAAO,MAAM,oBAAoB,GACpC,KAAK,wBAAwB;GAAE,MAAM;GAAM,OAAO;EAAK;EAEzD,OAAO;CACT;CAEA,IAAI,kBAAkB;EACpB,MAAM,EACJ,YAAY,UACZ,GAAG,SACD;EACJ,MAAM,+BAA+B,mBACjC,qBACE,4BAA4B,kBAAyB,kBAAkB,IACtE,mBACH;EACJ,MAAM,qBAAqB,kBAAkB,OAAO,kBAAkB;EACtE,OAAO;GACL,GAAG;GACH,YAAY,oBAAoB;IAC9B,GAAG;IACH,GAAG;GACL,CAAC;EACH;CACF;CAEA,OAAO;EACL,GAAG;EACH,YAAY,oBAAoB,kBAAkB,OAAO,kBAAkB,CAAC;CAC9E;AACF"}
|
|
1
|
+
{"version":3,"file":"props.mjs","names":[],"sources":["../../../../src/runtime/define/props.ts"],"sourcesContent":["import type {\n ComponentPropsOptions,\n MiniProgramComponentPropertyOption,\n MiniProgramComponentShortProperty,\n} from '../types'\nimport {\n WEVU_SLOT_NAMES_PROP,\n WEVU_SLOT_OWNER_ID_PROP,\n WEVU_SLOT_SCOPE_KEY,\n} from '@weapp-core/constants'\nimport { hasOwn } from '../../utils'\n\nconst ALLOW_NULL_PROP_INPUT_KEY = '__wevu_allowNullPropInput'\nconst PUBLIC_ALLOW_NULL_PROP_INPUT_KEY = 'allowNullPropInput'\n\ntype NormalizedNativePropertyType = MiniProgramComponentShortProperty | FunctionConstructor | null\n\nconst NATIVE_PROPERTY_TYPE_MAP = new Map<unknown, NormalizedNativePropertyType>([\n [String, String],\n [Number, Number],\n [Boolean, Boolean],\n [Object, Object],\n [Array, Array],\n [Function, Function],\n ['String', String],\n ['Number', Number],\n ['Boolean', Boolean],\n ['Object', Object],\n ['Array', Array],\n ['Function', Function],\n [null, null],\n ['null', null],\n ['Null', null],\n])\n\nfunction toNativePropertyType(candidate: unknown) {\n return NATIVE_PROPERTY_TYPE_MAP.get(candidate)\n}\n\nfunction collectNativePropertyTypeCandidates(\n raw: unknown,\n normalized: NormalizedNativePropertyType[] = [],\n) {\n if (Array.isArray(raw)) {\n for (const item of raw) {\n collectNativePropertyTypeCandidates(item, normalized)\n }\n return normalized\n }\n const mapped = toNativePropertyType(raw)\n if (mapped !== undefined && !normalized.includes(mapped)) {\n normalized.push(mapped)\n }\n return normalized\n}\n\nfunction normalizeTypeCandidates(raw: unknown) {\n if (raw === undefined) {\n return []\n }\n const normalized = collectNativePropertyTypeCandidates(raw)\n const requiredNativeTypes = normalized.filter((item): item is Exclude<NormalizedNativePropertyType, null> => item !== null)\n if (requiredNativeTypes.length > 0) {\n return requiredNativeTypes\n }\n return [null]\n}\n\nfunction applyTypeOptions(target: Record<string, unknown>, rawType: unknown) {\n const candidates = normalizeTypeCandidates(rawType)\n if (candidates.length === 0) {\n return\n }\n\n target.type = candidates[0]\n if (candidates.length > 1) {\n const optionalTypes: NormalizedNativePropertyType[] = []\n for (const candidate of candidates.slice(1)) {\n if (!optionalTypes.includes(candidate)) {\n optionalTypes.push(candidate)\n }\n }\n if (optionalTypes.length > 0) {\n target.optionalTypes = optionalTypes\n }\n }\n}\n\nfunction preserveImplicitNativeDefault(target: Record<string, unknown>) {\n if (hasOwn(target, 'value')) {\n return\n }\n if (target.type === String) {\n target.value = ''\n }\n else if (target.type === Number) {\n target.value = 0\n }\n else if (target.type === Boolean) {\n target.value = false\n }\n else if (target.type === Array) {\n target.value = []\n }\n}\n\nfunction applyNullableTransportOptions(\n target: Record<string, unknown>,\n definition: unknown,\n allowNullPropInput: boolean,\n) {\n if (!allowNullPropInput || target.type === null) {\n return\n }\n const definitionRecord = definition && typeof definition === 'object' && !Array.isArray(definition)\n ? (definition as Record<string, unknown>)\n : undefined\n const candidates = collectNativePropertyTypeCandidates(\n definitionRecord\n ? [definitionRecord.type, definitionRecord.optionalTypes]\n : definition,\n )\n const explicitlyNullable = candidates.includes(null)\n const nativeTypes = candidates.filter(candidate => candidate !== null)\n const acceptsMultipleNativeTypes = nativeTypes.length > 1\n const acceptsMissingInput = definitionRecord?.required !== true\n // glass-easel 会先按主 type 校验并转换,optionalTypes 无法保护合法的联合值与空值传输。\n if (!explicitlyNullable && !acceptsMultipleNativeTypes && !acceptsMissingInput) {\n return\n }\n\n // 显式声明的 null 必须保持可观察;其余降级场景则保留原主类型的宿主隐式默认值。\n if (!explicitlyNullable) {\n preserveImplicitNativeDefault(target)\n }\n target.type = null\n delete target.optionalTypes\n}\n\nfunction normalizeVueProps(\n props: ComponentPropsOptions | undefined,\n allowNullPropInput: boolean,\n) {\n const properties: Record<string, any> = {}\n if (!props) {\n return properties\n }\n\n Object.entries(props).forEach(([key, definition]) => {\n if (definition === undefined) {\n return\n }\n if (definition === null) {\n properties[key] = { type: null }\n return\n }\n if (Array.isArray(definition) || typeof definition === 'function') {\n const propOptions: Record<string, unknown> = {}\n applyTypeOptions(propOptions, definition)\n if (!hasOwn(propOptions, 'type')) {\n propOptions.type = null\n }\n applyNullableTransportOptions(propOptions, definition, allowNullPropInput)\n properties[key] = propOptions\n return\n }\n if (typeof definition === 'object') {\n // 在 Vue <script setup> 中,defineModel() 会生成空的 modifiers props。\n if (key.endsWith('Modifiers') && Object.keys(definition).length === 0) {\n properties[key] = { type: Object, value: {} }\n return\n }\n const propOptions: Record<string, unknown> = {}\n if ('type' in definition && definition.type !== undefined) {\n applyTypeOptions(propOptions, (definition as any).type)\n }\n if (Array.isArray((definition as any).optionalTypes)) {\n const optionalTypes = (definition as any).optionalTypes.map((item: unknown) => toNativePropertyType(item)).filter((item: unknown): item is Exclude<NormalizedNativePropertyType, null> => item !== undefined && item !== null)\n if (optionalTypes.length > 0) {\n const existingOptionalTypes = Array.isArray(propOptions.optionalTypes)\n ? propOptions.optionalTypes as NormalizedNativePropertyType[]\n : []\n for (const optionalType of optionalTypes) {\n if (optionalType === propOptions.type) {\n continue\n }\n if (!existingOptionalTypes.includes(optionalType)) {\n existingOptionalTypes.push(optionalType)\n }\n }\n if (existingOptionalTypes.length > 0) {\n propOptions.optionalTypes = existingOptionalTypes\n }\n }\n }\n if ('observer' in definition && (typeof (definition as any).observer === 'function' || typeof (definition as any).observer === 'string')) {\n propOptions.observer = (definition as any).observer\n }\n const defaultValue = 'default' in definition ? (definition as any).default : (definition as any).value\n if (defaultValue !== undefined) {\n propOptions.value = typeof defaultValue === 'function' ? (defaultValue as any)() : defaultValue\n }\n if (!hasOwn(propOptions, 'type')) {\n propOptions.type = null\n }\n applyNullableTransportOptions(propOptions, definition, allowNullPropInput)\n properties[key] = propOptions\n }\n })\n\n return properties\n}\n\nexport function normalizeProps(\n baseOptions: Record<string, any>,\n props?: ComponentPropsOptions,\n explicitProperties?: MiniProgramComponentPropertyOption,\n) {\n const allowNullPropInput = Boolean(\n (baseOptions as any)[ALLOW_NULL_PROP_INPUT_KEY]\n ?? (baseOptions as any)[PUBLIC_ALLOW_NULL_PROP_INPUT_KEY],\n )\n const {\n [ALLOW_NULL_PROP_INPUT_KEY]: _ignoredAllowNullPropInput,\n [PUBLIC_ALLOW_NULL_PROP_INPUT_KEY]: _ignoredPublicAllowNullPropInput,\n ...normalizedBaseOptions\n } = baseOptions\n const baseProperties = (baseOptions as any).properties\n const normalizedBaseProperties = baseProperties && typeof baseProperties === 'object' && Object.keys(baseProperties).length > 0\n ? (baseProperties as any)\n : undefined\n const resolvedExplicit = explicitProperties\n ?? normalizedBaseProperties\n const shouldAttachInternalProps = Boolean(props || resolvedExplicit)\n const attachInternalProps = (source?: Record<string, any>) => {\n const next = { ...(source ?? {}) }\n if (!shouldAttachInternalProps) {\n return next\n }\n if (!hasOwn(next, WEVU_SLOT_OWNER_ID_PROP)) {\n next[WEVU_SLOT_OWNER_ID_PROP] = { type: String, value: '' }\n }\n if (!hasOwn(next, WEVU_SLOT_SCOPE_KEY)) {\n next[WEVU_SLOT_SCOPE_KEY] = { type: null, value: null }\n }\n if (!hasOwn(next, WEVU_SLOT_NAMES_PROP)) {\n next[WEVU_SLOT_NAMES_PROP] = { type: null, value: null }\n }\n return next\n }\n\n if (resolvedExplicit) {\n const {\n properties: _ignored,\n ...rest\n } = normalizedBaseOptions\n const normalizedExplicitProperties = resolvedExplicit\n const normalizedVueProps = normalizeVueProps(props, allowNullPropInput)\n return {\n ...rest,\n properties: attachInternalProps({\n ...normalizedVueProps,\n ...normalizedExplicitProperties,\n }),\n }\n }\n\n return {\n ...normalizedBaseOptions,\n properties: attachInternalProps(normalizeVueProps(props, allowNullPropInput)),\n }\n}\n"],"mappings":";;;;AAYA,MAAM,4BAA4B;AAClC,MAAM,mCAAmC;AAIzC,MAAM,2CAA2B,IAAI,IAA2C;CAC9E,CAAC,QAAQ,MAAM;CACf,CAAC,QAAQ,MAAM;CACf,CAAC,SAAS,OAAO;CACjB,CAAC,QAAQ,MAAM;CACf,CAAC,OAAO,KAAK;CACb,CAAC,UAAU,QAAQ;CACnB,CAAC,UAAU,MAAM;CACjB,CAAC,UAAU,MAAM;CACjB,CAAC,WAAW,OAAO;CACnB,CAAC,UAAU,MAAM;CACjB,CAAC,SAAS,KAAK;CACf,CAAC,YAAY,QAAQ;CACrB,CAAC,MAAM,IAAI;CACX,CAAC,QAAQ,IAAI;CACb,CAAC,QAAQ,IAAI;AACf,CAA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AuB,GACvC,KAAK,2BAA2B;GAAE,MAAM;GAAQ,OAAO;EAAG;EAE5D,IAAI,CAAC,OAAO,MAAM,mBAAmB,GACnC,KAAK,uBAAuB;GAAE,MAAM;GAAM,OAAO;EAAK;EAExD,IAAI,CAAC,OAAO,MAAM,oBAAoB,GACpC,KAAK,wBAAwB;GAAE,MAAM;GAAM,OAAO;EAAK;EAEzD,OAAO;CACT;CAEA,IAAI,kBAAkB;EACpB,MAAM,EACJ,YAAY,UACZ,GAAG,SACD;EACJ,MAAM,+BAA+B;EACrC,MAAM,qBAAqB,kBAAkB,OAAO,kBAAkB;EACtE,OAAO;GACL,GAAG;GACH,YAAY,oBAAoB;IAC9B,GAAG;IACH,GAAG;GACL,CAAC;EACH;CACF;CAEA,OAAO;EACL,GAAG;EACH,YAAY,oBAAoB,kBAAkB,OAAO,kBAAkB,CAAC;CAC9E;AACF"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { requireRuntimeCapability, runtimeCapabilityRegistry } from "../capabilities.mjs";
|
|
2
|
+
import { runTeardownSteps } from "../teardown.mjs";
|
|
1
3
|
import { hasOwn } from "../../utils.mjs";
|
|
2
4
|
import { cloneSnapshotValue, isDeepEqualValue } from "../app/setData/snapshot.mjs";
|
|
3
|
-
import {
|
|
5
|
+
import { decodeWxmlEntities, resolveDatasetEventValue } from "../inlineDataset.mjs";
|
|
4
6
|
import { getOwnerProxy, getOwnerSnapshot, getOwnerTarget, subscribeOwner } from "../scopedSlots.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { WEVU_INLINE_HANDLER, WEVU_INLINE_MAP_KEY, WEVU_OWNER_HANDLER, WEVU_PROPS_DERIVED_KEYS_KEY, WEVU_PUBLIC_RUNTIME_KEY, WEVU_SLOT_FUNCTION_TOKEN, WEVU_SLOT_OWNER_ID_KEY, WEVU_SLOT_OWNER_ID_PROP, WEVU_SLOT_OWNER_KEY, WEVU_SLOT_OWNER_PROXY_KEY, WEVU_SLOT_PROPS_DATA_KEY, WEVU_SLOT_PROPS_KEY, WEVU_SLOT_SCOPE_KEY, WEVU_TEMPLATE_REFS_KEY } from "@weapp-core/constants";
|
|
7
|
+
import { WEVU_BINDING_MANIFEST_KEY, WEVU_INLINE_HANDLER, WEVU_INLINE_MAP_KEY, WEVU_LAYOUT_HOSTS_KEY, WEVU_OWNER_HANDLER, WEVU_PROPS_DERIVED_KEYS_KEY, WEVU_PUBLIC_RUNTIME_KEY, WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY, WEVU_SLOT_FUNCTION_TOKEN, WEVU_SLOT_OWNER_ID_KEY, WEVU_SLOT_OWNER_ID_PROP, WEVU_SLOT_OWNER_KEY, WEVU_SLOT_OWNER_PROXY_KEY, WEVU_SLOT_PROPS_DATA_KEY, WEVU_SLOT_PROPS_KEY, WEVU_SLOT_SCOPE_KEY, WEVU_TEMPLATE_REFS_KEY } from "@weapp-core/constants";
|
|
7
8
|
|
|
8
9
|
//#region src/runtime/define/scopedSlotOptions.ts
|
|
9
10
|
const SCOPED_SLOT_SNAPSHOT_OMIT_KEYS = [
|
|
@@ -15,16 +16,6 @@ const SCOPED_SLOT_SNAPSHOT_OMIT_KEYS = [
|
|
|
15
16
|
WEVU_SLOT_PROPS_KEY,
|
|
16
17
|
WEVU_SLOT_SCOPE_KEY
|
|
17
18
|
];
|
|
18
|
-
const AMP_RE = /&/g;
|
|
19
|
-
const QUOT_RE = /"/g;
|
|
20
|
-
const NUM_QUOT_RE = /"/g;
|
|
21
|
-
const APOS_RE = /'/g;
|
|
22
|
-
const NUM_APOS_RE = /'/g;
|
|
23
|
-
const LT_RE = /</g;
|
|
24
|
-
const GT_RE = />/g;
|
|
25
|
-
function decodeWxmlEntities(value) {
|
|
26
|
-
return value.replace(AMP_RE, "&").replace(QUOT_RE, "\"").replace(NUM_QUOT_RE, "\"").replace(APOS_RE, "'").replace(NUM_APOS_RE, "'").replace(LT_RE, "<").replace(GT_RE, ">");
|
|
27
|
-
}
|
|
28
19
|
function parseInlineArgs(event) {
|
|
29
20
|
var _ref, _event$currentTarget$, _event$currentTarget, _event$target;
|
|
30
21
|
const dataset = (_ref = (_event$currentTarget$ = event === null || event === void 0 || (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.dataset) !== null && _event$currentTarget$ !== void 0 ? _event$currentTarget$ : event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.dataset) !== null && _ref !== void 0 ? _ref : {};
|
|
@@ -279,12 +270,18 @@ function createScopedSlotData() {
|
|
|
279
270
|
}
|
|
280
271
|
function createScopedSlotOptions(overrides) {
|
|
281
272
|
const scopedSlotComputed = overrides === null || overrides === void 0 ? void 0 : overrides.computed;
|
|
273
|
+
const layoutHosts = overrides === null || overrides === void 0 ? void 0 : overrides.layoutHosts;
|
|
282
274
|
const templateRefs = overrides === null || overrides === void 0 ? void 0 : overrides.templateRefs;
|
|
275
|
+
if (templateRefs === null || templateRefs === void 0 ? void 0 : templateRefs.length) requireRuntimeCapability("templateRefs", "createWevuScopedSlotComponent(templateRefs)");
|
|
276
|
+
const hasInlineMap = Boolean((overrides === null || overrides === void 0 ? void 0 : overrides.inlineMap) && Object.keys(overrides.inlineMap).length);
|
|
277
|
+
if (hasInlineMap) requireRuntimeCapability("inlineEvents", "createWevuScopedSlotComponent(inlineMap)");
|
|
278
|
+
if (layoutHosts === null || layoutHosts === void 0 ? void 0 : layoutHosts.length) requireRuntimeCapability("layout", "createWevuScopedSlotComponent(layoutHosts)");
|
|
283
279
|
const resolveTemplateRefOwner = (instance) => {
|
|
284
280
|
const ownerId = resolveBoundOwnerId(instance);
|
|
285
281
|
return ownerId ? getOwnerTarget(ownerId) : void 0;
|
|
286
282
|
};
|
|
287
283
|
const baseOptions = {
|
|
284
|
+
[WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY]: true,
|
|
288
285
|
options: { virtualHost: true },
|
|
289
286
|
setData: { omit: SCOPED_SLOT_SNAPSHOT_OMIT_KEYS },
|
|
290
287
|
[WEVU_PROPS_DERIVED_KEYS_KEY]: SCOPED_SLOT_SNAPSHOT_OMIT_KEYS,
|
|
@@ -327,23 +324,40 @@ function createScopedSlotOptions(overrides) {
|
|
|
327
324
|
syncScopedSlotBindings(this, scopedSlotComputed);
|
|
328
325
|
flushScopedSlotComputedBindings(this, scopedSlotComputed, { force: true });
|
|
329
326
|
const owner = resolveTemplateRefOwner(this);
|
|
330
|
-
if (owner
|
|
327
|
+
if (owner && (templateRefs === null || templateRefs === void 0 ? void 0 : templateRefs.length)) {
|
|
328
|
+
var _runtimeCapabilityReg;
|
|
329
|
+
(_runtimeCapabilityReg = runtimeCapabilityRegistry.templateRefs) === null || _runtimeCapabilityReg === void 0 || _runtimeCapabilityReg.schedule(this, void 0, owner);
|
|
330
|
+
}
|
|
331
331
|
},
|
|
332
332
|
detached() {
|
|
333
333
|
const owner = resolveTemplateRefOwner(this);
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
334
|
+
runTeardownSteps([
|
|
335
|
+
() => {
|
|
336
|
+
if (owner && (templateRefs === null || templateRefs === void 0 ? void 0 : templateRefs.length)) {
|
|
337
|
+
var _runtimeCapabilityReg2;
|
|
338
|
+
(_runtimeCapabilityReg2 = runtimeCapabilityRegistry.templateRefs) === null || _runtimeCapabilityReg2 === void 0 || _runtimeCapabilityReg2.clear(this, owner);
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
() => {
|
|
342
|
+
if (typeof this.__wvOwnerUnsub === "function") this.__wvOwnerUnsub();
|
|
343
|
+
},
|
|
344
|
+
() => {
|
|
345
|
+
this.__wvOwnerUnsub = void 0;
|
|
346
|
+
this.__wvOwnerBoundId = "";
|
|
347
|
+
},
|
|
348
|
+
() => setOwnerProxy(this, void 0)
|
|
349
|
+
]);
|
|
339
350
|
}
|
|
340
351
|
},
|
|
341
352
|
methods: { [WEVU_OWNER_HANDLER](event) {
|
|
342
353
|
var _wevu, _ref4, _event$currentTarget$2, _event$currentTarget2, _event$target2;
|
|
343
354
|
const owner = this[WEVU_SLOT_OWNER_PROXY_KEY];
|
|
344
355
|
const inlineMap = (_wevu = this.__wevu) === null || _wevu === void 0 || (_wevu = _wevu.methods) === null || _wevu === void 0 ? void 0 : _wevu[WEVU_INLINE_MAP_KEY];
|
|
345
|
-
|
|
346
|
-
|
|
356
|
+
if (hasInlineMap) {
|
|
357
|
+
var _runtimeCapabilityReg3;
|
|
358
|
+
const result = (_runtimeCapabilityReg3 = runtimeCapabilityRegistry.inlineEvents) === null || _runtimeCapabilityReg3 === void 0 ? void 0 : _runtimeCapabilityReg3.run(owner, void 0, event, inlineMap);
|
|
359
|
+
if (result !== void 0) return result;
|
|
360
|
+
}
|
|
347
361
|
if (!owner) return;
|
|
348
362
|
const dataset = (_ref4 = (_event$currentTarget$2 = event === null || event === void 0 || (_event$currentTarget2 = event.currentTarget) === null || _event$currentTarget2 === void 0 ? void 0 : _event$currentTarget2.dataset) !== null && _event$currentTarget$2 !== void 0 ? _event$currentTarget$2 : event === null || event === void 0 || (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.dataset) !== null && _ref4 !== void 0 ? _ref4 : {};
|
|
349
363
|
const handlerName = resolveDatasetEventValue(dataset, "wvHandler", event);
|
|
@@ -360,6 +374,8 @@ function createScopedSlotOptions(overrides) {
|
|
|
360
374
|
[WEVU_INLINE_MAP_KEY]: overrides.inlineMap
|
|
361
375
|
};
|
|
362
376
|
if (templateRefs === null || templateRefs === void 0 ? void 0 : templateRefs.length) baseOptions[WEVU_TEMPLATE_REFS_KEY] = templateRefs;
|
|
377
|
+
if (layoutHosts === null || layoutHosts === void 0 ? void 0 : layoutHosts.length) baseOptions[WEVU_LAYOUT_HOSTS_KEY] = layoutHosts;
|
|
378
|
+
if (overrides === null || overrides === void 0 ? void 0 : overrides[WEVU_BINDING_MANIFEST_KEY]) baseOptions[WEVU_BINDING_MANIFEST_KEY] = overrides[WEVU_BINDING_MANIFEST_KEY];
|
|
363
379
|
return baseOptions;
|
|
364
380
|
}
|
|
365
381
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scopedSlotOptions.mjs","names":[],"sources":["../../../../src/runtime/define/scopedSlotOptions.ts"],"sourcesContent":["import type { InlineExpressionMap } from '../register/inline'\nimport type { TemplateRefBinding } from '../templateRefs'\nimport type { ComputedDefinitions } from '../types'\nimport {\n WEVU_INLINE_HANDLER,\n WEVU_INLINE_MAP_KEY,\n WEVU_OWNER_HANDLER,\n WEVU_PROPS_DERIVED_KEYS_KEY,\n WEVU_PUBLIC_RUNTIME_KEY,\n WEVU_SLOT_FUNCTION_TOKEN,\n WEVU_SLOT_OWNER_ID_KEY,\n WEVU_SLOT_OWNER_ID_PROP,\n WEVU_SLOT_OWNER_KEY,\n WEVU_SLOT_OWNER_PROXY_KEY,\n WEVU_SLOT_PROPS_DATA_KEY,\n WEVU_SLOT_PROPS_KEY,\n WEVU_SLOT_SCOPE_KEY,\n WEVU_TEMPLATE_REFS_KEY,\n} from '@weapp-core/constants'\nimport { hasOwn } from '../../utils'\nimport { cloneSnapshotValue, isDeepEqualValue } from '../app/setData/snapshot'\nimport { resolveDatasetEventValue, runInlineExpression } from '../register/inline'\nimport { getOwnerProxy, getOwnerSnapshot, getOwnerTarget, subscribeOwner } from '../scopedSlots'\nimport { clearTemplateRefs, scheduleTemplateRefUpdate } from '../templateRefs'\n\nconst SCOPED_SLOT_SNAPSHOT_OMIT_KEYS = [\n WEVU_SLOT_OWNER_ID_KEY,\n WEVU_SLOT_OWNER_ID_PROP,\n WEVU_SLOT_OWNER_PROXY_KEY,\n WEVU_SLOT_OWNER_KEY,\n WEVU_SLOT_PROPS_DATA_KEY,\n WEVU_SLOT_PROPS_KEY,\n WEVU_SLOT_SCOPE_KEY,\n]\n\nconst AMP_RE = /&/g\nconst QUOT_RE = /"/g\nconst NUM_QUOT_RE = /"/g\nconst APOS_RE = /'/g\nconst NUM_APOS_RE = /'/g\nconst LT_RE = /</g\nconst GT_RE = />/g\n\nfunction decodeWxmlEntities(value: string) {\n return value\n .replace(AMP_RE, '&')\n .replace(QUOT_RE, '\"')\n .replace(NUM_QUOT_RE, '\"')\n .replace(APOS_RE, '\\'')\n .replace(NUM_APOS_RE, '\\'')\n .replace(LT_RE, '<')\n .replace(GT_RE, '>')\n}\n\nfunction parseInlineArgs(event: any) {\n const dataset = event?.currentTarget?.dataset ?? event?.target?.dataset ?? {}\n const argsRaw = resolveDatasetEventValue(dataset, 'wvArgs', event)\n let args: any[] = []\n if (Array.isArray(argsRaw)) {\n args = argsRaw\n }\n else if (typeof argsRaw === 'string') {\n try {\n args = JSON.parse(argsRaw)\n }\n catch {\n try {\n args = JSON.parse(decodeWxmlEntities(argsRaw))\n }\n catch {\n args = []\n }\n }\n }\n if (!Array.isArray(args)) {\n args = []\n }\n return args.map((item: any) => item === '$event' ? event : item)\n}\n\nfunction normalizeSlotBindings(value: unknown): Record<string, any> {\n if (!value || typeof value !== 'object') {\n return {}\n }\n if (Array.isArray(value)) {\n const result: Record<string, any> = {}\n for (let i = 0; i < value.length; i += 2) {\n const key = value[i]\n if (typeof key === 'string' && key) {\n result[key] = value[i + 1]\n }\n }\n return result\n }\n return value as Record<string, any>\n}\n\nfunction isSlotFunctionDescriptor(value: unknown): value is [string, string, unknown[], unknown[]] {\n return Array.isArray(value)\n && value[0] === WEVU_SLOT_FUNCTION_TOKEN\n && typeof value[1] === 'string'\n}\n\nfunction createSlotFunctionProxy(instance: any, descriptor: [string, string, unknown[], unknown[]]) {\n return (...args: unknown[]) => {\n const owner = instance?.selectOwnerComponent?.()\n const handler = owner?.[WEVU_INLINE_HANDLER]\n if (typeof handler !== 'function') {\n return undefined\n }\n const dataset: Record<string, unknown> = {\n wd: 1,\n wi: descriptor[1],\n }\n const scopeBindings = Array.isArray(descriptor[2]) ? descriptor[2] : []\n const indexBindings = Array.isArray(descriptor[3]) ? descriptor[3] : []\n scopeBindings.forEach((value, index) => dataset[`wvS${index}`] = value)\n indexBindings.forEach((value, index) => dataset[`wvI${index}`] = value)\n const event = {\n type: 'wv-slot-function',\n detail: args,\n currentTarget: { dataset },\n target: { dataset },\n }\n return handler.call(owner, event)\n }\n}\n\nfunction resolveRuntimeSlotBindings(instance: any, bindings: Record<string, any>) {\n const resolved: Record<string, any> = {}\n for (const [key, value] of Object.entries(bindings)) {\n resolved[key] = isSlotFunctionDescriptor(value) ? createSlotFunctionProxy(instance, value) : value\n }\n return resolved\n}\n\nfunction resolveComputedContext(instance: any) {\n return instance?.__wevu?.proxy\n ?? instance?.[WEVU_PUBLIC_RUNTIME_KEY]?.proxy\n ?? instance\n}\n\nfunction collectComputedPayload(instance: any, computed?: ComputedDefinitions) {\n if (!computed || Object.keys(computed).length === 0) {\n return undefined\n }\n\n const context = resolveComputedContext(instance)\n const payload: Record<string, any> = {}\n for (const [key, definition] of Object.entries(computed)) {\n try {\n let value: any\n if (typeof definition === 'function') {\n value = definition.call(context)\n }\n else if (typeof (definition as any)?.get === 'function') {\n value = (definition as any).get.call(context)\n }\n if (value !== undefined) {\n payload[key] = value\n }\n }\n catch {\n }\n }\n return payload\n}\n\nfunction flushOwnerProxyBindings(instance: any) {\n instance?.__wevu?.__wevu_flushSetupSnapshotSync?.()\n}\n\nfunction flushScopedSlotComputedBindings(\n instance: any,\n computed?: ComputedDefinitions,\n options?: { force?: boolean },\n) {\n flushOwnerProxyBindings(instance)\n const payload = collectComputedPayload(instance, computed)\n if (!payload || typeof instance?.setData !== 'function') {\n return\n }\n const hasPrevious = hasOwn(instance, '__wvScopedSlotComputedSnapshot')\n const previous = instance.__wvScopedSlotComputedSnapshot ?? {}\n const next: Record<string, any> = {}\n const changed: Record<string, any> = {}\n for (const [key, value] of Object.entries(payload)) {\n next[key] = cloneSnapshotValue(value)\n if (options?.force || !hasPrevious || !hasOwn(previous, key) || !isDeepEqualValue(previous[key], value, 20, { keys: 10_000 })) {\n changed[key] = value\n }\n }\n for (const key of Object.keys(previous)) {\n if (!hasOwn(payload, key)) {\n changed[key] = null\n }\n }\n instance.__wvScopedSlotComputedSnapshot = next\n if (Object.keys(changed).length > 0) {\n instance.setData(changed)\n }\n}\n\nfunction syncSlotPropsData(\n instance: any,\n override?: { [WEVU_SLOT_SCOPE_KEY]?: unknown, [WEVU_SLOT_PROPS_KEY]?: unknown },\n) {\n const scopeSource = hasOwn(override ?? {}, WEVU_SLOT_SCOPE_KEY)\n ? (override as any)[WEVU_SLOT_SCOPE_KEY]\n : instance?.properties?.[WEVU_SLOT_SCOPE_KEY]\n const propsSource = hasOwn(override ?? {}, WEVU_SLOT_PROPS_KEY)\n ? (override as any)[WEVU_SLOT_PROPS_KEY]\n : instance?.properties?.[WEVU_SLOT_PROPS_KEY]\n const scope = normalizeSlotBindings(scopeSource)\n const slotProps = normalizeSlotBindings(propsSource)\n const snapshot = { ...scope, ...slotProps }\n const snapshotChanged = !hasOwn(instance, '__wvSlotPropsSnapshot')\n || !isDeepEqualValue(\n instance.__wvSlotPropsSnapshot ?? {},\n snapshot,\n 20,\n { keys: 10_000 },\n )\n const merged = snapshotChanged || !instance[WEVU_SLOT_PROPS_DATA_KEY]\n ? resolveRuntimeSlotBindings(instance, snapshot)\n : instance[WEVU_SLOT_PROPS_DATA_KEY]\n if (snapshotChanged) {\n instance.__wvSlotPropsSnapshot = cloneSnapshotValue(snapshot)\n }\n instance[WEVU_SLOT_PROPS_DATA_KEY] = merged\n const runtimeState = instance?.__wevu?.state\n const runtimeSnapshotChanged = Boolean(\n runtimeState\n && typeof runtimeState === 'object'\n && (\n !hasOwn(runtimeState, WEVU_SLOT_PROPS_DATA_KEY)\n || !isDeepEqualValue(\n runtimeState[WEVU_SLOT_PROPS_DATA_KEY] ?? {},\n snapshot,\n 20,\n { keys: 10_000 },\n )\n ),\n )\n if (runtimeState && typeof runtimeState === 'object') {\n runtimeState[WEVU_SLOT_PROPS_DATA_KEY] = merged\n }\n return { merged, runtimeSnapshotChanged, snapshot, snapshotChanged }\n}\n\nfunction mergeSlotProps(\n instance: any,\n computed?: ComputedDefinitions,\n override?: { [WEVU_SLOT_SCOPE_KEY]?: unknown, [WEVU_SLOT_PROPS_KEY]?: unknown },\n) {\n const { runtimeSnapshotChanged, snapshot, snapshotChanged } = syncSlotPropsData(instance, override)\n if ((snapshotChanged || runtimeSnapshotChanged) && typeof instance?.setData === 'function') {\n instance.setData({ [WEVU_SLOT_PROPS_DATA_KEY]: snapshot })\n }\n if (snapshotChanged) {\n flushScopedSlotComputedBindings(instance, computed)\n }\n}\n\nfunction setOwnerProxy(instance: any, proxy: any) {\n let changed = false\n if (instance[WEVU_SLOT_OWNER_PROXY_KEY] !== proxy) {\n instance[WEVU_SLOT_OWNER_PROXY_KEY] = proxy\n changed = true\n }\n const data = instance?.data\n if (data && typeof data === 'object' && data[WEVU_SLOT_OWNER_PROXY_KEY] !== proxy) {\n try {\n Object.defineProperty(data, WEVU_SLOT_OWNER_PROXY_KEY, {\n value: proxy,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n }\n catch {\n data[WEVU_SLOT_OWNER_PROXY_KEY] = proxy\n }\n changed = true\n }\n const runtimeState = instance?.__wevu?.state\n if (\n runtimeState\n && typeof runtimeState === 'object'\n && runtimeState[WEVU_SLOT_OWNER_PROXY_KEY] !== proxy\n ) {\n runtimeState[WEVU_SLOT_OWNER_PROXY_KEY] = proxy\n changed = true\n }\n return changed\n}\n\nfunction isSnapshotObject(value: unknown): value is Record<string, any> {\n if (!value || typeof value !== 'object') {\n return false\n }\n const prototype = Object.getPrototypeOf(value)\n return prototype === Object.prototype || prototype === null\n}\n\nfunction splitOwnerSnapshotFunctions(\n value: any,\n path: string,\n functionPayload: Record<string, any>,\n visiting: WeakSet<object>,\n): any {\n if (typeof value === 'function') {\n functionPayload[path] = value\n return undefined\n }\n if (value == null || typeof value !== 'object') {\n return value\n }\n if (visiting.has(value)) {\n return undefined\n }\n if (Array.isArray(value)) {\n visiting.add(value)\n const output = value.map((item, index) => {\n const next = splitOwnerSnapshotFunctions(item, `${path}.${index}`, functionPayload, visiting)\n return next === undefined ? null : next\n })\n visiting.delete(value)\n return output\n }\n if (!isSnapshotObject(value)) {\n return cloneSnapshotValue(value)\n }\n visiting.add(value)\n const output: Record<string, any> = {}\n for (const [key, child] of Object.entries(value)) {\n const next = splitOwnerSnapshotFunctions(child, `${path}.${key}`, functionPayload, visiting)\n if (next !== undefined) {\n output[key] = next\n }\n }\n visiting.delete(value)\n return output\n}\n\nfunction createOwnerSetDataPayload(snapshot: Record<string, any>) {\n const functionPayload: Record<string, any> = {}\n const ownerSnapshot = splitOwnerSnapshotFunctions(\n snapshot,\n WEVU_SLOT_OWNER_KEY,\n functionPayload,\n new WeakSet(),\n )\n return {\n [WEVU_SLOT_OWNER_KEY]: ownerSnapshot,\n ...functionPayload,\n }\n}\n\nfunction updateOwnerBindings(instance: any, snapshot: Record<string, any>, proxy: any, computed?: ComputedDefinitions) {\n const proxyChanged = setOwnerProxy(instance, proxy)\n const { snapshotChanged: slotPropsChanged } = syncSlotPropsData(instance)\n const nextOwnerSnapshot = snapshot || {}\n const ownerChanged = !hasOwn(instance, '__wvOwnerSnapshot')\n || !isDeepEqualValue(\n instance.__wvOwnerSnapshot ?? {},\n nextOwnerSnapshot,\n 20,\n { keys: 10_000 },\n )\n if (ownerChanged) {\n instance.__wvOwnerSnapshot = cloneSnapshotValue(nextOwnerSnapshot)\n instance[WEVU_SLOT_OWNER_KEY] = nextOwnerSnapshot\n const runtimeState = instance?.__wevu?.state\n if (runtimeState && typeof runtimeState === 'object') {\n runtimeState[WEVU_SLOT_OWNER_KEY] = nextOwnerSnapshot\n }\n }\n if (ownerChanged && typeof instance?.setData === 'function') {\n instance.setData(createOwnerSetDataPayload(nextOwnerSnapshot))\n }\n if (ownerChanged || proxyChanged || slotPropsChanged) {\n flushScopedSlotComputedBindings(instance, computed)\n }\n}\n\nfunction bindOwner(instance: any, ownerId: string, computed?: ComputedDefinitions) {\n if (!ownerId) {\n if (typeof instance?.__wvOwnerUnsub === 'function') {\n instance.__wvOwnerUnsub()\n }\n instance.__wvOwnerUnsub = undefined\n instance.__wvOwnerBoundId = ''\n setOwnerProxy(instance, undefined)\n return\n }\n\n const updateOwner = (snapshot: Record<string, any>, proxy: any) => {\n updateOwnerBindings(instance, snapshot, proxy, computed)\n }\n if (instance.__wvOwnerBoundId !== ownerId) {\n if (typeof instance.__wvOwnerUnsub === 'function') {\n instance.__wvOwnerUnsub()\n }\n instance.__wvOwnerBoundId = ownerId\n instance.__wvOwnerUnsub = subscribeOwner(ownerId, updateOwner)\n }\n const snapshot = getOwnerSnapshot(ownerId)\n if (snapshot) {\n updateOwner(snapshot, getOwnerProxy(ownerId))\n }\n}\n\nfunction resolveBoundOwnerId(instance: any) {\n return instance?.properties?.[WEVU_SLOT_OWNER_ID_PROP]\n ?? instance?.properties?.[WEVU_SLOT_OWNER_ID_KEY]\n ?? ''\n}\n\nfunction syncScopedSlotBindings(instance: any, computed?: ComputedDefinitions) {\n mergeSlotProps(instance, computed)\n const ownerId = resolveBoundOwnerId(instance)\n if (!ownerId) {\n return\n }\n bindOwner(instance, ownerId, computed)\n}\n\nfunction createScopedSlotData() {\n const data = {\n [WEVU_SLOT_OWNER_KEY]: {},\n [WEVU_SLOT_PROPS_DATA_KEY]: {},\n }\n Object.defineProperty(data, WEVU_SLOT_OWNER_PROXY_KEY, {\n value: undefined,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n return data\n}\n\nexport function createScopedSlotOptions(\n overrides?: {\n computed?: ComputedDefinitions\n inlineMap?: InlineExpressionMap\n templateRefs?: TemplateRefBinding[]\n },\n) {\n const scopedSlotComputed = overrides?.computed\n const templateRefs = overrides?.templateRefs\n const resolveTemplateRefOwner = (instance: any) => {\n const ownerId = resolveBoundOwnerId(instance)\n return ownerId ? getOwnerTarget(ownerId) : undefined\n }\n const baseOptions = {\n options: {\n virtualHost: true,\n },\n setData: {\n omit: SCOPED_SLOT_SNAPSHOT_OMIT_KEYS,\n },\n [WEVU_PROPS_DERIVED_KEYS_KEY]: SCOPED_SLOT_SNAPSHOT_OMIT_KEYS,\n properties: {\n [WEVU_SLOT_OWNER_ID_PROP]: {\n type: String,\n value: '',\n observer(this: any, next: string) {\n bindOwner(this, next || '', scopedSlotComputed)\n },\n },\n [WEVU_SLOT_OWNER_ID_KEY]: {\n type: String,\n value: '',\n observer(this: any, next: string) {\n bindOwner(this, next || '', scopedSlotComputed)\n },\n },\n [WEVU_SLOT_PROPS_KEY]: {\n type: null,\n value: null,\n observer(this: any, next: unknown) {\n mergeSlotProps(this, scopedSlotComputed, { [WEVU_SLOT_PROPS_KEY]: next })\n },\n },\n [WEVU_SLOT_SCOPE_KEY]: {\n type: null,\n value: null,\n observer(this: any, next: unknown) {\n mergeSlotProps(this, scopedSlotComputed, { [WEVU_SLOT_SCOPE_KEY]: next })\n },\n },\n },\n data: createScopedSlotData,\n lifetimes: {\n attached(this: any) {\n syncScopedSlotBindings(this, scopedSlotComputed)\n },\n ready(this: any) {\n syncScopedSlotBindings(this, scopedSlotComputed)\n flushScopedSlotComputedBindings(this, scopedSlotComputed, { force: true })\n const owner = resolveTemplateRefOwner(this)\n if (owner) {\n scheduleTemplateRefUpdate(this, undefined, owner)\n }\n },\n detached(this: any) {\n const owner = resolveTemplateRefOwner(this)\n if (owner) {\n clearTemplateRefs(this, owner)\n }\n if (typeof this.__wvOwnerUnsub === 'function') {\n this.__wvOwnerUnsub()\n }\n this.__wvOwnerUnsub = undefined\n this.__wvOwnerBoundId = ''\n setOwnerProxy(this, undefined)\n },\n },\n methods: {\n [WEVU_OWNER_HANDLER](this: any, event: any) {\n const owner = this[WEVU_SLOT_OWNER_PROXY_KEY]\n const inlineMap = (this as any).__wevu?.methods?.[WEVU_INLINE_MAP_KEY]\n const result = runInlineExpression(owner, undefined, event, inlineMap)\n if (result !== undefined) {\n return result\n }\n if (!owner) {\n return undefined\n }\n const dataset = event?.currentTarget?.dataset ?? event?.target?.dataset ?? {}\n const handlerName = resolveDatasetEventValue(dataset, 'wvHandler', event)\n if (typeof handlerName !== 'string' || !handlerName) {\n return undefined\n }\n const handler = owner?.[handlerName]\n if (typeof handler !== 'function') {\n return undefined\n }\n const args = parseInlineArgs(event)\n return handler.apply(owner, args)\n },\n },\n }\n\n if (overrides?.computed && Object.keys(overrides.computed).length > 0) {\n ;(baseOptions as any).computed = overrides.computed\n }\n if (overrides?.inlineMap && Object.keys(overrides.inlineMap).length > 0) {\n ;(baseOptions as any).methods = {\n ...(baseOptions as any).methods,\n [WEVU_INLINE_MAP_KEY]: overrides.inlineMap,\n }\n }\n if (templateRefs?.length) {\n ;(baseOptions as any)[WEVU_TEMPLATE_REFS_KEY] = templateRefs\n }\n\n return baseOptions\n}\n"],"mappings":";;;;;;;;AAyBA,MAAM,iCAAiC;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,cAAc;AACpB,MAAM,UAAU;AAChB,MAAM,cAAc;AACpB,MAAM,QAAQ;AACd,MAAM,QAAQ;AAEd,SAAS,mBAAmB,OAAe;CACzC,OAAO,MACJ,QAAQ,QAAQ,GAAG,CAAC,CACpB,QAAQ,SAAS,IAAG,CAAC,CACrB,QAAQ,aAAa,IAAG,CAAC,CACzB,QAAQ,SAAS,GAAI,CAAC,CACtB,QAAQ,aAAa,GAAI,CAAC,CAC1B,QAAQ,OAAO,GAAG,CAAC,CACnB,QAAQ,OAAO,GAAG;AACvB;AAEA,SAAS,gBAAgB,OAAY;;CACnC,MAAM,yGAAU,MAAO,2FAAe,uIAAW,MAAO,sEAAQ,8CAAW,CAAC;CAC5E,MAAM,UAAU,yBAAyB,SAAS,UAAU,KAAK;CACjE,IAAI,OAAc,CAAC;CACnB,IAAI,MAAM,QAAQ,OAAO,GACvB,OAAO;MAEJ,IAAI,OAAO,YAAY,UAC1B,IAAI;EACF,OAAO,KAAK,MAAM,OAAO;CAC3B,kBACM;EACJ,IAAI;GACF,OAAO,KAAK,MAAM,m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I,OAAO,YAAY,YACrB;GAEF,MAAM,OAAO,gBAAgB,KAAK;GAClC,OAAO,QAAQ,MAAM,OAAO,IAAI;EAClC,EACF;CACF;CAEA,2DAAI,UAAW,aAAY,OAAO,KAAK,UAAU,QAAQ,CAAC,CAAC,SAAS,GACjE,AAAC,YAAoB,WAAW,UAAU;CAE7C,2DAAI,UAAW,cAAa,OAAO,KAAK,UAAU,SAAS,CAAC,CAAC,SAAS,GACnE,AAAC,YAAoB,UAAU;EAC9B,GAAI,YAAoB;GACvB,sBAAsB,UAAU;CACnC;CAEF,gEAAI,aAAc,QACf,AAAC,YAAoB,0BAA0B;CAGlD,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"scopedSlotOptions.mjs","names":[],"sources":["../../../../src/runtime/define/scopedSlotOptions.ts"],"sourcesContent":["import type { WevuRuntimeBindingManifestV1 } from '@weapp-core/constants'\nimport type { LayoutHostBinding, TemplateRefBinding } from '../capabilities'\nimport type { InlineExpressionMap } from '../register/inline'\nimport type { ComputedDefinitions } from '../types'\nimport {\n WEVU_BINDING_MANIFEST_KEY,\n WEVU_INLINE_HANDLER,\n WEVU_INLINE_MAP_KEY,\n WEVU_LAYOUT_HOSTS_KEY,\n WEVU_OWNER_HANDLER,\n WEVU_PROPS_DERIVED_KEYS_KEY,\n WEVU_PUBLIC_RUNTIME_KEY,\n WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY,\n WEVU_SLOT_FUNCTION_TOKEN,\n WEVU_SLOT_OWNER_ID_KEY,\n WEVU_SLOT_OWNER_ID_PROP,\n WEVU_SLOT_OWNER_KEY,\n WEVU_SLOT_OWNER_PROXY_KEY,\n WEVU_SLOT_PROPS_DATA_KEY,\n WEVU_SLOT_PROPS_KEY,\n WEVU_SLOT_SCOPE_KEY,\n WEVU_TEMPLATE_REFS_KEY,\n} from '@weapp-core/constants'\nimport { hasOwn } from '../../utils'\nimport { cloneSnapshotValue, isDeepEqualValue } from '../app/setData/snapshot'\nimport { requireRuntimeCapability, runtimeCapabilityRegistry } from '../capabilities'\nimport { decodeWxmlEntities, resolveDatasetEventValue } from '../inlineDataset'\nimport { getOwnerProxy, getOwnerSnapshot, getOwnerTarget, subscribeOwner } from '../scopedSlots'\nimport { runTeardownSteps } from '../teardown'\n\nconst SCOPED_SLOT_SNAPSHOT_OMIT_KEYS = [\n WEVU_SLOT_OWNER_ID_KEY,\n WEVU_SLOT_OWNER_ID_PROP,\n WEVU_SLOT_OWNER_PROXY_KEY,\n WEVU_SLOT_OWNER_KEY,\n WEVU_SLOT_PROPS_DATA_KEY,\n WEVU_SLOT_PROPS_KEY,\n WEVU_SLOT_SCOPE_KEY,\n]\n\nfunction parseInlineArgs(event: any) {\n const dataset = event?.currentTarget?.dataset ?? event?.target?.dataset ?? {}\n const argsRaw = resolveDatasetEventValue(dataset, 'wvArgs', event)\n let args: any[] = []\n if (Array.isArray(argsRaw)) {\n args = argsRaw\n }\n else if (typeof argsRaw === 'string') {\n try {\n args = JSON.parse(argsRaw)\n }\n catch {\n try {\n args = JSON.parse(decodeWxmlEntities(argsRaw))\n }\n catch {\n args = []\n }\n }\n }\n if (!Array.isArray(args)) {\n args = []\n }\n return args.map((item: any) => item === '$event' ? event : item)\n}\n\nfunction normalizeSlotBindings(value: unknown): Record<string, any> {\n if (!value || typeof value !== 'object') {\n return {}\n }\n if (Array.isArray(value)) {\n const result: Record<string, any> = {}\n for (let i = 0; i < value.length; i += 2) {\n const key = value[i]\n if (typeof key === 'string' && key) {\n result[key] = value[i + 1]\n }\n }\n return result\n }\n return value as Record<string, any>\n}\n\nfunction isSlotFunctionDescriptor(value: unknown): value is [string, string, unknown[], unknown[]] {\n return Array.isArray(value)\n && value[0] === WEVU_SLOT_FUNCTION_TOKEN\n && typeof value[1] === 'string'\n}\n\nfunction createSlotFunctionProxy(instance: any, descriptor: [string, string, unknown[], unknown[]]) {\n return (...args: unknown[]) => {\n const owner = instance?.selectOwnerComponent?.()\n const handler = owner?.[WEVU_INLINE_HANDLER]\n if (typeof handler !== 'function') {\n return undefined\n }\n const dataset: Record<string, unknown> = {\n wd: 1,\n wi: descriptor[1],\n }\n const scopeBindings = Array.isArray(descriptor[2]) ? descriptor[2] : []\n const indexBindings = Array.isArray(descriptor[3]) ? descriptor[3] : []\n scopeBindings.forEach((value, index) => dataset[`wvS${index}`] = value)\n indexBindings.forEach((value, index) => dataset[`wvI${index}`] = value)\n const event = {\n type: 'wv-slot-function',\n detail: args,\n currentTarget: { dataset },\n target: { dataset },\n }\n return handler.call(owner, event)\n }\n}\n\nfunction resolveRuntimeSlotBindings(instance: any, bindings: Record<string, any>) {\n const resolved: Record<string, any> = {}\n for (const [key, value] of Object.entries(bindings)) {\n resolved[key] = isSlotFunctionDescriptor(value) ? createSlotFunctionProxy(instance, value) : value\n }\n return resolved\n}\n\nfunction resolveComputedContext(instance: any) {\n return instance?.__wevu?.proxy\n ?? instance?.[WEVU_PUBLIC_RUNTIME_KEY]?.proxy\n ?? instance\n}\n\nfunction collectComputedPayload(instance: any, computed?: ComputedDefinitions) {\n if (!computed || Object.keys(computed).length === 0) {\n return undefined\n }\n\n const context = resolveComputedContext(instance)\n const payload: Record<string, any> = {}\n for (const [key, definition] of Object.entries(computed)) {\n try {\n let value: any\n if (typeof definition === 'function') {\n value = definition.call(context)\n }\n else if (typeof (definition as any)?.get === 'function') {\n value = (definition as any).get.call(context)\n }\n if (value !== undefined) {\n payload[key] = value\n }\n }\n catch {\n }\n }\n return payload\n}\n\nfunction flushOwnerProxyBindings(instance: any) {\n instance?.__wevu?.__wevu_flushSetupSnapshotSync?.()\n}\n\nfunction flushScopedSlotComputedBindings(\n instance: any,\n computed?: ComputedDefinitions,\n options?: { force?: boolean },\n) {\n flushOwnerProxyBindings(instance)\n const payload = collectComputedPayload(instance, computed)\n if (!payload || typeof instance?.setData !== 'function') {\n return\n }\n const hasPrevious = hasOwn(instance, '__wvScopedSlotComputedSnapshot')\n const previous = instance.__wvScopedSlotComputedSnapshot ?? {}\n const next: Record<string, any> = {}\n const changed: Record<string, any> = {}\n for (const [key, value] of Object.entries(payload)) {\n next[key] = cloneSnapshotValue(value)\n if (options?.force || !hasPrevious || !hasOwn(previous, key) || !isDeepEqualValue(previous[key], value, 20, { keys: 10_000 })) {\n changed[key] = value\n }\n }\n for (const key of Object.keys(previous)) {\n if (!hasOwn(payload, key)) {\n changed[key] = null\n }\n }\n instance.__wvScopedSlotComputedSnapshot = next\n if (Object.keys(changed).length > 0) {\n instance.setData(changed)\n }\n}\n\nfunction syncSlotPropsData(\n instance: any,\n override?: { [WEVU_SLOT_SCOPE_KEY]?: unknown, [WEVU_SLOT_PROPS_KEY]?: unknown },\n) {\n const scopeSource = hasOwn(override ?? {}, WEVU_SLOT_SCOPE_KEY)\n ? (override as any)[WEVU_SLOT_SCOPE_KEY]\n : instance?.properties?.[WEVU_SLOT_SCOPE_KEY]\n const propsSource = hasOwn(override ?? {}, WEVU_SLOT_PROPS_KEY)\n ? (override as any)[WEVU_SLOT_PROPS_KEY]\n : instance?.properties?.[WEVU_SLOT_PROPS_KEY]\n const scope = normalizeSlotBindings(scopeSource)\n const slotProps = normalizeSlotBindings(propsSource)\n const snapshot = { ...scope, ...slotProps }\n const snapshotChanged = !hasOwn(instance, '__wvSlotPropsSnapshot')\n || !isDeepEqualValue(\n instance.__wvSlotPropsSnapshot ?? {},\n snapshot,\n 20,\n { keys: 10_000 },\n )\n const merged = snapshotChanged || !instance[WEVU_SLOT_PROPS_DATA_KEY]\n ? resolveRuntimeSlotBindings(instance, snapshot)\n : instance[WEVU_SLOT_PROPS_DATA_KEY]\n if (snapshotChanged) {\n instance.__wvSlotPropsSnapshot = cloneSnapshotValue(snapshot)\n }\n instance[WEVU_SLOT_PROPS_DATA_KEY] = merged\n const runtimeState = instance?.__wevu?.state\n const runtimeSnapshotChanged = Boolean(\n runtimeState\n && typeof runtimeState === 'object'\n && (\n !hasOwn(runtimeState, WEVU_SLOT_PROPS_DATA_KEY)\n || !isDeepEqualValue(\n runtimeState[WEVU_SLOT_PROPS_DATA_KEY] ?? {},\n snapshot,\n 20,\n { keys: 10_000 },\n )\n ),\n )\n if (runtimeState && typeof runtimeState === 'object') {\n runtimeState[WEVU_SLOT_PROPS_DATA_KEY] = merged\n }\n return { merged, runtimeSnapshotChanged, snapshot, snapshotChanged }\n}\n\nfunction mergeSlotProps(\n instance: any,\n computed?: ComputedDefinitions,\n override?: { [WEVU_SLOT_SCOPE_KEY]?: unknown, [WEVU_SLOT_PROPS_KEY]?: unknown },\n) {\n const { runtimeSnapshotChanged, snapshot, snapshotChanged } = syncSlotPropsData(instance, override)\n if ((snapshotChanged || runtimeSnapshotChanged) && typeof instance?.setData === 'function') {\n instance.setData({ [WEVU_SLOT_PROPS_DATA_KEY]: snapshot })\n }\n if (snapshotChanged) {\n flushScopedSlotComputedBindings(instance, computed)\n }\n}\n\nfunction setOwnerProxy(instance: any, proxy: any) {\n let changed = false\n if (instance[WEVU_SLOT_OWNER_PROXY_KEY] !== proxy) {\n instance[WEVU_SLOT_OWNER_PROXY_KEY] = proxy\n changed = true\n }\n const data = instance?.data\n if (data && typeof data === 'object' && data[WEVU_SLOT_OWNER_PROXY_KEY] !== proxy) {\n try {\n Object.defineProperty(data, WEVU_SLOT_OWNER_PROXY_KEY, {\n value: proxy,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n }\n catch {\n data[WEVU_SLOT_OWNER_PROXY_KEY] = proxy\n }\n changed = true\n }\n const runtimeState = instance?.__wevu?.state\n if (\n runtimeState\n && typeof runtimeState === 'object'\n && runtimeState[WEVU_SLOT_OWNER_PROXY_KEY] !== proxy\n ) {\n runtimeState[WEVU_SLOT_OWNER_PROXY_KEY] = proxy\n changed = true\n }\n return changed\n}\n\nfunction isSnapshotObject(value: unknown): value is Record<string, any> {\n if (!value || typeof value !== 'object') {\n return false\n }\n const prototype = Object.getPrototypeOf(value)\n return prototype === Object.prototype || prototype === null\n}\n\nfunction splitOwnerSnapshotFunctions(\n value: any,\n path: string,\n functionPayload: Record<string, any>,\n visiting: WeakSet<object>,\n): any {\n if (typeof value === 'function') {\n functionPayload[path] = value\n return undefined\n }\n if (value == null || typeof value !== 'object') {\n return value\n }\n if (visiting.has(value)) {\n return undefined\n }\n if (Array.isArray(value)) {\n visiting.add(value)\n const output = value.map((item, index) => {\n const next = splitOwnerSnapshotFunctions(item, `${path}.${index}`, functionPayload, visiting)\n return next === undefined ? null : next\n })\n visiting.delete(value)\n return output\n }\n if (!isSnapshotObject(value)) {\n return cloneSnapshotValue(value)\n }\n visiting.add(value)\n const output: Record<string, any> = {}\n for (const [key, child] of Object.entries(value)) {\n const next = splitOwnerSnapshotFunctions(child, `${path}.${key}`, functionPayload, visiting)\n if (next !== undefined) {\n output[key] = next\n }\n }\n visiting.delete(value)\n return output\n}\n\nfunction createOwnerSetDataPayload(snapshot: Record<string, any>) {\n const functionPayload: Record<string, any> = {}\n const ownerSnapshot = splitOwnerSnapshotFunctions(\n snapshot,\n WEVU_SLOT_OWNER_KEY,\n functionPayload,\n new WeakSet(),\n )\n return {\n [WEVU_SLOT_OWNER_KEY]: ownerSnapshot,\n ...functionPayload,\n }\n}\n\nfunction updateOwnerBindings(instance: any, snapshot: Record<string, any>, proxy: any, computed?: ComputedDefinitions) {\n const proxyChanged = setOwnerProxy(instance, proxy)\n const { snapshotChanged: slotPropsChanged } = syncSlotPropsData(instance)\n const nextOwnerSnapshot = snapshot || {}\n const ownerChanged = !hasOwn(instance, '__wvOwnerSnapshot')\n || !isDeepEqualValue(\n instance.__wvOwnerSnapshot ?? {},\n nextOwnerSnapshot,\n 20,\n { keys: 10_000 },\n )\n if (ownerChanged) {\n instance.__wvOwnerSnapshot = cloneSnapshotValue(nextOwnerSnapshot)\n instance[WEVU_SLOT_OWNER_KEY] = nextOwnerSnapshot\n const runtimeState = instance?.__wevu?.state\n if (runtimeState && typeof runtimeState === 'object') {\n runtimeState[WEVU_SLOT_OWNER_KEY] = nextOwnerSnapshot\n }\n }\n if (ownerChanged && typeof instance?.setData === 'function') {\n instance.setData(createOwnerSetDataPayload(nextOwnerSnapshot))\n }\n if (ownerChanged || proxyChanged || slotPropsChanged) {\n flushScopedSlotComputedBindings(instance, computed)\n }\n}\n\nfunction bindOwner(instance: any, ownerId: string, computed?: ComputedDefinitions) {\n if (!ownerId) {\n if (typeof instance?.__wvOwnerUnsub === 'function') {\n instance.__wvOwnerUnsub()\n }\n instance.__wvOwnerUnsub = undefined\n instance.__wvOwnerBoundId = ''\n setOwnerProxy(instance, undefined)\n return\n }\n\n const updateOwner = (snapshot: Record<string, any>, proxy: any) => {\n updateOwnerBindings(instance, snapshot, proxy, computed)\n }\n if (instance.__wvOwnerBoundId !== ownerId) {\n if (typeof instance.__wvOwnerUnsub === 'function') {\n instance.__wvOwnerUnsub()\n }\n instance.__wvOwnerBoundId = ownerId\n instance.__wvOwnerUnsub = subscribeOwner(ownerId, updateOwner)\n }\n const snapshot = getOwnerSnapshot(ownerId)\n if (snapshot) {\n updateOwner(snapshot, getOwnerProxy(ownerId))\n }\n}\n\nfunction resolveBoundOwnerId(instance: any) {\n return instance?.properties?.[WEVU_SLOT_OWNER_ID_PROP]\n ?? instance?.properties?.[WEVU_SLOT_OWNER_ID_KEY]\n ?? ''\n}\n\nfunction syncScopedSlotBindings(instance: any, computed?: ComputedDefinitions) {\n mergeSlotProps(instance, computed)\n const ownerId = resolveBoundOwnerId(instance)\n if (!ownerId) {\n return\n }\n bindOwner(instance, ownerId, computed)\n}\n\nfunction createScopedSlotData() {\n const data = {\n [WEVU_SLOT_OWNER_KEY]: {},\n [WEVU_SLOT_PROPS_DATA_KEY]: {},\n }\n Object.defineProperty(data, WEVU_SLOT_OWNER_PROXY_KEY, {\n value: undefined,\n configurable: true,\n enumerable: false,\n writable: true,\n })\n return data\n}\n\nexport function createScopedSlotOptions(\n overrides?: {\n computed?: ComputedDefinitions\n inlineMap?: InlineExpressionMap\n layoutHosts?: LayoutHostBinding[]\n templateRefs?: TemplateRefBinding[]\n [WEVU_BINDING_MANIFEST_KEY]?: WevuRuntimeBindingManifestV1\n },\n) {\n const scopedSlotComputed = overrides?.computed\n const layoutHosts = overrides?.layoutHosts\n const templateRefs = overrides?.templateRefs\n if (templateRefs?.length) {\n requireRuntimeCapability('templateRefs', 'createWevuScopedSlotComponent(templateRefs)')\n }\n const hasInlineMap = Boolean(overrides?.inlineMap && Object.keys(overrides.inlineMap).length)\n if (hasInlineMap) {\n requireRuntimeCapability('inlineEvents', 'createWevuScopedSlotComponent(inlineMap)')\n }\n if (layoutHosts?.length) {\n requireRuntimeCapability('layout', 'createWevuScopedSlotComponent(layoutHosts)')\n }\n const resolveTemplateRefOwner = (instance: any) => {\n const ownerId = resolveBoundOwnerId(instance)\n return ownerId ? getOwnerTarget(ownerId) : undefined\n }\n const baseOptions = {\n [WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY]: true,\n options: {\n virtualHost: true,\n },\n setData: {\n omit: SCOPED_SLOT_SNAPSHOT_OMIT_KEYS,\n },\n [WEVU_PROPS_DERIVED_KEYS_KEY]: SCOPED_SLOT_SNAPSHOT_OMIT_KEYS,\n properties: {\n [WEVU_SLOT_OWNER_ID_PROP]: {\n type: String,\n value: '',\n observer(this: any, next: string) {\n bindOwner(this, next || '', scopedSlotComputed)\n },\n },\n [WEVU_SLOT_OWNER_ID_KEY]: {\n type: String,\n value: '',\n observer(this: any, next: string) {\n bindOwner(this, next || '', scopedSlotComputed)\n },\n },\n [WEVU_SLOT_PROPS_KEY]: {\n type: null,\n value: null,\n observer(this: any, next: unknown) {\n mergeSlotProps(this, scopedSlotComputed, { [WEVU_SLOT_PROPS_KEY]: next })\n },\n },\n [WEVU_SLOT_SCOPE_KEY]: {\n type: null,\n value: null,\n observer(this: any, next: unknown) {\n mergeSlotProps(this, scopedSlotComputed, { [WEVU_SLOT_SCOPE_KEY]: next })\n },\n },\n },\n data: createScopedSlotData,\n lifetimes: {\n attached(this: any) {\n syncScopedSlotBindings(this, scopedSlotComputed)\n },\n ready(this: any) {\n syncScopedSlotBindings(this, scopedSlotComputed)\n flushScopedSlotComputedBindings(this, scopedSlotComputed, { force: true })\n const owner = resolveTemplateRefOwner(this)\n if (owner && templateRefs?.length) {\n runtimeCapabilityRegistry.templateRefs?.schedule(this, undefined, owner)\n }\n },\n detached(this: any) {\n const owner = resolveTemplateRefOwner(this)\n runTeardownSteps([\n () => {\n if (owner && templateRefs?.length) {\n runtimeCapabilityRegistry.templateRefs?.clear(this, owner)\n }\n },\n () => {\n if (typeof this.__wvOwnerUnsub === 'function') {\n this.__wvOwnerUnsub()\n }\n },\n () => {\n this.__wvOwnerUnsub = undefined\n this.__wvOwnerBoundId = ''\n },\n () => setOwnerProxy(this, undefined),\n ])\n },\n },\n methods: {\n [WEVU_OWNER_HANDLER](this: any, event: any) {\n const owner = this[WEVU_SLOT_OWNER_PROXY_KEY]\n const inlineMap = (this as any).__wevu?.methods?.[WEVU_INLINE_MAP_KEY]\n if (hasInlineMap) {\n const result = runtimeCapabilityRegistry.inlineEvents?.run(owner, undefined, event, inlineMap)\n if (result !== undefined) {\n return result\n }\n }\n if (!owner) {\n return undefined\n }\n const dataset = event?.currentTarget?.dataset ?? event?.target?.dataset ?? {}\n const handlerName = resolveDatasetEventValue(dataset, 'wvHandler', event)\n if (typeof handlerName !== 'string' || !handlerName) {\n return undefined\n }\n const handler = owner?.[handlerName]\n if (typeof handler !== 'function') {\n return undefined\n }\n const args = parseInlineArgs(event)\n return handler.apply(owner, args)\n },\n },\n }\n\n if (overrides?.computed && Object.keys(overrides.computed).length > 0) {\n ;(baseOptions as any).computed = overrides.computed\n }\n if (overrides?.inlineMap && Object.keys(overrides.inlineMap).length > 0) {\n ;(baseOptions as any).methods = {\n ...(baseOptions as any).methods,\n [WEVU_INLINE_MAP_KEY]: overrides.inlineMap,\n }\n }\n if (templateRefs?.length) {\n ;(baseOptions as any)[WEVU_TEMPLATE_REFS_KEY] = templateRefs\n }\n if (layoutHosts?.length) {\n ;(baseOptions as Record<string, unknown>)[WEVU_LAYOUT_HOSTS_KEY] = layoutHosts\n }\n if (overrides?.[WEVU_BINDING_MANIFEST_KEY]) {\n ;(baseOptions as Record<string, unknown>)[WEVU_BINDING_MANIFEST_KEY] = overrides[WEVU_BINDING_MANIFEST_KEY]\n }\n\n return baseOptions\n}\n"],"mappings":";;;;;;;;;AA8BA,MAAM,iCAAiC;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAS,gBAAgB,OAAY;;CACnC,MAAM,yGAAU,MAAO,2FAAe,uIAAW,MAAO,sEAAQ,8CAAW,CAAC;CAC5E,MAAM,UAAU,yBAAyB,SAAS,UAAU,KAAK;CACjE,IAAI,OAAc,CAAC;CACnB,IAAI,MAAM,QAAQ,OAAO,GACvB,OAAO;MAEJ,IAAI,OAAO,YAAY,UAC1B,IAAI;EACF,OAAO,KAAK,MAAM,OAAO;CAC3B,kBACM;EACJ,IAAI;GACF,OAAO,KAAK,MAAM,mBAAmB,OAAO,CAAC;EAC/C,mBACM;GACJ,OAAO,CAAC;EACV;CACF;CAEF,IAAI,CAAC,MAAM,QAAQ,IAAI,GACrB,OAAO,CAAC;CAEV,OAAO,KAAK,KAAK,SAAc,SAAS,WAAW,QAAQ,IAAI;AACjE;AAEA,SAAS,sBAAsB,OAAqC;CAClE,IAAI,CAAC,SAAS,OAAO,UAAU,UAC7B,OAAO,CAAC;CAEV,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,MAAM,SAA8B,CAAC;EACrC,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;GACxC,MAAM,MAAM,MAAM;GAClB,IAAI,OAAO,QAAQ,YAAY,KAC7B,OAAO,OAAO,MAAM,IAAI;EAE5B;EACA,OAAO;CACT;CACA,OAAO;AACT;AAEA,SAAS,yBAAyB,OAAiE;CACjG,OAAO,MAAM,QAAQ,KAAK,KACrB,MAAM,OAAO,4BACb,OAAO,MAAM,OAAO;AAC3B;AAEA,SAAS,wBAAwB,UAAe,YAAoD;CAClG,QAAQ,GAAG,S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,OAAO,KAAK,UAAU,SAAS,CAAC,CAAC,SAAS,GACnE,AAAC,YAAoB,UAAU;EAC9B,GAAI,YAAoB;GACvB,sBAAsB,UAAU;CACnC;CAEF,gEAAI,aAAc,QACf,AAAC,YAAoB,0BAA0B;CAElD,8DAAI,YAAa,QACd,AAAC,YAAwC,yBAAyB;CAErE,0DAAI,UAAY,4BACb,AAAC,YAAwC,6BAA6B,UAAU;CAGnF,OAAO;AACT"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { HostMiniProgramComponentPropertyOption } from "./types/miniprogramHost.mjs";
|
|
2
|
+
import { MiniProgramComponentRawOptions } from "./types/miniprogram.mjs";
|
|
3
|
+
import { ComponentPropsOptions, InferProps } from "./types/props/propTypes.mjs";
|
|
4
|
+
import { ComponentPublicInstance, ComputedDefinitions, MethodDefinitions } from "./types/core.mjs";
|
|
5
|
+
import { RuntimeApp } from "./types/runtime.mjs";
|
|
6
|
+
import { DefineComponent, ShallowUnwrapRef } from "../vue-types.mjs";
|
|
7
|
+
import { SetDataSnapshotOptions } from "./types/setData.mjs";
|
|
8
|
+
import { DefineComponentOptions } from "./types/options.mjs";
|
|
9
|
+
import "./types.mjs";
|
|
10
|
+
import { WevuRuntimeBindingManifestV1 } from "@weapp-core/constants";
|
|
11
|
+
//#region src/runtime/define.d.ts
|
|
12
|
+
/**
|
|
13
|
+
* defineComponent 返回的组件定义描述,用于手动注册或高级用法。
|
|
14
|
+
*/
|
|
15
|
+
export interface ComponentDefinition<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
16
|
+
/**
|
|
17
|
+
* 内部 runtime app(高级能力使用),不对外暴露正式 API。
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
__wevu_runtime: RuntimeApp<D, C, M>;
|
|
21
|
+
/**
|
|
22
|
+
* 内部选项快照(高级能力使用),包含 data/computed/methods 等。
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
__wevu_options: {
|
|
26
|
+
scopedSlotOwnerRequired: boolean;
|
|
27
|
+
data: () => D;
|
|
28
|
+
computed: C;
|
|
29
|
+
methods: M;
|
|
30
|
+
setData: SetDataSnapshotOptions | undefined;
|
|
31
|
+
bindingManifest?: WevuRuntimeBindingManifestV1;
|
|
32
|
+
watch: Record<string, any> | undefined;
|
|
33
|
+
setup: ((props: any, ctx: any) => any) | undefined;
|
|
34
|
+
mpOptions: MiniProgramComponentRawOptions;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
type SetupBindings<S> = Exclude<S, void> extends never ? Record<never, never> : Exclude<S, void>;
|
|
38
|
+
type ResolveProps<P> = P extends ComponentPropsOptions ? InferProps<P> : P;
|
|
39
|
+
export interface WevuComponentConstructor<Props, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> {
|
|
40
|
+
new (): ComponentPublicInstance<D, C, M, Props> & ShallowUnwrapRef<RawBindings>;
|
|
41
|
+
}
|
|
42
|
+
export type WevuDefinedComponent<PropsOrPropOptions, RawBindings, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> = DefineComponent<PropsOrPropOptions, RawBindings, D, C, M> & ComponentDefinition<D, C, M>;
|
|
43
|
+
export interface SetupContextWithTypeProps<TypeProps> {
|
|
44
|
+
props: TypeProps;
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}
|
|
47
|
+
export type SetupFunctionWithTypeProps<TypeProps> = (props: TypeProps, ctx: SetupContextWithTypeProps<TypeProps>) => Record<string, any> | void;
|
|
48
|
+
export interface DefineComponentTypePropsOptions<TypeProps> {
|
|
49
|
+
__typeProps: TypeProps;
|
|
50
|
+
setup?: SetupFunctionWithTypeProps<TypeProps>;
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
}
|
|
53
|
+
export interface DefineComponentWithTypeProps<TypeProps> {
|
|
54
|
+
new (): {
|
|
55
|
+
$props: TypeProps;
|
|
56
|
+
} & Record<string, any>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 按 Vue 3 风格定义一个小程序组件/页面。
|
|
60
|
+
*
|
|
61
|
+
* - 统一注册为 `Component()`
|
|
62
|
+
*
|
|
63
|
+
* @param options 组件定义项
|
|
64
|
+
* @returns 可手动注册的组件定义
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* defineComponent({
|
|
69
|
+
* data: () => ({ count: 0 }),
|
|
70
|
+
* setup() {
|
|
71
|
+
* onMounted(() => console.log('已挂载'))
|
|
72
|
+
* }
|
|
73
|
+
* })
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* defineComponent({
|
|
79
|
+
* setup() {
|
|
80
|
+
* onPageScroll(() => {})
|
|
81
|
+
* }
|
|
82
|
+
* })
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function defineComponent<TypeProps = any>(options: DefineComponentTypePropsOptions<TypeProps>): DefineComponentWithTypeProps<TypeProps>;
|
|
86
|
+
export declare function defineComponent<P extends ComponentPropsOptions = Record<never, never>, D extends object = Record<never, never>, C extends ComputedDefinitions = Record<never, never>, M extends MethodDefinitions = Record<never, never>, S extends Record<string, any> | void = void>(options: DefineComponentOptions<P, D, C, M, S>): WevuComponentConstructor<ResolveProps<P>, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>;
|
|
87
|
+
/**
|
|
88
|
+
* 创建不触发宿主全局注册的 Wevu 组件定义。
|
|
89
|
+
*
|
|
90
|
+
* @param options 组件选项
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
export declare function createWevuComponentDefinition(options: DefineComponentOptions<any, any, any, any, any>): WevuComponentConstructor<InferProps<ComponentPropsOptions>, Record<string, any>, Record<string, any>, ComputedDefinitions, MethodDefinitions> & ComponentDefinition<any, any, any>;
|
|
94
|
+
/**
|
|
95
|
+
* 从现有组件定义派生拥有独立应用上下文的组件定义。
|
|
96
|
+
*
|
|
97
|
+
* @param definition 已解析的 Wevu 组件定义
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
export declare function createIsolatedWevuComponentDefinition(definition: object): ComponentDefinition<any, any, any>;
|
|
101
|
+
/**
|
|
102
|
+
* 获取组件定义对应的宿主生命周期定义。
|
|
103
|
+
*
|
|
104
|
+
* @param definition Wevu 组件定义
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
export declare function getWevuComponentLifecycleDefinition(definition: object): Record<string, any> | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* 从 Vue SFC 选项创建 wevu 组件,供 weapp-vite 编译产物直接调用的兼容入口。
|
|
110
|
+
*
|
|
111
|
+
* @param options 组件选项,可能包含小程序特有的 properties
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
114
|
+
export declare function createWevuComponent<P extends ComponentPropsOptions = ComponentPropsOptions, D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions>(options: DefineComponentOptions<P, D, C, M> & {
|
|
115
|
+
properties?: HostMiniProgramComponentPropertyOption;
|
|
116
|
+
}): void;
|
|
117
|
+
//#endregion
|
|
118
|
+
//# sourceMappingURL=define.d.mts.map
|