wevu 7.1.4 → 7.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -6
- package/dist/dev/index.mjs +3 -2
- package/dist/dev/package.mjs +1 -1
- package/dist/dev/reactivity/computed.mjs +10 -1
- package/dist/dev/reactivity/computed.mjs.map +1 -1
- package/dist/dev/reactivity/reactive.mjs +27 -20
- package/dist/dev/reactivity/reactive.mjs.map +1 -1
- package/dist/dev/router/auto-routes.mjs +11 -0
- package/dist/dev/router/auto-routes.mjs.map +1 -0
- package/dist/dev/router/createRouter.mjs +3 -4
- package/dist/dev/router/createRouter.mjs.map +1 -1
- package/dist/dev/router/navigationCore.mjs +7 -7
- package/dist/dev/router/navigationCore.mjs.map +1 -1
- package/dist/dev/router/resolve.mjs.map +1 -1
- package/dist/dev/router/types.mjs.map +1 -1
- package/dist/dev/router/useRoute.mjs.map +1 -1
- package/dist/dev/router/useRouter.mjs.map +1 -1
- package/dist/dev/routerInternal/matching.mjs +1 -1
- package/dist/dev/routerInternal/matching.mjs.map +1 -1
- package/dist/dev/routerInternal/params.mjs.map +1 -1
- package/dist/dev/runtime/hooks/base.mjs +5 -5
- package/dist/dev/runtime/hooks/base.mjs.map +1 -1
- package/dist/dev/runtime/platform.mjs +31 -24
- package/dist/dev/runtime/platform.mjs.map +1 -1
- package/dist/dev/runtime/register/component/alipay.mjs +72 -0
- package/dist/dev/runtime/register/component/alipay.mjs.map +1 -0
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +5 -2
- package/dist/dev/runtime/register/component/registerNativeDefinition.mjs.map +1 -1
- package/dist/dev/store/actions.mjs +27 -29
- package/dist/dev/store/actions.mjs.map +1 -1
- package/dist/dev/store/base.mjs +152 -36
- package/dist/dev/store/base.mjs.map +1 -1
- package/dist/dev/store/define/create.mjs +92 -0
- package/dist/dev/store/define/create.mjs.map +1 -0
- package/dist/dev/store/define.mjs +11 -15
- package/dist/dev/store/define.mjs.map +1 -1
- package/dist/dev/store/manager.mjs +55 -14
- package/dist/dev/store/manager.mjs.map +1 -1
- package/dist/dev/store/storeToRefs.mjs +10 -18
- package/dist/dev/store/storeToRefs.mjs.map +1 -1
- package/dist/dev/store/subscriptions.mjs +17 -0
- package/dist/dev/store/subscriptions.mjs.map +1 -0
- package/dist/dev/store/types.mjs +11 -0
- package/dist/dev/store/types.mjs.map +1 -0
- package/dist/dev/store/utils.mjs +1 -37
- package/dist/dev/store/utils.mjs.map +1 -1
- package/dist/dev/store/view.mjs +56 -0
- package/dist/dev/store/view.mjs.map +1 -0
- package/dist/dev/store.mjs +3 -2
- package/dist/dev/vue-demi.mjs +3 -2
- package/dist/dev/vue-demi.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/reactivity/computed.d.mts +4 -0
- package/dist/reactivity/computed.mjs +1 -1
- package/dist/reactivity/reactive.mjs +1 -1
- package/dist/router/auto-routes.d.mts +7 -0
- package/dist/router/auto-routes.mjs +1 -0
- package/dist/router/createRouter.d.mts +2 -1
- package/dist/router/createRouter.mjs +1 -1
- package/dist/router/navigationCore.d.mts +3 -2
- package/dist/router/navigationCore.mjs +1 -1
- package/dist/router/resolve.d.mts +3 -2
- package/dist/router/routeSync.d.mts +1 -0
- package/dist/router/types.d.mts +173 -78
- package/dist/router/useRoute.d.mts +4 -3
- package/dist/router/useRouter.d.mts +2 -1
- package/dist/router.d.mts +18 -3
- package/dist/routerInternal/location.d.mts +2 -0
- package/dist/routerInternal/matching.d.mts +2 -0
- package/dist/routerInternal/matching.mjs +1 -1
- package/dist/routerInternal/params.d.mts +2 -0
- package/dist/routerInternal/records.d.mts +2 -0
- package/dist/routerInternal/recordsWarnings.d.mts +2 -0
- package/dist/routerInternal/shared.d.mts +9 -0
- package/dist/routerInternal/snapshots.d.mts +2 -0
- package/dist/runtime/hooks/base.mjs +1 -1
- package/dist/runtime/platform.mjs +1 -1
- package/dist/runtime/register/component/alipay.mjs +1 -0
- package/dist/runtime/register/component/registerNativeDefinition.mjs +1 -1
- package/dist/store/actions.mjs +1 -1
- package/dist/store/base.mjs +1 -1
- package/dist/store/define/create.mjs +1 -0
- package/dist/store/define.d.mts +5 -16
- package/dist/store/define.mjs +1 -1
- package/dist/store/manager.d.mts +13 -5
- package/dist/store/manager.mjs +1 -1
- package/dist/store/storeToRefs.d.mts +5 -7
- package/dist/store/storeToRefs.mjs +1 -1
- package/dist/store/subscriptions.mjs +1 -0
- package/dist/store/types.d.mts +85 -59
- package/dist/store/types.mjs +1 -0
- package/dist/store/utils.mjs +1 -1
- package/dist/store/view.mjs +1 -0
- package/dist/store.d.mts +3 -3
- package/dist/store.mjs +1 -1
- package/dist/vue-demi.d.mts +3 -3
- package/dist/vue-demi.mjs +1 -1
- package/package.json +29 -9
- package/dist/dev/api/vitest/setup.d.mts +0 -1
- package/dist/dev/api/vitest.d.mts +0 -1
- package/dist/dev/api.d.mts +0 -1
- package/dist/dev/compiler.d.mts +0 -1
- package/dist/dev/fetch.d.mts +0 -9
- package/dist/dev/index.d.mts +0 -72
- package/dist/dev/internal-reactivity.d.mts +0 -18
- package/dist/dev/internal-runtime.d.mts +0 -44
- package/dist/dev/internal-template.d.mts +0 -2
- package/dist/dev/jsxTypes.d.mts +0 -9
- package/dist/dev/macros/shared.d.mts +0 -83
- package/dist/dev/macros.d.mts +0 -71
- package/dist/dev/reactivity/asyncDerivation.d.mts +0 -41
- package/dist/dev/reactivity/computed.d.mts +0 -21
- package/dist/dev/reactivity/core.d.mts +0 -35
- package/dist/dev/reactivity/index.d.mts +0 -16
- package/dist/dev/reactivity/reactive/mutation.d.mts +0 -21
- package/dist/dev/reactivity/reactive/patch.d.mts +0 -18
- package/dist/dev/reactivity/reactive/shallow.d.mts +0 -22
- package/dist/dev/reactivity/reactive/shared.d.mts +0 -4
- package/dist/dev/reactivity/reactive.d.mts +0 -42
- package/dist/dev/reactivity/readonly.d.mts +0 -27
- package/dist/dev/reactivity/ref.d.mts +0 -27
- package/dist/dev/reactivity/shallowRef.d.mts +0 -19
- package/dist/dev/reactivity/toRefs.d.mts +0 -43
- package/dist/dev/reactivity/traverse.d.mts +0 -8
- package/dist/dev/reactivity/watch/types.d.mts +0 -43
- package/dist/dev/reactivity/watch.d.mts +0 -22
- package/dist/dev/router/createRouter.d.mts +0 -8
- package/dist/dev/router/navigationCore.d.mts +0 -6
- package/dist/dev/router/resolve.d.mts +0 -6
- package/dist/dev/router/routeSync.d.mts +0 -1
- package/dist/dev/router/types.d.mts +0 -172
- package/dist/dev/router/useRoute.d.mts +0 -19
- package/dist/dev/router/useRouter.d.mts +0 -8
- package/dist/dev/router.d.mts +0 -10
- package/dist/dev/routerInternal/query.d.mts +0 -7
- package/dist/dev/routerInternal/types.d.mts +0 -9
- package/dist/dev/runtime/app/pending.d.mts +0 -10
- package/dist/dev/runtime/app/setData/commitTracker.d.mts +0 -13
- package/dist/dev/runtime/app/setData/scheduler.d.mts +0 -51
- package/dist/dev/runtime/app.d.mts +0 -8
- package/dist/dev/runtime/capabilities.d.mts +0 -75
- package/dist/dev/runtime/css.d.mts +0 -14
- package/dist/dev/runtime/defaults.d.mts +0 -12
- package/dist/dev/runtime/define.d.mts +0 -118
- package/dist/dev/runtime/disposables.d.mts +0 -31
- package/dist/dev/runtime/elementIntersectionObserver.d.mts +0 -26
- package/dist/dev/runtime/features/inlineEvents.d.mts +0 -7
- package/dist/dev/runtime/features/layout.d.mts +0 -7
- package/dist/dev/runtime/features/patchStrategy.d.mts +0 -7
- package/dist/dev/runtime/features/publicLayout.d.mts +0 -24
- package/dist/dev/runtime/features/scopedSlots.d.mts +0 -23
- package/dist/dev/runtime/features/setDataHighFrequencyWarning.d.mts +0 -7
- package/dist/dev/runtime/features/templateRefs.d.mts +0 -7
- package/dist/dev/runtime/hooks/base.d.mts +0 -27
- package/dist/dev/runtime/hooks/register.d.mts +0 -30
- package/dist/dev/runtime/hooks/vue.d.mts +0 -52
- package/dist/dev/runtime/hooks.d.mts +0 -4
- package/dist/dev/runtime/index.d.mts +0 -46
- package/dist/dev/runtime/intersectionObserver.d.mts +0 -14
- package/dist/dev/runtime/jsxIsland.d.mts +0 -37
- package/dist/dev/runtime/layoutBridge.d.mts +0 -55
- package/dist/dev/runtime/noSetData.d.mts +0 -5
- package/dist/dev/runtime/pageEnvironment.d.mts +0 -50
- package/dist/dev/runtime/pageLayout.d.mts +0 -25
- package/dist/dev/runtime/pageScroll.d.mts +0 -29
- package/dist/dev/runtime/provide.d.mts +0 -60
- package/dist/dev/runtime/provideStore.d.mts +0 -7
- package/dist/dev/runtime/publicRuntime.d.mts +0 -22
- package/dist/dev/runtime/pullDownRefresh.d.mts +0 -12
- package/dist/dev/runtime/register/app.d.mts +0 -14
- package/dist/dev/runtime/register/component.d.mts +0 -17
- package/dist/dev/runtime/register/inline.d.mts +0 -15
- package/dist/dev/runtime/register/runtimeInstance.d.mts +0 -26
- package/dist/dev/runtime/register/setup.d.mts +0 -11
- package/dist/dev/runtime/register/watch.d.mts +0 -12
- package/dist/dev/runtime/register.d.mts +0 -5
- package/dist/dev/runtime/selectorQuery.d.mts +0 -54
- package/dist/dev/runtime/template.d.mts +0 -6
- package/dist/dev/runtime/templateRefTypes.d.mts +0 -12
- package/dist/dev/runtime/types/core.d.mts +0 -35
- package/dist/dev/runtime/types/miniprogram.d.mts +0 -84
- package/dist/dev/runtime/types/miniprogramHost.d.mts +0 -45
- package/dist/dev/runtime/types/miniprogramHostSources.d.mts +0 -112
- package/dist/dev/runtime/types/options.d.mts +0 -138
- package/dist/dev/runtime/types/props/propTypes.d.mts +0 -79
- package/dist/dev/runtime/types/props/router.d.mts +0 -51
- package/dist/dev/runtime/types/props/setup.d.mts +0 -96
- package/dist/dev/runtime/types/props.d.mts +0 -4
- package/dist/dev/runtime/types/runtime.d.mts +0 -59
- package/dist/dev/runtime/types/setData.d.mts +0 -237
- package/dist/dev/runtime/types.d.mts +0 -29
- package/dist/dev/runtime/uniAppHost.d.mts +0 -8
- package/dist/dev/runtime/updatePerformance.d.mts +0 -13
- package/dist/dev/runtime/use.d.mts +0 -13
- package/dist/dev/runtime/vueCompat/context.d.mts +0 -8
- package/dist/dev/runtime/vueCompat/model.d.mts +0 -30
- package/dist/dev/runtime/vueCompat/router.d.mts +0 -29
- package/dist/dev/runtime/vueCompat/templateRef.d.mts +0 -9
- package/dist/dev/runtime/vueCompat.d.mts +0 -5
- package/dist/dev/scheduler.d.mts +0 -4
- package/dist/dev/store/define/optionsStyle.mjs +0 -117
- package/dist/dev/store/define/optionsStyle.mjs.map +0 -1
- package/dist/dev/store/define/setupStyle.mjs +0 -137
- package/dist/dev/store/define/setupStyle.mjs.map +0 -1
- package/dist/dev/store/define/shared.mjs +0 -81
- package/dist/dev/store/define/shared.mjs.map +0 -1
- package/dist/dev/store/define.d.mts +0 -19
- package/dist/dev/store/manager.d.mts +0 -8
- package/dist/dev/store/storeToRefs.d.mts +0 -13
- package/dist/dev/store/types.d.mts +0 -80
- package/dist/dev/store.d.mts +0 -5
- package/dist/dev/version.d.mts +0 -4
- package/dist/dev/vue-augment.d.mts +0 -8
- package/dist/dev/vue-demi.d.mts +0 -87
- package/dist/dev/vue-types.d.mts +0 -19
- package/dist/dev/web-apis.d.mts +0 -3
- package/dist/store/define/optionsStyle.mjs +0 -1
- package/dist/store/define/setupStyle.mjs +0 -1
- package/dist/store/define/shared.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../src/store/utils.ts"],"sourcesContent":["export function isObject(val: unknown): val is object {\n return typeof val === 'object' && val !== null\n}\n\nexport function isPlainObject(val: unknown): val is Record<string, any> {\n if (!isObject(val)) {\n return false\n }\n const proto = Object.getPrototypeOf(val)\n return proto === Object.prototype || proto === null\n}\n
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../src/store/utils.ts"],"sourcesContent":["export function isObject(val: unknown): val is object {\n return typeof val === 'object' && val !== null\n}\n\nexport function isPlainObject(val: unknown): val is Record<string, any> {\n if (!isObject(val)) {\n return false\n }\n const proto = Object.getPrototypeOf(val)\n return proto === Object.prototype || proto === null\n}\n"],"mappings":";AAAA,SAAgB,SAAS,KAA6B;CACpD,OAAO,OAAO,QAAQ,YAAY,QAAQ;AAC5C;AAEA,SAAgB,cAAc,KAA0C;CACtE,IAAI,CAAC,SAAS,GAAG,GACf,OAAO;CAET,MAAM,QAAQ,OAAO,eAAe,GAAG;CACvC,OAAO,UAAU,OAAO,aAAa,UAAU;AACjD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { toRaw } from "../reactivity/reactive/shared.mjs";
|
|
2
|
+
import { isShallowReactive } from "../reactivity/reactive/shallow.mjs";
|
|
3
|
+
import { isReactive, reactive } from "../reactivity/reactive.mjs";
|
|
4
|
+
import { isRef } from "../reactivity/ref.mjs";
|
|
5
|
+
import { isPlainObject } from "./utils.mjs";
|
|
6
|
+
|
|
7
|
+
//#region src/store/view.ts
|
|
8
|
+
const views = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
/** 仅在 Store 边界解包 ref,所有读写仍转发到原始响应式来源。 */
|
|
10
|
+
function storeView(source) {
|
|
11
|
+
if (source["__r_skip"]) return source;
|
|
12
|
+
if (!isPlainObject(source) && !Array.isArray(source)) return source;
|
|
13
|
+
if (isReactive(source) && isShallowReactive(source)) return source;
|
|
14
|
+
const target = isReactive(source) ? source : reactive(source);
|
|
15
|
+
const cached = views.get(target);
|
|
16
|
+
if (cached) return cached;
|
|
17
|
+
const storeViewValue = (value) => isReactive(value) ? storeView(value) : value;
|
|
18
|
+
const view = new Proxy(target, {
|
|
19
|
+
get(object, key, receiver) {
|
|
20
|
+
const value = Reflect.get(object, key, receiver);
|
|
21
|
+
if (key === "__r_raw" || key === "__r_skip") return value;
|
|
22
|
+
if (isRef(value)) return Array.isArray(object) && typeof key === "string" && /^\d+$/.test(key) ? value : storeViewValue(value.value);
|
|
23
|
+
return storeViewValue(value);
|
|
24
|
+
},
|
|
25
|
+
set(object, key, value, receiver) {
|
|
26
|
+
const previous = Reflect.get(object, key, receiver);
|
|
27
|
+
if (isRef(previous) && !isRef(value) && !Array.isArray(object)) {
|
|
28
|
+
previous.value = value;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
return Reflect.set(object, key, value, receiver);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
views.set(target, view);
|
|
35
|
+
views.set(view, view);
|
|
36
|
+
return view;
|
|
37
|
+
}
|
|
38
|
+
/** 合并普通对象,数组替换;保留 ref 和已有响应式对象的写入语义。 */
|
|
39
|
+
function mergeState(target, patch) {
|
|
40
|
+
if (target instanceof Map && patch instanceof Map) patch.forEach((value, key) => target.set(key, value));
|
|
41
|
+
else if (target instanceof Set && patch instanceof Set) patch.forEach((value) => target.add(value));
|
|
42
|
+
for (const key of Object.keys(patch !== null && patch !== void 0 ? patch : {})) {
|
|
43
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") continue;
|
|
44
|
+
const value = patch[key];
|
|
45
|
+
if (isPlainObject(target[key]) && isPlainObject(value) && !isRef(value) && !isReactive(value)) mergeState(target[key], value);
|
|
46
|
+
else target[key] = value;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** 返回尚未解包的属性,供 storeToRefs 保留 state/getter 的来源。 */
|
|
50
|
+
function rawStore(store) {
|
|
51
|
+
return toRaw(store);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { mergeState, rawStore, storeView };
|
|
56
|
+
//# sourceMappingURL=view.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.mjs","names":[],"sources":["../../../src/store/view.ts"],"sourcesContent":["import { isReactive, isRef, isShallowReactive, reactive, toRaw } from '../reactivity'\nimport { ReactiveFlags } from '../reactivity/reactive/shared'\nimport { isPlainObject } from './utils'\n\nconst views = new WeakMap<object, any>()\n\n/** 仅在 Store 边界解包 ref,所有读写仍转发到原始响应式来源。 */\nexport function storeView<T extends object>(source: T): T {\n if ((source as any)[ReactiveFlags.SKIP]) {\n return source\n }\n if (!isPlainObject(source) && !Array.isArray(source)) {\n return source\n }\n if (isReactive(source) && isShallowReactive(source)) {\n return source\n }\n const target = isReactive(source) ? source : reactive(source)\n const cached = views.get(target)\n if (cached) {\n return cached\n }\n // 属性视图只解包既有响应式来源,不把 shallowRef 的普通值转成深层代理。\n const storeViewValue = (value: any): any => isReactive(value) ? storeView(value) : value\n const view = new Proxy(target, {\n get(object, key, receiver) {\n const value = Reflect.get(object, key, receiver)\n if (key === ReactiveFlags.RAW || key === ReactiveFlags.SKIP) {\n return value\n }\n if (isRef(value)) {\n return Array.isArray(object) && typeof key === 'string' && /^\\d+$/.test(key)\n ? value\n : storeViewValue(value.value)\n }\n return storeViewValue(value)\n },\n set(object, key, value, receiver) {\n const previous = Reflect.get(object, key, receiver)\n if (isRef(previous) && !isRef(value) && !Array.isArray(object)) {\n previous.value = value\n return true\n }\n return Reflect.set(object, key, value, receiver)\n },\n })\n views.set(target, view)\n views.set(view, view)\n return view\n}\n\n/** 合并普通对象,数组替换;保留 ref 和已有响应式对象的写入语义。 */\nexport function mergeState(target: Record<string, any>, patch: Record<string, any>) {\n if (target instanceof Map && patch instanceof Map) {\n patch.forEach((value, key) => target.set(key, value))\n }\n else if (target instanceof Set && patch instanceof Set) {\n patch.forEach(value => target.add(value))\n }\n for (const key of Object.keys(patch ?? {})) {\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n continue\n }\n const value = patch[key]\n if (isPlainObject(target[key]) && isPlainObject(value) && !isRef(value) && !isReactive(value)) {\n mergeState(target[key], value)\n }\n else {\n target[key] = value\n }\n }\n}\n\n/** 返回尚未解包的属性,供 storeToRefs 保留 state/getter 的来源。 */\nexport function rawStore(store: object): Record<string, any> {\n return toRaw(store)\n}\n"],"mappings":";;;;;;;AAIA,MAAM,wBAAQ,IAAI,QAAqB;;AAGvC,SAAgB,UAA4B,QAAc;CACxD,IAAK,oBACH,OAAO;CAET,IAAI,CAAC,cAAc,MAAM,KAAK,CAAC,MAAM,QAAQ,MAAM,GACjD,OAAO;CAET,IAAI,WAAW,MAAM,KAAK,kBAAkB,MAAM,GAChD,OAAO;CAET,MAAM,SAAS,WAAW,MAAM,IAAI,SAAS,SAAS,MAAM;CAC5D,MAAM,SAAS,MAAM,IAAI,MAAM;CAC/B,IAAI,QACF,OAAO;CAGT,MAAM,kBAAkB,UAAoB,WAAW,KAAK,IAAI,UAAU,KAAK,IAAI;CACnF,MAAM,OAAO,IAAI,MAAM,QAAQ;EAC7B,IAAI,QAAQ,KAAK,UAAU;GACzB,MAAM,QAAQ,QAAQ,IAAI,QAAQ,KAAK,QAAQ;GAC/C,IAAI,qBAA6B,oBAC/B,OAAO;GAET,IAAI,MAAM,KAAK,GACb,OAAO,MAAM,QAAQ,MAAM,KAAK,OAAO,QAAQ,YAAY,QAAQ,KAAK,GAAG,IACvE,QACA,eAAe,MAAM,KAAK;GAEhC,OAAO,eAAe,KAAK;EAC7B;EACA,IAAI,QAAQ,KAAK,OAAO,UAAU;GAChC,MAAM,WAAW,QAAQ,IAAI,QAAQ,KAAK,QAAQ;GAClD,IAAI,MAAM,QAAQ,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,QAAQ,MAAM,GAAG;IAC9D,SAAS,QAAQ;IACjB,OAAO;GACT;GACA,OAAO,QAAQ,IAAI,QAAQ,KAAK,OAAO,QAAQ;EACjD;CACF,CAAC;CACD,MAAM,IAAI,QAAQ,IAAI;CACtB,MAAM,IAAI,MAAM,IAAI;CACpB,OAAO;AACT;;AAGA,SAAgB,WAAW,QAA6B,OAA4B;CAClF,IAAI,kBAAkB,OAAO,iBAAiB,KAC5C,MAAM,SAAS,OAAO,QAAQ,OAAO,IAAI,KAAK,KAAK,CAAC;MAEjD,IAAI,kBAAkB,OAAO,iBAAiB,KACjD,MAAM,SAAQ,UAAS,OAAO,IAAI,KAAK,CAAC;CAE1C,KAAK,MAAM,OAAO,OAAO,KAAK,6CAAS,CAAC,CAAC,GAAG;EAC1C,IAAI,QAAQ,eAAe,QAAQ,iBAAiB,QAAQ,aAC1D;EAEF,MAAM,QAAQ,MAAM;EACpB,IAAI,cAAc,OAAO,IAAI,KAAK,cAAc,KAAK,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,WAAW,KAAK,GAC1F,WAAW,OAAO,MAAM,KAAK;OAG7B,OAAO,OAAO;CAElB;AACF;;AAGA,SAAgB,SAAS,OAAoC;CAC3D,OAAO,MAAM,KAAK;AACpB"}
|
package/dist/dev/store.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { createStore } from "./store/manager.mjs";
|
|
1
|
+
import { createPinia, createStore, disposePinia, getActivePinia, setActivePinia } from "./store/manager.mjs";
|
|
2
|
+
import { MutationType } from "./store/types.mjs";
|
|
2
3
|
import { defineStore } from "./store/define.mjs";
|
|
3
4
|
import { storeToRefs } from "./store/storeToRefs.mjs";
|
|
4
5
|
|
|
5
|
-
export { createStore, defineStore, storeToRefs };
|
|
6
|
+
export { MutationType, createPinia, createStore, defineStore, disposePinia, getActivePinia, setActivePinia, storeToRefs };
|
package/dist/dev/vue-demi.mjs
CHANGED
|
@@ -41,7 +41,8 @@ import { useAttrs, useNativeInstance, useSlots } from "./runtime/vueCompat/conte
|
|
|
41
41
|
import { mergeModels, useBindModel, useChangeModel, useModel } from "./runtime/vueCompat/model.mjs";
|
|
42
42
|
import { useNativePageRouter, useNativeRouter } from "./runtime/vueCompat/router.mjs";
|
|
43
43
|
import { useTemplateRef } from "./runtime/vueCompat/templateRef.mjs";
|
|
44
|
-
import { createStore } from "./store/manager.mjs";
|
|
44
|
+
import { createPinia, createStore, disposePinia, getActivePinia, setActivePinia } from "./store/manager.mjs";
|
|
45
|
+
import { MutationType } from "./store/types.mjs";
|
|
45
46
|
import { defineStore } from "./store/define.mjs";
|
|
46
47
|
import { storeToRefs } from "./store/storeToRefs.mjs";
|
|
47
48
|
|
|
@@ -66,5 +67,5 @@ const Vue2 = void 0;
|
|
|
66
67
|
function install() {}
|
|
67
68
|
|
|
68
69
|
//#endregion
|
|
69
|
-
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, resolvePropValue, 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, useAsyncDerivation, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, 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 };
|
|
70
|
+
export { MutationType, Vue2, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createPinia, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineStore, disposePinia, effect, effectScope, endBatch, getActivePinia, 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, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setActivePinia, 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, useAsyncDerivation, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, 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 };
|
|
70
71
|
//# 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,CAAC"}
|
package/dist/index.d.mts
CHANGED
|
@@ -62,11 +62,11 @@ import { TemplateRef, useTemplateRef } from "./runtime/vueCompat/templateRef.mjs
|
|
|
62
62
|
import "./runtime/index.mjs";
|
|
63
63
|
import { ComponentTypeEmits, EmitFn, EmitsOptions } from "./macros/shared.mjs";
|
|
64
64
|
import { DefineModelModifiers, DefineModelTransformOptions, ModelRef, PageLayoutMeta, PageMeta, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, withDefaults } from "./macros.mjs";
|
|
65
|
-
import { ActionContext, ActionSubscriber, DefineStoreOptions, MutationType, StoreManager, StoreSubscribeOptions, SubscriptionCallback } from "./store/types.mjs";
|
|
65
|
+
import { ActionContext, ActionSubscriber, DefineStoreOptions, MutationType, Pinia, PiniaCustomProperties, PiniaCustomStateProperties, PiniaPlugin, PiniaPluginContext, StateTree, StoreActions, StoreDefinition, StoreGeneric, StoreManager, StoreState, StoreSubscribeOptions, SubscriptionCallback, SubscriptionCallbackMutation } from "./store/types.mjs";
|
|
66
66
|
import { defineStore } from "./store/define.mjs";
|
|
67
|
-
import { createStore } from "./store/manager.mjs";
|
|
67
|
+
import { createPinia, createStore, disposePinia, getActivePinia, setActivePinia } from "./store/manager.mjs";
|
|
68
68
|
import { StoreToRefsResult, storeToRefs } from "./store/storeToRefs.mjs";
|
|
69
69
|
import "./store.mjs";
|
|
70
70
|
import { version } from "./version.mjs";
|
|
71
71
|
export * from "@wevu/web-apis";
|
|
72
|
-
export { type ActionContext, type ActionSubscriber, type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type AsyncDerivation, type AsyncDerivationContext, type AsyncDerivationState, type AsyncDerivationStatus, type ComponentCustomProps, type ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComponentTypeEmits, type ComputedDefinitions, type ComputedGetter, type ComputedRef, type ComputedSetter, type CreateAppOptions, type CustomRefFactory, type CustomRefOptions, type CustomRefSource, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, type DefineComponentTypePropsOptions, type DefineComponentWithTypeProps, DefineModelModifiers, DefineModelTransformOptions, type DefineStoreOptions, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, type EffectScope, ElementIntersectionObserverCallback, type EmitFn, type EmitsOptions, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, type LayoutBridgeInstance, type LayoutHostBinding, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MaybeUndefined, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, ModelRef, type MultiWatchSources, type MutationKind, type MutationOp, type MutationRecord, type MutationType, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type OnCleanup, type PageFeatures, PageLayoutMeta, type PageLayoutState, PageMeta, PageStackSnapshot, type PrelinkReactiveTreeOptions, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type Ref, type RuntimeApp, type RuntimeInstance, type SetDataBindingDiagnostic, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextIntersectionObserver, type SetupContextIntersectionObserverOptions, type SetupContextNativeInstance, type SetupContextRouter, type SetupContextSelectorQuery, type SetupContextWithTypeProps, type SetupFunction, type SetupFunctionWithTypeProps, type ShallowRef, type ShallowUnwrapRef, type StoreManager, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, type TemplateRef, TemplateRefValue, TemplateRefs, type ToRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, type UseAsyncDerivationOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WatchCallback, type WatchEffect, type WatchEffectOptions, type WatchMultiSources, type WatchOptions, type WatchScheduler, type WatchSource, type WatchSourceValue, type WatchSources, type WatchStopHandle, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, type WevuComponentConstructor, type WevuDefaults, type WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, type WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, type WritableComputedOptions, type 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, resolvePropValue, 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, useAsyncDerivation, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, 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 };
|
|
72
|
+
export { type ActionContext, type ActionSubscriber, type AlipayMiniProgramHostNamespace, type AlipayMiniProgramHostSourceContract, type AllowedComponentProps, type AppConfig, type AsyncDerivation, type AsyncDerivationContext, type AsyncDerivationState, type AsyncDerivationStatus, type ComponentCustomProps, type ComponentDefinition, type ComponentOptionsMixin, type ComponentPropsOptions, type ComponentPublicInstance, type ComponentTypeEmits, type ComputedDefinitions, type ComputedGetter, type ComputedRef, type ComputedSetter, type CreateAppOptions, type CustomRefFactory, type CustomRefOptions, type CustomRefSource, type DataOption, type DefaultMiniProgramHostNamespace, type DefaultMiniProgramHostSourceContract, type DefineAppOptions, type DefineComponent, type DefineComponentOptions, type DefineComponentTypePropsOptions, type DefineComponentWithTypeProps, DefineModelModifiers, DefineModelTransformOptions, type DefineStoreOptions, DisposableBag, DisposableLike, DisposableMethodName, DisposableObject, type DouyinMiniProgramHostNamespace, type DouyinMiniProgramHostSourceContract, type EffectScope, ElementIntersectionObserverCallback, type EmitFn, type EmitsOptions, type ExtractComputed, type ExtractDefaultPropTypes, type ExtractMethods, type ExtractPropTypes, type ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, type HostMiniProgramAddToFavoritesOption, type HostMiniProgramAppOptions, type HostMiniProgramAppTrivialInstance, type HostMiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray, type HostMiniProgramComponentInstance, type HostMiniProgramComponentMethodOption, type HostMiniProgramComponentPropertyOption, type HostMiniProgramComponentPropertyValue, type HostMiniProgramComponentShortProperty, type HostMiniProgramComponentTrivialInstance, type HostMiniProgramComponentTrivialOption, type HostMiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption, type HostMiniProgramNodesRef, type HostMiniProgramNodesRefFields, type HostMiniProgramPageLifetime, type HostMiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption, type HostMiniProgramPageScrollOption, type HostMiniProgramPageTrivialInstance, type HostMiniProgramReLaunchOption, type HostMiniProgramRedirectToOption, type HostMiniProgramRouter, type HostMiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption, type HostMiniProgramThemeChangeResult, type HostMiniProgramTriggerEventOptions, type HostMiniProgramUnhandledRejectionResult, type InferNativePropType, type InferNativeProps, type InferPropType, type InferProps, type InternalRuntimeState, type InternalRuntimeStateFields, type LayoutBridgeInstance, type LayoutHostBinding, type MapSources, type MaybeRef, type MaybeRefOrGetter, type MaybeUndefined, type MethodDefinitions, type MiniProgramAdapter, type HostMiniProgramAddToFavoritesOption as MiniProgramAddToFavoritesOption, type MiniProgramAppOptions, type MiniProgramBehaviorIdentifier, type HostMiniProgramBoundingClientRectResult as MiniProgramBoundingClientRectResult, type HostMiniProgramComponentAllFullProperty as MiniProgramComponentAllFullProperty, type HostMiniProgramComponentAllProperty as MiniProgramComponentAllProperty, type HostMiniProgramComponentBehaviorOptions as MiniProgramComponentBehaviorOptions, type HostMiniProgramComponentEmptyArray as MiniProgramComponentEmptyArray, type MiniProgramComponentInstance, type HostMiniProgramComponentMethodOption as MiniProgramComponentMethodOption, type MiniProgramComponentOptions, type HostMiniProgramComponentPropertyOption as MiniProgramComponentPropertyOption, type MiniProgramComponentPropertyValue, type MiniProgramComponentRawOptions, type HostMiniProgramComponentShortProperty as MiniProgramComponentShortProperty, type MiniProgramHostNamespace, type MiniProgramHostNamespaceBySource, type MiniProgramHostSourceName, type MiniProgramHostSourceRegistry, type MiniProgramInstance, type HostMiniProgramIntersectionObserver as MiniProgramIntersectionObserver, type HostMiniProgramIntersectionObserverOptions as MiniProgramIntersectionObserverOptions, type HostMiniProgramLaunchOptions as MiniProgramLaunchOptions, type HostMiniProgramMemoryWarningResult as MiniProgramMemoryWarningResult, type HostMiniProgramNavigateToOption as MiniProgramNavigateToOption, type HostMiniProgramNodesRef as MiniProgramNodesRef, type HostMiniProgramNodesRefFields as MiniProgramNodesRefFields, type HostMiniProgramPageLifetime as MiniProgramPageLifetime, type MiniProgramPageLifetimes, type HostMiniProgramPageNotFoundOptions as MiniProgramPageNotFoundOptions, type HostMiniProgramPageResizeOption as MiniProgramPageResizeOption, type HostMiniProgramPageScrollOption as MiniProgramPageScrollOption, type MiniProgramPlatformHostNamespaceBySource, type MiniProgramPlatformHostSourceName, type MiniProgramPlatformHostSourceRegistry, type HostMiniProgramReLaunchOption as MiniProgramReLaunchOption, type HostMiniProgramRedirectToOption as MiniProgramRedirectToOption, type HostMiniProgramRouter as MiniProgramRouter, type MiniProgramRouterNavigateToOption, type MiniProgramRouterReLaunchOption, type MiniProgramRouterRedirectToOption, type MiniProgramRouterSwitchTabOption, type MiniProgramRuntimeHostNamespaceBySource, type MiniProgramRuntimeHostSourceName, type MiniProgramRuntimeHostSourceRegistry, type HostMiniProgramSaveExitState as MiniProgramSaveExitState, type HostMiniProgramScrollOffsetResult as MiniProgramScrollOffsetResult, type HostMiniProgramSelectorQuery as MiniProgramSelectorQuery, type HostMiniProgramShareAppMessageOption as MiniProgramShareAppMessageOption, type HostMiniProgramSwitchTabOption as MiniProgramSwitchTabOption, type HostMiniProgramTabItemTapOption as MiniProgramTabItemTapOption, MiniProgramTemplateRefValue, type HostMiniProgramThemeChangeResult as MiniProgramThemeChangeResult, type HostMiniProgramUnhandledRejectionResult as MiniProgramUnhandledRejectionResult, type ModelBinding, type ModelBindingOptions, type ModelBindingPayload, type ModelModifiers, ModelRef, type MultiWatchSources, type MutationKind, type MutationOp, type MutationRecord, MutationType, type NativeComponent, type NativePropType, type NativePropsOptions, type NativeTypeHint, type NativeTypedProperty, NavigationBarMetrics, type ObjectDirective, type OnCleanup, type PageFeatures, PageLayoutMeta, type PageLayoutState, PageMeta, PageStackSnapshot, type Pinia, type PiniaCustomProperties, type PiniaCustomStateProperties, type PiniaPlugin, type PiniaPluginContext, type PrelinkReactiveTreeOptions, type PropConstructor, type PropOptions, type PropType, type PublicProps, PullDownRefreshHandler, type Ref, type RuntimeApp, type RuntimeInstance, type SetDataBindingDiagnostic, type SetDataDebugInfo, type SetDataSnapshotOptions, type SetupContext, type SetupContextIntersectionObserver, type SetupContextIntersectionObserverOptions, type SetupContextNativeInstance, type SetupContextRouter, type SetupContextSelectorQuery, type SetupContextWithTypeProps, type SetupFunction, type SetupFunctionWithTypeProps, type ShallowRef, type ShallowUnwrapRef, type StateTree, type StoreActions, type StoreDefinition, type StoreGeneric, type StoreManager, type StoreState, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, type SubscriptionCallbackMutation, type TemplateRef, TemplateRefValue, TemplateRefs, type ToRefs, type HostMiniProgramTriggerEventOptions as TriggerEventOptions, type TtMiniProgramHostNamespace, type TtMiniProgramHostSourceContract, UpdatePerformanceListener, UpdatePerformanceListenerResult, UseAllBoundingClientRectOptions, UseAllScrollOffsetOptions, UseAllSelectorFieldsOptions, type UseAsyncDerivationOptions, UseAsyncPullDownRefreshOptions, UseBoundingClientRectOptions, UseElementIntersectionObserverOptions, UseElementIntersectionObserverReturn, UseIntersectionObserverOptions, UseIntersectionObserverResult, type UseModelOptions, UseNavigationBarMetricsOptions, UsePageScrollThrottleOptions, UsePageScrollThrottleStopHandle, UsePageStackOptions, UseScrollOffsetOptions, UseSelectorFieldsOptions, UseSelectorQueryOptions, UseUpdatePerformanceListenerStopHandle, type VNode, type VNodeProps, type WatchCallback, type WatchEffect, type WatchEffectOptions, type WatchMultiSources, type WatchOptions, type WatchScheduler, type WatchSource, type WatchSourceValue, type WatchSources, type WatchStopHandle, type WechatMiniProgramHostNamespace, type WechatMiniProgramHostSourceContract, type WevuComponentConstructor, type WevuDefaults, type WevuDefinedComponent, WevuGlobalComponents, WevuGlobalDirectives, type WevuPageLayoutMap, type WevuPlugin, type WevuTypedRouterRouteMap, type WritableComputedOptions, type WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createPinia, createStore, createWevuComponent, createWevuScopedSlotComponent, customRef, defineAppSetup, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, definePageMeta, defineProps, defineSlots, defineStore, disposePinia, effect, effectScope, endBatch, getActivePinia, 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, resolvePropValue, resolveRuntimePageLayoutName, runSetupFunction, setActivePinia, 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, useAsyncDerivation, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useCssModule, 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{nextTick as e}from"./scheduler.mjs";import{batch as t,effect as n,effectScope as r,endBatch as i,getCurrentScope as a,onScopeDispose as o,startBatch as s,stop as c}from"./reactivity/core.mjs";import{addMutationRecorder as l,removeMutationRecorder as u}from"./reactivity/reactive/mutation.mjs";import{toRaw as d}from"./reactivity/reactive/shared.mjs";import{prelinkReactiveTree as f,touchReactive as p}from"./reactivity/reactive/patch.mjs";import{isShallowReactive as m,shallowReactive as h}from"./reactivity/reactive/shallow.mjs";import{getReactiveVersion as g,isRaw as _,isReactive as v,markRaw as y,reactive as b}from"./reactivity/reactive.mjs";import{customRef as x,isRef as S,ref as C,toValue as w,unref as T}from"./reactivity/ref.mjs";import{isProxy as E,isReadonly as D,readonly as O,shallowReadonly as k}from"./reactivity/readonly.mjs";import{useAsyncDerivation as A}from"./reactivity/asyncDerivation.mjs";import{computed as j}from"./reactivity/computed.mjs";import{isShallowRef as M,shallowRef as N,triggerRef as P}from"./reactivity/shallowRef.mjs";import{toRef as F,toRefs as I}from"./reactivity/toRefs.mjs";import{traverse as L}from"./reactivity/traverse.mjs";import{callHookList as R,callHookReturn as z,getCurrentInstance as B,getCurrentSetupContext as V,setCurrentInstance as H,setCurrentSetupContext as U}from"./runtime/hooks/base.mjs";import{onAddToFavorites as W,onAttached as G,onDetached as K,onError as q,onHide as J,onLaunch as Y,onLoad as X,onMemoryWarning as Z,onMoved as Q,onPageNotFound as $,onPageScroll as ee,onPullDownRefresh as te,onReachBottom as ne,onReady as re,onResize as ie,onRouteDone as ae,onSaveExitState as oe,onShareAppMessage as se,onShareTimeline as ce,onShow as le,onTabItemTap as ue,onThemeChange as de,onUnhandledRejection as fe,onUnload as pe}from"./runtime/hooks/register.mjs";import{callUpdateHooks as me,onActivated as he,onBeforeMount as ge,onBeforeUnmount as _e,onBeforeUpdate as ve,onDeactivated as ye,onErrorCaptured as be,onMounted as xe,onServerPrefetch as Se,onUnmounted as Ce,onUpdated as we}from"./runtime/hooks/vue.mjs";import{getDeepWatchStrategy as Te,setDeepWatchStrategy as Ee}from"./reactivity/watch/types.mjs";import{watch as De,watchEffect as Oe,watchPostEffect as ke,watchSyncEffect as Ae}from"./reactivity/watch.mjs";import{useCssModule as je}from"./runtime/css.mjs";import{resetWevuDefaults as Me}from"./runtime/defaults.mjs";import{useDisposables as Ne}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as Pe}from"./runtime/elementIntersectionObserver.mjs";import{isNoSetData as Fe,markNoSetData as Ie}from"./runtime/noSetData.mjs";import{registerPageLayoutBridge as Le,registerRuntimeLayoutHosts as Re,resolveLayoutBridge as ze,resolveLayoutHost as Be,resolveRuntimePageLayoutName as Ve,setPageLayout as He,syncRuntimePageLayoutState as Ue,syncRuntimePageLayoutStateFromRuntime as We,unregisterPageLayoutBridge as Ge,unregisterRuntimeLayoutHosts as Ke,useLayoutBridge as qe,useLayoutHosts as Je,usePageLayout as Ye,waitForLayoutHost as Xe}from"./runtime/features/publicLayout.mjs";import{useIntersectionObserver as Ze}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as Qe,getNavigationBarMetrics as $e,useNavigationBarMetrics as et,usePageStack as tt}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as nt}from"./runtime/pageScroll.mjs";import{setGlobalProvidedValue as rt}from"./runtime/provideStore.mjs";import{hasInjectionContext as it,inject as at,injectGlobal as ot,provide as st,provideGlobal as ct}from"./runtime/provide.mjs";import{version as lt}from"./version.mjs";import{runSetupFunction as ut}from"./runtime/register/setup.mjs";import{setRuntimeSetDataVisibility as dt,teardownRuntimeInstance as ft}from"./runtime/register/runtimeInstance.mjs";import{createApp as pt,createWevuComponent as mt,createWevuScopedSlotComponent as ht,defineComponent as gt,mountRuntimeInstance as _t,registerApp as vt,registerComponent as yt,setWevuDefaults as bt}from"./runtime/publicRuntime.mjs";import{useAsyncPullDownRefresh as xt}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as St,useScrollOffset as Ct,useSelectorFields as wt,useSelectorQuery as Tt}from"./runtime/selectorQuery.mjs";import{normalizeClass as Et,normalizeStyle as Dt,resolvePropValue as Ot}from"./runtime/template.mjs";import{useUpdatePerformanceListener as kt}from"./runtime/updatePerformance.mjs";import{defineAppSetup as At,use as jt}from"./runtime/use.mjs";import{useAttrs as Mt,useNativeInstance as Nt,useSlots as Pt}from"./runtime/vueCompat/context.mjs";import{mergeModels as Ft,useBindModel as It,useChangeModel as Lt,useModel as Rt}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as zt,useNativeRouter as Bt}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as Vt}from"./runtime/vueCompat/templateRef.mjs";import{createStore as
|
|
1
|
+
import{nextTick as e}from"./scheduler.mjs";import{batch as t,effect as n,effectScope as r,endBatch as i,getCurrentScope as a,onScopeDispose as o,startBatch as s,stop as c}from"./reactivity/core.mjs";import{addMutationRecorder as l,removeMutationRecorder as u}from"./reactivity/reactive/mutation.mjs";import{toRaw as d}from"./reactivity/reactive/shared.mjs";import{prelinkReactiveTree as f,touchReactive as p}from"./reactivity/reactive/patch.mjs";import{isShallowReactive as m,shallowReactive as h}from"./reactivity/reactive/shallow.mjs";import{getReactiveVersion as g,isRaw as _,isReactive as v,markRaw as y,reactive as b}from"./reactivity/reactive.mjs";import{customRef as x,isRef as S,ref as C,toValue as w,unref as T}from"./reactivity/ref.mjs";import{isProxy as E,isReadonly as D,readonly as O,shallowReadonly as k}from"./reactivity/readonly.mjs";import{useAsyncDerivation as A}from"./reactivity/asyncDerivation.mjs";import{computed as j}from"./reactivity/computed.mjs";import{isShallowRef as M,shallowRef as N,triggerRef as P}from"./reactivity/shallowRef.mjs";import{toRef as F,toRefs as I}from"./reactivity/toRefs.mjs";import{traverse as L}from"./reactivity/traverse.mjs";import{callHookList as R,callHookReturn as z,getCurrentInstance as B,getCurrentSetupContext as V,setCurrentInstance as H,setCurrentSetupContext as U}from"./runtime/hooks/base.mjs";import{onAddToFavorites as W,onAttached as G,onDetached as K,onError as q,onHide as J,onLaunch as Y,onLoad as X,onMemoryWarning as Z,onMoved as Q,onPageNotFound as $,onPageScroll as ee,onPullDownRefresh as te,onReachBottom as ne,onReady as re,onResize as ie,onRouteDone as ae,onSaveExitState as oe,onShareAppMessage as se,onShareTimeline as ce,onShow as le,onTabItemTap as ue,onThemeChange as de,onUnhandledRejection as fe,onUnload as pe}from"./runtime/hooks/register.mjs";import{callUpdateHooks as me,onActivated as he,onBeforeMount as ge,onBeforeUnmount as _e,onBeforeUpdate as ve,onDeactivated as ye,onErrorCaptured as be,onMounted as xe,onServerPrefetch as Se,onUnmounted as Ce,onUpdated as we}from"./runtime/hooks/vue.mjs";import{getDeepWatchStrategy as Te,setDeepWatchStrategy as Ee}from"./reactivity/watch/types.mjs";import{watch as De,watchEffect as Oe,watchPostEffect as ke,watchSyncEffect as Ae}from"./reactivity/watch.mjs";import{useCssModule as je}from"./runtime/css.mjs";import{resetWevuDefaults as Me}from"./runtime/defaults.mjs";import{useDisposables as Ne}from"./runtime/disposables.mjs";import{useElementIntersectionObserver as Pe}from"./runtime/elementIntersectionObserver.mjs";import{isNoSetData as Fe,markNoSetData as Ie}from"./runtime/noSetData.mjs";import{registerPageLayoutBridge as Le,registerRuntimeLayoutHosts as Re,resolveLayoutBridge as ze,resolveLayoutHost as Be,resolveRuntimePageLayoutName as Ve,setPageLayout as He,syncRuntimePageLayoutState as Ue,syncRuntimePageLayoutStateFromRuntime as We,unregisterPageLayoutBridge as Ge,unregisterRuntimeLayoutHosts as Ke,useLayoutBridge as qe,useLayoutHosts as Je,usePageLayout as Ye,waitForLayoutHost as Xe}from"./runtime/features/publicLayout.mjs";import{useIntersectionObserver as Ze}from"./runtime/intersectionObserver.mjs";import{getCurrentPageStackSnapshot as Qe,getNavigationBarMetrics as $e,useNavigationBarMetrics as et,usePageStack as tt}from"./runtime/pageEnvironment.mjs";import{usePageScrollThrottle as nt}from"./runtime/pageScroll.mjs";import{setGlobalProvidedValue as rt}from"./runtime/provideStore.mjs";import{hasInjectionContext as it,inject as at,injectGlobal as ot,provide as st,provideGlobal as ct}from"./runtime/provide.mjs";import{version as lt}from"./version.mjs";import{runSetupFunction as ut}from"./runtime/register/setup.mjs";import{setRuntimeSetDataVisibility as dt,teardownRuntimeInstance as ft}from"./runtime/register/runtimeInstance.mjs";import{createApp as pt,createWevuComponent as mt,createWevuScopedSlotComponent as ht,defineComponent as gt,mountRuntimeInstance as _t,registerApp as vt,registerComponent as yt,setWevuDefaults as bt}from"./runtime/publicRuntime.mjs";import{useAsyncPullDownRefresh as xt}from"./runtime/pullDownRefresh.mjs";import{useBoundingClientRect as St,useScrollOffset as Ct,useSelectorFields as wt,useSelectorQuery as Tt}from"./runtime/selectorQuery.mjs";import{normalizeClass as Et,normalizeStyle as Dt,resolvePropValue as Ot}from"./runtime/template.mjs";import{useUpdatePerformanceListener as kt}from"./runtime/updatePerformance.mjs";import{defineAppSetup as At,use as jt}from"./runtime/use.mjs";import{useAttrs as Mt,useNativeInstance as Nt,useSlots as Pt}from"./runtime/vueCompat/context.mjs";import{mergeModels as Ft,useBindModel as It,useChangeModel as Lt,useModel as Rt}from"./runtime/vueCompat/model.mjs";import{useNativePageRouter as zt,useNativeRouter as Bt}from"./runtime/vueCompat/router.mjs";import{useTemplateRef as Vt}from"./runtime/vueCompat/templateRef.mjs";import{createPinia as Ht,createStore as Ut,disposePinia as Wt,getActivePinia as Gt,setActivePinia as Kt}from"./store/manager.mjs";import{MutationType as qt}from"./store/types.mjs";import{defineStore as Jt}from"./store/define.mjs";import{storeToRefs as Yt}from"./store/storeToRefs.mjs";export*from"@wevu/web-apis";export{qt as MutationType,l as addMutationRecorder,t as batch,R as callHookList,z as callHookReturn,me as callUpdateHooks,j as computed,pt as createApp,Ht as createPinia,Ut as createStore,mt as createWevuComponent,ht as createWevuScopedSlotComponent,x as customRef,At as defineAppSetup,gt as defineComponent,Jt as defineStore,Wt as disposePinia,n as effect,r as effectScope,i as endBatch,Gt as getActivePinia,B as getCurrentInstance,Qe as getCurrentPageStackSnapshot,a as getCurrentScope,V as getCurrentSetupContext,Te as getDeepWatchStrategy,$e as getNavigationBarMetrics,g as getReactiveVersion,it as hasInjectionContext,at as inject,ot as injectGlobal,Fe as isNoSetData,E as isProxy,_ as isRaw,v as isReactive,D as isReadonly,S as isRef,m as isShallowReactive,M as isShallowRef,Ie as markNoSetData,y as markRaw,Ft as mergeModels,_t as mountRuntimeInstance,e as nextTick,Et as normalizeClass,Dt as normalizeStyle,he as onActivated,W as onAddToFavorites,G as onAttached,ge as onBeforeMount,_e as onBeforeUnmount,ve as onBeforeUpdate,ye as onDeactivated,K as onDetached,q as onError,be as onErrorCaptured,J as onHide,Y as onLaunch,X as onLoad,Z as onMemoryWarning,xe as onMounted,Q as onMoved,$ as onPageNotFound,ee as onPageScroll,te as onPullDownRefresh,ne as onReachBottom,re as onReady,ie as onResize,ae as onRouteDone,oe as onSaveExitState,o as onScopeDispose,Se as onServerPrefetch,se as onShareAppMessage,ce as onShareTimeline,le as onShow,ue as onTabItemTap,de as onThemeChange,fe as onUnhandledRejection,pe as onUnload,Ce as onUnmounted,we as onUpdated,f as prelinkReactiveTree,st as provide,ct as provideGlobal,b as reactive,O as readonly,C as ref,vt as registerApp,yt as registerComponent,Le as registerPageLayoutBridge,Re as registerRuntimeLayoutHosts,u as removeMutationRecorder,Me as resetWevuDefaults,ze as resolveLayoutBridge,Be as resolveLayoutHost,Ot as resolvePropValue,Ve as resolveRuntimePageLayoutName,ut as runSetupFunction,Kt as setActivePinia,H as setCurrentInstance,U as setCurrentSetupContext,Ee as setDeepWatchStrategy,rt as setGlobalProvidedValue,He as setPageLayout,dt as setRuntimeSetDataVisibility,bt as setWevuDefaults,h as shallowReactive,k as shallowReadonly,N as shallowRef,s as startBatch,c as stop,Yt as storeToRefs,Ue as syncRuntimePageLayoutState,We as syncRuntimePageLayoutStateFromRuntime,ft as teardownRuntimeInstance,d as toRaw,F as toRef,I as toRefs,w as toValue,p as touchReactive,L as traverse,P as triggerRef,T as unref,Ge as unregisterPageLayoutBridge,Ke as unregisterRuntimeLayoutHosts,jt as use,A as useAsyncDerivation,xt as useAsyncPullDownRefresh,Mt as useAttrs,It as useBindModel,St as useBoundingClientRect,Lt as useChangeModel,je as useCssModule,Ne as useDisposables,Pe as useElementIntersectionObserver,Ze as useIntersectionObserver,qe as useLayoutBridge,Je as useLayoutHosts,Rt as useModel,Nt as useNativeInstance,zt as useNativePageRouter,Bt as useNativeRouter,et as useNavigationBarMetrics,Ye as usePageLayout,nt as usePageScrollThrottle,tt as usePageStack,Ct as useScrollOffset,wt as useSelectorFields,Tt as useSelectorQuery,Pt as useSlots,Vt as useTemplateRef,kt as useUpdatePerformanceListener,lt as version,Xe as waitForLayoutHost,De as watch,Oe as watchEffect,ke as watchPostEffect,Ae as watchSyncEffect};
|
package/dist/package.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`7.1
|
|
1
|
+
var e=`7.2.1`;export{e as version};
|
|
@@ -2,13 +2,17 @@ import { Ref } from "./ref.mjs";
|
|
|
2
2
|
//#region src/reactivity/computed.d.ts
|
|
3
3
|
export type ComputedGetter<T> = () => T;
|
|
4
4
|
export type ComputedSetter<T> = (value: T) => void;
|
|
5
|
+
declare const computedBrand: unique symbol;
|
|
6
|
+
declare const writableComputedBrand: unique symbol;
|
|
5
7
|
interface BaseComputedRef<T, S = T> extends Ref<T, S> {
|
|
6
8
|
[key: symbol]: any;
|
|
7
9
|
}
|
|
8
10
|
export interface ComputedRef<T = any> extends BaseComputedRef<T> {
|
|
11
|
+
readonly [computedBrand]: true;
|
|
9
12
|
readonly value: T;
|
|
10
13
|
}
|
|
11
14
|
export interface WritableComputedRef<T, S = T> extends BaseComputedRef<T, S> {
|
|
15
|
+
readonly [writableComputedBrand]: true;
|
|
12
16
|
value: T;
|
|
13
17
|
}
|
|
14
18
|
export interface WritableComputedOptions<T> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createComputedEffect as e,track as t,trigger as n}from"./core.mjs";import{
|
|
1
|
+
import{createComputedEffect as e,track as t,trigger as n}from"./core.mjs";import{markRaw as r}from"./reactive.mjs";import{markAsRef as i}from"./ref.mjs";const a=/* @__PURE__ */ new WeakSet;function o(e){return typeof e==`object`&&!!e&&a.has(e)}function s(o){let s,c,l=typeof o==`function`;l?(s=o,c=()=>{throw Error(`计算属性是只读的`)}):(s=o.get,c=o.set);let u,d=!0,f,p={get value(){return d&&(u=f(),d=!1),t(p,`value`),u},set value(e){c(e)}};return i(p),r(p),a.add(p),Object.defineProperty(p,"__r_isReadonly",{value:l}),f=e(s,{lazy:!0,scheduler:()=>{d||(d=!0,n(p,`value`))}}),p}export{s as computed,o as isComputedRef};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{batch as e,track as t,trigger as n}from"./core.mjs";import{addMutationRecorder as r,mutationRecorders as i,removeMutationRecorder as a}from"./reactive/mutation.mjs";import{adoptReactiveRoot as o,bumpAncestorVersions as s,bumpRawVersion as c,getRawVersion as l,rawMultiParentSet as u,rawParentsMap as d,rawPathMap as f,rawRootMap as p,rawVersionMap as m,recordParentLink as h,removeParentLink as g,resolvePathToTarget as _}from"./reactive/patchState.mjs";import{VERSION_KEY as v,getTargetType as y,hasOwn as b,isArrayIndexKey as x,isObject as S,toRaw as C}from"./reactive/shared.mjs";import{rawMap as w,reactiveMap as T}from"./reactive/state.mjs";import{clearPatchIndices as E,prelinkReactiveTree as D,touchReactive as O}from"./reactive/patch.mjs";import{isShallowReactive as k,shallowReactive as A}from"./reactive/shallow.mjs";function j(e){let t=C(e);return l(t)}function M(e,t,n){var r;if(!i.size||typeof t!=`string`||t.startsWith(`__r_`))return;let a=(r=p.get(e))==null?e:r,o=Array.isArray(e)&&(t===`length`||x(t))?`array`:`property`,s=_(a,e);if(!s){let r=/* @__PURE__ */ new Set,s=d.get(e);if(s)for(let[e,t]of s){var c;let n=f.get(e),i=n?n.split(`.`,1)[0]:void 0,o=i||(c=_(a,e))==null?void 0:c[0];for(let e of t){var l;typeof e==`string`&&r.add((l=i==null?o:i)==null?e:l)}}else r.add(t);for(let e of i)e({root:a,kind:o,op:n,path:void 0,fallbackTopKeys:r.size?[...r]:void 0});return}let u=s.findIndex(e=>x(e));if(u!==-1){let e=s.slice(0,u).join(`.`)||void 0;for(let t of i)t({root:a,kind:`array`,op:n,path:e});return}let m=s.length?s.join(`.`):``,h=o===`array`?m||void 0:m?`${m}.${t}`:t;for(let e of i)e({root:a,kind:o,op:n,path:h})}const N={get(e,n,r){if(n===`__r_isReactive`)return!0;if(n===`__r_raw`)return e;let a=Reflect.get(e,n,r);if(t(e,n),S(a)){var s;if(a.__r_skip)return a;let t=(s=a==null?void 0:a.__r_raw)==null?a:s;o(t,e),h(t,e,n);let r=f.get(e);if(i.size&&typeof n==`string`&&r!=null&&!u.has(t)){let e=r?`${r}.${n}`:n;f.set(t,e)}return P(a)}return a},set(t,r,a,l){let d=b(t,r),m=Array.isArray(t),_=m?t.length:0,y=Reflect.get(t,r,l),w=S(y)?C(y):y,T=S(a)?C(a):a;if(Object.is(w,T))return!0;let E=Reflect.set(t,r,a,l);if(E){let a=S(w)?w:void 0;if(a&&g(a,t,r),S(T)&&!T.__r_skip){let e=T;o(e,t),h(e,t,r);let n=f.get(t);if(i.size&&typeof r==`string`&&n!=null&&!u.has(e)){let t=n?`${n}.${r}`:r;f.set(e,t)}}e(()=>{n(t,r),m&&typeof r==`string`&&x(r)&&Number(r)>=_&&n(t,`length`),n(t,v),c(t),s(t);let e=p.get(t);e&&e!==t&&(n(e,v),c(e)),d||n(t,Symbol.iterator)}),M(t,r,`set`)}return E},deleteProperty(t,r){let i=b(t,r),a=i?t[r]:void 0,o=Reflect.deleteProperty(t,r);if(i&&o){var l;let i=S(a)?(l=a==null?void 0:a.__r_raw)==null?a:l:void 0;i&&g(i,t,r),e(()=>{n(t,r),n(t,v),c(t),s(t);let e=p.get(t);e&&e!==t&&(n(e,v),c(e)),n(t,Symbol.iterator)}),M(t,r,`delete`)}return o},ownKeys(e){return t(e,Symbol.iterator),t(e,v),Reflect.ownKeys(e)}};function P(e){if(!S(e)||e.__r_isReactive)return e;let t=T.get(e);if(t)return t;if(y(e)===0)return e;let n=new Proxy(e,N);return T.set(e,n),w.set(n,e),m.has(e)||m.set(e,0),p.has(e)||p.set(e,e),n}function F(e){return!!(e&&e.__r_isReactive)}function I(e){return S(e)?P(e):e}function L(e){return S(e)&&Object.defineProperty(e,"__r_skip",{value:!0,configurable:!0,enumerable:!1,writable:!0}),e}function R(e){return S(e)&&`__r_skip`in e}export{r as addMutationRecorder,E as clearPatchIndices,I as convertToReactive,j as getReactiveVersion,S as isObject,R as isRaw,F as isReactive,k as isShallowReactive,L as markRaw,D as prelinkReactiveTree,P as reactive,a as removeMutationRecorder,A as shallowReactive,C as toRaw,O as touchReactive};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WevuAutoRoute } from "./types.mjs";
|
|
2
|
+
import { WevuNamedRouteMap } from "../router.mjs";
|
|
3
|
+
//#region src/router/auto-routes.d.ts
|
|
4
|
+
export type WevuAutoRoutes<TRouteMap extends object = WevuNamedRouteMap> = readonly WevuAutoRoute<TRouteMap>[];
|
|
5
|
+
export declare const routes: WevuAutoRoutes;
|
|
6
|
+
//#endregion
|
|
7
|
+
export type { WevuAutoRoute };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{WEVU_AUTO_ROUTES_MODULE_ID as e}from"@weapp-core/constants";function t(){throw Error(`${e} is generated by weapp-vite and is unavailable outside a weapp-vite build.`)}const n=t();export{n as routes};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RouterNavigation, UseRouterOptions } from "./types.mjs";
|
|
2
|
+
import { WevuNamedRouteMap } from "../router.mjs";
|
|
2
3
|
//#region src/router/createRouter.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* @description 创建高阶路由导航器(对齐 Vue Router 的 createRouter 心智)
|
|
5
6
|
*/
|
|
6
|
-
export declare function createRouter(
|
|
7
|
+
export declare function createRouter<TRouteMap extends object = WevuNamedRouteMap>(optionsInput?: UseRouterOptions<NoInfer<TRouteMap>>): RouterNavigation<TRouteMap>;
|
|
7
8
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentMiniProgramTabBarPagePaths as e,getMiniProgramGlobalObject as t}from"../runtime/platform.mjs";import{setActiveRouter as n}from"./instance.mjs";import{DEFAULT_INITIAL_NAVIGATION_TIMEOUT as r,registerInitialNavigationRunner as i}from"./initialNavigation.mjs";import{installRouteStateSyncOnNativeRouter as a,notifyRouteStateSync as o}from"./routeSync.mjs";import{resolvePath as ee}from"../routerInternal/path.mjs";import{parseQuery as te,stringifyQuery as ne}from"../routerInternal/query.mjs";import{resolveCurrentRoute as re}from"../routerInternal/location.mjs";import{resolveNamedRouteLocation as s}from"../routerInternal/params.mjs";import{mergeMatchedRouteMeta as ie,resolveMatchedRouteRecord as ae}from"../routerInternal/matching.mjs";import{warnDuplicateRouteEntries as oe}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteLookup as se,resolveRouteOptionEntries as ce}from"../routerInternal/records.mjs";import{cloneRouteMeta as le,cloneRouteParams as ue,createNativeRouteUrl as de,createRouterOptionsSnapshot as fe,normalizeRouteRecordMatched as pe,snapshotRouteLocation as c}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as
|
|
1
|
+
import{getCurrentMiniProgramTabBarPagePaths as e,getMiniProgramGlobalObject as t}from"../runtime/platform.mjs";import{setActiveRouter as n}from"./instance.mjs";import{DEFAULT_INITIAL_NAVIGATION_TIMEOUT as r,registerInitialNavigationRunner as i}from"./initialNavigation.mjs";import{installRouteStateSyncOnNativeRouter as a,notifyRouteStateSync as o}from"./routeSync.mjs";import{resolvePath as ee}from"../routerInternal/path.mjs";import{parseQuery as te,stringifyQuery as ne}from"../routerInternal/query.mjs";import{resolveCurrentRoute as re}from"../routerInternal/location.mjs";import{resolveNamedRouteLocation as s}from"../routerInternal/params.mjs";import{mergeMatchedRouteMeta as ie,resolveMatchedRouteRecord as ae}from"../routerInternal/matching.mjs";import{warnDuplicateRouteEntries as oe}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteLookup as se,resolveRouteOptionEntries as ce}from"../routerInternal/records.mjs";import{cloneRouteMeta as le,cloneRouteParams as ue,createNativeRouteUrl as de,createRouterOptionsSnapshot as fe,normalizeRouteRecordMatched as pe,snapshotRouteLocation as c}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as l}from"./types.mjs";import{createNavigationFailure as u,executeNavigationMethod as d}from"./navigationCore.mjs";import{createNavigationResultController as f}from"./navigationResult.mjs";import{resolveBackNavigationTarget as p,runBackNavigationGuards as me}from"./backNavigation.mjs";import{navigateWithTarget as he}from"./navigationTarget.mjs";import{createNavigationApi as ge}from"./navigationApi.mjs";import{resolveRouteLocation as _e}from"./resolve.mjs";import{createRouteRegistry as ve}from"./routeRegistry.mjs";import{createRouteStateController as ye,useNativeRouter as m}from"./useRoute.mjs";function h(h={}){var g,_,v,y,b,x,S;let C=h,w=m();a(t());let T=/* @__PURE__ */ new Set,E=/* @__PURE__ */ new Set,D=/* @__PURE__ */ new Set,O=/* @__PURE__ */ new Set,k=(g=C.maxRedirects)==null?10:g,A=C.initialNavigationMode===`blocking`?`blocking`:`eager`,j=Number.isFinite(C.initialNavigationTimeout)&&((_=C.initialNavigationTimeout)==null?0:_)>0?Math.max(1,Math.trunc(C.initialNavigationTimeout)):r,M=(v=C.paramsMode)==null?`loose`:v,N=(y=C.rejectOnError)==null||y,P={parseQuery:(b=C.parseQuery)==null?te:b,stringifyQuery:(x=C.stringifyQuery)==null?ne:x},be=Promise.resolve(),F=ce(C);oe(F);let I=se(F),L=((S=C.tabBarEntries)==null?e():S).map(e=>ee(e,``)).filter(Boolean),R=new Set(L),z=ve(I),B=0,V,H,U,xe=fe(L,z.getRoutes(),M,k,A,j,P,N);function W(e){let t={...e};t.href=t.fullPath;let n=ae(t,I);if(n){let e=n.record;t.name===void 0&&(t.name=e.name);let r=ie(n.matchedRecords);r!==void 0&&(t.meta=le(r)),n.params&&Object.keys(t.params).length===0&&(t.params=ue(n.params)),t.matched=n.matchedRecords.map((e,t,r)=>{let i=t===r.length-1?n.matchedPath:void 0;return pe(e,i)})}else t.matched=[];return t}function G(e,t){let n=typeof e==`string`?e:s(e,I,M);return W(_e(n,t,P))}let K,q;function J(e){return e.source===`page`||e.source===`native`&&e.method===`navigateBack`}function Se(e,t){if(B>0||!J(t)||U!==void 0)return;if(H!==void 0){let t=H;if(H=void 0,e.fullPath===t)return}if(e.fullPath===K.fullPath)return;U=e.fullPath;let n=c(K);me({target:e,from:n,nativeRouter:w,beforeEachGuards:T,beforeResolveGuards:E,resolveWithCodec:G}).then(e=>q==null?void 0:q(e)).finally(()=>{U=void 0})}K=ye({beforeRouteStateSync:Se,resolveRoute:W}).route;let Ce=e=>G(e,K.path),Y=f({afterEachHooks:D,errorHandlers:O,nativeRouter:w,rejectOnError:N});q=Y.emitNavigationAfterEach;let X=ge({nativeRouter:w,route:K,routeResolveCodec:P,namedRouteLookup:I,beforeEachGuards:T,beforeResolveGuards:E,maxRedirects:k,tabBarPathSet:R,resolveWithCodec:G,settleNavigationResult:Y.settleNavigationResult});async function Z(e,t){let n=K.fullPath;t&&(V=t),B+=1;try{let t=await e();return K.fullPath!==n&&(H=K.fullPath),t}finally{--B,B<=0&&(V=void 0)}}function Q(e){try{return G(e,K.path).fullPath}catch(e){return}}async function we(e,t,n=()=>!0){return Z(async()=>{let r=c(K),i=W(re(t,e));if(!i.path)return;if(V===i.fullPath){o({route:i,source:`router`});return}let a=await he({mode:`push`,target:i,from:r,nativeRouter:w,routeResolveCodec:P,namedRouteLookup:I,beforeEachGuards:T,beforeResolveGuards:E,maxRedirects:k,tabBarPathSet:R,resolveWithCodec:G,executeNative:!1,allowSameLocation:!0});if(n()){if(A===`blocking`&&a.to&&a.to.fullPath!==i.fullPath){let e=a.to,t=R.has(e.path)?w.switchTab:w.redirectTo;return await d(t,{url:de(e,P.stringifyQuery)},e,r)||(o({route:e,source:`router`}),u(l.cancelled,e,r))}return Y.settleNavigationResult(a)}})}function Te(e){return T.add(e),()=>{T.delete(e)}}function Ee(e){return E.add(e),()=>{E.delete(e)}}function De(e){return D.add(e),()=>{D.delete(e)}}function Oe(e){return O.add(e),()=>{O.delete(e)}}let $={nativeRouter:w,options:xe,currentRoute:K,install(e){var t;n($);let r=e==null||(t=e.config)==null?void 0:t.globalProperties;r&&(r.$router=$)},resolve:Ce,isReady(){return be},push:e=>Z(()=>X.push(e),Q(e)),replace:e=>Z(()=>X.replace(e),Q(e)),back:e=>{var t;return Z(()=>X.back(e),(t=p(e==null?1:e,K,G))==null?void 0:t.fullPath)},go:e=>{var t;return Z(()=>X.go(e),e<0?(t=p(Math.abs(e),K,G))==null?void 0:t.fullPath:void 0)},forward:()=>Z(()=>X.forward()),hasRoute:z.hasRoute,getRoutes:z.getRoutes,addRoute:z.addRoute,removeRoute:z.removeRoute,clearRoutes:z.clearRoutes,beforeEach:Te,beforeResolve:Ee,afterEach:De,onError:Oe};return n($),i($,we,j,A),$}export{h as createRouter};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NavigationFailure, NavigationFailureTypeValue, RouteLocationNormalizedLoaded } from "./types.mjs";
|
|
2
|
+
import { WevuNamedRouteMap } from "../router.mjs";
|
|
2
3
|
//#region src/router/navigationCore.d.ts
|
|
3
|
-
export declare function createNavigationFailure(type: NavigationFailureTypeValue, to?: RouteLocationNormalizedLoaded
|
|
4
|
-
export declare function isNavigationFailure(error: unknown, type?: NavigationFailureTypeValue): error is NavigationFailure
|
|
4
|
+
export declare function createNavigationFailure<TRouteMap extends object = WevuNamedRouteMap>(type: NavigationFailureTypeValue, to?: RouteLocationNormalizedLoaded<NoInfer<TRouteMap>>, from?: RouteLocationNormalizedLoaded<NoInfer<TRouteMap>>, cause?: unknown): NavigationFailure<TRouteMap>;
|
|
5
|
+
export declare function isNavigationFailure<TRouteMap extends object = WevuNamedRouteMap>(error: unknown, type?: NavigationFailureTypeValue): error is NavigationFailure<TRouteMap>;
|
|
5
6
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NavigationFailureType as e}from"./types.mjs";const t=/already|same|duplicat|重复/,n=/cancel|取消/,r=/abort|interrupt|中断/;function i(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 a(a){let o=i(a).toLowerCase();return t.test(o)?e.duplicated:n.test(o)?e.cancelled:r.test(o)?e.aborted:e.unknown}function o(e,t,n,r){let a=i(r)||`Navigation failed
|
|
1
|
+
import{NavigationFailureType as e}from"./types.mjs";const t=/already|same|duplicat|重复/,n=/cancel|取消/,r=/abort|interrupt|中断/;function i(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 a(a){let o=i(a).toLowerCase();return t.test(o)?e.duplicated:n.test(o)?e.cancelled:r.test(o)?e.aborted:e.unknown}function o(e,t,n,r){let a=i(r)||`Navigation failed`;return Object.assign(Error(a),{__wevuNavigationFailure:!0,type:e,to:t,from:n,cause:r})}function s(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0||n.type===t:!1}function c(e){return!e||typeof e!=`object`?!1:`to`in e}function l(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 u(t,n,r){for(let i of t)try{let t=await i(n.to,n.from,n);if(s(t))return{status:`failure`,failure:t};if(t===!1)return{status:`failure`,failure:o(e.aborted,n.to,n.from,`Navigation aborted by guard`)};if(c(t))return n.to?{status:`redirect`,target:r(t.to,n.to.path),replace:t.replace}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)};if(l(t))return n.to?{status:`redirect`,target:r(t,n.to.path)}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)}}catch(t){return{status:`failure`,failure:o(e.aborted,n.to,n.from,t)}}return{status:`continue`}}function d(e,t,n,r){return new Promise(i=>{let s=!1,c=e=>{s||(s=!0,i(e))};try{let i=e({...t,success:()=>c(),fail:e=>{c(o(a(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>c(),e=>c(o(a(e),n,r,e)))}catch(e){c(o(a(e),n,r,e))}})}async function f(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch(e){}}async function p(e,t,n){for(let r of e)try{await r(t,n)}catch(e){}}function m(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function h(t){return t.type===e.unknown||t.cause instanceof Error||t.type===e.aborted&&t.cause!==void 0&&!(typeof t.cause==`string`||m(t.cause))}export{o as createNavigationFailure,d as executeNavigationMethod,s as isNavigationFailure,c as isNavigationRedirectCandidate,f as runAfterEachHooks,p as runNavigationErrorHooks,u as runNavigationGuards,h as shouldEmitNavigationError};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RouteResolveCodec } from "../routerInternal/types.mjs";
|
|
2
|
-
import
|
|
2
|
+
import "../routerInternal/shared.mjs";
|
|
3
|
+
import { RouteLocationNormalizedLoaded, RouteLocationRaw, WevuBroadRouteMap } from "./types.mjs";
|
|
3
4
|
//#region src/router/resolve.d.ts
|
|
4
|
-
export declare function resolveRouteLocation(to: RouteLocationRaw
|
|
5
|
+
export declare function resolveRouteLocation(to: RouteLocationRaw<WevuBroadRouteMap>, currentPath?: string, codec?: RouteResolveCodec): RouteLocationNormalizedLoaded<WevuBroadRouteMap>;
|
|
5
6
|
//#endregion
|