@vue/runtime-dom 3.5.1 → 3.5.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.1
2
+ * @vue/runtime-dom v3.5.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -624,9 +624,6 @@ var VueRuntimeDOM = (function (exports) {
624
624
  return false;
625
625
  }
626
626
  function refreshComputed(computed) {
627
- if (computed.flags & 2) {
628
- return false;
629
- }
630
627
  if (computed.flags & 4 && !(computed.flags & 16)) {
631
628
  return;
632
629
  }
@@ -647,7 +644,7 @@ var VueRuntimeDOM = (function (exports) {
647
644
  shouldTrack = true;
648
645
  try {
649
646
  prepareDeps(computed);
650
- const value = computed.fn();
647
+ const value = computed.fn(computed._value);
651
648
  if (dep.version === 0 || hasChanged(value, computed._value)) {
652
649
  computed._value = value;
653
650
  dep.version++;
@@ -756,7 +753,7 @@ var VueRuntimeDOM = (function (exports) {
756
753
  }
757
754
  }
758
755
  track(debugInfo) {
759
- if (!activeSub || !shouldTrack) {
756
+ if (!activeSub || !shouldTrack || activeSub === this.computed) {
760
757
  return;
761
758
  }
762
759
  let link = this.activeLink;
@@ -1769,7 +1766,7 @@ var VueRuntimeDOM = (function (exports) {
1769
1766
  return isFunction(source) ? source() : unref(source);
1770
1767
  }
1771
1768
  const shallowUnwrapHandlers = {
1772
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
1769
+ get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
1773
1770
  set: (target, key, value, receiver) => {
1774
1771
  const oldValue = target[key];
1775
1772
  if (isRef(oldValue) && !isRef(value)) {
@@ -1901,8 +1898,8 @@ var VueRuntimeDOM = (function (exports) {
1901
1898
  * @internal
1902
1899
  */
1903
1900
  notify() {
1901
+ this.flags |= 16;
1904
1902
  if (activeSub !== this) {
1905
- this.flags |= 16;
1906
1903
  this.dep.notify();
1907
1904
  }
1908
1905
  }
@@ -2471,9 +2468,7 @@ var VueRuntimeDOM = (function (exports) {
2471
2468
  } else {
2472
2469
  queue.splice(findInsertionIndex(jobId), 0, job);
2473
2470
  }
2474
- if (!(job.flags & 4)) {
2475
- job.flags |= 1;
2476
- }
2471
+ job.flags |= 1;
2477
2472
  queueFlush();
2478
2473
  }
2479
2474
  }
@@ -2489,9 +2484,7 @@ var VueRuntimeDOM = (function (exports) {
2489
2484
  activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
2490
2485
  } else if (!(cb.flags & 1)) {
2491
2486
  pendingPostFlushCbs.push(cb);
2492
- if (!(cb.flags & 4)) {
2493
- cb.flags |= 1;
2494
- }
2487
+ cb.flags |= 1;
2495
2488
  }
2496
2489
  } else {
2497
2490
  pendingPostFlushCbs.push(...cb);
@@ -2513,6 +2506,9 @@ var VueRuntimeDOM = (function (exports) {
2513
2506
  }
2514
2507
  queue.splice(i, 1);
2515
2508
  i--;
2509
+ if (cb.flags & 4) {
2510
+ cb.flags &= ~1;
2511
+ }
2516
2512
  cb();
2517
2513
  cb.flags &= ~1;
2518
2514
  }
@@ -2537,6 +2533,9 @@ var VueRuntimeDOM = (function (exports) {
2537
2533
  if (checkRecursiveUpdates(seen, cb)) {
2538
2534
  continue;
2539
2535
  }
2536
+ if (cb.flags & 4) {
2537
+ cb.flags &= ~1;
2538
+ }
2540
2539
  if (!(cb.flags & 8)) cb();
2541
2540
  cb.flags &= ~1;
2542
2541
  }
@@ -2559,6 +2558,9 @@ var VueRuntimeDOM = (function (exports) {
2559
2558
  if (check(job)) {
2560
2559
  continue;
2561
2560
  }
2561
+ if (job.flags & 4) {
2562
+ job.flags &= ~1;
2563
+ }
2562
2564
  callWithErrorHandling(
2563
2565
  job,
2564
2566
  job.i,
@@ -2568,6 +2570,12 @@ var VueRuntimeDOM = (function (exports) {
2568
2570
  }
2569
2571
  }
2570
2572
  } finally {
2573
+ for (; flushIndex < queue.length; flushIndex++) {
2574
+ const job = queue[flushIndex];
2575
+ if (job) {
2576
+ job.flags &= ~1;
2577
+ }
2578
+ }
2571
2579
  flushIndex = 0;
2572
2580
  queue.length = 0;
2573
2581
  flushPostFlushCbs(seen);
@@ -3324,6 +3332,7 @@ var VueRuntimeDOM = (function (exports) {
3324
3332
  if (!(instance.job.flags & 8)) {
3325
3333
  instance.update();
3326
3334
  }
3335
+ delete leavingHooks.afterLeave;
3327
3336
  };
3328
3337
  return emptyPlaceholder(child);
3329
3338
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3601,6 +3610,34 @@ var VueRuntimeDOM = (function (exports) {
3601
3610
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
3602
3611
  }
3603
3612
 
3613
+ const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
3614
+ function useTemplateRef(key) {
3615
+ const i = getCurrentInstance();
3616
+ const r = shallowRef(null);
3617
+ if (i) {
3618
+ const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
3619
+ let desc;
3620
+ if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
3621
+ warn$1(`useTemplateRef('${key}') already exists.`);
3622
+ } else {
3623
+ Object.defineProperty(refs, key, {
3624
+ enumerable: true,
3625
+ get: () => r.value,
3626
+ set: (val) => r.value = val
3627
+ });
3628
+ }
3629
+ } else {
3630
+ warn$1(
3631
+ `useTemplateRef() is called when there is no active component instance to be associated with.`
3632
+ );
3633
+ }
3634
+ const ret = readonly(r) ;
3635
+ {
3636
+ knownTemplateRefs.add(ret);
3637
+ }
3638
+ return ret;
3639
+ }
3640
+
3604
3641
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3605
3642
  if (isArray(rawRef)) {
3606
3643
  rawRef.forEach(
@@ -3629,7 +3666,13 @@ var VueRuntimeDOM = (function (exports) {
3629
3666
  const oldRef = oldRawRef && oldRawRef.r;
3630
3667
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3631
3668
  const setupState = owner.setupState;
3632
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => hasOwn(setupState, key) && !(Object.getOwnPropertyDescriptor(refs, key) || EMPTY_OBJ).get;
3669
+ const rawSetupState = toRaw(setupState);
3670
+ const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3671
+ if (knownTemplateRefs.has(rawSetupState[key])) {
3672
+ return false;
3673
+ }
3674
+ return hasOwn(rawSetupState, key);
3675
+ };
3633
3676
  if (oldRef != null && oldRef !== ref) {
3634
3677
  if (isString(oldRef)) {
3635
3678
  refs[oldRef] = null;
@@ -4680,7 +4723,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4680
4723
  return () => {
4681
4724
  pendingCacheKey = null;
4682
4725
  if (!slots.default) {
4683
- return null;
4726
+ return current = null;
4684
4727
  }
4685
4728
  const children = slots.default();
4686
4729
  const rawVNode = children[0];
@@ -8412,7 +8455,8 @@ If you want to remount the same app, move your app creation logic into a factory
8412
8455
  data,
8413
8456
  setupState,
8414
8457
  ctx,
8415
- inheritAttrs
8458
+ inheritAttrs,
8459
+ isMounted
8416
8460
  } = instance;
8417
8461
  const prev = setCurrentRenderingInstance(instance);
8418
8462
  let result;
@@ -8532,7 +8576,7 @@ If you want to remount the same app, move your app creation logic into a factory
8532
8576
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8533
8577
  );
8534
8578
  }
8535
- root.transition = vnode.transition;
8579
+ root.transition = isMounted ? vnode.component.subTree.transition : vnode.transition;
8536
8580
  }
8537
8581
  if (setRoot) {
8538
8582
  setRoot(root);
@@ -9026,7 +9070,7 @@ If you want to remount the same app, move your app creation logic into a factory
9026
9070
  };
9027
9071
  }
9028
9072
  if (activeBranch) {
9029
- if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
9073
+ if (parentNode(activeBranch.el) === container2) {
9030
9074
  anchor = next(activeBranch);
9031
9075
  }
9032
9076
  unmount(activeBranch, parentComponent2, suspense, true);
@@ -10073,29 +10117,6 @@ Component that was made reactive: `,
10073
10117
  return c;
10074
10118
  };
10075
10119
 
10076
- function useTemplateRef(key) {
10077
- const i = getCurrentInstance();
10078
- const r = shallowRef(null);
10079
- if (i) {
10080
- const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
10081
- let desc;
10082
- if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
10083
- warn$1(`useTemplateRef('${key}') already exists.`);
10084
- } else {
10085
- Object.defineProperty(refs, key, {
10086
- enumerable: true,
10087
- get: () => r.value,
10088
- set: (val) => r.value = val
10089
- });
10090
- }
10091
- } else {
10092
- warn$1(
10093
- `useTemplateRef() is called when there is no active component instance to be associated with.`
10094
- );
10095
- }
10096
- return readonly(r) ;
10097
- }
10098
-
10099
10120
  function h(type, propsOrChildren, children) {
10100
10121
  const l = arguments.length;
10101
10122
  if (l === 2) {
@@ -10321,7 +10342,7 @@ Component that was made reactive: `,
10321
10342
  return true;
10322
10343
  }
10323
10344
 
10324
- const version = "3.5.1";
10345
+ const version = "3.5.2";
10325
10346
  const warn = warn$1 ;
10326
10347
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10327
10348
  const devtools = devtools$1 ;