vue 3.4.0 → 3.4.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.
@@ -3296,6 +3296,13 @@ If this is a native custom element, make sure to exclude it from component resol
3296
3296
  return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3297
3297
  }
3298
3298
 
3299
+ const ssrContextKey = Symbol.for("v-scx");
3300
+ const useSSRContext = () => {
3301
+ {
3302
+ warn$1(`useSSRContext() is not supported in the global build.`);
3303
+ }
3304
+ };
3305
+
3299
3306
  function watchEffect(effect, options) {
3300
3307
  return doWatch(effect, null, options);
3301
3308
  }
@@ -3370,8 +3377,8 @@ If this is a native custom element, make sure to exclude it from component resol
3370
3377
  getter = () => source.value;
3371
3378
  forceTrigger = isShallow(source);
3372
3379
  } else if (isReactive(source)) {
3373
- getter = () => source;
3374
- deep = true;
3380
+ getter = isShallow(source) || deep === false ? () => traverse(source, 1) : () => traverse(source);
3381
+ forceTrigger = true;
3375
3382
  } else if (isArray(source)) {
3376
3383
  isMultiSource = true;
3377
3384
  forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
@@ -3379,7 +3386,7 @@ If this is a native custom element, make sure to exclude it from component resol
3379
3386
  if (isRef(s)) {
3380
3387
  return s.value;
3381
3388
  } else if (isReactive(s)) {
3382
- return traverse(s);
3389
+ return traverse(s, isShallow(s) || deep === false ? 1 : void 0);
3383
3390
  } else if (isFunction(s)) {
3384
3391
  return callWithErrorHandling(s, instance, 2);
3385
3392
  } else {
@@ -3512,28 +3519,34 @@ If this is a native custom element, make sure to exclude it from component resol
3512
3519
  return cur;
3513
3520
  };
3514
3521
  }
3515
- function traverse(value, seen) {
3522
+ function traverse(value, depth, currentDepth = 0, seen) {
3516
3523
  if (!isObject(value) || value["__v_skip"]) {
3517
3524
  return value;
3518
3525
  }
3526
+ if (depth && depth > 0) {
3527
+ if (currentDepth >= depth) {
3528
+ return value;
3529
+ }
3530
+ currentDepth++;
3531
+ }
3519
3532
  seen = seen || /* @__PURE__ */ new Set();
3520
3533
  if (seen.has(value)) {
3521
3534
  return value;
3522
3535
  }
3523
3536
  seen.add(value);
3524
3537
  if (isRef(value)) {
3525
- traverse(value.value, seen);
3538
+ traverse(value.value, depth, currentDepth, seen);
3526
3539
  } else if (isArray(value)) {
3527
3540
  for (let i = 0; i < value.length; i++) {
3528
- traverse(value[i], seen);
3541
+ traverse(value[i], depth, currentDepth, seen);
3529
3542
  }
3530
3543
  } else if (isSet(value) || isMap(value)) {
3531
3544
  value.forEach((v) => {
3532
- traverse(v, seen);
3545
+ traverse(v, depth, currentDepth, seen);
3533
3546
  });
3534
3547
  } else if (isPlainObject(value)) {
3535
3548
  for (const key in value) {
3536
- traverse(value[key], seen);
3549
+ traverse(value[key], depth, currentDepth, seen);
3537
3550
  }
3538
3551
  }
3539
3552
  return value;
@@ -4795,6 +4808,7 @@ If this is a native custom element, make sure to exclude it from component resol
4795
4808
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
4796
4809
  return ref();
4797
4810
  }
4811
+ const camelizedName = camelize(name);
4798
4812
  const res = customRef((track, trigger) => {
4799
4813
  let localValue;
4800
4814
  watchSyncEffect(() => {
@@ -4811,7 +4825,8 @@ If this is a native custom element, make sure to exclude it from component resol
4811
4825
  },
4812
4826
  set(value) {
4813
4827
  const rawProps = i.vnode.props;
4814
- if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
4828
+ if (!(rawProps && // check if parent has passed v-model
4829
+ (name in rawProps || camelizedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps)) && hasChanged(value, localValue)) {
4815
4830
  localValue = value;
4816
4831
  trigger();
4817
4832
  }
@@ -4825,7 +4840,7 @@ If this is a native custom element, make sure to exclude it from component resol
4825
4840
  return {
4826
4841
  next() {
4827
4842
  if (i2 < 2) {
4828
- return { value: i2++ ? props[modifierKey] : res, done: false };
4843
+ return { value: i2++ ? props[modifierKey] || {} : res, done: false };
4829
4844
  } else {
4830
4845
  return { done: true };
4831
4846
  }
@@ -9264,13 +9279,6 @@ Component that was made reactive: `,
9264
9279
  }
9265
9280
  }
9266
9281
 
9267
- const ssrContextKey = Symbol.for("v-scx");
9268
- const useSSRContext = () => {
9269
- {
9270
- warn$1(`useSSRContext() is not supported in the global build.`);
9271
- }
9272
- };
9273
-
9274
9282
  function initCustomFormatter() {
9275
9283
  if (typeof window === "undefined") {
9276
9284
  return;
@@ -9472,7 +9480,7 @@ Component that was made reactive: `,
9472
9480
  return true;
9473
9481
  }
9474
9482
 
9475
- const version = "3.4.0";
9483
+ const version = "3.4.2";
9476
9484
  const warn = warn$1 ;
9477
9485
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9478
9486
  const devtools = devtools$1 ;