wevu 7.5.0 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alipay/jsx-runtime.d.mts +0 -2
- package/dist/config/defaults.d.mts +42 -0
- package/dist/config/pageFeatures.d.mts +49 -0
- package/dist/config.d.mts +4 -0
- package/dist/config.mjs +1 -0
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/defineProperty.mjs +1 -2
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPrimitive.mjs +1 -2
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPropertyKey.mjs +1 -2
- package/dist/dev/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/typeof.mjs +1 -2
- package/dist/dev/api/vitest/setup.mjs +1 -2
- package/dist/dev/package.mjs +2 -3
- package/dist/dev/reactivity/asyncDerivation.mjs +1 -2
- package/dist/dev/reactivity/computed.mjs +1 -2
- package/dist/dev/reactivity/computed.mjs.map +1 -1
- package/dist/dev/reactivity/core.mjs +2 -3
- package/dist/dev/reactivity/reactive/mutation.mjs +1 -2
- package/dist/dev/reactivity/reactive/patch.mjs +1 -2
- package/dist/dev/reactivity/reactive/patchState.mjs +1 -2
- package/dist/dev/reactivity/reactive/shallow.mjs +1 -2
- package/dist/dev/reactivity/reactive/shared.mjs +1 -2
- package/dist/dev/reactivity/reactive/state.mjs +1 -2
- package/dist/dev/reactivity/reactive.mjs +1 -2
- package/dist/dev/reactivity/readonly.mjs +1 -2
- package/dist/dev/reactivity/ref.mjs +2 -3
- package/dist/dev/reactivity/ref.mjs.map +1 -1
- package/dist/dev/reactivity/shallowRef.mjs +1 -2
- package/dist/dev/reactivity/toRefs.mjs +1 -2
- package/dist/dev/reactivity/traverse.mjs +1 -2
- package/dist/dev/reactivity/watch/helpers.mjs +1 -2
- package/dist/dev/reactivity/watch/types.mjs +1 -2
- package/dist/dev/reactivity/watch.mjs +1 -2
- package/dist/dev/router/auto-routes.mjs +1 -2
- package/dist/dev/router/backNavigation.mjs +1 -2
- package/dist/dev/router/createRouter.mjs +1 -2
- package/dist/dev/router/initialNavigation.mjs +1 -2
- package/dist/dev/router/instance.mjs +1 -2
- package/dist/dev/router/navigationApi.mjs +1 -2
- package/dist/dev/router/navigationCore.mjs +1 -2
- package/dist/dev/router/navigationResult.mjs +1 -2
- package/dist/dev/router/navigationTarget.mjs +1 -2
- package/dist/dev/router/navigationTargetHelpers.mjs +1 -2
- package/dist/dev/router/resolve.mjs +1 -2
- package/dist/dev/router/routeRegistry.mjs +1 -2
- package/dist/dev/router/routeSync.mjs +1 -2
- package/dist/dev/router/scrollRestoration/adapters.mjs +1 -2
- package/dist/dev/router/scrollRestoration/controller.mjs +1 -2
- package/dist/dev/router/scrollRestoration/host.mjs +1 -2
- package/dist/dev/router/scrollRestoration/index.mjs +1 -2
- package/dist/dev/router/types.mjs +1 -2
- package/dist/dev/router/useRoute.mjs +1 -2
- package/dist/dev/router/useRouter.mjs +1 -2
- package/dist/dev/routerInternal/location.mjs +1 -2
- package/dist/dev/routerInternal/matching.mjs +1 -2
- package/dist/dev/routerInternal/params.mjs +1 -2
- package/dist/dev/routerInternal/path.mjs +1 -2
- package/dist/dev/routerInternal/query.mjs +1 -2
- package/dist/dev/routerInternal/records.mjs +1 -2
- package/dist/dev/routerInternal/recordsWarnings.mjs +1 -2
- package/dist/dev/routerInternal/snapshots.mjs +1 -2
- package/dist/dev/runtime/app/computed.mjs +1 -2
- package/dist/dev/runtime/app/context.mjs +1 -2
- package/dist/dev/runtime/app/diagnostics.mjs +1 -2
- package/dist/dev/runtime/app/mount.mjs +1 -2
- package/dist/dev/runtime/app/pending.mjs +1 -2
- package/dist/dev/runtime/app/setData/commitTracker.mjs +1 -2
- package/dist/dev/runtime/app/setData/observation.mjs +1 -2
- package/dist/dev/runtime/app/setData/patchScheduler.mjs +1 -2
- package/dist/dev/runtime/app/setData/payload.mjs +1 -2
- package/dist/dev/runtime/app/setData/scheduler.mjs +1 -2
- package/dist/dev/runtime/app/setData/snapshot.mjs +1 -2
- package/dist/dev/runtime/app/setDataOptions.mjs +1 -2
- package/dist/dev/runtime/app.mjs +1 -2
- package/dist/dev/runtime/bindModel.mjs +1 -2
- package/dist/dev/runtime/bindingManifest.mjs +1 -2
- package/dist/dev/runtime/capabilities.mjs +1 -2
- package/dist/dev/runtime/css.mjs +1 -2
- package/dist/dev/runtime/defaults.mjs +1 -2
- package/dist/dev/runtime/define/componentDefinition.mjs +1 -2
- package/dist/dev/runtime/define/initialComputed.mjs +1 -2
- package/dist/dev/runtime/define/options.mjs +1 -2
- package/dist/dev/runtime/define/optionsApi.mjs +1 -2
- package/dist/dev/runtime/define/props.mjs +1 -2
- package/dist/dev/runtime/define/scopedSlotOptions.mjs +1 -2
- package/dist/dev/runtime/define/setupResult.mjs +4 -7
- package/dist/dev/runtime/define/setupResult.mjs.map +1 -1
- package/dist/dev/runtime/define.mjs +3 -9
- package/dist/dev/runtime/define.mjs.map +1 -1
- package/dist/dev/runtime/diff.mjs +1 -2
- package/dist/dev/runtime/disposables.mjs +1 -2
- package/dist/dev/runtime/elementIntersectionObserver.mjs +1 -2
- package/dist/dev/runtime/emit.mjs +1 -2
- package/dist/dev/runtime/features/inlineEvents.mjs +1 -2
- package/dist/dev/runtime/features/jsxIslands.mjs +1 -2
- package/dist/dev/runtime/features/layout.mjs +1 -2
- package/dist/dev/runtime/features/patchStrategy.mjs +1 -2
- package/dist/dev/runtime/features/publicLayout.mjs +1 -2
- package/dist/dev/runtime/features/scopedSlots.mjs +1 -2
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.mjs +1 -2
- package/dist/dev/runtime/features/templateRefs.mjs +1 -2
- package/dist/dev/runtime/hooks/base.mjs +1 -2
- package/dist/dev/runtime/hooks/pageScroll.mjs +1 -2
- package/dist/dev/runtime/hooks/register.mjs +1 -2
- package/dist/dev/runtime/hooks/vue.mjs +1 -2
- package/dist/dev/runtime/inlineDataset.mjs +1 -2
- package/dist/dev/runtime/internal.mjs +1 -2
- package/dist/dev/runtime/intersectionObserver.mjs +1 -2
- package/dist/dev/runtime/jsxIsland.mjs +1 -2
- package/dist/dev/runtime/layoutBridge.mjs +1 -2
- package/dist/dev/runtime/layoutComponentMatcher.mjs +1 -2
- package/dist/dev/runtime/nativeBridge.mjs +1 -2
- package/dist/dev/runtime/navigationLifecycle.mjs +1 -2
- package/dist/dev/runtime/noSetData.mjs +1 -2
- package/dist/dev/runtime/pageEnvironment.mjs +1 -2
- package/dist/dev/runtime/pageLayout.mjs +1 -2
- package/dist/dev/runtime/pageLayout.mjs.map +1 -1
- package/dist/dev/runtime/pageScroll.mjs +1 -2
- package/dist/dev/runtime/platform/current.mjs +1 -2
- package/dist/dev/runtime/platform/generic.mjs +1 -2
- package/dist/dev/runtime/platform/globals.mjs +1 -2
- package/dist/dev/runtime/platform.mjs +1 -2
- package/dist/dev/runtime/provide.mjs +1 -2
- package/dist/dev/runtime/provideContext.mjs +1 -2
- package/dist/dev/runtime/provideStore.mjs +1 -2
- package/dist/dev/runtime/publicRuntime.mjs +1 -2
- package/dist/dev/runtime/pullDownRefresh.mjs +1 -2
- package/dist/dev/runtime/register/app.mjs +1 -2
- package/dist/dev/runtime/register/component/alipay.mjs +1 -2
- package/dist/dev/runtime/register/component/alipayRegistration.mjs +1 -2
- package/dist/dev/runtime/register/component/features.mjs +1 -2
- package/dist/dev/runtime/register/component/hmrRegistration.mjs +14 -0
- package/dist/dev/runtime/register/component/hmrRegistration.mjs.map +1 -0
- package/dist/dev/runtime/register/component/lifecycle/optionalHooks.mjs +1 -2
- package/dist/dev/runtime/register/component/lifecycle/platform.mjs +1 -2
- package/dist/dev/runtime/register/component/lifecycle.mjs +1 -2
- package/dist/dev/runtime/register/component/methods.mjs +1 -2
- package/dist/dev/runtime/register/component/options.mjs +1 -2
- package/dist/dev/runtime/register/component/props.mjs +5 -6
- package/dist/dev/runtime/register/component/props.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerDefinition.mjs +7 -6
- package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +1 -2
- package/dist/dev/runtime/register/component.mjs +23 -14
- package/dist/dev/runtime/register/component.mjs.map +1 -1
- package/dist/dev/runtime/register/inline.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/nativeDeclaration.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +3 -27
- package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
- package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance/utils.mjs +1 -2
- package/dist/dev/runtime/register/runtimeInstance.mjs +12 -14
- package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
- package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +1 -2
- package/dist/dev/runtime/register/setup.mjs +1 -2
- package/dist/dev/runtime/register/snapshot.mjs +1 -2
- package/dist/dev/runtime/register/watch.mjs +2 -5
- package/dist/dev/runtime/register/watch.mjs.map +1 -1
- package/dist/dev/runtime/scopedSlots.mjs +1 -2
- package/dist/dev/runtime/selectorQuery.mjs +1 -2
- package/dist/dev/runtime/setupTracking.mjs +1 -2
- package/dist/dev/runtime/teardown.mjs +1 -2
- package/dist/dev/runtime/template.mjs +1 -2
- package/dist/dev/runtime/templateRefs/helpers.mjs +1 -2
- package/dist/dev/runtime/templateRefs.mjs +1 -2
- package/dist/dev/runtime/uniAppHost.mjs +1 -2
- package/dist/dev/runtime/updatePerformance.mjs +1 -2
- package/dist/dev/runtime/use.mjs +1 -2
- package/dist/dev/runtime/vueCompat/context.mjs +1 -2
- package/dist/dev/runtime/vueCompat/model.mjs +1 -2
- package/dist/dev/runtime/vueCompat/router.mjs +1 -2
- package/dist/dev/runtime/vueCompat/templateRef.mjs +1 -2
- package/dist/dev/scheduler.mjs +1 -2
- package/dist/dev/store/actions.mjs +1 -2
- package/dist/dev/store/base.mjs +1 -2
- package/dist/dev/store/define/create.mjs +1 -2
- package/dist/dev/store/define.mjs +1 -2
- package/dist/dev/store/manager.mjs +1 -2
- package/dist/dev/store/storeToRefs.mjs +1 -2
- package/dist/dev/store/subscriptions.mjs +1 -2
- package/dist/dev/store/types.mjs +1 -2
- package/dist/dev/store/utils.mjs +1 -2
- package/dist/dev/store/view.mjs +1 -2
- package/dist/dev/utils.mjs +1 -2
- package/dist/dev/version.mjs +1 -2
- package/dist/dev/vue-demi.mjs +1 -2
- package/dist/fetch.d.mts +0 -2
- package/dist/index.d.mts +13 -8
- package/dist/internal-reactivity.d.mts +2 -1
- package/dist/jsx-runtime.d.mts +1 -2
- package/dist/jsxTypes.d.mts +1 -3
- package/dist/macros/shared.d.mts +2 -3
- package/dist/macros.d.mts +3 -12
- package/dist/miniprogram/jsx-runtime.d.mts +0 -2
- package/dist/package.mjs +1 -1
- package/dist/reactivity/asyncDerivation.d.mts +1 -2
- package/dist/reactivity/computed.d.mts +2 -8
- package/dist/reactivity/core.d.mts +1 -3
- package/dist/reactivity/core.mjs +1 -1
- package/dist/reactivity/index.d.mts +2 -1
- package/dist/reactivity/reactive/mutation.d.mts +1 -2
- package/dist/reactivity/reactive/patch.d.mts +1 -3
- package/dist/reactivity/reactive/patchState.mjs +1 -1
- package/dist/reactivity/reactive/shallow.d.mts +1 -3
- package/dist/reactivity/reactive/shared.d.mts +1 -3
- package/dist/reactivity/reactive.d.mts +0 -2
- package/dist/reactivity/readonly.d.mts +1 -3
- package/dist/reactivity/ref.d.mts +2 -4
- package/dist/reactivity/ref.mjs +1 -1
- package/dist/reactivity/shallowRef.d.mts +1 -3
- package/dist/reactivity/toRefs.d.mts +1 -2
- package/dist/reactivity/traverse.d.mts +1 -3
- package/dist/reactivity/watch/types.d.mts +1 -2
- package/dist/reactivity/watch.d.mts +0 -2
- package/dist/router/auto-routes.d.mts +0 -2
- package/dist/router/createRouter.d.mts +1 -3
- package/dist/router/navigationCore.d.mts +1 -3
- package/dist/router/resolve.d.mts +1 -3
- package/dist/router/scrollRestoration/adapters.d.mts +1 -3
- package/dist/router/scrollRestoration/controller.d.mts +1 -3
- package/dist/router/scrollRestoration/index.d.mts +0 -2
- package/dist/router/scrollRestoration/index.mjs +1 -1
- package/dist/router/scrollRestoration/types.d.mts +1 -3
- package/dist/router/types.d.mts +1 -2
- package/dist/router/useRoute.d.mts +1 -3
- package/dist/router/useRouter.d.mts +1 -3
- package/dist/router.d.mts +0 -2
- package/dist/routerInternal/query.d.mts +1 -3
- package/dist/routerInternal/types.d.mts +1 -3
- package/dist/runtime/app/pending.d.mts +1 -3
- package/dist/runtime/app/setData/commitTracker.d.mts +1 -3
- package/dist/runtime/app/setData/observation.d.mts +1 -2
- package/dist/runtime/app/setData/scheduler.d.mts +1 -3
- package/dist/runtime/app/setData/scheduler.mjs +1 -1
- package/dist/runtime/app.d.mts +2 -4
- package/dist/runtime/capabilities.d.mts +2 -4
- package/dist/runtime/css.d.mts +1 -3
- package/dist/runtime/defaults.d.mts +1 -3
- package/dist/runtime/define/props.mjs +1 -1
- package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
- package/dist/runtime/define/setupResult.mjs +1 -1
- package/dist/runtime/define.d.mts +4 -4
- package/dist/runtime/define.mjs +1 -1
- package/dist/runtime/disposables.d.mts +1 -3
- package/dist/runtime/elementIntersectionObserver.d.mts +1 -3
- package/dist/runtime/features/inlineEvents.d.mts +1 -3
- package/dist/runtime/features/jsxIslands.d.mts +1 -3
- package/dist/runtime/features/layout.d.mts +1 -3
- package/dist/runtime/features/patchStrategy.d.mts +1 -3
- package/dist/runtime/features/publicLayout.d.mts +2 -3
- package/dist/runtime/features/scopedSlots.d.mts +2 -4
- package/dist/runtime/features/setDataHighFrequencyWarning.d.mts +1 -3
- package/dist/runtime/features/templateRefs.d.mts +1 -3
- package/dist/runtime/hooks/base.d.mts +1 -3
- package/dist/runtime/hooks/register.d.mts +1 -3
- package/dist/runtime/hooks/vue.d.mts +1 -3
- package/dist/runtime/index.d.mts +7 -4
- package/dist/runtime/intersectionObserver.d.mts +1 -3
- package/dist/runtime/jsxIsland.d.mts +1 -3
- package/dist/runtime/layoutBridge.d.mts +0 -2
- package/dist/runtime/noSetData.d.mts +1 -3
- package/dist/runtime/pageEnvironment.d.mts +1 -3
- package/dist/runtime/pageLayout.d.mts +2 -3
- package/dist/runtime/pageScroll.d.mts +1 -3
- package/dist/runtime/provide.d.mts +0 -2
- package/dist/runtime/provideStore.d.mts +1 -3
- package/dist/runtime/publicRuntime.d.mts +1 -3
- package/dist/runtime/pullDownRefresh.d.mts +1 -3
- package/dist/runtime/register/app.d.mts +2 -4
- package/dist/runtime/register/component/hmrRegistration.mjs +1 -0
- package/dist/runtime/register/component/props.mjs +1 -1
- package/dist/runtime/register/component/registerDefinition.mjs +1 -1
- package/dist/runtime/register/component.d.mts +2 -4
- package/dist/runtime/register/component.mjs +1 -1
- package/dist/runtime/register/inline.d.mts +1 -2
- package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -1
- package/dist/runtime/register/runtimeInstance.d.mts +2 -3
- package/dist/runtime/register/runtimeInstance.mjs +1 -1
- package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -1
- package/dist/runtime/register/setup.d.mts +1 -2
- package/dist/runtime/register/watch.d.mts +1 -2
- package/dist/runtime/register/watch.mjs +1 -1
- package/dist/runtime/selectorQuery.d.mts +1 -3
- package/dist/runtime/template.d.mts +1 -3
- package/dist/runtime/templateRefTypes.d.mts +2 -6
- package/dist/runtime/types/core.d.mts +2 -8
- package/dist/runtime/types/miniprogram.d.mts +0 -2
- package/dist/runtime/types/miniprogramHost.d.mts +0 -2
- package/dist/runtime/types/miniprogramHostSources.d.mts +2 -3
- package/dist/runtime/types/options.d.mts +5 -53
- package/dist/runtime/types/props/propTypes.d.mts +1 -2
- package/dist/runtime/types/props/router.d.mts +1 -2
- package/dist/runtime/types/props/setup.d.mts +3 -4
- package/dist/runtime/types/runtime.d.mts +3 -4
- package/dist/runtime/types/setData.d.mts +1 -3
- package/dist/runtime/types.d.mts +5 -5
- package/dist/runtime/uniAppHost.d.mts +1 -2
- package/dist/runtime/updatePerformance.d.mts +1 -3
- package/dist/runtime/use.d.mts +1 -3
- package/dist/runtime/vueCompat/context.d.mts +1 -3
- package/dist/runtime/vueCompat/model.d.mts +2 -3
- package/dist/runtime/vueCompat/router.d.mts +1 -2
- package/dist/runtime/vueCompat/templateRef.d.mts +1 -3
- package/dist/scheduler.d.mts +1 -3
- package/dist/store/define.d.mts +1 -3
- package/dist/store/manager.d.mts +1 -3
- package/dist/store/storeToRefs.d.mts +1 -2
- package/dist/store/types.d.mts +3 -4
- package/dist/tt/jsx-runtime.d.mts +0 -2
- package/dist/types/definitions.d.mts +5 -0
- package/dist/types/pageLayout.d.mts +2 -0
- package/dist/types/pageMeta.d.mts +8 -0
- package/dist/types/reactivity.d.mts +11 -0
- package/dist/types.d.mts +5 -0
- package/dist/types.mjs +1 -0
- package/dist/version.d.mts +1 -3
- package/dist/vue-augment.d.mts +1 -3
- package/dist/vue-demi.d.mts +13 -9
- package/dist/vue-types.d.mts +3 -6
- package/dist/weapp/jsx-runtime.d.mts +0 -2
- package/package.json +22 -13
- /package/dist/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/defineProperty.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPrimitive.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPropertyKey.mjs +0 -0
- /package/dist/_virtual/{_@oxc-project_runtime@0.153.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/typeof.mjs +0 -0
|
@@ -3,7 +3,6 @@ import { MaybeRefOrGetter } from "../reactivity/ref.mjs";
|
|
|
3
3
|
import "../reactivity/index.mjs";
|
|
4
4
|
import { InternalRuntimeState } from "./types/runtime.mjs";
|
|
5
5
|
import "./types.mjs";
|
|
6
|
-
//#region src/runtime/elementIntersectionObserver.d.ts
|
|
7
6
|
export type ElementIntersectionObserverCallback<T = unknown> = (result: T) => void;
|
|
8
7
|
export interface UseElementIntersectionObserverOptions<T = unknown> {
|
|
9
8
|
context?: InternalRuntimeState | null;
|
|
@@ -21,5 +20,4 @@ export interface UseElementIntersectionObserverReturn {
|
|
|
21
20
|
/**
|
|
22
21
|
* 观察当前组件或页面内的节点可见性,并在卸载时自动断开。
|
|
23
22
|
*/
|
|
24
|
-
export declare function useElementIntersectionObserver<T = unknown>(options: UseElementIntersectionObserverOptions<T>): UseElementIntersectionObserverReturn;
|
|
25
|
-
//#endregion
|
|
23
|
+
export declare function useElementIntersectionObserver<T = unknown>(options: UseElementIntersectionObserverOptions<T>): UseElementIntersectionObserverReturn;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WevuPageLayoutMap } from "../../types/pageLayout.mjs";
|
|
2
|
+
import { PageLayoutState, resolveRuntimePageLayoutName as resolveRuntimePageLayoutName$1, syncRuntimePageLayoutState as syncRuntimePageLayoutState$1, syncRuntimePageLayoutStateFromRuntime as syncRuntimePageLayoutStateFromRuntime$1, usePageLayout as usePageLayout$1 } from "../pageLayout.mjs";
|
|
2
3
|
import { LayoutHostBinding } from "../capabilities.mjs";
|
|
3
4
|
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
5
|
export declare const registerPageLayoutBridge: typeof registerPageLayoutBridge$1;
|
|
6
6
|
export declare const unregisterPageLayoutBridge: typeof unregisterPageLayoutBridge$1;
|
|
7
7
|
export declare const resolveLayoutBridge: typeof resolveLayoutBridge$1;
|
|
@@ -19,5 +19,4 @@ export declare function setPageLayout<Name extends PublicPageLayoutName>(layout:
|
|
|
19
19
|
export declare const syncRuntimePageLayoutState: typeof syncRuntimePageLayoutState$1;
|
|
20
20
|
export declare const syncRuntimePageLayoutStateFromRuntime: typeof syncRuntimePageLayoutStateFromRuntime$1;
|
|
21
21
|
export declare const resolveRuntimePageLayoutName: typeof resolveRuntimePageLayoutName$1;
|
|
22
|
-
//#endregion
|
|
23
22
|
export type { LayoutBridgeInstance, LayoutHostBinding, PageLayoutState, WevuPageLayoutMap };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ComputedDefinitions } from "
|
|
1
|
+
import { ComputedDefinitions } from "../../types/definitions.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
3
|
import { InlineExpressionMap } from "../register/inline.mjs";
|
|
4
4
|
import { LayoutHostBinding, TemplateRefBinding } from "../capabilities.mjs";
|
|
5
5
|
import { WEVU_BINDING_MANIFEST_KEY, WEVU_NATIVE_SLOT_CONTEXT_KEY, WevuRuntimeBindingManifestV1 } from "@weapp-core/constants";
|
|
6
|
-
//#region src/runtime/features/scopedSlots.d.ts
|
|
7
6
|
export interface CreateWevuScopedSlotComponentOptions {
|
|
8
7
|
computed?: ComputedDefinitions;
|
|
9
8
|
inlineMap?: InlineExpressionMap;
|
|
@@ -19,5 +18,4 @@ export declare function createWevuScopedSlotComponent(overrides?: CreateWevuScop
|
|
|
19
18
|
/**
|
|
20
19
|
* 安装作用域插槽的 owner 生命周期与组件创建能力。
|
|
21
20
|
*/
|
|
22
|
-
export declare function installScopedSlots(): void;
|
|
23
|
-
//#endregion
|
|
21
|
+
export declare function installScopedSlots(): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { InternalRuntimeState } from "../types/runtime.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/hooks/base.d.ts
|
|
4
3
|
export declare function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined;
|
|
5
4
|
/**
|
|
6
5
|
* 设置当前运行时实例(框架内部使用)。
|
|
@@ -22,5 +21,4 @@ export declare function callHookList(target: InternalRuntimeState, name: string,
|
|
|
22
21
|
* 调用返回值型 hook(框架内部调度入口)。
|
|
23
22
|
* @internal
|
|
24
23
|
*/
|
|
25
|
-
export declare function callHookReturn(target: InternalRuntimeState, name: string, args?: any[]): any;
|
|
26
|
-
//#endregion
|
|
24
|
+
export declare function callHookReturn(target: InternalRuntimeState, name: string, args?: any[]): any;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HostMiniProgramAddToFavoritesOption, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramSaveExitState, HostMiniProgramShareAppMessageOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramUnhandledRejectionResult } from "../types/miniprogramHost.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/hooks/register.d.ts
|
|
4
3
|
export declare function onLaunch(handler: (options: HostMiniProgramLaunchOptions) => void): void;
|
|
5
4
|
export declare function onPageNotFound(handler: (options: HostMiniProgramPageNotFoundOptions) => void): void;
|
|
6
5
|
export declare function onUnhandledRejection(handler: (options: HostMiniProgramUnhandledRejectionResult) => void): void;
|
|
@@ -25,5 +24,4 @@ export declare function onError(handler: (err: any) => void): void;
|
|
|
25
24
|
export declare function onSaveExitState(handler: () => HostMiniProgramSaveExitState): void;
|
|
26
25
|
export declare function onShareAppMessage(handler: (options: HostMiniProgramShareAppMessageOption) => Record<string, any> | void): void;
|
|
27
26
|
export declare function onShareTimeline(handler: HostMiniProgramPageLifetime['onShareTimeline']): void;
|
|
28
|
-
export declare function onAddToFavorites(handler: (options: HostMiniProgramAddToFavoritesOption) => Record<string, any> | void): void;
|
|
29
|
-
//#endregion
|
|
27
|
+
export declare function onAddToFavorites(handler: (options: HostMiniProgramAddToFavoritesOption) => Record<string, any> | void): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { InternalRuntimeState } from "../types/runtime.mjs";
|
|
2
2
|
import "../types.mjs";
|
|
3
|
-
//#region src/runtime/hooks/vue.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Vue 3 对齐:组件/页面已挂载,映射小程序 onReady
|
|
6
5
|
*/
|
|
@@ -47,5 +46,4 @@ export declare function onServerPrefetch(_handler: () => void): void;
|
|
|
47
46
|
* 派发更新阶段钩子(框架内部调度入口)。
|
|
48
47
|
* @internal
|
|
49
48
|
*/
|
|
50
|
-
export declare function callUpdateHooks(target: InternalRuntimeState, phase: 'before' | 'after'): void;
|
|
51
|
-
//#endregion
|
|
49
|
+
export declare function callUpdateHooks(target: InternalRuntimeState, phase: 'before' | 'after'): void;
|
package/dist/runtime/index.d.mts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
import { SetDataBindingDiagnostic, SetDataDebugInfo, SetDataSnapshotOptions } from "./types/setData.mjs";
|
|
2
|
+
import { PageFeatures } from "../config/pageFeatures.mjs";
|
|
1
3
|
import { AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract } from "./types/miniprogramHostSources.mjs";
|
|
2
4
|
import { HostMiniProgramAddToFavoritesOption, HostMiniProgramAppOptions, HostMiniProgramAppTrivialInstance, HostMiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray, HostMiniProgramComponentInstance, HostMiniProgramComponentMethodOption, HostMiniProgramComponentPropertyOption, HostMiniProgramComponentPropertyValue, HostMiniProgramComponentShortProperty, HostMiniProgramComponentTrivialInstance, HostMiniProgramComponentTrivialOption, HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption, HostMiniProgramNodesRef, HostMiniProgramNodesRefFields, HostMiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramPageTrivialInstance, HostMiniProgramReLaunchOption, HostMiniProgramRedirectToOption, HostMiniProgramRouter, HostMiniProgramSaveExitState, HostMiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramTriggerEventOptions, HostMiniProgramUnhandledRejectionResult } from "./types/miniprogramHost.mjs";
|
|
3
5
|
import { MiniProgramAdapter, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, MiniProgramComponentInstance, MiniProgramComponentOptions, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, MiniProgramInstance, MiniProgramPageLifetimes } from "./types/miniprogram.mjs";
|
|
4
6
|
import { ComponentPropsOptions, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InferNativePropType, InferNativeProps, InferPropType, InferProps, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, PropConstructor, PropOptions, PropType } from "./types/props/propTypes.mjs";
|
|
5
7
|
import { MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, SetupContextRouter, WevuTypedRouterRouteMap } from "./types/props/router.mjs";
|
|
6
|
-
import {
|
|
8
|
+
import { ComputedDefinitions, ExtractComputed, ExtractMethods, MethodDefinitions } from "../types/definitions.mjs";
|
|
9
|
+
import { ComponentPublicInstance, ModelBinding, ModelBindingOptions, ModelBindingPayload } from "./types/core.mjs";
|
|
7
10
|
import { AppConfig, InternalRuntimeState, InternalRuntimeStateFields, RuntimeApp, RuntimeInstance, WevuPlugin } from "./types/runtime.mjs";
|
|
8
11
|
import { SetupContext, SetupContextIntersectionObserver, SetupContextIntersectionObserverOptions, SetupContextNativeInstance, SetupContextSelectorQuery, SetupFunction } from "./types/props/setup.mjs";
|
|
9
12
|
import { AllowedComponentProps, ComponentCustomProps, ComponentOptionsMixin, DefineComponent, NativeComponent, ObjectDirective, PublicProps, ShallowUnwrapRef, VNode, VNodeProps } from "../vue-types.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import { CreateAppOptions, DataOption, DefineAppOptions, DefineComponentOptions, PageFeatures } from "./types/options.mjs";
|
|
13
|
+
import { CreateAppOptions, DataOption, DefineAppOptions, DefineComponentOptions } from "./types/options.mjs";
|
|
12
14
|
import { GlobalComponents, GlobalDirectives, MiniProgramTemplateRefValue, TemplateRefValue, TemplateRefs, WevuGlobalComponents, WevuGlobalDirectives } from "./types.mjs";
|
|
13
15
|
import { useCssModule } from "./css.mjs";
|
|
14
16
|
import { WevuDefaults, resetWevuDefaults } from "./defaults.mjs";
|
|
15
17
|
import { ComponentDefinition, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, SetupContextWithTypeProps, SetupFunctionWithTypeProps, WevuComponentConstructor, WevuDefinedComponent } from "./define.mjs";
|
|
16
18
|
import { DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, useDisposables } from "./disposables.mjs";
|
|
17
19
|
import { ElementIntersectionObserverCallback, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, useElementIntersectionObserver } from "./elementIntersectionObserver.mjs";
|
|
18
|
-
import {
|
|
20
|
+
import { WevuPageLayoutMap } from "../types/pageLayout.mjs";
|
|
21
|
+
import { PageLayoutState } from "./pageLayout.mjs";
|
|
19
22
|
import { LayoutHostBinding } from "./capabilities.mjs";
|
|
20
23
|
import { LayoutBridgeInstance } from "./layoutBridge.mjs";
|
|
21
24
|
import { registerPageLayoutBridge, registerRuntimeLayoutHosts, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, setPageLayout, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, useLayoutBridge, useLayoutHosts, usePageLayout, waitForLayoutHost } from "./features/publicLayout.mjs";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions } from "./types/miniprogramHost.mjs";
|
|
2
2
|
import "./types.mjs";
|
|
3
|
-
//#region src/runtime/intersectionObserver.d.ts
|
|
4
3
|
export type UseIntersectionObserverOptions = HostMiniProgramIntersectionObserverOptions;
|
|
5
4
|
export type UseIntersectionObserverResult = HostMiniProgramIntersectionObserver;
|
|
6
5
|
/**
|
|
@@ -9,5 +8,4 @@ export type UseIntersectionObserverResult = HostMiniProgramIntersectionObserver;
|
|
|
9
8
|
* - 优先使用 `ctx.instance.createIntersectionObserver(options)`。
|
|
10
9
|
* - 不可用时回退到宿主全局对象的 `createIntersectionObserver(...)`。
|
|
11
10
|
*/
|
|
12
|
-
export declare function useIntersectionObserver(options?: UseIntersectionObserverOptions): UseIntersectionObserverResult;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare function useIntersectionObserver(options?: UseIntersectionObserverOptions): UseIntersectionObserverResult;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WevuJsxVNode } from "../jsxTypes.mjs";
|
|
2
|
-
//#region src/runtime/jsxIsland.d.ts
|
|
3
2
|
export declare const Fragment: unique symbol;
|
|
4
3
|
export interface WevuJsxIslandNode {
|
|
5
4
|
children?: WevuJsxIslandNode[];
|
|
@@ -32,5 +31,4 @@ export declare function withDirectives(vnode: WevuJsxVNode, directives: unknown[
|
|
|
32
31
|
type: unknown;
|
|
33
32
|
};
|
|
34
33
|
export declare function resolveDirective(name: string): string;
|
|
35
|
-
export declare function normalizeJsxIsland(this: any, value: unknown, islandId: string, adapters: WevuJsxIslandAdapters): WevuJsxIslandNode | null;
|
|
36
|
-
//#endregion
|
|
34
|
+
export declare function normalizeJsxIsland(this: any, value: unknown, islandId: string, adapters: WevuJsxIslandAdapters): WevuJsxIslandNode | null;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LayoutHostBinding } from "./capabilities.mjs";
|
|
2
|
-
//#region src/runtime/layoutBridge.d.ts
|
|
3
2
|
type LayoutBridgeContext = Record<string, any>;
|
|
4
3
|
type LayoutBridgeComponentResolver = (selector: string) => any;
|
|
5
4
|
type LayoutHostMap = Record<string, unknown>;
|
|
@@ -50,5 +49,4 @@ export declare function unregisterRuntimeLayoutHosts(bindings: readonly LayoutHo
|
|
|
50
49
|
* 使用 key -> 宿主实例的映射批量暴露 layout 内部宿主,适合 toast/dialog 等共享反馈节点。
|
|
51
50
|
*/
|
|
52
51
|
export declare function useLayoutHosts(hosts: LayoutHostMap): void;
|
|
53
|
-
//#endregion
|
|
54
52
|
export type { LayoutHostBinding };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Ref } from "../reactivity/ref.mjs";
|
|
2
2
|
import { ComputedRef } from "../reactivity/computed.mjs";
|
|
3
3
|
import "../index.mjs";
|
|
4
|
-
//#region src/runtime/pageEnvironment.d.ts
|
|
5
4
|
export interface PageStackSnapshot {
|
|
6
5
|
canGoBack: boolean;
|
|
7
6
|
currentRoute: string;
|
|
@@ -45,5 +44,4 @@ export declare function useNavigationBarMetrics(options?: UseNavigationBarMetric
|
|
|
45
44
|
navigationHeight: ComputedRef<number>;
|
|
46
45
|
refresh: () => void;
|
|
47
46
|
statusBarHeight: Ref<number, number>;
|
|
48
|
-
};
|
|
49
|
-
//#endregion
|
|
47
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { WevuPageLayoutMap } from "../types/pageLayout.mjs";
|
|
2
2
|
type PageLayoutProps = object;
|
|
3
|
-
export interface WevuPageLayoutMap {}
|
|
4
3
|
type ResolveTypedPageLayoutName = keyof WevuPageLayoutMap extends never ? string : Extract<keyof WevuPageLayoutMap, string>;
|
|
5
4
|
type ResolveTypedPageLayoutProps<Name extends string> = Name extends keyof WevuPageLayoutMap ? WevuPageLayoutMap[Name] : PageLayoutProps;
|
|
6
5
|
type PageLayoutNamedState = { [Name in ResolveTypedPageLayoutName]: {
|
|
@@ -21,4 +20,4 @@ export declare function usePageLayout(): Readonly<PageLayoutState>;
|
|
|
21
20
|
export declare function syncRuntimePageLayoutState(target: Record<string, any>, layout: string | false, props: PageLayoutProps): void;
|
|
22
21
|
export declare function syncRuntimePageLayoutStateFromRuntime(target: Record<string, any>): void;
|
|
23
22
|
export declare function resolveRuntimePageLayoutName(layout: string | false): string;
|
|
24
|
-
|
|
23
|
+
export type { WevuPageLayoutMap };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HostMiniProgramPageScrollOption } from "./types/miniprogramHost.mjs";
|
|
2
2
|
import "./types.mjs";
|
|
3
|
-
//#region src/runtime/pageScroll.d.ts
|
|
4
3
|
export interface UsePageScrollThrottleOptions {
|
|
5
4
|
/**
|
|
6
5
|
* 节流间隔(毫秒),默认 80ms。
|
|
@@ -24,5 +23,4 @@ export type UsePageScrollThrottleStopHandle = () => void;
|
|
|
24
23
|
/**
|
|
25
24
|
* 在 setup 中注册节流后的 onPageScroll 监听,并在卸载时自动清理。
|
|
26
25
|
*/
|
|
27
|
-
export declare function usePageScrollThrottle(handler: (opt: HostMiniProgramPageScrollOption) => void, options?: UsePageScrollThrottleOptions): UsePageScrollThrottleStopHandle;
|
|
28
|
-
//#endregion
|
|
26
|
+
export declare function usePageScrollThrottle(handler: (opt: HostMiniProgramPageScrollOption) => void, options?: UsePageScrollThrottleOptions): UsePageScrollThrottleStopHandle;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { setGlobalProvidedValue } from "./provideStore.mjs";
|
|
2
|
-
//#region src/runtime/provide.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* 判断当前是否存在可用的注入上下文。
|
|
5
4
|
*
|
|
@@ -55,5 +54,4 @@ export declare function provideGlobal<T>(key: any, value: T): void;
|
|
|
55
54
|
* 在无实例上下文时 `inject()` 会自动从全局存储读取。
|
|
56
55
|
*/
|
|
57
56
|
export declare function injectGlobal<T>(key: any, defaultValue?: T): T;
|
|
58
|
-
//#endregion
|
|
59
57
|
export { setGlobalProvidedValue };
|
|
@@ -6,7 +6,6 @@ import { registerApp as registerApp$1 } from "./register/app.mjs";
|
|
|
6
6
|
import { registerComponent as registerComponent$1 } from "./register/component.mjs";
|
|
7
7
|
import { mountRuntimeInstance as mountRuntimeInstance$1 } from "./register/runtimeInstance.mjs";
|
|
8
8
|
import "./register.mjs";
|
|
9
|
-
//#region src/runtime/publicRuntime.d.ts
|
|
10
9
|
export declare const createApp: typeof createApp$1;
|
|
11
10
|
export declare const defineComponent: typeof defineComponent$1;
|
|
12
11
|
export declare const createWevuComponent: typeof createWevuComponent$1;
|
|
@@ -17,5 +16,4 @@ export declare const setWevuDefaults: typeof setWevuDefaults$1;
|
|
|
17
16
|
/**
|
|
18
17
|
* 创建公开入口的作用域插槽组件,并保留历史上的完整能力行为。
|
|
19
18
|
*/
|
|
20
|
-
export declare function createWevuScopedSlotComponent(overrides?: CreateWevuScopedSlotComponentOptions): void;
|
|
21
|
-
//#endregion
|
|
19
|
+
export declare function createWevuScopedSlotComponent(overrides?: CreateWevuScopedSlotComponentOptions): void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/runtime/pullDownRefresh.d.ts
|
|
2
1
|
export type PullDownRefreshHandler = () => void | Promise<void>;
|
|
3
2
|
export interface UseAsyncPullDownRefreshOptions {
|
|
4
3
|
onError?: (error: unknown) => void | Promise<void>;
|
|
@@ -7,5 +6,4 @@ export interface UseAsyncPullDownRefreshOptions {
|
|
|
7
6
|
/**
|
|
8
7
|
* 注册下拉刷新回调,并在回调结束后自动停止宿主下拉刷新状态。
|
|
9
8
|
*/
|
|
10
|
-
export declare function useAsyncPullDownRefresh(refresh: PullDownRefreshHandler, options?: UseAsyncPullDownRefreshOptions): void;
|
|
11
|
-
//#endregion
|
|
9
|
+
export declare function useAsyncPullDownRefresh(refresh: PullDownRefreshHandler, options?: UseAsyncPullDownRefreshOptions): void;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { MiniProgramAppOptions } from "../types/miniprogram.mjs";
|
|
2
|
-
import { ComputedDefinitions, MethodDefinitions } from "
|
|
2
|
+
import { ComputedDefinitions, MethodDefinitions } from "../../types/definitions.mjs";
|
|
3
3
|
import { RuntimeApp } from "../types/runtime.mjs";
|
|
4
4
|
import { DefineAppOptions } from "../types/options.mjs";
|
|
5
5
|
import "../types.mjs";
|
|
6
6
|
import { WatchMap } from "./watch.mjs";
|
|
7
|
-
//#region src/runtime/register/app.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* 注册 App 入口(框架内部使用)。
|
|
10
9
|
* @internal
|
|
11
10
|
*/
|
|
12
|
-
export declare function registerApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineAppOptions<D, C, M>['setup'], mpOptions: MiniProgramAppOptions): void;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare function registerApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineAppOptions<D, C, M>['setup'], mpOptions: MiniProgramAppOptions): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{WEAPP_VITE_STATEFUL_HMR_REGISTRATION_CONTRACT_VERSION as e,WEAPP_VITE_STATEFUL_HMR_UNSUPPORTED_REGISTRATION_CODE as t}from"@weapp-core/constants";function n(n,r){if(n.registrationContractVersion!==e)throw Object.assign(/* @__PURE__ */ Error(`Stateful HMR bridge does not support the Wevu registration contract; classic rebuild is required.`),{code:t});return{version:e,...r}}export{n as createStatefulHmrRegistrationContract};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasOwn as e}from"../../../utils.mjs";import{isDeepEqualValue as t}from"../../app/setData/snapshot.mjs";import{updateNativeDeclarationAddress as n}from"../runtimeInstance/nativeDeclaration.mjs";import{refreshOwnerSnapshotFromInstance as r}from"../snapshot.mjs";import{WEVU_ATTRS_KEY as i,WEVU_NATIVE_DECLARATION_ADDRESS_PROP as a,WEVU_PENDING_PROP_VALUES_KEY as o,WEVU_PROPS_DERIVED_KEYS_KEY as s,WEVU_PROPS_KEY as c,WEVU_PROP_KEYS_KEY as l,WEVU_SLOT_NAMES_PROP as u,WEVU_SLOT_OWNER_ID_PROP as d,WEVU_SLOT_SCOPE_KEY as f}from"@weapp-core/constants";function p(p){let{restOptions:m,
|
|
1
|
+
import{hasOwn as e}from"../../../utils.mjs";import{isDeepEqualValue as t}from"../../app/setData/snapshot.mjs";import{updateNativeDeclarationAddress as n}from"../runtimeInstance/nativeDeclaration.mjs";import{refreshOwnerSnapshotFromInstance as r}from"../snapshot.mjs";import{WEVU_ATTRS_KEY as i,WEVU_NATIVE_DECLARATION_ADDRESS_PROP as a,WEVU_PENDING_PROP_VALUES_KEY as o,WEVU_PROPS_DERIVED_KEYS_KEY as s,WEVU_PROPS_KEY as c,WEVU_PROP_KEYS_KEY as l,WEVU_SLOT_NAMES_PROP as u,WEVU_SLOT_OWNER_ID_PROP as d,WEVU_SLOT_SCOPE_KEY as f}from"@weapp-core/constants";function p(p){let{restOptions:m,nativeSlotContext:h,propsAliases:g,propsDerivedKeys:_,userObservers:v}=p,y=m.properties&&typeof m.properties==`object`?Object.keys(m.properties):[],b=new Set(y),x=new Set(_??[]),S=Object.entries(g??{}).filter(([e,t])=>e&&t),C=/* @__PURE__ */ new Set([u,d,f]),w=y.filter(e=>!C.has(e)),T=/* @__PURE__ */ new WeakMap,E=e=>e.startsWith(`__wv_`),D=e=>{let t=e.__wevu?.[s];if(t instanceof Set)for(let e of w)t.add(e)},O=(t,n,r)=>e(t,n)&&Object.is(t[n],r)?!1:(t[n]=r,!0),k=(n,r,i)=>C.has(r)&&e(n,r)&&t(n[r],i,20,{keys:1e4})?!1:O(n,r,i),A=(e,t,n)=>{if(!C.has(t))return;let r=!1,i=e.__wevu?.state;try{i&&typeof i==`object`&&k(i,t,n);let a=e.data;a&&typeof a==`object`&&(r=k(a,t,n))}catch{}if(r&&typeof e.setData==`function`)try{e.setData({[t]:n})}catch{}},j=(t,n)=>{if(!S.length)return;let r=t.__wevu,i=r?.setupState,a=r?.state;if(!i||typeof i!=`object`)return;D(t);let o=T.get(t)??/* @__PURE__ */ new Set;T.set(t,o);for(let[t,r]of S){if(e(i,t)&&!o.has(t))continue;let s=n[r];try{O(i,t,s),o.add(t)}catch{}if(a&&typeof a==`object`&&(!e(a,t)||o.has(t)))try{O(a,t,s)}catch{}}},M=(t,n)=>{if(!x.size)return;let r=t.__wevu?.setupState;if(!r||typeof r!=`object`)return;D(t);let i=new Map(S);for(let t of x){let a=i.get(t)??t;if(e(n,a))try{O(r,t,n[a])}catch{}}},N=e=>{try{Object.defineProperty(e,l,{value:y,configurable:!0,enumerable:!1,writable:!1})}catch{e[l]=y}},P=t=>{let n=t[i];if(!n||typeof n!=`object`)return;let a=n=>{let r=t.__wevu?.state;return typeof r==`object`&&!!r&&e(r,n)},o=t.properties,s=o&&typeof o==`object`?o:void 0,c=Object.keys(n);for(let t of c)if(!s||!e(s,t)||E(t)||b.has(t)||a(t))try{delete n[t]}catch{}if(!s)r(t);else{for(let[e,t]of Object.entries(s))if(!(E(e)||b.has(e)||a(e)))try{n[e]=t}catch{}r(t)}},F=t=>{let n=t[c],i=t.properties,a=t[o];if(n&&typeof n==`object`&&i&&typeof i==`object`){let o=i,s=Object.keys(n);for(let t of s)if(!b.has(t)||!e(o,t))try{delete n[t]}catch{}for(let r of y){let i=a&&e(a,r);if(!i&&!e(o,r))continue;let s=i?a[r]:o[r];try{k(n,r,s)}catch{}A(t,r,s)}M(t,n),j(t,n),r(t)}a&&delete t[o],P(t)},I=(t,n)=>{if(!n||typeof n!=`object`)return;let i=t[c];if(!i||typeof i!=`object`)return;let a=!1;for(let r of y)if(e(n,r)){try{a=k(i,r,n[r])||a}catch{}A(t,r,n[r])}a&&(M(t,i),j(t,i),r(t),P(t))},L=(e,t,n)=>{var i;let a=e[c];if(!a||typeof a!=`object`)return;try{if(!k(a,t,n)){A(e,t,n);return}}catch{}A(e,t,n);let s=(i=e)[o]??(i[o]=Object.create(null));s[t]=n,M(e,a),j(e,a),r(e),P(e)},R={};if(y.length)for(let e of y)R[e]=function(t){(!import.meta.env?.PLATFORM||import.meta.env?.PLATFORM===`weapp`)&&h&&e===a&&n(this,t),L(this,e,t)};let z={...(!import.meta.env?.PLATFORM||import.meta.env?.PLATFORM===`weapp`)&&h&&b.has(a)?{[a]:void 0}:{},...v??{}};for(let[e,t]of Object.entries(R)){let n=z[e];z[e]=typeof n==`function`?function(...r){h&&e===a?(t.apply(this,r),n.apply(this,r)):(n.apply(this,r),t.apply(this,r))}:t}let B=z[`**`];return z[`**`]=function(...e){typeof B==`function`&&B.apply(this,e),F(this)},{attachWevuPropKeys:N,directPropsDerivedKeys:w,syncWevuPropsFromInstance:F,syncWevuPropsFromValues:I,finalObservers:z}}export{p as createPropsSync};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getMiniProgramRuntimeGlobalObject as e}from"../../platform.mjs";import{callHookList as t}from"../../hooks/base.mjs";import{requireRuntimeCapability as n,runtimeCapabilityRegistry as r}from"../../capabilities.mjs";import{runTeardownSteps as i}from"../../teardown.mjs";import{receiveNativeDeclaration as ee}from"../runtimeInstance/nativeDeclaration.mjs";import{receiveNativeSlotParent as
|
|
1
|
+
import{getMiniProgramRuntimeGlobalObject as e}from"../../platform.mjs";import{callHookList as t}from"../../hooks/base.mjs";import{requireRuntimeCapability as n,runtimeCapabilityRegistry as r}from"../../capabilities.mjs";import{runTeardownSteps as i}from"../../teardown.mjs";import{receiveNativeDeclaration as ee}from"../runtimeInstance/nativeDeclaration.mjs";import{receiveNativeSlotParent as te}from"../runtimeInstance/provideContext.mjs";import{enableDeferredSetData as a,mountRuntimeInstance as o,refreshRuntimeInstance as s,setRuntimeSetDataVisibility as c,teardownRuntimeInstance as l}from"../runtimeInstance.mjs";import{ensureInitialNavigation as u}from"../../navigationLifecycle.mjs";import{createStatefulHmrRegistrationContract as d}from"./hmrRegistration.mjs";import{registerNativeComponentDefinition as f}from"./registerNativeDefinition.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as ne,WEVU_NATIVE_DECLARATION_METHOD as re,WEVU_NATIVE_SLOT_PARENT_METHOD as p,WEVU_PUBLIC_RUNTIME_KEY as m,WEVU_READY_CALLED_KEY as h,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as g,WEVU_RUNTIME_KEY as _}from"@weapp-core/constants";function v(v){let{runtimeApp:y,watch:b,setup:x,restOptions:S,statefulHmrRegistration:ie,pageLifecycleHooks:C,finalObservers:ae,userLifetimes:w,userPageLifetimes:T,finalMethods:E,finalOptions:D,applyExtraInstanceFields:O,templateRefs:k,layoutHosts:A,attachWevuPropKeys:j,setupLifecycle:M,syncWevuPropsFromInstance:N,directPropsDerivedKeys:P,isPage:F,nativeSlotContext:I,vueLifecycles:L,getRuntimeOwnerLabel:R,registerNative:z=!0}=v,B=Array.isArray(k)&&k.length>0?k:void 0,V=/* @__PURE__ */ new WeakSet;B&&n(`templateRefs`,`registerComponentDefinition(template refs)`);let H=Array.isArray(A)&&A.length>0?A:void 0,U=H?n(`layout`,`registerComponentDefinition(layout hosts)`):void 0,oe=(e,t)=>{B?r.templateRefs?.schedule(e,t):t?.()},W=e=>{let t=e.__wevu??e[m];if(t)return t;let n=e.$state;if(n&&typeof n==`object`)return n[_]},se=e=>W(e)?.proxy||(r.scopedSlots?.resolveLifecycleProxy(e)??e),G=e=>{let t=W(e);return t?{runtime:t,mounted:!1}:(O(e),j(e),o(e,y,b,x,{deferSetData:!0,snapshotOmitKeys:P,attached:!V.has(e)}),N(e),a(e),{runtime:W(e),mounted:!0})},K=(e,t,n)=>{let r=L[t];if(typeof r==`function`)return r.apply(se(e),n)},q=(e,t)=>{F&&u(e,void 0,{start:!1,onComplete:e=>{e&&t()}})||t()},ce=e=>{W(e)||typeof L.mounted!=`function`||G(e).mounted&&(K(e,`created`,[]),K(e,`beforeMount`,[]))},J={},Y=e=>{H&&U?.attachHosts(H,e)},X=e=>{F&&U&&U?.attachPageSetter(e)};if(F)for(let e of[`onPageScroll`,`onPullDownRefresh`,`onReachBottom`,`onShareAppMessage`,`onShareTimeline`,`onAddToFavorites`]){let t=C[e];typeof t==`function`&&typeof E[e]!=`function`&&(J[e]=function(...e){return t.apply(this,e)})}let Z={...J,...E,[g]:function(){let e=G(this);return e.mounted&&(K(this,`created`,[]),K(this,`beforeMount`,[])),e.runtime?.proxy}};(!import.meta.env?.PLATFORM||import.meta.env?.PLATFORM===`weapp`)&&I&&(Z[p]=te,Z[re]=ee);let Q={...S,...F?C:{},observers:ae,lifetimes:{...w,created:function(...e){V.add(this),O(this),j(this),B&&r.templateRefs?.attachBindings(this,B),q(this,()=>{if(K(this,`beforeCreate`,e),M===`created`){try{o(this,y,b,x,{deferSetData:!0,snapshotOmitKeys:P})}catch(e){let t=R(this);throw Error(`[wevu] mount runtime failed in created (${t}): ${e instanceof Error?e.message:String(e)}`)}N(this),X(this)}typeof w.created==`function`&&w.created.apply(this,e)})},moved:function(...e){t(this,`onMoved`,e),typeof w.moved==`function`&&w.moved.apply(this,e)},attached:function(...e){V.delete(this),O(this),j(this),B&&!r.templateRefs?.hasBindings(this)&&r.templateRefs?.attachBindings(this,B),q(this,()=>{if(M!==`created`||!this.__wevu)try{o(this,y,b,x,{deferSetData:!0,snapshotOmitKeys:P,attached:!0})}catch(e){let t=R(this);throw Error(`[wevu] mount runtime failed in attached (${t}): ${e instanceof Error?e.message:String(e)}`)}N(this),K(this,`created`,e),K(this,`beforeMount`,e),X(this),Y(this),a(this),t(this,`onAttached`,e),typeof w.attached==`function`&&w.attached.apply(this,e)})},ready:function(...e){if(V.has(this))return w.ready?.apply(this,e);if(!F||this[h]||!u(this,void 0,{start:!0,onComplete:t=>{t&&!this.__wevuInitialNavigationReady&&(this.__wevuInitialNavigationReady=!0,Q.lifetimes.ready.call(this,...e))}})||this.__wevuInitialNavigationReady){if(ce(this),F&&typeof C.onReady==`function`){let t=!!this[h];if(C.onReady.call(this,...e),!t){let t=()=>K(this,`mounted`,e);u(this,void 0,{start:!1,onComplete:e=>{e&&t()}})||t()}typeof w.ready==`function`&&w.ready.apply(this,e)}else this[h]?typeof w.ready==`function`&&w.ready.apply(this,e):(this[h]=!0,N(this),r.templateRefs?.scheduleOwner(this),oe(this,()=>{t(this,`onReady`,e),K(this,`mounted`,e),typeof w.ready==`function`&&w.ready.apply(this,e)}))}},detached:function(...e){F&&typeof C.onUnload==`function`?i([()=>K(this,`beforeUnmount`,e),()=>K(this,`beforeDestroy`,e),()=>r.templateRefs?.scheduleOwner(this),()=>t(this,`onDetached`,e),()=>C.onUnload.call(this,...e),()=>{typeof w.detached==`function`&&w.detached.apply(this,e)},()=>K(this,`unmounted`,e),()=>K(this,`destroyed`,e)]):i([()=>K(this,`beforeUnmount`,e),()=>K(this,`beforeDestroy`,e),()=>r.templateRefs?.scheduleOwner(this),()=>t(this,`onDetached`,e),()=>{H&&U?.detachHosts(H,this)},()=>l(this),()=>K(this,`unmounted`,e),()=>K(this,`destroyed`,e),()=>{typeof w.detached==`function`&&w.detached.apply(this,e)}])},error:function(...e){t(this,`onError`,e),typeof w.error==`function`&&w.error.apply(this,e)}},pageLifetimes:{...T,show:function(...e){F&&typeof C.onShow==`function`?(C.onShow.call(this,...e),typeof T.show==`function`&&T.show.apply(this,e)):(c(this,!0),t(this,`onShow`,e),typeof T.show==`function`&&T.show.apply(this,e))},hide:function(...e){F&&typeof C.onHide==`function`?(C.onHide.call(this,...e),typeof T.hide==`function`&&T.hide.apply(this,e)):(c(this,!1),t(this,`onHide`,e),typeof T.hide==`function`&&T.hide.apply(this,e))},resize:function(...e){F&&typeof C.onResize==`function`?(C.onResize.call(this,...e),typeof T.resize==`function`&&T.resize.apply(this,e)):(t(this,`onResize`,e),typeof T.resize==`function`&&T.resize.apply(this,e))},routeDone:function(...e){F&&typeof C.onRouteDone==`function`?(C.onRouteDone.call(this,...e),typeof T.routeDone==`function`&&T.routeDone.apply(this,e)):(t(this,`onRouteDone`,e),typeof T.routeDone==`function`&&T.routeDone.apply(this,e))}},methods:Z,options:D};if(!z)return Q;let $=e()?.[ne];if(typeof $?.trackWevuComponent==`function`){let e=d($,ie),t=$.trackWevuComponent(Q,(e,t)=>{s(e,y,b,x,{snapshotOmitKeys:P,stateSnapshot:t,attached:!V.has(e)}),N(e),X(e),Y(e),a(e,{rehydrateSetupState:!0})},e=>{i([()=>H&&U?.detachHosts(H,e),()=>l(e,{skipHooks:!0})])},e);return $.isApplying()||f(t,F),t}return f(Q,F),Q}export{v as registerComponentDefinition};
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { MiniProgramComponentRawOptions } from "../types/miniprogram.mjs";
|
|
2
2
|
import { ComponentPropsOptions } from "../types/props/propTypes.mjs";
|
|
3
|
-
import { ComputedDefinitions, MethodDefinitions } from "
|
|
3
|
+
import { ComputedDefinitions, MethodDefinitions } from "../../types/definitions.mjs";
|
|
4
4
|
import { RuntimeApp } from "../types/runtime.mjs";
|
|
5
5
|
import { DefineComponentOptions } from "../types/options.mjs";
|
|
6
6
|
import "../types.mjs";
|
|
7
7
|
import { WatchMap } from "./watch.mjs";
|
|
8
|
-
//#region src/runtime/register/component.d.ts
|
|
9
8
|
/**
|
|
10
9
|
* 注册组件入口(框架内部使用)。
|
|
11
10
|
* @internal
|
|
12
11
|
*/
|
|
13
12
|
export declare function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'], mpOptions: MiniProgramComponentRawOptions, options?: {
|
|
14
13
|
registerNative?: boolean;
|
|
15
|
-
}): any;
|
|
16
|
-
//#endregion
|
|
14
|
+
}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveComponentFeatures as e}from"./component/features.mjs";import{createPageLifecycleHooks as t}from"./component/lifecycle.mjs";import{createComponentMethods as n}from"./component/methods.mjs";import{getRuntimeOwnerLabel as r,prepareComponentOptions as i}from"./component/options.mjs";import{createPropsSync as
|
|
1
|
+
import{resolveComponentFeatures as e}from"./component/features.mjs";import{createPageLifecycleHooks as t}from"./component/lifecycle.mjs";import{createComponentMethods as n}from"./component/methods.mjs";import{getRuntimeOwnerLabel as r,prepareComponentOptions as i}from"./component/options.mjs";import{createPropsSync as a}from"./component/props.mjs";import{registerComponentDefinition as o}from"./component/registerDefinition.mjs";import{WEVU_EXPOSED_KEY as s,WEVU_HOOKS_KEY as ee,WEVU_NATIVE_SLOT_CONTEXT_KEY as te}from"@weapp-core/constants";function c(c,l,u,d,f,p={}){let{userMethods:m,userLifetimes:h,userPageLifetimes:ne,userOptions:g,restOptions:_,topLevelMethods:v,templateRefs:y,layoutHosts:b,propsAliases:x,propsDerivedKeys:S,userObservers:C,setupLifecycle:w,vueLifecycles:T,isPage:E,features:D,userOnLoad:O,userOnUnload:k,userOnShow:A,userOnHide:j,userOnReady:M,userOnSaveExitState:N,userOnPullDownRefresh:P,userOnReachBottom:F,userOnPageScroll:I,userOnRouteDone:L,userOnTabItemTap:R,userOnResize:z,userOnShareAppMessage:B,userOnShareTimeline:V,userOnAddToFavorites:H,applyExtraInstanceFields:U}=i(f),{enableOnPullDownRefresh:W,enableOnReachBottom:G,enableOnPageScroll:re,enableOnRouteDone:K,enableOnRouteDoneFallback:q,enableOnTabItemTap:J,enableOnResize:Y,enableOnShareAppMessage:X,enableOnShareTimeline:ie,enableOnAddToFavorites:ae,enableOnSaveExitState:oe,effectiveOnSaveExitState:se,effectiveOnPullDownRefresh:ce,effectiveOnReachBottom:le,effectiveOnPageScroll:ue,effectiveOnRouteDone:de,effectiveOnTabItemTap:fe,effectiveOnResize:pe,effectiveOnShareAppMessage:me,effectiveOnShareTimeline:he,effectiveOnAddToFavorites:ge}=e({features:D,userOnSaveExitState:N,userOnPullDownRefresh:P,userOnReachBottom:F,userOnPageScroll:I,userOnRouteDone:L,userOnTabItemTap:R,userOnResize:z,userOnShareAppMessage:B,userOnShareTimeline:V,userOnAddToFavorites:H}),_e=(e,t)=>{let n=e[ee];if(!n)return!1;let r=n[t];return r?Array.isArray(r)?r.length>0:typeof r==`function`:!1},Z=_.export;_.export=function(){let e=this[s]??{},t=typeof Z==`function`?Z.call(this):{};return t&&typeof t==`object`&&!Array.isArray(t)?{...e,...t}:t??e};let ve={multipleSlots:g.multipleSlots??!0,...g},Q=(!import.meta.env?.PLATFORM||import.meta.env?.PLATFORM===`weapp`)&&f[te]===!0,{attachWevuPropKeys:ye,directPropsDerivedKeys:be,syncWevuPropsFromInstance:xe,syncWevuPropsFromValues:$,finalObservers:Se}=a({restOptions:_,nativeSlotContext:Q,propsAliases:x,propsDerivedKeys:S,userObservers:C}),{finalMethods:Ce}=n({userMethods:{...v,...m},runtimeMethods:l}),we=t({runtimeApp:c,watch:u,setup:d,userOnLoad:O,userOnUnload:k,userOnShow:A,userOnHide:j,userOnReady:M,isPage:E,enableOnSaveExitState:oe,enableOnPullDownRefresh:W,enableOnReachBottom:G,enableOnPageScroll:re,enableOnRouteDone:K,enableOnRouteDoneFallback:q,enableOnTabItemTap:J,enableOnResize:Y,enableOnShareAppMessage:X,enableOnShareTimeline:ie,enableOnAddToFavorites:ae,syncWevuPropsFromValues:$,effectiveOnSaveExitState:se,effectiveOnPullDownRefresh:ce,effectiveOnReachBottom:le,effectiveOnPageScroll:ue,effectiveOnRouteDone:de,effectiveOnTabItemTap:fe,effectiveOnResize:pe,effectiveOnShareAppMessage:me,effectiveOnShareTimeline:he,effectiveOnAddToFavorites:ge,hasHook:_e});return o({runtimeApp:c,watch:u,setup:d,restOptions:_,statefulHmrRegistration:{userObservers:C,userExport:Z,propsAliases:x,propsDerivedKeys:S,templateRefs:y,layoutHosts:b,setupLifecycle:w,nativeSlotContext:Q},pageLifecycleHooks:we,finalObservers:Se,userLifetimes:h,userPageLifetimes:ne,finalMethods:Ce,finalOptions:ve,applyExtraInstanceFields:U,templateRefs:y,layoutHosts:b,attachWevuPropKeys:ye,setupLifecycle:w,syncWevuPropsFromInstance:xe,syncWevuPropsFromValues:$,directPropsDerivedKeys:be,nativeSlotContext:Q,isPage:E,vueLifecycles:T,getRuntimeOwnerLabel:r,registerNative:p.registerNative})}export{c as registerComponent};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/runtime/register/inline.d.ts
|
|
2
1
|
export interface InlineExpressionEntry {
|
|
3
2
|
keys: string[];
|
|
4
3
|
indexKeys?: string[];
|
|
@@ -11,4 +10,4 @@ interface InlineExpressionScopeResolver {
|
|
|
11
10
|
indexKey: string;
|
|
12
11
|
}
|
|
13
12
|
export type InlineExpressionMap = Record<string, InlineExpressionEntry>;
|
|
14
|
-
|
|
13
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{effectScope as e}from"../../../reactivity/core.mjs";import{
|
|
1
|
+
import{effectScope as e}from"../../../reactivity/core.mjs";import{shallowReactive as t}from"../../../reactivity/reactive/shallow.mjs";import{getCurrentInstance as n,getCurrentSetupContext as r,setCurrentInstance as i,setCurrentSetupContext as a}from"../../hooks/base.mjs";import{hasOwn as o}from"../../../utils.mjs";import{normalizeEmitEventName as s,normalizeEmitPayload as c}from"../../emit.mjs";import{attachRuntimeSlots as l,ensureSetupContextInstance as u,safeMarkNoSetData as d}from"./setupContext.mjs";import{applySetupResult as f}from"../../define/setupResult.mjs";import{runSetupFunction as p}from"../setup.mjs";import{attachRuntimeSetupState as m,ensureRuntimeProps as h}from"./utils.mjs";import{WEVU_ATTRS_KEY as g,WEVU_EFFECT_SCOPE_KEY as _,WEVU_EXPOSED_KEY as v,WEVU_PROP_KEYS_KEY as y}from"@weapp-core/constants";let b=0;function x(e,t){let n,r=e,i={proxy:{configurable:!0,enumerable:!1,value:t,writable:!1},$:{configurable:!0,enumerable:!1,value:e,writable:!1},uid:{configurable:!0,enumerable:!1,value:++b,writable:!1},exposed:{configurable:!0,enumerable:!1,get:()=>n}};for(let[e,t]of Object.entries(i))try{Object.defineProperty(r,e,t)}catch{`value`in t&&(r[e]=t.value)}let a={$:{configurable:!0,enumerable:!1,value:e,writable:!1},$el:{configurable:!0,enumerable:!1,value:e,writable:!1}};for(let[e,n]of Object.entries(a))try{Object.defineProperty(t,e,n)}catch{t[e]=n.value}return e=>{n=e}}function S(e){return e.startsWith(`__wv_`)}function C(b){let{target:C,runtime:w,runtimeWithDefaults:T,runtimeState:E,runtimeProxy:D,setup:O}=b,k=C.properties||{},A=h(C,E,k),j=t(Object.create(null)),M=new Set(Array.isArray(C[y])?C[y]:[]),N=e=>typeof E==`object`&&!!E&&o(E,e);(()=>{let e=C.properties&&typeof C.properties==`object`?C.properties:void 0;for(let t of Object.keys(j))(!e||!o(e,t)||S(t)||M.has(t)||N(t))&&delete j[t];if(e)for(let[t,n]of Object.entries(e))S(t)||M.has(t)||N(t)||(j[t]=n)})();try{Object.defineProperty(C,g,{value:j,configurable:!0,enumerable:!1,writable:!1})}catch{C[g]=j}let P=u(C,T),F=x(C,P),I=l(E,A),L=T.setupState??Object.create(null);m(E,L);let R=d({props:A,runtime:T,state:E,proxy:D,bindModel:w.bindModel.bind(T),watch:w.watch.bind(T),instance:P,emit:(e,...t)=>{let{detail:n,options:r}=c(t),i=s(e);P.triggerEvent(i,n,r)},expose:e=>{C[v]=e,F(e)},attrs:j,slots:I}),z=e(!0),B=n(),V=r(),H=()=>{n()===C&&r()===R&&(a(V),i(B))};C[_]=z,i(C),a(R);try{let e=z.run(()=>p(O,A,R));e&&typeof e==`object`&&f(T,C,e)}finally{H()}}export{C as runRuntimeSetupPhase};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ComponentPropsOptions } from "../types/props/propTypes.mjs";
|
|
2
|
-
import { ComputedDefinitions, MethodDefinitions } from "
|
|
2
|
+
import { ComputedDefinitions, MethodDefinitions } from "../../types/definitions.mjs";
|
|
3
3
|
import { InternalRuntimeState, RuntimeApp, RuntimeInstance } from "../types/runtime.mjs";
|
|
4
4
|
import { DefineAppOptions, DefineComponentOptions } from "../types/options.mjs";
|
|
5
5
|
import "../types.mjs";
|
|
6
6
|
import { WatchMap } from "./watch.mjs";
|
|
7
|
-
//#region src/runtime/register/runtimeInstance.d.ts
|
|
8
7
|
type RuntimeSetupFunction<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> = DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'] | DefineAppOptions<D, C, M>['setup'];
|
|
9
8
|
interface RuntimeMountOptions {
|
|
10
9
|
deferSetData?: boolean;
|
|
@@ -26,4 +25,4 @@ export declare function teardownRuntimeInstance(target: InternalRuntimeState, op
|
|
|
26
25
|
skipHooks?: boolean;
|
|
27
26
|
preserveNativeDeclarationChildren?: boolean;
|
|
28
27
|
}): void;
|
|
29
|
-
|
|
28
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{effectScope as e}from"../../reactivity/core.mjs";import{isReactive as t}from"../../reactivity/reactive.mjs";import{isRef as n}from"../../reactivity/ref.mjs";import{getMiniProgramRuntimeGlobalObject as r}from"../platform.mjs";import{callHookList as i}from"../hooks/base.mjs";import{isSetDataHighFrequencyWarningRequested as a,requireRuntimeCapability as o,runtimeCapabilityRegistry as s}from"../capabilities.mjs";import{runTeardownSteps as c}from"../teardown.mjs";import{observePhysicalDispatch as l}from"../app/setData/observation.mjs";import{applySnapshotUpdate as u,isDeepEqualValue as d}from"../app/setData/snapshot.mjs";import{observeSetDataCompletion as ee}from"../app/setData/commitTracker.mjs";import{isRuntimeLayoutComponentTarget as f}from"../layoutComponentMatcher.mjs";import{attachRuntimeSlots as te,createNoopWatchStopHandle as ne,safeMarkNoSetData as re}from"./runtimeInstance/setupContext.mjs";import{bridgeRuntimeMethodsToTarget as ie}from"./runtimeInstance/methodBridge.mjs";import{releaseNativeDeclaration as p}from"./runtimeInstance/nativeDeclaration.mjs";import{attachRuntimeProvideParentContext as ae}from"./runtimeInstance/provideContext.mjs";import{attachNativeInstanceRef as oe,attachRuntimeInstance as se,attachRuntimeRef as m,callNativeSetData as ce,ensureRuntimeProps as le,resolveNativeSetData as ue}from"./runtimeInstance/utils.mjs";import{runRuntimeSetupPhase as de}from"./runtimeInstance/setupPhase.mjs";import{restoreReactiveSetupSnapshot as h}from"./runtimeInstance/setupSnapshot.mjs";import{registerWatches as fe}from"./watch.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as pe,WEVU_EFFECT_SCOPE_KEY as g,WEVU_EXPOSED_KEY as me,WEVU_HOOKS_KEY as _,WEVU_HOST_COMMIT_PROMISE_KEY as v,WEVU_ON_BEFORE_UNMOUNT_HOOK as y,WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as he,WEVU_PARENT_INSTANCE_KEY as b,WEVU_PROPS_DERIVED_KEYS_KEY as ge,WEVU_PROVIDES_KEY as x,WEVU_PUBLIC_RUNTIME_KEY as S,WEVU_RUNTIME_APP_KEY as C,WEVU_SETUP_CONTEXT_INSTANCE_KEY as w,WEVU_SLOT_OWNER_ID_KEY as _e,WEVU_WATCH_STOPS_KEY as T}from"@weapp-core/constants";const E=/* @__PURE__ */ new WeakMap;function D(e,t=/* @__PURE__ */ new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(D(r,t));return n}let n={};t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=D(i,t);return n}function ve(e,t){let n=e??{};for(let[e,r]of Object.entries(t)){let t;for(let r of Object.keys(n))if(e.startsWith(`${r}.`)){t=r;break}if(t){let i={value:n[t]};u(i,`value.${e.slice(t.length+1)}`,r,`set`,{cloneValue:!1,clonedParents:/* @__PURE__ */ new WeakSet}),n[t]=i.value;continue}let i=`${e}.`;for(let e of Object.keys(n))e.startsWith(i)&&delete n[e];n[e]=r}return n}function ye(e,t,n){let r=e.data;if((!r||typeof r!=`object`)&&(!n||!Object.keys(n).length))return;let i=Array.isArray(t)&&t.length?new Set(t):void 0,a={};if(r&&typeof r==`object`)for(let[e,t]of Object.entries(r))i?.has(e)||(a[e]=D(t));if(n)for(let[e,t]of Object.entries(n))i?.has(e)||(a[e]=D(t));return a}function be(e){return!!e?.__wevuHasTemplateRuntimeBindings}function O(e,t,n,r,i){if(e.__wevu)return import.meta.env?.PROD!==!0&&e[C]&&e[C]!==t?I(e,t,n,r,{snapshotOmitKeys:i?.snapshotOmitKeys,attached:i?.attached}):e.__wevu;try{return k(e,t,n,r,i)}catch(t){try{F(e,{skipHooks:!0})}catch{}throw t}}function k(e,n,c,u,d){let f=n.__wevuSetDataOptions,p=be(n)?o(`scopedSlots`,`mountRuntimeInstance(scoped-slot bindings)`):void 0,h=p?.prepareMount(e),g=e.__wevuTemplateRefs;Array.isArray(g)&&g.length&&o(`templateRefs`,`mountRuntimeInstance(template refs)`);let me=a(f?.highFrequencyWarning)?o(`setDataHighFrequencyWarning`,`mountRuntimeInstance(setData.highFrequencyWarning)`):void 0;ae(e,n,d?.attached,d?.layoutParent),re(e);let _=!!f?.suspendWhenHidden,y=typeof e.route==`string`&&e.route?`page:${e.route}`:typeof e.is==`string`&&e.is?`component:${e.is}`:`unknown-target`,b=me?.createMonitor({option:f?.highFrequencyWarning,targetLabel:y,isInPageScrollHook:()=>Number(e[he]??0)>0}),x=!0,C=!d?.deferSetData,w=!1,O=0,k,A,j,M,N=[],P=!(v in e),F=0,I=!1,L,R,z,B,V=()=>{!F&&!k&&!R&&(I=!1,L=void 0)},H=()=>{F||k||(I?B?.(L):z?.(),R=void 0,z=void 0,B=void 0)},xe=()=>{P&&(F+=1)},U=(e=`committed`,t)=>{P&&!w&&(e===`failed`&&!I&&(I=!0,L=t),--F,H())},Se=e=>U(`failed`,e);P&&Object.defineProperty(e,v,{configurable:!0,enumerable:!1,get:()=>!F&&!k?I?Promise.reject(L):void 0:(R??(R=new Promise((e,t)=>{z=e,B=t})),R)});let W=()=>{h&&s.scopedSlots?.refresh(e,h)},G=()=>{if(w)return;let t=e.__wevuTemplateRefs;!s.templateRefs&&(!Array.isArray(t)||!t.length)?P&&U():o(`templateRefs`,`mountRuntimeInstance(template ref completion)`).schedule(e,P?U:void 0,e,P?Se:void 0)},Ce=()=>{h&&p?.syncNativeOwnerId(e,h)},we=(e,t)=>{let n={settle:e,next:void 0};j?j.next=n:A=n,j=n,t&&(M??(M=[])).push(t)},K=(e,t,n)=>{let r=e,i=!0;for(;r;){let e=r.next;r.next=void 0,t===`failed`&&!i?r.settle(`abandoned`):r.settle(t,n),r=e,i=!1}},Te=(t,n,r)=>{let i=O;xe(),W(),ee({observer:r,invoke:n=>{let i=ue(e);if(!i)n();else return r&&l(r,t),ce(e,i,t,n)},completion:`callback`,settle:(e,t)=>{if(!(w||i!==O)){if(e!==`committed`)U(e,t),n(e,t);else{try{n(e,t)}catch(e){throw U(`failed`,e),e}G()}}}})},Ee=()=>{if(!k)return;let e=k,t=A,n=N;k=void 0,A=void 0,j=void 0,N=[];let r=M;M=void 0,Te(e,(e,r)=>{if(e===`committed`)try{for(let e of n)e()}finally{K(t,e,r)}else K(t,e,r)},r&&{dispatch:e=>r.forEach(t=>t.dispatch(e)),returned:e=>r.forEach(t=>t.returned(e)),complete:e=>r.forEach(t=>t.complete(e))})},De=()=>{M=void 0;let e=A;k=void 0,A=void 0,j=void 0,N=[],K(e,`abandoned`),H()},Oe=e=>{V(),k=ve(k,e)},q={setData(t,n){if(b?.(),!C||_&&!x){Oe(t),n&&N.push(n),W();return}W(),V(),xe();let r=ue(e);if(!r){try{n?.()}catch(e){throw U(`failed`,e),e}G();return}let i=!0,a=!1,o=!1,s=!1,c=e=>{s||(s=!0,U(`failed`,e))},l=()=>{s||(s=!0,G())},u=()=>{try{n?.()}catch(e){throw c(e),e}i?a=!0:o||l()},d;try{d=ce(e,r,t,u)}catch(e){throw c(e),e}return i=!1,o=!!(d&&typeof d.then==`function`),d&&typeof d.then==`function`?d.then(()=>{l()},e=>{throw c(e),e}):(a&&l(),d)},__wevu_dispatchSetData(e,t,n){b?.(),w?t(`abandoned`):!C||_&&!x?(Oe(e),we(t,n),W()):(V(),Te(e,t,n))},__wevu_enableSetData(e=!1){C=!0,e?De():Ee()},__wevu_setVisibility(e){x=e,x&&C&&Ee()},__wevu_disposeSetData(){w||(w=!0,O+=1,k=void 0,A=void 0,j=void 0,N=[],F=0,I=!1,L=void 0,H(),P&&Reflect.deleteProperty(e,v))}};Object.defineProperty(q,"__wevu_reportSetDataError",{configurable:!0,enumerable:!1,value:t=>{i(e,`onError`,[t])},writable:!1}),Object.defineProperty(q,"__wevu_targetLabel",{configurable:!0,enumerable:!1,value:y,writable:!1});let J=e.properties;J&&typeof J==`object`&&Object.defineProperty(q,"__wevu_initialProps",{configurable:!0,enumerable:!1,value:J,writable:!1}),Array.isArray(d?.snapshotOmitKeys)&&d.snapshotOmitKeys.length&&Object.defineProperty(q,"__wevu_snapshotOmitKeys",{configurable:!0,enumerable:!1,value:d.snapshotOmitKeys,writable:!1});let Y=ye(e,d?.snapshotOmitKeys);Y&&Object.keys(Y).length&&Object.defineProperty(q,"__wevu_initialSnapshot",{configurable:!0,enumerable:!1,value:Y,writable:!1}),h&&Object.defineProperty(q,"__wevu_initialState",{configurable:!0,enumerable:!1,value:{[_e]:h.ownerId},writable:!1}),(d?.deferSetData||u||J&&typeof J==`object`&&Object.keys(J).length>0)&&Object.defineProperty(q,"__wevu_deferInitialSnapshot",{configurable:!0,enumerable:!1,value:!0,writable:!1});let X=n.mount(q);se(X,e);let ke=X?.proxy??{},Z=X?.state??{},Ae=X?.setupState??Object.create(null);Z&&typeof Z==`object`&&(m(Z,X),oe(Z,e));let je=X?.computed??Object.create(null);if(!X?.methods)try{X.methods=Object.create(null)}catch{}let Me=X?.methods??Object.create(null),Ne=X?.watch??(()=>ne()),Pe=X?.bindModel??(()=>{}),Q={...X??{},state:Z,setupState:Ae,proxy:ke,methods:Me,computed:je,watch:Ne,bindModel:Pe,snapshot:X?.snapshot??(()=>Object.create(null)),unmount:X?.unmount??(()=>{})};Object.defineProperty(Q,"__wevu_initialRuntimeSnapshot",{configurable:!0,enumerable:!1,value:D(Z),writable:!1});let Fe=Q,Ie={__wevu_flushSetupSnapshotSync:X.__wevu_flushSetupSnapshotSync,__wevu_touchSetupMethodsVersion:X.__wevu_touchSetupMethodsVersion,__wevu_trackSetupReactiveKey:X.__wevu_trackSetupReactiveKey,__wevu_cloneDispatchedSnapshot:X.__wevu_cloneDispatchedSnapshot,[ge]:X[ge]};for(let[e,t]of Object.entries(Ie))t&&Object.defineProperty(Q,e,{configurable:!0,enumerable:!1,value:t,writable:!0});Object.defineProperty(e,S,{value:Q,configurable:!0,enumerable:!1,writable:!1}),e.__wevu=Q;let Le=le(e,Z);te(Z,Le),h&&p?.attachMount(e,Q,h,!!d?.deferSetData),Ce();let $=c?fe(Q,c,e,{deferMissingSourceBaseline:!!u}):[];if($.length&&(e[T]=$),u){if(de({target:e,runtime:X,runtimeWithDefaults:Q,runtimeState:Z,runtimeProxy:ke,setup:u}),import.meta.env?.PROD!==!0&&typeof r()?.[pe]?.trackWevuComponent==`function`){let e={};for(let[n,r]of Object.entries(Q.setupState??{}))t(r)&&(e[n]=D(r));E.set(Q,e)}d?.deferSetData||Fe.__wevu_flushSetupSnapshotSync?.(),d?.deferSetData||W();for(let e of $)e.resume()}else!d?.deferSetData&&e.properties&&typeof e.properties==`object`&&Object.keys(e.properties).length>0&&(Fe.__wevu_flushSetupSnapshotSync?.(),W());return ie(e,X),X}function A(e,t,n){for(let e of Reflect.ownKeys(t))Reflect.has(n,e)||Reflect.getOwnPropertyDescriptor(t,e)?.configurable&&Reflect.deleteProperty(t,e);for(let e of Reflect.ownKeys(n)){let r=Reflect.getOwnPropertyDescriptor(n,e);if(r)try{Reflect.defineProperty(t,e,r)}catch{try{t[e]=n[e]}catch{}}}m(t.state,t);let r=E.get(n);return r&&E.set(t,r),e.__wevu=t,Object.defineProperty(e,S,{value:t,configurable:!0,enumerable:!1,writable:!1}),t}function j(e,r,i){let a=e.state,o=e.setupState,s={};for(let e of Object.keys(r??{})){if(!Object.prototype.hasOwnProperty.call(a,e))continue;let r=o?.[e];(!o||!Object.prototype.hasOwnProperty.call(o,e)||n(r)||t(r))&&(s[e]=i&&Object.prototype.hasOwnProperty.call(i,e)?D(i[e]):D(n(r)?r.value:a[e]))}return s}function M(e,r){let i=e.__wevu,a=i?.state,o=i?.setupState,s=r?.nativeData??e.data;if(!a||typeof a!=`object`||!s||typeof s!=`object`)return;let c=i?.__wevu_initialRuntimeSnapshot;for(let[e,i]of Object.entries(s))if(e&&e!==`undefined`&&Object.prototype.hasOwnProperty.call(a,e))try{let s=o?.[e],l=D(i);if(o&&Object.prototype.hasOwnProperty.call(o,e)&&(!r?.includeSetupState||!n(s)&&!t(s))||!r?.includeSetupState&&c&&Object.prototype.hasOwnProperty.call(c,e)&&!d(a[e],c[e],20,{keys:1e4})||!r?.includeSetupState&&c&&!Object.prototype.hasOwnProperty.call(c,e))continue;if(n(s)){s.value=l;continue}if(t(s)&&l&&typeof l==`object`){h(s,l,r?.initialSetupState?.[e]);continue}a[e]=l}catch{}}function N(e,t){let n=e.__wevu?.adapter;M(e,{includeSetupState:t?.rehydrateSetupState}),n?.__wevu_enableSetData?.(!0),e.__wevu?.__wevu_flushSetupSnapshotSync?.()}function P(e,t){(e.__wevu?.adapter)?.__wevu_setVisibility?.(t)}function F(t,n){let r=t.__wevu,a=t[T],l=t[g];c([()=>{if(!n?.skipHooks&&r&&t[_]?.[y]){if(l?.active)l.run(()=>i(t,y));else{let n=e(!0);c([()=>n.run(()=>i(t,y)),()=>n.stop()])}}},...!import.meta.env?.PLATFORM||import.meta.env?.PLATFORM===`weapp`?[()=>p(t,n?.preserveNativeDeclarationChildren)]:[],()=>s.scopedSlots?.teardown(t),()=>{Array.isArray(t.__wevuTemplateRefs)&&t.__wevuTemplateRefs.length>0&&o(`templateRefs`,`teardownRuntimeInstance(template refs)`).clear(t)},()=>{!n?.skipHooks&&r&&t[_]&&i(t,`onUnload`,[])},()=>{t[_]&&(t[_]=void 0)},()=>{if(Array.isArray(a))for(let e of a)try{e()}catch{}},()=>{t[T]=void 0},()=>{l?.stop()},()=>{t[g]=void 0},()=>r?.unmount(),()=>{(r?.adapter)?.__wevu_disposeSetData?.()},()=>{delete t[w],delete t[me]},()=>{delete t.__wevu},()=>{S in t&&delete t[S]},()=>{delete t[b]},()=>{delete t[x]},()=>{delete t[C]}])}function I(e,t,n,r,i){let a=e.__wevu,o=a?E.get(a):void 0,s=a?j(a,e.data,i?.stateSnapshot):void 0,c=e[b],l=c&&f(c)?c:void 0;F(e,{skipHooks:!0,preserveNativeDeclarationChildren:!0});let u=O(e,t,n,r,{deferSetData:!0,snapshotOmitKeys:i?.snapshotOmitKeys,attached:i?.attached,layoutParent:l}),d=s??(i?.stateSnapshot?j(u,i.stateSnapshot,i.stateSnapshot):void 0);if(d){let t=e.data;t&&typeof t==`object`&&Object.assign(t,D(d)),M(e,{includeSetupState:!0,nativeData:d,initialSetupState:o})}return!a||a===u?u:A(e,a,u)}export{N as enableDeferredSetData,O as mountRuntimeInstance,I as refreshRuntimeInstance,P as setRuntimeSetDataVisibility,F as teardownRuntimeInstance};
|
|
1
|
+
import{effectScope as e}from"../../reactivity/core.mjs";import{isReactive as t}from"../../reactivity/reactive.mjs";import{isRef as n}from"../../reactivity/ref.mjs";import{getMiniProgramRuntimeGlobalObject as r}from"../platform.mjs";import{callHookList as i}from"../hooks/base.mjs";import{isSetDataHighFrequencyWarningRequested as a,requireRuntimeCapability as o,runtimeCapabilityRegistry as s}from"../capabilities.mjs";import{runTeardownSteps as c}from"../teardown.mjs";import{observePhysicalDispatch as l}from"../app/setData/observation.mjs";import{applySnapshotUpdate as u,isDeepEqualValue as d}from"../app/setData/snapshot.mjs";import{observeSetDataCompletion as ee}from"../app/setData/commitTracker.mjs";import{isRuntimeLayoutComponentTarget as f}from"../layoutComponentMatcher.mjs";import{attachRuntimeSlots as te,createNoopWatchStopHandle as ne,safeMarkNoSetData as re}from"./runtimeInstance/setupContext.mjs";import{bridgeRuntimeMethodsToTarget as ie}from"./runtimeInstance/methodBridge.mjs";import{releaseNativeDeclaration as p}from"./runtimeInstance/nativeDeclaration.mjs";import{attachRuntimeProvideParentContext as ae}from"./runtimeInstance/provideContext.mjs";import{attachNativeInstanceRef as oe,attachRuntimeInstance as se,attachRuntimeRef as ce,callNativeSetData as m,ensureRuntimeProps as le,resolveNativeSetData as ue}from"./runtimeInstance/utils.mjs";import{runRuntimeSetupPhase as de}from"./runtimeInstance/setupPhase.mjs";import{restoreReactiveSetupSnapshot as h}from"./runtimeInstance/setupSnapshot.mjs";import{registerWatches as fe}from"./watch.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as pe,WEVU_EFFECT_SCOPE_KEY as g,WEVU_EXPOSED_KEY as me,WEVU_HOOKS_KEY as _,WEVU_HOST_COMMIT_PROMISE_KEY as v,WEVU_NATIVE_SLOT_CONTEXT_KEY as y,WEVU_ON_BEFORE_UNMOUNT_HOOK as b,WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as he,WEVU_PARENT_INSTANCE_KEY as x,WEVU_PROPS_DERIVED_KEYS_KEY as ge,WEVU_PROVIDES_KEY as S,WEVU_PUBLIC_RUNTIME_KEY as C,WEVU_RUNTIME_APP_KEY as w,WEVU_SETUP_CONTEXT_INSTANCE_KEY as T,WEVU_SLOT_OWNER_ID_KEY as _e,WEVU_WATCH_STOPS_KEY as E}from"@weapp-core/constants";const D=/* @__PURE__ */ new WeakMap;function O(e,t=/* @__PURE__ */ new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(O(r,t));return n}let n={};t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=O(i,t);return n}function ve(e,t){let n=e??{};for(let[e,r]of Object.entries(t)){let t;for(let r of Object.keys(n))if(e.startsWith(`${r}.`)){t=r;break}if(t){let i={value:n[t]};u(i,`value.${e.slice(t.length+1)}`,r,`set`,{cloneValue:!1,clonedParents:/* @__PURE__ */ new WeakSet}),n[t]=i.value;continue}let i=`${e}.`;for(let e of Object.keys(n))e.startsWith(i)&&delete n[e];n[e]=r}return n}function ye(e,t,n){let r=e.data;if((!r||typeof r!=`object`)&&(!n||!Object.keys(n).length))return;let i=Array.isArray(t)&&t.length?new Set(t):void 0,a={};if(r&&typeof r==`object`)for(let[e,t]of Object.entries(r))i?.has(e)||(a[e]=O(t));if(n)for(let[e,t]of Object.entries(n))i?.has(e)||(a[e]=O(t));return a}function be(e){return!!e?.__wevuHasTemplateRuntimeBindings}function k(e,t,n,r,i){if(e.__wevu)return import.meta.env?.PROD!==!0&&e[w]&&e[w]!==t?L(e,t,n,r,{snapshotOmitKeys:i?.snapshotOmitKeys,attached:i?.attached}):e.__wevu;try{return A(e,t,n,r,i)}catch(t){try{I(e,{skipHooks:!0})}catch{}throw t}}function A(e,n,c,u,d){let f=n.__wevuSetDataOptions,p=be(n)?o(`scopedSlots`,`mountRuntimeInstance(scoped-slot bindings)`):void 0,h=p?.prepareMount(e),g=e.__wevuTemplateRefs;Array.isArray(g)&&g.length&&o(`templateRefs`,`mountRuntimeInstance(template refs)`);let me=a(f?.highFrequencyWarning)?o(`setDataHighFrequencyWarning`,`mountRuntimeInstance(setData.highFrequencyWarning)`):void 0;ae(e,n,d?.attached,d?.layoutParent),re(e);let _=!!f?.suspendWhenHidden,y=typeof e.route==`string`&&e.route?`page:${e.route}`:typeof e.is==`string`&&e.is?`component:${e.is}`:`unknown-target`,b=me?.createMonitor({option:f?.highFrequencyWarning,targetLabel:y,isInPageScrollHook:()=>Number(e[he]??0)>0}),x=!0,S=!d?.deferSetData,w=!1,T=0,k,A,j,M,N=[],P=!(v in e),F=0,I=!1,L,R,z,B,V=()=>{F||k||R||(I=!1,L=void 0)},H=()=>{F||k||(I?B?.(L):z?.(),R=void 0,z=void 0,B=void 0)},xe=()=>{P&&(F+=1)},U=(e=`committed`,t)=>{P&&!w&&(e===`failed`&&!I&&(I=!0,L=t),--F,H())},Se=e=>U(`failed`,e);P&&Object.defineProperty(e,v,{configurable:!0,enumerable:!1,get:()=>!F&&!k?I?Promise.reject(L):void 0:(R??(R=new Promise((e,t)=>{z=e,B=t})),R)});let W=()=>{h&&s.scopedSlots?.refresh(e,h)},G=()=>{if(w)return;let t=e.__wevuTemplateRefs;!s.templateRefs&&(!Array.isArray(t)||!t.length)?P&&U():o(`templateRefs`,`mountRuntimeInstance(template ref completion)`).schedule(e,P?U:void 0,e,P?Se:void 0)},Ce=()=>{h&&p?.syncNativeOwnerId(e,h)},we=(e,t)=>{let n={settle:e,next:void 0};j?j.next=n:A=n,j=n,t&&(M??(M=[])).push(t)},K=(e,t,n)=>{let r=e,i=!0;for(;r;){let e=r.next;r.next=void 0,t===`failed`&&!i?r.settle(`abandoned`):r.settle(t,n),r=e,i=!1}},Te=(t,n,r)=>{let i=T;xe(),W(),ee({observer:r,invoke:n=>{let i=ue(e);if(!i)n();else return r&&l(r,t),m(e,i,t,n)},completion:`callback`,settle:(e,t)=>{if(!(w||i!==T)){if(e!==`committed`)U(e,t),n(e,t);else{try{n(e,t)}catch(e){throw U(`failed`,e),e}G()}}}})},Ee=()=>{if(!k)return;let e=k,t=A,n=N;k=void 0,A=void 0,j=void 0,N=[];let r=M;M=void 0,Te(e,(e,r)=>{if(e===`committed`)try{for(let e of n)e()}finally{K(t,e,r)}else K(t,e,r)},r&&{dispatch:e=>r.forEach(t=>t.dispatch(e)),returned:e=>r.forEach(t=>t.returned(e)),complete:e=>r.forEach(t=>t.complete(e))})},De=()=>{M=void 0;let e=A;k=void 0,A=void 0,j=void 0,N=[],K(e,`abandoned`),H()},Oe=e=>{V(),k=ve(k,e)},q={setData(t,n){if(b?.(),!S||_&&!x){Oe(t),n&&N.push(n),W();return}W(),V(),xe();let r=ue(e);if(!r){try{n?.()}catch(e){throw U(`failed`,e),e}G();return}let i=!0,a=!1,o=!1,s=!1,c=e=>{s||(s=!0,U(`failed`,e))},l=()=>{s||(s=!0,G())},u=()=>{try{n?.()}catch(e){throw c(e),e}i?a=!0:o||l()},d;try{d=m(e,r,t,u)}catch(e){throw c(e),e}return i=!1,o=!!(d&&typeof d.then==`function`),d&&typeof d.then==`function`?d.then(()=>{l()},e=>{throw c(e),e}):(a&&l(),d)},__wevu_dispatchSetData(e,t,n){b?.(),w?t(`abandoned`):!S||_&&!x?(Oe(e),we(t,n),W()):(V(),Te(e,t,n))},__wevu_enableSetData(e=!1){S=!0,e?De():Ee()},__wevu_setVisibility(e){x=e,x&&S&&Ee()},__wevu_disposeSetData(){w||(w=!0,T+=1,k=void 0,A=void 0,j=void 0,N=[],F=0,I=!1,L=void 0,H(),P&&Reflect.deleteProperty(e,v))}};Object.defineProperty(q,"__wevu_reportSetDataError",{configurable:!0,enumerable:!1,value:t=>{i(e,`onError`,[t])},writable:!1}),Object.defineProperty(q,"__wevu_targetLabel",{configurable:!0,enumerable:!1,value:y,writable:!1});let J=e.properties;J&&typeof J==`object`&&Object.defineProperty(q,"__wevu_initialProps",{configurable:!0,enumerable:!1,value:J,writable:!1}),Array.isArray(d?.snapshotOmitKeys)&&d.snapshotOmitKeys.length&&Object.defineProperty(q,"__wevu_snapshotOmitKeys",{configurable:!0,enumerable:!1,value:d.snapshotOmitKeys,writable:!1});let Y=ye(e,d?.snapshotOmitKeys);Y&&Object.keys(Y).length&&Object.defineProperty(q,"__wevu_initialSnapshot",{configurable:!0,enumerable:!1,value:Y,writable:!1}),h&&Object.defineProperty(q,"__wevu_initialState",{configurable:!0,enumerable:!1,value:{[_e]:h.ownerId},writable:!1}),(d?.deferSetData||u||J&&typeof J==`object`&&Object.keys(J).length>0)&&Object.defineProperty(q,"__wevu_deferInitialSnapshot",{configurable:!0,enumerable:!1,value:!0,writable:!1});let X=n.mount(q);se(X,e);let ke=X?.proxy??{},Z=X?.state??{},Ae=X?.setupState??Object.create(null);Z&&typeof Z==`object`&&(ce(Z,X),oe(Z,e));let je=X?.computed??Object.create(null);if(!X?.methods)try{X.methods=Object.create(null)}catch{}let Me=X?.methods??Object.create(null),Ne=X?.watch??(()=>ne()),Pe=X?.bindModel??(()=>{}),Q={...X??{},state:Z,setupState:Ae,proxy:ke,methods:Me,computed:je,watch:Ne,bindModel:Pe,snapshot:X?.snapshot??(()=>Object.create(null)),unmount:X?.unmount??(()=>{})};Object.defineProperty(Q,"__wevu_initialRuntimeSnapshot",{configurable:!0,enumerable:!1,value:O(Z),writable:!1});let Fe=Q,Ie={__wevu_flushSetupSnapshotSync:X.__wevu_flushSetupSnapshotSync,__wevu_touchSetupMethodsVersion:X.__wevu_touchSetupMethodsVersion,__wevu_trackSetupReactiveKey:X.__wevu_trackSetupReactiveKey,__wevu_cloneDispatchedSnapshot:X.__wevu_cloneDispatchedSnapshot,[ge]:X[ge]};for(let[e,t]of Object.entries(Ie))t&&Object.defineProperty(Q,e,{configurable:!0,enumerable:!1,value:t,writable:!0});Object.defineProperty(e,C,{value:Q,configurable:!0,enumerable:!1,writable:!1}),e.__wevu=Q;let Le=le(e,Z);te(Z,Le),h&&p?.attachMount(e,Q,h,!!d?.deferSetData),Ce(),u&&de({target:e,runtime:X,runtimeWithDefaults:Q,runtimeState:Z,runtimeProxy:ke,setup:u});let $=c?fe(Q,c,e):[];if($.length&&(e[E]=$),u){if(import.meta.env?.PROD!==!0&&typeof r()?.[pe]?.trackWevuComponent==`function`){let e={};for(let[n,r]of Object.entries(Q.setupState??{}))t(r)&&(e[n]=O(r));D.set(Q,e)}d?.deferSetData||Fe.__wevu_flushSetupSnapshotSync?.(),d?.deferSetData||W()}else!d?.deferSetData&&e.properties&&typeof e.properties==`object`&&Object.keys(e.properties).length>0&&(Fe.__wevu_flushSetupSnapshotSync?.(),W());return ie(e,X),X}function j(e,t,n){for(let e of Reflect.ownKeys(t))Reflect.has(n,e)||Reflect.getOwnPropertyDescriptor(t,e)?.configurable&&Reflect.deleteProperty(t,e);for(let e of Reflect.ownKeys(n)){let r=Reflect.getOwnPropertyDescriptor(n,e);if(r)try{Reflect.defineProperty(t,e,r)}catch{try{t[e]=n[e]}catch{}}}ce(t.state,t);let r=D.get(n);return r&&D.set(t,r),e.__wevu=t,Object.defineProperty(e,C,{value:t,configurable:!0,enumerable:!1,writable:!1}),t}function M(e,r,i){let a=e.state,o=e.setupState,s={};for(let e of Object.keys(r??{})){if(!Object.prototype.hasOwnProperty.call(a,e))continue;let r=o?.[e];(!o||!Object.prototype.hasOwnProperty.call(o,e)||n(r)||t(r))&&(s[e]=i&&Object.prototype.hasOwnProperty.call(i,e)?O(i[e]):O(n(r)?r.value:a[e]))}return s}function N(e,r){let i=e.__wevu,a=i?.state,o=i?.setupState,s=r?.nativeData??e.data;if(!a||typeof a!=`object`||!s||typeof s!=`object`)return;let c=i?.__wevu_initialRuntimeSnapshot;for(let[e,i]of Object.entries(s))if(e&&e!==`undefined`&&Object.prototype.hasOwnProperty.call(a,e))try{let s=o?.[e],l=O(i);if(o&&Object.prototype.hasOwnProperty.call(o,e)&&(!r?.includeSetupState||!n(s)&&!t(s))||!r?.includeSetupState&&c&&Object.prototype.hasOwnProperty.call(c,e)&&!d(a[e],c[e],20,{keys:1e4})||!r?.includeSetupState&&c&&!Object.prototype.hasOwnProperty.call(c,e))continue;if(n(s)){s.value=l;continue}if(t(s)&&l&&typeof l==`object`){h(s,l,r?.initialSetupState?.[e]);continue}a[e]=l}catch{}}function P(e,t){let n=e.__wevu?.adapter;N(e,{includeSetupState:t?.rehydrateSetupState}),n?.__wevu_enableSetData?.(!0),e.__wevu?.__wevu_flushSetupSnapshotSync?.()}function F(e,t){(e.__wevu?.adapter)?.__wevu_setVisibility?.(t)}function I(t,n){let r=t.__wevu,a=t[E],l=t[g];c([()=>{if(!n?.skipHooks&&r&&t[_]?.[b]){if(l?.active)l.run(()=>i(t,b));else{let n=e(!0);c([()=>n.run(()=>i(t,b)),()=>n.stop()])}}},...(!import.meta.env?.PLATFORM||import.meta.env?.PLATFORM===`weapp`)&&t[y]===!0?[()=>p(t,n?.preserveNativeDeclarationChildren)]:[],()=>s.scopedSlots?.teardown(t),()=>{Array.isArray(t.__wevuTemplateRefs)&&t.__wevuTemplateRefs.length>0&&o(`templateRefs`,`teardownRuntimeInstance(template refs)`).clear(t)},()=>{!n?.skipHooks&&r&&t[_]&&i(t,`onUnload`,[])},()=>{t[_]&&(t[_]=void 0)},()=>{if(Array.isArray(a))for(let e of a)try{e()}catch{}},()=>{t[E]=void 0},()=>{l?.stop()},()=>{t[g]=void 0},()=>r?.unmount(),()=>{(r?.adapter)?.__wevu_disposeSetData?.()},()=>{delete t[T],delete t[me]},()=>{delete t.__wevu},()=>{C in t&&delete t[C]},()=>{delete t[x]},()=>{delete t[S]},()=>{delete t[w]}])}function L(e,t,n,r,i){let a=e.__wevu,o=a?D.get(a):void 0,s=a?M(a,e.data,i?.stateSnapshot):void 0,c=e[x],l=c&&f(c)?c:void 0;I(e,{skipHooks:!0,preserveNativeDeclarationChildren:!0});let u=k(e,t,n,r,{deferSetData:!0,snapshotOmitKeys:i?.snapshotOmitKeys,attached:i?.attached,layoutParent:l}),d=s??(i?.stateSnapshot?M(u,i.stateSnapshot,i.stateSnapshot):void 0);if(d){let t=e.data;t&&typeof t==`object`&&Object.assign(t,O(d)),N(e,{includeSetupState:!0,nativeData:d,initialSetupState:o})}return!a||a===u?u:j(e,a,u)}export{P as enableDeferredSetData,k as mountRuntimeInstance,L as refreshRuntimeInstance,F as setRuntimeSetDataVisibility,I as teardownRuntimeInstance};
|