wevu 7.0.4 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -4
- package/dist/alipay/jsx-runtime.d.mts +13 -0
- package/dist/alipay/jsx-runtime.mjs +1 -0
- package/dist/alipayIntrinsicElements/base.d.mts +4 -0
- package/dist/alipayIntrinsicElements/elements/button.d.mts +29 -0
- package/dist/alipayIntrinsicElements/elements/camera.d.mts +18 -0
- package/dist/alipayIntrinsicElements/elements/canvas.d.mts +20 -0
- package/dist/alipayIntrinsicElements/elements/checkbox-group.d.mts +11 -0
- package/dist/alipayIntrinsicElements/elements/checkbox.d.mts +14 -0
- package/dist/alipayIntrinsicElements/elements/contact-button.d.mts +15 -0
- package/dist/alipayIntrinsicElements/elements/cover-image.d.mts +11 -0
- package/dist/alipayIntrinsicElements/elements/cover-view.d.mts +11 -0
- package/dist/alipayIntrinsicElements/elements/error-view.d.mts +14 -0
- package/dist/alipayIntrinsicElements/elements/form.d.mts +12 -0
- package/dist/alipayIntrinsicElements/elements/icon.d.mts +11 -0
- package/dist/alipayIntrinsicElements/elements/image.d.mts +17 -0
- package/dist/alipayIntrinsicElements/elements/input.d.mts +31 -0
- package/dist/alipayIntrinsicElements/elements/join-group-chat.d.mts +9 -0
- package/dist/alipayIntrinsicElements/elements/label.d.mts +9 -0
- package/dist/alipayIntrinsicElements/elements/lifestyle.d.mts +11 -0
- package/dist/alipayIntrinsicElements/elements/lottie.d.mts +25 -0
- package/dist/alipayIntrinsicElements/elements/map.d.mts +44 -0
- package/dist/alipayIntrinsicElements/elements/match-media.d.mts +15 -0
- package/dist/alipayIntrinsicElements/elements/movable-area.d.mts +9 -0
- package/dist/alipayIntrinsicElements/elements/movable-view.d.mts +32 -0
- package/dist/alipayIntrinsicElements/elements/navigator.d.mts +13 -0
- package/dist/alipayIntrinsicElements/elements/page-container.d.mts +27 -0
- package/dist/alipayIntrinsicElements/elements/page-meta.d.mts +19 -0
- package/dist/alipayIntrinsicElements/elements/picker-view-column.d.mts +7 -0
- package/dist/alipayIntrinsicElements/elements/picker-view.d.mts +18 -0
- package/dist/alipayIntrinsicElements/elements/picker.d.mts +15 -0
- package/dist/alipayIntrinsicElements/elements/progress.d.mts +14 -0
- package/dist/alipayIntrinsicElements/elements/radio-group.d.mts +11 -0
- package/dist/alipayIntrinsicElements/elements/radio.d.mts +12 -0
- package/dist/alipayIntrinsicElements/elements/rich-text.d.mts +17 -0
- package/dist/alipayIntrinsicElements/elements/root-portal.d.mts +9 -0
- package/dist/alipayIntrinsicElements/elements/scroll-view.d.mts +29 -0
- package/dist/alipayIntrinsicElements/elements/share-element.d.mts +12 -0
- package/dist/alipayIntrinsicElements/elements/slider.d.mts +23 -0
- package/dist/alipayIntrinsicElements/elements/subscribe-message.d.mts +11 -0
- package/dist/alipayIntrinsicElements/elements/swiper-item.d.mts +7 -0
- package/dist/alipayIntrinsicElements/elements/swiper.d.mts +36 -0
- package/dist/alipayIntrinsicElements/elements/switch.d.mts +15 -0
- package/dist/alipayIntrinsicElements/elements/text.d.mts +12 -0
- package/dist/alipayIntrinsicElements/elements/textarea.d.mts +24 -0
- package/dist/alipayIntrinsicElements/elements/video.d.mts +39 -0
- package/dist/alipayIntrinsicElements/elements/view.d.mts +29 -0
- package/dist/alipayIntrinsicElements/elements/web-view.d.mts +13 -0
- package/dist/alipayIntrinsicElements.d.mts +94 -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/alipayIntrinsicElements/base.d.mts +5 -0
- package/dist/dev/alipayIntrinsicElements/elements/button.d.mts +30 -0
- package/dist/dev/alipayIntrinsicElements/elements/camera.d.mts +19 -0
- package/dist/dev/alipayIntrinsicElements/elements/canvas.d.mts +21 -0
- package/dist/dev/alipayIntrinsicElements/elements/checkbox-group.d.mts +12 -0
- package/dist/dev/alipayIntrinsicElements/elements/checkbox.d.mts +15 -0
- package/dist/dev/alipayIntrinsicElements/elements/contact-button.d.mts +16 -0
- package/dist/dev/alipayIntrinsicElements/elements/cover-image.d.mts +12 -0
- package/dist/dev/alipayIntrinsicElements/elements/cover-view.d.mts +12 -0
- package/dist/dev/alipayIntrinsicElements/elements/error-view.d.mts +15 -0
- package/dist/dev/alipayIntrinsicElements/elements/form.d.mts +13 -0
- package/dist/dev/alipayIntrinsicElements/elements/icon.d.mts +12 -0
- package/dist/dev/alipayIntrinsicElements/elements/image.d.mts +18 -0
- package/dist/dev/alipayIntrinsicElements/elements/input.d.mts +32 -0
- package/dist/dev/alipayIntrinsicElements/elements/join-group-chat.d.mts +10 -0
- package/dist/dev/alipayIntrinsicElements/elements/label.d.mts +10 -0
- package/dist/dev/alipayIntrinsicElements/elements/lifestyle.d.mts +12 -0
- package/dist/dev/alipayIntrinsicElements/elements/lottie.d.mts +26 -0
- package/dist/dev/alipayIntrinsicElements/elements/map.d.mts +45 -0
- package/dist/dev/alipayIntrinsicElements/elements/match-media.d.mts +16 -0
- package/dist/dev/alipayIntrinsicElements/elements/movable-area.d.mts +10 -0
- package/dist/dev/alipayIntrinsicElements/elements/movable-view.d.mts +33 -0
- package/dist/dev/alipayIntrinsicElements/elements/navigator.d.mts +14 -0
- package/dist/dev/alipayIntrinsicElements/elements/page-container.d.mts +28 -0
- package/dist/dev/alipayIntrinsicElements/elements/page-meta.d.mts +20 -0
- package/dist/dev/alipayIntrinsicElements/elements/picker-view-column.d.mts +8 -0
- package/dist/dev/alipayIntrinsicElements/elements/picker-view.d.mts +19 -0
- package/dist/dev/alipayIntrinsicElements/elements/picker.d.mts +16 -0
- package/dist/dev/alipayIntrinsicElements/elements/progress.d.mts +15 -0
- package/dist/dev/alipayIntrinsicElements/elements/radio-group.d.mts +12 -0
- package/dist/dev/alipayIntrinsicElements/elements/radio.d.mts +13 -0
- package/dist/dev/alipayIntrinsicElements/elements/rich-text.d.mts +18 -0
- package/dist/dev/alipayIntrinsicElements/elements/root-portal.d.mts +10 -0
- package/dist/dev/alipayIntrinsicElements/elements/scroll-view.d.mts +30 -0
- package/dist/dev/alipayIntrinsicElements/elements/share-element.d.mts +13 -0
- package/dist/dev/alipayIntrinsicElements/elements/slider.d.mts +24 -0
- package/dist/dev/alipayIntrinsicElements/elements/subscribe-message.d.mts +12 -0
- package/dist/dev/alipayIntrinsicElements/elements/swiper-item.d.mts +8 -0
- package/dist/dev/alipayIntrinsicElements/elements/swiper.d.mts +37 -0
- package/dist/dev/alipayIntrinsicElements/elements/switch.d.mts +16 -0
- package/dist/dev/alipayIntrinsicElements/elements/text.d.mts +13 -0
- package/dist/dev/alipayIntrinsicElements/elements/textarea.d.mts +25 -0
- package/dist/dev/alipayIntrinsicElements/elements/video.d.mts +40 -0
- package/dist/dev/alipayIntrinsicElements/elements/view.d.mts +30 -0
- package/dist/dev/alipayIntrinsicElements/elements/web-view.d.mts +14 -0
- package/dist/dev/alipayIntrinsicElements.d.mts +94 -0
- 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/jsx-runtime.d.mts +44 -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/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/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/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 +0 -4
- 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 +28 -0
- 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/ttIntrinsicElements/base.d.mts +5 -0
- package/dist/dev/ttIntrinsicElements/elements/ad.d.mts +8 -0
- package/dist/dev/ttIntrinsicElements/elements/aweme-data.d.mts +15 -0
- package/dist/dev/ttIntrinsicElements/elements/aweme-user-card.d.mts +16 -0
- package/dist/dev/ttIntrinsicElements/elements/button.d.mts +23 -0
- package/dist/dev/ttIntrinsicElements/elements/camera.d.mts +19 -0
- package/dist/dev/ttIntrinsicElements/elements/canvas.d.mts +16 -0
- package/dist/dev/ttIntrinsicElements/elements/checkbox-group.d.mts +12 -0
- package/dist/dev/ttIntrinsicElements/elements/checkbox.d.mts +12 -0
- package/dist/dev/ttIntrinsicElements/elements/draw-ad.d.mts +16 -0
- package/dist/dev/ttIntrinsicElements/elements/form.d.mts +14 -0
- package/dist/dev/ttIntrinsicElements/elements/icon.d.mts +11 -0
- package/dist/dev/ttIntrinsicElements/elements/image.d.mts +16 -0
- package/dist/dev/ttIntrinsicElements/elements/input.d.mts +32 -0
- package/dist/dev/ttIntrinsicElements/elements/label.d.mts +10 -0
- package/dist/dev/ttIntrinsicElements/elements/live-player.d.mts +19 -0
- package/dist/dev/ttIntrinsicElements/elements/live-preview.d.mts +13 -0
- package/dist/dev/ttIntrinsicElements/elements/map.d.mts +36 -0
- package/dist/dev/ttIntrinsicElements/elements/mask.d.mts +8 -0
- package/dist/dev/ttIntrinsicElements/elements/match-media.d.mts +16 -0
- package/dist/dev/ttIntrinsicElements/elements/movable-area.d.mts +10 -0
- package/dist/dev/ttIntrinsicElements/elements/movable-view.d.mts +27 -0
- package/dist/dev/ttIntrinsicElements/elements/navigator.d.mts +16 -0
- package/dist/dev/ttIntrinsicElements/elements/open-data.d.mts +15 -0
- package/dist/dev/ttIntrinsicElements/elements/picker-view-column.d.mts +8 -0
- package/dist/dev/ttIntrinsicElements/elements/picker-view.d.mts +19 -0
- package/dist/dev/ttIntrinsicElements/elements/picker.d.mts +22 -0
- package/dist/dev/ttIntrinsicElements/elements/progress.d.mts +16 -0
- package/dist/dev/ttIntrinsicElements/elements/radio-group.d.mts +12 -0
- package/dist/dev/ttIntrinsicElements/elements/radio.d.mts +12 -0
- package/dist/dev/ttIntrinsicElements/elements/rich-text.d.mts +10 -0
- package/dist/dev/ttIntrinsicElements/elements/rtc-room.d.mts +13 -0
- package/dist/dev/ttIntrinsicElements/elements/scroll-view.d.mts +32 -0
- package/dist/dev/ttIntrinsicElements/elements/slider.d.mts +19 -0
- package/dist/dev/ttIntrinsicElements/elements/swiper-item.d.mts +10 -0
- package/dist/dev/ttIntrinsicElements/elements/swiper.d.mts +27 -0
- package/dist/dev/ttIntrinsicElements/elements/switch.d.mts +14 -0
- package/dist/dev/ttIntrinsicElements/elements/text.d.mts +12 -0
- package/dist/dev/ttIntrinsicElements/elements/textarea.d.mts +34 -0
- package/dist/dev/ttIntrinsicElements/elements/video.d.mts +58 -0
- package/dist/dev/ttIntrinsicElements/elements/view.d.mts +15 -0
- package/dist/dev/ttIntrinsicElements/elements/web-view.d.mts +15 -0
- package/dist/dev/ttIntrinsicElements.d.mts +88 -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/weappIntrinsicElements/base.d.mts +5 -0
- package/dist/dev/weappIntrinsicElements/elements/ad-custom.d.mts +14 -0
- package/dist/dev/weappIntrinsicElements/elements/ad.d.mts +17 -0
- package/dist/dev/weappIntrinsicElements/elements/audio.d.mts +21 -0
- package/dist/dev/weappIntrinsicElements/elements/block.d.mts +8 -0
- package/dist/dev/weappIntrinsicElements/elements/button.d.mts +42 -0
- package/dist/dev/weappIntrinsicElements/elements/camera.d.mts +19 -0
- package/dist/dev/weappIntrinsicElements/elements/canvas.d.mts +19 -0
- package/dist/dev/weappIntrinsicElements/elements/checkbox-group.d.mts +11 -0
- package/dist/dev/weappIntrinsicElements/elements/checkbox.d.mts +13 -0
- package/dist/dev/weappIntrinsicElements/elements/cover-image.d.mts +14 -0
- package/dist/dev/weappIntrinsicElements/elements/cover-view.d.mts +10 -0
- package/dist/dev/weappIntrinsicElements/elements/editor.d.mts +23 -0
- package/dist/dev/weappIntrinsicElements/elements/form.d.mts +17 -0
- package/dist/dev/weappIntrinsicElements/elements/functional-page-navigator.d.mts +16 -0
- package/dist/dev/weappIntrinsicElements/elements/icon.d.mts +12 -0
- package/dist/dev/weappIntrinsicElements/elements/image.d.mts +19 -0
- package/dist/dev/weappIntrinsicElements/elements/import.d.mts +10 -0
- package/dist/dev/weappIntrinsicElements/elements/include.d.mts +10 -0
- package/dist/dev/weappIntrinsicElements/elements/input.d.mts +47 -0
- package/dist/dev/weappIntrinsicElements/elements/keyboard-accessory.d.mts +8 -0
- package/dist/dev/weappIntrinsicElements/elements/label.d.mts +10 -0
- package/dist/dev/weappIntrinsicElements/elements/live-player.d.mts +36 -0
- package/dist/dev/weappIntrinsicElements/elements/live-pusher.d.mts +58 -0
- package/dist/dev/weappIntrinsicElements/elements/map.d.mts +106 -0
- package/dist/dev/weappIntrinsicElements/elements/match-media.d.mts +16 -0
- package/dist/dev/weappIntrinsicElements/elements/movable-area.d.mts +27 -0
- package/dist/dev/weappIntrinsicElements/elements/movable-view.d.mts +27 -0
- package/dist/dev/weappIntrinsicElements/elements/navigation-bar.d.mts +15 -0
- package/dist/dev/weappIntrinsicElements/elements/navigator.d.mts +26 -0
- package/dist/dev/weappIntrinsicElements/elements/official-account.d.mts +14 -0
- package/dist/dev/weappIntrinsicElements/elements/open-data.d.mts +16 -0
- package/dist/dev/weappIntrinsicElements/elements/page-container.d.mts +26 -0
- package/dist/dev/weappIntrinsicElements/elements/page-meta.d.mts +24 -0
- package/dist/dev/weappIntrinsicElements/elements/picker-view-column.d.mts +19 -0
- package/dist/dev/weappIntrinsicElements/elements/picker-view.d.mts +19 -0
- package/dist/dev/weappIntrinsicElements/elements/picker.d.mts +24 -0
- package/dist/dev/weappIntrinsicElements/elements/progress.d.mts +22 -0
- package/dist/dev/weappIntrinsicElements/elements/radio-group.d.mts +11 -0
- package/dist/dev/weappIntrinsicElements/elements/radio.d.mts +13 -0
- package/dist/dev/weappIntrinsicElements/elements/rich-text.d.mts +17 -0
- package/dist/dev/weappIntrinsicElements/elements/scroll-view.d.mts +64 -0
- package/dist/dev/weappIntrinsicElements/elements/share-element.d.mts +17 -0
- package/dist/dev/weappIntrinsicElements/elements/slider.d.mts +24 -0
- package/dist/dev/weappIntrinsicElements/elements/slot.d.mts +10 -0
- package/dist/dev/weappIntrinsicElements/elements/swiper-item.d.mts +11 -0
- package/dist/dev/weappIntrinsicElements/elements/swiper.d.mts +40 -0
- package/dist/dev/weappIntrinsicElements/elements/switch.d.mts +15 -0
- package/dist/dev/weappIntrinsicElements/elements/template.d.mts +12 -0
- package/dist/dev/weappIntrinsicElements/elements/text.d.mts +15 -0
- package/dist/dev/weappIntrinsicElements/elements/textarea.d.mts +41 -0
- package/dist/dev/weappIntrinsicElements/elements/video.d.mts +72 -0
- package/dist/dev/weappIntrinsicElements/elements/view.d.mts +15 -0
- package/dist/dev/weappIntrinsicElements/elements/voip-room.d.mts +15 -0
- package/dist/dev/weappIntrinsicElements/elements/web-view.d.mts +14 -0
- package/dist/dev/weappIntrinsicElements.d.mts +114 -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 +13 -0
- package/dist/miniprogram/jsx-runtime.mjs +1 -0
- package/dist/miniprogramIntrinsicElements/base.d.mts +4 -0
- package/dist/miniprogramIntrinsicElements/elements/button.d.mts +23 -0
- package/dist/miniprogramIntrinsicElements/elements/camera.d.mts +18 -0
- package/dist/miniprogramIntrinsicElements/elements/canvas.d.mts +16 -0
- package/dist/miniprogramIntrinsicElements/elements/checkbox-group.d.mts +12 -0
- package/dist/miniprogramIntrinsicElements/elements/checkbox.d.mts +13 -0
- package/dist/miniprogramIntrinsicElements/elements/form.d.mts +13 -0
- package/dist/miniprogramIntrinsicElements/elements/icon.d.mts +12 -0
- package/dist/miniprogramIntrinsicElements/elements/image.d.mts +16 -0
- package/dist/miniprogramIntrinsicElements/elements/input.d.mts +29 -0
- package/dist/miniprogramIntrinsicElements/elements/label.d.mts +11 -0
- package/dist/miniprogramIntrinsicElements/elements/map.d.mts +31 -0
- package/dist/miniprogramIntrinsicElements/elements/match-media.d.mts +13 -0
- package/dist/miniprogramIntrinsicElements/elements/movable-area.d.mts +9 -0
- package/dist/miniprogramIntrinsicElements/elements/movable-view.d.mts +26 -0
- package/dist/miniprogramIntrinsicElements/elements/navigator.d.mts +15 -0
- package/dist/miniprogramIntrinsicElements/elements/picker-view-column.d.mts +9 -0
- package/dist/miniprogramIntrinsicElements/elements/picker-view.d.mts +20 -0
- package/dist/miniprogramIntrinsicElements/elements/picker.d.mts +14 -0
- package/dist/miniprogramIntrinsicElements/elements/progress.d.mts +12 -0
- package/dist/miniprogramIntrinsicElements/elements/radio-group.d.mts +12 -0
- package/dist/miniprogramIntrinsicElements/elements/radio.d.mts +13 -0
- package/dist/miniprogramIntrinsicElements/elements/rich-text.d.mts +11 -0
- package/dist/miniprogramIntrinsicElements/elements/scroll-view.d.mts +22 -0
- package/dist/miniprogramIntrinsicElements/elements/slider.d.mts +19 -0
- package/dist/miniprogramIntrinsicElements/elements/swiper-item.d.mts +9 -0
- package/dist/miniprogramIntrinsicElements/elements/swiper.d.mts +24 -0
- package/dist/miniprogramIntrinsicElements/elements/switch.d.mts +14 -0
- package/dist/miniprogramIntrinsicElements/elements/text.d.mts +13 -0
- package/dist/miniprogramIntrinsicElements/elements/textarea.d.mts +23 -0
- package/dist/miniprogramIntrinsicElements/elements/video.d.mts +29 -0
- package/dist/miniprogramIntrinsicElements/elements/view.d.mts +16 -0
- package/dist/miniprogramIntrinsicElements/elements/web-view.d.mts +15 -0
- package/dist/miniprogramIntrinsicElements.d.mts +70 -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/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/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/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 +13 -0
- package/dist/tt/jsx-runtime.mjs +1 -0
- package/dist/ttIntrinsicElements/base.d.mts +4 -0
- package/dist/ttIntrinsicElements/elements/ad.d.mts +7 -0
- package/dist/ttIntrinsicElements/elements/aweme-data.d.mts +14 -0
- package/dist/ttIntrinsicElements/elements/aweme-user-card.d.mts +15 -0
- package/dist/ttIntrinsicElements/elements/button.d.mts +22 -0
- package/dist/ttIntrinsicElements/elements/camera.d.mts +18 -0
- package/dist/ttIntrinsicElements/elements/canvas.d.mts +15 -0
- package/dist/ttIntrinsicElements/elements/checkbox-group.d.mts +11 -0
- package/dist/ttIntrinsicElements/elements/checkbox.d.mts +11 -0
- package/dist/ttIntrinsicElements/elements/draw-ad.d.mts +15 -0
- package/dist/ttIntrinsicElements/elements/form.d.mts +13 -0
- package/dist/ttIntrinsicElements/elements/icon.d.mts +10 -0
- package/dist/ttIntrinsicElements/elements/image.d.mts +15 -0
- package/dist/ttIntrinsicElements/elements/input.d.mts +31 -0
- package/dist/ttIntrinsicElements/elements/label.d.mts +9 -0
- package/dist/ttIntrinsicElements/elements/live-player.d.mts +18 -0
- package/dist/ttIntrinsicElements/elements/live-preview.d.mts +12 -0
- package/dist/ttIntrinsicElements/elements/map.d.mts +35 -0
- package/dist/ttIntrinsicElements/elements/mask.d.mts +7 -0
- package/dist/ttIntrinsicElements/elements/match-media.d.mts +15 -0
- package/dist/ttIntrinsicElements/elements/movable-area.d.mts +9 -0
- package/dist/ttIntrinsicElements/elements/movable-view.d.mts +26 -0
- package/dist/ttIntrinsicElements/elements/navigator.d.mts +15 -0
- package/dist/ttIntrinsicElements/elements/open-data.d.mts +14 -0
- package/dist/ttIntrinsicElements/elements/picker-view-column.d.mts +7 -0
- package/dist/ttIntrinsicElements/elements/picker-view.d.mts +18 -0
- package/dist/ttIntrinsicElements/elements/picker.d.mts +21 -0
- package/dist/ttIntrinsicElements/elements/progress.d.mts +15 -0
- package/dist/ttIntrinsicElements/elements/radio-group.d.mts +11 -0
- package/dist/ttIntrinsicElements/elements/radio.d.mts +11 -0
- package/dist/ttIntrinsicElements/elements/rich-text.d.mts +9 -0
- package/dist/ttIntrinsicElements/elements/rtc-room.d.mts +12 -0
- package/dist/ttIntrinsicElements/elements/scroll-view.d.mts +31 -0
- package/dist/ttIntrinsicElements/elements/slider.d.mts +18 -0
- package/dist/ttIntrinsicElements/elements/swiper-item.d.mts +9 -0
- package/dist/ttIntrinsicElements/elements/swiper.d.mts +26 -0
- package/dist/ttIntrinsicElements/elements/switch.d.mts +13 -0
- package/dist/ttIntrinsicElements/elements/text.d.mts +11 -0
- package/dist/ttIntrinsicElements/elements/textarea.d.mts +33 -0
- package/dist/ttIntrinsicElements/elements/video.d.mts +57 -0
- package/dist/ttIntrinsicElements/elements/view.d.mts +14 -0
- package/dist/ttIntrinsicElements/elements/web-view.d.mts +14 -0
- package/dist/ttIntrinsicElements.d.mts +88 -0
- package/dist/vue-demi.d.mts +13 -14
- package/dist/vue-demi.mjs +1 -1
- package/dist/weapp/jsx-runtime.d.mts +13 -0
- package/dist/weapp/jsx-runtime.mjs +1 -0
- package/dist/weappIntrinsicElements/base.d.mts +2 -19
- package/dist/weappIntrinsicElements/elements/ad-custom.d.mts +5 -4
- package/dist/weappIntrinsicElements/elements/ad.d.mts +6 -5
- package/dist/weappIntrinsicElements/elements/audio.d.mts +8 -7
- package/dist/weappIntrinsicElements/elements/block.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/button.d.mts +17 -15
- package/dist/weappIntrinsicElements/elements/camera.d.mts +11 -10
- package/dist/weappIntrinsicElements/elements/canvas.d.mts +9 -8
- package/dist/weappIntrinsicElements/elements/checkbox-group.d.mts +5 -7
- package/dist/weappIntrinsicElements/elements/checkbox.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/cover-image.d.mts +8 -4
- package/dist/weappIntrinsicElements/elements/cover-view.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/editor.d.mts +8 -7
- package/dist/weappIntrinsicElements/elements/form.d.mts +6 -5
- package/dist/weappIntrinsicElements/elements/functional-page-navigator.d.mts +8 -7
- package/dist/weappIntrinsicElements/elements/icon.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/image.d.mts +6 -5
- package/dist/weappIntrinsicElements/elements/import.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/include.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/input.d.mts +16 -16
- package/dist/weappIntrinsicElements/elements/keyboard-accessory.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/label.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/live-player.d.mts +17 -16
- package/dist/weappIntrinsicElements/elements/live-pusher.d.mts +18 -17
- package/dist/weappIntrinsicElements/elements/map.d.mts +17 -16
- package/dist/weappIntrinsicElements/elements/match-media.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/movable-area.d.mts +7 -6
- package/dist/weappIntrinsicElements/elements/movable-view.d.mts +7 -6
- package/dist/weappIntrinsicElements/elements/navigation-bar.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/navigator.d.mts +9 -8
- package/dist/weappIntrinsicElements/elements/official-account.d.mts +5 -4
- package/dist/weappIntrinsicElements/elements/open-data.d.mts +4 -3
- package/dist/weappIntrinsicElements/elements/page-container.d.mts +10 -9
- package/dist/weappIntrinsicElements/elements/page-meta.d.mts +6 -5
- package/dist/weappIntrinsicElements/elements/picker-view-column.d.mts +6 -5
- package/dist/weappIntrinsicElements/elements/picker-view.d.mts +6 -5
- package/dist/weappIntrinsicElements/elements/picker.d.mts +8 -7
- package/dist/weappIntrinsicElements/elements/progress.d.mts +4 -3
- package/dist/weappIntrinsicElements/elements/radio-group.d.mts +5 -7
- package/dist/weappIntrinsicElements/elements/radio.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/rich-text.d.mts +5 -5
- package/dist/weappIntrinsicElements/elements/scroll-view.d.mts +19 -23
- package/dist/weappIntrinsicElements/elements/share-element.d.mts +4 -5
- package/dist/weappIntrinsicElements/elements/slider.d.mts +5 -4
- package/dist/weappIntrinsicElements/elements/slot.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/swiper-item.d.mts +5 -36
- package/dist/weappIntrinsicElements/elements/swiper.d.mts +10 -12
- package/dist/weappIntrinsicElements/elements/switch.d.mts +4 -3
- package/dist/weappIntrinsicElements/elements/template.d.mts +2 -2
- package/dist/weappIntrinsicElements/elements/text.d.mts +4 -4
- package/dist/weappIntrinsicElements/elements/textarea.d.mts +15 -14
- package/dist/weappIntrinsicElements/elements/video.d.mts +23 -22
- package/dist/weappIntrinsicElements/elements/view.d.mts +4 -2
- package/dist/weappIntrinsicElements/elements/voip-room.d.mts +6 -5
- package/dist/weappIntrinsicElements/elements/web-view.d.mts +6 -5
- package/dist/weappIntrinsicElements.d.mts +111 -150
- package/package.json +19 -19
- package/dist/dev/jsx-runtime.mjs +0 -1
- package/dist/runtime/templateRefs.d.mts +0 -10
- /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,37 +1,30 @@
|
|
|
1
|
-
import { getScopedSlotHostGlobalObject } from "./platform.mjs";
|
|
2
|
-
import { hasOwn } from "../utils.mjs";
|
|
3
1
|
import { applyWevuComponentDefaults } from "./defaults.mjs";
|
|
4
|
-
import {
|
|
2
|
+
import { requireRuntimeCapability } from "./capabilities.mjs";
|
|
3
|
+
import { hasOwn } from "../utils.mjs";
|
|
4
|
+
import { hasBindingOutputPath, resolveBindingManifest } from "./bindingManifest.mjs";
|
|
5
5
|
import { runSetupFunction } from "./register/setup.mjs";
|
|
6
6
|
import { createRuntimeComponentDefinition } from "./define/componentDefinition.mjs";
|
|
7
7
|
import { resolveNativeInitialData } from "./define/initialComputed.mjs";
|
|
8
8
|
import { resolveVueComponentOptions } from "./define/options.mjs";
|
|
9
9
|
import { applyOptionsApiProvide, resolveOptionsApiInjections } from "./define/optionsApi.mjs";
|
|
10
10
|
import { normalizeProps } from "./define/props.mjs";
|
|
11
|
-
import { createScopedSlotOptions } from "./define/scopedSlotOptions.mjs";
|
|
12
11
|
import { applySetupResult } from "./define/setupResult.mjs";
|
|
13
|
-
import { WEVU_CSS_MODULES_KEY, WEVU_FUNCTION_PROP_PATHS_KEY,
|
|
12
|
+
import { WEVU_BINDING_MANIFEST_KEY, WEVU_CSS_MODULES_KEY, WEVU_FUNCTION_PROP_PATHS_KEY, WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY, WEVU_SLOT_OWNER_ID_KEY, WEVU_SLOT_OWNER_ID_PROP, WEVU_SLOT_SCOPE_KEY } from "@weapp-core/constants";
|
|
14
13
|
|
|
15
14
|
//#region src/runtime/define.ts
|
|
16
|
-
let scopedSlotCreator;
|
|
17
15
|
const componentLifecycleDefinitions = /* @__PURE__ */ new WeakMap();
|
|
18
|
-
function ensureScopedSlotComponentGlobal() {
|
|
19
|
-
const globalObject = getScopedSlotHostGlobalObject();
|
|
20
|
-
if (!globalObject) return;
|
|
21
|
-
const globalRecord = globalObject;
|
|
22
|
-
if (scopedSlotCreator && globalRecord[WEVU_SCOPED_SLOT_CREATOR_KEY] !== scopedSlotCreator) globalRecord[WEVU_SCOPED_SLOT_CREATOR_KEY] = scopedSlotCreator;
|
|
23
|
-
}
|
|
24
16
|
function resolveInitialDataContext(properties, methods) {
|
|
25
17
|
const context = { ...methods !== null && methods !== void 0 ? methods : {} };
|
|
26
18
|
if (!properties || typeof properties !== "object") return context;
|
|
27
19
|
for (const [name, definition] of Object.entries(properties)) if (definition && typeof definition === "object" && hasOwn(definition, "value")) context[name] = definition.value;
|
|
28
20
|
return context;
|
|
29
21
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
22
|
+
function shouldDeclareNativeSlotOwnerId(setData, bindingManifest) {
|
|
23
|
+
var _bindingManifest$feat;
|
|
24
|
+
return Array.isArray(setData === null || setData === void 0 ? void 0 : setData.pick) && setData.pick.includes(WEVU_SLOT_OWNER_ID_KEY) || (bindingManifest === null || bindingManifest === void 0 || (_bindingManifest$feat = bindingManifest.features) === null || _bindingManifest$feat === void 0 ? void 0 : _bindingManifest$feat.scopedSlots) === true && hasBindingOutputPath(bindingManifest, WEVU_SLOT_OWNER_ID_KEY);
|
|
32
25
|
}
|
|
33
|
-
function
|
|
34
|
-
return
|
|
26
|
+
function shouldSeedNativeSlotOwnerId(mpOptions) {
|
|
27
|
+
return Boolean(mpOptions.__wevu_isPage);
|
|
35
28
|
}
|
|
36
29
|
function hasScopedSlotHostProperties(mpOptions) {
|
|
37
30
|
const properties = mpOptions.properties;
|
|
@@ -57,8 +50,8 @@ function defineComponent(options) {
|
|
|
57
50
|
return createComponentDefinition(options, true);
|
|
58
51
|
}
|
|
59
52
|
function createComponentDefinition(options, registerNative) {
|
|
60
|
-
|
|
61
|
-
const
|
|
53
|
+
const { __typeProps: _typeProps, [WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY]: scopedSlotOwnerRequired, data, computed, methods, setData, watch, setup, props, inject: injectOptions, provide: provideOptions, allowFunctionProps, [WEVU_BINDING_MANIFEST_KEY]: rawBindingManifest, [WEVU_CSS_MODULES_KEY]: cssModules, ...mpOptions } = resolveVueComponentOptions(applyWevuComponentDefaults(options));
|
|
54
|
+
const bindingManifest = resolveBindingManifest(rawBindingManifest);
|
|
62
55
|
const rawFunctionPropPaths = mpOptions[WEVU_FUNCTION_PROP_PATHS_KEY];
|
|
63
56
|
const functionPropPaths = Array.isArray(rawFunctionPropPaths) ? [...new Set(rawFunctionPropPaths.filter((path) => typeof path === "string" && path.length > 0))] : [];
|
|
64
57
|
delete mpOptions[WEVU_FUNCTION_PROP_PATHS_KEY];
|
|
@@ -71,7 +64,7 @@ function createComponentDefinition(options, registerNative) {
|
|
|
71
64
|
functionPaths: functionPropPaths
|
|
72
65
|
} : setData);
|
|
73
66
|
const setupFunctionPropKeys = new Set(functionPropPaths.filter((path) => !path.includes(".")));
|
|
74
|
-
const normalizedMpOptions = normalizeProps(mpOptions, props);
|
|
67
|
+
const normalizedMpOptions = normalizeProps(mpOptions, props, mpOptions.properties);
|
|
75
68
|
const initialDataContext = resolveInitialDataContext(normalizedMpOptions.properties, methods);
|
|
76
69
|
const resolvedData = typeof data === "function" ? () => data.call(initialDataContext) : data;
|
|
77
70
|
const setupWrapper = typeof setup === "function" || injectOptions != null || provideOptions != null || cssModules ? ((props, ctx) => {
|
|
@@ -93,22 +86,28 @@ function createComponentDefinition(options, registerNative) {
|
|
|
93
86
|
return result;
|
|
94
87
|
}) : void 0;
|
|
95
88
|
const nativeData = typeof resolvedData === "function" ? resolvedData() : resolvedData;
|
|
96
|
-
const
|
|
89
|
+
const nativeOwnerId = nativeData && typeof nativeData === "object" ? Reflect.get(nativeData, WEVU_SLOT_OWNER_ID_KEY) : void 0;
|
|
90
|
+
const shouldDeclareOwnerId = shouldDeclareNativeSlotOwnerId(resolvedSetData, bindingManifest);
|
|
91
|
+
const scopedSlotHooks = shouldDeclareOwnerId ? requireRuntimeCapability("scopedSlots", "defineComponent(scoped-slot owner metadata)") : void 0;
|
|
92
|
+
const seededNativeData = shouldDeclareOwnerId ? {
|
|
97
93
|
...nativeData && typeof nativeData === "object" ? nativeData : {},
|
|
98
|
-
[WEVU_SLOT_OWNER_ID_KEY]: shouldSeedNativeSlotOwnerId(mpOptions
|
|
94
|
+
[WEVU_SLOT_OWNER_ID_KEY]: shouldSeedNativeSlotOwnerId(mpOptions) ? nativeOwnerId || (scopedSlotHooks === null || scopedSlotHooks === void 0 ? void 0 : scopedSlotHooks.allocateOwnerId()) : nativeOwnerId || ""
|
|
99
95
|
} : nativeData;
|
|
100
96
|
const nativeInitialData = resolveNativeInitialData(seededNativeData, computed, resolvedSetData, methods);
|
|
97
|
+
const mpOptionsWithProps = nativeInitialData !== void 0 ? {
|
|
98
|
+
...normalizedMpOptions,
|
|
99
|
+
data: nativeInitialData
|
|
100
|
+
} : normalizedMpOptions;
|
|
101
101
|
return materializeComponentDefinition({
|
|
102
|
+
scopedSlotOwnerRequired: scopedSlotOwnerRequired === true,
|
|
102
103
|
data: resolvedData,
|
|
103
104
|
computed,
|
|
104
105
|
methods,
|
|
105
106
|
setData: resolvedSetData,
|
|
107
|
+
bindingManifest,
|
|
106
108
|
watch,
|
|
107
109
|
setup: setupWrapper,
|
|
108
|
-
mpOptions:
|
|
109
|
-
...normalizedMpOptions,
|
|
110
|
-
data: nativeInitialData
|
|
111
|
-
} : normalizedMpOptions
|
|
110
|
+
mpOptions: mpOptionsWithProps
|
|
112
111
|
}, registerNative);
|
|
113
112
|
}
|
|
114
113
|
/**
|
|
@@ -147,26 +146,15 @@ function getWevuComponentLifecycleDefinition(definition) {
|
|
|
147
146
|
* @internal
|
|
148
147
|
*/
|
|
149
148
|
function createWevuComponent(options) {
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
};
|
|
158
|
-
defineComponent(normalizeProps(baseOptions, props, properties));
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* scoped slot 兼容组件入口(编译产物内部使用)。
|
|
162
|
-
* @internal
|
|
163
|
-
*/
|
|
164
|
-
function createWevuScopedSlotComponent(overrides) {
|
|
165
|
-
createWevuComponent(createScopedSlotOptions(overrides));
|
|
149
|
+
var _options$allowNullPro;
|
|
150
|
+
const allowNullPropInput = (_options$allowNullPro = options.allowNullPropInput) !== null && _options$allowNullPro !== void 0 ? _options$allowNullPro : true;
|
|
151
|
+
defineComponent({
|
|
152
|
+
...options,
|
|
153
|
+
allowNullPropInput,
|
|
154
|
+
__wevu_allowNullPropInput: allowNullPropInput
|
|
155
|
+
});
|
|
166
156
|
}
|
|
167
|
-
scopedSlotCreator = createWevuScopedSlotComponent;
|
|
168
|
-
ensureScopedSlotComponentGlobal();
|
|
169
157
|
|
|
170
158
|
//#endregion
|
|
171
|
-
export { createIsolatedWevuComponentDefinition, createWevuComponent, createWevuComponentDefinition,
|
|
159
|
+
export { createIsolatedWevuComponentDefinition, createWevuComponent, createWevuComponentDefinition, defineComponent, getWevuComponentLifecycleDefinition };
|
|
172
160
|
//# sourceMappingURL=define.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.mjs","names":[],"sources":["../../../src/runtime/define.ts"],"sourcesContent":["import type { RuntimeComponentDefinitionOptions } from './define/componentDefinition'\nimport type { InlineExpressionMap } from './register/inline'\nimport type { TemplateRefBinding } from './templateRefs'\nimport type {\n ComponentPropsOptions,\n ComponentPublicInstance,\n ComputedDefinitions,\n DefineComponent,\n DefineComponentOptions,\n InferProps,\n MethodDefinitions,\n MiniProgramComponentPropertyOption,\n MiniProgramComponentRawOptions,\n ShallowUnwrapRef,\n} from './types'\nimport {\n WEVU_CSS_MODULES_KEY,\n WEVU_FUNCTION_PROP_PATHS_KEY,\n WEVU_SCOPED_SLOT_CREATOR_KEY,\n WEVU_SLOT_OWNER_ID_KEY,\n WEVU_SLOT_OWNER_ID_PROP,\n WEVU_SLOT_SCOPE_KEY,\n} from '@weapp-core/constants'\nimport { hasOwn } from '../utils'\nimport { applyWevuComponentDefaults } from './defaults'\nimport {\n createRuntimeComponentDefinition,\n} from './define/componentDefinition'\nimport { resolveNativeInitialData } from './define/initialComputed'\nimport { resolveVueComponentOptions } from './define/options'\nimport { applyOptionsApiProvide, resolveOptionsApiInjections } from './define/optionsApi'\nimport { normalizeProps } from './define/props'\nimport { createScopedSlotOptions } from './define/scopedSlotOptions'\nimport { applySetupResult } from './define/setupResult'\nimport { getScopedSlotHostGlobalObject } from './platform'\nimport { runSetupFunction } from './register'\nimport { allocateOwnerId } from './scopedSlots'\n\nlet scopedSlotCreator: (() => void) | undefined\nconst componentLifecycleDefinitions = new WeakMap<object, Record<string, any>>()\n\nfunction ensureScopedSlotComponentGlobal() {\n const globalObject = getScopedSlotHostGlobalObject()\n if (!globalObject) {\n return\n }\n const globalRecord = globalObject as Record<string, any>\n if (scopedSlotCreator && globalRecord[WEVU_SCOPED_SLOT_CREATOR_KEY] !== scopedSlotCreator) {\n globalRecord[WEVU_SCOPED_SLOT_CREATOR_KEY] = scopedSlotCreator\n }\n}\n\nfunction resolveInitialDataContext(properties: unknown, methods: MethodDefinitions | undefined) {\n const context: Record<string, unknown> = { ...(methods ?? {}) }\n if (!properties || typeof properties !== 'object') {\n return context\n }\n for (const [name, definition] of Object.entries(properties)) {\n if (definition && typeof definition === 'object' && hasOwn(definition, 'value')) {\n context[name] = (definition as Record<string, unknown>).value\n }\n }\n return context\n}\n\nfunction shouldSeedNativeSlotOwnerId(\n mpOptions: Record<string, any>,\n setData: DefineComponentOptions<any, any, any, any, any>['setData'],\n) {\n return Boolean((mpOptions as any).__wevu_isPage)\n && Array.isArray(setData?.pick)\n && setData.pick.includes(WEVU_SLOT_OWNER_ID_KEY)\n}\n\nfunction shouldDeclareNativeSlotOwnerId(\n setData: DefineComponentOptions<any, any, any, any, any>['setData'],\n) {\n return Array.isArray(setData?.pick)\n && setData.pick.includes(WEVU_SLOT_OWNER_ID_KEY)\n}\n\nfunction hasScopedSlotHostProperties(mpOptions: Record<string, any>) {\n const properties = mpOptions.properties\n return Boolean(\n properties\n && typeof properties === 'object'\n && (\n WEVU_SLOT_OWNER_ID_PROP in properties\n || WEVU_SLOT_SCOPE_KEY in properties\n ),\n )\n}\n\nfunction resolveScopedSlotHostSetData(\n mpOptions: Record<string, any>,\n setData: DefineComponentOptions<any, any, any, any, any>['setData'],\n) {\n if (setData?.strategy !== 'patch' || !hasScopedSlotHostProperties(mpOptions)) {\n return setData\n }\n return {\n ...setData,\n strategy: 'diff' as const,\n }\n}\n\n/**\n * defineComponent 返回的组件定义描述,用于手动注册或高级用法。\n */\nexport interface ComponentDefinition<\n D extends object,\n C extends ComputedDefinitions,\n M extends MethodDefinitions,\n> {\n /**\n * 内部 runtime app(高级能力使用),不对外暴露正式 API。\n * @internal\n */\n __wevu_runtime: import('./types').RuntimeApp<D, C, M>\n\n /**\n * 内部选项快照(高级能力使用),包含 data/computed/methods 等。\n * @internal\n */\n __wevu_options: {\n data: () => D\n computed: C\n methods: M\n setData: import('./types').SetDataSnapshotOptions | undefined\n watch: Record<string, any> | undefined\n setup: ((props: any, ctx: any) => any) | undefined\n mpOptions: MiniProgramComponentRawOptions\n }\n}\n\nfunction materializeComponentDefinition(\n componentOptions: RuntimeComponentDefinitionOptions,\n registerNative = false,\n) {\n const { lifecycleDefinition, runtimeApp } = createRuntimeComponentDefinition(componentOptions, registerNative)\n const definition: ComponentDefinition<any, any, any> = {\n __wevu_runtime: runtimeApp as any,\n __wevu_options: componentOptions as ComponentDefinition<any, any, any>['__wevu_options'],\n }\n componentLifecycleDefinitions.set(definition, lifecycleDefinition)\n return definition\n}\n\ntype SetupBindings<S> = Exclude<S, void> extends never ? Record<string, never> : Exclude<S, void>\ntype ResolveProps<P> = P extends ComponentPropsOptions ? InferProps<P> : P\n\nexport interface WevuComponentConstructor<\n Props,\n RawBindings,\n D extends object,\n C extends ComputedDefinitions,\n M extends MethodDefinitions,\n> {\n new (): ComponentPublicInstance<D, C, M, Props> & ShallowUnwrapRef<RawBindings>\n}\n\nexport type WevuDefinedComponent<\n PropsOrPropOptions,\n RawBindings,\n D extends object,\n C extends ComputedDefinitions,\n M extends MethodDefinitions,\n> = DefineComponent<PropsOrPropOptions, RawBindings, D, C, M> & ComponentDefinition<D, C, M>\nexport interface SetupContextWithTypeProps<TypeProps> {\n props: TypeProps\n [key: string]: any\n}\nexport type SetupFunctionWithTypeProps<\n TypeProps,\n> = (\n props: TypeProps,\n ctx: SetupContextWithTypeProps<TypeProps>,\n) => Record<string, any> | void\nexport interface DefineComponentTypePropsOptions<TypeProps> {\n __typeProps: TypeProps\n setup?: SetupFunctionWithTypeProps<TypeProps>\n [key: string]: any\n}\nexport interface DefineComponentWithTypeProps<TypeProps> {\n new (): { $props: TypeProps } & Record<string, any>\n}\n\n/**\n * 按 Vue 3 风格定义一个小程序组件/页面。\n *\n * - 统一注册为 `Component()`\n *\n * @param options 组件定义项\n * @returns 可手动注册的组件定义\n *\n * @example\n * ```ts\n * defineComponent({\n * data: () => ({ count: 0 }),\n * setup() {\n * onMounted(() => console.log('已挂载'))\n * }\n * })\n * ```\n *\n * @example\n * ```ts\n * defineComponent({\n * setup() {\n * onPageScroll(() => {})\n * }\n * })\n * ```\n */\n// @ts-expect-error -- TS2589:__typeProps 签名的重载实例化深度过高。\nexport function defineComponent<\n TypeProps = any,\n>(\n options: DefineComponentTypePropsOptions<TypeProps>,\n): DefineComponentWithTypeProps<TypeProps>\nexport function defineComponent<\n P extends ComponentPropsOptions = ComponentPropsOptions,\n D extends object = Record<string, any>,\n C extends ComputedDefinitions = ComputedDefinitions,\n M extends MethodDefinitions = MethodDefinitions,\n S extends Record<string, any> | void = Record<string, any> | void,\n>(\n options: DefineComponentOptions<P, D, C, M, S>,\n): WevuComponentConstructor<ResolveProps<P>, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>\nexport function defineComponent(\n options: DefineComponentOptions<any, any, any, any, any>,\n): WevuComponentConstructor<Record<string, any>, Record<string, any>, Record<string, any>, ComputedDefinitions, MethodDefinitions>\n & ComponentDefinition<any, any, any> {\n // eslint-disable-next-line ts/no-use-before-define -- 重载实现需保持在内部共享工厂之前。\n return createComponentDefinition(options, true) as any\n}\n\nfunction createComponentDefinition(\n options: DefineComponentOptions<any, any, any, any, any>,\n registerNative: boolean,\n) {\n if (registerNative) {\n ensureScopedSlotComponentGlobal()\n }\n const resolvedOptions = resolveVueComponentOptions(applyWevuComponentDefaults(options))\n const {\n __typeProps: _typeProps,\n data,\n computed,\n methods,\n setData,\n watch,\n setup,\n props,\n inject: injectOptions,\n provide: provideOptions,\n allowFunctionProps,\n [WEVU_CSS_MODULES_KEY]: cssModules,\n ...mpOptions\n } = resolvedOptions\n\n const rawFunctionPropPaths = (mpOptions as any)[WEVU_FUNCTION_PROP_PATHS_KEY]\n const functionPropPaths: string[] = Array.isArray(rawFunctionPropPaths)\n ? [...new Set(rawFunctionPropPaths.filter((path: unknown): path is string => typeof path === 'string' && path.length > 0))]\n : []\n delete (mpOptions as any)[WEVU_FUNCTION_PROP_PATHS_KEY]\n\n const rawResolvedSetData = allowFunctionProps === true\n ? {\n ...(setData ?? {}),\n includeFunctions: true,\n functionPaths: functionPropPaths,\n }\n : allowFunctionProps === false\n ? setData\n : functionPropPaths.length\n ? {\n ...(setData ?? {}),\n functionPaths: functionPropPaths,\n }\n : setData\n const resolvedSetData = resolveScopedSlotHostSetData(mpOptions, rawResolvedSetData)\n const setupFunctionPropKeys = new Set(\n functionPropPaths\n .filter(path => !path.includes('.')),\n )\n\n const normalizedMpOptions = normalizeProps(mpOptions, props)\n const initialDataContext = resolveInitialDataContext(normalizedMpOptions.properties, methods)\n const resolvedData = typeof data === 'function'\n ? () => data.call(initialDataContext)\n : data\n\n const hasOptionsApiContext = injectOptions != null || provideOptions != null\n const setupWrapper = typeof setup === 'function' || hasOptionsApiContext || cssModules\n ? ((props, ctx) => {\n if (cssModules && typeof cssModules === 'object') {\n ;((ctx as any).instance as Record<string, any>)[WEVU_CSS_MODULES_KEY] = cssModules\n }\n const publicInstance = (ctx as any)?.proxy ?? (ctx as any)?.instance ?? Object.create(null)\n const injected = resolveOptionsApiInjections(injectOptions, publicInstance)\n if (provideOptions != null) {\n applyOptionsApiProvide(provideOptions, publicInstance)\n }\n const setupResult = typeof setup === 'function'\n ? runSetupFunction(setup as any, props as Record<string, any>, ctx as any) as Record<string, any> | void\n : undefined\n const result = {\n ...injected,\n ...(cssModules ?? {}),\n ...(setupResult ?? {}),\n }\n if (ctx && Object.keys(result).length) {\n applySetupResult((ctx as any).runtime, (ctx as any).instance, result, {\n includeFunctionsInState: allowFunctionProps === true,\n functionPropPaths: allowFunctionProps === false ? undefined : setupFunctionPropKeys,\n })\n }\n return result\n }) satisfies DefineComponentOptions<ComponentPropsOptions, any, any, any, any>['setup']\n : undefined\n\n const nativeData = typeof resolvedData === 'function'\n ? resolvedData()\n : resolvedData\n const shouldDeclareOwnerId = shouldDeclareNativeSlotOwnerId(resolvedSetData)\n const seededNativeData = shouldDeclareOwnerId\n ? {\n ...(nativeData && typeof nativeData === 'object' ? nativeData : {}),\n [WEVU_SLOT_OWNER_ID_KEY]: shouldSeedNativeSlotOwnerId(mpOptions, resolvedSetData)\n ? (nativeData as any)?.[WEVU_SLOT_OWNER_ID_KEY] || allocateOwnerId()\n : (nativeData as any)?.[WEVU_SLOT_OWNER_ID_KEY] || '',\n }\n : nativeData\n const nativeInitialData = resolveNativeInitialData(seededNativeData, computed as ComputedDefinitions, resolvedSetData, methods as Record<string, any> | undefined)\n const mpOptionsWithProps = nativeInitialData !== undefined\n ? {\n ...normalizedMpOptions,\n data: nativeInitialData,\n }\n : normalizedMpOptions\n\n const componentOptions: RuntimeComponentDefinitionOptions = {\n data: resolvedData as () => Record<string, any>,\n computed: computed as ComputedDefinitions,\n methods: methods as MethodDefinitions,\n setData: resolvedSetData,\n watch,\n setup: setupWrapper,\n mpOptions: mpOptionsWithProps as MiniProgramComponentRawOptions,\n }\n\n const definition = materializeComponentDefinition(componentOptions, registerNative)\n\n return definition as unknown as WevuComponentConstructor<\n ResolveProps<ComponentPropsOptions>,\n Record<string, any>,\n Record<string, any>,\n ComputedDefinitions,\n MethodDefinitions\n > & ComponentDefinition<any, any, any>\n}\n\n/**\n * 创建不触发宿主全局注册的 Wevu 组件定义。\n *\n * @param options 组件选项\n * @internal\n */\nexport function createWevuComponentDefinition(\n options: DefineComponentOptions<any, any, any, any, any>,\n) {\n return createComponentDefinition(options, false)\n}\n\n/**\n * 从现有组件定义派生拥有独立应用上下文的组件定义。\n *\n * @param definition 已解析的 Wevu 组件定义\n * @internal\n */\nexport function createIsolatedWevuComponentDefinition(definition: object) {\n const componentOptions = (definition as ComponentDefinition<any, any, any>).__wevu_options\n if (!componentOptions) {\n throw new TypeError('无法从非 Wevu 组件定义创建独立运行时')\n }\n return materializeComponentDefinition(componentOptions)\n}\n\n/**\n * 获取组件定义对应的宿主生命周期定义。\n *\n * @param definition Wevu 组件定义\n * @internal\n */\nexport function getWevuComponentLifecycleDefinition(definition: object) {\n return componentLifecycleDefinitions.get(definition)\n}\n\n/**\n * 从 Vue SFC 选项创建 wevu 组件,供 weapp-vite 编译产物直接调用的兼容入口。\n *\n * @param options 组件选项,可能包含小程序特有的 properties\n * @internal\n */\nexport function createWevuComponent<\n P extends ComponentPropsOptions = ComponentPropsOptions,\n D extends object = Record<string, any>,\n C extends ComputedDefinitions = ComputedDefinitions,\n M extends MethodDefinitions = MethodDefinitions,\n>(\n options: DefineComponentOptions<P, D, C, M> & { properties?: MiniProgramComponentPropertyOption },\n): void {\n ensureScopedSlotComponentGlobal()\n const {\n properties,\n props,\n ...restOptions\n } = options\n\n const baseOptions = {\n ...restOptions,\n allowNullPropInput: (restOptions as any).allowNullPropInput ?? true,\n __wevu_allowNullPropInput: true,\n }\n\n // 将 properties 合并到 mpOptions,保持小程序属性定义\n const finalOptions = normalizeProps(baseOptions, props, properties)\n\n defineComponent(finalOptions)\n}\n\n/**\n * scoped slot 兼容组件入口(编译产物内部使用)。\n * @internal\n */\nexport function createWevuScopedSlotComponent(\n overrides?: {\n computed?: ComputedDefinitions\n inlineMap?: InlineExpressionMap\n templateRefs?: TemplateRefBinding[]\n },\n): void {\n const baseOptions = createScopedSlotOptions(overrides)\n createWevuComponent(baseOptions as any)\n}\n\nscopedSlotCreator = createWevuScopedSlotComponent\nensureScopedSlotComponentGlobal()\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"define.mjs","names":[],"sources":["../../../src/runtime/define.ts"],"sourcesContent":["import type { WevuRuntimeBindingManifestV1 } from '@weapp-core/constants'\nimport type { RuntimeComponentDefinitionOptions } from './define/componentDefinition'\nimport type {\n ComponentPropsOptions,\n ComponentPublicInstance,\n ComputedDefinitions,\n DefineComponent,\n DefineComponentOptions,\n InferProps,\n MethodDefinitions,\n MiniProgramComponentPropertyOption,\n MiniProgramComponentRawOptions,\n SetDataSnapshotOptions,\n ShallowUnwrapRef,\n} from './types'\nimport {\n WEVU_BINDING_MANIFEST_KEY,\n WEVU_CSS_MODULES_KEY,\n WEVU_FUNCTION_PROP_PATHS_KEY,\n WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY,\n WEVU_SLOT_OWNER_ID_KEY,\n WEVU_SLOT_OWNER_ID_PROP,\n WEVU_SLOT_SCOPE_KEY,\n} from '@weapp-core/constants'\nimport { hasOwn } from '../utils'\nimport { hasBindingOutputPath, resolveBindingManifest } from './bindingManifest'\nimport { requireRuntimeCapability } from './capabilities'\nimport { applyWevuComponentDefaults } from './defaults'\nimport {\n createRuntimeComponentDefinition,\n} from './define/componentDefinition'\nimport { resolveNativeInitialData } from './define/initialComputed'\nimport { resolveVueComponentOptions } from './define/options'\nimport { applyOptionsApiProvide, resolveOptionsApiInjections } from './define/optionsApi'\nimport { normalizeProps } from './define/props'\nimport { applySetupResult } from './define/setupResult'\nimport { runSetupFunction } from './register'\n\nconst componentLifecycleDefinitions = new WeakMap<object, Record<string, any>>()\n\nfunction resolveInitialDataContext(properties: unknown, methods: MethodDefinitions | undefined) {\n const context: Record<string, unknown> = { ...(methods ?? {}) }\n if (!properties || typeof properties !== 'object') {\n return context\n }\n for (const [name, definition] of Object.entries(properties)) {\n if (definition && typeof definition === 'object' && hasOwn(definition, 'value')) {\n context[name] = (definition as Record<string, unknown>).value\n }\n }\n return context\n}\n\nfunction shouldDeclareNativeSlotOwnerId(\n setData: SetDataSnapshotOptions | undefined,\n bindingManifest: WevuRuntimeBindingManifestV1 | undefined,\n) {\n return (\n Array.isArray(setData?.pick)\n && setData.pick.includes(WEVU_SLOT_OWNER_ID_KEY)\n ) || (\n bindingManifest?.features?.scopedSlots === true\n && hasBindingOutputPath(bindingManifest, WEVU_SLOT_OWNER_ID_KEY)\n )\n}\n\nfunction shouldSeedNativeSlotOwnerId(mpOptions: Record<string, unknown>) {\n return Boolean(mpOptions.__wevu_isPage)\n}\n\nfunction hasScopedSlotHostProperties(mpOptions: Record<string, any>) {\n const properties = mpOptions.properties\n return Boolean(\n properties\n && typeof properties === 'object'\n && (\n WEVU_SLOT_OWNER_ID_PROP in properties\n || WEVU_SLOT_SCOPE_KEY in properties\n ),\n )\n}\n\nfunction resolveScopedSlotHostSetData(\n mpOptions: Record<string, any>,\n setData: DefineComponentOptions<any, any, any, any, any>['setData'],\n) {\n if (setData?.strategy !== 'patch' || !hasScopedSlotHostProperties(mpOptions)) {\n return setData\n }\n return {\n ...setData,\n strategy: 'diff' as const,\n }\n}\n\n/**\n * defineComponent 返回的组件定义描述,用于手动注册或高级用法。\n */\nexport interface ComponentDefinition<\n D extends object,\n C extends ComputedDefinitions,\n M extends MethodDefinitions,\n> {\n /**\n * 内部 runtime app(高级能力使用),不对外暴露正式 API。\n * @internal\n */\n __wevu_runtime: import('./types').RuntimeApp<D, C, M>\n\n /**\n * 内部选项快照(高级能力使用),包含 data/computed/methods 等。\n * @internal\n */\n __wevu_options: {\n scopedSlotOwnerRequired: boolean\n data: () => D\n computed: C\n methods: M\n setData: import('./types').SetDataSnapshotOptions | undefined\n bindingManifest?: WevuRuntimeBindingManifestV1\n watch: Record<string, any> | undefined\n setup: ((props: any, ctx: any) => any) | undefined\n mpOptions: MiniProgramComponentRawOptions\n }\n}\n\nfunction materializeComponentDefinition(\n componentOptions: RuntimeComponentDefinitionOptions,\n registerNative = false,\n) {\n const { lifecycleDefinition, runtimeApp } = createRuntimeComponentDefinition(componentOptions, registerNative)\n const definition: ComponentDefinition<any, any, any> = {\n __wevu_runtime: runtimeApp as any,\n __wevu_options: componentOptions as ComponentDefinition<any, any, any>['__wevu_options'],\n }\n componentLifecycleDefinitions.set(definition, lifecycleDefinition)\n return definition\n}\n\ntype SetupBindings<S> = Exclude<S, void> extends never ? Record<never, never> : Exclude<S, void>\ntype ResolveProps<P> = P extends ComponentPropsOptions ? InferProps<P> : P\n\nexport interface WevuComponentConstructor<\n Props,\n RawBindings,\n D extends object,\n C extends ComputedDefinitions,\n M extends MethodDefinitions,\n> {\n new (): ComponentPublicInstance<D, C, M, Props> & ShallowUnwrapRef<RawBindings>\n}\n\nexport type WevuDefinedComponent<\n PropsOrPropOptions,\n RawBindings,\n D extends object,\n C extends ComputedDefinitions,\n M extends MethodDefinitions,\n> = DefineComponent<PropsOrPropOptions, RawBindings, D, C, M> & ComponentDefinition<D, C, M>\nexport interface SetupContextWithTypeProps<TypeProps> {\n props: TypeProps\n [key: string]: any\n}\nexport type SetupFunctionWithTypeProps<\n TypeProps,\n> = (\n props: TypeProps,\n ctx: SetupContextWithTypeProps<TypeProps>,\n) => Record<string, any> | void\nexport interface DefineComponentTypePropsOptions<TypeProps> {\n __typeProps: TypeProps\n setup?: SetupFunctionWithTypeProps<TypeProps>\n [key: string]: any\n}\nexport interface DefineComponentWithTypeProps<TypeProps> {\n new (): { $props: TypeProps } & Record<string, any>\n}\n\n/**\n * 按 Vue 3 风格定义一个小程序组件/页面。\n *\n * - 统一注册为 `Component()`\n *\n * @param options 组件定义项\n * @returns 可手动注册的组件定义\n *\n * @example\n * ```ts\n * defineComponent({\n * data: () => ({ count: 0 }),\n * setup() {\n * onMounted(() => console.log('已挂载'))\n * }\n * })\n * ```\n *\n * @example\n * ```ts\n * defineComponent({\n * setup() {\n * onPageScroll(() => {})\n * }\n * })\n * ```\n */\n// @ts-expect-error -- TS2589:__typeProps 签名的重载实例化深度过高。\nexport function defineComponent<\n TypeProps = any,\n>(\n options: DefineComponentTypePropsOptions<TypeProps>,\n): DefineComponentWithTypeProps<TypeProps>\nexport function defineComponent<\n P extends ComponentPropsOptions = Record<never, never>,\n D extends object = Record<never, never>,\n C extends ComputedDefinitions = Record<never, never>,\n M extends MethodDefinitions = Record<never, never>,\n S extends Record<string, any> | void = void,\n>(\n options: DefineComponentOptions<P, D, C, M, S>,\n): WevuComponentConstructor<ResolveProps<P>, SetupBindings<S>, D, C, M> & ComponentDefinition<D, C, M>\nexport function defineComponent(\n options: DefineComponentOptions<any, any, any, any, any>,\n): WevuComponentConstructor<Record<string, any>, Record<string, any>, Record<string, any>, ComputedDefinitions, MethodDefinitions>\n & ComponentDefinition<any, any, any> {\n // eslint-disable-next-line ts/no-use-before-define -- 重载实现需保持在内部共享工厂之前。\n return createComponentDefinition(options, true) as any\n}\n\nfunction createComponentDefinition(\n options: DefineComponentOptions<any, any, any, any, any>,\n registerNative: boolean,\n) {\n const resolvedOptions = resolveVueComponentOptions(applyWevuComponentDefaults(options))\n const {\n __typeProps: _typeProps,\n [WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY]: scopedSlotOwnerRequired,\n data,\n computed,\n methods,\n setData,\n watch,\n setup,\n props,\n inject: injectOptions,\n provide: provideOptions,\n allowFunctionProps,\n [WEVU_BINDING_MANIFEST_KEY]: rawBindingManifest,\n [WEVU_CSS_MODULES_KEY]: cssModules,\n ...mpOptions\n } = resolvedOptions as typeof resolvedOptions & { [WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY]?: boolean }\n const bindingManifest = resolveBindingManifest(rawBindingManifest)\n\n const rawFunctionPropPaths = (mpOptions as any)[WEVU_FUNCTION_PROP_PATHS_KEY]\n const functionPropPaths: string[] = Array.isArray(rawFunctionPropPaths)\n ? [...new Set(rawFunctionPropPaths.filter((path: unknown): path is string => typeof path === 'string' && path.length > 0))]\n : []\n delete (mpOptions as any)[WEVU_FUNCTION_PROP_PATHS_KEY]\n\n const rawResolvedSetData = allowFunctionProps === true\n ? {\n ...(setData ?? {}),\n includeFunctions: true,\n functionPaths: functionPropPaths,\n }\n : allowFunctionProps === false\n ? setData\n : functionPropPaths.length\n ? {\n ...(setData ?? {}),\n functionPaths: functionPropPaths,\n }\n : setData\n const resolvedSetData = resolveScopedSlotHostSetData(mpOptions, rawResolvedSetData)\n const setupFunctionPropKeys = new Set(\n functionPropPaths\n .filter(path => !path.includes('.')),\n )\n\n const normalizedMpOptions = normalizeProps(mpOptions, props, mpOptions.properties)\n const initialDataContext = resolveInitialDataContext(normalizedMpOptions.properties, methods)\n const resolvedData = typeof data === 'function'\n ? () => data.call(initialDataContext)\n : data\n\n const hasOptionsApiContext = injectOptions != null || provideOptions != null\n const setupWrapper = typeof setup === 'function' || hasOptionsApiContext || cssModules\n ? ((props, ctx) => {\n if (cssModules && typeof cssModules === 'object') {\n ;((ctx as any).instance as Record<string, any>)[WEVU_CSS_MODULES_KEY] = cssModules\n }\n const publicInstance = (ctx as any)?.proxy ?? (ctx as any)?.instance ?? Object.create(null)\n const injected = resolveOptionsApiInjections(injectOptions, publicInstance)\n if (provideOptions != null) {\n applyOptionsApiProvide(provideOptions, publicInstance)\n }\n const setupResult = typeof setup === 'function'\n ? runSetupFunction(setup as any, props as Record<string, any>, ctx as any) as Record<string, any> | void\n : undefined\n const result = {\n ...injected,\n ...(cssModules ?? {}),\n ...(setupResult ?? {}),\n }\n if (ctx && Object.keys(result).length) {\n applySetupResult((ctx as any).runtime, (ctx as any).instance, result, {\n includeFunctionsInState: allowFunctionProps === true,\n functionPropPaths: allowFunctionProps === false ? undefined : setupFunctionPropKeys,\n })\n }\n return result\n }) satisfies DefineComponentOptions<ComponentPropsOptions, any, any, any, any>['setup']\n : undefined\n\n const nativeData = typeof resolvedData === 'function'\n ? resolvedData()\n : resolvedData\n const nativeOwnerId = nativeData && typeof nativeData === 'object'\n ? Reflect.get(nativeData, WEVU_SLOT_OWNER_ID_KEY)\n : undefined\n const shouldDeclareOwnerId = shouldDeclareNativeSlotOwnerId(resolvedSetData, bindingManifest)\n const scopedSlotHooks = shouldDeclareOwnerId\n ? requireRuntimeCapability('scopedSlots', 'defineComponent(scoped-slot owner metadata)')\n : undefined\n const seededNativeData = shouldDeclareOwnerId\n ? {\n ...(nativeData && typeof nativeData === 'object' ? nativeData : {}),\n [WEVU_SLOT_OWNER_ID_KEY]: shouldSeedNativeSlotOwnerId(mpOptions)\n ? nativeOwnerId || scopedSlotHooks?.allocateOwnerId()\n : nativeOwnerId || '',\n }\n : nativeData\n const nativeInitialData = resolveNativeInitialData(seededNativeData, computed as ComputedDefinitions, resolvedSetData, methods as Record<string, any> | undefined)\n const mpOptionsWithProps = nativeInitialData !== undefined\n ? {\n ...normalizedMpOptions,\n data: nativeInitialData,\n }\n : normalizedMpOptions\n\n const componentOptions: RuntimeComponentDefinitionOptions = {\n scopedSlotOwnerRequired: scopedSlotOwnerRequired === true,\n data: resolvedData as () => Record<string, any>,\n computed: computed as ComputedDefinitions,\n methods: methods as MethodDefinitions,\n setData: resolvedSetData,\n bindingManifest,\n watch,\n setup: setupWrapper,\n mpOptions: mpOptionsWithProps as MiniProgramComponentRawOptions,\n }\n\n const definition = materializeComponentDefinition(componentOptions, registerNative)\n\n return definition as unknown as WevuComponentConstructor<\n ResolveProps<ComponentPropsOptions>,\n Record<string, any>,\n Record<string, any>,\n ComputedDefinitions,\n MethodDefinitions\n > & ComponentDefinition<any, any, any>\n}\n\n/**\n * 创建不触发宿主全局注册的 Wevu 组件定义。\n *\n * @param options 组件选项\n * @internal\n */\nexport function createWevuComponentDefinition(\n options: DefineComponentOptions<any, any, any, any, any>,\n) {\n return createComponentDefinition(options, false)\n}\n\n/**\n * 从现有组件定义派生拥有独立应用上下文的组件定义。\n *\n * @param definition 已解析的 Wevu 组件定义\n * @internal\n */\nexport function createIsolatedWevuComponentDefinition(definition: object) {\n const componentOptions = (definition as ComponentDefinition<any, any, any>).__wevu_options\n if (!componentOptions) {\n throw new TypeError('无法从非 Wevu 组件定义创建独立运行时')\n }\n return materializeComponentDefinition(componentOptions)\n}\n\n/**\n * 获取组件定义对应的宿主生命周期定义。\n *\n * @param definition Wevu 组件定义\n * @internal\n */\nexport function getWevuComponentLifecycleDefinition(definition: object) {\n return componentLifecycleDefinitions.get(definition)\n}\n\n/**\n * 从 Vue SFC 选项创建 wevu 组件,供 weapp-vite 编译产物直接调用的兼容入口。\n *\n * @param options 组件选项,可能包含小程序特有的 properties\n * @internal\n */\nexport function createWevuComponent<\n P extends ComponentPropsOptions = ComponentPropsOptions,\n D extends object = Record<string, any>,\n C extends ComputedDefinitions = ComputedDefinitions,\n M extends MethodDefinitions = MethodDefinitions,\n>(\n options: DefineComponentOptions<P, D, C, M> & { properties?: MiniProgramComponentPropertyOption },\n): void {\n const allowNullPropInput = options.allowNullPropInput ?? true\n defineComponent({\n ...options,\n allowNullPropInput,\n __wevu_allowNullPropInput: allowNullPropInput,\n })\n}\n"],"mappings":"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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { toRaw } from "../reactivity/reactive/shared.mjs";
|
|
2
2
|
import { getReactiveVersion, isReactive } from "../reactivity/reactive.mjs";
|
|
3
3
|
import { unref } from "../reactivity/ref.mjs";
|
|
4
|
+
import { isNoSetData } from "./noSetData.mjs";
|
|
4
5
|
import { hasOwn } from "../utils.mjs";
|
|
5
6
|
import { hasTrackableSetupBinding } from "./setupTracking.mjs";
|
|
6
|
-
import { isNoSetData } from "./noSetData.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/runtime/diff.ts
|
|
9
9
|
function isPlainObject(value) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/runtime/disposables.d.ts
|
|
2
|
+
export type DisposableMethodName = 'dispose' | 'abort' | 'cancel' | 'stop' | 'disconnect' | 'destroy' | 'close';
|
|
3
|
+
export type DisposableObject = Partial<Record<DisposableMethodName, () => void>>;
|
|
4
|
+
export type DisposableLike = (() => void) | DisposableObject;
|
|
5
|
+
export interface DisposableBag {
|
|
6
|
+
/**
|
|
7
|
+
* 注册一个清理项,返回“取消注册”函数(不会立即执行清理)。
|
|
8
|
+
*/
|
|
9
|
+
add: (target: DisposableLike | null | undefined) => () => void;
|
|
10
|
+
/**
|
|
11
|
+
* 立即执行并清空当前 bag 中的全部清理项(幂等)。
|
|
12
|
+
*/
|
|
13
|
+
dispose: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* 注册 timeout,并在 bag dispose 时自动 clearTimeout。
|
|
16
|
+
*/
|
|
17
|
+
setTimeout: (handler: (...args: any[]) => void, timeout?: number, ...args: any[]) => ReturnType<typeof setTimeout>;
|
|
18
|
+
/**
|
|
19
|
+
* 注册 interval,并在 bag dispose 时自动 clearInterval。
|
|
20
|
+
*/
|
|
21
|
+
setInterval: (handler: (...args: any[]) => void, timeout?: number, ...args: any[]) => ReturnType<typeof setInterval>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 在 setup() 中创建一个“清理袋”,统一管理副作用释放。
|
|
25
|
+
*
|
|
26
|
+
* 典型用法:注册定时器、请求任务、事件监听退订函数,
|
|
27
|
+
* 在页面/组件卸载时自动批量清理,减少内存泄漏风险。
|
|
28
|
+
*/
|
|
29
|
+
export declare function useDisposables(): DisposableBag;
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=disposables.d.mts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions } from "./types/miniprogramHost.mjs";
|
|
2
|
+
import { MaybeRefOrGetter } from "../reactivity/ref.mjs";
|
|
3
|
+
import "../reactivity/index.mjs";
|
|
4
|
+
import { InternalRuntimeState } from "./types/runtime.mjs";
|
|
5
|
+
import "./types.mjs";
|
|
6
|
+
//#region src/runtime/elementIntersectionObserver.d.ts
|
|
7
|
+
export type ElementIntersectionObserverCallback<T = unknown> = (result: T) => void;
|
|
8
|
+
export interface UseElementIntersectionObserverOptions<T = unknown> {
|
|
9
|
+
context?: InternalRuntimeState | null;
|
|
10
|
+
enabled?: MaybeRefOrGetter<boolean>;
|
|
11
|
+
observerOptions?: MaybeRefOrGetter<HostMiniProgramIntersectionObserverOptions>;
|
|
12
|
+
onObserve?: ElementIntersectionObserverCallback<T>;
|
|
13
|
+
relativeToViewport?: boolean | Record<string, number>;
|
|
14
|
+
selector: MaybeRefOrGetter<string | null | undefined>;
|
|
15
|
+
}
|
|
16
|
+
export interface UseElementIntersectionObserverReturn {
|
|
17
|
+
disconnect: () => void;
|
|
18
|
+
observe: () => HostMiniProgramIntersectionObserver | null;
|
|
19
|
+
readonly observer: HostMiniProgramIntersectionObserver | null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 观察当前组件或页面内的节点可见性,并在卸载时自动断开。
|
|
23
|
+
*/
|
|
24
|
+
export declare function useElementIntersectionObserver<T = unknown>(options: UseElementIntersectionObserverOptions<T>): UseElementIntersectionObserverReturn;
|
|
25
|
+
//#endregion
|
|
26
|
+
//# sourceMappingURL=elementIntersectionObserver.d.mts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { registerRuntimeCapability } from "../capabilities.mjs";
|
|
2
|
+
import { runInlineExpression } from "../register/inline.mjs";
|
|
3
|
+
import { WEVU_INLINE_MAP_KEY } from "@weapp-core/constants";
|
|
4
|
+
|
|
5
|
+
//#region src/runtime/features/inlineEvents.ts
|
|
6
|
+
const inlineEventHooks = {
|
|
7
|
+
handler(event) {
|
|
8
|
+
var _runtime$proxy, _runtime$methods;
|
|
9
|
+
const runtime = this.__wevu;
|
|
10
|
+
const context = (_runtime$proxy = runtime === null || runtime === void 0 ? void 0 : runtime.proxy) !== null && _runtime$proxy !== void 0 ? _runtime$proxy : this;
|
|
11
|
+
const inlineMap = runtime === null || runtime === void 0 || (_runtime$methods = runtime.methods) === null || _runtime$methods === void 0 ? void 0 : _runtime$methods[WEVU_INLINE_MAP_KEY];
|
|
12
|
+
return runInlineExpression(context, void 0, event, inlineMap && typeof inlineMap === "object" && !Array.isArray(inlineMap) ? inlineMap : void 0);
|
|
13
|
+
},
|
|
14
|
+
run: runInlineExpression
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 安装模板内联事件能力。
|
|
18
|
+
*/
|
|
19
|
+
function installInlineEvents() {
|
|
20
|
+
registerRuntimeCapability("inlineEvents", inlineEventHooks);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { installInlineEvents };
|
|
25
|
+
//# sourceMappingURL=inlineEvents.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inlineEvents.mjs","names":[],"sources":["../../../../src/runtime/features/inlineEvents.ts"],"sourcesContent":["import type { RuntimeCapabilityRegistry } from '../capabilities'\nimport type { InlineExpressionMap } from '../register/inline'\nimport type { InternalRuntimeState } from '../types'\nimport { WEVU_INLINE_MAP_KEY } from '@weapp-core/constants'\nimport { registerRuntimeCapability } from '../capabilities'\nimport { runInlineExpression } from '../register/inline'\n\nconst inlineEventHooks: NonNullable<RuntimeCapabilityRegistry['inlineEvents']> = {\n handler(this: InternalRuntimeState, event: unknown) {\n const runtime = this.__wevu\n const context = runtime?.proxy ?? this\n const inlineMap = runtime?.methods?.[WEVU_INLINE_MAP_KEY] as unknown\n return runInlineExpression(\n context,\n undefined,\n event,\n inlineMap && typeof inlineMap === 'object' && !Array.isArray(inlineMap)\n ? inlineMap as InlineExpressionMap\n : undefined,\n )\n },\n run: runInlineExpression,\n}\n\n/**\n * 安装模板内联事件能力。\n */\nexport function installInlineEvents(): void {\n registerRuntimeCapability('inlineEvents', inlineEventHooks)\n}\n"],"mappings":";;;;;AAOA,MAAM,mBAA2E;CAC/E,QAAoC,OAAgB;;EAClD,MAAM,UAAU,KAAK;EACrB,MAAM,8EAAU,QAAS,gEAAS;EAClC,MAAM,0EAAY,QAAS,6EAAU;EACrC,OAAO,oBACL,SACA,QACA,OACA,aAAa,OAAO,cAAc,YAAY,CAAC,MAAM,QAAQ,SAAS,IAClE,YACA,MACN;CACF;CACA,KAAK;AACP;;;;AAKA,SAAgB,sBAA4B;CAC1C,0BAA0B,gBAAgB,gBAAgB;AAC5D"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { registerRuntimeCapability } from "../capabilities.mjs";
|
|
2
|
+
import { registerRuntimeLayoutHosts, unregisterRuntimeLayoutHosts } from "../layoutBridge.mjs";
|
|
3
|
+
import { resolveRuntimePageLayoutName, syncRuntimePageLayoutState } from "../pageLayout.mjs";
|
|
4
|
+
import { runTeardownSteps } from "../teardown.mjs";
|
|
5
|
+
import { installTemplateRefs } from "./templateRefs.mjs";
|
|
6
|
+
import { WEVU_LAYOUT_HOST_BRIDGE_KEY, WEVU_PAGE_LAYOUT_NAME_KEY, WEVU_PAGE_LAYOUT_PROPS_KEY, WEVU_PAGE_LAYOUT_SETTER_KEY } from "@weapp-core/constants";
|
|
7
|
+
|
|
8
|
+
//#region src/runtime/features/layout.ts
|
|
9
|
+
const layoutHooks = {
|
|
10
|
+
attachPageSetter(target) {
|
|
11
|
+
target[WEVU_PAGE_LAYOUT_SETTER_KEY] = (layout, props) => {
|
|
12
|
+
var _target$__wevu;
|
|
13
|
+
const runtimeState = (_target$__wevu = target.__wevu) === null || _target$__wevu === void 0 ? void 0 : _target$__wevu.state;
|
|
14
|
+
if (!runtimeState || typeof runtimeState !== "object") return;
|
|
15
|
+
runtimeState[WEVU_PAGE_LAYOUT_NAME_KEY] = resolveRuntimePageLayoutName(layout);
|
|
16
|
+
const nextProps = layout === false ? {} : props !== null && props !== void 0 ? props : {};
|
|
17
|
+
runtimeState[WEVU_PAGE_LAYOUT_PROPS_KEY] = nextProps;
|
|
18
|
+
syncRuntimePageLayoutState(target, layout, nextProps);
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
attachHosts(bindings, target) {
|
|
22
|
+
if (!bindings.length || target[WEVU_LAYOUT_HOST_BRIDGE_KEY]) return;
|
|
23
|
+
const bridge = registerRuntimeLayoutHosts(bindings, target);
|
|
24
|
+
if (bridge) target[WEVU_LAYOUT_HOST_BRIDGE_KEY] = bridge;
|
|
25
|
+
},
|
|
26
|
+
detachHosts(bindings, target) {
|
|
27
|
+
const bridge = target[WEVU_LAYOUT_HOST_BRIDGE_KEY];
|
|
28
|
+
if (!bindings.length || !bridge) return;
|
|
29
|
+
runTeardownSteps([() => unregisterRuntimeLayoutHosts(bindings, bridge), () => {
|
|
30
|
+
delete target[WEVU_LAYOUT_HOST_BRIDGE_KEY];
|
|
31
|
+
}]);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* 安装 layout 能力,并直接安装其模板 ref 依赖。
|
|
36
|
+
*/
|
|
37
|
+
function installLayout() {
|
|
38
|
+
installTemplateRefs();
|
|
39
|
+
registerRuntimeCapability("layout", layoutHooks);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { installLayout };
|
|
44
|
+
//# sourceMappingURL=layout.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.mjs","names":[],"sources":["../../../../src/runtime/features/layout.ts"],"sourcesContent":["import type { RuntimeCapabilityRegistry } from '../capabilities'\nimport type { InternalRuntimeState } from '../types'\nimport {\n WEVU_LAYOUT_HOST_BRIDGE_KEY,\n WEVU_PAGE_LAYOUT_NAME_KEY,\n WEVU_PAGE_LAYOUT_PROPS_KEY,\n WEVU_PAGE_LAYOUT_SETTER_KEY,\n} from '@weapp-core/constants'\nimport { registerRuntimeCapability } from '../capabilities'\nimport { registerRuntimeLayoutHosts, unregisterRuntimeLayoutHosts } from '../layoutBridge'\nimport { resolveRuntimePageLayoutName, syncRuntimePageLayoutState } from '../pageLayout'\nimport { runTeardownSteps } from '../teardown'\nimport { installTemplateRefs } from './templateRefs'\n\nconst layoutHooks: NonNullable<RuntimeCapabilityRegistry['layout']> = {\n attachPageSetter(target) {\n target[WEVU_PAGE_LAYOUT_SETTER_KEY] = (layout: string | false, props?: object) => {\n const runtimeState = target.__wevu?.state as Record<string, unknown> | undefined\n if (!runtimeState || typeof runtimeState !== 'object') {\n return\n }\n runtimeState[WEVU_PAGE_LAYOUT_NAME_KEY] = resolveRuntimePageLayoutName(layout)\n const nextProps = layout === false ? {} : (props ?? {})\n runtimeState[WEVU_PAGE_LAYOUT_PROPS_KEY] = nextProps\n syncRuntimePageLayoutState(target as InternalRuntimeState & Record<string, unknown>, layout, nextProps)\n }\n },\n attachHosts(bindings, target) {\n if (!bindings.length || target[WEVU_LAYOUT_HOST_BRIDGE_KEY]) {\n return\n }\n const bridge = registerRuntimeLayoutHosts(bindings, target)\n if (bridge) {\n target[WEVU_LAYOUT_HOST_BRIDGE_KEY] = bridge\n }\n },\n detachHosts(bindings, target) {\n const bridge = target[WEVU_LAYOUT_HOST_BRIDGE_KEY]\n if (!bindings.length || !bridge) {\n return\n }\n runTeardownSteps([\n () => unregisterRuntimeLayoutHosts(bindings, bridge),\n () => {\n delete target[WEVU_LAYOUT_HOST_BRIDGE_KEY]\n },\n ])\n },\n}\n\n/**\n * 安装 layout 能力,并直接安装其模板 ref 依赖。\n */\nexport function installLayout(): void {\n installTemplateRefs()\n registerRuntimeCapability('layout', layoutHooks)\n}\n"],"mappings":";;;;;;;;AAcA,MAAM,cAAgE;CACpE,iBAAiB,QAAQ;EACvB,OAAO,gCAAgC,QAAwB,UAAmB;;GAChF,MAAM,iCAAe,OAAO,wEAAQ;GACpC,IAAI,CAAC,gBAAgB,OAAO,iBAAiB,UAC3C;GAEF,aAAa,6BAA6B,6BAA6B,MAAM;GAC7E,MAAM,YAAY,WAAW,QAAQ,CAAC,IAAK,6CAAS,CAAC;GACrD,aAAa,8BAA8B;GAC3C,2BAA2B,QAA0D,QAAQ,SAAS;EACxG;CACF;CACA,YAAY,UAAU,QAAQ;EAC5B,IAAI,CAAC,SAAS,UAAU,OAAO,8BAC7B;EAEF,MAAM,SAAS,2BAA2B,UAAU,MAAM;EAC1D,IAAI,QACF,OAAO,+BAA+B;CAE1C;CACA,YAAY,UAAU,QAAQ;EAC5B,MAAM,SAAS,OAAO;EACtB,IAAI,CAAC,SAAS,UAAU,CAAC,QACvB;EAEF,iBAAiB,OACT,6BAA6B,UAAU,MAAM,SAC7C;GACJ,OAAO,OAAO;EAChB,CACF,CAAC;CACH;AACF;;;;AAKA,SAAgB,gBAAsB;CACpC,oBAAoB;CACpB,0BAA0B,UAAU,WAAW;AACjD"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { addMutationRecorder, removeMutationRecorder } from "../../reactivity/reactive/mutation.mjs";
|
|
2
|
+
import { toRaw } from "../../reactivity/reactive/shared.mjs";
|
|
3
|
+
import { clearPatchIndices, prelinkReactiveTree } from "../../reactivity/reactive/patch.mjs";
|
|
4
|
+
import { registerRuntimeCapability } from "../capabilities.mjs";
|
|
5
|
+
import { createSetDataScheduler } from "../app/setData/scheduler.mjs";
|
|
6
|
+
import { preparePatchUpdate } from "../app/setData/patchScheduler.mjs";
|
|
7
|
+
|
|
8
|
+
//#region src/runtime/features/patchStrategy.ts
|
|
9
|
+
function createPatchSetDataScheduler(options) {
|
|
10
|
+
const scheduler = createSetDataScheduler(options);
|
|
11
|
+
const stateRootRaw = toRaw(options.state);
|
|
12
|
+
const pendingPatches = /* @__PURE__ */ new Map();
|
|
13
|
+
const fallbackTopKeys = /* @__PURE__ */ new Set();
|
|
14
|
+
const dispatchedComputedSnapshot = Object.create(null);
|
|
15
|
+
let requiresDiffCollection = true;
|
|
16
|
+
let started = false;
|
|
17
|
+
let disposed = false;
|
|
18
|
+
const syncComputedSnapshot = (snapshot) => {
|
|
19
|
+
if (!options.includeComputed) return;
|
|
20
|
+
for (const key of Object.keys(dispatchedComputedSnapshot)) delete dispatchedComputedSnapshot[key];
|
|
21
|
+
for (const key of Object.keys(options.computedRefs)) if (scheduler.shouldIncludeSnapshotKey(key)) dispatchedComputedSnapshot[key] = snapshot[key];
|
|
22
|
+
options.dirtyComputedKeys.clear();
|
|
23
|
+
};
|
|
24
|
+
const runDiffUpdate = (reason = "diff") => {
|
|
25
|
+
const pendingPatchKeys = pendingPatches.size + fallbackTopKeys.size;
|
|
26
|
+
pendingPatches.clear();
|
|
27
|
+
fallbackTopKeys.clear();
|
|
28
|
+
requiresDiffCollection = false;
|
|
29
|
+
scheduler.runDiffUpdate(reason, pendingPatchKeys, syncComputedSnapshot);
|
|
30
|
+
};
|
|
31
|
+
const mutationRecorder = (record) => {
|
|
32
|
+
if (!options.isMounted()) return;
|
|
33
|
+
if (record.root !== stateRootRaw) {
|
|
34
|
+
const topKeys = scheduler.resolveTopKeysByRoot(record.root);
|
|
35
|
+
for (const key of topKeys) fallbackTopKeys.add(key);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!record.path) {
|
|
39
|
+
if (Array.isArray(record.fallbackTopKeys) && record.fallbackTopKeys.length) for (const key of record.fallbackTopKeys) fallbackTopKeys.add(key);
|
|
40
|
+
else requiresDiffCollection = true;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const topKey = record.path.split(".", 1)[0];
|
|
44
|
+
if (scheduler.shouldIncludeSnapshotKey(topKey)) pendingPatches.set(record.path, {
|
|
45
|
+
kind: record.kind,
|
|
46
|
+
op: record.op
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
job() {
|
|
51
|
+
if (!scheduler.prepareJob(pendingPatches.size + fallbackTopKeys.size, () => [
|
|
52
|
+
...pendingPatches.keys(),
|
|
53
|
+
...fallbackTopKeys,
|
|
54
|
+
...options.includeComputed ? options.dirtyComputedKeys : []
|
|
55
|
+
])) return;
|
|
56
|
+
if (requiresDiffCollection || scheduler.needsFullSnapshot()) return runDiffUpdate("needsFullSnapshot");
|
|
57
|
+
if (!(pendingPatches.size > 0 || fallbackTopKeys.size > 0 || options.includeComputed && options.dirtyComputedKeys.size > 0)) return runDiffUpdate("diff");
|
|
58
|
+
const preparation = preparePatchUpdate({
|
|
59
|
+
state: options.state,
|
|
60
|
+
computedRefs: options.computedRefs,
|
|
61
|
+
dirtyComputedKeys: options.dirtyComputedKeys,
|
|
62
|
+
includeComputed: options.includeComputed,
|
|
63
|
+
computedCompare: options.computedCompare,
|
|
64
|
+
computedCompareMaxDepth: options.computedCompareMaxDepth,
|
|
65
|
+
computedCompareMaxKeys: options.computedCompareMaxKeys,
|
|
66
|
+
shouldIncludeKey: scheduler.shouldIncludeSnapshotKey,
|
|
67
|
+
maxPatchKeys: options.maxPatchKeys,
|
|
68
|
+
maxPayloadBytes: options.maxPayloadBytes,
|
|
69
|
+
mergeSiblingThreshold: options.mergeSiblingThreshold,
|
|
70
|
+
mergeSiblingMaxInflationRatio: options.mergeSiblingMaxInflationRatio,
|
|
71
|
+
mergeSiblingMaxParentBytes: options.mergeSiblingMaxParentBytes,
|
|
72
|
+
mergeSiblingSkipArray: options.mergeSiblingSkipArray,
|
|
73
|
+
elevateTopKeyThreshold: options.elevateTopKeyThreshold,
|
|
74
|
+
toPlainMaxDepth: options.toPlainMaxDepth,
|
|
75
|
+
toPlainMaxKeys: options.toPlainMaxKeys,
|
|
76
|
+
includeFunctions: options.includeFunctions,
|
|
77
|
+
functionPaths: options.functionPaths,
|
|
78
|
+
plainCache: scheduler.plainCache,
|
|
79
|
+
plainCacheEligibility: scheduler.plainCacheEligibility,
|
|
80
|
+
pendingPatches,
|
|
81
|
+
fallbackTopKeys,
|
|
82
|
+
dispatchedSnapshot: scheduler.getLatestSnapshot(),
|
|
83
|
+
dispatchedComputedSnapshot
|
|
84
|
+
});
|
|
85
|
+
if (!preparation) return;
|
|
86
|
+
scheduler.emitDebug(preparation.debug, preparation.type === "patch" ? Object.keys(preparation.payload) : void 0);
|
|
87
|
+
if (preparation.type === "fallback") return runDiffUpdate(preparation.reason);
|
|
88
|
+
if (preparation.computedUpdates) Object.assign(dispatchedComputedSnapshot, preparation.computedUpdates);
|
|
89
|
+
scheduler.dispatchUpdate({
|
|
90
|
+
mode: "patch",
|
|
91
|
+
kind: "delta",
|
|
92
|
+
reason: "patch",
|
|
93
|
+
snapshot: preparation.snapshot,
|
|
94
|
+
payload: preparation.payload,
|
|
95
|
+
pendingPatchKeys: preparation.debug.pendingPatchKeys
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
snapshot: scheduler.snapshot,
|
|
99
|
+
cloneLatestSnapshot: scheduler.cloneLatestSnapshot,
|
|
100
|
+
start() {
|
|
101
|
+
if (started || disposed) return;
|
|
102
|
+
started = true;
|
|
103
|
+
prelinkReactiveTree(options.state, {
|
|
104
|
+
shouldIncludeTopKey: options.shouldIncludeKey,
|
|
105
|
+
maxDepth: options.prelinkMaxDepth,
|
|
106
|
+
maxKeys: options.prelinkMaxKeys
|
|
107
|
+
});
|
|
108
|
+
addMutationRecorder(mutationRecorder);
|
|
109
|
+
},
|
|
110
|
+
dispose() {
|
|
111
|
+
if (disposed) return;
|
|
112
|
+
disposed = true;
|
|
113
|
+
scheduler.dispose();
|
|
114
|
+
if (started) removeMutationRecorder(mutationRecorder);
|
|
115
|
+
clearPatchIndices(options.state);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const patchStrategyHooks = { createScheduler: createPatchSetDataScheduler };
|
|
120
|
+
/**
|
|
121
|
+
* 安装 patch setData 策略。
|
|
122
|
+
*/
|
|
123
|
+
function installPatchStrategy() {
|
|
124
|
+
registerRuntimeCapability("patchStrategy", patchStrategyHooks);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
//#endregion
|
|
128
|
+
export { installPatchStrategy };
|
|
129
|
+
//# sourceMappingURL=patchStrategy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patchStrategy.mjs","names":[],"sources":["../../../../src/runtime/features/patchStrategy.ts"],"sourcesContent":["import type { MutationRecord } from '../../reactivity'\nimport type { SetDataSchedulerOptions } from '../app/setData/scheduler'\nimport type { RuntimeCapabilityRegistry, SetDataScheduler } from '../capabilities'\nimport type { SetDataDebugInfo } from '../types'\nimport { addMutationRecorder, prelinkReactiveTree, removeMutationRecorder, toRaw } from '../../reactivity'\nimport { clearPatchIndices } from '../../reactivity/reactive'\nimport { preparePatchUpdate } from '../app/setData/patchScheduler'\nimport { createSetDataScheduler } from '../app/setData/scheduler'\nimport { registerRuntimeCapability } from '../capabilities'\n\nfunction createPatchSetDataScheduler(options: SetDataSchedulerOptions): SetDataScheduler {\n const scheduler = createSetDataScheduler(options)\n const stateRootRaw = toRaw(options.state) as object\n const pendingPatches = new Map<string, { kind: 'property' | 'array', op: 'set' | 'delete' }>()\n const fallbackTopKeys = new Set<string>()\n const dispatchedComputedSnapshot: Record<string, unknown> = Object.create(null)\n let requiresDiffCollection = true\n let started = false\n let disposed = false\n\n const syncComputedSnapshot = (\n snapshot: Record<string, unknown>,\n ) => {\n if (!options.includeComputed) {\n return\n }\n for (const key of Object.keys(dispatchedComputedSnapshot)) {\n delete dispatchedComputedSnapshot[key]\n }\n for (const key of Object.keys(options.computedRefs)) {\n if (scheduler.shouldIncludeSnapshotKey(key)) {\n dispatchedComputedSnapshot[key] = snapshot[key]\n }\n }\n options.dirtyComputedKeys.clear()\n }\n\n const runDiffUpdate = (reason: SetDataDebugInfo['reason'] = 'diff') => {\n const pendingPatchKeys = pendingPatches.size + fallbackTopKeys.size\n pendingPatches.clear()\n fallbackTopKeys.clear()\n requiresDiffCollection = false\n scheduler.runDiffUpdate(reason, pendingPatchKeys, syncComputedSnapshot)\n }\n\n const mutationRecorder = (record: MutationRecord) => {\n if (!options.isMounted()) {\n return\n }\n if (record.root !== stateRootRaw) {\n const topKeys = scheduler.resolveTopKeysByRoot(record.root)\n for (const key of topKeys) {\n fallbackTopKeys.add(key)\n }\n return\n }\n if (!record.path) {\n if (Array.isArray(record.fallbackTopKeys) && record.fallbackTopKeys.length) {\n for (const key of record.fallbackTopKeys) {\n fallbackTopKeys.add(key)\n }\n }\n else {\n requiresDiffCollection = true\n }\n return\n }\n const topKey = record.path.split('.', 1)[0]\n if (scheduler.shouldIncludeSnapshotKey(topKey)) {\n pendingPatches.set(record.path, { kind: record.kind, op: record.op })\n }\n }\n\n return {\n job() {\n if (!scheduler.prepareJob(\n pendingPatches.size + fallbackTopKeys.size,\n () => [\n ...pendingPatches.keys(),\n ...fallbackTopKeys,\n ...(options.includeComputed ? options.dirtyComputedKeys : []),\n ],\n )) {\n return\n }\n if (requiresDiffCollection || scheduler.needsFullSnapshot()) {\n return runDiffUpdate('needsFullSnapshot')\n }\n const hasPatchSignal = pendingPatches.size > 0\n || fallbackTopKeys.size > 0\n || (options.includeComputed && options.dirtyComputedKeys.size > 0)\n // setup 返回的 ref/computed 变更不会进入 mutation recorder,patch 信号为空时兜底走 diff。\n if (!hasPatchSignal) {\n return runDiffUpdate('diff')\n }\n const preparation = preparePatchUpdate({\n state: options.state,\n computedRefs: options.computedRefs,\n dirtyComputedKeys: options.dirtyComputedKeys,\n includeComputed: options.includeComputed,\n computedCompare: options.computedCompare,\n computedCompareMaxDepth: options.computedCompareMaxDepth,\n computedCompareMaxKeys: options.computedCompareMaxKeys,\n shouldIncludeKey: scheduler.shouldIncludeSnapshotKey,\n maxPatchKeys: options.maxPatchKeys,\n maxPayloadBytes: options.maxPayloadBytes,\n mergeSiblingThreshold: options.mergeSiblingThreshold,\n mergeSiblingMaxInflationRatio: options.mergeSiblingMaxInflationRatio,\n mergeSiblingMaxParentBytes: options.mergeSiblingMaxParentBytes,\n mergeSiblingSkipArray: options.mergeSiblingSkipArray,\n elevateTopKeyThreshold: options.elevateTopKeyThreshold,\n toPlainMaxDepth: options.toPlainMaxDepth,\n toPlainMaxKeys: options.toPlainMaxKeys,\n includeFunctions: options.includeFunctions,\n functionPaths: options.functionPaths,\n plainCache: scheduler.plainCache,\n plainCacheEligibility: scheduler.plainCacheEligibility,\n pendingPatches,\n fallbackTopKeys,\n dispatchedSnapshot: scheduler.getLatestSnapshot(),\n dispatchedComputedSnapshot,\n })\n if (!preparation) {\n return\n }\n scheduler.emitDebug(\n preparation.debug,\n preparation.type === 'patch' ? Object.keys(preparation.payload) : undefined,\n )\n if (preparation.type === 'fallback') {\n return runDiffUpdate(preparation.reason)\n }\n if (preparation.computedUpdates) {\n Object.assign(dispatchedComputedSnapshot, preparation.computedUpdates)\n }\n scheduler.dispatchUpdate({\n mode: 'patch',\n kind: 'delta',\n reason: 'patch',\n snapshot: preparation.snapshot,\n payload: preparation.payload,\n pendingPatchKeys: preparation.debug.pendingPatchKeys,\n })\n },\n snapshot: scheduler.snapshot,\n cloneLatestSnapshot: scheduler.cloneLatestSnapshot,\n start() {\n if (started || disposed) {\n return\n }\n started = true\n prelinkReactiveTree(options.state, {\n shouldIncludeTopKey: options.shouldIncludeKey,\n maxDepth: options.prelinkMaxDepth,\n maxKeys: options.prelinkMaxKeys,\n })\n addMutationRecorder(mutationRecorder)\n },\n dispose() {\n if (disposed) {\n return\n }\n disposed = true\n scheduler.dispose()\n if (started) {\n removeMutationRecorder(mutationRecorder)\n }\n clearPatchIndices(options.state)\n },\n }\n}\n\nconst patchStrategyHooks: NonNullable<RuntimeCapabilityRegistry['patchStrategy']> = {\n createScheduler: createPatchSetDataScheduler,\n}\n\n/**\n * 安装 patch setData 策略。\n */\nexport function installPatchStrategy(): void {\n registerRuntimeCapability('patchStrategy', patchStrategyHooks)\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PageLayoutState, WevuPageLayoutMap, resolveRuntimePageLayoutName as resolveRuntimePageLayoutName$1, syncRuntimePageLayoutState as syncRuntimePageLayoutState$1, syncRuntimePageLayoutStateFromRuntime as syncRuntimePageLayoutStateFromRuntime$1, usePageLayout as usePageLayout$1 } from "../pageLayout.mjs";
|
|
2
|
+
import { LayoutHostBinding } from "../capabilities.mjs";
|
|
3
|
+
import { LayoutBridgeInstance, registerPageLayoutBridge as registerPageLayoutBridge$1, registerRuntimeLayoutHosts as registerRuntimeLayoutHosts$1, resolveLayoutBridge as resolveLayoutBridge$1, resolveLayoutHost as resolveLayoutHost$1, unregisterPageLayoutBridge as unregisterPageLayoutBridge$1, unregisterRuntimeLayoutHosts as unregisterRuntimeLayoutHosts$1, useLayoutBridge as useLayoutBridge$1, useLayoutHosts as useLayoutHosts$1, waitForLayoutHost as waitForLayoutHost$1 } from "../layoutBridge.mjs";
|
|
4
|
+
//#region src/runtime/features/publicLayout.d.ts
|
|
5
|
+
export declare const registerPageLayoutBridge: typeof registerPageLayoutBridge$1;
|
|
6
|
+
export declare const unregisterPageLayoutBridge: typeof unregisterPageLayoutBridge$1;
|
|
7
|
+
export declare const resolveLayoutBridge: typeof resolveLayoutBridge$1;
|
|
8
|
+
export declare const resolveLayoutHost: typeof resolveLayoutHost$1;
|
|
9
|
+
export declare const waitForLayoutHost: typeof waitForLayoutHost$1;
|
|
10
|
+
export declare const useLayoutBridge: typeof useLayoutBridge$1;
|
|
11
|
+
export declare const registerRuntimeLayoutHosts: typeof registerRuntimeLayoutHosts$1;
|
|
12
|
+
export declare const unregisterRuntimeLayoutHosts: typeof unregisterRuntimeLayoutHosts$1;
|
|
13
|
+
export declare const useLayoutHosts: typeof useLayoutHosts$1;
|
|
14
|
+
export declare const usePageLayout: typeof usePageLayout$1;
|
|
15
|
+
type PublicPageLayoutName = keyof WevuPageLayoutMap extends never ? string : Extract<keyof WevuPageLayoutMap, string>;
|
|
16
|
+
type PublicPageLayoutProps<Name extends string> = Name extends keyof WevuPageLayoutMap ? WevuPageLayoutMap[Name] : object;
|
|
17
|
+
export declare function setPageLayout(layout: false): void;
|
|
18
|
+
export declare function setPageLayout<Name extends PublicPageLayoutName>(layout: Name, props?: PublicPageLayoutProps<Name>): void;
|
|
19
|
+
export declare const syncRuntimePageLayoutState: typeof syncRuntimePageLayoutState$1;
|
|
20
|
+
export declare const syncRuntimePageLayoutStateFromRuntime: typeof syncRuntimePageLayoutStateFromRuntime$1;
|
|
21
|
+
export declare const resolveRuntimePageLayoutName: typeof resolveRuntimePageLayoutName$1;
|
|
22
|
+
//#endregion
|
|
23
|
+
export type { LayoutBridgeInstance, LayoutHostBinding, PageLayoutState, WevuPageLayoutMap };
|
|
24
|
+
//# sourceMappingURL=publicLayout.d.mts.map
|