@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
  **/
@@ -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
  **/
@@ -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.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -644,7 +644,7 @@ function refreshComputed(computed) {
644
644
  shouldTrack = true;
645
645
  try {
646
646
  prepareDeps(computed);
647
- const value = computed.fn();
647
+ const value = computed.fn(computed._value);
648
648
  if (dep.version === 0 || hasChanged(value, computed._value)) {
649
649
  computed._value = value;
650
650
  dep.version++;
@@ -753,7 +753,7 @@ class Dep {
753
753
  }
754
754
  }
755
755
  track(debugInfo) {
756
- if (!activeSub || !shouldTrack) {
756
+ if (!activeSub || !shouldTrack || activeSub === this.computed) {
757
757
  return;
758
758
  }
759
759
  let link = this.activeLink;
@@ -1766,7 +1766,7 @@ function toValue(source) {
1766
1766
  return isFunction(source) ? source() : unref(source);
1767
1767
  }
1768
1768
  const shallowUnwrapHandlers = {
1769
- 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)),
1770
1770
  set: (target, key, value, receiver) => {
1771
1771
  const oldValue = target[key];
1772
1772
  if (isRef(oldValue) && !isRef(value)) {
@@ -2468,9 +2468,7 @@ function queueJob(job) {
2468
2468
  } else {
2469
2469
  queue.splice(findInsertionIndex(jobId), 0, job);
2470
2470
  }
2471
- if (!(job.flags & 4)) {
2472
- job.flags |= 1;
2473
- }
2471
+ job.flags |= 1;
2474
2472
  queueFlush();
2475
2473
  }
2476
2474
  }
@@ -2486,9 +2484,7 @@ function queuePostFlushCb(cb) {
2486
2484
  activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
2487
2485
  } else if (!(cb.flags & 1)) {
2488
2486
  pendingPostFlushCbs.push(cb);
2489
- if (!(cb.flags & 4)) {
2490
- cb.flags |= 1;
2491
- }
2487
+ cb.flags |= 1;
2492
2488
  }
2493
2489
  } else {
2494
2490
  pendingPostFlushCbs.push(...cb);
@@ -2510,6 +2506,9 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
2510
2506
  }
2511
2507
  queue.splice(i, 1);
2512
2508
  i--;
2509
+ if (cb.flags & 4) {
2510
+ cb.flags &= ~1;
2511
+ }
2513
2512
  cb();
2514
2513
  cb.flags &= ~1;
2515
2514
  }
@@ -2534,6 +2533,9 @@ function flushPostFlushCbs(seen) {
2534
2533
  if (checkRecursiveUpdates(seen, cb)) {
2535
2534
  continue;
2536
2535
  }
2536
+ if (cb.flags & 4) {
2537
+ cb.flags &= ~1;
2538
+ }
2537
2539
  if (!(cb.flags & 8)) cb();
2538
2540
  cb.flags &= ~1;
2539
2541
  }
@@ -2556,6 +2558,9 @@ function flushJobs(seen) {
2556
2558
  if (check(job)) {
2557
2559
  continue;
2558
2560
  }
2561
+ if (job.flags & 4) {
2562
+ job.flags &= ~1;
2563
+ }
2559
2564
  callWithErrorHandling(
2560
2565
  job,
2561
2566
  job.i,
@@ -2565,6 +2570,12 @@ function flushJobs(seen) {
2565
2570
  }
2566
2571
  }
2567
2572
  } finally {
2573
+ for (; flushIndex < queue.length; flushIndex++) {
2574
+ const job = queue[flushIndex];
2575
+ if (job) {
2576
+ job.flags &= ~1;
2577
+ }
2578
+ }
2568
2579
  flushIndex = 0;
2569
2580
  queue.length = 0;
2570
2581
  flushPostFlushCbs(seen);
@@ -3321,6 +3332,7 @@ const BaseTransitionImpl = {
3321
3332
  if (!(instance.job.flags & 8)) {
3322
3333
  instance.update();
3323
3334
  }
3335
+ delete leavingHooks.afterLeave;
3324
3336
  };
3325
3337
  return emptyPlaceholder(child);
3326
3338
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3543,6 +3555,7 @@ function getInnerChild$1(vnode) {
3543
3555
  }
3544
3556
  function setTransitionHooks(vnode, hooks) {
3545
3557
  if (vnode.shapeFlag & 6 && vnode.component) {
3558
+ vnode.transition = hooks;
3546
3559
  setTransitionHooks(vnode.component.subTree, hooks);
3547
3560
  } else if (vnode.shapeFlag & 128) {
3548
3561
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
@@ -3587,7 +3600,7 @@ function defineComponent(options, extraOptions) {
3587
3600
  function useId() {
3588
3601
  const i = getCurrentInstance();
3589
3602
  if (i) {
3590
- return (i.appContext.config.idPrefix || "v") + ":" + i.ids[0] + i.ids[1]++;
3603
+ return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
3591
3604
  } else {
3592
3605
  warn$1(
3593
3606
  `useId() is called when there is no active component instance to be associated with.`
@@ -3598,6 +3611,34 @@ function markAsyncBoundary(instance) {
3598
3611
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
3599
3612
  }
3600
3613
 
3614
+ const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
3615
+ function useTemplateRef(key) {
3616
+ const i = getCurrentInstance();
3617
+ const r = shallowRef(null);
3618
+ if (i) {
3619
+ const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
3620
+ let desc;
3621
+ if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
3622
+ warn$1(`useTemplateRef('${key}') already exists.`);
3623
+ } else {
3624
+ Object.defineProperty(refs, key, {
3625
+ enumerable: true,
3626
+ get: () => r.value,
3627
+ set: (val) => r.value = val
3628
+ });
3629
+ }
3630
+ } else {
3631
+ warn$1(
3632
+ `useTemplateRef() is called when there is no active component instance to be associated with.`
3633
+ );
3634
+ }
3635
+ const ret = readonly(r) ;
3636
+ {
3637
+ knownTemplateRefs.add(ret);
3638
+ }
3639
+ return ret;
3640
+ }
3641
+
3601
3642
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3602
3643
  if (isArray(rawRef)) {
3603
3644
  rawRef.forEach(
@@ -3626,7 +3667,13 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3626
3667
  const oldRef = oldRawRef && oldRawRef.r;
3627
3668
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3628
3669
  const setupState = owner.setupState;
3629
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => hasOwn(setupState, key) && !(Object.getOwnPropertyDescriptor(refs, key) || EMPTY_OBJ).get;
3670
+ const rawSetupState = toRaw(setupState);
3671
+ const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3672
+ if (knownTemplateRefs.has(rawSetupState[key])) {
3673
+ return false;
3674
+ }
3675
+ return hasOwn(rawSetupState, key);
3676
+ };
3630
3677
  if (oldRef != null && oldRef !== ref) {
3631
3678
  if (isString(oldRef)) {
3632
3679
  refs[oldRef] = null;
@@ -4683,7 +4730,7 @@ const KeepAliveImpl = {
4683
4730
  return () => {
4684
4731
  pendingCacheKey = null;
4685
4732
  if (!slots.default) {
4686
- return null;
4733
+ return current = null;
4687
4734
  }
4688
4735
  const children = slots.default();
4689
4736
  const rawVNode = children[0];
@@ -7269,7 +7316,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7269
7316
  endMeasure(instance, `hydrate`);
7270
7317
  }
7271
7318
  };
7272
- if (isAsyncWrapperVNode) {
7319
+ if (isAsyncWrapperVNode && type.__asyncHydrate) {
7273
7320
  type.__asyncHydrate(
7274
7321
  el,
7275
7322
  instance,
@@ -8560,7 +8607,7 @@ function renderComponentRoot(instance) {
8560
8607
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8561
8608
  );
8562
8609
  }
8563
- root.transition = vnode.transition;
8610
+ setTransitionHooks(root, vnode.transition);
8564
8611
  }
8565
8612
  if (setRoot) {
8566
8613
  setRoot(root);
@@ -9054,7 +9101,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9054
9101
  };
9055
9102
  }
9056
9103
  if (activeBranch) {
9057
- if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
9104
+ if (parentNode(activeBranch.el) === container2) {
9058
9105
  anchor = next(activeBranch);
9059
9106
  }
9060
9107
  unmount(activeBranch, parentComponent2, suspense, true);
@@ -10115,29 +10162,6 @@ const computed = (getterOrOptions, debugOptions) => {
10115
10162
  return c;
10116
10163
  };
10117
10164
 
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
10165
  function h(type, propsOrChildren, children) {
10142
10166
  const l = arguments.length;
10143
10167
  if (l === 2) {
@@ -10363,7 +10387,7 @@ function isMemoSame(cached, memo) {
10363
10387
  return true;
10364
10388
  }
10365
10389
 
10366
- const version = "3.5.1";
10390
+ const version = "3.5.3";
10367
10391
  const warn = warn$1 ;
10368
10392
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10369
10393
  const devtools = devtools$1 ;
@@ -10376,7 +10400,9 @@ const _ssrUtils = {
10376
10400
  isVNode: isVNode,
10377
10401
  normalizeVNode,
10378
10402
  getComponentPublicInstance,
10379
- ensureValidVNode
10403
+ ensureValidVNode,
10404
+ pushWarningContext,
10405
+ popWarningContext
10380
10406
  };
10381
10407
  const ssrUtils = _ssrUtils ;
10382
10408
  const resolveFilter = null;