wevu 6.16.14 → 6.16.16

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.
@@ -1,7 +1,7 @@
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-Dui1TzOR.mjs";
2
- import { i as computed, n as defineStore, r as createStore, t as storeToRefs } from "./store-Brqfb7LU.mjs";
3
- import { $ as onUnhandledRejection, A as setGlobalProvidedValue, B as onPageNotFound, C as releaseCurrentPageInstance, D as attachRuntimeProvideContext, E as attachRuntimeLayoutProvideContext, 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, O as ensureRuntimeAppProvides, P as onError, Q as onThemeChange, R as onMemoryWarning, S as getCurrentPageInstance, T as runInPageScrollHook, 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, b as ensureMiniProgramGlobalPatched, ct as setCurrentSetupContext, dt as getCurrentMiniProgramRuntimeCapabilities, et as onUnload, ft as getMiniProgramGlobalObject, g as injectGlobal, gt as isReadonly, h as inject, ht as isProxy, it as getCurrentInstance, j as onAddToFavorites, k as setRuntimeAppProvidedValue, lt as getCurrentMiniProgramHostConfig, m as hasInjectionContext, mt as supportsCurrentMiniProgramRuntimeCapability, n as useNativeRouter, nt as callHookList, ot as pushHook, pt as getScopedSlotHostGlobalObject, q as onSaveExitState, rt as callHookReturn, st as setCurrentInstance, t as useNativePageRouter, tt as assertInSetup, ut as getCurrentMiniProgramPages, v as provideGlobal, vt as shallowReadonly, w as resolvePageOptions, x as ensurePageShareMenus, y as bindCurrentPageInstance, z as onMoved } from "./router-DFQw3LKA.mjs";
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_SCOPED_SLOT_OWNER_SEED_KEY, WEVU_SCOPED_SLOT_OWNER_STORE_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_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";
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-DwMy6G0t.mjs";
2
+ import { i as computed, n as defineStore, r as createStore, t as storeToRefs } from "./store-BQxQF7rr.mjs";
3
+ import { $ as onUnhandledRejection, A as setGlobalProvidedValue, B as onPageNotFound, C as releaseCurrentPageInstance, D as attachRuntimeProvideContext, E as attachRuntimeLayoutProvideContext, 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, O as ensureRuntimeAppProvides, P as onError, Q as onThemeChange, R as onMemoryWarning, S as getCurrentPageInstance, T as runInPageScrollHook, 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, b as ensureMiniProgramGlobalPatched, ct as setCurrentSetupContext, dt as getCurrentMiniProgramRuntimeCapabilities, et as onUnload, ft as getMiniProgramGlobalObject, g as injectGlobal, gt as isReadonly, h as inject, ht as isProxy, it as getCurrentInstance, j as onAddToFavorites, k as setRuntimeAppProvidedValue, lt as getCurrentMiniProgramHostConfig, m as hasInjectionContext, mt as supportsCurrentMiniProgramRuntimeCapability, n as useNativeRouter, nt as callHookList, ot as pushHook, pt as getScopedSlotHostGlobalObject, q as onSaveExitState, rt as callHookReturn, st as setCurrentInstance, t as useNativePageRouter, tt as assertInSetup, ut as getCurrentMiniProgramPages, v as provideGlobal, vt as shallowReadonly, w as resolvePageOptions, x as ensurePageShareMenus, y as bindCurrentPageInstance, z as onMoved } from "./router-ydmXxXVD.mjs";
4
+ 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_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_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";
5
5
  import { resolveMiniProgramPageKeys } from "@weapp-core/shared";
6
6
  import { wpi } from "@wevu/api";
7
7
 
@@ -478,7 +478,7 @@ function watchSyncEffect(effectFn, options = {}) {
478
478
 
479
479
  //#endregion
480
480
  //#region package.json
481
- var version$1 = "6.16.14";
481
+ var version$1 = "6.16.16";
482
482
 
483
483
  //#endregion
484
484
  //#region src/version.ts
@@ -944,14 +944,14 @@ function isPlainObject$1(value) {
944
944
  const proto = Object.getPrototypeOf(value);
945
945
  return proto === null || proto === Object.prototype;
946
946
  }
947
- function toPlainInternal(value, seen, cache, depth, budget) {
947
+ function toPlainInternal(value, seen, cache, depth, budget, includeFunctions, functionPathSet, currentPath) {
948
948
  const unwrapped = unref(value);
949
949
  if (typeof unwrapped === "bigint") {
950
950
  const asNumber = Number(unwrapped);
951
951
  return Number.isSafeInteger(asNumber) ? asNumber : unwrapped.toString();
952
952
  }
953
953
  if (typeof unwrapped === "symbol") return unwrapped.toString();
954
- if (typeof unwrapped === "function") return;
954
+ if (typeof unwrapped === "function") return includeFunctions || (functionPathSet === null || functionPathSet === void 0 ? void 0 : functionPathSet.has(currentPath)) ? unwrapped : void 0;
955
955
  if (typeof unwrapped !== "object" || unwrapped === null) return unwrapped;
956
956
  if (isNoSetData(unwrapped)) return;
957
957
  const raw = isReactive(unwrapped) ? toRaw(unwrapped) : unwrapped;
@@ -969,7 +969,7 @@ function toPlainInternal(value, seen, cache, depth, budget) {
969
969
  const entries = [];
970
970
  seen.set(raw, entries);
971
971
  raw.forEach((mapValue, mapKey) => {
972
- entries.push([toPlainInternal(mapKey, seen, void 0, Number.POSITIVE_INFINITY, { keys: Number.POSITIVE_INFINITY }), toPlainInternal(mapValue, seen, void 0, Number.POSITIVE_INFINITY, { keys: Number.POSITIVE_INFINITY })]);
972
+ entries.push([toPlainInternal(mapKey, seen, void 0, Number.POSITIVE_INFINITY, { keys: Number.POSITIVE_INFINITY }, includeFunctions, void 0, ""), toPlainInternal(mapValue, seen, void 0, Number.POSITIVE_INFINITY, { keys: Number.POSITIVE_INFINITY }, includeFunctions, void 0, "")]);
973
973
  });
974
974
  return entries;
975
975
  }
@@ -977,7 +977,7 @@ function toPlainInternal(value, seen, cache, depth, budget) {
977
977
  const values = [];
978
978
  seen.set(raw, values);
979
979
  raw.forEach((setValue) => {
980
- values.push(toPlainInternal(setValue, seen, void 0, Number.POSITIVE_INFINITY, { keys: Number.POSITIVE_INFINITY }));
980
+ values.push(toPlainInternal(setValue, seen, void 0, Number.POSITIVE_INFINITY, { keys: Number.POSITIVE_INFINITY }, includeFunctions, void 0, ""));
981
981
  });
982
982
  return values;
983
983
  }
@@ -988,7 +988,7 @@ function toPlainInternal(value, seen, cache, depth, budget) {
988
988
  if (typeof view[Symbol.iterator] === "function") {
989
989
  const values = [...view];
990
990
  seen.set(raw, values);
991
- return values.map((item) => toPlainInternal(item, seen, void 0, Number.POSITIVE_INFINITY, { keys: Number.POSITIVE_INFINITY }));
991
+ return values.map((item) => toPlainInternal(item, seen, void 0, Number.POSITIVE_INFINITY, { keys: Number.POSITIVE_INFINITY }, includeFunctions, void 0, ""));
992
992
  }
993
993
  const bytes = [...new Uint8Array(view.buffer, view.byteOffset, view.byteLength)];
994
994
  seen.set(raw, bytes);
@@ -1004,7 +1004,8 @@ function toPlainInternal(value, seen, cache, depth, budget) {
1004
1004
  seen.set(raw, arr);
1005
1005
  const nextDepth = depth - 1;
1006
1006
  for (let index = 0; index < raw.length; index += 1) {
1007
- const next = toPlainInternal(raw[index], seen, cache, nextDepth, budget);
1007
+ const childPath = currentPath ? `${currentPath}.${index}` : String(index);
1008
+ const next = toPlainInternal(raw[index], seen, cache, nextDepth, budget, includeFunctions, functionPathSet, childPath);
1008
1009
  arr[index] = next === void 0 ? null : next;
1009
1010
  }
1010
1011
  if (cacheRef) cacheRef.set(raw, {
@@ -1019,7 +1020,8 @@ function toPlainInternal(value, seen, cache, depth, budget) {
1019
1020
  for (const key of Object.keys(raw)) {
1020
1021
  budget.keys -= 1;
1021
1022
  if (budget.keys <= 0) break;
1022
- const next = toPlainInternal(raw[key], seen, cache, nextDepth, budget);
1023
+ const childPath = currentPath ? `${currentPath}.${key}` : key;
1024
+ const next = toPlainInternal(raw[key], seen, cache, nextDepth, budget, includeFunctions, functionPathSet, childPath);
1023
1025
  if (next !== void 0) output[key] = next;
1024
1026
  }
1025
1027
  if (cacheRef) cacheRef.set(raw, {
@@ -1029,10 +1031,11 @@ function toPlainInternal(value, seen, cache, depth, budget) {
1029
1031
  return output;
1030
1032
  }
1031
1033
  function toPlain(value, seen = /* @__PURE__ */ new WeakMap(), options) {
1032
- var _options$_depth, _options$_budget;
1034
+ var _options$_depth, _options$_budget, _options$_path;
1033
1035
  const depth = (_options$_depth = options === null || options === void 0 ? void 0 : options._depth) !== null && _options$_depth !== void 0 ? _options$_depth : typeof (options === null || options === void 0 ? void 0 : options.maxDepth) === "number" ? Math.max(0, Math.floor(options.maxDepth)) : Number.POSITIVE_INFINITY;
1034
1036
  const budget = (_options$_budget = options === null || options === void 0 ? void 0 : options._budget) !== null && _options$_budget !== void 0 ? _options$_budget : typeof (options === null || options === void 0 ? void 0 : options.maxKeys) === "number" ? { keys: Math.max(0, Math.floor(options.maxKeys)) } : { keys: Number.POSITIVE_INFINITY };
1035
- return toPlainInternal(value, seen, options === null || options === void 0 ? void 0 : options.cache, depth, budget);
1037
+ const functionPathSet = Array.isArray(options === null || options === void 0 ? void 0 : options.functionPaths) && options.functionPaths.length ? new Set(options.functionPaths) : void 0;
1038
+ return toPlainInternal(value, seen, options === null || options === void 0 ? void 0 : options.cache, depth, budget, Boolean(options === null || options === void 0 ? void 0 : options.includeFunctions), functionPathSet, (_options$_path = options === null || options === void 0 ? void 0 : options._path) !== null && _options$_path !== void 0 ? _options$_path : "");
1036
1039
  }
1037
1040
  function isArrayEqual(a, b, compare) {
1038
1041
  if (a.length !== b.length) return false;
@@ -1322,7 +1325,7 @@ function applySnapshotUpdate(snapshot, path, value, op, options) {
1322
1325
  else current[leaf] = cloneValue ? cloneSnapshotValue(value) : value;
1323
1326
  }
1324
1327
  function collectSnapshot(options) {
1325
- const { state, computedRefs, includeComputed, shouldIncludeKey, plainCache, toPlainMaxDepth, toPlainMaxKeys } = options;
1328
+ const { state, computedRefs, includeComputed, shouldIncludeKey, plainCache, toPlainMaxDepth, toPlainMaxKeys, includeFunctions = false, functionPaths = [] } = options;
1326
1329
  const seen = /* @__PURE__ */ new WeakMap();
1327
1330
  const out = {};
1328
1331
  const budget = Number.isFinite(toPlainMaxKeys) ? { keys: toPlainMaxKeys } : void 0;
@@ -1334,7 +1337,10 @@ function collectSnapshot(options) {
1334
1337
  out[key] = toPlain(rawState[key], seen, {
1335
1338
  cache: plainCache,
1336
1339
  maxDepth: toPlainMaxDepth,
1337
- _budget: budget
1340
+ includeFunctions,
1341
+ functionPaths,
1342
+ _budget: budget,
1343
+ _path: key
1338
1344
  });
1339
1345
  }
1340
1346
  for (const key of computedKeys) {
@@ -1342,7 +1348,10 @@ function collectSnapshot(options) {
1342
1348
  out[key] = toPlain(computedRefs[key].value, seen, {
1343
1349
  cache: plainCache,
1344
1350
  maxDepth: toPlainMaxDepth,
1345
- _budget: budget
1351
+ includeFunctions,
1352
+ functionPaths,
1353
+ _budget: budget,
1354
+ _path: key
1346
1355
  });
1347
1356
  }
1348
1357
  return out;
@@ -1351,7 +1360,7 @@ function collectSnapshot(options) {
1351
1360
  //#endregion
1352
1361
  //#region src/runtime/app/setData/patchScheduler.ts
1353
1362
  function runPatchUpdate(options) {
1354
- const { state, computedRefs, dirtyComputedKeys, includeComputed, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, currentAdapter, shouldIncludeKey, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, plainCache, pendingPatches, fallbackTopKeys, latestSnapshot, latestComputedSnapshot, needsFullSnapshot, emitDebug, runDiffUpdate } = options;
1363
+ const { state, computedRefs, dirtyComputedKeys, includeComputed, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, currentAdapter, shouldIncludeKey, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, includeFunctions = false, functionPaths, plainCache, pendingPatches, fallbackTopKeys, latestSnapshot, latestComputedSnapshot, needsFullSnapshot, emitDebug, runDiffUpdate } = options;
1355
1364
  if (pendingPatches.size > maxPatchKeys) {
1356
1365
  needsFullSnapshot.value = true;
1357
1366
  const pendingCount = pendingPatches.size;
@@ -1399,7 +1408,10 @@ function runPatchUpdate(options) {
1399
1408
  const value = normalizeSetDataValue(toPlain(getStateValueByPath(path), seen, {
1400
1409
  cache: plainCache,
1401
1410
  maxDepth: toPlainMaxDepth,
1402
- maxKeys: toPlainMaxKeys
1411
+ maxKeys: toPlainMaxKeys,
1412
+ includeFunctions,
1413
+ functionPaths,
1414
+ _path: path
1403
1415
  }));
1404
1416
  plainByPath.set(path, value);
1405
1417
  return value;
@@ -1433,7 +1445,10 @@ function runPatchUpdate(options) {
1433
1445
  const nextValue = toPlain(computedRefs[key].value, seen, {
1434
1446
  cache: plainCache,
1435
1447
  maxDepth: toPlainMaxDepth,
1436
- maxKeys: toPlainMaxKeys
1448
+ maxKeys: toPlainMaxKeys,
1449
+ includeFunctions,
1450
+ functionPaths,
1451
+ _path: key
1437
1452
  });
1438
1453
  const prevValue = latestComputedSnapshot[key];
1439
1454
  if (computedCompare === "deep" ? isDeepEqualValue(prevValue, nextValue, computedCompareMaxDepth, { keys: computedCompareMaxKeys }) : computedCompare === "shallow" ? isShallowEqualValue(prevValue, nextValue) : Object.is(prevValue, nextValue)) continue;
@@ -1497,7 +1512,7 @@ function runPatchUpdate(options) {
1497
1512
  //#endregion
1498
1513
  //#region src/runtime/app/setData/scheduler.ts
1499
1514
  function createSetDataScheduler(options) {
1500
- const { state, computedRefs, dirtyComputedKeys, includeComputed, setDataStrategy, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, currentAdapter, shouldIncludeKey, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, debug, debugWhen, debugSampleRate, runTracker, isMounted } = options;
1515
+ const { state, 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;
1501
1516
  const plainCache = /* @__PURE__ */ new WeakMap();
1502
1517
  let latestSnapshot = {};
1503
1518
  let latestComputedSnapshot = Object.create(null);
@@ -1530,7 +1545,9 @@ function createSetDataScheduler(options) {
1530
1545
  if (candidate == null || typeof candidate !== "object") return candidate;
1531
1546
  if (!isReactive(candidate) && hasTrackableSetupBinding(candidate)) return { snapshot: toPlain(candidate, /* @__PURE__ */ new WeakMap(), {
1532
1547
  maxDepth: toPlainMaxDepth,
1533
- maxKeys: toPlainMaxKeys
1548
+ maxKeys: toPlainMaxKeys,
1549
+ includeFunctions,
1550
+ functionPaths
1534
1551
  }) };
1535
1552
  const raw = isReactive(candidate) ? toRaw(candidate) : candidate;
1536
1553
  return {
@@ -1573,7 +1590,9 @@ function createSetDataScheduler(options) {
1573
1590
  shouldIncludeKey,
1574
1591
  plainCache,
1575
1592
  toPlainMaxDepth,
1576
- toPlainMaxKeys
1593
+ toPlainMaxKeys,
1594
+ includeFunctions,
1595
+ functionPaths
1577
1596
  });
1578
1597
  const collectDiffSnapshot = () => {
1579
1598
  const rawState = isReactive(state) ? toRaw(state) : state;
@@ -1591,7 +1610,10 @@ function createSetDataScheduler(options) {
1591
1610
  if (!isSameToken(previousToken, token) || !hasOwn(latestSnapshot, key)) nextSnapshot[key] = toPlain(rawState[key], seen, {
1592
1611
  cache: plainCache,
1593
1612
  maxDepth: toPlainMaxDepth,
1594
- maxKeys: toPlainMaxKeys
1613
+ maxKeys: toPlainMaxKeys,
1614
+ includeFunctions,
1615
+ functionPaths,
1616
+ _path: key
1595
1617
  });
1596
1618
  latestStateTokens[key] = token;
1597
1619
  }
@@ -1614,7 +1636,10 @@ function createSetDataScheduler(options) {
1614
1636
  if (!isSameToken(latestComputedTokens[key], token) || !hasOwn(latestSnapshot, key)) nextSnapshot[key] = toPlain(value, seen, {
1615
1637
  cache: plainCache,
1616
1638
  maxDepth: toPlainMaxDepth,
1617
- maxKeys: toPlainMaxKeys
1639
+ maxKeys: toPlainMaxKeys,
1640
+ includeFunctions,
1641
+ functionPaths,
1642
+ _path: key
1618
1643
  });
1619
1644
  latestComputedTokens[key] = token;
1620
1645
  }
@@ -1708,6 +1733,8 @@ function createSetDataScheduler(options) {
1708
1733
  elevateTopKeyThreshold,
1709
1734
  toPlainMaxDepth,
1710
1735
  toPlainMaxKeys,
1736
+ includeFunctions,
1737
+ functionPaths,
1711
1738
  plainCache,
1712
1739
  pendingPatches,
1713
1740
  fallbackTopKeys,
@@ -1755,6 +1782,8 @@ function resolveSetDataOptions(setDataOptions) {
1755
1782
  const elevateTopKeyThreshold = typeof (setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.elevateTopKeyThreshold) === "number" ? Math.max(0, Math.floor(setDataOptions.elevateTopKeyThreshold)) : Number.POSITIVE_INFINITY;
1756
1783
  const toPlainMaxDepth = typeof (setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.toPlainMaxDepth) === "number" ? Math.max(0, Math.floor(setDataOptions.toPlainMaxDepth)) : Number.POSITIVE_INFINITY;
1757
1784
  const toPlainMaxKeys = typeof (setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.toPlainMaxKeys) === "number" ? Math.max(0, Math.floor(setDataOptions.toPlainMaxKeys)) : Number.POSITIVE_INFINITY;
1785
+ const includeFunctions = Boolean(setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.includeFunctions);
1786
+ const functionPaths = Array.isArray(setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.functionPaths) ? [...new Set(setDataOptions.functionPaths.filter((path) => typeof path === "string" && path.length > 0))] : [];
1758
1787
  const pickSet = Array.isArray(setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.pick) && setDataOptions.pick.length > 0 ? new Set(setDataOptions.pick) : void 0;
1759
1788
  const omitSet = Array.isArray(setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.omit) && setDataOptions.omit.length > 0 ? new Set(setDataOptions.omit) : void 0;
1760
1789
  const shouldIncludeKey = (key) => {
@@ -1784,6 +1813,8 @@ function resolveSetDataOptions(setDataOptions) {
1784
1813
  elevateTopKeyThreshold,
1785
1814
  toPlainMaxDepth,
1786
1815
  toPlainMaxKeys,
1816
+ includeFunctions,
1817
+ functionPaths,
1787
1818
  pickSet,
1788
1819
  omitSet,
1789
1820
  shouldIncludeKey
@@ -1833,7 +1864,7 @@ function createRuntimeMount(options) {
1833
1864
  const value = state[key];
1834
1865
  if (hasTrackableSetupBinding(value)) trackedSetupReactiveKeys.add(key);
1835
1866
  });
1836
- const { includeComputed, setDataStrategy, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, prelinkMaxDepth, prelinkMaxKeys, debug, diagnostics, debugWhen, debugSampleRate, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, shouldIncludeKey } = resolveSetDataOptions(setDataOptions);
1867
+ const { includeComputed, setDataStrategy, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, prelinkMaxDepth, prelinkMaxKeys, debug, diagnostics, debugWhen, debugSampleRate, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, includeFunctions, functionPaths, shouldIncludeKey } = resolveSetDataOptions(setDataOptions);
1837
1868
  const diagnosticsLogger = createDiagnosticsLogger(diagnostics);
1838
1869
  const mergedDebug = debug || diagnosticsLogger ? (info) => {
1839
1870
  if (typeof debug === "function") debug(info);
@@ -1871,6 +1902,8 @@ function createRuntimeMount(options) {
1871
1902
  elevateTopKeyThreshold,
1872
1903
  toPlainMaxDepth,
1873
1904
  toPlainMaxKeys,
1905
+ includeFunctions,
1906
+ functionPaths,
1874
1907
  debug: mergedDebug,
1875
1908
  debugWhen: mergedDebugWhen,
1876
1909
  debugSampleRate,
@@ -4886,11 +4919,13 @@ const NATIVE_PROPERTY_TYPE_MAP = new Map([
4886
4919
  [Boolean, Boolean],
4887
4920
  [Object, Object],
4888
4921
  [Array, Array],
4922
+ [Function, Function],
4889
4923
  ["String", String],
4890
4924
  ["Number", Number],
4891
4925
  ["Boolean", Boolean],
4892
4926
  ["Object", Object],
4893
4927
  ["Array", Array],
4928
+ ["Function", Function],
4894
4929
  [null, null],
4895
4930
  ["null", null],
4896
4931
  ["Null", null]
@@ -5300,8 +5335,10 @@ function shouldExposeInSnapshot(value) {
5300
5335
  if (Array.isArray(value)) return true;
5301
5336
  return isPlainObject(value);
5302
5337
  }
5303
- function applySetupResult(runtime, target, result) {
5338
+ function applySetupResult(runtime, target, result, options) {
5304
5339
  var _runtime$methods, _runtime$state;
5340
+ const includeFunctionsInState = Boolean(options === null || options === void 0 ? void 0 : options.includeFunctionsInState);
5341
+ const functionPropPaths = options === null || options === void 0 ? void 0 : options.functionPropPaths;
5305
5342
  const declaredPropKeys = new Set(Array.isArray(target === null || target === void 0 ? void 0 : target[WEVU_PROP_KEYS_KEY]) ? target[WEVU_PROP_KEYS_KEY] : []);
5306
5343
  const methods = (_runtime$methods = runtime === null || runtime === void 0 ? void 0 : runtime.methods) !== null && _runtime$methods !== void 0 ? _runtime$methods : Object.create(null);
5307
5344
  const state = (_runtime$state = runtime === null || runtime === void 0 ? void 0 : runtime.state) !== null && _runtime$state !== void 0 ? _runtime$state : Object.create(null);
@@ -5316,10 +5353,12 @@ function applySetupResult(runtime, target, result) {
5316
5353
  Object.keys(result).forEach((key) => {
5317
5354
  const val = result[key];
5318
5355
  if (typeof val === "function") {
5319
- methods[key] = (...args) => {
5356
+ const bound = (...args) => {
5320
5357
  var _runtime$proxy;
5321
5358
  return val.apply((_runtime$proxy = runtime === null || runtime === void 0 ? void 0 : runtime.proxy) !== null && _runtime$proxy !== void 0 ? _runtime$proxy : runtime, args);
5322
5359
  };
5360
+ methods[key] = bound;
5361
+ if (includeFunctionsInState || (functionPropPaths === null || functionPropPaths === void 0 ? void 0 : functionPropPaths.has(key))) state[key] = bound;
5323
5362
  methodsChanged = true;
5324
5363
  } else {
5325
5364
  if (hasTrackableSetupBinding(val)) {
@@ -5386,17 +5425,32 @@ function ensureScopedSlotComponentGlobal() {
5386
5425
  }
5387
5426
  function defineComponent(options) {
5388
5427
  ensureScopedSlotComponentGlobal();
5389
- const { __typeProps: _typeProps, data, computed, methods, setData, watch, setup, props, ...mpOptions } = applyWevuComponentDefaults(options);
5428
+ const { __typeProps: _typeProps, data, computed, methods, setData, watch, setup, props, allowFunctionProps, ...mpOptions } = applyWevuComponentDefaults(options);
5429
+ const rawFunctionPropPaths = mpOptions[WEVU_FUNCTION_PROP_PATHS_KEY];
5430
+ const functionPropPaths = Array.isArray(rawFunctionPropPaths) ? [...new Set(rawFunctionPropPaths.filter((path) => typeof path === "string" && path.length > 0))] : [];
5431
+ delete mpOptions[WEVU_FUNCTION_PROP_PATHS_KEY];
5432
+ const resolvedSetData = allowFunctionProps === true ? {
5433
+ ...setData !== null && setData !== void 0 ? setData : {},
5434
+ includeFunctions: true,
5435
+ functionPaths: functionPropPaths
5436
+ } : allowFunctionProps === false ? setData : functionPropPaths.length ? {
5437
+ ...setData !== null && setData !== void 0 ? setData : {},
5438
+ functionPaths: functionPropPaths
5439
+ } : setData;
5440
+ const setupFunctionPropKeys = new Set(functionPropPaths.filter((path) => !path.includes(".")));
5390
5441
  const runtimeApp = createApp({
5391
5442
  data,
5392
5443
  computed,
5393
5444
  methods,
5394
- setData,
5445
+ setData: resolvedSetData,
5395
5446
  [INTERNAL_DEFAULTS_SCOPE_KEY]: "component"
5396
5447
  });
5397
5448
  const setupWrapper = typeof setup === "function" ? ((props, ctx) => {
5398
5449
  const result = runSetupFunction(setup, props, ctx);
5399
- if (result && ctx) applySetupResult(ctx.runtime, ctx.instance, result);
5450
+ if (result && ctx) applySetupResult(ctx.runtime, ctx.instance, result, {
5451
+ includeFunctionsInState: allowFunctionProps === true,
5452
+ functionPropPaths: allowFunctionProps === false ? void 0 : setupFunctionPropKeys
5453
+ });
5400
5454
  return result;
5401
5455
  }) : void 0;
5402
5456
  const nativeData = typeof data === "function" ? data() : data;
@@ -5408,7 +5462,7 @@ function defineComponent(options) {
5408
5462
  data,
5409
5463
  computed,
5410
5464
  methods,
5411
- setData,
5465
+ setData: resolvedSetData,
5412
5466
  watch,
5413
5467
  setup: setupWrapper,
5414
5468
  mpOptions: mpOptionsWithProps
@@ -6178,4 +6232,4 @@ function useTemplateRef(name) {
6178
6232
 
6179
6233
  //#endregion
6180
6234
  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 };
6181
- //# sourceMappingURL=src-w-aXGv3j.mjs.map
6235
+ //# sourceMappingURL=src-CZ1f7pP9.mjs.map