wevu 6.17.0 → 6.17.2
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/{base-C_Jux3cz.mjs → base-ii6cqKIl.mjs} +2 -2
- package/dist/dev/{base-C_Jux3cz.mjs.map → base-ii6cqKIl.mjs.map} +1 -1
- package/dist/dev/{computed-DKaBMLFF.mjs → computed-4hT2jDra.mjs} +2 -2
- package/dist/dev/{computed-DKaBMLFF.mjs.map → computed-4hT2jDra.mjs.map} +1 -1
- package/dist/dev/index.mjs +9 -9
- package/dist/dev/internal-reactivity.mjs +5 -5
- package/dist/dev/internal-runtime.mjs +3 -3
- package/dist/dev/internal-template.mjs +1 -1
- package/dist/dev/{ref-Beyx3EmJ.mjs → ref-Bxwe2Kfo.mjs} +5 -5
- package/dist/dev/{ref-Beyx3EmJ.mjs.map → ref-Bxwe2Kfo.mjs.map} +1 -1
- package/dist/dev/{router-CQIgz5Q_.mjs → router-D6H7HviN.mjs} +2 -2
- package/dist/dev/{router-CQIgz5Q_.mjs.map → router-D6H7HviN.mjs.map} +1 -1
- package/dist/dev/router.mjs +3 -3
- package/dist/dev/{store-Dzij_OWm.mjs → store-7lzhCASj.mjs} +3 -3
- package/dist/dev/{store-Dzij_OWm.mjs.map → store-7lzhCASj.mjs.map} +1 -1
- package/dist/dev/store.mjs +1 -1
- package/dist/dev/{template-QtiM6Ubi.mjs → template-DLHZbQ3E.mjs} +2 -2
- package/dist/dev/{template-QtiM6Ubi.mjs.map → template-DLHZbQ3E.mjs.map} +1 -1
- package/dist/dev/{templateRef-BxL-pQJJ.mjs → templateRef-WI08WOed.mjs} +42 -60
- package/dist/dev/{templateRef-BxL-pQJJ.mjs.map → templateRef-WI08WOed.mjs.map} +1 -1
- package/dist/dev/{toRefs-BNWU48nG.mjs → toRefs-BVrN7XKZ.mjs} +2 -2
- package/dist/dev/{toRefs-BNWU48nG.mjs.map → toRefs-BVrN7XKZ.mjs.map} +1 -1
- package/dist/dev/vue-demi.mjs +9 -9
- package/dist/dev/{watch-BLUHj_gn.mjs → watch-B46crqgs.mjs} +3 -3
- package/dist/dev/{watch-BLUHj_gn.mjs.map → watch-B46crqgs.mjs.map} +1 -1
- package/dist/{index-DcoLBzsV.d.mts → index-HS9xxiUI.d.mts} +1 -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-CNk-wF37.mjs +1 -0
- package/dist/vue-demi.d.mts +1 -1
- package/dist/vue-demi.mjs +1 -1
- package/package.json +5 -5
- package/dist/templateRef-DpUlTGua.mjs +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as track, C as effect, N as nextTick, P as queueJob, a as toValue, b as addMutationRecorder, d as reactive, 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, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-
|
|
2
|
-
import { t as computed } from "./computed-
|
|
3
|
-
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-
|
|
4
|
-
import { l as shallowRef, t as watch } from "./watch-
|
|
5
|
-
import { C as releaseCurrentPageInstance, D as attachRuntimeProvideContext, E as attachRuntimeLayoutProvideContext, H as onPullDownRefresh, M as onAttached, N as onDetached, O as ensureRuntimeAppProvides, S as getCurrentPageInstance, T as runInPageScrollHook, V as onPageScroll, X as onShow, b as ensureMiniProgramGlobalPatched, et as onUnload, k as setRuntimeAppProvidedValue, w as resolvePageOptions, x as ensurePageShareMenus, y as bindCurrentPageInstance } from "./router-
|
|
1
|
+
import { A as track, C as effect, N as nextTick, P as queueJob, a as toValue, b as addMutationRecorder, d as reactive, 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, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-Bxwe2Kfo.mjs";
|
|
2
|
+
import { t as computed } from "./computed-4hT2jDra.mjs";
|
|
3
|
+
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-ii6cqKIl.mjs";
|
|
4
|
+
import { l as shallowRef, t as watch } from "./watch-B46crqgs.mjs";
|
|
5
|
+
import { C as releaseCurrentPageInstance, D as attachRuntimeProvideContext, E as attachRuntimeLayoutProvideContext, H as onPullDownRefresh, M as onAttached, N as onDetached, O as ensureRuntimeAppProvides, S as getCurrentPageInstance, T as runInPageScrollHook, V as onPageScroll, X as onShow, b as ensureMiniProgramGlobalPatched, et as onUnload, k as setRuntimeAppProvidedValue, w as resolvePageOptions, x as ensurePageShareMenus, y as bindCurrentPageInstance } from "./router-D6H7HviN.mjs";
|
|
6
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";
|
|
7
|
-
import { resolveMiniProgramPageKeys } from "@weapp-core/shared";
|
|
7
|
+
import { createMiniProgramLayoutHostRegistry, normalizeMiniProgramLayoutHostKeys, resolveMiniProgramPageKeys } from "@weapp-core/shared";
|
|
8
8
|
import { wpi } from "@wevu/api";
|
|
9
9
|
|
|
10
10
|
//#region src/runtime/hooks/vue.ts
|
|
@@ -84,7 +84,7 @@ function callUpdateHooks(target, phase) {
|
|
|
84
84
|
|
|
85
85
|
//#endregion
|
|
86
86
|
//#region package.json
|
|
87
|
-
var version$1 = "6.17.
|
|
87
|
+
var version$1 = "6.17.2";
|
|
88
88
|
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/version.ts
|
|
@@ -1257,7 +1257,7 @@ function createSetDataScheduler(options) {
|
|
|
1257
1257
|
const resolveTopKeysByRoot = (root) => {
|
|
1258
1258
|
const matches = [];
|
|
1259
1259
|
const rawSetupState = setupState && typeof setupState === "object" ? isReactive(setupState) ? toRaw(setupState) : setupState : void 0;
|
|
1260
|
-
for (const key of new Set([...Object.keys(state), ...rawSetupState ? Object.keys(rawSetupState) : []])) {
|
|
1260
|
+
for (const key of /* @__PURE__ */ new Set([...Object.keys(state), ...rawSetupState ? Object.keys(rawSetupState) : []])) {
|
|
1261
1261
|
if (!shouldIncludeSnapshotKey(key)) continue;
|
|
1262
1262
|
const value = rawSetupState && hasOwn(rawSetupState, key) ? rawSetupState[key] : state[key];
|
|
1263
1263
|
const candidate = isRef(value) ? value.value : value;
|
|
@@ -1317,7 +1317,7 @@ function createSetDataScheduler(options) {
|
|
|
1317
1317
|
const includedStateKeys = /* @__PURE__ */ new Set();
|
|
1318
1318
|
const includedComputedKeys = /* @__PURE__ */ new Set();
|
|
1319
1319
|
const replacedTopLevelKeys = /* @__PURE__ */ new Set();
|
|
1320
|
-
for (const key of new Set([...Object.keys(rawState), ...rawSetupState ? Object.keys(rawSetupState) : []])) {
|
|
1320
|
+
for (const key of /* @__PURE__ */ new Set([...Object.keys(rawState), ...rawSetupState ? Object.keys(rawSetupState) : []])) {
|
|
1321
1321
|
if (!shouldIncludeSnapshotKey(key)) continue;
|
|
1322
1322
|
includedStateKeys.add(key);
|
|
1323
1323
|
const source = rawSetupState && hasOwn(rawSetupState, key) ? rawSetupState : rawState;
|
|
@@ -2216,7 +2216,7 @@ function mergeComponentRefValue(wrapper, exposed) {
|
|
|
2216
2216
|
return Reflect.has(target, key) || key in source;
|
|
2217
2217
|
},
|
|
2218
2218
|
ownKeys(target) {
|
|
2219
|
-
return [
|
|
2219
|
+
return [.../* @__PURE__ */ new Set([...Reflect.ownKeys(target), ...Reflect.ownKeys(source)])];
|
|
2220
2220
|
},
|
|
2221
2221
|
getOwnPropertyDescriptor(target, key) {
|
|
2222
2222
|
if (Reflect.has(target, key)) return Object.getOwnPropertyDescriptor(target, key);
|
|
@@ -3989,7 +3989,7 @@ function prepareComponentOptions(mpOptions) {
|
|
|
3989
3989
|
].some((hook) => typeof hook === "function");
|
|
3990
3990
|
const isPage = Boolean(rest.__wevu_isPage) || Object.keys(features !== null && features !== void 0 ? features : {}).length > 0 || hasPageOnlyHooks;
|
|
3991
3991
|
const restOptions = { ...rest };
|
|
3992
|
-
const preservedInstanceFieldKeys = new Set([
|
|
3992
|
+
const preservedInstanceFieldKeys = /* @__PURE__ */ new Set([
|
|
3993
3993
|
"data",
|
|
3994
3994
|
"behaviors",
|
|
3995
3995
|
"relations",
|
|
@@ -4025,7 +4025,7 @@ function prepareComponentOptions(mpOptions) {
|
|
|
4025
4025
|
} catch (_unused) {}
|
|
4026
4026
|
}
|
|
4027
4027
|
};
|
|
4028
|
-
const moveToMethodsExcludes = new Set([
|
|
4028
|
+
const moveToMethodsExcludes = /* @__PURE__ */ new Set([
|
|
4029
4029
|
"data",
|
|
4030
4030
|
"export",
|
|
4031
4031
|
"definitionFilter",
|
|
@@ -4127,7 +4127,7 @@ function createPropsSync(options) {
|
|
|
4127
4127
|
const aliasEntries = Object.entries(propsAliases !== null && propsAliases !== void 0 ? propsAliases : {}).filter(([alias, propName]) => alias && propName);
|
|
4128
4128
|
const aliasKeySet = new Set(aliasEntries.map(([alias]) => alias));
|
|
4129
4129
|
const directPropsDerivedKeys = [...propsDerivedKeySet].filter((key) => propKeySet.has(key) && !aliasKeySet.has(key));
|
|
4130
|
-
const templateRuntimePropKeys = new Set([
|
|
4130
|
+
const templateRuntimePropKeys = /* @__PURE__ */ new Set([
|
|
4131
4131
|
WEVU_SLOT_NAMES_PROP,
|
|
4132
4132
|
WEVU_SLOT_OWNER_ID_PROP,
|
|
4133
4133
|
WEVU_SLOT_SCOPE_KEY
|
|
@@ -4331,14 +4331,11 @@ function createPropsSync(options) {
|
|
|
4331
4331
|
|
|
4332
4332
|
//#endregion
|
|
4333
4333
|
//#region src/runtime/layoutBridge.ts
|
|
4334
|
-
const
|
|
4334
|
+
const pageLayoutBridgeRegistry = createMiniProgramLayoutHostRegistry();
|
|
4335
4335
|
function resolveCurrentPageInstance() {
|
|
4336
4336
|
const pages = getCurrentMiniProgramPages();
|
|
4337
4337
|
return pages[pages.length - 1];
|
|
4338
4338
|
}
|
|
4339
|
-
function normalizeSelectors(selectors) {
|
|
4340
|
-
return Array.from(new Set(Array.isArray(selectors) ? selectors : [selectors])).filter((selector) => typeof selector === "string" && selector.length > 0);
|
|
4341
|
-
}
|
|
4342
4339
|
function resolvePageKeys(page) {
|
|
4343
4340
|
return resolveMiniProgramPageKeys(page);
|
|
4344
4341
|
}
|
|
@@ -4388,7 +4385,8 @@ function resolveDeclaredLayoutHostFromRefs(binding, context) {
|
|
|
4388
4385
|
}
|
|
4389
4386
|
function createDeclaredLayoutHostBridge(bindings, context) {
|
|
4390
4387
|
const nativeContext = resolveNativeLayoutContext(context);
|
|
4391
|
-
|
|
4388
|
+
const bridgeBase = nativeContext && typeof nativeContext === "object" ? Object.create(nativeContext) : {};
|
|
4389
|
+
return Object.assign(bridgeBase, { selectComponent(key) {
|
|
4392
4390
|
const binding = findLayoutHostBinding(bindings, key);
|
|
4393
4391
|
if (!binding) return null;
|
|
4394
4392
|
if (binding.kind === "component" || !binding.kind) {
|
|
@@ -4408,12 +4406,7 @@ function registerPageLayoutBridge(selectors, context) {
|
|
|
4408
4406
|
const page = resolvePageFromContext(bridgeContext);
|
|
4409
4407
|
const pageKeys = resolvePageKeys(page);
|
|
4410
4408
|
if (!bridgeContext || !page || pageKeys.length === 0) return false;
|
|
4411
|
-
|
|
4412
|
-
var _pageLayoutBridges$ge;
|
|
4413
|
-
const registry = (_pageLayoutBridges$ge = pageLayoutBridges.get(pageKey)) !== null && _pageLayoutBridges$ge !== void 0 ? _pageLayoutBridges$ge : /* @__PURE__ */ new Map();
|
|
4414
|
-
for (const selector of normalizeSelectors(selectors)) registry.set(selector, bridgeContext);
|
|
4415
|
-
pageLayoutBridges.set(pageKey, registry);
|
|
4416
|
-
}
|
|
4409
|
+
if (!pageLayoutBridgeRegistry.register(selectors, bridgeContext, pageKeys)) return false;
|
|
4417
4410
|
bridgeContext[WEVU_LAYOUT_BRIDGE_PAGE_KEYS] = pageKeys;
|
|
4418
4411
|
return true;
|
|
4419
4412
|
}
|
|
@@ -4426,16 +4419,7 @@ function unregisterPageLayoutBridge(selectors, context) {
|
|
|
4426
4419
|
const page = resolvePageFromContext(bridgeContext);
|
|
4427
4420
|
const pageKeys = (_bridgeContext$WEVU_L = bridgeContext === null || bridgeContext === void 0 ? void 0 : bridgeContext[WEVU_LAYOUT_BRIDGE_PAGE_KEYS]) !== null && _bridgeContext$WEVU_L !== void 0 ? _bridgeContext$WEVU_L : resolvePageKeys(page);
|
|
4428
4421
|
if (!bridgeContext || !Array.isArray(pageKeys) || pageKeys.length === 0) return false;
|
|
4429
|
-
|
|
4430
|
-
for (const pageKey of pageKeys) {
|
|
4431
|
-
const registry = pageLayoutBridges.get(pageKey);
|
|
4432
|
-
if (!registry) continue;
|
|
4433
|
-
for (const selector of normalizeSelectors(selectors)) if (registry.get(selector) === bridgeContext) {
|
|
4434
|
-
registry.delete(selector);
|
|
4435
|
-
removed = true;
|
|
4436
|
-
}
|
|
4437
|
-
if (registry.size === 0) pageLayoutBridges.delete(pageKey);
|
|
4438
|
-
}
|
|
4422
|
+
const removed = pageLayoutBridgeRegistry.unregister(selectors, bridgeContext, pageKeys);
|
|
4439
4423
|
delete bridgeContext[WEVU_LAYOUT_BRIDGE_PAGE_KEYS];
|
|
4440
4424
|
return removed;
|
|
4441
4425
|
}
|
|
@@ -4444,38 +4428,35 @@ function unregisterPageLayoutBridge(selectors, context) {
|
|
|
4444
4428
|
*/
|
|
4445
4429
|
function resolveLayoutBridge(selector, fallbackContext) {
|
|
4446
4430
|
var _resolveCurrentPageIn, _ref4;
|
|
4447
|
-
const
|
|
4448
|
-
|
|
4449
|
-
return (_pageLayoutBridges$ge2 = pageLayoutBridges.get(pageKey)) === null || _pageLayoutBridges$ge2 === void 0 ? void 0 : _pageLayoutBridges$ge2.get(selector);
|
|
4450
|
-
}).find(Boolean);
|
|
4431
|
+
const page = (_resolveCurrentPageIn = resolveCurrentPageInstance()) !== null && _resolveCurrentPageIn !== void 0 ? _resolveCurrentPageIn : resolvePageFromContext(fallbackContext);
|
|
4432
|
+
const bridgeContext = pageLayoutBridgeRegistry.resolveBridge(selector, resolvePageKeys(page));
|
|
4451
4433
|
return (_ref4 = bridgeContext !== null && bridgeContext !== void 0 ? bridgeContext : fallbackContext) !== null && _ref4 !== void 0 ? _ref4 : getCurrentInstance();
|
|
4452
4434
|
}
|
|
4453
4435
|
/**
|
|
4454
4436
|
* 解析当前页面 layout 内通过指定 key 暴露的宿主实例。
|
|
4455
4437
|
*/
|
|
4456
4438
|
function resolveLayoutHost(key, options = {}) {
|
|
4457
|
-
var _options$context,
|
|
4458
|
-
const
|
|
4459
|
-
const
|
|
4460
|
-
return
|
|
4439
|
+
var _options$context, _resolveCurrentPageIn2;
|
|
4440
|
+
const context = (_options$context = options.context) !== null && _options$context !== void 0 ? _options$context : options.fallbackContext;
|
|
4441
|
+
const page = (_resolveCurrentPageIn2 = resolveCurrentPageInstance()) !== null && _resolveCurrentPageIn2 !== void 0 ? _resolveCurrentPageIn2 : resolvePageFromContext(context);
|
|
4442
|
+
return pageLayoutBridgeRegistry.resolveHost(key, resolvePageKeys(page), (bridge, key) => {
|
|
4443
|
+
var _bridge$selectCompone;
|
|
4444
|
+
return (_bridge$selectCompone = bridge.selectComponent) === null || _bridge$selectCompone === void 0 ? void 0 : _bridge$selectCompone.call(bridge, key);
|
|
4445
|
+
});
|
|
4461
4446
|
}
|
|
4462
4447
|
/**
|
|
4463
4448
|
* 等待当前页面 layout 宿主实例可用,适合页面初次进入时的异步宿主解析。
|
|
4464
4449
|
*/
|
|
4465
4450
|
function waitForLayoutHost(key, options = {}) {
|
|
4466
|
-
var _options$
|
|
4467
|
-
const
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
retries: retries - 1
|
|
4476
|
-
}));
|
|
4477
|
-
}, interval);
|
|
4478
|
-
});
|
|
4451
|
+
var _options$context2;
|
|
4452
|
+
const context = (_options$context2 = options.context) !== null && _options$context2 !== void 0 ? _options$context2 : options.fallbackContext;
|
|
4453
|
+
return pageLayoutBridgeRegistry.waitForHost(key, () => {
|
|
4454
|
+
var _resolveCurrentPageIn3;
|
|
4455
|
+
return resolvePageKeys((_resolveCurrentPageIn3 = resolveCurrentPageInstance()) !== null && _resolveCurrentPageIn3 !== void 0 ? _resolveCurrentPageIn3 : resolvePageFromContext(context));
|
|
4456
|
+
}, (bridge, key) => {
|
|
4457
|
+
var _bridge$selectCompone2;
|
|
4458
|
+
return (_bridge$selectCompone2 = bridge.selectComponent) === null || _bridge$selectCompone2 === void 0 ? void 0 : _bridge$selectCompone2.call(bridge, key);
|
|
4459
|
+
}, options);
|
|
4479
4460
|
}
|
|
4480
4461
|
/**
|
|
4481
4462
|
* 在 layout 生命周期内暴露 bridge,使页面或子组件可访问 layout 内部实例。
|
|
@@ -4483,10 +4464,11 @@ function waitForLayoutHost(key, options = {}) {
|
|
|
4483
4464
|
function useLayoutBridge(selectors, options = {}) {
|
|
4484
4465
|
if (!getCurrentSetupContext()) throw new Error("useLayoutBridge() 必须在 setup() 的同步阶段调用");
|
|
4485
4466
|
const context = getCurrentInstance();
|
|
4486
|
-
const normalizedSelectors =
|
|
4467
|
+
const normalizedSelectors = normalizeMiniProgramLayoutHostKeys(selectors);
|
|
4487
4468
|
const resolveComponent = options.resolveComponent;
|
|
4488
4469
|
const nativeContext = resolveNativeLayoutContext(context);
|
|
4489
|
-
const
|
|
4470
|
+
const bridgeBase = nativeContext && typeof nativeContext === "object" ? Object.create(nativeContext) : {};
|
|
4471
|
+
const bridge = Object.assign(bridgeBase, { selectComponent(selector) {
|
|
4490
4472
|
var _nativeContext$select, _currentPage$selectCo, _currentPage$selectCo2;
|
|
4491
4473
|
if (!normalizedSelectors.includes(selector)) return null;
|
|
4492
4474
|
const resolvedComponent = resolveComponent === null || resolveComponent === void 0 ? void 0 : resolveComponent(selector);
|
|
@@ -5031,7 +5013,7 @@ function resolveNativeInitialData(data, computed, setData) {
|
|
|
5031
5013
|
//#region src/runtime/define/props.ts
|
|
5032
5014
|
const ALLOW_NULL_PROP_INPUT_KEY = "__wevu_allowNullPropInput";
|
|
5033
5015
|
const PUBLIC_ALLOW_NULL_PROP_INPUT_KEY = "allowNullPropInput";
|
|
5034
|
-
const NATIVE_PROPERTY_TYPE_MAP = new Map([
|
|
5016
|
+
const NATIVE_PROPERTY_TYPE_MAP = /* @__PURE__ */ new Map([
|
|
5035
5017
|
[String, String],
|
|
5036
5018
|
[Number, Number],
|
|
5037
5019
|
[Boolean, Boolean],
|
|
@@ -6257,7 +6239,7 @@ function useChangeModel() {
|
|
|
6257
6239
|
function mergeModels(a, b) {
|
|
6258
6240
|
if (a == null) return b;
|
|
6259
6241
|
if (b == null) return a;
|
|
6260
|
-
if (Array.isArray(a) && Array.isArray(b)) return [
|
|
6242
|
+
if (Array.isArray(a) && Array.isArray(b)) return [.../* @__PURE__ */ new Set([...a, ...b])];
|
|
6261
6243
|
if (typeof a === "object" && typeof b === "object") return {
|
|
6262
6244
|
...a,
|
|
6263
6245
|
...b
|
|
@@ -6298,4 +6280,4 @@ function useTemplateRef(name) {
|
|
|
6298
6280
|
|
|
6299
6281
|
//#endregion
|
|
6300
6282
|
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 };
|
|
6301
|
-
//# sourceMappingURL=templateRef-
|
|
6283
|
+
//# sourceMappingURL=templateRef-WI08WOed.mjs.map
|