@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
  **/
@@ -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
  **/
@@ -494,6 +494,7 @@ export interface DataHTMLAttributes extends HTMLAttributes {
494
494
  value?: string | ReadonlyArray<string> | number;
495
495
  }
496
496
  export interface DetailsHTMLAttributes extends HTMLAttributes {
497
+ name?: string;
497
498
  open?: Booleanish;
498
499
  onToggle?: (payload: ToggleEvent) => void;
499
500
  }
@@ -503,6 +504,7 @@ export interface DelHTMLAttributes extends HTMLAttributes {
503
504
  }
504
505
  export interface DialogHTMLAttributes extends HTMLAttributes {
505
506
  open?: Booleanish;
507
+ onClose?: (payload: Event) => void;
506
508
  }
507
509
  export interface EmbedHTMLAttributes extends HTMLAttributes {
508
510
  height?: Numberish;
@@ -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
  **/
@@ -621,9 +621,6 @@ function isDirty(sub) {
621
621
  return false;
622
622
  }
623
623
  function refreshComputed(computed) {
624
- if (computed.flags & 2) {
625
- return false;
626
- }
627
624
  if (computed.flags & 4 && !(computed.flags & 16)) {
628
625
  return;
629
626
  }
@@ -644,7 +641,7 @@ function refreshComputed(computed) {
644
641
  shouldTrack = true;
645
642
  try {
646
643
  prepareDeps(computed);
647
- const value = computed.fn();
644
+ const value = computed.fn(computed._value);
648
645
  if (dep.version === 0 || hasChanged(value, computed._value)) {
649
646
  computed._value = value;
650
647
  dep.version++;
@@ -753,7 +750,7 @@ class Dep {
753
750
  }
754
751
  }
755
752
  track(debugInfo) {
756
- if (!activeSub || !shouldTrack) {
753
+ if (!activeSub || !shouldTrack || activeSub === this.computed) {
757
754
  return;
758
755
  }
759
756
  let link = this.activeLink;
@@ -1766,7 +1763,7 @@ function toValue(source) {
1766
1763
  return isFunction(source) ? source() : unref(source);
1767
1764
  }
1768
1765
  const shallowUnwrapHandlers = {
1769
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
1766
+ get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
1770
1767
  set: (target, key, value, receiver) => {
1771
1768
  const oldValue = target[key];
1772
1769
  if (isRef(oldValue) && !isRef(value)) {
@@ -1898,8 +1895,8 @@ class ComputedRefImpl {
1898
1895
  * @internal
1899
1896
  */
1900
1897
  notify() {
1898
+ this.flags |= 16;
1901
1899
  if (activeSub !== this) {
1902
- this.flags |= 16;
1903
1900
  this.dep.notify();
1904
1901
  }
1905
1902
  }
@@ -2468,9 +2465,7 @@ function queueJob(job) {
2468
2465
  } else {
2469
2466
  queue.splice(findInsertionIndex(jobId), 0, job);
2470
2467
  }
2471
- if (!(job.flags & 4)) {
2472
- job.flags |= 1;
2473
- }
2468
+ job.flags |= 1;
2474
2469
  queueFlush();
2475
2470
  }
2476
2471
  }
@@ -2486,9 +2481,7 @@ function queuePostFlushCb(cb) {
2486
2481
  activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
2487
2482
  } else if (!(cb.flags & 1)) {
2488
2483
  pendingPostFlushCbs.push(cb);
2489
- if (!(cb.flags & 4)) {
2490
- cb.flags |= 1;
2491
- }
2484
+ cb.flags |= 1;
2492
2485
  }
2493
2486
  } else {
2494
2487
  pendingPostFlushCbs.push(...cb);
@@ -2510,6 +2503,9 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
2510
2503
  }
2511
2504
  queue.splice(i, 1);
2512
2505
  i--;
2506
+ if (cb.flags & 4) {
2507
+ cb.flags &= ~1;
2508
+ }
2513
2509
  cb();
2514
2510
  cb.flags &= ~1;
2515
2511
  }
@@ -2534,6 +2530,9 @@ function flushPostFlushCbs(seen) {
2534
2530
  if (checkRecursiveUpdates(seen, cb)) {
2535
2531
  continue;
2536
2532
  }
2533
+ if (cb.flags & 4) {
2534
+ cb.flags &= ~1;
2535
+ }
2537
2536
  if (!(cb.flags & 8)) cb();
2538
2537
  cb.flags &= ~1;
2539
2538
  }
@@ -2556,6 +2555,9 @@ function flushJobs(seen) {
2556
2555
  if (check(job)) {
2557
2556
  continue;
2558
2557
  }
2558
+ if (job.flags & 4) {
2559
+ job.flags &= ~1;
2560
+ }
2559
2561
  callWithErrorHandling(
2560
2562
  job,
2561
2563
  job.i,
@@ -2565,6 +2567,12 @@ function flushJobs(seen) {
2565
2567
  }
2566
2568
  }
2567
2569
  } finally {
2570
+ for (; flushIndex < queue.length; flushIndex++) {
2571
+ const job = queue[flushIndex];
2572
+ if (job) {
2573
+ job.flags &= ~1;
2574
+ }
2575
+ }
2568
2576
  flushIndex = 0;
2569
2577
  queue.length = 0;
2570
2578
  flushPostFlushCbs(seen);
@@ -3321,6 +3329,7 @@ const BaseTransitionImpl = {
3321
3329
  if (!(instance.job.flags & 8)) {
3322
3330
  instance.update();
3323
3331
  }
3332
+ delete leavingHooks.afterLeave;
3324
3333
  };
3325
3334
  return emptyPlaceholder(child);
3326
3335
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3598,6 +3607,34 @@ function markAsyncBoundary(instance) {
3598
3607
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
3599
3608
  }
3600
3609
 
3610
+ const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
3611
+ function useTemplateRef(key) {
3612
+ const i = getCurrentInstance();
3613
+ const r = shallowRef(null);
3614
+ if (i) {
3615
+ const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
3616
+ let desc;
3617
+ if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
3618
+ warn$1(`useTemplateRef('${key}') already exists.`);
3619
+ } else {
3620
+ Object.defineProperty(refs, key, {
3621
+ enumerable: true,
3622
+ get: () => r.value,
3623
+ set: (val) => r.value = val
3624
+ });
3625
+ }
3626
+ } else {
3627
+ warn$1(
3628
+ `useTemplateRef() is called when there is no active component instance to be associated with.`
3629
+ );
3630
+ }
3631
+ const ret = readonly(r) ;
3632
+ {
3633
+ knownTemplateRefs.add(ret);
3634
+ }
3635
+ return ret;
3636
+ }
3637
+
3601
3638
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3602
3639
  if (isArray(rawRef)) {
3603
3640
  rawRef.forEach(
@@ -3626,7 +3663,13 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3626
3663
  const oldRef = oldRawRef && oldRawRef.r;
3627
3664
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3628
3665
  const setupState = owner.setupState;
3629
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => hasOwn(setupState, key) && !(Object.getOwnPropertyDescriptor(refs, key) || EMPTY_OBJ).get;
3666
+ const rawSetupState = toRaw(setupState);
3667
+ const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3668
+ if (knownTemplateRefs.has(rawSetupState[key])) {
3669
+ return false;
3670
+ }
3671
+ return hasOwn(rawSetupState, key);
3672
+ };
3630
3673
  if (oldRef != null && oldRef !== ref) {
3631
3674
  if (isString(oldRef)) {
3632
3675
  refs[oldRef] = null;
@@ -4683,7 +4726,7 @@ const KeepAliveImpl = {
4683
4726
  return () => {
4684
4727
  pendingCacheKey = null;
4685
4728
  if (!slots.default) {
4686
- return null;
4729
+ return current = null;
4687
4730
  }
4688
4731
  const children = slots.default();
4689
4732
  const rawVNode = children[0];
@@ -8440,7 +8483,8 @@ function renderComponentRoot(instance) {
8440
8483
  data,
8441
8484
  setupState,
8442
8485
  ctx,
8443
- inheritAttrs
8486
+ inheritAttrs,
8487
+ isMounted
8444
8488
  } = instance;
8445
8489
  const prev = setCurrentRenderingInstance(instance);
8446
8490
  let result;
@@ -8560,7 +8604,7 @@ function renderComponentRoot(instance) {
8560
8604
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8561
8605
  );
8562
8606
  }
8563
- root.transition = vnode.transition;
8607
+ root.transition = isMounted ? vnode.component.subTree.transition : vnode.transition;
8564
8608
  }
8565
8609
  if (setRoot) {
8566
8610
  setRoot(root);
@@ -9054,7 +9098,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9054
9098
  };
9055
9099
  }
9056
9100
  if (activeBranch) {
9057
- if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
9101
+ if (parentNode(activeBranch.el) === container2) {
9058
9102
  anchor = next(activeBranch);
9059
9103
  }
9060
9104
  unmount(activeBranch, parentComponent2, suspense, true);
@@ -10115,29 +10159,6 @@ const computed = (getterOrOptions, debugOptions) => {
10115
10159
  return c;
10116
10160
  };
10117
10161
 
10118
- function useTemplateRef(key) {
10119
- const i = getCurrentInstance();
10120
- const r = shallowRef(null);
10121
- if (i) {
10122
- const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
10123
- let desc;
10124
- if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
10125
- warn$1(`useTemplateRef('${key}') already exists.`);
10126
- } else {
10127
- Object.defineProperty(refs, key, {
10128
- enumerable: true,
10129
- get: () => r.value,
10130
- set: (val) => r.value = val
10131
- });
10132
- }
10133
- } else {
10134
- warn$1(
10135
- `useTemplateRef() is called when there is no active component instance to be associated with.`
10136
- );
10137
- }
10138
- return readonly(r) ;
10139
- }
10140
-
10141
10162
  function h(type, propsOrChildren, children) {
10142
10163
  const l = arguments.length;
10143
10164
  if (l === 2) {
@@ -10363,7 +10384,7 @@ function isMemoSame(cached, memo) {
10363
10384
  return true;
10364
10385
  }
10365
10386
 
10366
- const version = "3.5.1";
10387
+ const version = "3.5.2";
10367
10388
  const warn = warn$1 ;
10368
10389
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10369
10390
  const devtools = devtools$1 ;