wevu 6.16.1 → 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/README.md +8 -0
- package/dist/api.mjs +1 -2
- package/dist/chunk-CbfVNrr-.mjs +1 -0
- package/dist/compiler.mjs +1 -2
- package/dist/dev/api.mjs +3 -0
- package/dist/dev/compiler.mjs +3 -0
- package/dist/dev/fetch.mjs +3 -0
- package/dist/dev/index.mjs +8 -0
- package/dist/dev/jsx-runtime.mjs +1 -0
- package/dist/{ref-DuEgaxvT.mjs → dev/ref-BTTXccLL.mjs} +15 -0
- package/dist/dev/ref-BTTXccLL.mjs.map +1 -0
- package/dist/{router-Ck6g5XK5.mjs → dev/router-BZZnIx32.mjs} +14 -1
- package/dist/dev/router-BZZnIx32.mjs.map +1 -0
- package/dist/dev/router.mjs +1267 -0
- package/dist/dev/router.mjs.map +1 -0
- package/dist/{src-Bncvw6p2.mjs → dev/src-DjDCQerj.mjs} +348 -6
- package/dist/dev/src-DjDCQerj.mjs.map +1 -0
- package/dist/{store-BhbWIoTi.mjs → dev/store-Dr0zE_9B.mjs} +13 -1
- package/dist/dev/store-Dr0zE_9B.mjs.map +1 -0
- package/dist/dev/store.mjs +3 -0
- package/dist/dev/vue-demi.mjs +184 -0
- package/dist/dev/vue-demi.mjs.map +1 -0
- package/dist/dev/web-apis.mjs +5 -0
- package/dist/fetch.mjs +1 -2
- package/dist/{index-6sv3KnLP.d.mts → index-BKnpWfa6.d.mts} +132 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -6
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/ref-Bs--7iY3.mjs +1 -0
- package/dist/router-BtpVtHM4.mjs +1 -0
- package/dist/router.mjs +1 -1248
- package/dist/src-D9uUICz0.mjs +1 -0
- package/dist/store-B63-EIon.mjs +1 -0
- package/dist/store.mjs +1 -2
- package/dist/vue-demi.d.mts +3 -3
- package/dist/vue-demi.mjs +1 -24
- package/dist/web-apis.mjs +1 -3
- package/package.json +74 -2
- package/dist/chunk-D1SwGrFN.mjs +0 -27
|
@@ -1,9 +1,45 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
import "./
|
|
4
|
-
import { $ as pushHook, E as onDetached, J as assertInSetup, P as onPageScroll, Q as getCurrentSetupContext, S as setRuntimeAppProvidedValue, T as onAttached, X as callHookReturn, Y as callHookList, Z as getCurrentInstance, at as getMiniProgramGlobalObject, b as attachRuntimeProvideContext, et as setCurrentInstance, it as getCurrentMiniProgramRuntimeCapabilities, nt as getCurrentMiniProgramHostConfig, ot as getScopedSlotHostGlobalObject, q as onUnload, rt as getCurrentMiniProgramPages, st as supportsCurrentMiniProgramRuntimeCapability, tt as setCurrentSetupContext, ut as readonly, x as ensureRuntimeAppProvides, y as attachRuntimeLayoutProvideContext } from "./router-Ck6g5XK5.mjs";
|
|
1
|
+
import { A as track, C as effect, D as onScopeDispose, E as getCurrentScope, M as triggerEffects, N as nextTick, O as startBatch, P as queueJob, 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, j as trigger, k as stop, l as isReactive, m as clearPatchIndices, n as isRef, o as unref, p as shallowReactive, r as markAsRef, s as getReactiveVersion, t as customRef, u as markRaw, v as isObject$1, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-BTTXccLL.mjs";
|
|
2
|
+
import { i as computed, n as defineStore, r as createStore, t as storeToRefs } from "./store-Dr0zE_9B.mjs";
|
|
3
|
+
import { $ as pushHook, 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, J as assertInSetup, K as onUnhandledRejection, L as onReady, M as onMoved, N as onPageNotFound, O as onHide, P as onPageScroll, Q as getCurrentSetupContext, R as onResize, S as setRuntimeAppProvidedValue, T as onAttached, U as onShow, V as onShareAppMessage, W as onTabItemTap, X as callHookReturn, Y as callHookList, Z as getCurrentInstance, _ as provide, at as getMiniProgramGlobalObject, b as attachRuntimeProvideContext, ct as isProxy, dt as shallowReadonly, et as setCurrentInstance, g as injectGlobal, h as inject, it as getCurrentMiniProgramRuntimeCapabilities, j as onMemoryWarning, k as onLaunch, lt as isReadonly, m as hasInjectionContext, n as useNativeRouter, nt as getCurrentMiniProgramHostConfig, ot as getScopedSlotHostGlobalObject, q as onUnload, rt as getCurrentMiniProgramPages, st as supportsCurrentMiniProgramRuntimeCapability, t as useNativePageRouter, tt as setCurrentSetupContext, ut as readonly, v as provideGlobal, w as onAddToFavorites, x as ensureRuntimeAppProvides, y as attachRuntimeLayoutProvideContext, z as onRouteDone } from "./router-BZZnIx32.mjs";
|
|
5
4
|
import { WEVU_ATTRS_KEY, WEVU_EFFECT_SCOPE_KEY, WEVU_EXPOSED_KEY, WEVU_HOOKS_KEY, WEVU_INLINE_HANDLER, WEVU_INLINE_MAP_KEY, WEVU_IS_APP_INSTANCE_KEY, WEVU_LAYOUT_BRIDGE_PAGE_KEYS, WEVU_LAYOUT_HOST_BRIDGE_KEY, WEVU_MODEL_HANDLER, WEVU_NATIVE_INSTANCE_KEY, WEVU_ON_BEFORE_UPDATE_HOOK, WEVU_ON_LOAD_CALLED_KEY, WEVU_ON_UPDATED_HOOK, WEVU_OWNER_HANDLER, WEVU_PAGE_LAYOUT_NAME_KEY, WEVU_PAGE_LAYOUT_NONE, WEVU_PAGE_LAYOUT_PROPS_KEY, WEVU_PAGE_LAYOUT_SETTER_KEY, WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY, WEVU_PARENT_INSTANCE_KEY, WEVU_PENDING_PROP_VALUES_KEY, WEVU_PROPS_KEY, WEVU_PROP_KEYS_KEY, WEVU_PUBLIC_RUNTIME_KEY, WEVU_READY_CALLED_KEY, WEVU_RESERVED_METHOD_PREFIX, WEVU_ROUTE_DONE_CALLED_KEY, WEVU_ROUTE_DONE_IN_TICK_KEY, WEVU_RUNTIME_APP_KEY, WEVU_RUNTIME_KEY, WEVU_SCOPED_SLOT_CREATOR_KEY, WEVU_SETUP_CONTEXT_INSTANCE_KEY, WEVU_SLOT_NAMES_PROP, WEVU_SLOT_OWNER_ID_KEY, WEVU_SLOT_OWNER_ID_PROP, WEVU_SLOT_OWNER_KEY, WEVU_SLOT_PROPS_DATA_KEY, WEVU_SLOT_PROPS_KEY, WEVU_SLOT_SCOPE_KEY, WEVU_TEMPLATE_REFS_CALLBACKS_KEY, WEVU_TEMPLATE_REFS_KEY, WEVU_TEMPLATE_REFS_PENDING_KEY, WEVU_TEMPLATE_REF_MAP_KEY, WEVU_WATCH_STOPS_KEY } from "@weapp-core/constants";
|
|
6
5
|
import { resolveMiniProgramPageKeys } from "@weapp-core/shared";
|
|
6
|
+
import { wpi } from "@wevu/api";
|
|
7
|
+
|
|
8
|
+
//#region \0rolldown/runtime.js
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __exportAll = (all, no_symbols) => {
|
|
14
|
+
let target = {};
|
|
15
|
+
for (var name in all) {
|
|
16
|
+
__defProp(target, name, {
|
|
17
|
+
get: all[name],
|
|
18
|
+
enumerable: true
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
if (!no_symbols) {
|
|
22
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
23
|
+
}
|
|
24
|
+
return target;
|
|
25
|
+
};
|
|
26
|
+
var __copyProps = (to, from, except, desc) => {
|
|
27
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
29
|
+
key = keys[i];
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
31
|
+
__defProp(to, key, {
|
|
32
|
+
get: ((k) => from[k]).bind(null, key),
|
|
33
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return to;
|
|
39
|
+
};
|
|
40
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
7
43
|
//#region src/reactivity/shallowRef.ts
|
|
8
44
|
/**
|
|
9
45
|
* 创建一个“浅层” ref:它只在 .value 被整体替换时触发依赖,不会对内部对象做深层响应式处理。
|
|
@@ -56,6 +92,7 @@ function triggerRef(ref) {
|
|
|
56
92
|
ref.value = ref.value;
|
|
57
93
|
}
|
|
58
94
|
}
|
|
95
|
+
|
|
59
96
|
//#endregion
|
|
60
97
|
//#region src/reactivity/toRefs.ts
|
|
61
98
|
function toRef(object, key, defaultValue) {
|
|
@@ -93,6 +130,7 @@ function toRefs(object) {
|
|
|
93
130
|
for (const key in object) result[key] = toRef(object, key);
|
|
94
131
|
return result;
|
|
95
132
|
}
|
|
133
|
+
|
|
96
134
|
//#endregion
|
|
97
135
|
//#region src/reactivity/traverse.ts
|
|
98
136
|
/**
|
|
@@ -126,6 +164,7 @@ function traverse(value, depth = Infinity, seen = /* @__PURE__ */ new Map()) {
|
|
|
126
164
|
for (const key in target) traverse(value[key], nextDepth, seen);
|
|
127
165
|
return value;
|
|
128
166
|
}
|
|
167
|
+
|
|
129
168
|
//#endregion
|
|
130
169
|
//#region src/runtime/hooks/vue.ts
|
|
131
170
|
/**
|
|
@@ -201,6 +240,7 @@ function onServerPrefetch(_handler) {
|
|
|
201
240
|
function callUpdateHooks(target, phase) {
|
|
202
241
|
callHookList(target, phase === "before" ? WEVU_ON_BEFORE_UPDATE_HOOK : WEVU_ON_UPDATED_HOOK);
|
|
203
242
|
}
|
|
243
|
+
|
|
204
244
|
//#endregion
|
|
205
245
|
//#region src/reactivity/watch/types.ts
|
|
206
246
|
let __deepWatchStrategy = "version";
|
|
@@ -218,6 +258,7 @@ function setDeepWatchStrategy(strategy) {
|
|
|
218
258
|
function getDeepWatchStrategy() {
|
|
219
259
|
return __deepWatchStrategy;
|
|
220
260
|
}
|
|
261
|
+
|
|
221
262
|
//#endregion
|
|
222
263
|
//#region src/reactivity/watch/helpers.ts
|
|
223
264
|
function resolveWatchSource(item) {
|
|
@@ -281,6 +322,7 @@ function dispatchScheduledJob(job, flush, isFirstRun, scheduler) {
|
|
|
281
322
|
if (isFirstRun) job();
|
|
282
323
|
else queueJob(job);
|
|
283
324
|
}
|
|
325
|
+
|
|
284
326
|
//#endregion
|
|
285
327
|
//#region src/reactivity/watch.ts
|
|
286
328
|
function watch(source, cb, options = {}) {
|
|
@@ -433,9 +475,15 @@ function watchSyncEffect(effectFn, options = {}) {
|
|
|
433
475
|
flush: "sync"
|
|
434
476
|
});
|
|
435
477
|
}
|
|
478
|
+
|
|
479
|
+
//#endregion
|
|
480
|
+
//#region package.json
|
|
481
|
+
var version$1 = "6.16.3";
|
|
482
|
+
|
|
436
483
|
//#endregion
|
|
437
484
|
//#region src/version.ts
|
|
438
|
-
const version =
|
|
485
|
+
const version = version$1;
|
|
486
|
+
|
|
439
487
|
//#endregion
|
|
440
488
|
//#region src/utils.ts
|
|
441
489
|
function capitalize(str) {
|
|
@@ -446,6 +494,7 @@ function toPathSegments(path) {
|
|
|
446
494
|
if (!path) return [];
|
|
447
495
|
return path.split(".").map((segment) => segment.trim()).filter(Boolean);
|
|
448
496
|
}
|
|
497
|
+
|
|
449
498
|
//#endregion
|
|
450
499
|
//#region src/runtime/internal.ts
|
|
451
500
|
function setComputedValue(setters, key, value) {
|
|
@@ -461,6 +510,7 @@ function parseModelEventValue(event) {
|
|
|
461
510
|
}
|
|
462
511
|
return event;
|
|
463
512
|
}
|
|
513
|
+
|
|
464
514
|
//#endregion
|
|
465
515
|
//#region src/runtime/bindModel.ts
|
|
466
516
|
function setWithSegments(target, segments, value) {
|
|
@@ -543,6 +593,7 @@ function createBindModel(publicInstance, state, computedRefs, computedSetters) {
|
|
|
543
593
|
};
|
|
544
594
|
return bindModel;
|
|
545
595
|
}
|
|
596
|
+
|
|
546
597
|
//#endregion
|
|
547
598
|
//#region src/runtime/setupTracking.ts
|
|
548
599
|
function isPlainObject$2(value) {
|
|
@@ -594,6 +645,7 @@ function touchSetupBinding(value, seen = /* @__PURE__ */ new WeakSet()) {
|
|
|
594
645
|
seen.add(value);
|
|
595
646
|
getTrackableChildren(value).forEach((item) => touchSetupBinding(item, seen));
|
|
596
647
|
}
|
|
648
|
+
|
|
597
649
|
//#endregion
|
|
598
650
|
//#region src/runtime/nativeBridge.ts
|
|
599
651
|
const NATIVE_BRIDGE_MARKER = "__wevu_native_bridge__";
|
|
@@ -612,6 +664,7 @@ function markNativeBridgeMethod(method) {
|
|
|
612
664
|
function isNativeBridgeMethod(method) {
|
|
613
665
|
return typeof method === "function" && Boolean(method[NATIVE_BRIDGE_MARKER]);
|
|
614
666
|
}
|
|
667
|
+
|
|
615
668
|
//#endregion
|
|
616
669
|
//#region src/runtime/app/computed.ts
|
|
617
670
|
function createComputedAccessors(options) {
|
|
@@ -674,6 +727,7 @@ function createComputedAccessors(options) {
|
|
|
674
727
|
})
|
|
675
728
|
};
|
|
676
729
|
}
|
|
730
|
+
|
|
677
731
|
//#endregion
|
|
678
732
|
//#region src/runtime/app/context.ts
|
|
679
733
|
function createRuntimeContext(options) {
|
|
@@ -827,6 +881,7 @@ function createRuntimeContext(options) {
|
|
|
827
881
|
}
|
|
828
882
|
};
|
|
829
883
|
}
|
|
884
|
+
|
|
830
885
|
//#endregion
|
|
831
886
|
//#region src/runtime/app/diagnostics.ts
|
|
832
887
|
function isFallbackReason(reason) {
|
|
@@ -855,6 +910,7 @@ function createDiagnosticsLogger(mode) {
|
|
|
855
910
|
console.info(message);
|
|
856
911
|
};
|
|
857
912
|
}
|
|
913
|
+
|
|
858
914
|
//#endregion
|
|
859
915
|
//#region src/runtime/noSetData.ts
|
|
860
916
|
const NO_SETDATA = Symbol("wevu.noSetData");
|
|
@@ -870,6 +926,7 @@ function markNoSetData(value) {
|
|
|
870
926
|
function isNoSetData(value) {
|
|
871
927
|
return typeof value === "object" && value !== null && value[NO_SETDATA] === true;
|
|
872
928
|
}
|
|
929
|
+
|
|
873
930
|
//#endregion
|
|
874
931
|
//#region src/runtime/diff.ts
|
|
875
932
|
function isPlainObject$1(value) {
|
|
@@ -1023,6 +1080,7 @@ function diffSnapshots(prev, next, options) {
|
|
|
1023
1080
|
}
|
|
1024
1081
|
return diff;
|
|
1025
1082
|
}
|
|
1083
|
+
|
|
1026
1084
|
//#endregion
|
|
1027
1085
|
//#region src/runtime/app/setData/payload.ts
|
|
1028
1086
|
function collapsePayload(input) {
|
|
@@ -1179,6 +1237,7 @@ function mergeSiblingPayload(options) {
|
|
|
1179
1237
|
merged
|
|
1180
1238
|
};
|
|
1181
1239
|
}
|
|
1240
|
+
|
|
1182
1241
|
//#endregion
|
|
1183
1242
|
//#region src/runtime/app/setData/snapshot.ts
|
|
1184
1243
|
function isPlainObjectLike(value) {
|
|
@@ -1278,6 +1337,7 @@ function collectSnapshot(options) {
|
|
|
1278
1337
|
}
|
|
1279
1338
|
return out;
|
|
1280
1339
|
}
|
|
1340
|
+
|
|
1281
1341
|
//#endregion
|
|
1282
1342
|
//#region src/runtime/app/setData/patchScheduler.ts
|
|
1283
1343
|
function runPatchUpdate(options) {
|
|
@@ -1423,6 +1483,7 @@ function runPatchUpdate(options) {
|
|
|
1423
1483
|
payloadKeys: Object.keys(collapsedPayload).length
|
|
1424
1484
|
});
|
|
1425
1485
|
}
|
|
1486
|
+
|
|
1426
1487
|
//#endregion
|
|
1427
1488
|
//#region src/runtime/app/setData/scheduler.ts
|
|
1428
1489
|
function createSetDataScheduler(options) {
|
|
@@ -1658,6 +1719,7 @@ function createSetDataScheduler(options) {
|
|
|
1658
1719
|
getLatestSnapshot: () => latestSnapshot
|
|
1659
1720
|
};
|
|
1660
1721
|
}
|
|
1722
|
+
|
|
1661
1723
|
//#endregion
|
|
1662
1724
|
//#region src/runtime/app/setDataOptions.ts
|
|
1663
1725
|
function resolveSetDataOptions(setDataOptions) {
|
|
@@ -1717,6 +1779,7 @@ function resolveSetDataOptions(setDataOptions) {
|
|
|
1717
1779
|
shouldIncludeKey
|
|
1718
1780
|
};
|
|
1719
1781
|
}
|
|
1782
|
+
|
|
1720
1783
|
//#endregion
|
|
1721
1784
|
//#region src/runtime/app/mount.ts
|
|
1722
1785
|
function createWatchStopHandle(cleanup, baseHandle) {
|
|
@@ -1920,6 +1983,7 @@ function createRuntimeMount(options) {
|
|
|
1920
1983
|
return runtimeInstance;
|
|
1921
1984
|
};
|
|
1922
1985
|
}
|
|
1986
|
+
|
|
1923
1987
|
//#endregion
|
|
1924
1988
|
//#region src/runtime/defaults.ts
|
|
1925
1989
|
const INTERNAL_DEFAULTS_SCOPE_KEY = "__wevuDefaultsScope";
|
|
@@ -1978,6 +2042,7 @@ function applyWevuAppDefaults(options) {
|
|
|
1978
2042
|
function applyWevuComponentDefaults(options) {
|
|
1979
2043
|
return mergeWithDefaults(currentDefaults.component, options);
|
|
1980
2044
|
}
|
|
2045
|
+
|
|
1981
2046
|
//#endregion
|
|
1982
2047
|
//#region src/runtime/register/inline.ts
|
|
1983
2048
|
const AMP_RE$1 = /&/g;
|
|
@@ -2117,6 +2182,7 @@ function runInlineExpression(ctx, expr, event, inlineMap) {
|
|
|
2117
2182
|
const handler = ctx === null || ctx === void 0 ? void 0 : ctx[handlerName];
|
|
2118
2183
|
if (typeof handler === "function") return handler.apply(ctx, resolvedArgs);
|
|
2119
2184
|
}
|
|
2185
|
+
|
|
2120
2186
|
//#endregion
|
|
2121
2187
|
//#region src/runtime/register/component/lifecycle/platform.ts
|
|
2122
2188
|
let miniProgramGlobalPatched = false;
|
|
@@ -2204,6 +2270,7 @@ function ensurePageShareMenus(options) {
|
|
|
2204
2270
|
break;
|
|
2205
2271
|
} catch (_unused) {}
|
|
2206
2272
|
}
|
|
2273
|
+
|
|
2207
2274
|
//#endregion
|
|
2208
2275
|
//#region src/runtime/pageLayout.ts
|
|
2209
2276
|
function resolveCurrentPageInstance$1() {
|
|
@@ -2264,6 +2331,7 @@ function setPageLayout(layout, props) {
|
|
|
2264
2331
|
function resolveRuntimePageLayoutName(layout) {
|
|
2265
2332
|
return layout === false ? WEVU_PAGE_LAYOUT_NONE : layout;
|
|
2266
2333
|
}
|
|
2334
|
+
|
|
2267
2335
|
//#endregion
|
|
2268
2336
|
//#region src/runtime/scopedSlots.ts
|
|
2269
2337
|
const ownerStore = /* @__PURE__ */ new Map();
|
|
@@ -2330,6 +2398,7 @@ function attachOwnerSnapshot(target, runtime, ownerId) {
|
|
|
2330
2398
|
if (propsSource && typeof propsSource === "object") for (const [key, value] of Object.entries(propsSource)) snapshot[key] = value;
|
|
2331
2399
|
updateOwnerSnapshot(ownerId, snapshot, runtime.proxy);
|
|
2332
2400
|
}
|
|
2401
|
+
|
|
2333
2402
|
//#endregion
|
|
2334
2403
|
//#region src/runtime/templateRefs/helpers.ts
|
|
2335
2404
|
function isComponentRef(binding) {
|
|
@@ -2550,6 +2619,7 @@ function buildTemplateRefValue(target, binding, result) {
|
|
|
2550
2619
|
if (!result) return null;
|
|
2551
2620
|
return createTemplateRefWrapper(target, binding.selector, { multiple: false });
|
|
2552
2621
|
}
|
|
2622
|
+
|
|
2553
2623
|
//#endregion
|
|
2554
2624
|
//#region src/runtime/templateRefs.ts
|
|
2555
2625
|
function updateTemplateRefs(target, onResolved) {
|
|
@@ -2704,6 +2774,7 @@ function clearTemplateRefs(target) {
|
|
|
2704
2774
|
}
|
|
2705
2775
|
for (const key of Object.keys(refsContainer)) if (!nextNames.has(key)) delete refsContainer[key];
|
|
2706
2776
|
}
|
|
2777
|
+
|
|
2707
2778
|
//#endregion
|
|
2708
2779
|
//#region src/runtime/register/runtimeInstance/setupContext.ts
|
|
2709
2780
|
const setupInstanceMethodNames = [
|
|
@@ -2908,6 +2979,7 @@ function ensureSetupContextInstance(target, runtime) {
|
|
|
2908
2979
|
}
|
|
2909
2980
|
return setupInstance;
|
|
2910
2981
|
}
|
|
2982
|
+
|
|
2911
2983
|
//#endregion
|
|
2912
2984
|
//#region src/runtime/register/runtimeInstance/methodBridge.ts
|
|
2913
2985
|
function bridgeRuntimeMethodsToTarget(target, runtime) {
|
|
@@ -2924,6 +2996,7 @@ function bridgeRuntimeMethodsToTarget(target, runtime) {
|
|
|
2924
2996
|
}
|
|
2925
2997
|
} catch (_unused) {}
|
|
2926
2998
|
}
|
|
2999
|
+
|
|
2927
3000
|
//#endregion
|
|
2928
3001
|
//#region src/runtime/layoutComponentMatcher.ts
|
|
2929
3002
|
const DEFAULT_LAYOUT_COMPONENT_PATH_PREFIX = "layouts/";
|
|
@@ -2932,6 +3005,7 @@ function isRuntimeLayoutComponentTarget(target) {
|
|
|
2932
3005
|
const componentPath = target.is;
|
|
2933
3006
|
return typeof componentPath === "string" && runtimeLayoutComponentMatcher(componentPath, target);
|
|
2934
3007
|
}
|
|
3008
|
+
|
|
2935
3009
|
//#endregion
|
|
2936
3010
|
//#region src/runtime/register/runtimeInstance/provideContext.ts
|
|
2937
3011
|
function resolveRuntimeParentInstance(target) {
|
|
@@ -2956,6 +3030,7 @@ function attachRuntimeProvideParentContext(target, runtimeApp) {
|
|
|
2956
3030
|
attachRuntimeProvideContext(target, runtimeApp, resolveRuntimeParentInstance(target));
|
|
2957
3031
|
attachRuntimeLayoutParentContext(target);
|
|
2958
3032
|
}
|
|
3033
|
+
|
|
2959
3034
|
//#endregion
|
|
2960
3035
|
//#region src/runtime/register/setup.ts
|
|
2961
3036
|
function runSetupFunction(setup, props, context) {
|
|
@@ -2974,6 +3049,7 @@ function runSetupFunction(setup, props, context) {
|
|
|
2974
3049
|
runtime: runtimeContext
|
|
2975
3050
|
});
|
|
2976
3051
|
}
|
|
3052
|
+
|
|
2977
3053
|
//#endregion
|
|
2978
3054
|
//#region src/runtime/register/runtimeInstance/setupPhase.ts
|
|
2979
3055
|
function runRuntimeSetupPhase(options) {
|
|
@@ -3109,6 +3185,7 @@ function runRuntimeSetupPhase(options) {
|
|
|
3109
3185
|
setCurrentInstance(void 0);
|
|
3110
3186
|
}
|
|
3111
3187
|
}
|
|
3188
|
+
|
|
3112
3189
|
//#endregion
|
|
3113
3190
|
//#region src/runtime/register/runtimeInstance/utils.ts
|
|
3114
3191
|
function attachRuntimeProxyProps(state, props) {
|
|
@@ -3192,6 +3269,7 @@ function syncRuntimeProps(props, mpProperties) {
|
|
|
3192
3269
|
} catch (_unused6) {}
|
|
3193
3270
|
for (const [key, value] of Object.entries(mpProperties)) props[key] = value;
|
|
3194
3271
|
}
|
|
3272
|
+
|
|
3195
3273
|
//#endregion
|
|
3196
3274
|
//#region src/runtime/register/setDataFrequencyWarning.ts
|
|
3197
3275
|
function isObject(value) {
|
|
@@ -3282,6 +3360,7 @@ function createSetDataHighFrequencyWarningMonitor(options) {
|
|
|
3282
3360
|
logger(`[wevu:setData] 检测到高频 setData 调用:${callTimes.length} 次/${resolved.sampleWindowMs}ms(${options.targetLabel})。建议合并更新或降低调用频率。`);
|
|
3283
3361
|
};
|
|
3284
3362
|
}
|
|
3363
|
+
|
|
3285
3364
|
//#endregion
|
|
3286
3365
|
//#region src/runtime/register/watch.ts
|
|
3287
3366
|
function normalizeWatchDescriptor(descriptor, runtime, instance) {
|
|
@@ -3333,6 +3412,7 @@ function registerWatches(runtime, watchMap, instance) {
|
|
|
3333
3412
|
}
|
|
3334
3413
|
return stops;
|
|
3335
3414
|
}
|
|
3415
|
+
|
|
3336
3416
|
//#endregion
|
|
3337
3417
|
//#region src/runtime/register/runtimeInstance.ts
|
|
3338
3418
|
function attachPageLayoutSetter(target) {
|
|
@@ -3543,6 +3623,7 @@ function teardownRuntimeInstance(target) {
|
|
|
3543
3623
|
delete target.__wevu;
|
|
3544
3624
|
if (WEVU_PUBLIC_RUNTIME_KEY in target) delete target[WEVU_PUBLIC_RUNTIME_KEY];
|
|
3545
3625
|
}
|
|
3626
|
+
|
|
3546
3627
|
//#endregion
|
|
3547
3628
|
//#region src/runtime/register/app.ts
|
|
3548
3629
|
const APP_GLOBAL_LISTENER_STORE_KEY = "__wevuAppGlobalListeners";
|
|
@@ -3693,6 +3774,7 @@ function registerApp(runtimeApp, methods, watch, setup, mpOptions) {
|
|
|
3693
3774
|
}
|
|
3694
3775
|
App(appOptions);
|
|
3695
3776
|
}
|
|
3777
|
+
|
|
3696
3778
|
//#endregion
|
|
3697
3779
|
//#region src/runtime/register/component/features.ts
|
|
3698
3780
|
function resolveComponentFeatures(options) {
|
|
@@ -3733,6 +3815,7 @@ function resolveComponentFeatures(options) {
|
|
|
3733
3815
|
effectiveOnAddToFavorites: typeof userOnAddToFavorites === "function" ? userOnAddToFavorites : (() => ({}))
|
|
3734
3816
|
};
|
|
3735
3817
|
}
|
|
3818
|
+
|
|
3736
3819
|
//#endregion
|
|
3737
3820
|
//#region src/runtime/register/component/lifecycle/optionalHooks.ts
|
|
3738
3821
|
function attachOptionalPageLifecycleHooks(pageLifecycleHooks, options) {
|
|
@@ -3790,6 +3873,7 @@ function attachOptionalPageLifecycleHooks(pageLifecycleHooks, options) {
|
|
|
3790
3873
|
return effectiveOnAddToFavorites.apply(this, args);
|
|
3791
3874
|
};
|
|
3792
3875
|
}
|
|
3876
|
+
|
|
3793
3877
|
//#endregion
|
|
3794
3878
|
//#region src/runtime/register/component/lifecycle.ts
|
|
3795
3879
|
function createPageLifecycleHooks(options) {
|
|
@@ -3886,6 +3970,7 @@ function createPageLifecycleHooks(options) {
|
|
|
3886
3970
|
});
|
|
3887
3971
|
return pageLifecycleHooks;
|
|
3888
3972
|
}
|
|
3973
|
+
|
|
3889
3974
|
//#endregion
|
|
3890
3975
|
//#region src/runtime/register/component/methods.ts
|
|
3891
3976
|
function createComponentMethods(options) {
|
|
@@ -3959,6 +4044,7 @@ function createComponentMethods(options) {
|
|
|
3959
4044
|
}
|
|
3960
4045
|
return { finalMethods };
|
|
3961
4046
|
}
|
|
4047
|
+
|
|
3962
4048
|
//#endregion
|
|
3963
4049
|
//#region src/runtime/register/component/options.ts
|
|
3964
4050
|
function cloneInstanceFieldValue(value, cache = /* @__PURE__ */ new WeakMap()) {
|
|
@@ -4127,6 +4213,7 @@ function prepareComponentOptions(mpOptions) {
|
|
|
4127
4213
|
applyExtraInstanceFields
|
|
4128
4214
|
};
|
|
4129
4215
|
}
|
|
4216
|
+
|
|
4130
4217
|
//#endregion
|
|
4131
4218
|
//#region src/runtime/register/snapshot.ts
|
|
4132
4219
|
function refreshOwnerSnapshotFromInstance(instance) {
|
|
@@ -4139,6 +4226,7 @@ function refreshOwnerSnapshotFromInstance(instance) {
|
|
|
4139
4226
|
if (propsSource && typeof propsSource === "object") for (const [key, value] of Object.entries(propsSource)) snapshot[key] = value;
|
|
4140
4227
|
updateOwnerSnapshot(ownerId, snapshot, runtime.proxy);
|
|
4141
4228
|
}
|
|
4229
|
+
|
|
4142
4230
|
//#endregion
|
|
4143
4231
|
//#region src/runtime/register/component/props.ts
|
|
4144
4232
|
function createPropsSync(options) {
|
|
@@ -4245,6 +4333,7 @@ function createPropsSync(options) {
|
|
|
4245
4333
|
finalObservers
|
|
4246
4334
|
};
|
|
4247
4335
|
}
|
|
4336
|
+
|
|
4248
4337
|
//#endregion
|
|
4249
4338
|
//#region src/runtime/layoutBridge.ts
|
|
4250
4339
|
const pageLayoutBridges = /* @__PURE__ */ new Map();
|
|
@@ -4448,6 +4537,7 @@ function useLayoutHosts(hosts) {
|
|
|
4448
4537
|
return resolveHostEntry(hosts[key]);
|
|
4449
4538
|
} });
|
|
4450
4539
|
}
|
|
4540
|
+
|
|
4451
4541
|
//#endregion
|
|
4452
4542
|
//#region src/runtime/register/component/registerDefinition.ts
|
|
4453
4543
|
function registerComponentDefinition(options) {
|
|
@@ -4623,6 +4713,7 @@ function registerComponentDefinition(options) {
|
|
|
4623
4713
|
options: finalOptions
|
|
4624
4714
|
});
|
|
4625
4715
|
}
|
|
4716
|
+
|
|
4626
4717
|
//#endregion
|
|
4627
4718
|
//#region src/runtime/register/component.ts
|
|
4628
4719
|
/**
|
|
@@ -4735,6 +4826,7 @@ function registerComponent(runtimeApp, methods, watch, setup, mpOptions) {
|
|
|
4735
4826
|
getRuntimeOwnerLabel
|
|
4736
4827
|
});
|
|
4737
4828
|
}
|
|
4829
|
+
|
|
4738
4830
|
//#endregion
|
|
4739
4831
|
//#region src/runtime/app.ts
|
|
4740
4832
|
function createApp(options) {
|
|
@@ -4805,6 +4897,7 @@ function createApp(options) {
|
|
|
4805
4897
|
}
|
|
4806
4898
|
return runtimeApp;
|
|
4807
4899
|
}
|
|
4900
|
+
|
|
4808
4901
|
//#endregion
|
|
4809
4902
|
//#region src/runtime/define/props.ts
|
|
4810
4903
|
const ALLOW_NULL_PROP_INPUT_KEY = "__wevu_allowNullPropInput";
|
|
@@ -4980,6 +5073,7 @@ function normalizeProps(baseOptions, props, explicitProperties) {
|
|
|
4980
5073
|
properties: attachInternalProps(properties)
|
|
4981
5074
|
};
|
|
4982
5075
|
}
|
|
5076
|
+
|
|
4983
5077
|
//#endregion
|
|
4984
5078
|
//#region src/runtime/define/scopedSlotOptions.ts
|
|
4985
5079
|
const AMP_RE = /&/g;
|
|
@@ -5101,6 +5195,7 @@ function createScopedSlotOptions(overrides) {
|
|
|
5101
5195
|
};
|
|
5102
5196
|
return baseOptions;
|
|
5103
5197
|
}
|
|
5198
|
+
|
|
5104
5199
|
//#endregion
|
|
5105
5200
|
//#region src/runtime/define/setupResult.ts
|
|
5106
5201
|
function isPlainObject(value) {
|
|
@@ -5189,6 +5284,7 @@ function applySetupResult(runtime, target, result) {
|
|
|
5189
5284
|
}
|
|
5190
5285
|
}
|
|
5191
5286
|
}
|
|
5287
|
+
|
|
5192
5288
|
//#endregion
|
|
5193
5289
|
//#region src/runtime/define.ts
|
|
5194
5290
|
let scopedSlotCreator;
|
|
@@ -5258,6 +5354,7 @@ function createWevuScopedSlotComponent(overrides) {
|
|
|
5258
5354
|
}
|
|
5259
5355
|
scopedSlotCreator = createWevuScopedSlotComponent;
|
|
5260
5356
|
ensureScopedSlotComponentGlobal();
|
|
5357
|
+
|
|
5261
5358
|
//#endregion
|
|
5262
5359
|
//#region src/runtime/disposables.ts
|
|
5263
5360
|
const DISPOSABLE_METHODS = [
|
|
@@ -5333,6 +5430,78 @@ function useDisposables() {
|
|
|
5333
5430
|
setInterval: bagSetInterval
|
|
5334
5431
|
};
|
|
5335
5432
|
}
|
|
5433
|
+
|
|
5434
|
+
//#endregion
|
|
5435
|
+
//#region src/runtime/elementIntersectionObserver.ts
|
|
5436
|
+
function createObserverFromContext(context, options) {
|
|
5437
|
+
const nativeContext = context;
|
|
5438
|
+
const creator = nativeContext.createIntersectionObserver;
|
|
5439
|
+
if (typeof creator === "function") return creator.call(nativeContext, options);
|
|
5440
|
+
if (!supportsCurrentMiniProgramRuntimeCapability("globalCreateIntersectionObserver")) return;
|
|
5441
|
+
const miniProgramGlobal = getMiniProgramGlobalObject();
|
|
5442
|
+
const globalCreator = miniProgramGlobal === null || miniProgramGlobal === void 0 ? void 0 : miniProgramGlobal.createIntersectionObserver;
|
|
5443
|
+
if (typeof globalCreator !== "function") return;
|
|
5444
|
+
return getCurrentMiniProgramRuntimeCapabilities().intersectionObserverScopeByParameter ? globalCreator.call(miniProgramGlobal, context, options) : globalCreator.call(miniProgramGlobal, options);
|
|
5445
|
+
}
|
|
5446
|
+
function applyRelativeToViewport(observer, relativeToViewport) {
|
|
5447
|
+
var _observer$relativeToV;
|
|
5448
|
+
if (relativeToViewport === false || typeof observer.relativeToViewport !== "function") return observer;
|
|
5449
|
+
const margins = relativeToViewport && typeof relativeToViewport === "object" ? relativeToViewport : void 0;
|
|
5450
|
+
return (_observer$relativeToV = observer.relativeToViewport(margins)) !== null && _observer$relativeToV !== void 0 ? _observer$relativeToV : observer;
|
|
5451
|
+
}
|
|
5452
|
+
/**
|
|
5453
|
+
* 观察当前组件或页面内的节点可见性,并在卸载时自动断开。
|
|
5454
|
+
*/
|
|
5455
|
+
function useElementIntersectionObserver(options) {
|
|
5456
|
+
var _options$context;
|
|
5457
|
+
const context = (_options$context = options.context) !== null && _options$context !== void 0 ? _options$context : getCurrentInstance();
|
|
5458
|
+
if (!context || !getCurrentSetupContext()) throw new Error("useElementIntersectionObserver() 必须在 setup() 的同步阶段调用");
|
|
5459
|
+
let observer = null;
|
|
5460
|
+
const disconnect = () => {
|
|
5461
|
+
if (!observer) return;
|
|
5462
|
+
try {
|
|
5463
|
+
observer.disconnect();
|
|
5464
|
+
} catch (_unused) {}
|
|
5465
|
+
observer = null;
|
|
5466
|
+
};
|
|
5467
|
+
const observe = () => {
|
|
5468
|
+
var _options$observerOpti, _options$relativeToVi;
|
|
5469
|
+
disconnect();
|
|
5470
|
+
const selector = toValue(options.selector);
|
|
5471
|
+
if (!(options.enabled == null ? true : toValue(options.enabled)) || !selector) return null;
|
|
5472
|
+
const nextObserver = createObserverFromContext(context, toValue((_options$observerOpti = options.observerOptions) !== null && _options$observerOpti !== void 0 ? _options$observerOpti : {}));
|
|
5473
|
+
if (!nextObserver || typeof nextObserver.observe !== "function") return null;
|
|
5474
|
+
observer = applyRelativeToViewport(nextObserver, (_options$relativeToVi = options.relativeToViewport) !== null && _options$relativeToVi !== void 0 ? _options$relativeToVi : true);
|
|
5475
|
+
observer.observe(selector, (result) => {
|
|
5476
|
+
var _options$onObserve;
|
|
5477
|
+
return (_options$onObserve = options.onObserve) === null || _options$onObserve === void 0 ? void 0 : _options$onObserve.call(options, result);
|
|
5478
|
+
});
|
|
5479
|
+
return observer;
|
|
5480
|
+
};
|
|
5481
|
+
watch(() => {
|
|
5482
|
+
var _options$observerOpti2;
|
|
5483
|
+
return [
|
|
5484
|
+
toValue(options.selector),
|
|
5485
|
+
options.enabled == null ? true : toValue(options.enabled),
|
|
5486
|
+
toValue((_options$observerOpti2 = options.observerOptions) !== null && _options$observerOpti2 !== void 0 ? _options$observerOpti2 : {}),
|
|
5487
|
+
options.relativeToViewport
|
|
5488
|
+
];
|
|
5489
|
+
}, () => {
|
|
5490
|
+
observe();
|
|
5491
|
+
}, { deep: true });
|
|
5492
|
+
onMounted(observe);
|
|
5493
|
+
onUnmounted(disconnect);
|
|
5494
|
+
onUnload(disconnect);
|
|
5495
|
+
onDetached(disconnect);
|
|
5496
|
+
return {
|
|
5497
|
+
disconnect,
|
|
5498
|
+
observe,
|
|
5499
|
+
get observer() {
|
|
5500
|
+
return observer;
|
|
5501
|
+
}
|
|
5502
|
+
};
|
|
5503
|
+
}
|
|
5504
|
+
|
|
5336
5505
|
//#endregion
|
|
5337
5506
|
//#region src/runtime/intersectionObserver.ts
|
|
5338
5507
|
function createObserverFromInstance(instance, options) {
|
|
@@ -5372,6 +5541,99 @@ function useIntersectionObserver(options = {}) {
|
|
|
5372
5541
|
onDetached(disconnect);
|
|
5373
5542
|
return observer;
|
|
5374
5543
|
}
|
|
5544
|
+
|
|
5545
|
+
//#endregion
|
|
5546
|
+
//#region src/runtime/pageEnvironment.ts
|
|
5547
|
+
function normalizeRoute(route) {
|
|
5548
|
+
var _route$split$0$replac, _route$split$;
|
|
5549
|
+
return route ? (_route$split$0$replac = (_route$split$ = route.split("?")[0]) === null || _route$split$ === void 0 ? void 0 : _route$split$.replace(/^\/+/, "")) !== null && _route$split$0$replac !== void 0 ? _route$split$0$replac : "" : "";
|
|
5550
|
+
}
|
|
5551
|
+
/**
|
|
5552
|
+
* 获取当前小程序页面栈的稳定快照。
|
|
5553
|
+
*/
|
|
5554
|
+
function getCurrentPageStackSnapshot() {
|
|
5555
|
+
const pages = getCurrentMiniProgramPages();
|
|
5556
|
+
const currentPage = pages.at(-1);
|
|
5557
|
+
const stackLength = pages.length || 1;
|
|
5558
|
+
return {
|
|
5559
|
+
canGoBack: stackLength > 1,
|
|
5560
|
+
currentRoute: normalizeRoute(currentPage === null || currentPage === void 0 ? void 0 : currentPage.route),
|
|
5561
|
+
stackLength
|
|
5562
|
+
};
|
|
5563
|
+
}
|
|
5564
|
+
/**
|
|
5565
|
+
* 在 setup 中跟踪当前小程序页面栈状态。
|
|
5566
|
+
*/
|
|
5567
|
+
function usePageStack(options = {}) {
|
|
5568
|
+
var _options$autoRefresh;
|
|
5569
|
+
if (!getCurrentSetupContext()) throw new Error("usePageStack() 必须在 setup() 的同步阶段调用");
|
|
5570
|
+
const snapshot = getCurrentPageStackSnapshot();
|
|
5571
|
+
const currentRoute = ref(snapshot.currentRoute);
|
|
5572
|
+
const stackLength = ref(snapshot.stackLength);
|
|
5573
|
+
const canGoBack = computed(() => stackLength.value > 1);
|
|
5574
|
+
const refresh = () => {
|
|
5575
|
+
const nextSnapshot = getCurrentPageStackSnapshot();
|
|
5576
|
+
currentRoute.value = nextSnapshot.currentRoute;
|
|
5577
|
+
stackLength.value = nextSnapshot.stackLength;
|
|
5578
|
+
};
|
|
5579
|
+
if ((_options$autoRefresh = options.autoRefresh) !== null && _options$autoRefresh !== void 0 ? _options$autoRefresh : true) {
|
|
5580
|
+
onAttached(refresh);
|
|
5581
|
+
onShow(refresh);
|
|
5582
|
+
}
|
|
5583
|
+
return {
|
|
5584
|
+
canGoBack,
|
|
5585
|
+
currentRoute,
|
|
5586
|
+
refresh,
|
|
5587
|
+
stackLength
|
|
5588
|
+
};
|
|
5589
|
+
}
|
|
5590
|
+
/**
|
|
5591
|
+
* 计算自定义导航栏所需的状态栏和胶囊占位高度。
|
|
5592
|
+
*/
|
|
5593
|
+
function getNavigationBarMetrics(options = {}) {
|
|
5594
|
+
var _options$defaultStatu, _options$defaultNavig;
|
|
5595
|
+
const defaultStatusBarHeight = (_options$defaultStatu = options.defaultStatusBarHeight) !== null && _options$defaultStatu !== void 0 ? _options$defaultStatu : 20;
|
|
5596
|
+
const defaultNavigationBarHeight = (_options$defaultNavig = options.defaultNavigationBarHeight) !== null && _options$defaultNavig !== void 0 ? _options$defaultNavig : 44;
|
|
5597
|
+
const miniProgramGlobal = getMiniProgramGlobalObject();
|
|
5598
|
+
const systemInfo = typeof (miniProgramGlobal === null || miniProgramGlobal === void 0 ? void 0 : miniProgramGlobal.getSystemInfoSync) === "function" ? miniProgramGlobal.getSystemInfoSync() : {};
|
|
5599
|
+
const statusBarHeight = Number((systemInfo === null || systemInfo === void 0 ? void 0 : systemInfo.statusBarHeight) || defaultStatusBarHeight);
|
|
5600
|
+
let menuButtonRect;
|
|
5601
|
+
try {
|
|
5602
|
+
menuButtonRect = typeof (miniProgramGlobal === null || miniProgramGlobal === void 0 ? void 0 : miniProgramGlobal.getMenuButtonBoundingClientRect) === "function" ? miniProgramGlobal.getMenuButtonBoundingClientRect() : void 0;
|
|
5603
|
+
} catch (_unused) {}
|
|
5604
|
+
const menuTop = Number((menuButtonRect === null || menuButtonRect === void 0 ? void 0 : menuButtonRect.top) || 0);
|
|
5605
|
+
const menuHeight = Number((menuButtonRect === null || menuButtonRect === void 0 ? void 0 : menuButtonRect.height) || 0);
|
|
5606
|
+
const navigationBarHeight = menuTop > statusBarHeight && menuHeight > 0 ? (menuTop - statusBarHeight) * 2 + menuHeight : defaultNavigationBarHeight;
|
|
5607
|
+
return {
|
|
5608
|
+
navigationBarHeight,
|
|
5609
|
+
navigationHeight: statusBarHeight + navigationBarHeight,
|
|
5610
|
+
statusBarHeight
|
|
5611
|
+
};
|
|
5612
|
+
}
|
|
5613
|
+
/**
|
|
5614
|
+
* 在 setup 中跟踪自定义导航栏尺寸。
|
|
5615
|
+
*/
|
|
5616
|
+
function useNavigationBarMetrics(options = {}) {
|
|
5617
|
+
var _options$autoRefresh2;
|
|
5618
|
+
if (!getCurrentSetupContext()) throw new Error("useNavigationBarMetrics() 必须在 setup() 的同步阶段调用");
|
|
5619
|
+
const initialMetrics = getNavigationBarMetrics(options);
|
|
5620
|
+
const statusBarHeight = ref(initialMetrics.statusBarHeight);
|
|
5621
|
+
const navigationBarHeight = ref(initialMetrics.navigationBarHeight);
|
|
5622
|
+
const navigationHeight = computed(() => statusBarHeight.value + navigationBarHeight.value);
|
|
5623
|
+
const refresh = () => {
|
|
5624
|
+
const nextMetrics = getNavigationBarMetrics(options);
|
|
5625
|
+
statusBarHeight.value = nextMetrics.statusBarHeight;
|
|
5626
|
+
navigationBarHeight.value = nextMetrics.navigationBarHeight;
|
|
5627
|
+
};
|
|
5628
|
+
if ((_options$autoRefresh2 = options.autoRefresh) !== null && _options$autoRefresh2 !== void 0 ? _options$autoRefresh2 : true) onAttached(refresh);
|
|
5629
|
+
return {
|
|
5630
|
+
navigationBarHeight,
|
|
5631
|
+
navigationHeight,
|
|
5632
|
+
refresh,
|
|
5633
|
+
statusBarHeight
|
|
5634
|
+
};
|
|
5635
|
+
}
|
|
5636
|
+
|
|
5375
5637
|
//#endregion
|
|
5376
5638
|
//#region src/runtime/pageScroll.ts
|
|
5377
5639
|
function resolvePositiveInterval(interval) {
|
|
@@ -5476,6 +5738,70 @@ function usePageScrollThrottle(handler, options = {}) {
|
|
|
5476
5738
|
onDetached(stop);
|
|
5477
5739
|
return stop;
|
|
5478
5740
|
}
|
|
5741
|
+
|
|
5742
|
+
//#endregion
|
|
5743
|
+
//#region src/runtime/pullDownRefresh.ts
|
|
5744
|
+
/**
|
|
5745
|
+
* 注册下拉刷新回调,并在回调结束后自动停止宿主下拉刷新状态。
|
|
5746
|
+
*/
|
|
5747
|
+
function useAsyncPullDownRefresh(refresh, options = {}) {
|
|
5748
|
+
onPullDownRefresh(async () => {
|
|
5749
|
+
try {
|
|
5750
|
+
await refresh();
|
|
5751
|
+
} catch (error) {
|
|
5752
|
+
var _options$onError;
|
|
5753
|
+
await ((_options$onError = options.onError) === null || _options$onError === void 0 ? void 0 : _options$onError.call(options, error));
|
|
5754
|
+
} finally {
|
|
5755
|
+
var _options$stopPullDown;
|
|
5756
|
+
await ((_options$stopPullDown = options.stopPullDownRefresh) !== null && _options$stopPullDown !== void 0 ? _options$stopPullDown : (() => wpi.stopPullDownRefresh()))();
|
|
5757
|
+
}
|
|
5758
|
+
});
|
|
5759
|
+
}
|
|
5760
|
+
|
|
5761
|
+
//#endregion
|
|
5762
|
+
//#region src/runtime/selectorQuery.ts
|
|
5763
|
+
function resolveSetupContext(apiName, context) {
|
|
5764
|
+
const resolved = context !== null && context !== void 0 ? context : getCurrentInstance();
|
|
5765
|
+
if (!resolved || !getCurrentSetupContext()) throw new Error(`${apiName}() 必须在 setup() 的同步阶段调用`);
|
|
5766
|
+
return resolved;
|
|
5767
|
+
}
|
|
5768
|
+
function runSelectorQuery(context, selector, all, apply) {
|
|
5769
|
+
const query = createSelectorQuery(context);
|
|
5770
|
+
if (!query || !selector) return Promise.resolve(null);
|
|
5771
|
+
apply(all ? query.selectAll(selector) : query.select(selector));
|
|
5772
|
+
return new Promise((resolve) => {
|
|
5773
|
+
query.exec((res) => {
|
|
5774
|
+
const result = Array.isArray(res) ? res[0] : null;
|
|
5775
|
+
resolve(result !== null && result !== void 0 ? result : null);
|
|
5776
|
+
});
|
|
5777
|
+
});
|
|
5778
|
+
}
|
|
5779
|
+
/**
|
|
5780
|
+
* 创建绑定当前小程序实例的选择器查询工厂。
|
|
5781
|
+
*/
|
|
5782
|
+
function useSelectorQuery(options = {}) {
|
|
5783
|
+
const context = resolveSetupContext("useSelectorQuery", options.context);
|
|
5784
|
+
return () => createSelectorQuery(context);
|
|
5785
|
+
}
|
|
5786
|
+
function useBoundingClientRect(options = {}) {
|
|
5787
|
+
var _options$all;
|
|
5788
|
+
const context = resolveSetupContext("useBoundingClientRect", options.context);
|
|
5789
|
+
const all = (_options$all = options.all) !== null && _options$all !== void 0 ? _options$all : false;
|
|
5790
|
+
return (selector) => runSelectorQuery(context, selector, all, (nodesRef) => nodesRef.boundingClientRect());
|
|
5791
|
+
}
|
|
5792
|
+
function useSelectorFields(options) {
|
|
5793
|
+
var _options$all2;
|
|
5794
|
+
const context = resolveSetupContext("useSelectorFields", options.context);
|
|
5795
|
+
const all = (_options$all2 = options.all) !== null && _options$all2 !== void 0 ? _options$all2 : false;
|
|
5796
|
+
return (selector) => runSelectorQuery(context, selector, all, (nodesRef) => nodesRef.fields(options.fields));
|
|
5797
|
+
}
|
|
5798
|
+
function useScrollOffset(options = {}) {
|
|
5799
|
+
var _options$all3;
|
|
5800
|
+
const context = resolveSetupContext("useScrollOffset", options.context);
|
|
5801
|
+
const all = (_options$all3 = options.all) !== null && _options$all3 !== void 0 ? _options$all3 : false;
|
|
5802
|
+
return (selector) => runSelectorQuery(context, selector, all, (nodesRef) => nodesRef.scrollOffset());
|
|
5803
|
+
}
|
|
5804
|
+
|
|
5479
5805
|
//#endregion
|
|
5480
5806
|
//#region src/runtime/template.ts
|
|
5481
5807
|
const hyphenateRE = /\B([A-Z])/g;
|
|
@@ -5540,6 +5866,7 @@ function normalizeClass(value) {
|
|
|
5540
5866
|
}
|
|
5541
5867
|
return res;
|
|
5542
5868
|
}
|
|
5869
|
+
|
|
5543
5870
|
//#endregion
|
|
5544
5871
|
//#region src/runtime/updatePerformance.ts
|
|
5545
5872
|
function resolveUpdatePerformanceSetter(instance) {
|
|
@@ -5575,6 +5902,7 @@ function useUpdatePerformanceListener(listener) {
|
|
|
5575
5902
|
onDetached(stop);
|
|
5576
5903
|
return stop;
|
|
5577
5904
|
}
|
|
5905
|
+
|
|
5578
5906
|
//#endregion
|
|
5579
5907
|
//#region src/runtime/use.ts
|
|
5580
5908
|
function resolveCurrentRuntimeApp() {
|
|
@@ -5594,6 +5922,7 @@ function defineAppSetup(setup) {
|
|
|
5594
5922
|
function use(plugin, ...options) {
|
|
5595
5923
|
return resolveCurrentRuntimeApp().use(plugin, ...options);
|
|
5596
5924
|
}
|
|
5925
|
+
|
|
5597
5926
|
//#endregion
|
|
5598
5927
|
//#region src/runtime/vueCompat/context.ts
|
|
5599
5928
|
const EMPTY_SETUP_SLOTS = Object.freeze(Object.create(null));
|
|
@@ -5614,6 +5943,7 @@ function useNativeInstance() {
|
|
|
5614
5943
|
if (!(ctx === null || ctx === void 0 ? void 0 : ctx.instance)) throw new Error("useNativeInstance() 必须在 setup() 的同步阶段调用");
|
|
5615
5944
|
return ctx.instance;
|
|
5616
5945
|
}
|
|
5946
|
+
|
|
5617
5947
|
//#endregion
|
|
5618
5948
|
//#region src/runtime/vueCompat/model.ts
|
|
5619
5949
|
const EMPTY_MODEL_MODIFIERS = Object.freeze(Object.create(null));
|
|
@@ -5705,6 +6035,15 @@ function useBindModel(defaultOptions) {
|
|
|
5705
6035
|
};
|
|
5706
6036
|
return bindModel;
|
|
5707
6037
|
}
|
|
6038
|
+
/**
|
|
6039
|
+
* useChangeModel 返回以 change 事件为默认更新事件的 model 绑定助手。
|
|
6040
|
+
*/
|
|
6041
|
+
function useChangeModel() {
|
|
6042
|
+
const bindModel = useBindModel({ event: "change" });
|
|
6043
|
+
return function changeModel(path, options) {
|
|
6044
|
+
return bindModel.model(path, options);
|
|
6045
|
+
};
|
|
6046
|
+
}
|
|
5708
6047
|
function mergeModels(a, b) {
|
|
5709
6048
|
if (a == null) return b;
|
|
5710
6049
|
if (b == null) return a;
|
|
@@ -5715,6 +6054,7 @@ function mergeModels(a, b) {
|
|
|
5715
6054
|
};
|
|
5716
6055
|
return b;
|
|
5717
6056
|
}
|
|
6057
|
+
|
|
5718
6058
|
//#endregion
|
|
5719
6059
|
//#region src/runtime/vueCompat/templateRef.ts
|
|
5720
6060
|
function ensureTemplateRefMap(target) {
|
|
@@ -5745,5 +6085,7 @@ function useTemplateRef(name) {
|
|
|
5745
6085
|
map.set(normalized, target);
|
|
5746
6086
|
return target;
|
|
5747
6087
|
}
|
|
6088
|
+
|
|
5748
6089
|
//#endregion
|
|
5749
|
-
export {
|
|
6090
|
+
export { isNoSetData as $, createApp as A, waitForLayoutHost as B, usePageStack as C, shallowRef as Ct, createWevuComponent as D, useDisposables as E, __reExport as Et, resolveLayoutHost as F, runSetupFunction as G, mountRuntimeInstance as H, unregisterPageLayoutBridge as I, syncRuntimePageLayoutState as J, resolveRuntimePageLayoutName as K, unregisterRuntimeLayoutHosts as L, registerPageLayoutBridge as M, registerRuntimeLayoutHosts as N, createWevuScopedSlotComponent as O, resolveLayoutBridge as P, setWevuDefaults as Q, useLayoutBridge as R, useNavigationBarMetrics as S, isShallowRef as St, useElementIntersectionObserver as T, __exportAll as Tt, setRuntimeSetDataVisibility as U, registerApp as V, teardownRuntimeInstance as W, usePageLayout as X, syncRuntimePageLayoutStateFromRuntime as Y, resetWevuDefaults as Z, useSelectorQuery as _, onUnmounted as _t, useModel as a, watchSyncEffect as at, getCurrentPageStackSnapshot as b, toRef as bt, useSlots as c, callUpdateHooks as ct, useUpdatePerformanceListener as d, onBeforeUnmount as dt, markNoSetData as et, normalizeClass as f, onBeforeUpdate as ft, useSelectorFields as g, onServerPrefetch as gt, useScrollOffset as h, onMounted as ht, useChangeModel as i, watchPostEffect as it, registerComponent as j, defineComponent as k, defineAppSetup as l, onActivated as lt, useBoundingClientRect as m, onErrorCaptured as mt, mergeModels as n, watch as nt, useAttrs as o, getDeepWatchStrategy as ot, normalizeStyle as p, onDeactivated as pt, setPageLayout as q, useBindModel as r, watchEffect as rt, useNativeInstance as s, setDeepWatchStrategy as st, useTemplateRef as t, version as tt, use as u, onBeforeMount as ut, useAsyncPullDownRefresh as v, onUpdated as vt, useIntersectionObserver as w, triggerRef as wt, getNavigationBarMetrics as x, toRefs as xt, usePageScrollThrottle as y, traverse as yt, useLayoutHosts as z };
|
|
6091
|
+
//# sourceMappingURL=src-DjDCQerj.mjs.map
|