wevu 6.16.28 → 6.16.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/index.mjs +1 -1
- package/dist/dev/{src-DytVfRYX.mjs → src-C3pTdTFG.mjs} +185 -17
- package/dist/dev/src-C3pTdTFG.mjs.map +1 -0
- package/dist/dev/vue-demi.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/src-BaSaNnna.mjs +1 -0
- package/dist/vue-demi.mjs +1 -1
- package/package.json +4 -4
- package/dist/dev/src-DytVfRYX.mjs.map +0 -1
- package/dist/src-C0BF7KOe.mjs +0 -1
package/dist/dev/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as setWevuDefaults, A as defineComponent, B as useLayoutHosts, C as useNavigationBarMetrics, Ct as isShallowRef, D as useDisposables, E as useElementIntersectionObserver, F as resolveLayoutBridge, G as teardownRuntimeInstance, H as registerApp, I as resolveLayoutHost, J as setPageLayout, K as runSetupFunction, L as unregisterPageLayoutBridge, M as registerComponent, N as registerPageLayoutBridge, O as createWevuComponent, P as registerRuntimeLayoutHosts, Q as resetWevuDefaults, R as unregisterRuntimeLayoutHosts, S as getNavigationBarMetrics, St as toRefs, T as useIntersectionObserver, Tt as triggerRef, U as mountRuntimeInstance, V as waitForLayoutHost, W as setRuntimeSetDataVisibility, X as syncRuntimePageLayoutStateFromRuntime, Y as syncRuntimePageLayoutState, Z as usePageLayout, _ as useSelectorFields, _t as onServerPrefetch, a as useModel, at as watchPostEffect, b as usePageScrollThrottle, bt as traverse, c as useSlots, ct as setDeepWatchStrategy, d as useUpdatePerformanceListener, dt as onBeforeMount, et as isNoSetData, f as normalizeClass, ft as onBeforeUnmount, g as useScrollOffset, gt as onMounted, h as useBoundingClientRect, ht as onErrorCaptured, i as useChangeModel, it as watchEffect, j as createApp, k as createWevuScopedSlotComponent, l as defineAppSetup, lt as callUpdateHooks, m as resolvePropValue, mt as onDeactivated, n as mergeModels, nt as version, o as useAttrs, ot as watchSyncEffect, p as normalizeStyle, pt as onBeforeUpdate, q as resolveRuntimePageLayoutName, r as useBindModel, rt as watch, s as useNativeInstance, st as getDeepWatchStrategy, t as useTemplateRef, tt as markNoSetData, u as use, ut as onActivated, v as useSelectorQuery, vt as onUnmounted, w as usePageStack, wt as shallowRef, x as getCurrentPageStackSnapshot, xt as toRef, y as useAsyncPullDownRefresh, yt as onUpdated, z as useLayoutBridge } from "./src-
|
|
1
|
+
import { $ as setWevuDefaults, A as defineComponent, B as useLayoutHosts, C as useNavigationBarMetrics, Ct as isShallowRef, D as useDisposables, E as useElementIntersectionObserver, F as resolveLayoutBridge, G as teardownRuntimeInstance, H as registerApp, I as resolveLayoutHost, J as setPageLayout, K as runSetupFunction, L as unregisterPageLayoutBridge, M as registerComponent, N as registerPageLayoutBridge, O as createWevuComponent, P as registerRuntimeLayoutHosts, Q as resetWevuDefaults, R as unregisterRuntimeLayoutHosts, S as getNavigationBarMetrics, St as toRefs, T as useIntersectionObserver, Tt as triggerRef, U as mountRuntimeInstance, V as waitForLayoutHost, W as setRuntimeSetDataVisibility, X as syncRuntimePageLayoutStateFromRuntime, Y as syncRuntimePageLayoutState, Z as usePageLayout, _ as useSelectorFields, _t as onServerPrefetch, a as useModel, at as watchPostEffect, b as usePageScrollThrottle, bt as traverse, c as useSlots, ct as setDeepWatchStrategy, d as useUpdatePerformanceListener, dt as onBeforeMount, et as isNoSetData, f as normalizeClass, ft as onBeforeUnmount, g as useScrollOffset, gt as onMounted, h as useBoundingClientRect, ht as onErrorCaptured, i as useChangeModel, it as watchEffect, j as createApp, k as createWevuScopedSlotComponent, l as defineAppSetup, lt as callUpdateHooks, m as resolvePropValue, mt as onDeactivated, n as mergeModels, nt as version, o as useAttrs, ot as watchSyncEffect, p as normalizeStyle, pt as onBeforeUpdate, q as resolveRuntimePageLayoutName, r as useBindModel, rt as watch, s as useNativeInstance, st as getDeepWatchStrategy, t as useTemplateRef, tt as markNoSetData, u as use, ut as onActivated, v as useSelectorQuery, vt as onUnmounted, w as usePageStack, wt as shallowRef, x as getCurrentPageStackSnapshot, xt as toRef, y as useAsyncPullDownRefresh, yt as onUpdated, z as useLayoutBridge } from "./src-C3pTdTFG.mjs";
|
|
2
2
|
import { C as effect, D as onScopeDispose, E as getCurrentScope, N as nextTick, O as startBatch, S as batch, T as endBatch, a as toValue, b as addMutationRecorder, c as isRaw, d as reactive, f as isShallowReactive, g as touchReactive, h as prelinkReactiveTree, i as ref, k as stop, l as isReactive, n as isRef, o as unref, p as shallowReactive, s as getReactiveVersion, t as customRef, u as markRaw, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-BoBfMdVt.mjs";
|
|
3
3
|
import { i as computed, n as defineStore, r as createStore, t as storeToRefs } from "./store-eNxaNZbj.mjs";
|
|
4
4
|
import { $ as onUnhandledRejection, A as setGlobalProvidedValue, B as onPageNotFound, F as onHide, G as onResize, H as onPullDownRefresh, I as onLaunch, J as onShareAppMessage, K as onRouteDone, L as onLoad, M as onAttached, N as onDetached, P as onError, Q as onThemeChange, R as onMemoryWarning, U as onReachBottom, V as onPageScroll, W as onReady, X as onShow, Y as onShareTimeline, Z as onTabItemTap, _ as provide, _t as readonly, at as getCurrentSetupContext, ct as setCurrentSetupContext, et as onUnload, g as injectGlobal, gt as isReadonly, h as inject, ht as isProxy, it as getCurrentInstance, j as onAddToFavorites, m as hasInjectionContext, n as useNativeRouter, nt as callHookList, q as onSaveExitState, rt as callHookReturn, st as setCurrentInstance, t as useNativePageRouter, v as provideGlobal, vt as shallowReadonly, z as onMoved } from "./router-ByTtgUmi.mjs";
|
|
@@ -478,7 +478,7 @@ function watchSyncEffect(effectFn, options = {}) {
|
|
|
478
478
|
|
|
479
479
|
//#endregion
|
|
480
480
|
//#region package.json
|
|
481
|
-
var version$1 = "6.16.
|
|
481
|
+
var version$1 = "6.16.29";
|
|
482
482
|
|
|
483
483
|
//#endregion
|
|
484
484
|
//#region src/version.ts
|
|
@@ -1555,7 +1555,7 @@ function runPatchUpdate(options) {
|
|
|
1555
1555
|
//#endregion
|
|
1556
1556
|
//#region src/runtime/app/setData/scheduler.ts
|
|
1557
1557
|
function createSetDataScheduler(options) {
|
|
1558
|
-
const { state, setupState, snapshotOmitKeys, computedRefs, dirtyComputedKeys, includeComputed, setDataStrategy, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, currentAdapter, shouldIncludeKey, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, includeFunctions = false, functionPaths, debug, debugWhen, debugSampleRate, runTracker, isMounted } = options;
|
|
1558
|
+
const { state, setupState, snapshotOmitKeys, computedRefs, dirtyComputedKeys, includeComputed, setDataStrategy, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, currentAdapter, shouldIncludeKey, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, includeFunctions = false, functionPaths, debug, debugWhen, debugSampleRate, runTracker, isMounted, initialSnapshot } = options;
|
|
1559
1559
|
const plainCache = /* @__PURE__ */ new WeakMap();
|
|
1560
1560
|
let latestSnapshot = {};
|
|
1561
1561
|
let latestComputedSnapshot = Object.create(null);
|
|
@@ -1607,6 +1607,25 @@ function createSetDataScheduler(options) {
|
|
|
1607
1607
|
return left.raw === right.raw && left.version === right.version;
|
|
1608
1608
|
};
|
|
1609
1609
|
const shouldIncludeSnapshotKey = (key) => shouldIncludeKey(key) && !(snapshotOmitKeys === null || snapshotOmitKeys === void 0 ? void 0 : snapshotOmitKeys.has(key));
|
|
1610
|
+
if (initialSnapshot) {
|
|
1611
|
+
for (const [key, value] of Object.entries(initialSnapshot)) if (shouldIncludeSnapshotKey(key)) latestSnapshot[key] = value;
|
|
1612
|
+
}
|
|
1613
|
+
const syncInitialSnapshotTokens = () => {
|
|
1614
|
+
if (!initialSnapshot) return;
|
|
1615
|
+
const rawState = isReactive(state) ? toRaw(state) : state;
|
|
1616
|
+
const rawSetupState = setupState && typeof setupState === "object" ? isReactive(setupState) ? toRaw(setupState) : setupState : void 0;
|
|
1617
|
+
for (const key of Object.keys(initialSnapshot)) {
|
|
1618
|
+
if (!shouldIncludeSnapshotKey(key)) continue;
|
|
1619
|
+
if (rawSetupState && hasOwn(rawSetupState, key)) {
|
|
1620
|
+
latestStateTokens[key] = createValueToken(rawSetupState[key]);
|
|
1621
|
+
continue;
|
|
1622
|
+
}
|
|
1623
|
+
if (hasOwn(rawState, key)) {
|
|
1624
|
+
rawState[key] = initialSnapshot[key];
|
|
1625
|
+
latestStateTokens[key] = createValueToken(rawState[key]);
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
};
|
|
1610
1629
|
const resolveTopKeysByRoot = (root) => {
|
|
1611
1630
|
const matches = [];
|
|
1612
1631
|
const rawSetupState = setupState && typeof setupState === "object" ? isReactive(setupState) ? toRaw(setupState) : setupState : void 0;
|
|
@@ -1640,6 +1659,7 @@ function createSetDataScheduler(options) {
|
|
|
1640
1659
|
includeFunctions,
|
|
1641
1660
|
functionPaths
|
|
1642
1661
|
});
|
|
1662
|
+
syncInitialSnapshotTokens();
|
|
1643
1663
|
const collectDiffSnapshot = () => {
|
|
1644
1664
|
const rawState = isReactive(state) ? toRaw(state) : state;
|
|
1645
1665
|
const rawSetupState = setupState && typeof setupState === "object" ? isReactive(setupState) ? toRaw(setupState) : setupState : void 0;
|
|
@@ -1906,6 +1926,7 @@ function createRuntimeMount(options) {
|
|
|
1906
1926
|
const setupState = reactive(Object.create(null));
|
|
1907
1927
|
const adapterSnapshotOmitKeys = adapter === null || adapter === void 0 ? void 0 : adapter.__wevu_snapshotOmitKeys;
|
|
1908
1928
|
const deferInitialSnapshot = Boolean(adapter === null || adapter === void 0 ? void 0 : adapter.__wevu_deferInitialSnapshot);
|
|
1929
|
+
const adapterInitialSnapshot = adapter === null || adapter === void 0 ? void 0 : adapter.__wevu_initialSnapshot;
|
|
1909
1930
|
const snapshotOmitKeys = new Set(adapterSnapshotOmitKeys instanceof Set ? adapterSnapshotOmitKeys : Array.isArray(adapterSnapshotOmitKeys) ? adapterSnapshotOmitKeys : []);
|
|
1910
1931
|
if (rawState && typeof rawState === "object" && !hasOwn(rawState, WEVU_SETUP_STATE_KEY)) try {
|
|
1911
1932
|
Object.defineProperty(rawState, WEVU_SETUP_STATE_KEY, {
|
|
@@ -1971,7 +1992,8 @@ function createRuntimeMount(options) {
|
|
|
1971
1992
|
debugWhen: mergedDebugWhen,
|
|
1972
1993
|
debugSampleRate,
|
|
1973
1994
|
runTracker: () => tracker === null || tracker === void 0 ? void 0 : tracker(),
|
|
1974
|
-
isMounted: () => mounted
|
|
1995
|
+
isMounted: () => mounted,
|
|
1996
|
+
initialSnapshot: adapterInitialSnapshot && typeof adapterInitialSnapshot === "object" ? adapterInitialSnapshot : void 0
|
|
1975
1997
|
});
|
|
1976
1998
|
const job = () => scheduler.job(stateRootRaw);
|
|
1977
1999
|
const mutationRecorder = (record) => scheduler.mutationRecorder(record, stateRootRaw);
|
|
@@ -3250,6 +3272,9 @@ function ensureRuntimeProps(target, runtimeState, mpProperties = target.properti
|
|
|
3250
3272
|
function normalizeEmitEventName(eventName) {
|
|
3251
3273
|
return eventName.includes(":") ? eventName.replaceAll(":", "-").toLowerCase() : eventName;
|
|
3252
3274
|
}
|
|
3275
|
+
function isInternalAttrKey(key) {
|
|
3276
|
+
return key.startsWith("__wv_");
|
|
3277
|
+
}
|
|
3253
3278
|
function runRuntimeSetupPhase(options) {
|
|
3254
3279
|
var _runtimeWithDefaults$;
|
|
3255
3280
|
const { target, runtime, runtimeWithDefaults, runtimeState, runtimeProxy, setup } = options;
|
|
@@ -3261,10 +3286,10 @@ function runRuntimeSetupPhase(options) {
|
|
|
3261
3286
|
};
|
|
3262
3287
|
const syncAttrsFromProperties = () => {
|
|
3263
3288
|
const next = target.properties && typeof target.properties === "object" ? target.properties : void 0;
|
|
3264
|
-
for (const existingKey of Object.keys(attrs)) if (!next || !hasOwn(next, existingKey) || declaredPropKeys.has(existingKey) || hasRuntimeStateKey(existingKey)) delete attrs[existingKey];
|
|
3289
|
+
for (const existingKey of Object.keys(attrs)) if (!next || !hasOwn(next, existingKey) || isInternalAttrKey(existingKey) || declaredPropKeys.has(existingKey) || hasRuntimeStateKey(existingKey)) delete attrs[existingKey];
|
|
3265
3290
|
if (!next) return;
|
|
3266
3291
|
for (const [key, value] of Object.entries(next)) {
|
|
3267
|
-
if (declaredPropKeys.has(key) || hasRuntimeStateKey(key)) continue;
|
|
3292
|
+
if (isInternalAttrKey(key) || declaredPropKeys.has(key) || hasRuntimeStateKey(key)) continue;
|
|
3268
3293
|
attrs[key] = value;
|
|
3269
3294
|
}
|
|
3270
3295
|
};
|
|
@@ -3495,6 +3520,38 @@ function registerWatches(runtime, watchMap, instance) {
|
|
|
3495
3520
|
|
|
3496
3521
|
//#endregion
|
|
3497
3522
|
//#region src/runtime/register/runtimeInstance.ts
|
|
3523
|
+
function cloneInitialSnapshotValue(value, cache = /* @__PURE__ */ new WeakMap()) {
|
|
3524
|
+
if (!value || typeof value !== "object") return value;
|
|
3525
|
+
if (cache.has(value)) return cache.get(value);
|
|
3526
|
+
if (Array.isArray(value)) {
|
|
3527
|
+
const next = [];
|
|
3528
|
+
cache.set(value, next);
|
|
3529
|
+
for (const item of value) next.push(cloneInitialSnapshotValue(item, cache));
|
|
3530
|
+
return next;
|
|
3531
|
+
}
|
|
3532
|
+
const next = {};
|
|
3533
|
+
cache.set(value, next);
|
|
3534
|
+
for (const [key, child] of Object.entries(value)) next[key] = cloneInitialSnapshotValue(child, cache);
|
|
3535
|
+
return next;
|
|
3536
|
+
}
|
|
3537
|
+
function resolveInitialSnapshotFromNativeData(target, omitKeys, extraEntries) {
|
|
3538
|
+
const data = target.data;
|
|
3539
|
+
if ((!data || typeof data !== "object") && (!extraEntries || !Object.keys(extraEntries).length)) return;
|
|
3540
|
+
const omitSet = Array.isArray(omitKeys) && omitKeys.length ? new Set(omitKeys) : void 0;
|
|
3541
|
+
const snapshot = {};
|
|
3542
|
+
if (data && typeof data === "object") for (const [key, value] of Object.entries(data)) {
|
|
3543
|
+
if (omitSet === null || omitSet === void 0 ? void 0 : omitSet.has(key)) continue;
|
|
3544
|
+
snapshot[key] = cloneInitialSnapshotValue(value);
|
|
3545
|
+
}
|
|
3546
|
+
if (extraEntries) for (const [key, value] of Object.entries(extraEntries)) {
|
|
3547
|
+
if (omitSet === null || omitSet === void 0 ? void 0 : omitSet.has(key)) continue;
|
|
3548
|
+
snapshot[key] = cloneInitialSnapshotValue(value);
|
|
3549
|
+
}
|
|
3550
|
+
return snapshot;
|
|
3551
|
+
}
|
|
3552
|
+
function hasTemplateRuntimeBindings(runtimeApp) {
|
|
3553
|
+
return Boolean(runtimeApp === null || runtimeApp === void 0 ? void 0 : runtimeApp.__wevuHasTemplateRuntimeBindings);
|
|
3554
|
+
}
|
|
3498
3555
|
function attachPageLayoutSetter(target) {
|
|
3499
3556
|
if (typeof target.route !== "string" || !target.route) return;
|
|
3500
3557
|
target[WEVU_PAGE_LAYOUT_SETTER_KEY] = (layout, props) => {
|
|
@@ -3604,7 +3661,15 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
3604
3661
|
value: options.snapshotOmitKeys,
|
|
3605
3662
|
writable: false
|
|
3606
3663
|
});
|
|
3607
|
-
|
|
3664
|
+
const initialSnapshot = resolveInitialSnapshotFromNativeData(target, options === null || options === void 0 ? void 0 : options.snapshotOmitKeys, hasTemplateRuntimeBindings(runtimeApp) ? void 0 : { [WEVU_SLOT_OWNER_ID_KEY]: ownerId });
|
|
3665
|
+
if (initialSnapshot && Object.keys(initialSnapshot).length) Object.defineProperty(baseMountAdapter, "__wevu_initialSnapshot", {
|
|
3666
|
+
configurable: true,
|
|
3667
|
+
enumerable: false,
|
|
3668
|
+
value: initialSnapshot,
|
|
3669
|
+
writable: false
|
|
3670
|
+
});
|
|
3671
|
+
const targetProperties = target.properties;
|
|
3672
|
+
if (Boolean(setup) || Boolean(targetProperties && typeof targetProperties === "object" && Object.keys(targetProperties).length > 0)) Object.defineProperty(baseMountAdapter, "__wevu_deferInitialSnapshot", {
|
|
3608
3673
|
configurable: true,
|
|
3609
3674
|
enumerable: false,
|
|
3610
3675
|
value: true,
|
|
@@ -3669,7 +3734,6 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
3669
3734
|
if (stops.length) target[WEVU_WATCH_STOPS_KEY] = stops;
|
|
3670
3735
|
}
|
|
3671
3736
|
if (setup) {
|
|
3672
|
-
var _runtimeWithSyncFlush;
|
|
3673
3737
|
runRuntimeSetupPhase({
|
|
3674
3738
|
target,
|
|
3675
3739
|
runtime,
|
|
@@ -3678,7 +3742,10 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
3678
3742
|
runtimeProxy,
|
|
3679
3743
|
setup
|
|
3680
3744
|
});
|
|
3681
|
-
(
|
|
3745
|
+
if (!(options === null || options === void 0 ? void 0 : options.deferSetData)) {
|
|
3746
|
+
var _runtimeWithSyncFlush;
|
|
3747
|
+
(_runtimeWithSyncFlush = runtimeWithSyncFlush.__wevu_flushSetupSnapshotSync) === null || _runtimeWithSyncFlush === void 0 || _runtimeWithSyncFlush.call(runtimeWithSyncFlush);
|
|
3748
|
+
}
|
|
3682
3749
|
refreshOwnerSnapshot();
|
|
3683
3750
|
} else if (target.properties && typeof target.properties === "object" && Object.keys(target.properties).length > 0) {
|
|
3684
3751
|
var _runtimeWithSyncFlush2;
|
|
@@ -3688,14 +3755,23 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
3688
3755
|
bridgeRuntimeMethodsToTarget(target, runtime);
|
|
3689
3756
|
return runtime;
|
|
3690
3757
|
}
|
|
3758
|
+
function syncRuntimeStateFromNativeData(target) {
|
|
3759
|
+
var _target$__wevu2;
|
|
3760
|
+
const runtimeState = (_target$__wevu2 = target.__wevu) === null || _target$__wevu2 === void 0 ? void 0 : _target$__wevu2.state;
|
|
3761
|
+
const nativeData = target.data;
|
|
3762
|
+
if (!runtimeState || typeof runtimeState !== "object" || !nativeData || typeof nativeData !== "object") return;
|
|
3763
|
+
for (const [key, value] of Object.entries(nativeData)) if (Object.prototype.hasOwnProperty.call(runtimeState, key)) runtimeState[key] = value;
|
|
3764
|
+
}
|
|
3691
3765
|
function enableDeferredSetData(target) {
|
|
3692
|
-
var _wevu;
|
|
3766
|
+
var _wevu, _wevu2, _wevu2$__wevu_flushSe;
|
|
3693
3767
|
const adapter = (_wevu = target.__wevu) === null || _wevu === void 0 ? void 0 : _wevu.adapter;
|
|
3768
|
+
syncRuntimeStateFromNativeData(target);
|
|
3769
|
+
(_wevu2 = target.__wevu) === null || _wevu2 === void 0 || (_wevu2$__wevu_flushSe = _wevu2.__wevu_flushSetupSnapshotSync) === null || _wevu2$__wevu_flushSe === void 0 || _wevu2$__wevu_flushSe.call(_wevu2);
|
|
3694
3770
|
if (adapter && typeof adapter.__wevu_enableSetData === "function") adapter.__wevu_enableSetData();
|
|
3695
3771
|
}
|
|
3696
3772
|
function setRuntimeSetDataVisibility(target, visible) {
|
|
3697
|
-
var
|
|
3698
|
-
const adapter = (
|
|
3773
|
+
var _wevu3;
|
|
3774
|
+
const adapter = (_wevu3 = target.__wevu) === null || _wevu3 === void 0 ? void 0 : _wevu3.adapter;
|
|
3699
3775
|
if (adapter && typeof adapter.__wevu_setVisibility === "function") adapter.__wevu_setVisibility(visible);
|
|
3700
3776
|
}
|
|
3701
3777
|
/**
|
|
@@ -4355,6 +4431,7 @@ function createPropsSync(options) {
|
|
|
4355
4431
|
const aliasKeySet = new Set(aliasEntries.map(([alias]) => alias));
|
|
4356
4432
|
const directPropsDerivedKeys = [...propsDerivedKeySet].filter((key) => propKeySet.has(key) && !aliasKeySet.has(key));
|
|
4357
4433
|
const syncedAliases = /* @__PURE__ */ new WeakMap();
|
|
4434
|
+
const isInternalAttrKey = (key) => key.startsWith("__wv_");
|
|
4358
4435
|
const updateSnapshotOmitKeys = (instance) => {
|
|
4359
4436
|
const runtime = instance.__wevu;
|
|
4360
4437
|
const snapshotOmitKeys = runtime === null || runtime === void 0 ? void 0 : runtime[WEVU_PROPS_DERIVED_KEYS_KEY];
|
|
@@ -4427,7 +4504,7 @@ function createPropsSync(options) {
|
|
|
4427
4504
|
const properties = instance.properties;
|
|
4428
4505
|
const next = properties && typeof properties === "object" ? properties : void 0;
|
|
4429
4506
|
const currentKeys = Object.keys(attrsProxy);
|
|
4430
|
-
for (const existingKey of currentKeys) if (!next || !hasOwn(next, existingKey) || propKeySet.has(existingKey) || hasRuntimeStateKey(existingKey)) try {
|
|
4507
|
+
for (const existingKey of currentKeys) if (!next || !hasOwn(next, existingKey) || isInternalAttrKey(existingKey) || propKeySet.has(existingKey) || hasRuntimeStateKey(existingKey)) try {
|
|
4431
4508
|
delete attrsProxy[existingKey];
|
|
4432
4509
|
} catch (_unused5) {}
|
|
4433
4510
|
if (!next) {
|
|
@@ -4435,7 +4512,7 @@ function createPropsSync(options) {
|
|
|
4435
4512
|
return;
|
|
4436
4513
|
}
|
|
4437
4514
|
for (const [key, value] of Object.entries(next)) {
|
|
4438
|
-
if (propKeySet.has(key) || hasRuntimeStateKey(key)) continue;
|
|
4515
|
+
if (isInternalAttrKey(key) || propKeySet.has(key) || hasRuntimeStateKey(key)) continue;
|
|
4439
4516
|
try {
|
|
4440
4517
|
attrsProxy[key] = value;
|
|
4441
4518
|
} catch (_unused6) {}
|
|
@@ -5088,8 +5165,15 @@ function createApp(options) {
|
|
|
5088
5165
|
enumerable: false,
|
|
5089
5166
|
writable: false
|
|
5090
5167
|
});
|
|
5168
|
+
Object.defineProperty(runtimeApp, "__wevuHasTemplateRuntimeBindings", {
|
|
5169
|
+
value: Object.keys(resolvedComputed).some((key) => key.startsWith("__wv_bind_")),
|
|
5170
|
+
configurable: true,
|
|
5171
|
+
enumerable: false,
|
|
5172
|
+
writable: false
|
|
5173
|
+
});
|
|
5091
5174
|
} catch (_unused) {
|
|
5092
5175
|
runtimeApp.__wevuSetDataOptions = setDataOptions;
|
|
5176
|
+
runtimeApp.__wevuHasTemplateRuntimeBindings = Object.keys(resolvedComputed).some((key) => key.startsWith("__wv_bind_"));
|
|
5093
5177
|
}
|
|
5094
5178
|
if (hasGlobalApp) {
|
|
5095
5179
|
const globalObject = getMiniProgramGlobalObject();
|
|
@@ -5102,6 +5186,90 @@ function createApp(options) {
|
|
|
5102
5186
|
return runtimeApp;
|
|
5103
5187
|
}
|
|
5104
5188
|
|
|
5189
|
+
//#endregion
|
|
5190
|
+
//#region src/runtime/define/initialComputed.ts
|
|
5191
|
+
var InitialComputedBailout = class extends Error {};
|
|
5192
|
+
function resolveComputedGetter(definition) {
|
|
5193
|
+
if (typeof definition === "function") return definition;
|
|
5194
|
+
const getter = definition === null || definition === void 0 ? void 0 : definition.get;
|
|
5195
|
+
return typeof getter === "function" ? getter : void 0;
|
|
5196
|
+
}
|
|
5197
|
+
function resolveInitialComputedData(options) {
|
|
5198
|
+
const { data, computed, setData } = options;
|
|
5199
|
+
const computedKeys = computed ? Object.keys(computed) : [];
|
|
5200
|
+
if (!computedKeys.length) return;
|
|
5201
|
+
const { includeComputed, shouldIncludeKey, toPlainMaxDepth, toPlainMaxKeys, includeFunctions, functionPaths } = resolveSetDataOptions(setData);
|
|
5202
|
+
if (!includeComputed) return;
|
|
5203
|
+
const resolved = {};
|
|
5204
|
+
const resolving = /* @__PURE__ */ new Set();
|
|
5205
|
+
let proxy;
|
|
5206
|
+
const resolveComputedValue = (key) => {
|
|
5207
|
+
if (hasOwn(data, key) || !shouldIncludeKey(key)) return { ok: false };
|
|
5208
|
+
if (hasOwn(resolved, key)) return {
|
|
5209
|
+
ok: true,
|
|
5210
|
+
value: resolved[key]
|
|
5211
|
+
};
|
|
5212
|
+
if (resolving.has(key)) return { ok: false };
|
|
5213
|
+
const getter = resolveComputedGetter(computed[key]);
|
|
5214
|
+
if (!getter) return { ok: false };
|
|
5215
|
+
resolving.add(key);
|
|
5216
|
+
try {
|
|
5217
|
+
const rawValue = getter.call(proxy);
|
|
5218
|
+
if (rawValue === void 0) return { ok: false };
|
|
5219
|
+
const value = toPlain(rawValue, /* @__PURE__ */ new WeakMap(), {
|
|
5220
|
+
maxDepth: toPlainMaxDepth,
|
|
5221
|
+
maxKeys: toPlainMaxKeys,
|
|
5222
|
+
includeFunctions,
|
|
5223
|
+
functionPaths,
|
|
5224
|
+
_path: key
|
|
5225
|
+
});
|
|
5226
|
+
if (value === void 0) return { ok: false };
|
|
5227
|
+
resolved[key] = value;
|
|
5228
|
+
return {
|
|
5229
|
+
ok: true,
|
|
5230
|
+
value
|
|
5231
|
+
};
|
|
5232
|
+
} catch (_unused) {
|
|
5233
|
+
return { ok: false };
|
|
5234
|
+
} finally {
|
|
5235
|
+
resolving.delete(key);
|
|
5236
|
+
}
|
|
5237
|
+
};
|
|
5238
|
+
proxy = new Proxy(data, {
|
|
5239
|
+
get(target, key, receiver) {
|
|
5240
|
+
if (typeof key === "string") {
|
|
5241
|
+
if (key === "data" || key === "$state") return data;
|
|
5242
|
+
if (key === "props" || key === "$props" || key === "$attrs") throw new InitialComputedBailout();
|
|
5243
|
+
if (hasOwn(data, key)) return Reflect.get(target, key, receiver);
|
|
5244
|
+
if (computed && hasOwn(computed, key)) {
|
|
5245
|
+
const computedValue = resolveComputedValue(key);
|
|
5246
|
+
if (computedValue.ok) return computedValue.value;
|
|
5247
|
+
throw new InitialComputedBailout();
|
|
5248
|
+
}
|
|
5249
|
+
throw new InitialComputedBailout();
|
|
5250
|
+
}
|
|
5251
|
+
return Reflect.get(target, key, receiver);
|
|
5252
|
+
},
|
|
5253
|
+
has(target, key) {
|
|
5254
|
+
return Reflect.has(target, key) || typeof key === "string" && Boolean(computed && hasOwn(computed, key));
|
|
5255
|
+
}
|
|
5256
|
+
});
|
|
5257
|
+
for (const key of computedKeys) resolveComputedValue(key);
|
|
5258
|
+
return Object.keys(resolved).length ? resolved : void 0;
|
|
5259
|
+
}
|
|
5260
|
+
function resolveNativeInitialData(data, computed, setData) {
|
|
5261
|
+
if (!data || typeof data !== "object") return data;
|
|
5262
|
+
const initialComputedData = resolveInitialComputedData({
|
|
5263
|
+
data,
|
|
5264
|
+
computed,
|
|
5265
|
+
setData
|
|
5266
|
+
});
|
|
5267
|
+
return initialComputedData ? {
|
|
5268
|
+
...data,
|
|
5269
|
+
...initialComputedData
|
|
5270
|
+
} : data;
|
|
5271
|
+
}
|
|
5272
|
+
|
|
5105
5273
|
//#endregion
|
|
5106
5274
|
//#region src/runtime/define/props.ts
|
|
5107
5275
|
const ALLOW_NULL_PROP_INPUT_KEY = "__wevu_allowNullPropInput";
|
|
@@ -5631,10 +5799,10 @@ function defineComponent(options) {
|
|
|
5631
5799
|
});
|
|
5632
5800
|
return result;
|
|
5633
5801
|
}) : void 0;
|
|
5634
|
-
const
|
|
5635
|
-
const mpOptionsWithProps = normalizeProps(
|
|
5802
|
+
const nativeInitialData = resolveNativeInitialData(typeof data === "function" ? data() : data, computed, resolvedSetData);
|
|
5803
|
+
const mpOptionsWithProps = normalizeProps(nativeInitialData !== void 0 ? {
|
|
5636
5804
|
...mpOptions,
|
|
5637
|
-
data:
|
|
5805
|
+
data: nativeInitialData
|
|
5638
5806
|
} : mpOptions, props);
|
|
5639
5807
|
const componentOptions = {
|
|
5640
5808
|
data,
|
|
@@ -6432,4 +6600,4 @@ function useTemplateRef(name) {
|
|
|
6432
6600
|
|
|
6433
6601
|
//#endregion
|
|
6434
6602
|
export { setWevuDefaults as $, defineComponent as A, useLayoutHosts as B, useNavigationBarMetrics as C, isShallowRef as Ct, useDisposables as D, __reExport as Dt, useElementIntersectionObserver as E, __exportAll as Et, resolveLayoutBridge as F, teardownRuntimeInstance as G, registerApp as H, resolveLayoutHost as I, setPageLayout as J, runSetupFunction as K, unregisterPageLayoutBridge as L, registerComponent as M, registerPageLayoutBridge as N, createWevuComponent as O, registerRuntimeLayoutHosts as P, resetWevuDefaults as Q, unregisterRuntimeLayoutHosts as R, getNavigationBarMetrics as S, toRefs as St, useIntersectionObserver as T, triggerRef as Tt, mountRuntimeInstance as U, waitForLayoutHost as V, setRuntimeSetDataVisibility as W, syncRuntimePageLayoutStateFromRuntime as X, syncRuntimePageLayoutState as Y, usePageLayout as Z, useSelectorFields as _, onServerPrefetch as _t, useModel as a, watchPostEffect as at, usePageScrollThrottle as b, traverse as bt, useSlots as c, setDeepWatchStrategy as ct, useUpdatePerformanceListener as d, onBeforeMount as dt, isNoSetData as et, normalizeClass as f, onBeforeUnmount as ft, useScrollOffset as g, onMounted as gt, useBoundingClientRect as h, onErrorCaptured as ht, useChangeModel as i, watchEffect as it, createApp as j, createWevuScopedSlotComponent as k, defineAppSetup as l, callUpdateHooks as lt, resolvePropValue as m, onDeactivated as mt, mergeModels as n, version as nt, useAttrs as o, watchSyncEffect as ot, normalizeStyle as p, onBeforeUpdate as pt, resolveRuntimePageLayoutName as q, useBindModel as r, watch as rt, useNativeInstance as s, getDeepWatchStrategy as st, useTemplateRef as t, markNoSetData as tt, use as u, onActivated as ut, useSelectorQuery as v, onUnmounted as vt, usePageStack as w, shallowRef as wt, getCurrentPageStackSnapshot as x, toRef as xt, useAsyncPullDownRefresh as y, onUpdated as yt, useLayoutBridge as z };
|
|
6435
|
-
//# sourceMappingURL=src-
|
|
6603
|
+
//# sourceMappingURL=src-C3pTdTFG.mjs.map
|