@vue/runtime-dom 3.5.1 → 3.5.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.1
2
+ * @vue/runtime-dom v3.5.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -647,7 +647,7 @@ var VueRuntimeDOM = (function (exports) {
647
647
  shouldTrack = true;
648
648
  try {
649
649
  prepareDeps(computed);
650
- const value = computed.fn();
650
+ const value = computed.fn(computed._value);
651
651
  if (dep.version === 0 || hasChanged(value, computed._value)) {
652
652
  computed._value = value;
653
653
  dep.version++;
@@ -756,7 +756,7 @@ var VueRuntimeDOM = (function (exports) {
756
756
  }
757
757
  }
758
758
  track(debugInfo) {
759
- if (!activeSub || !shouldTrack) {
759
+ if (!activeSub || !shouldTrack || activeSub === this.computed) {
760
760
  return;
761
761
  }
762
762
  let link = this.activeLink;
@@ -1769,7 +1769,7 @@ var VueRuntimeDOM = (function (exports) {
1769
1769
  return isFunction(source) ? source() : unref(source);
1770
1770
  }
1771
1771
  const shallowUnwrapHandlers = {
1772
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
1772
+ get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
1773
1773
  set: (target, key, value, receiver) => {
1774
1774
  const oldValue = target[key];
1775
1775
  if (isRef(oldValue) && !isRef(value)) {
@@ -2471,9 +2471,7 @@ var VueRuntimeDOM = (function (exports) {
2471
2471
  } else {
2472
2472
  queue.splice(findInsertionIndex(jobId), 0, job);
2473
2473
  }
2474
- if (!(job.flags & 4)) {
2475
- job.flags |= 1;
2476
- }
2474
+ job.flags |= 1;
2477
2475
  queueFlush();
2478
2476
  }
2479
2477
  }
@@ -2489,9 +2487,7 @@ var VueRuntimeDOM = (function (exports) {
2489
2487
  activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
2490
2488
  } else if (!(cb.flags & 1)) {
2491
2489
  pendingPostFlushCbs.push(cb);
2492
- if (!(cb.flags & 4)) {
2493
- cb.flags |= 1;
2494
- }
2490
+ cb.flags |= 1;
2495
2491
  }
2496
2492
  } else {
2497
2493
  pendingPostFlushCbs.push(...cb);
@@ -2513,6 +2509,9 @@ var VueRuntimeDOM = (function (exports) {
2513
2509
  }
2514
2510
  queue.splice(i, 1);
2515
2511
  i--;
2512
+ if (cb.flags & 4) {
2513
+ cb.flags &= ~1;
2514
+ }
2516
2515
  cb();
2517
2516
  cb.flags &= ~1;
2518
2517
  }
@@ -2537,6 +2536,9 @@ var VueRuntimeDOM = (function (exports) {
2537
2536
  if (checkRecursiveUpdates(seen, cb)) {
2538
2537
  continue;
2539
2538
  }
2539
+ if (cb.flags & 4) {
2540
+ cb.flags &= ~1;
2541
+ }
2540
2542
  if (!(cb.flags & 8)) cb();
2541
2543
  cb.flags &= ~1;
2542
2544
  }
@@ -2559,6 +2561,9 @@ var VueRuntimeDOM = (function (exports) {
2559
2561
  if (check(job)) {
2560
2562
  continue;
2561
2563
  }
2564
+ if (job.flags & 4) {
2565
+ job.flags &= ~1;
2566
+ }
2562
2567
  callWithErrorHandling(
2563
2568
  job,
2564
2569
  job.i,
@@ -2568,6 +2573,12 @@ var VueRuntimeDOM = (function (exports) {
2568
2573
  }
2569
2574
  }
2570
2575
  } finally {
2576
+ for (; flushIndex < queue.length; flushIndex++) {
2577
+ const job = queue[flushIndex];
2578
+ if (job) {
2579
+ job.flags &= ~1;
2580
+ }
2581
+ }
2571
2582
  flushIndex = 0;
2572
2583
  queue.length = 0;
2573
2584
  flushPostFlushCbs(seen);
@@ -3324,6 +3335,7 @@ var VueRuntimeDOM = (function (exports) {
3324
3335
  if (!(instance.job.flags & 8)) {
3325
3336
  instance.update();
3326
3337
  }
3338
+ delete leavingHooks.afterLeave;
3327
3339
  };
3328
3340
  return emptyPlaceholder(child);
3329
3341
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3546,6 +3558,7 @@ var VueRuntimeDOM = (function (exports) {
3546
3558
  }
3547
3559
  function setTransitionHooks(vnode, hooks) {
3548
3560
  if (vnode.shapeFlag & 6 && vnode.component) {
3561
+ vnode.transition = hooks;
3549
3562
  setTransitionHooks(vnode.component.subTree, hooks);
3550
3563
  } else if (vnode.shapeFlag & 128) {
3551
3564
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
@@ -3590,7 +3603,7 @@ var VueRuntimeDOM = (function (exports) {
3590
3603
  function useId() {
3591
3604
  const i = getCurrentInstance();
3592
3605
  if (i) {
3593
- return (i.appContext.config.idPrefix || "v") + ":" + i.ids[0] + i.ids[1]++;
3606
+ return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
3594
3607
  } else {
3595
3608
  warn$1(
3596
3609
  `useId() is called when there is no active component instance to be associated with.`
@@ -3601,6 +3614,34 @@ var VueRuntimeDOM = (function (exports) {
3601
3614
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
3602
3615
  }
3603
3616
 
3617
+ const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
3618
+ function useTemplateRef(key) {
3619
+ const i = getCurrentInstance();
3620
+ const r = shallowRef(null);
3621
+ if (i) {
3622
+ const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
3623
+ let desc;
3624
+ if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
3625
+ warn$1(`useTemplateRef('${key}') already exists.`);
3626
+ } else {
3627
+ Object.defineProperty(refs, key, {
3628
+ enumerable: true,
3629
+ get: () => r.value,
3630
+ set: (val) => r.value = val
3631
+ });
3632
+ }
3633
+ } else {
3634
+ warn$1(
3635
+ `useTemplateRef() is called when there is no active component instance to be associated with.`
3636
+ );
3637
+ }
3638
+ const ret = readonly(r) ;
3639
+ {
3640
+ knownTemplateRefs.add(ret);
3641
+ }
3642
+ return ret;
3643
+ }
3644
+
3604
3645
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3605
3646
  if (isArray(rawRef)) {
3606
3647
  rawRef.forEach(
@@ -3629,7 +3670,13 @@ var VueRuntimeDOM = (function (exports) {
3629
3670
  const oldRef = oldRawRef && oldRawRef.r;
3630
3671
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3631
3672
  const setupState = owner.setupState;
3632
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => hasOwn(setupState, key) && !(Object.getOwnPropertyDescriptor(refs, key) || EMPTY_OBJ).get;
3673
+ const rawSetupState = toRaw(setupState);
3674
+ const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3675
+ if (knownTemplateRefs.has(rawSetupState[key])) {
3676
+ return false;
3677
+ }
3678
+ return hasOwn(rawSetupState, key);
3679
+ };
3633
3680
  if (oldRef != null && oldRef !== ref) {
3634
3681
  if (isString(oldRef)) {
3635
3682
  refs[oldRef] = null;
@@ -4680,7 +4727,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4680
4727
  return () => {
4681
4728
  pendingCacheKey = null;
4682
4729
  if (!slots.default) {
4683
- return null;
4730
+ return current = null;
4684
4731
  }
4685
4732
  const children = slots.default();
4686
4733
  const rawVNode = children[0];
@@ -7263,7 +7310,7 @@ If you want to remount the same app, move your app creation logic into a factory
7263
7310
  endMeasure(instance, `hydrate`);
7264
7311
  }
7265
7312
  };
7266
- if (isAsyncWrapperVNode) {
7313
+ if (isAsyncWrapperVNode && type.__asyncHydrate) {
7267
7314
  type.__asyncHydrate(
7268
7315
  el,
7269
7316
  instance,
@@ -8532,7 +8579,7 @@ If you want to remount the same app, move your app creation logic into a factory
8532
8579
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8533
8580
  );
8534
8581
  }
8535
- root.transition = vnode.transition;
8582
+ setTransitionHooks(root, vnode.transition);
8536
8583
  }
8537
8584
  if (setRoot) {
8538
8585
  setRoot(root);
@@ -9026,7 +9073,7 @@ If you want to remount the same app, move your app creation logic into a factory
9026
9073
  };
9027
9074
  }
9028
9075
  if (activeBranch) {
9029
- if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
9076
+ if (parentNode(activeBranch.el) === container2) {
9030
9077
  anchor = next(activeBranch);
9031
9078
  }
9032
9079
  unmount(activeBranch, parentComponent2, suspense, true);
@@ -10073,29 +10120,6 @@ Component that was made reactive: `,
10073
10120
  return c;
10074
10121
  };
10075
10122
 
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
10123
  function h(type, propsOrChildren, children) {
10100
10124
  const l = arguments.length;
10101
10125
  if (l === 2) {
@@ -10321,7 +10345,7 @@ Component that was made reactive: `,
10321
10345
  return true;
10322
10346
  }
10323
10347
 
10324
- const version = "3.5.1";
10348
+ const version = "3.5.3";
10325
10349
  const warn = warn$1 ;
10326
10350
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10327
10351
  const devtools = devtools$1 ;