wevu 6.18.1 → 6.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/index.mjs +1 -1
- package/dist/dev/internal-runtime.mjs +1 -1
- package/dist/dev/{templateRef-v7Hidcei.mjs → templateRef-CvZ5CnbL.mjs} +71 -13
- package/dist/dev/templateRef-CvZ5CnbL.mjs.map +1 -0
- package/dist/dev/vue-demi.mjs +1 -1
- package/dist/{index-Dg1-jV9L.d.mts → index-BiHILcmb.d.mts} +3 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/internal-runtime.d.mts +1 -1
- package/dist/internal-runtime.mjs +1 -1
- package/dist/templateRef-DXLWwmHl.mjs +1 -0
- package/dist/vue-demi.d.mts +1 -1
- package/dist/vue-demi.mjs +1 -1
- package/package.json +4 -4
- package/dist/dev/templateRef-v7Hidcei.mjs.map +0 -1
- package/dist/templateRef-CudR7kjO.mjs +0 -1
package/dist/dev/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { i as touchReactive, r as prelinkReactiveTree, t as computed } from "./c
|
|
|
5
5
|
import { S as shallowReadonly, b as isReadonly, c as getCurrentSetupContext, d as setCurrentSetupContext, n as callHookList, r as callHookReturn, s as getCurrentInstance, u as setCurrentInstance, x as readonly, y as isProxy } from "./base-CYkvI7w8.mjs";
|
|
6
6
|
import { n as toRefs, t as toRef } from "./toRefs-D06VmFK2.mjs";
|
|
7
7
|
import { $ as onShow, B as onLoad, F as onAttached, G as onPullDownRefresh, H as onMoved, I as onDetached, J as onResize, K as onReachBottom, L as onError, N as setGlobalProvidedValue, P as onAddToFavorites, Q as onShareTimeline, R as onHide, U as onPageNotFound, V as onMemoryWarning, W as onPageScroll, X as onSaveExitState, Y as onRouteDone, Z as onShareAppMessage, _ as hasInjectionContext, b as provide, et as onTabItemTap, n as useNativeRouter, nt as onUnhandledRejection, q as onReady, rt as onUnload, t as useNativePageRouter, tt as onThemeChange, v as inject, x as provideGlobal, y as injectGlobal, z as onLaunch } from "./router-BD-ovqV2.mjs";
|
|
8
|
-
import { $ as version, A as registerPageLayoutBridge, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, F as unregisterRuntimeLayoutHosts, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, P as unregisterPageLayoutBridge, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, et as callUpdateHooks, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, j as registerRuntimeLayoutHosts, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-
|
|
8
|
+
import { $ as version, A as registerPageLayoutBridge, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, F as unregisterRuntimeLayoutHosts, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, P as unregisterPageLayoutBridge, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, et as callUpdateHooks, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, j as registerRuntimeLayoutHosts, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-CvZ5CnbL.mjs";
|
|
9
9
|
import { n as normalizeStyle, r as resolvePropValue, t as normalizeClass } from "./template-n_iVr0ey.mjs";
|
|
10
10
|
import { n as defineStore, r as createStore, t as storeToRefs } from "./store-HNsiQJ4d.mjs";
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as getCurrentSetupContext, d as setCurrentSetupContext, n as callHookList, r as callHookReturn, s as getCurrentInstance, u as setCurrentInstance } from "./base-CYkvI7w8.mjs";
|
|
2
2
|
import { $ as onShow, B as onLoad, F as onAttached, G as onPullDownRefresh, H as onMoved, I as onDetached, J as onResize, K as onReachBottom, L as onError, N as setGlobalProvidedValue, P as onAddToFavorites, Q as onShareTimeline, R as onHide, U as onPageNotFound, V as onMemoryWarning, W as onPageScroll, X as onSaveExitState, Y as onRouteDone, Z as onShareAppMessage, _ as hasInjectionContext, b as provide, et as onTabItemTap, n as useNativeRouter, nt as onUnhandledRejection, q as onReady, rt as onUnload, t as useNativePageRouter, tt as onThemeChange, v as inject, x as provideGlobal, y as injectGlobal, z as onLaunch } from "./router-BD-ovqV2.mjs";
|
|
3
|
-
import { $ as version, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-
|
|
3
|
+
import { $ as version, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-CvZ5CnbL.mjs";
|
|
4
4
|
|
|
5
5
|
export { callHookList, callHookReturn, createApp, createWevuComponent, createWevuScopedSlotComponent, defineAppSetup, defineComponent, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentSetupContext, getNavigationBarMetrics, hasInjectionContext, inject, injectGlobal, isNoSetData, markNoSetData, mergeModels, mountRuntimeInstance, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, provide, provideGlobal, registerApp, registerComponent, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost };
|
|
@@ -3,7 +3,7 @@ import { A as removeMutationRecorder, B as trigger, M as effect, N as effectScop
|
|
|
3
3
|
import { i as touchReactive, n as clearPatchIndices, r as prelinkReactiveTree, t as computed } from "./computed-BxRsUJgi.mjs";
|
|
4
4
|
import { _ as getScopedSlotHostGlobalObject, c as getCurrentSetupContext, d as setCurrentSetupContext, g as getMiniProgramGlobalObject, h as getCurrentMiniProgramRuntimeCapabilities, l as pushHook, m as getCurrentMiniProgramPages, n as callHookList, p as getCurrentMiniProgramHostConfig, r as callHookReturn, s as getCurrentInstance, t as assertInSetup, u as setCurrentInstance, v as supportsCurrentMiniProgramRuntimeCapability, x as readonly } from "./base-CYkvI7w8.mjs";
|
|
5
5
|
import { $ as onShow, A as attachRuntimeProvideContext, C as ensureMiniProgramGlobalPatched, D as resolvePageOptions, E as releaseCurrentPageInstance, F as onAttached, G as onPullDownRefresh, I as onDetached, M as setRuntimeAppProvidedValue, O as runInPageScrollHook, S as bindCurrentPageInstance, T as getCurrentPageInstance, W as onPageScroll, j as ensureRuntimeAppProvides, k as attachRuntimeLayoutProvideContext, rt as onUnload, w as ensurePageShareMenus } from "./router-BD-ovqV2.mjs";
|
|
6
|
-
import { WEVU_ATTRS_KEY, WEVU_EFFECT_SCOPE_KEY, WEVU_EXPOSED_KEY, WEVU_FUNCTION_PROP_PATHS_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_ALIASES_KEY, WEVU_PROPS_DERIVED_KEYS_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_SCOPED_SLOT_OWNER_SEED_KEY, WEVU_SCOPED_SLOT_OWNER_STORE_KEY, WEVU_SETUP_CONTEXT_INSTANCE_KEY, WEVU_SETUP_STATE_KEY, WEVU_SLOT_NAMES_PROP, WEVU_SLOT_OWNER_ID_KEY, WEVU_SLOT_OWNER_ID_PROP, WEVU_SLOT_OWNER_KEY, WEVU_SLOT_OWNER_PROXY_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
|
+
import { WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY, WEVU_ATTRS_KEY, WEVU_EFFECT_SCOPE_KEY, WEVU_EXPOSED_KEY, WEVU_FUNCTION_PROP_PATHS_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_ALIASES_KEY, WEVU_PROPS_DERIVED_KEYS_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_SCOPED_SLOT_OWNER_SEED_KEY, WEVU_SCOPED_SLOT_OWNER_STORE_KEY, WEVU_SETUP_CONTEXT_INSTANCE_KEY, WEVU_SETUP_STATE_KEY, WEVU_SLOT_NAMES_PROP, WEVU_SLOT_OWNER_ID_KEY, WEVU_SLOT_OWNER_ID_PROP, WEVU_SLOT_OWNER_KEY, WEVU_SLOT_OWNER_PROXY_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";
|
|
7
7
|
import { wpi } from "@wevu/api";
|
|
8
8
|
|
|
9
9
|
//#region src/runtime/hooks/vue.ts
|
|
@@ -83,7 +83,7 @@ function callUpdateHooks(target, phase) {
|
|
|
83
83
|
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region package.json
|
|
86
|
-
var version$1 = "6.18.
|
|
86
|
+
var version$1 = "6.18.3";
|
|
87
87
|
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region src/version.ts
|
|
@@ -3280,8 +3280,9 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
3280
3280
|
const setData = resolveNativeSetData(instance);
|
|
3281
3281
|
if (setData) return callNativeSetData(instance, setData, payload);
|
|
3282
3282
|
} };
|
|
3283
|
-
adapter.__wevu_enableSetData = () => {
|
|
3283
|
+
adapter.__wevu_enableSetData = (discardPending = false) => {
|
|
3284
3284
|
enabled = true;
|
|
3285
|
+
if (discardPending) pending = void 0;
|
|
3285
3286
|
const setData = resolveNativeSetData(instance);
|
|
3286
3287
|
if (pending && Object.keys(pending).length && setData) {
|
|
3287
3288
|
const payload = pending;
|
|
@@ -3453,24 +3454,70 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
|
3453
3454
|
bridgeRuntimeMethodsToTarget(target, runtime);
|
|
3454
3455
|
return runtime;
|
|
3455
3456
|
}
|
|
3457
|
+
function preserveRuntimeFacadeIdentity(target, previousRuntime, nextRuntime) {
|
|
3458
|
+
for (const key of Reflect.ownKeys(previousRuntime)) if (!Reflect.has(nextRuntime, key)) {
|
|
3459
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(previousRuntime, key);
|
|
3460
|
+
if (descriptor === null || descriptor === void 0 ? void 0 : descriptor.configurable) Reflect.deleteProperty(previousRuntime, key);
|
|
3461
|
+
}
|
|
3462
|
+
for (const key of Reflect.ownKeys(nextRuntime)) {
|
|
3463
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(nextRuntime, key);
|
|
3464
|
+
if (!descriptor) continue;
|
|
3465
|
+
try {
|
|
3466
|
+
Reflect.defineProperty(previousRuntime, key, descriptor);
|
|
3467
|
+
} catch (_unused3) {
|
|
3468
|
+
try {
|
|
3469
|
+
previousRuntime[key] = nextRuntime[key];
|
|
3470
|
+
} catch (_unused4) {}
|
|
3471
|
+
}
|
|
3472
|
+
}
|
|
3473
|
+
attachRuntimeRef(previousRuntime.state, previousRuntime);
|
|
3474
|
+
target.__wevu = previousRuntime;
|
|
3475
|
+
Object.defineProperty(target, WEVU_PUBLIC_RUNTIME_KEY, {
|
|
3476
|
+
value: previousRuntime,
|
|
3477
|
+
configurable: true,
|
|
3478
|
+
enumerable: false,
|
|
3479
|
+
writable: false
|
|
3480
|
+
});
|
|
3481
|
+
return previousRuntime;
|
|
3482
|
+
}
|
|
3483
|
+
/**
|
|
3484
|
+
* 重建运行时实例,同时保持宿主包装对象持有的 runtime facade 身份稳定。
|
|
3485
|
+
* @internal
|
|
3486
|
+
*/
|
|
3487
|
+
function refreshRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
|
|
3488
|
+
const previousRuntime = target.__wevu;
|
|
3489
|
+
teardownRuntimeInstance(target, { skipHooks: true });
|
|
3490
|
+
const nextRuntime = mountRuntimeInstance(target, runtimeApp, watchMap, setup, {
|
|
3491
|
+
deferSetData: true,
|
|
3492
|
+
snapshotOmitKeys: options === null || options === void 0 ? void 0 : options.snapshotOmitKeys
|
|
3493
|
+
});
|
|
3494
|
+
if (!previousRuntime || previousRuntime === nextRuntime) return nextRuntime;
|
|
3495
|
+
return preserveRuntimeFacadeIdentity(target, previousRuntime, nextRuntime);
|
|
3496
|
+
}
|
|
3456
3497
|
function syncRuntimeStateFromNativeData(target) {
|
|
3457
|
-
|
|
3458
|
-
const runtimeState =
|
|
3498
|
+
const runtime = target.__wevu;
|
|
3499
|
+
const runtimeState = runtime === null || runtime === void 0 ? void 0 : runtime.state;
|
|
3500
|
+
const setupState = runtime === null || runtime === void 0 ? void 0 : runtime.setupState;
|
|
3459
3501
|
const nativeData = target.data;
|
|
3460
3502
|
if (!runtimeState || typeof runtimeState !== "object" || !nativeData || typeof nativeData !== "object") return;
|
|
3461
3503
|
for (const [key, value] of Object.entries(nativeData)) {
|
|
3462
3504
|
if (!key || key === "undefined") continue;
|
|
3463
3505
|
if (Object.prototype.hasOwnProperty.call(runtimeState, key)) try {
|
|
3506
|
+
const setupBinding = setupState === null || setupState === void 0 ? void 0 : setupState[key];
|
|
3507
|
+
if (isRef(setupBinding)) {
|
|
3508
|
+
setupBinding.value = value;
|
|
3509
|
+
continue;
|
|
3510
|
+
}
|
|
3464
3511
|
runtimeState[key] = value;
|
|
3465
|
-
} catch (
|
|
3512
|
+
} catch (_unused5) {}
|
|
3466
3513
|
}
|
|
3467
3514
|
}
|
|
3468
3515
|
function enableDeferredSetData(target) {
|
|
3469
3516
|
var _wevu, _wevu2, _wevu2$__wevu_flushSe;
|
|
3470
3517
|
const adapter = (_wevu = target.__wevu) === null || _wevu === void 0 ? void 0 : _wevu.adapter;
|
|
3471
3518
|
syncRuntimeStateFromNativeData(target);
|
|
3519
|
+
if (adapter && typeof adapter.__wevu_enableSetData === "function") adapter.__wevu_enableSetData(true);
|
|
3472
3520
|
(_wevu2 = target.__wevu) === null || _wevu2 === void 0 || (_wevu2$__wevu_flushSe = _wevu2.__wevu_flushSetupSnapshotSync) === null || _wevu2$__wevu_flushSe === void 0 || _wevu2$__wevu_flushSe.call(_wevu2);
|
|
3473
|
-
if (adapter && typeof adapter.__wevu_enableSetData === "function") adapter.__wevu_enableSetData();
|
|
3474
3521
|
}
|
|
3475
3522
|
function setRuntimeSetDataVisibility(target, visible) {
|
|
3476
3523
|
var _wevu3;
|
|
@@ -3481,18 +3528,18 @@ function setRuntimeSetDataVisibility(target, visible) {
|
|
|
3481
3528
|
* 卸载运行时实例(框架内部注册流程使用)。
|
|
3482
3529
|
* @internal
|
|
3483
3530
|
*/
|
|
3484
|
-
function teardownRuntimeInstance(target) {
|
|
3531
|
+
function teardownRuntimeInstance(target, options) {
|
|
3485
3532
|
var _target$WEVU_EFFECT_S;
|
|
3486
3533
|
const runtime = target.__wevu;
|
|
3487
3534
|
const ownerId = target[WEVU_SLOT_OWNER_ID_KEY];
|
|
3488
3535
|
if (ownerId) removeOwner(ownerId);
|
|
3489
3536
|
clearTemplateRefs(target);
|
|
3490
|
-
if (runtime && target[WEVU_HOOKS_KEY]) callHookList(target, "onUnload", []);
|
|
3537
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipHooks) && runtime && target[WEVU_HOOKS_KEY]) callHookList(target, "onUnload", []);
|
|
3491
3538
|
if (target[WEVU_HOOKS_KEY]) target[WEVU_HOOKS_KEY] = void 0;
|
|
3492
3539
|
const stops = target[WEVU_WATCH_STOPS_KEY];
|
|
3493
3540
|
if (Array.isArray(stops)) for (const stop of stops) try {
|
|
3494
3541
|
stop();
|
|
3495
|
-
} catch (
|
|
3542
|
+
} catch (_unused6) {}
|
|
3496
3543
|
target[WEVU_WATCH_STOPS_KEY] = void 0;
|
|
3497
3544
|
(_target$WEVU_EFFECT_S = target[WEVU_EFFECT_SCOPE_KEY]) === null || _target$WEVU_EFFECT_S === void 0 || _target$WEVU_EFFECT_S.stop();
|
|
3498
3545
|
target[WEVU_EFFECT_SCOPE_KEY] = void 0;
|
|
@@ -4644,7 +4691,7 @@ function registerComponentDefinition(options) {
|
|
|
4644
4691
|
return pageHook.apply(this, args);
|
|
4645
4692
|
};
|
|
4646
4693
|
}
|
|
4647
|
-
|
|
4694
|
+
const componentDefinition = {
|
|
4648
4695
|
...restOptions,
|
|
4649
4696
|
...pageLifecycleHooks,
|
|
4650
4697
|
observers: finalObservers,
|
|
@@ -4784,7 +4831,18 @@ function registerComponentDefinition(options) {
|
|
|
4784
4831
|
...finalMethods
|
|
4785
4832
|
},
|
|
4786
4833
|
options: finalOptions
|
|
4787
|
-
}
|
|
4834
|
+
};
|
|
4835
|
+
const statefulHmrBridge = globalThis[WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY];
|
|
4836
|
+
if (typeof (statefulHmrBridge === null || statefulHmrBridge === void 0 ? void 0 : statefulHmrBridge.trackWevuComponent) === "function") {
|
|
4837
|
+
const definition = statefulHmrBridge.trackWevuComponent(componentDefinition, (instance) => {
|
|
4838
|
+
refreshRuntimeInstance(instance, runtimeApp, watch, setup, { snapshotOmitKeys: directPropsDerivedKeys });
|
|
4839
|
+
syncWevuPropsFromInstance(instance);
|
|
4840
|
+
attachPageLayoutSetter(instance);
|
|
4841
|
+
attachRuntimeLayoutHosts(instance);
|
|
4842
|
+
enableDeferredSetData(instance);
|
|
4843
|
+
});
|
|
4844
|
+
if (!statefulHmrBridge.isApplying()) Component(definition);
|
|
4845
|
+
} else Component(componentDefinition);
|
|
4788
4846
|
}
|
|
4789
4847
|
|
|
4790
4848
|
//#endregion
|
|
@@ -6373,4 +6431,4 @@ function useTemplateRef(name) {
|
|
|
6373
6431
|
|
|
6374
6432
|
//#endregion
|
|
6375
6433
|
export { version as $, registerPageLayoutBridge as A, mountRuntimeInstance as B, useElementIntersectionObserver as C, defineComponent as D, createWevuScopedSlotComponent as E, unregisterRuntimeLayoutHosts as F, setPageLayout as G, teardownRuntimeInstance as H, useLayoutBridge as I, usePageLayout as J, syncRuntimePageLayoutState as K, useLayoutHosts as L, resolveLayoutBridge as M, resolveLayoutHost as N, createApp as O, unregisterPageLayoutBridge as P, markNoSetData as Q, waitForLayoutHost as R, useIntersectionObserver as S, createWevuComponent as T, runSetupFunction as U, setRuntimeSetDataVisibility as V, resolveRuntimePageLayoutName as W, setWevuDefaults as X, resetWevuDefaults as Y, isNoSetData as Z, usePageScrollThrottle as _, useModel as a, onDeactivated as at, useNavigationBarMetrics as b, useSlots as c, onServerPrefetch as ct, useUpdatePerformanceListener as d, callUpdateHooks as et, useBoundingClientRect as f, useAsyncPullDownRefresh as g, useSelectorQuery as h, useChangeModel as i, onBeforeUpdate as it, registerRuntimeLayoutHosts as j, registerComponent as k, defineAppSetup as l, onUnmounted as lt, useSelectorFields as m, mergeModels as n, onBeforeMount as nt, useAttrs as o, onErrorCaptured as ot, useScrollOffset as p, syncRuntimePageLayoutStateFromRuntime as q, useBindModel as r, onBeforeUnmount as rt, useNativeInstance as s, onMounted as st, useTemplateRef as t, onActivated as tt, use as u, onUpdated as ut, getCurrentPageStackSnapshot as v, useDisposables as w, usePageStack as x, getNavigationBarMetrics as y, registerApp as z };
|
|
6376
|
-
//# sourceMappingURL=templateRef-
|
|
6434
|
+
//# sourceMappingURL=templateRef-CvZ5CnbL.mjs.map
|