wevu 6.16.2 → 6.16.3
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/dev/index.mjs +2 -2
- package/dist/dev/router.mjs +39 -39
- package/dist/dev/router.mjs.map +1 -1
- package/dist/dev/{src-DcTVnwpE.mjs → src-DjDCQerj.mjs} +239 -3
- package/dist/dev/{src-DcTVnwpE.mjs.map → src-DjDCQerj.mjs.map} +1 -1
- package/dist/dev/vue-demi.mjs +13 -2
- package/dist/dev/vue-demi.mjs.map +1 -1
- package/dist/{index-6sv3KnLP.d.mts → index-BKnpWfa6.d.mts} +132 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/router.mjs +1 -1
- package/dist/src-D9uUICz0.mjs +1 -0
- package/dist/vue-demi.d.mts +3 -3
- package/dist/vue-demi.mjs +1 -1
- package/package.json +2 -2
- package/dist/src-BFQLJ5K7.mjs +0 -1
package/dist/dev/vue-demi.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as isNoSetData, A as createApp, B as waitForLayoutHost, C as usePageStack, Ct as shallowRef, D as createWevuComponent, E as useDisposables, Et as __reExport, F as resolveLayoutHost, G as runSetupFunction, H as mountRuntimeInstance, I as unregisterPageLayoutBridge, J as syncRuntimePageLayoutState, K as resolveRuntimePageLayoutName, L as unregisterRuntimeLayoutHosts, M as registerPageLayoutBridge, N as registerRuntimeLayoutHosts, O as createWevuScopedSlotComponent, P as resolveLayoutBridge, Q as setWevuDefaults, R as useLayoutBridge, S as useNavigationBarMetrics, St as isShallowRef, T as useElementIntersectionObserver, Tt as __exportAll, U as setRuntimeSetDataVisibility, V as registerApp, W as teardownRuntimeInstance, X as usePageLayout, Y as syncRuntimePageLayoutStateFromRuntime, Z as resetWevuDefaults, _ as useSelectorQuery, _t as onUnmounted, a as useModel, at as watchSyncEffect, b as getCurrentPageStackSnapshot, bt as toRef, c as useSlots, ct as callUpdateHooks, d as useUpdatePerformanceListener, dt as onBeforeUnmount, et as markNoSetData, f as normalizeClass, ft as onBeforeUpdate, g as useSelectorFields, gt as onServerPrefetch, h as useScrollOffset, ht as onMounted, i as useChangeModel, it as watchPostEffect, j as registerComponent, k as defineComponent, l as defineAppSetup, lt as onActivated, m as useBoundingClientRect, mt as onErrorCaptured, n as mergeModels, nt as watch, o as useAttrs, ot as getDeepWatchStrategy, p as normalizeStyle, pt as onDeactivated, q as setPageLayout, r as useBindModel, rt as watchEffect, s as useNativeInstance, st as setDeepWatchStrategy, t as useTemplateRef, tt as version, u as use, ut as onBeforeMount, v as useAsyncPullDownRefresh, vt as onUpdated, w as useIntersectionObserver, wt as triggerRef, x as getNavigationBarMetrics, xt as toRefs, y as usePageScrollThrottle, yt as traverse, z as useLayoutHosts } from "./src-DjDCQerj.mjs";
|
|
2
2
|
import { C as effect, D as onScopeDispose, E as getCurrentScope, N as nextTick, O as startBatch, S as batch, T as endBatch, a as toValue, b as addMutationRecorder, c as isRaw, d as reactive, f as isShallowReactive, g as touchReactive, h as prelinkReactiveTree, i as ref, k as stop, l as isReactive, n as isRef, o as unref, p as shallowReactive, s as getReactiveVersion, t as customRef, u as markRaw, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-BTTXccLL.mjs";
|
|
3
3
|
import { i as computed, n as defineStore, r as createStore, t as storeToRefs } from "./store-Dr0zE_9B.mjs";
|
|
4
4
|
import { A as onLoad, B as onSaveExitState, C as setGlobalProvidedValue, D as onError, E as onDetached, F as onPullDownRefresh, G as onThemeChange, H as onShareTimeline, I as onReachBottom, K as onUnhandledRejection, L as onReady, M as onMoved, N as onPageNotFound, O as onHide, P as onPageScroll, Q as getCurrentSetupContext, R as onResize, T as onAttached, U as onShow, V as onShareAppMessage, W as onTabItemTap, X as callHookReturn, Y as callHookList, Z as getCurrentInstance, _ as provide, ct as isProxy, dt as shallowReadonly, et as setCurrentInstance, g as injectGlobal, h as inject, j as onMemoryWarning, k as onLaunch, lt as isReadonly, m as hasInjectionContext, n as useNativeRouter, q as onUnload, t as useNativePageRouter, tt as setCurrentSetupContext, ut as readonly, v as provideGlobal, w as onAddToFavorites, z as onRouteDone } from "./router-BZZnIx32.mjs";
|
|
@@ -26,9 +26,11 @@ var vue_demi_exports = /* @__PURE__ */ __exportAll({
|
|
|
26
26
|
effectScope: () => effectScope,
|
|
27
27
|
endBatch: () => endBatch,
|
|
28
28
|
getCurrentInstance: () => getCurrentInstance,
|
|
29
|
+
getCurrentPageStackSnapshot: () => getCurrentPageStackSnapshot,
|
|
29
30
|
getCurrentScope: () => getCurrentScope,
|
|
30
31
|
getCurrentSetupContext: () => getCurrentSetupContext,
|
|
31
32
|
getDeepWatchStrategy: () => getDeepWatchStrategy,
|
|
33
|
+
getNavigationBarMetrics: () => getNavigationBarMetrics,
|
|
32
34
|
getReactiveVersion: () => getReactiveVersion,
|
|
33
35
|
hasInjectionContext: () => hasInjectionContext,
|
|
34
36
|
inject: () => inject,
|
|
@@ -129,9 +131,13 @@ var vue_demi_exports = /* @__PURE__ */ __exportAll({
|
|
|
129
131
|
unregisterPageLayoutBridge: () => unregisterPageLayoutBridge,
|
|
130
132
|
unregisterRuntimeLayoutHosts: () => unregisterRuntimeLayoutHosts,
|
|
131
133
|
use: () => use,
|
|
134
|
+
useAsyncPullDownRefresh: () => useAsyncPullDownRefresh,
|
|
132
135
|
useAttrs: () => useAttrs,
|
|
133
136
|
useBindModel: () => useBindModel,
|
|
137
|
+
useBoundingClientRect: () => useBoundingClientRect,
|
|
138
|
+
useChangeModel: () => useChangeModel,
|
|
134
139
|
useDisposables: () => useDisposables,
|
|
140
|
+
useElementIntersectionObserver: () => useElementIntersectionObserver,
|
|
135
141
|
useIntersectionObserver: () => useIntersectionObserver,
|
|
136
142
|
useLayoutBridge: () => useLayoutBridge,
|
|
137
143
|
useLayoutHosts: () => useLayoutHosts,
|
|
@@ -139,8 +145,13 @@ var vue_demi_exports = /* @__PURE__ */ __exportAll({
|
|
|
139
145
|
useNativeInstance: () => useNativeInstance,
|
|
140
146
|
useNativePageRouter: () => useNativePageRouter,
|
|
141
147
|
useNativeRouter: () => useNativeRouter,
|
|
148
|
+
useNavigationBarMetrics: () => useNavigationBarMetrics,
|
|
142
149
|
usePageLayout: () => usePageLayout,
|
|
143
150
|
usePageScrollThrottle: () => usePageScrollThrottle,
|
|
151
|
+
usePageStack: () => usePageStack,
|
|
152
|
+
useScrollOffset: () => useScrollOffset,
|
|
153
|
+
useSelectorFields: () => useSelectorFields,
|
|
154
|
+
useSelectorQuery: () => useSelectorQuery,
|
|
144
155
|
useSlots: () => useSlots,
|
|
145
156
|
useTemplateRef: () => useTemplateRef,
|
|
146
157
|
useUpdatePerformanceListener: () => useUpdatePerformanceListener,
|
|
@@ -169,5 +180,5 @@ const Vue2 = void 0;
|
|
|
169
180
|
function install() {}
|
|
170
181
|
|
|
171
182
|
//#endregion
|
|
172
|
-
export { Vue2, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getReactiveVersion, hasInjectionContext, inject, injectGlobal, install, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, isVue2, isVue3, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAttrs, useBindModel, useDisposables, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, usePageLayout, usePageScrollThrottle, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect };
|
|
183
|
+
export { Vue2, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getNavigationBarMetrics, getReactiveVersion, hasInjectionContext, inject, injectGlobal, install, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, isVue2, isVue3, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect };
|
|
173
184
|
//# sourceMappingURL=vue-demi.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-demi.mjs","names":[],"sources":["../../src/vue-demi.ts"],"sourcesContent":["export * from './index'\nexport { version } from './version'\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue2 = false\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue3 = true\n\n/**\n * 与 `vue-demi` 保持一致,Vue 3 分支下不暴露 Vue 2 构造器。\n */\nexport const Vue2 = undefined\n\n/**\n * Vue 3 分支的 `vue-demi.install()` 为 no-op,这里保持同样语义。\n */\nexport function install() {}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vue-demi.mjs","names":[],"sources":["../../src/vue-demi.ts"],"sourcesContent":["export * from './index'\nexport { version } from './version'\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue2 = false\n\n/**\n * 标记当前兼容层运行在 Vue 3 风格分支。\n */\nexport const isVue3 = true\n\n/**\n * 与 `vue-demi` 保持一致,Vue 3 分支下不暴露 Vue 2 构造器。\n */\nexport const Vue2 = undefined\n\n/**\n * Vue 3 分支的 `vue-demi.install()` 为 no-op,这里保持同样语义。\n */\nexport function install() {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAa,SAAS;;;;AAKtB,MAAa,SAAS;;;;AAKtB,MAAa,OAAO;;;;AAKpB,SAAgB,UAAU"}
|
|
@@ -472,6 +472,26 @@ interface DisposableBag {
|
|
|
472
472
|
*/
|
|
473
473
|
declare function useDisposables(): DisposableBag;
|
|
474
474
|
//#endregion
|
|
475
|
+
//#region src/runtime/elementIntersectionObserver.d.ts
|
|
476
|
+
type ElementIntersectionObserverCallback<T = unknown> = (result: T) => void;
|
|
477
|
+
interface UseElementIntersectionObserverOptions<T = unknown> {
|
|
478
|
+
context?: InternalRuntimeState | null;
|
|
479
|
+
enabled?: MaybeRefOrGetter<boolean>;
|
|
480
|
+
observerOptions?: MaybeRefOrGetter<HostMiniProgramIntersectionObserverOptions>;
|
|
481
|
+
onObserve?: ElementIntersectionObserverCallback<T>;
|
|
482
|
+
relativeToViewport?: boolean | Record<string, number>;
|
|
483
|
+
selector: MaybeRefOrGetter<string | null | undefined>;
|
|
484
|
+
}
|
|
485
|
+
interface UseElementIntersectionObserverReturn {
|
|
486
|
+
disconnect: () => void;
|
|
487
|
+
observe: () => HostMiniProgramIntersectionObserver | null;
|
|
488
|
+
readonly observer: HostMiniProgramIntersectionObserver | null;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* 观察当前组件或页面内的节点可见性,并在卸载时自动断开。
|
|
492
|
+
*/
|
|
493
|
+
declare function useElementIntersectionObserver<T = unknown>(options: UseElementIntersectionObserverOptions<T>): UseElementIntersectionObserverReturn;
|
|
494
|
+
//#endregion
|
|
475
495
|
//#region src/runtime/hooks/base.d.ts
|
|
476
496
|
declare function getCurrentInstance<T extends InternalRuntimeState = InternalRuntimeState>(): T | undefined;
|
|
477
497
|
/**
|
|
@@ -646,6 +666,52 @@ declare function useLayoutHosts(hosts: LayoutHostMap): void;
|
|
|
646
666
|
declare function markNoSetData<T extends object>(value: T): T;
|
|
647
667
|
declare function isNoSetData(value: unknown): boolean;
|
|
648
668
|
//#endregion
|
|
669
|
+
//#region src/runtime/pageEnvironment.d.ts
|
|
670
|
+
interface PageStackSnapshot {
|
|
671
|
+
canGoBack: boolean;
|
|
672
|
+
currentRoute: string;
|
|
673
|
+
stackLength: number;
|
|
674
|
+
}
|
|
675
|
+
interface UsePageStackOptions {
|
|
676
|
+
autoRefresh?: boolean;
|
|
677
|
+
}
|
|
678
|
+
interface NavigationBarMetrics {
|
|
679
|
+
navigationBarHeight: number;
|
|
680
|
+
navigationHeight: number;
|
|
681
|
+
statusBarHeight: number;
|
|
682
|
+
}
|
|
683
|
+
interface UseNavigationBarMetricsOptions {
|
|
684
|
+
autoRefresh?: boolean;
|
|
685
|
+
defaultNavigationBarHeight?: number;
|
|
686
|
+
defaultStatusBarHeight?: number;
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* 获取当前小程序页面栈的稳定快照。
|
|
690
|
+
*/
|
|
691
|
+
declare function getCurrentPageStackSnapshot(): PageStackSnapshot;
|
|
692
|
+
/**
|
|
693
|
+
* 在 setup 中跟踪当前小程序页面栈状态。
|
|
694
|
+
*/
|
|
695
|
+
declare function usePageStack(options?: UsePageStackOptions): {
|
|
696
|
+
canGoBack: ComputedRef<boolean>;
|
|
697
|
+
currentRoute: Ref<string, string>;
|
|
698
|
+
refresh: () => void;
|
|
699
|
+
stackLength: Ref<number, number>;
|
|
700
|
+
};
|
|
701
|
+
/**
|
|
702
|
+
* 计算自定义导航栏所需的状态栏和胶囊占位高度。
|
|
703
|
+
*/
|
|
704
|
+
declare function getNavigationBarMetrics(options?: Omit<UseNavigationBarMetricsOptions, 'autoRefresh'>): NavigationBarMetrics;
|
|
705
|
+
/**
|
|
706
|
+
* 在 setup 中跟踪自定义导航栏尺寸。
|
|
707
|
+
*/
|
|
708
|
+
declare function useNavigationBarMetrics(options?: UseNavigationBarMetricsOptions): {
|
|
709
|
+
navigationBarHeight: Ref<number, number>;
|
|
710
|
+
navigationHeight: ComputedRef<number>;
|
|
711
|
+
refresh: () => void;
|
|
712
|
+
statusBarHeight: Ref<number, number>;
|
|
713
|
+
};
|
|
714
|
+
//#endregion
|
|
649
715
|
//#region src/runtime/pageLayout.d.ts
|
|
650
716
|
interface WevuPageLayoutMap {}
|
|
651
717
|
type ResolveTypedPageLayoutName = keyof WevuPageLayoutMap extends never ? string : Extract<keyof WevuPageLayoutMap, string>;
|
|
@@ -760,6 +826,17 @@ declare function provideGlobal<T>(key: any, value: T): void;
|
|
|
760
826
|
*/
|
|
761
827
|
declare function injectGlobal<T>(key: any, defaultValue?: T): T;
|
|
762
828
|
//#endregion
|
|
829
|
+
//#region src/runtime/pullDownRefresh.d.ts
|
|
830
|
+
type PullDownRefreshHandler = () => void | Promise<void>;
|
|
831
|
+
interface UseAsyncPullDownRefreshOptions {
|
|
832
|
+
onError?: (error: unknown) => void | Promise<void>;
|
|
833
|
+
stopPullDownRefresh?: () => unknown | Promise<unknown>;
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* 注册下拉刷新回调,并在回调结束后自动停止宿主下拉刷新状态。
|
|
837
|
+
*/
|
|
838
|
+
declare function useAsyncPullDownRefresh(refresh: PullDownRefreshHandler, options?: UseAsyncPullDownRefreshOptions): void;
|
|
839
|
+
//#endregion
|
|
763
840
|
//#region src/runtime/register/watch.d.ts
|
|
764
841
|
type WatchHandler = (this: any, value: any, oldValue: any) => void;
|
|
765
842
|
type WatchDescriptor = WatchHandler | string | {
|
|
@@ -809,6 +886,56 @@ type SetupRunner = {
|
|
|
809
886
|
*/
|
|
810
887
|
declare function runSetupFunction(setup: SetupRunner | undefined, props: Record<string, any>, context: any): unknown;
|
|
811
888
|
//#endregion
|
|
889
|
+
//#region src/runtime/selectorQuery.d.ts
|
|
890
|
+
interface UseSelectorQueryOptions {
|
|
891
|
+
context?: InternalRuntimeState | null;
|
|
892
|
+
}
|
|
893
|
+
interface UseBoundingClientRectOptions extends UseSelectorQueryOptions {
|
|
894
|
+
all?: boolean;
|
|
895
|
+
}
|
|
896
|
+
interface UseSelectorFieldsOptions extends UseSelectorQueryOptions {
|
|
897
|
+
all?: boolean;
|
|
898
|
+
fields: HostMiniProgramNodesRefFields;
|
|
899
|
+
}
|
|
900
|
+
interface UseScrollOffsetOptions extends UseSelectorQueryOptions {
|
|
901
|
+
all?: boolean;
|
|
902
|
+
}
|
|
903
|
+
interface UseAllBoundingClientRectOptions extends UseSelectorQueryOptions {
|
|
904
|
+
all: true;
|
|
905
|
+
}
|
|
906
|
+
interface UseAllSelectorFieldsOptions extends UseSelectorQueryOptions {
|
|
907
|
+
all: true;
|
|
908
|
+
fields: HostMiniProgramNodesRefFields;
|
|
909
|
+
}
|
|
910
|
+
interface UseAllScrollOffsetOptions extends UseSelectorQueryOptions {
|
|
911
|
+
all: true;
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* 创建绑定当前小程序实例的选择器查询工厂。
|
|
915
|
+
*/
|
|
916
|
+
declare function useSelectorQuery(options?: UseSelectorQueryOptions): () => HostMiniProgramSelectorQuery | null;
|
|
917
|
+
/**
|
|
918
|
+
* 创建绑定当前小程序实例的节点布局查询函数。
|
|
919
|
+
*/
|
|
920
|
+
declare function useBoundingClientRect(options?: UseBoundingClientRectOptions & {
|
|
921
|
+
all?: false;
|
|
922
|
+
}): (selector: string) => Promise<HostMiniProgramBoundingClientRectResult | null>;
|
|
923
|
+
declare function useBoundingClientRect(options: UseAllBoundingClientRectOptions): (selector: string) => Promise<HostMiniProgramBoundingClientRectResult[] | null>;
|
|
924
|
+
/**
|
|
925
|
+
* 创建绑定当前小程序实例的节点字段查询函数。
|
|
926
|
+
*/
|
|
927
|
+
declare function useSelectorFields(options: UseSelectorFieldsOptions & {
|
|
928
|
+
all?: false;
|
|
929
|
+
}): (selector: string) => Promise<Record<string, any> | null>;
|
|
930
|
+
declare function useSelectorFields(options: UseAllSelectorFieldsOptions): (selector: string) => Promise<Array<Record<string, any>> | null>;
|
|
931
|
+
/**
|
|
932
|
+
* 创建绑定当前小程序实例的滚动位置查询函数。
|
|
933
|
+
*/
|
|
934
|
+
declare function useScrollOffset(options?: UseScrollOffsetOptions & {
|
|
935
|
+
all?: false;
|
|
936
|
+
}): (selector: string) => Promise<HostMiniProgramScrollOffsetResult | null>;
|
|
937
|
+
declare function useScrollOffset(options: UseAllScrollOffsetOptions): (selector: string) => Promise<HostMiniProgramScrollOffsetResult[] | null>;
|
|
938
|
+
//#endregion
|
|
812
939
|
//#region src/runtime/template.d.ts
|
|
813
940
|
declare function normalizeStyle(value: any): string;
|
|
814
941
|
declare function normalizeClass(value: any): string;
|
|
@@ -859,6 +986,10 @@ type BindModelWithHelper<DefaultEvent extends string = 'input', DefaultValueProp
|
|
|
859
986
|
on: <T = any, Event extends string = DefaultEvent, ValueProp extends string = DefaultValueProp, Formatted = T>(path: string, options?: ModelBindingOptions<T, Event, ValueProp, Formatted>) => (event: any) => void;
|
|
860
987
|
};
|
|
861
988
|
declare function useBindModel<DefaultEvent extends string = 'input', DefaultValueProp extends string = 'value'>(defaultOptions?: ModelBindingOptions<any, DefaultEvent, DefaultValueProp, any>): BindModelWithHelper<DefaultEvent, DefaultValueProp>;
|
|
989
|
+
/**
|
|
990
|
+
* useChangeModel 返回以 change 事件为默认更新事件的 model 绑定助手。
|
|
991
|
+
*/
|
|
992
|
+
declare function useChangeModel(): <T = any, ValueProp extends string = "value", Formatted = T>(path: string, options?: ModelBindingOptions<T, "change", ValueProp, Formatted>) => ModelBindingPayload<T, "change", ValueProp, Formatted>;
|
|
862
993
|
declare function mergeModels<T>(a: T, b: T): T;
|
|
863
994
|
//#endregion
|
|
864
995
|
//#region src/runtime/vueCompat/router.d.ts
|
|
@@ -1030,4 +1161,4 @@ declare function defineModel<T = any, M extends PropertyKey = string, G = T, S =
|
|
|
1030
1161
|
//#region src/version.d.ts
|
|
1031
1162
|
declare const version: string;
|
|
1032
1163
|
//#endregion
|
|
1033
|
-
export {
|
|
1164
|
+
export { teardownRuntimeInstance as $, setWevuDefaults as $n, onServerPrefetch as $t, useSlots as A, setCurrentInstance as An, markNoSetData as At, UseAllScrollOffsetOptions as B, useDisposables as Bn, useLayoutHosts as Bt, UseModelOptions as C, onThemeChange as Cn, UseNavigationBarMetricsOptions as Ct, useModel as D, callHookReturn as Dn, useNavigationBarMetrics as Dt, useChangeModel as E, callHookList as En, getNavigationBarMetrics as Et, UseUpdatePerformanceListenerStopHandle as F, useElementIntersectionObserver as Fn, resolveLayoutBridge as Ft, UseSelectorQueryOptions as G, SetupFunctionWithTypeProps as Gn, callUpdateHooks as Gt, UseBoundingClientRectOptions as H, DefineComponentTypePropsOptions as Hn, UseIntersectionObserverOptions as Ht, useUpdatePerformanceListener as I, DisposableBag as In, resolveLayoutHost as It, useSelectorFields as J, createWevuComponent as Jn, onBeforeUnmount as Jt, useBoundingClientRect as K, WevuComponentConstructor as Kn, onActivated as Kt, normalizeClass as L, DisposableLike as Ln, unregisterPageLayoutBridge as Lt, use as M, ElementIntersectionObserverCallback as Mn, LayoutHostBinding as Mt, UpdatePerformanceListener as N, UseElementIntersectionObserverOptions as Nn, registerPageLayoutBridge as Nt, useAttrs as O, getCurrentInstance as On, usePageStack as Ot, UpdatePerformanceListenerResult as P, UseElementIntersectionObserverReturn as Pn, registerRuntimeLayoutHosts as Pt, setRuntimeSetDataVisibility as Q, resetWevuDefaults as Qn, onMounted as Qt, normalizeStyle as R, DisposableMethodName as Rn, unregisterRuntimeLayoutHosts as Rt, ModelModifiers as S, onTabItemTap as Sn, PageStackSnapshot as St, useBindModel as T, onUnload as Tn, getCurrentPageStackSnapshot as Tt, UseScrollOffsetOptions as U, DefineComponentWithTypeProps as Un, UseIntersectionObserverResult as Ut, UseAllSelectorFieldsOptions as V, ComponentDefinition as Vn, waitForLayoutHost as Vt, UseSelectorFieldsOptions as W, SetupContextWithTypeProps as Wn, useIntersectionObserver as Wt, runSetupFunction as X, defineComponent as Xn, onDeactivated as Xt, useSelectorQuery as Y, createWevuScopedSlotComponent as Yn, onBeforeUpdate as Yt, mountRuntimeInstance as Z, WevuDefaults as Zn, onErrorCaptured as Zt, EmitsOptions as _, onRouteDone as _n, setPageLayout as _t, PageLayoutMeta as a, onError as an, TemplateRefs as ar, hasInjectionContext as at, useNativePageRouter as b, onShareTimeline as bn, usePageLayout as bt, defineExpose as c, onLoad as cn, CreateAppOptions as cr, provide as ct, definePageMeta as d, onPageNotFound as dn, DefineComponentOptions as dr, UsePageScrollThrottleOptions as dt, onUnmounted as en, createApp as er, registerComponent as et, defineProps as f, onPageScroll as fn, PageFeatures as fr, UsePageScrollThrottleStopHandle as ft, EmitFn as g, onResize as gn, resolveRuntimePageLayoutName as gt, ComponentTypeEmits as h, onReady as hn, WevuPageLayoutMap as ht, ModelRef as i, onDetached as in, TemplateRefValue as ir, useAsyncPullDownRefresh as it, defineAppSetup as j, setCurrentSetupContext as jn, LayoutBridgeInstance as jt, useNativeInstance as k, getCurrentSetupContext as kn, isNoSetData as kt, defineModel as l, onMemoryWarning as ln, DataOption as lr, provideGlobal as lt, withDefaults as m, onReachBottom as mn, SetDataSnapshotOptions as mr, PageLayoutState as mt, DefineModelModifiers as n, onAddToFavorites as nn, GlobalDirectives as nr, PullDownRefreshHandler as nt, PageMeta as o, onHide as on, WevuGlobalComponents as or, inject as ot, defineSlots as p, onPullDownRefresh as pn, SetDataDebugInfo as pr, usePageScrollThrottle as pt, useScrollOffset as q, WevuDefinedComponent as qn, onBeforeMount as qt, DefineModelTransformOptions as r, onAttached as rn, MiniProgramTemplateRefValue as rr, UseAsyncPullDownRefreshOptions as rt, defineEmits as s, onLaunch as sn, WevuGlobalDirectives as sr, injectGlobal as st, version as t, onUpdated as tn, GlobalComponents as tr, registerApp as tt, defineOptions as u, onMoved as un, DefineAppOptions as ur, setGlobalProvidedValue as ut, TemplateRef as v, onSaveExitState as vn, syncRuntimePageLayoutState as vt, mergeModels as w, onUnhandledRejection as wn, UsePageStackOptions as wt, useNativeRouter as x, onShow as xn, NavigationBarMetrics as xt, useTemplateRef as y, onShareAppMessage as yn, syncRuntimePageLayoutStateFromRuntime as yt, UseAllBoundingClientRectOptions as z, DisposableObject as zn, useLayoutBridge as zt };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as MiniProgramCSSProperties, c as MiniProgramIntrinsicEventHandler, d as WeappIntrinsicElementBaseAttributes, f as WeappIntrinsicEventHandler, i as WeappIntrinsicElements, l as WeappCSSProperties, n as MiniProgramIntrinsicElements, o as MiniProgramDatasetAttributes, r as WeappHtmlAliasIntrinsicElements, s as MiniProgramIntrinsicElementBaseAttributes, t as MiniProgramHtmlAliasIntrinsicElements, u as WeappDatasetAttributes } from "./weappIntrinsicElements-Cdfh6BlL.mjs";
|
|
2
2
|
import { $ as shallowRef, $n as HostMiniProgramNodesRefFields, A as watchPostEffect, An as MiniProgramPageLifetimes, Ar as MiniProgramRuntimeHostNamespaceBySource, At as nextTick, B as WatchOptions, Bn as HostMiniProgramComponentInstance, Bt as MaybeRef, C as ExtractMethods, Cn as MiniProgramAppOptions, Cr as MiniProgramHostNamespace, Ct as effect, D as ModelBindingPayload, Dn as MiniProgramComponentPropertyValue, Dr as MiniProgramPlatformHostNamespaceBySource, Dt as onScopeDispose, E as ModelBindingOptions, En as MiniProgramComponentOptions, Er as MiniProgramHostSourceRegistry, Et as getCurrentScope, F as OnCleanup, Fn as HostMiniProgramBoundingClientRectResult, Fr as WechatMiniProgramHostNamespace, Ft as WritableComputedRef, G as WatchStopHandle, Gn as HostMiniProgramComponentTrivialInstance, Gt as isRef, H as WatchSource, Hn as HostMiniProgramComponentPropertyOption, Ht as Ref, I as WatchCallback, In as HostMiniProgramComponentAllFullProperty, Ir as WechatMiniProgramHostSourceContract, It as computed, J as traverse, Jn as HostMiniProgramIntersectionObserverOptions, Jt as unref, K as getDeepWatchStrategy, Kn as HostMiniProgramComponentTrivialOption, Kt as ref, L as WatchEffect, Ln as HostMiniProgramComponentAllProperty, Lt as CustomRefFactory, M as MapSources, Mn as HostMiniProgramAppOptions, Mr as MiniProgramRuntimeHostSourceRegistry, Mt as ComputedRef, N as MaybeUndefined, Nn as HostMiniProgramAppTrivialInstance, Nr as TtMiniProgramHostNamespace, Nt as ComputedSetter, O as watch, On as MiniProgramComponentRawOptions, Or as MiniProgramPlatformHostSourceName, Ot as startBatch, P as MultiWatchSources, Pn as HostMiniProgramBehaviorIdentifier, Pr as TtMiniProgramHostSourceContract, Pt as WritableComputedOptions, Q as isShallowRef, Qn as HostMiniProgramNodesRef, Qt as MiniProgramRouterSwitchTabOption, R as WatchEffectOptions, Rn as HostMiniProgramComponentBehaviorOptions, Rt as CustomRefOptions, S as ExtractComputed, Sn as MiniProgramAdapter, Sr as DouyinMiniProgramHostSourceContract, St as batch, T as ModelBinding, Tn as MiniProgramComponentInstance, Tr as MiniProgramHostSourceName, Tt as endBatch, U as WatchSourceValue, Un as HostMiniProgramComponentPropertyValue, Ut as ShallowRef, V as WatchScheduler, Vn as HostMiniProgramComponentMethodOption, Vt as MaybeRefOrGetter, W as WatchSources, Wn as HostMiniProgramComponentShortProperty, Wt as customRef, X as toRef, Xn as HostMiniProgramMemoryWarningResult, Xt as MiniProgramRouterReLaunchOption, Y as ToRefs, Yn as HostMiniProgramLaunchOptions, Yt as MiniProgramRouterNavigateToOption, Z as toRefs, Zn as HostMiniProgramNavigateToOption, Zt as MiniProgramRouterRedirectToOption, _ as RuntimeApp, _n as NativeTypeHint, _r as AlipayMiniProgramHostNamespace, _t as MutationOp, a as NativeComponent, ar as HostMiniProgramReLaunchOption, at as getReactiveVersion, b as ComponentPublicInstance, bn as PropOptions, br as DefaultMiniProgramHostSourceContract, bt as removeMutationRecorder, c as ShallowUnwrapRef, cn as ExtractDefaultPropTypes, cr as HostMiniProgramSaveExitState, ct as markRaw, d as SetupContext, dn as InferNativePropType, dr as HostMiniProgramShareAppMessageOption, dt as isShallowReactive, er as HostMiniProgramPageLifetime, et as triggerRef, f as SetupContextNativeInstance, fn as InferNativeProps, fr as HostMiniProgramSwitchTabOption, ft as shallowReactive, g as InternalRuntimeStateFields, gn as NativePropsOptions, gr as HostMiniProgramUnhandledRejectionResult, gt as MutationKind, h as InternalRuntimeState, hn as NativePropType, hr as HostMiniProgramTriggerEventOptions, ht as touchReactive, i as DefineComponent, ir as HostMiniProgramPageTrivialInstance, it as shallowReadonly, j as watchSyncEffect, jn as HostMiniProgramAddToFavoritesOption, jr as MiniProgramRuntimeHostSourceName, jt as ComputedGetter, k as watchEffect, kn as MiniProgramInstance, kr as MiniProgramPlatformHostSourceRegistry, kt as stop, l as VNode, ln as ExtractPropTypes, lr as HostMiniProgramScrollOffsetResult, lt as reactive, m as AppConfig, mn as InferProps, mr as HostMiniProgramThemeChangeResult, mt as prelinkReactiveTree, n as ComponentCustomProps, nr as HostMiniProgramPageResizeOption, nt as isReadonly, o as ObjectDirective, on as WevuTypedRouterRouteMap, or as HostMiniProgramRedirectToOption, ot as isRaw, p as SetupFunction, pn as InferPropType, pr as HostMiniProgramTabItemTapOption, pt as PrelinkReactiveTreeOptions, q as setDeepWatchStrategy, qn as HostMiniProgramIntersectionObserver, qt as toValue, r as ComponentOptionsMixin, rn as SetupContextRouter, rr as HostMiniProgramPageScrollOption, rt as readonly, s as PublicProps, sn as ComponentPropsOptions, sr as HostMiniProgramRouter, st as isReactive, t as AllowedComponentProps, tr as HostMiniProgramPageNotFoundOptions, tt as isProxy, u as VNodeProps, un as ExtractPublicPropTypes, ur as HostMiniProgramSelectorQuery, ut as toRaw, v as RuntimeInstance, vn as NativeTypedProperty, vr as AlipayMiniProgramHostSourceContract, vt as MutationRecord, w as MethodDefinitions, wn as MiniProgramBehaviorIdentifier, wr as MiniProgramHostNamespaceBySource, wt as effectScope, x as ComputedDefinitions, xn as PropType, xr as DouyinMiniProgramHostNamespace, xt as EffectScope, y as WevuPlugin, yn as PropConstructor, yr as DefaultMiniProgramHostNamespace, yt as addMutationRecorder, z as WatchMultiSources, zn as HostMiniProgramComponentEmptyArray, zt as CustomRefSource } from "./vue-types-BiAihmBy.mjs";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as teardownRuntimeInstance, $n as setWevuDefaults, $t as onServerPrefetch, A as useSlots, An as setCurrentInstance, At as markNoSetData, B as UseAllScrollOffsetOptions, Bn as useDisposables, Bt as useLayoutHosts, C as UseModelOptions, Cn as onThemeChange, Ct as UseNavigationBarMetricsOptions, D as useModel, Dn as callHookReturn, Dt as useNavigationBarMetrics, E as useChangeModel, En as callHookList, Et as getNavigationBarMetrics, F as UseUpdatePerformanceListenerStopHandle, Fn as useElementIntersectionObserver, Ft as resolveLayoutBridge, G as UseSelectorQueryOptions, Gn as SetupFunctionWithTypeProps, Gt as callUpdateHooks, H as UseBoundingClientRectOptions, Hn as DefineComponentTypePropsOptions, Ht as UseIntersectionObserverOptions, I as useUpdatePerformanceListener, In as DisposableBag, It as resolveLayoutHost, J as useSelectorFields, Jn as createWevuComponent, Jt as onBeforeUnmount, K as useBoundingClientRect, Kn as WevuComponentConstructor, Kt as onActivated, L as normalizeClass, Ln as DisposableLike, Lt as unregisterPageLayoutBridge, M as use, Mn as ElementIntersectionObserverCallback, Mt as LayoutHostBinding, N as UpdatePerformanceListener, Nn as UseElementIntersectionObserverOptions, Nt as registerPageLayoutBridge, O as useAttrs, On as getCurrentInstance, Ot as usePageStack, P as UpdatePerformanceListenerResult, Pn as UseElementIntersectionObserverReturn, Pt as registerRuntimeLayoutHosts, Q as setRuntimeSetDataVisibility, Qn as resetWevuDefaults, Qt as onMounted, R as normalizeStyle, Rn as DisposableMethodName, Rt as unregisterRuntimeLayoutHosts, S as ModelModifiers, Sn as onTabItemTap, St as PageStackSnapshot, T as useBindModel, Tn as onUnload, Tt as getCurrentPageStackSnapshot, U as UseScrollOffsetOptions, Un as DefineComponentWithTypeProps, Ut as UseIntersectionObserverResult, V as UseAllSelectorFieldsOptions, Vn as ComponentDefinition, Vt as waitForLayoutHost, W as UseSelectorFieldsOptions, Wn as SetupContextWithTypeProps, Wt as useIntersectionObserver, X as runSetupFunction, Xn as defineComponent, Xt as onDeactivated, Y as useSelectorQuery, Yn as createWevuScopedSlotComponent, Yt as onBeforeUpdate, Z as mountRuntimeInstance, Zn as WevuDefaults, Zt as onErrorCaptured, _ as EmitsOptions, _n as onRouteDone, _t as setPageLayout, a as PageLayoutMeta, an as onError, ar as TemplateRefs, at as hasInjectionContext, b as useNativePageRouter, bn as onShareTimeline, bt as usePageLayout, c as defineExpose, cn as onLoad, cr as CreateAppOptions, ct as provide, d as definePageMeta, dn as onPageNotFound, dr as DefineComponentOptions, dt as UsePageScrollThrottleOptions, en as onUnmounted, er as createApp, et as registerComponent, f as defineProps, fn as onPageScroll, fr as PageFeatures, ft as UsePageScrollThrottleStopHandle, g as EmitFn, gn as onResize, gt as resolveRuntimePageLayoutName, h as ComponentTypeEmits, hn as onReady, ht as WevuPageLayoutMap, i as ModelRef, in as onDetached, ir as TemplateRefValue, it as useAsyncPullDownRefresh, j as defineAppSetup, jn as setCurrentSetupContext, jt as LayoutBridgeInstance, k as useNativeInstance, kn as getCurrentSetupContext, kt as isNoSetData, l as defineModel, ln as onMemoryWarning, lr as DataOption, lt as provideGlobal, m as withDefaults, mn as onReachBottom, mr as SetDataSnapshotOptions, mt as PageLayoutState, n as DefineModelModifiers, nn as onAddToFavorites, nr as GlobalDirectives, nt as PullDownRefreshHandler, o as PageMeta, on as onHide, or as WevuGlobalComponents, ot as inject, p as defineSlots, pn as onPullDownRefresh, pr as SetDataDebugInfo, pt as usePageScrollThrottle, q as useScrollOffset, qn as WevuDefinedComponent, qt as onBeforeMount, r as DefineModelTransformOptions, rn as onAttached, rr as MiniProgramTemplateRefValue, rt as UseAsyncPullDownRefreshOptions, s as defineEmits, sn as onLaunch, sr as WevuGlobalDirectives, st as injectGlobal, t as version, tn as onUpdated, tr as GlobalComponents, tt as registerApp, u as defineOptions, un as onMoved, ur as DefineAppOptions, ut as setGlobalProvidedValue, v as TemplateRef, vn as onSaveExitState, vt as syncRuntimePageLayoutState, w as mergeModels, wn as onUnhandledRejection, wt as UsePageStackOptions, x as useNativeRouter, xn as onShow, xt as NavigationBarMetrics, y as useTemplateRef, yn as onShareAppMessage, yt as syncRuntimePageLayoutStateFromRuntime, z as UseAllBoundingClientRectOptions, zn as DisposableObject, zt as useLayoutBridge } from "./index-BKnpWfa6.mjs";
|
|
4
4
|
import { a as ActionContext, c as MutationType, d as SubscriptionCallback, i as defineStore, l as StoreManager, n as storeToRefs, o as ActionSubscriber, r as createStore, s as DefineStoreOptions, t as StoreToRefsResult, u as StoreSubscribeOptions } from "./index-CmPm9WU0.mjs";
|
|
5
5
|
export * from "@wevu/web-apis";
|
|
6
|
-
export { ActionContext, ActionSubscriber, AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, AllowedComponentProps, AppConfig, ComponentCustomProps, ComponentDefinition, ComponentOptionsMixin, ComponentPropsOptions, ComponentPublicInstance, ComponentTypeEmits, ComputedDefinitions, ComputedGetter, ComputedRef, ComputedSetter, CreateAppOptions, CustomRefFactory, CustomRefOptions, CustomRefSource, DataOption, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DefineAppOptions, DefineComponent, DefineComponentOptions, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, DefineModelModifiers, DefineModelTransformOptions, DefineStoreOptions, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, EffectScope, EmitFn, EmitsOptions, ExtractComputed, ExtractDefaultPropTypes, ExtractMethods, ExtractPropTypes, ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, HostMiniProgramAddToFavoritesOption, HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, HostMiniProgramAppOptions, HostMiniProgramAppTrivialInstance, HostMiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult, HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty, HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty, HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions, HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray, HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, HostMiniProgramComponentInstance, HostMiniProgramComponentMethodOption, HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, HostMiniProgramComponentPropertyOption, HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, HostMiniProgramComponentPropertyValue, HostMiniProgramComponentShortProperty, HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, HostMiniProgramComponentTrivialInstance, HostMiniProgramComponentTrivialOption, HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions, HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions, HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption, HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, HostMiniProgramNodesRef, HostMiniProgramNodesRef as MiniProgramNodesRef, HostMiniProgramNodesRefFields, HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, HostMiniProgramPageLifetime, HostMiniProgramPageLifetime as MiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, HostMiniProgramPageTrivialInstance, HostMiniProgramReLaunchOption, HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, HostMiniProgramRedirectToOption, HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, HostMiniProgramRouter, HostMiniProgramRouter as MiniProgramRouter, HostMiniProgramSaveExitState, HostMiniProgramSaveExitState as MiniProgramSaveExitState, HostMiniProgramScrollOffsetResult, HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery, HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption, HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption, HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption, HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, HostMiniProgramTriggerEventOptions, HostMiniProgramTriggerEventOptions as TriggerEventOptions, HostMiniProgramUnhandledRejectionResult, HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, InferNativePropType, InferNativeProps, InferPropType, InferProps, InternalRuntimeState, InternalRuntimeStateFields, LayoutBridgeInstance, LayoutHostBinding, MapSources, MaybeRef, MaybeRefOrGetter, MaybeUndefined, MethodDefinitions, MiniProgramAdapter, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, MiniProgramCSSProperties, MiniProgramComponentInstance, MiniProgramComponentOptions, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, MiniProgramDatasetAttributes, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramHtmlAliasIntrinsicElements, MiniProgramInstance, MiniProgramIntrinsicElementBaseAttributes, MiniProgramIntrinsicElements, MiniProgramIntrinsicEventHandler, MiniProgramPageLifetimes, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, MiniProgramTemplateRefValue, ModelBinding, ModelBindingOptions, ModelBindingPayload, ModelModifiers, ModelRef, MultiWatchSources, MutationKind, MutationOp, MutationRecord, MutationType, NativeComponent, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, ObjectDirective, OnCleanup, PageFeatures, PageLayoutMeta, PageLayoutState, PageMeta, PrelinkReactiveTreeOptions, PropConstructor, PropOptions, PropType, PublicProps, Ref, RuntimeApp, RuntimeInstance, SetDataDebugInfo, SetDataSnapshotOptions, SetupContext, SetupContextNativeInstance, SetupContextRouter, SetupContextWithTypeProps, SetupFunction, SetupFunctionWithTypeProps, ShallowRef, ShallowUnwrapRef, StoreManager, StoreSubscribeOptions, StoreToRefsResult, SubscriptionCallback, TemplateRef, TemplateRefValue, TemplateRefs, ToRefs, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseIntersectionObserverOptions, UseIntersectionObserverResult, UseModelOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UseUpdatePerformanceListenerStopHandle, VNode, VNodeProps, WatchCallback, WatchEffect, WatchEffectOptions, WatchMultiSources, WatchOptions, WatchScheduler, WatchSource, WatchSourceValue, WatchSources, WatchStopHandle, WeappCSSProperties, WeappDatasetAttributes, WeappHtmlAliasIntrinsicElements, WeappIntrinsicElementBaseAttributes, WeappIntrinsicElements, WeappIntrinsicEventHandler, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract, WevuComponentConstructor, WevuDefaults, WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, WevuPageLayoutMap, WevuPlugin, WevuTypedRouterRouteMap, WritableComputedOptions, WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getReactiveVersion, hasInjectionContext, inject, injectGlobal, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAttrs, useBindModel, useDisposables, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, usePageLayout, usePageScrollThrottle, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect, withDefaults };
|
|
6
|
+
export { ActionContext, ActionSubscriber, AlipayMiniProgramHostNamespace, AlipayMiniProgramHostSourceContract, AllowedComponentProps, AppConfig, ComponentCustomProps, ComponentDefinition, ComponentOptionsMixin, ComponentPropsOptions, ComponentPublicInstance, ComponentTypeEmits, ComputedDefinitions, ComputedGetter, ComputedRef, ComputedSetter, CreateAppOptions, CustomRefFactory, CustomRefOptions, CustomRefSource, DataOption, DefaultMiniProgramHostNamespace, DefaultMiniProgramHostSourceContract, DefineAppOptions, DefineComponent, DefineComponentOptions, DefineComponentTypePropsOptions, DefineComponentWithTypeProps, DefineModelModifiers, DefineModelTransformOptions, DefineStoreOptions, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, DouyinMiniProgramHostNamespace, DouyinMiniProgramHostSourceContract, EffectScope, ElementIntersectionObserverCallback, EmitFn, EmitsOptions, ExtractComputed, ExtractDefaultPropTypes, ExtractMethods, ExtractPropTypes, ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, HostMiniProgramAddToFavoritesOption, HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, HostMiniProgramAppOptions, HostMiniProgramAppTrivialInstance, HostMiniProgramBehaviorIdentifier, HostMiniProgramBoundingClientRectResult, HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, HostMiniProgramComponentAllFullProperty, HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, HostMiniProgramComponentAllProperty, HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, HostMiniProgramComponentBehaviorOptions, HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, HostMiniProgramComponentEmptyArray, HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, HostMiniProgramComponentInstance, HostMiniProgramComponentMethodOption, HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, HostMiniProgramComponentPropertyOption, HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, HostMiniProgramComponentPropertyValue, HostMiniProgramComponentShortProperty, HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, HostMiniProgramComponentTrivialInstance, HostMiniProgramComponentTrivialOption, HostMiniProgramIntersectionObserver, HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, HostMiniProgramIntersectionObserverOptions, HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, HostMiniProgramLaunchOptions, HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, HostMiniProgramMemoryWarningResult, HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, HostMiniProgramNavigateToOption, HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, HostMiniProgramNodesRef, HostMiniProgramNodesRef as MiniProgramNodesRef, HostMiniProgramNodesRefFields, HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, HostMiniProgramPageLifetime, HostMiniProgramPageLifetime as MiniProgramPageLifetime, HostMiniProgramPageNotFoundOptions, HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, HostMiniProgramPageResizeOption, HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, HostMiniProgramPageScrollOption, HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, HostMiniProgramPageTrivialInstance, HostMiniProgramReLaunchOption, HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, HostMiniProgramRedirectToOption, HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, HostMiniProgramRouter, HostMiniProgramRouter as MiniProgramRouter, HostMiniProgramSaveExitState, HostMiniProgramSaveExitState as MiniProgramSaveExitState, HostMiniProgramScrollOffsetResult, HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, HostMiniProgramSelectorQuery, HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, HostMiniProgramShareAppMessageOption, HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, HostMiniProgramSwitchTabOption, HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, HostMiniProgramTabItemTapOption, HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, HostMiniProgramThemeChangeResult, HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, HostMiniProgramTriggerEventOptions, HostMiniProgramTriggerEventOptions as TriggerEventOptions, HostMiniProgramUnhandledRejectionResult, HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, InferNativePropType, InferNativeProps, InferPropType, InferProps, InternalRuntimeState, InternalRuntimeStateFields, LayoutBridgeInstance, LayoutHostBinding, MapSources, MaybeRef, MaybeRefOrGetter, MaybeUndefined, MethodDefinitions, MiniProgramAdapter, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, MiniProgramCSSProperties, MiniProgramComponentInstance, MiniProgramComponentOptions, MiniProgramComponentPropertyValue, MiniProgramComponentRawOptions, MiniProgramDatasetAttributes, MiniProgramHostNamespace, MiniProgramHostNamespaceBySource, MiniProgramHostSourceName, MiniProgramHostSourceRegistry, MiniProgramHtmlAliasIntrinsicElements, MiniProgramInstance, MiniProgramIntrinsicElementBaseAttributes, MiniProgramIntrinsicElements, MiniProgramIntrinsicEventHandler, MiniProgramPageLifetimes, MiniProgramPlatformHostNamespaceBySource, MiniProgramPlatformHostSourceName, MiniProgramPlatformHostSourceRegistry, MiniProgramRouterNavigateToOption, MiniProgramRouterReLaunchOption, MiniProgramRouterRedirectToOption, MiniProgramRouterSwitchTabOption, MiniProgramRuntimeHostNamespaceBySource, MiniProgramRuntimeHostSourceName, MiniProgramRuntimeHostSourceRegistry, MiniProgramTemplateRefValue, ModelBinding, ModelBindingOptions, ModelBindingPayload, ModelModifiers, ModelRef, MultiWatchSources, MutationKind, MutationOp, MutationRecord, MutationType, NativeComponent, NativePropType, NativePropsOptions, NativeTypeHint, NativeTypedProperty, NavigationBarMetrics, ObjectDirective, OnCleanup, PageFeatures, PageLayoutMeta, PageLayoutState, PageMeta, PageStackSnapshot, PrelinkReactiveTreeOptions, PropConstructor, PropOptions, PropType, PublicProps, PullDownRefreshHandler, Ref, RuntimeApp, RuntimeInstance, SetDataDebugInfo, SetDataSnapshotOptions, SetupContext, SetupContextNativeInstance, SetupContextRouter, SetupContextWithTypeProps, SetupFunction, SetupFunctionWithTypeProps, ShallowRef, ShallowUnwrapRef, StoreManager, StoreSubscribeOptions, StoreToRefsResult, SubscriptionCallback, TemplateRef, TemplateRefValue, TemplateRefs, ToRefs, TtMiniProgramHostNamespace, TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, VNode, VNodeProps, WatchCallback, WatchEffect, WatchEffectOptions, WatchMultiSources, WatchOptions, WatchScheduler, WatchSource, WatchSourceValue, WatchSources, WatchStopHandle, WeappCSSProperties, WeappDatasetAttributes, WeappHtmlAliasIntrinsicElements, WeappIntrinsicElementBaseAttributes, WeappIntrinsicElements, WeappIntrinsicEventHandler, WechatMiniProgramHostNamespace, WechatMiniProgramHostSourceContract, WevuComponentConstructor, WevuDefaults, WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, WevuPageLayoutMap, WevuPlugin, WevuTypedRouterRouteMap, WritableComputedOptions, WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getNavigationBarMetrics, getReactiveVersion, hasInjectionContext, inject, injectGlobal, isNoSetData, isProxy, isRaw, isReactive, isReadonly, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, registerPageLayoutBridge, registerRuntimeLayoutHosts, removeMutationRecorder, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, shallowReactive, shallowReadonly, shallowRef, startBatch, stop, storeToRefs, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, toRaw, toRef, toRefs, toValue, touchReactive, traverse, triggerRef, unref, unregisterPageLayoutBridge, unregisterRuntimeLayoutHosts, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost, watch, watchEffect, watchPostEffect, watchSyncEffect, withDefaults };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,D as t,E as n,N as r,O as i,S as a,T as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,k as h,l as g,n as _,o as v,p as y,s as b,t as x,u as S,w as C,x as w,y as T}from"./ref-Bs--7iY3.mjs";import{i as E,n as D,r as O,t as k}from"./store-B63-EIon.mjs";import{A,B as j,C as M,D as N,E as P,F,G as I,H as L,I as R,K as z,L as B,M as V,N as H,O as U,P as W,Q as G,R as K,T as q,U as J,V as Y,W as X,X as Z,Y as Q,Z as $,_ as ee,ct as te,dt as ne,et as re,g as ie,h as ae,j as oe,k as se,lt as ce,m as le,n as ue,q as de,t as fe,tt as pe,ut as me,v as he,w as ge,z as _e}from"./router-BtpVtHM4.mjs";import{$ as ve,A as ye,B as be,C as xe,
|
|
1
|
+
import{C as e,D as t,E as n,N as r,O as i,S as a,T as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,k as h,l as g,n as _,o as v,p as y,s as b,t as x,u as S,w as C,x as w,y as T}from"./ref-Bs--7iY3.mjs";import{i as E,n as D,r as O,t as k}from"./store-B63-EIon.mjs";import{A,B as j,C as M,D as N,E as P,F,G as I,H as L,I as R,K as z,L as B,M as V,N as H,O as U,P as W,Q as G,R as K,T as q,U as J,V as Y,W as X,X as Z,Y as Q,Z as $,_ as ee,ct as te,dt as ne,et as re,g as ie,h as ae,j as oe,k as se,lt as ce,m as le,n as ue,q as de,t as fe,tt as pe,ut as me,v as he,w as ge,z as _e}from"./router-BtpVtHM4.mjs";import{$ as ve,A as ye,B as be,C as xe,Ct as Se,D as Ce,E as we,F as Te,G as Ee,H as De,I as Oe,J as ke,K as Ae,L as je,M as Me,N as Ne,O as Pe,P as Fe,Q as Ie,R as Le,S as Re,St as ze,T as Be,U as Ve,V as He,W as Ue,X as We,Y as Ge,Z as Ke,_ as qe,_t as Je,a as Ye,at as Xe,b as Ze,bt as Qe,c as $e,ct as et,d as tt,dt as nt,et as rt,f as it,ft as at,g as ot,gt as st,h as ct,ht as lt,i as ut,it as dt,j as ft,k as pt,l as mt,lt as ht,m as gt,mt as _t,n as vt,nt as yt,o as bt,ot as xt,p as St,pt as Ct,q as wt,r as Tt,rt as Et,s as Dt,st as Ot,t as kt,tt as At,u as jt,ut as Mt,v as Nt,vt as Pt,w as Ft,wt as It,x as Lt,xt as Rt,y as zt,yt as Bt,z as Vt}from"./src-D9uUICz0.mjs";export*from"@wevu/web-apis";export{c as addMutationRecorder,a as batch,Q as callHookList,Z as callHookReturn,et as callUpdateHooks,E as computed,ye as createApp,O as createStore,Ce as createWevuComponent,Pe as createWevuScopedSlotComponent,x as customRef,mt as defineAppSetup,pt as defineComponent,D as defineStore,e as effect,C as effectScope,o as endBatch,$ as getCurrentInstance,Ze as getCurrentPageStackSnapshot,n as getCurrentScope,G as getCurrentSetupContext,xt as getDeepWatchStrategy,Lt as getNavigationBarMetrics,b as getReactiveVersion,le as hasInjectionContext,ae as inject,ie as injectGlobal,ve as isNoSetData,te as isProxy,l as isRaw,g as isReactive,ce as isReadonly,_ as isRef,d as isShallowReactive,ze as isShallowRef,rt as markNoSetData,S as markRaw,vt as mergeModels,De as mountRuntimeInstance,r as nextTick,it as normalizeClass,St as normalizeStyle,ht as onActivated,ge as onAddToFavorites,q as onAttached,Mt as onBeforeMount,nt as onBeforeUnmount,at as onBeforeUpdate,Ct as onDeactivated,P as onDetached,N as onError,_t as onErrorCaptured,U as onHide,se as onLaunch,A as onLoad,oe as onMemoryWarning,lt as onMounted,V as onMoved,H as onPageNotFound,W as onPageScroll,F as onPullDownRefresh,R as onReachBottom,B as onReady,K as onResize,_e as onRouteDone,j as onSaveExitState,t as onScopeDispose,st as onServerPrefetch,Y as onShareAppMessage,L as onShareTimeline,J as onShow,X as onTabItemTap,I as onThemeChange,z as onUnhandledRejection,de as onUnload,Je as onUnmounted,Pt as onUpdated,p as prelinkReactiveTree,ee as provide,he as provideGlobal,u as reactive,me as readonly,m as ref,He as registerApp,ft as registerComponent,Me as registerPageLayoutBridge,Ne as registerRuntimeLayoutHosts,w as removeMutationRecorder,Ke as resetWevuDefaults,Fe as resolveLayoutBridge,Te as resolveLayoutHost,Ae as resolveRuntimePageLayoutName,Ee as runSetupFunction,re as setCurrentInstance,pe as setCurrentSetupContext,Ot as setDeepWatchStrategy,M as setGlobalProvidedValue,wt as setPageLayout,Ve as setRuntimeSetDataVisibility,Ie as setWevuDefaults,y as shallowReactive,ne as shallowReadonly,Se as shallowRef,i as startBatch,h as stop,k as storeToRefs,ke as syncRuntimePageLayoutState,Ge as syncRuntimePageLayoutStateFromRuntime,Ue as teardownRuntimeInstance,T as toRaw,Qe as toRef,Rt as toRefs,s as toValue,f as touchReactive,Bt as traverse,It as triggerRef,v as unref,Oe as unregisterPageLayoutBridge,je as unregisterRuntimeLayoutHosts,jt as use,Nt as useAsyncPullDownRefresh,bt as useAttrs,Tt as useBindModel,gt as useBoundingClientRect,ut as useChangeModel,we as useDisposables,Be as useElementIntersectionObserver,Ft as useIntersectionObserver,Le as useLayoutBridge,Vt as useLayoutHosts,Ye as useModel,Dt as useNativeInstance,fe as useNativePageRouter,ue as useNativeRouter,Re as useNavigationBarMetrics,We as usePageLayout,zt as usePageScrollThrottle,xe as usePageStack,ct as useScrollOffset,ot as useSelectorFields,qe as useSelectorQuery,$e as useSlots,kt as useTemplateRef,tt as useUpdatePerformanceListener,At as version,be as waitForLayoutHost,yt as watch,Et as watchEffect,dt as watchPostEffect,Xe as watchSyncEffect};
|
package/dist/router.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e}from"./ref-Bs--7iY3.mjs";import{A as t,Q as n,U as r,a as i,c as a,d as o,f as s,g as c,i as l,l as u,n as d,o as f,p,r as m,s as h,t as g,u as _,ut as v,v as y,z as b}from"./router-BtpVtHM4.mjs";const x=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function S(e){var t;let n=x.exec(e);if(n)return{key:n[1],modifier:(t=n[2])==null?``:t}}function C(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function w(e){return encodeURIComponent(e)}function T(e){try{return decodeURIComponent(e)}catch(t){return e}}function E(e,t,n){let r=[],i=new Set;for(let a of e.split(`/`)){if(!a)continue;let e=S(a);if(!e){r.push(a);continue}let o=C(t[e.key]);if(e.modifier===``){if(o.length!==1)throw Error(`Missing required param "${e.key}" for named route "${n}"`);i.add(e.key),r.push(w(o[0]));continue}if(e.modifier===`?`){if(o.length===0)continue;if(o.length>1)throw Error(`Param "${e.key}" for named route "${n}" must be a single value`);i.add(e.key),r.push(w(o[0]));continue}if(e.modifier===`+`){if(o.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${n}"`);i.add(e.key);for(let e of o)r.push(w(e));continue}o.length>0&&i.add(e.key);for(let e of o)r.push(w(e))}return{path:r.join(`/`),consumedKeys:i}}function D(e){return e===void 0?!1:Array.isArray(e)?e.length>0:!0}function ee(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>D(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function te(e,t,n){let r=e.name;if(typeof r!=`string`||!r||e.path!==void 0||e.fullPath!==void 0)return e;let i=t.recordByName.get(r);if(!i)throw Error(`Named route "${r}" is not defined in createRouter({ routes | namedRoutes })`);let o=e.params?a(e.params):{},s=E(i.path,o,r);return n===`strict`&&ee(o,s.consumedKeys,r),{...e,path:s.path?`/${s.path}`:`/`,params:o}}function O(e){return e.split(`/`).filter(Boolean)}function ne(e){return[e.path,...e.aliasPaths]}function k(e,t){let n=[],r=new Set,i=e;for(;i&&!(r.has(i.name)||(r.add(i.name),n.unshift(i),!i.parentName));)i=t.recordByName.get(i.parentName);return n}function re(e){let t;for(let n of e)n.meta&&(t||(t={}),Object.assign(t,n.meta));return t}function A(e,t){let n=new Set;if(!t.has(e))return n;n.add(e);let r=!0;for(;r;){r=!1;for(let[e,i]of t.entries())!i.parentName||n.has(e)||n.has(i.parentName)&&(n.add(e),r=!0)}return n}function ie(e){let t={};for(let[n,r]of e.entries())r.length!==0&&(t[n]=r.length===1?r[0]:r);return t}function j(e,t){let n=O(e),r=O(t),i=new Map,a=(e,t)=>{let n=i.get(e);if(n){n.push(t);return}i.set(e,[t])},o=e=>{let t=i.get(e);!t||t.length===0||(t.pop(),t.length===0&&i.delete(e))},s=(e,t,n)=>{for(let i=0;i<n;i+=1)a(e,T(r[t+i]));return()=>{for(let t=0;t<n;t+=1)o(e)}},c=(e,t)=>{if(e>=n.length)return t>=r.length;let i=n[e],l=S(i);if(!l)return t>=r.length||i!==r[t]?!1:c(e+1,t+1);if(l.modifier===``){if(t>=r.length)return!1;a(l.key,T(r[t]));let n=c(e+1,t+1);return n||o(l.key),n}if(l.modifier===`?`){if(t<r.length){if(a(l.key,T(r[t])),c(e+1,t+1))return!0;o(l.key)}return c(e+1,t)}let u=+(l.modifier===`+`),d=r.length-t;for(let n=d;n>=u;--n){let r=s(l.key,t,n);if(c(e+1,t+n))return!0;r()}return!1};if(c(0,0))return ie(i)}function ae(e,t){if(e.name){let n=t.recordByName.get(e.name);if(n)return{record:n,matchedRecords:k(n,t)}}let n=t.nameByStaticPath.get(e.path);if(n){let r=t.recordByName.get(n);if(r)return{record:r,matchedRecords:k(r,t),matchedPath:e.path}}for(let n of t.recordByName.values())for(let r of ne(n)){if(!s(r))continue;let i=j(r,e.path);if(i)return{record:n,matchedRecords:k(n,t),matchedPath:r,params:i}}}function M(e){typeof console>`u`||typeof console.warn!=`function`||console.warn(`[wevu/router] ${e}`)}function oe(e){let t=p(e,``);return t?o(t):`/`}function N(e,t=new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(N(t,n))return!0;return!1}function se(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(N(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function ce(e){let t=new Map,n=[];for(let i of e){var r;let e=typeof i.route.name==`string`?i.route.name.trim():``;if(!e)continue;let a=(r=i.source)==null?`namedRoutes`:r,o=oe(i.route.path),s=t.get(e);s&&n.push(`"${e}" (${s.source}:${s.path} -> ${a}:${o})`),t.set(e,{source:a,path:o})}n.length!==0&&M(`duplicate route names detected, later entries override earlier ones: ${n.join(`, `)}`)}function le(e){return e?Array.isArray(e)?e:[e]:[]}function ue(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function P(e,t,n=`namedRoutes`){let r=p(e.path,``);if(!r&&e.path!==`/`)return;let i=ue(e,r,n);if(i)return{name:i,path:r,aliasPaths:de(e.alias,r),parentName:t,meta:e.meta,beforeEnterGuards:le(e.beforeEnter),redirect:e.redirect}}function de(e,t){if(!e)return[];let n=Array.isArray(e)?e:[e],r=[];for(let e of n){if(typeof e!=`string`)continue;let n=p(e,``);!n||n===t||r.includes(n)||r.push(n)}return r}function fe(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return I(e,void 0,void 0,[],t,t);let n=[];for(let[r,i]of Object.entries(e)){let e=typeof r==`string`?r.trim():``;if(!e){M(`ignored route record at ${t}: route name is required`);continue}if(typeof i!=`string`||!i){M(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:i},source:t})}return n}function pe(e){return[...fe(e.routes,`routes`),...fe(e.namedRoutes,`namedRoutes`)]}function F(e,t){return!t||e.startsWith(`/`)?p(e,``):p(`${o(t)}/${e}`,``)}function me(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function he(e){let t=[];for(let n of e)!n||t.includes(n)||t.push(n);return t}function ge(e){if(e.length!==0)return e.length===1?o(e[0]):e.map(e=>o(e))}function I(e,t,n,r=[],i,a=`namedRoutes`,s=new Set){let c=[];for(let[l,u]of e.entries()){let e=`${a}[${l}]`;if(s.has(u)){M(`ignored route record at ${e}: detected circular children reference`);continue}if(typeof u.path!=`string`||!u.path){M(`ignored route record "${typeof(u==null?void 0:u.name)==`string`?u.name.trim():``}" at ${e}: route path is required`);continue}let d=F(u.path,t),f=ue(u,d,i);if(!f){M(`ignored route record at ${e}: route name is required`);continue}let p=[],m=new Map;for(let n of me(u.alias)){let r=F(n,t);if(!r)continue;if(r===d){M(`ignored alias "${o(r)}" for route "${f}" at ${e}: alias is same as route path`);continue}let i=m.get(r);if(i){M(`ignored duplicate alias "${o(r)}" for route "${f}" at ${e}: already declared by "${i}"`);continue}m.set(r,n),p.push(r)}let h=u.path.startsWith(`/`)?[]:r.map(e=>F(u.path,e)).filter(Boolean).filter(e=>e!==d),g=he([...p,...h]),_={name:f,path:d?o(d):`/`,alias:ge(g),meta:u.meta,beforeEnter:u.beforeEnter,redirect:u.redirect};if(c.push({route:_,parentName:n,source:i}),Array.isArray(u.children)&&u.children.length>0){let t=new Set(s);t.add(u),c.push(...I(u.children,d,f,g,i,`${e}.children`,t))}}return c}function L(e){let t=new Map;for(let[n,r]of e.entries()){!s(r.path)&&!t.has(r.path)&&t.set(r.path,n);for(let e of r.aliasPaths)!s(e)&&!t.has(e)&&t.set(e,n)}return t}function _e(e){let t=new Map;for(let n of e){let e=P(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:L(t)}}function R(e){if(e)return{...e}}function ve(e){let t={name:e.name,path:e.path};return e.meta!==void 0&&(t.meta=R(e.meta)),Array.isArray(e.alias)?t.alias=Object.freeze(e.alias.slice()):e.alias!==void 0&&(t.alias=e.alias),Array.isArray(e.beforeEnter)?t.beforeEnter=Object.freeze(e.beforeEnter.slice()):e.beforeEnter!==void 0&&(t.beforeEnter=e.beforeEnter),e.redirect!==void 0&&(t.redirect=e.redirect),Object.freeze(t)}function ye(e,t,n,r,i,a){let s=Object.freeze(e.map(e=>o(e))),c=Object.freeze(t.map(ve));return Object.freeze({tabBarEntries:s,routes:c,namedRoutes:c,paramsMode:n,maxRedirects:r,parseQuery:i.parseQuery,stringifyQuery:i.stringifyQuery,rejectOnError:a})}function be(e,t){let n={name:e.name,path:o(e.path)},r=typeof t==`string`&&t?o(p(t,``)):void 0;return r&&r!==n.path&&(n.aliasPath=r),e.meta!==void 0&&(n.meta=R(e.meta)),n}function z(e){if(e)return e.map(e=>({name:e.name,path:e.path,aliasPath:e.aliasPath,meta:R(e.meta)}))}function B(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function V(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function xe(e){if(!e)return;let t={path:e.path,fullPath:e.fullPath,query:B(e.query),hash:e.hash,params:V(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=R(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=z(e.matched)),t}function Se(e){let t={path:e.path,fullPath:e.fullPath,query:B(e.query),hash:e.hash,params:V(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=R(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=z(e.matched)),t}function H(e){let t={path:e.path,fullPath:e.fullPath,query:B(e.query),hash:e.hash,params:V(e.params)};return e.meta!==void 0&&(t.meta=R(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=z(e.matched)),e.redirectedFrom!==void 0&&(t.redirectedFrom=xe(e.redirectedFrom)),e.name!==void 0&&(t.name=e.name),t}function U(e,t=_){let n=o(e.path),r=t(e.query);return r?`${n}?${r}`:n}function Ce(e){return Object.keys(e).length>0}const we=Symbol(`wevu.router.instance`);let Te;function W(e){Te=e,y(we,e)}function Ee(){var e;return(e=Te)==null?c(we,void 0):e}const G={unknown:1,aborted:4,cancelled:8,duplicated:16},De=/already|same|duplicat|重复/,Oe=/cancel|取消/,ke=/abort|interrupt|中断/;function Ae(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function K(e){let t=Ae(e).toLowerCase();return De.test(t)?G.duplicated:Oe.test(t)?G.cancelled:ke.test(t)?G.aborted:G.unknown}function q(e,t,n,r){let i=Ae(r)||`Navigation failed`,a=Error(i);return a.__wevuNavigationFailure=!0,a.type=e,a.to=t,a.from=n,a.cause=r,a}function J(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0?!0:n.type===t:!1}function je(e){return!e||typeof e!=`object`?!1:`to`in e}function Me(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function Y(e,t,n){for(let r of e)try{let e=await r(t.to,t.from,t);if(J(e))return{status:`failure`,failure:e};if(e===!1)return{status:`failure`,failure:q(G.aborted,t.to,t.from,`Navigation aborted by guard`)};if(je(e))return t.to?{status:`redirect`,target:n(e.to,t.to.path),replace:e.replace}:{status:`failure`,failure:q(G.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)};if(Me(e))return t.to?{status:`redirect`,target:n(e,t.to.path)}:{status:`failure`,failure:q(G.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)}}catch(e){return{status:`failure`,failure:q(G.aborted,t.to,t.from,e)}}return{status:`continue`}}function X(e,t,n,r){return new Promise(i=>{let a=!1,o=e=>{a||(a=!0,i(e))};try{let i=e({...t,success:()=>o(),fail:e=>{o(q(K(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>o(),e=>o(q(K(e),n,r,e)))}catch(e){o(q(K(e),n,r,e))}})}async function Ne(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch(e){}}async function Pe(e,t,n){for(let r of e)try{await r(t,n)}catch(e){}}function Fe(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function Ie(e){return e.type===G.unknown||e.cause instanceof Error?!0:e.type===G.aborted&&e.cause!==void 0?!(typeof e.cause==`string`||Fe(e.cause)):!1}function Z(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function Le(e){let{afterEachHooks:t,errorHandlers:n,nativeRouter:r,rejectOnError:i}=e;async function a(e){if(await Ne(t,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure}),e.failure&&Ie(e.failure)){var i;await Pe(n,(i=e.failure.cause)==null?e.failure:i,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure})}}function o(e){return i&&Ie(e)}async function s(e){if(await a(e),e.failure&&o(e.failure))throw e.failure;return e.failure}return{settleNavigationResult:s}}function Re(e,t){return q(G.duplicated,e,t,`Avoided redundant navigation to current location`)}function ze(e,t){return q(G.aborted,e,t,`switchTab does not support query parameters`)}function Q(e,t,n){return q(G.aborted,e,t,`Navigation redirected more than ${n} times`)}function Be(e,t){return q(G.aborted,e,t,`Hash-only navigation is not supported in mini-program router`)}function Ve(e){return q(G.aborted,void 0,e,`Forward navigation is not supported in mini-program router`)}function $(e,t){e.redirectedFrom=t.redirectedFrom?xe(t.redirectedFrom):Se(t)}async function He(e,t,n,r){let i=typeof e==`function`?await e(t,n):e;return je(i)?{target:r(i.to,t.path),replace:i.replace}:{target:r(i,t.path),replace:!0}}async function Ue(e){let{mode:t,target:n,from:r,nativeRouter:i,routeResolveCodec:a,namedRouteLookup:s,beforeEachGuards:c,beforeResolveGuards:l,maxRedirects:u,tabBarPathSet:d,resolveWithCodec:f}=e,p=n,m=t,h=0;for(;;){var g;let e=d.has(p.path);if(U(p,a.stringifyQuery)===U(r,a.stringifyQuery)&&p.hash!==r.hash)return Z(m,r,p,Be(p,r));if(e?p.path===r.path:p.fullPath===r.fullPath)return Z(m,r,p,Re(p,r));if(e&&Ce(p.query))return Z(m,r,p,ze(p,r));let t=await Y(c,{mode:m,to:p,from:r,nativeRouter:i},f);if(t.status===`failure`)return Z(m,r,p,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||n!==m){if($(e,p),p=e,m=n,h+=1,h>u)return Z(m,r,p,Q(p,r,u));continue}}let n=ae(p,s),_=(g=n==null?void 0:n.matchedRecords)==null?[]:g,v=!1;for(let e of _){if(e.redirect===void 0)continue;let t;try{t=await He(e.redirect,p,r,f)}catch(e){return Z(m,r,p,q(G.aborted,p,r,e))}let n=t.replace===!1?`push`:`replace`,i=t.target;if(i.fullPath!==p.fullPath||n!==m){if($(i,p),p=i,m=n,h+=1,h>u)return Z(m,r,p,Q(p,r,u));v=!0;break}}if(v)continue;let y=!1;for(let e of _){if(e.beforeEnterGuards.length===0)continue;let t=await Y(new Set(e.beforeEnterGuards),{mode:m,to:p,from:r,nativeRouter:i},f);if(t.status===`failure`)return Z(m,r,p,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||n!==m){if($(e,p),p=e,m=n,h+=1,h>u)return Z(m,r,p,Q(p,r,u));y=!0;break}}}if(y)continue;let b=await Y(l,{mode:m,to:p,from:r,nativeRouter:i},f);if(b.status===`failure`)return Z(m,r,p,b.failure);if(b.status===`redirect`){let e=b.target,t=b.replace===!0?`replace`:b.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||t!==m){if($(e,p),p=e,m=t,h+=1,h>u)return Z(m,r,p,Q(p,r,u));continue}}if(e){let e=await X(i.switchTab,{url:o(p.path)},p,r);return J(e)?Z(m,r,p,e):Z(m,r,p)}let x=await X(m===`push`?i.navigateTo:i.redirectTo,{url:U(p,a.stringifyQuery)},p,r);return J(x)?Z(m,r,p,x):Z(m,r,p)}}function We(e){let{nativeRouter:t,route:n,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l,settleNavigationResult:u}=e;async function d(e){let d=H(n),f;try{f=l(e,d.path)}catch(e){return u(Z(`push`,d,void 0,q(G.unknown,void 0,d,e)))}return u(await Ue({mode:`push`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l}))}async function f(e){let d=H(n),f;try{f=l(e,d.path)}catch(e){return u(Z(`replace`,d,void 0,q(G.unknown,void 0,d,e)))}return u(await Ue({mode:`replace`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l}))}async function p(e=1){let r=H(n),i=await Y(a,{mode:`back`,from:r,nativeRouter:t},l);if(i.status===`failure`)return u(Z(`back`,r,void 0,i.failure));if(i.status===`redirect`)return u(Z(`back`,r,void 0,q(G.aborted,void 0,r,`Redirect is not supported in back navigation guards`)));let s=await Y(o,{mode:`back`,from:r,nativeRouter:t},l);if(s.status===`failure`)return u(Z(`back`,r,void 0,s.failure));if(s.status===`redirect`)return u(Z(`back`,r,void 0,q(G.aborted,void 0,r,`Redirect is not supported in back navigation guards`)));let c=await X(t.navigateBack,{delta:e},void 0,r);return u(J(c)?Z(`back`,r,void 0,c):Z(`back`,r))}async function m(e){if(e<0)return p(Math.abs(e));if(e===0)return;let t=H(n);return u(Z(`back`,t,void 0,Ve(t)))}async function h(){return m(1)}return{push:d,replace:f,back:p,go:m,forward:h}}const Ge={parseQuery:u,stringifyQuery:_};function Ke(e,t=``,n=Ge){var r,i,o,s;if(typeof e==`string`){let r=l(e,n);return m(p(r.path,t),r.query,r.hash,void 0,{},n.stringifyQuery)}let c=typeof e.fullPath==`string`?l(e.fullPath,n):void 0;return m(p((r=(i=e.path)==null?c==null?void 0:c.path:i)==null?t:r,t),e.query?h(e.query):(o=c==null?void 0:c.query)==null?{}:o,f((s=e.hash)==null?c==null?void 0:c.hash:s),typeof e.name==`string`?e.name:void 0,e.params?a(e.params):{},n.stringifyQuery)}function qe(e){let t={name:e.name,path:e.path?`/${e.path}`:`/`};return e.meta!==void 0&&(t.meta=R(e.meta)),e.aliasPaths.length===1?t.alias=o(e.aliasPaths[0]):e.aliasPaths.length>1&&(t.alias=e.aliasPaths.map(e=>o(e))),e.beforeEnterGuards.length===1?t.beforeEnter=e.beforeEnterGuards[0]:e.beforeEnterGuards.length>1&&(t.beforeEnter=e.beforeEnterGuards.slice()),e.redirect!==void 0&&(t.redirect=e.redirect),t}function Je(e){let t=t=>e.recordByName.has(t),n=()=>Array.from(e.recordByName.values(),qe),r=((t,n)=>{let r=typeof t==`string`?n:t;if(!r)throw Error(`Route record is required when adding a child route`);se(r);let i=typeof t==`string`?t:void 0,a=i?e.recordByName.get(i):void 0;if(i&&!a)throw Error(`Parent route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let s=I([r],a==null?void 0:a.path,i,a==null?void 0:a.aliasPaths,void 0,`addRoute`);if(s.length===0)throw Error(`Route name and path are required when adding a named route`);let c=[];for(let t of s){let n=P(t.route,t.parentName);if(!n)continue;let r=e.recordByName.get(n.name);if(r){let t=A(r.name,e.recordByName);for(let n of t)e.recordByName.delete(n);M(`addRoute() replaced existing route "${n.name}" (${o(r.path)} -> ${o(n.path)}) and removed ${t.size-1} nested route(s)`)}e.recordByName.set(n.name,n),c.push(n)}return e.nameByStaticPath=L(e.recordByName),()=>{let t=!1;for(let n of c)e.recordByName.get(n.name)===n&&(e.recordByName.delete(n.name),t=!0);t&&(e.nameByStaticPath=L(e.recordByName))}});function i(t){let n=A(t,e.recordByName);if(n.size===0)return;let r=!1;for(let t of n)r=e.recordByName.delete(t)||r;r&&(e.nameByStaticPath=L(e.recordByName))}function a(){e.recordByName.clear(),e.nameByStaticPath.clear()}return{hasRoute:t,getRoutes:n,addRoute:r,removeRoute:i,clearRoutes:a}}function Ye(){if(!n())throw Error(`useRoute() 必须在 setup() 的同步阶段调用`);let a=i(),o=e({path:a.path,fullPath:a.fullPath,query:a.query,hash:a.hash,params:a.params,name:a.name});a.meta!==void 0&&(o.meta=a.meta);function s(e){let t=i(e);o.path=t.path,o.fullPath=t.fullPath,o.query=t.query,o.hash=t.hash,t.meta===void 0?delete o.meta:o.meta=t.meta,o.params=t.params,o.name=t.name}return t(e=>{s(e)}),r(()=>{s()}),b(()=>{s()}),v(o)}function Xe(){return d()}function Ze(){return g()}function Qe(e={}){var t,n,r,i,a,o;let s=Xe(),c=Ye(),l=new Set,d=new Set,f=new Set,m=new Set,h=(t=e.maxRedirects)==null?10:t,g=(n=e.paramsMode)==null?`loose`:n,v=(r=e.rejectOnError)==null?!0:r,y={parseQuery:(i=e.parseQuery)==null?u:i,stringifyQuery:(a=e.stringifyQuery)==null?_:a},b=Promise.resolve(),x=pe(e);ce(x);let S=_e(x),C=((o=e.tabBarEntries)==null?[]:o).map(e=>p(e,``)).filter(Boolean),w=new Set(C),T=Je(S),E=ye(C,T.getRoutes(),g,h,y,v);function D(e,t){let n=Ke(typeof e==`string`?e:te(e,S,g),t,y);n.href=n.fullPath;let r=ae(n,S);if(r){let e=r.record;n.name===void 0&&(n.name=e.name);let t=re(r.matchedRecords);t!==void 0&&(n.meta=R(t)),r.params&&Object.keys(n.params).length===0&&(n.params=V(r.params)),n.matched=r.matchedRecords.map((e,t,n)=>be(e,t===n.length-1?r.matchedPath:void 0))}else n.matched=[];return n}function ee(e){return D(e,c.path)}let O=We({nativeRouter:s,route:c,routeResolveCodec:y,namedRouteLookup:S,beforeEachGuards:l,beforeResolveGuards:d,maxRedirects:h,tabBarPathSet:w,resolveWithCodec:D,settleNavigationResult:Le({afterEachHooks:f,errorHandlers:m,nativeRouter:s,rejectOnError:v}).settleNavigationResult});function ne(e){return l.add(e),()=>{l.delete(e)}}function k(e){return d.add(e),()=>{d.delete(e)}}function A(e){return f.add(e),()=>{f.delete(e)}}function ie(e){return m.add(e),()=>{m.delete(e)}}let j={nativeRouter:s,options:E,currentRoute:c,install(e){var t;W(j);let n=e==null||(t=e.config)==null?void 0:t.globalProperties;n&&(n.$router=j)},resolve:ee,isReady(){return b},push:O.push,replace:O.replace,back:O.back,go:O.go,forward:O.forward,hasRoute:T.hasRoute,getRoutes:T.getRoutes,addRoute:T.addRoute,removeRoute:T.removeRoute,clearRoutes:T.clearRoutes,beforeEach:ne,beforeResolve:k,afterEach:A,onError:ie};return W(j),j}function $e(){let e=Ee();if(e)return e;throw Error(`useRouter() 未找到已创建的 router 实例。请先在 setup() 中调用 createRouter()。`)}export{G as NavigationFailureType,q as createNavigationFailure,Qe as createRouter,J as isNavigationFailure,u as parseQuery,Ke as resolveRouteLocation,_ as stringifyQuery,Ze as useNativePageRouter,Xe as useNativeRouter,Ye as useRoute,$e as useRouter};
|
|
1
|
+
import{d as e}from"./ref-Bs--7iY3.mjs";import{A as t,Q as n,U as r,a as i,c as a,d as o,f as s,g as c,i as l,l as u,n as d,o as f,p,r as m,s as h,t as g,u as _,ut as v,v as y,z as b}from"./router-BtpVtHM4.mjs";const x=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function S(e){var t;let n=x.exec(e);if(n)return{key:n[1],modifier:(t=n[2])==null?``:t}}function C(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function w(e){return encodeURIComponent(e)}function T(e){try{return decodeURIComponent(e)}catch(t){return e}}function E(e,t,n){let r=[],i=new Set;for(let a of e.split(`/`)){if(!a)continue;let e=S(a);if(!e){r.push(a);continue}let o=C(t[e.key]);if(e.modifier===``){if(o.length!==1)throw Error(`Missing required param "${e.key}" for named route "${n}"`);i.add(e.key),r.push(w(o[0]));continue}if(e.modifier===`?`){if(o.length===0)continue;if(o.length>1)throw Error(`Param "${e.key}" for named route "${n}" must be a single value`);i.add(e.key),r.push(w(o[0]));continue}if(e.modifier===`+`){if(o.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${n}"`);i.add(e.key);for(let e of o)r.push(w(e));continue}o.length>0&&i.add(e.key);for(let e of o)r.push(w(e))}return{path:r.join(`/`),consumedKeys:i}}function D(e){return e===void 0?!1:Array.isArray(e)?e.length>0:!0}function ee(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>D(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function te(e,t,n){let r=e.name;if(typeof r!=`string`||!r||e.path!==void 0||e.fullPath!==void 0)return e;let i=t.recordByName.get(r);if(!i)throw Error(`Named route "${r}" is not defined in createRouter({ routes | namedRoutes })`);let o=e.params?a(e.params):{},s=E(i.path,o,r);return n===`strict`&&ee(o,s.consumedKeys,r),{...e,path:s.path?`/${s.path}`:`/`,params:o}}function O(e){return e.split(`/`).filter(Boolean)}function ne(e){return[e.path,...e.aliasPaths]}function k(e,t){let n=[],r=new Set,i=e;for(;i&&!(r.has(i.name)||(r.add(i.name),n.unshift(i),!i.parentName));)i=t.recordByName.get(i.parentName);return n}function re(e){let t;for(let n of e)n.meta&&(t||(t={}),Object.assign(t,n.meta));return t}function A(e,t){let n=new Set;if(!t.has(e))return n;n.add(e);let r=!0;for(;r;){r=!1;for(let[e,i]of t.entries())!i.parentName||n.has(e)||n.has(i.parentName)&&(n.add(e),r=!0)}return n}function j(e){let t={};for(let[n,r]of e.entries())r.length!==0&&(t[n]=r.length===1?r[0]:r);return t}function M(e,t){let n=O(e),r=O(t),i=new Map,a=(e,t)=>{let n=i.get(e);if(n){n.push(t);return}i.set(e,[t])},o=e=>{let t=i.get(e);!t||t.length===0||(t.pop(),t.length===0&&i.delete(e))},s=(e,t,n)=>{for(let i=0;i<n;i+=1)a(e,T(r[t+i]));return()=>{for(let t=0;t<n;t+=1)o(e)}},c=(e,t)=>{if(e>=n.length)return t>=r.length;let i=n[e],l=S(i);if(!l)return t>=r.length||i!==r[t]?!1:c(e+1,t+1);if(l.modifier===``){if(t>=r.length)return!1;a(l.key,T(r[t]));let n=c(e+1,t+1);return n||o(l.key),n}if(l.modifier===`?`){if(t<r.length){if(a(l.key,T(r[t])),c(e+1,t+1))return!0;o(l.key)}return c(e+1,t)}let u=+(l.modifier===`+`),d=r.length-t;for(let n=d;n>=u;--n){let r=s(l.key,t,n);if(c(e+1,t+n))return!0;r()}return!1};if(c(0,0))return j(i)}function ie(e,t){if(e.name){let n=t.recordByName.get(e.name);if(n)return{record:n,matchedRecords:k(n,t)}}let n=t.nameByStaticPath.get(e.path);if(n){let r=t.recordByName.get(n);if(r)return{record:r,matchedRecords:k(r,t),matchedPath:e.path}}for(let n of t.recordByName.values())for(let r of ne(n)){if(!s(r))continue;let i=M(r,e.path);if(i)return{record:n,matchedRecords:k(n,t),matchedPath:r,params:i}}}function N(e){typeof console>`u`||typeof console.warn!=`function`||console.warn(`[wevu/router] ${e}`)}function ae(e){let t=p(e,``);return t?o(t):`/`}function oe(e,t=new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(oe(t,n))return!0;return!1}function se(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(oe(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function ce(e){let t=new Map,n=[];for(let i of e){var r;let e=typeof i.route.name==`string`?i.route.name.trim():``;if(!e)continue;let a=(r=i.source)==null?`namedRoutes`:r,o=ae(i.route.path),s=t.get(e);s&&n.push(`"${e}" (${s.source}:${s.path} -> ${a}:${o})`),t.set(e,{source:a,path:o})}n.length!==0&&N(`duplicate route names detected, later entries override earlier ones: ${n.join(`, `)}`)}function le(e){return e?Array.isArray(e)?e:[e]:[]}function ue(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function de(e,t){if(!e)return[];let n=Array.isArray(e)?e:[e],r=[];for(let e of n){if(typeof e!=`string`)continue;let n=p(e,``);!n||n===t||r.includes(n)||r.push(n)}return r}function fe(e,t,n=`namedRoutes`){let r=p(e.path,``);if(!r&&e.path!==`/`)return;let i=ue(e,r,n);if(i)return{name:i,path:r,aliasPaths:de(e.alias,r),parentName:t,meta:e.meta,beforeEnterGuards:le(e.beforeEnter),redirect:e.redirect}}function P(e,t){return!t||e.startsWith(`/`)?p(e,``):p(`${o(t)}/${e}`,``)}function pe(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function me(e){let t=[];for(let n of e)!n||t.includes(n)||t.push(n);return t}function he(e){if(e.length!==0)return e.length===1?o(e[0]):e.map(e=>o(e))}function F(e,t,n,r=[],i,a=`namedRoutes`,s=new Set){let c=[];for(let[l,u]of e.entries()){let e=`${a}[${l}]`;if(s.has(u)){N(`ignored route record at ${e}: detected circular children reference`);continue}if(typeof u.path!=`string`||!u.path){N(`ignored route record "${typeof(u==null?void 0:u.name)==`string`?u.name.trim():``}" at ${e}: route path is required`);continue}let d=P(u.path,t),f=ue(u,d,i);if(!f){N(`ignored route record at ${e}: route name is required`);continue}let p=[],m=new Map;for(let n of pe(u.alias)){let r=P(n,t);if(!r)continue;if(r===d){N(`ignored alias "${o(r)}" for route "${f}" at ${e}: alias is same as route path`);continue}let i=m.get(r);if(i){N(`ignored duplicate alias "${o(r)}" for route "${f}" at ${e}: already declared by "${i}"`);continue}m.set(r,n),p.push(r)}let h=u.path.startsWith(`/`)?[]:r.map(e=>P(u.path,e)).filter(Boolean).filter(e=>e!==d),g=me([...p,...h]),_={name:f,path:d?o(d):`/`,alias:he(g),meta:u.meta,beforeEnter:u.beforeEnter,redirect:u.redirect};if(c.push({route:_,parentName:n,source:i}),Array.isArray(u.children)&&u.children.length>0){let t=new Set(s);t.add(u),c.push(...F(u.children,d,f,g,i,`${e}.children`,t))}}return c}function I(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return F(e,void 0,void 0,[],t,t);let n=[];for(let[r,i]of Object.entries(e)){let e=typeof r==`string`?r.trim():``;if(!e){N(`ignored route record at ${t}: route name is required`);continue}if(typeof i!=`string`||!i){N(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:i},source:t})}return n}function ge(e){return[...I(e.routes,`routes`),...I(e.namedRoutes,`namedRoutes`)]}function L(e){let t=new Map;for(let[n,r]of e.entries()){!s(r.path)&&!t.has(r.path)&&t.set(r.path,n);for(let e of r.aliasPaths)!s(e)&&!t.has(e)&&t.set(e,n)}return t}function _e(e){let t=new Map;for(let n of e){let e=fe(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:L(t)}}function R(e){if(e)return{...e}}function ve(e){let t={name:e.name,path:e.path};return e.meta!==void 0&&(t.meta=R(e.meta)),Array.isArray(e.alias)?t.alias=Object.freeze(e.alias.slice()):e.alias!==void 0&&(t.alias=e.alias),Array.isArray(e.beforeEnter)?t.beforeEnter=Object.freeze(e.beforeEnter.slice()):e.beforeEnter!==void 0&&(t.beforeEnter=e.beforeEnter),e.redirect!==void 0&&(t.redirect=e.redirect),Object.freeze(t)}function ye(e,t,n,r,i,a){let s=Object.freeze(e.map(e=>o(e))),c=Object.freeze(t.map(ve));return Object.freeze({tabBarEntries:s,routes:c,namedRoutes:c,paramsMode:n,maxRedirects:r,parseQuery:i.parseQuery,stringifyQuery:i.stringifyQuery,rejectOnError:a})}function be(e,t){let n={name:e.name,path:o(e.path)},r=typeof t==`string`&&t?o(p(t,``)):void 0;return r&&r!==n.path&&(n.aliasPath=r),e.meta!==void 0&&(n.meta=R(e.meta)),n}function z(e){if(e)return e.map(e=>({name:e.name,path:e.path,aliasPath:e.aliasPath,meta:R(e.meta)}))}function B(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function V(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function xe(e){if(!e)return;let t={path:e.path,fullPath:e.fullPath,query:B(e.query),hash:e.hash,params:V(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=R(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=z(e.matched)),t}function Se(e){let t={path:e.path,fullPath:e.fullPath,query:B(e.query),hash:e.hash,params:V(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=R(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=z(e.matched)),t}function H(e){let t={path:e.path,fullPath:e.fullPath,query:B(e.query),hash:e.hash,params:V(e.params)};return e.meta!==void 0&&(t.meta=R(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=z(e.matched)),e.redirectedFrom!==void 0&&(t.redirectedFrom=xe(e.redirectedFrom)),e.name!==void 0&&(t.name=e.name),t}function U(e,t=_){let n=o(e.path),r=t(e.query);return r?`${n}?${r}`:n}function Ce(e){return Object.keys(e).length>0}const we=Symbol(`wevu.router.instance`);let Te;function Ee(e){Te=e,y(we,e)}function De(){var e;return(e=Te)==null?c(we,void 0):e}const W={unknown:1,aborted:4,cancelled:8,duplicated:16},Oe=/already|same|duplicat|重复/,ke=/cancel|取消/,Ae=/abort|interrupt|中断/;function je(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function G(e){let t=je(e).toLowerCase();return Oe.test(t)?W.duplicated:ke.test(t)?W.cancelled:Ae.test(t)?W.aborted:W.unknown}function K(e,t,n,r){let i=je(r)||`Navigation failed`,a=Error(i);return a.__wevuNavigationFailure=!0,a.type=e,a.to=t,a.from=n,a.cause=r,a}function q(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0?!0:n.type===t:!1}function Me(e){return!e||typeof e!=`object`?!1:`to`in e}function Ne(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function J(e,t,n){for(let r of e)try{let e=await r(t.to,t.from,t);if(q(e))return{status:`failure`,failure:e};if(e===!1)return{status:`failure`,failure:K(W.aborted,t.to,t.from,`Navigation aborted by guard`)};if(Me(e))return t.to?{status:`redirect`,target:n(e.to,t.to.path),replace:e.replace}:{status:`failure`,failure:K(W.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)};if(Ne(e))return t.to?{status:`redirect`,target:n(e,t.to.path)}:{status:`failure`,failure:K(W.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)}}catch(e){return{status:`failure`,failure:K(W.aborted,t.to,t.from,e)}}return{status:`continue`}}function Y(e,t,n,r){return new Promise(i=>{let a=!1,o=e=>{a||(a=!0,i(e))};try{let i=e({...t,success:()=>o(),fail:e=>{o(K(G(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>o(),e=>o(K(G(e),n,r,e)))}catch(e){o(K(G(e),n,r,e))}})}async function Pe(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch(e){}}async function Fe(e,t,n){for(let r of e)try{await r(t,n)}catch(e){}}function Ie(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function Le(e){return e.type===W.unknown||e.cause instanceof Error?!0:e.type===W.aborted&&e.cause!==void 0?!(typeof e.cause==`string`||Ie(e.cause)):!1}function X(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function Re(e){let{afterEachHooks:t,errorHandlers:n,nativeRouter:r,rejectOnError:i}=e;async function a(e){if(await Pe(t,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure}),e.failure&&Le(e.failure)){var i;await Fe(n,(i=e.failure.cause)==null?e.failure:i,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure})}}function o(e){return i&&Le(e)}async function s(e){if(await a(e),e.failure&&o(e.failure))throw e.failure;return e.failure}return{settleNavigationResult:s}}function ze(e,t){return K(W.duplicated,e,t,`Avoided redundant navigation to current location`)}function Be(e,t){return K(W.aborted,e,t,`switchTab does not support query parameters`)}function Z(e,t,n){return K(W.aborted,e,t,`Navigation redirected more than ${n} times`)}function Ve(e,t){return K(W.aborted,e,t,`Hash-only navigation is not supported in mini-program router`)}function He(e){return K(W.aborted,void 0,e,`Forward navigation is not supported in mini-program router`)}function Q(e,t){e.redirectedFrom=t.redirectedFrom?xe(t.redirectedFrom):Se(t)}async function Ue(e,t,n,r){let i=typeof e==`function`?await e(t,n):e;return Me(i)?{target:r(i.to,t.path),replace:i.replace}:{target:r(i,t.path),replace:!0}}async function We(e){let{mode:t,target:n,from:r,nativeRouter:i,routeResolveCodec:a,namedRouteLookup:s,beforeEachGuards:c,beforeResolveGuards:l,maxRedirects:u,tabBarPathSet:d,resolveWithCodec:f}=e,p=n,m=t,h=0;for(;;){var g;let e=d.has(p.path);if(U(p,a.stringifyQuery)===U(r,a.stringifyQuery)&&p.hash!==r.hash)return X(m,r,p,Ve(p,r));if(e?p.path===r.path:p.fullPath===r.fullPath)return X(m,r,p,ze(p,r));if(e&&Ce(p.query))return X(m,r,p,Be(p,r));let t=await J(c,{mode:m,to:p,from:r,nativeRouter:i},f);if(t.status===`failure`)return X(m,r,p,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||n!==m){if(Q(e,p),p=e,m=n,h+=1,h>u)return X(m,r,p,Z(p,r,u));continue}}let n=ie(p,s),_=(g=n==null?void 0:n.matchedRecords)==null?[]:g,v=!1;for(let e of _){if(e.redirect===void 0)continue;let t;try{t=await Ue(e.redirect,p,r,f)}catch(e){return X(m,r,p,K(W.aborted,p,r,e))}let n=t.replace===!1?`push`:`replace`,i=t.target;if(i.fullPath!==p.fullPath||n!==m){if(Q(i,p),p=i,m=n,h+=1,h>u)return X(m,r,p,Z(p,r,u));v=!0;break}}if(v)continue;let y=!1;for(let e of _){if(e.beforeEnterGuards.length===0)continue;let t=await J(new Set(e.beforeEnterGuards),{mode:m,to:p,from:r,nativeRouter:i},f);if(t.status===`failure`)return X(m,r,p,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||n!==m){if(Q(e,p),p=e,m=n,h+=1,h>u)return X(m,r,p,Z(p,r,u));y=!0;break}}}if(y)continue;let b=await J(l,{mode:m,to:p,from:r,nativeRouter:i},f);if(b.status===`failure`)return X(m,r,p,b.failure);if(b.status===`redirect`){let e=b.target,t=b.replace===!0?`replace`:b.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||t!==m){if(Q(e,p),p=e,m=t,h+=1,h>u)return X(m,r,p,Z(p,r,u));continue}}if(e){let e=await Y(i.switchTab,{url:o(p.path)},p,r);return q(e)?X(m,r,p,e):X(m,r,p)}let x=await Y(m===`push`?i.navigateTo:i.redirectTo,{url:U(p,a.stringifyQuery)},p,r);return q(x)?X(m,r,p,x):X(m,r,p)}}function Ge(e){let{nativeRouter:t,route:n,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l,settleNavigationResult:u}=e;async function d(e){let d=H(n),f;try{f=l(e,d.path)}catch(e){return u(X(`push`,d,void 0,K(W.unknown,void 0,d,e)))}return u(await We({mode:`push`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l}))}async function f(e){let d=H(n),f;try{f=l(e,d.path)}catch(e){return u(X(`replace`,d,void 0,K(W.unknown,void 0,d,e)))}return u(await We({mode:`replace`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l}))}async function p(e=1){let r=H(n),i=await J(a,{mode:`back`,from:r,nativeRouter:t},l);if(i.status===`failure`)return u(X(`back`,r,void 0,i.failure));if(i.status===`redirect`)return u(X(`back`,r,void 0,K(W.aborted,void 0,r,`Redirect is not supported in back navigation guards`)));let s=await J(o,{mode:`back`,from:r,nativeRouter:t},l);if(s.status===`failure`)return u(X(`back`,r,void 0,s.failure));if(s.status===`redirect`)return u(X(`back`,r,void 0,K(W.aborted,void 0,r,`Redirect is not supported in back navigation guards`)));let c=await Y(t.navigateBack,{delta:e},void 0,r);return u(q(c)?X(`back`,r,void 0,c):X(`back`,r))}async function m(e){if(e<0)return p(Math.abs(e));if(e===0)return;let t=H(n);return u(X(`back`,t,void 0,He(t)))}async function h(){return m(1)}return{push:d,replace:f,back:p,go:m,forward:h}}const Ke={parseQuery:u,stringifyQuery:_};function qe(e,t=``,n=Ke){var r,i,o,s;if(typeof e==`string`){let r=l(e,n);return m(p(r.path,t),r.query,r.hash,void 0,{},n.stringifyQuery)}let c=typeof e.fullPath==`string`?l(e.fullPath,n):void 0;return m(p((r=(i=e.path)==null?c==null?void 0:c.path:i)==null?t:r,t),e.query?h(e.query):(o=c==null?void 0:c.query)==null?{}:o,f((s=e.hash)==null?c==null?void 0:c.hash:s),typeof e.name==`string`?e.name:void 0,e.params?a(e.params):{},n.stringifyQuery)}function Je(e){let t={name:e.name,path:e.path?`/${e.path}`:`/`};return e.meta!==void 0&&(t.meta=R(e.meta)),e.aliasPaths.length===1?t.alias=o(e.aliasPaths[0]):e.aliasPaths.length>1&&(t.alias=e.aliasPaths.map(e=>o(e))),e.beforeEnterGuards.length===1?t.beforeEnter=e.beforeEnterGuards[0]:e.beforeEnterGuards.length>1&&(t.beforeEnter=e.beforeEnterGuards.slice()),e.redirect!==void 0&&(t.redirect=e.redirect),t}function Ye(e){let t=t=>e.recordByName.has(t),n=()=>Array.from(e.recordByName.values(),Je),r=((t,n)=>{let r=typeof t==`string`?n:t;if(!r)throw Error(`Route record is required when adding a child route`);se(r);let i=typeof t==`string`?t:void 0,a=i?e.recordByName.get(i):void 0;if(i&&!a)throw Error(`Parent route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let s=F([r],a==null?void 0:a.path,i,a==null?void 0:a.aliasPaths,void 0,`addRoute`);if(s.length===0)throw Error(`Route name and path are required when adding a named route`);let c=[];for(let t of s){let n=fe(t.route,t.parentName);if(!n)continue;let r=e.recordByName.get(n.name);if(r){let t=A(r.name,e.recordByName);for(let n of t)e.recordByName.delete(n);N(`addRoute() replaced existing route "${n.name}" (${o(r.path)} -> ${o(n.path)}) and removed ${t.size-1} nested route(s)`)}e.recordByName.set(n.name,n),c.push(n)}return e.nameByStaticPath=L(e.recordByName),()=>{let t=!1;for(let n of c)e.recordByName.get(n.name)===n&&(e.recordByName.delete(n.name),t=!0);t&&(e.nameByStaticPath=L(e.recordByName))}});function i(t){let n=A(t,e.recordByName);if(n.size===0)return;let r=!1;for(let t of n)r=e.recordByName.delete(t)||r;r&&(e.nameByStaticPath=L(e.recordByName))}function a(){e.recordByName.clear(),e.nameByStaticPath.clear()}return{hasRoute:t,getRoutes:n,addRoute:r,removeRoute:i,clearRoutes:a}}function Xe(){if(!n())throw Error(`useRoute() 必须在 setup() 的同步阶段调用`);let a=i(),o=e({path:a.path,fullPath:a.fullPath,query:a.query,hash:a.hash,params:a.params,name:a.name});a.meta!==void 0&&(o.meta=a.meta);function s(e){let t=i(e);o.path=t.path,o.fullPath=t.fullPath,o.query=t.query,o.hash=t.hash,t.meta===void 0?delete o.meta:o.meta=t.meta,o.params=t.params,o.name=t.name}return t(e=>{s(e)}),r(()=>{s()}),b(()=>{s()}),v(o)}function $(){return d()}function Ze(){return g()}function Qe(e={}){var t,n,r,i,a,o;let s=$(),c=Xe(),l=new Set,d=new Set,f=new Set,m=new Set,h=(t=e.maxRedirects)==null?10:t,g=(n=e.paramsMode)==null?`loose`:n,v=(r=e.rejectOnError)==null?!0:r,y={parseQuery:(i=e.parseQuery)==null?u:i,stringifyQuery:(a=e.stringifyQuery)==null?_:a},b=Promise.resolve(),x=ge(e);ce(x);let S=_e(x),C=((o=e.tabBarEntries)==null?[]:o).map(e=>p(e,``)).filter(Boolean),w=new Set(C),T=Ye(S),E=ye(C,T.getRoutes(),g,h,y,v);function D(e,t){let n=qe(typeof e==`string`?e:te(e,S,g),t,y);n.href=n.fullPath;let r=ie(n,S);if(r){let e=r.record;n.name===void 0&&(n.name=e.name);let t=re(r.matchedRecords);t!==void 0&&(n.meta=R(t)),r.params&&Object.keys(n.params).length===0&&(n.params=V(r.params)),n.matched=r.matchedRecords.map((e,t,n)=>be(e,t===n.length-1?r.matchedPath:void 0))}else n.matched=[];return n}function ee(e){return D(e,c.path)}let O=Ge({nativeRouter:s,route:c,routeResolveCodec:y,namedRouteLookup:S,beforeEachGuards:l,beforeResolveGuards:d,maxRedirects:h,tabBarPathSet:w,resolveWithCodec:D,settleNavigationResult:Re({afterEachHooks:f,errorHandlers:m,nativeRouter:s,rejectOnError:v}).settleNavigationResult});function ne(e){return l.add(e),()=>{l.delete(e)}}function k(e){return d.add(e),()=>{d.delete(e)}}function A(e){return f.add(e),()=>{f.delete(e)}}function j(e){return m.add(e),()=>{m.delete(e)}}let M={nativeRouter:s,options:E,currentRoute:c,install(e){var t;Ee(M);let n=e==null||(t=e.config)==null?void 0:t.globalProperties;n&&(n.$router=M)},resolve:ee,isReady(){return b},push:O.push,replace:O.replace,back:O.back,go:O.go,forward:O.forward,hasRoute:T.hasRoute,getRoutes:T.getRoutes,addRoute:T.addRoute,removeRoute:T.removeRoute,clearRoutes:T.clearRoutes,beforeEach:ne,beforeResolve:k,afterEach:A,onError:j};return Ee(M),M}function $e(){let e=De();if(e)return e;throw Error(`useRouter() 未找到已创建的 router 实例。请先在 setup() 中调用 createRouter()。`)}export{W as NavigationFailureType,K as createNavigationFailure,Qe as createRouter,q as isNavigationFailure,u as parseQuery,qe as resolveRouteLocation,_ as stringifyQuery,Ze as useNativePageRouter,$ as useNativeRouter,Xe as useRoute,$e as useRouter};
|