@vue/runtime-core 3.5.43 → 3.5.44

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-core v3.5.43
2
+ * @vue/runtime-core v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -334,21 +334,21 @@ function queuePostFlushCb(cb) {
334
334
  }
335
335
  queueFlush();
336
336
  }
337
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
337
+ function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
338
338
  {
339
339
  seen = seen || /* @__PURE__ */ new Map();
340
340
  }
341
341
  for (; i < queue.length; i++) {
342
342
  const cb = queue[i];
343
343
  if (cb && cb.flags & 2) {
344
- if (instance && cb.id !== instance.uid) {
344
+ if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
345
345
  continue;
346
346
  }
347
347
  if (checkRecursiveUpdates(seen, cb)) {
348
348
  continue;
349
349
  }
350
350
  queue.splice(i, 1);
351
- i--;
351
+ i = instance ? i - 1 : flushIndex;
352
352
  if (cb.flags & 4) {
353
353
  cb.flags &= -2;
354
354
  }
@@ -359,12 +359,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
359
359
  }
360
360
  }
361
361
  }
362
- function flushPostFlushCbs(seen) {
362
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
363
363
  if (pendingPostFlushCbs.length) {
364
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
365
- (a, b) => getId(a) - getId(b)
366
- );
367
- pendingPostFlushCbs.length = 0;
364
+ let cbs = pendingPostFlushCbs;
365
+ let kept = 0;
366
+ if (skip) {
367
+ cbs = [];
368
+ for (let i = 0; i < pendingPostFlushCbs.length; i++) {
369
+ const cb = pendingPostFlushCbs[i];
370
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
371
+ pendingPostFlushCbs[kept++] = cb;
372
+ } else {
373
+ cbs.push(cb);
374
+ }
375
+ }
376
+ }
377
+ const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
378
+ pendingPostFlushCbs.length = kept;
368
379
  if (activePostFlushCbs) {
369
380
  for (let i = 0; i < deduped.length; i++) {
370
381
  activePostFlushCbs.push(deduped[i]);
@@ -390,6 +401,22 @@ function flushPostFlushCbs(seen) {
390
401
  postFlushIndex = 0;
391
402
  }
392
403
  }
404
+ let isFlushing = false;
405
+ function flushOnAppMount(fn, minUid) {
406
+ if (isFlushing) {
407
+ fn();
408
+ return;
409
+ }
410
+ const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
411
+ fn();
412
+ isFlushing = true;
413
+ try {
414
+ flushPreFlushCbs(void 0, minUid);
415
+ flushPostFlushCbs(void 0, queued, minUid);
416
+ } finally {
417
+ isFlushing = false;
418
+ }
419
+ }
393
420
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
394
421
  function flushJobs(seen) {
395
422
  {
@@ -891,6 +918,7 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
891
918
  let isPre = false;
892
919
  if (flush === "post") {
893
920
  baseWatchOptions.scheduler = (job) => {
921
+ job.i = instance;
894
922
  queuePostRenderEffect(job, instance && instance.suspense);
895
923
  };
896
924
  } else if (flush !== "sync") {
@@ -1192,7 +1220,11 @@ const TeleportImpl = {
1192
1220
  };
1193
1221
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
1194
1222
  if (moveType === 0) {
1223
+ if (vnode.targetStart) {
1224
+ insert(vnode.targetStart, container, parentAnchor);
1225
+ }
1195
1226
  insert(vnode.targetAnchor, container, parentAnchor);
1227
+ parentAnchor = vnode.targetAnchor;
1196
1228
  }
1197
1229
  const { el, anchor, shapeFlag, children, props } = vnode;
1198
1230
  const isReorder = moveType === 2;
@@ -1361,10 +1393,6 @@ const BaseTransitionPropsValidators = {
1361
1393
  onAfterAppear: TransitionHookValidator,
1362
1394
  onAppearCancelled: TransitionHookValidator
1363
1395
  };
1364
- const recursiveGetSubtree = (instance) => {
1365
- const subTree = instance.subTree;
1366
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
1367
- };
1368
1396
  const BaseTransitionImpl = {
1369
1397
  name: `BaseTransition`,
1370
1398
  props: BaseTransitionPropsValidators,
@@ -1405,7 +1433,7 @@ const BaseTransitionImpl = {
1405
1433
  setTransitionHooks(innerChild, enterHooks);
1406
1434
  }
1407
1435
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
1408
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
1436
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
1409
1437
  let leavingHooks = resolveTransitionHooks(
1410
1438
  oldInnerChild,
1411
1439
  rawProps,
@@ -1538,8 +1566,15 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1538
1566
  );
1539
1567
  }
1540
1568
  const leavingVNode = leavingVNodesCache[key];
1541
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
1542
- leavingVNode.el[leaveCbKey]();
1569
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
1570
+ let leavingCb = leavingVNode.el[leaveCbKey];
1571
+ if (!leavingCb) {
1572
+ const leavingRoot = getTransitionRoot(leavingVNode);
1573
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
1574
+ }
1575
+ if (leavingCb) {
1576
+ leavingCb();
1577
+ }
1543
1578
  }
1544
1579
  callHook(hook, [el]);
1545
1580
  },
@@ -1667,6 +1702,12 @@ function setTransitionHooks(vnode, hooks) {
1667
1702
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1668
1703
  } else {
1669
1704
  vnode.transition = hooks;
1705
+ if (vnode.type === Fragment && shared.isArray(vnode.children)) {
1706
+ const child = filterSingleRoot(vnode.children, false);
1707
+ if (child) {
1708
+ setTransitionHooks(child, hooks);
1709
+ }
1710
+ }
1670
1711
  }
1671
1712
  }
1672
1713
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -1691,6 +1732,18 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
1691
1732
  }
1692
1733
  return ret;
1693
1734
  }
1735
+ function getTransitionRoot(vnode) {
1736
+ if (vnode.component) {
1737
+ return getTransitionRoot(vnode.component.subTree);
1738
+ }
1739
+ if (vnode.type === Fragment) {
1740
+ const child = shared.isArray(vnode.children) && filterSingleRoot(vnode.children, false);
1741
+ return child ? getTransitionRoot(child) : void 0;
1742
+ }
1743
+ if (vnode.type !== Comment) {
1744
+ return vnode;
1745
+ }
1746
+ }
1694
1747
 
1695
1748
  // @__NO_SIDE_EFFECTS__
1696
1749
  function defineComponent(options, extraOptions) {
@@ -2596,14 +2649,22 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
2596
2649
  break;
2597
2650
  }
2598
2651
  }, opts);
2599
- forEach((el) => {
2600
- if (!(el instanceof Element)) return;
2652
+ const observe = (el) => {
2601
2653
  if (elementIsVisibleInViewport(el)) {
2602
2654
  hydrate();
2603
2655
  ob.disconnect();
2604
2656
  return false;
2605
2657
  }
2658
+ if (getComputedStyle(el).display === "contents") {
2659
+ for (let i = 0; i < el.children.length; i++) {
2660
+ if (observe(el.children[i]) === false) return false;
2661
+ }
2662
+ }
2606
2663
  ob.observe(el);
2664
+ };
2665
+ forEach((el) => {
2666
+ if (!(el instanceof Element)) return;
2667
+ return observe(el);
2607
2668
  });
2608
2669
  return () => ob.disconnect();
2609
2670
  };
@@ -2957,6 +3018,7 @@ const KeepAliveImpl = {
2957
3018
  unmount(cached);
2958
3019
  } else if (current) {
2959
3020
  resetShapeFlag(current);
3021
+ if (cached) resetShapeFlag(cached);
2960
3022
  }
2961
3023
  cache.delete(key);
2962
3024
  keys.delete(key);
@@ -3248,9 +3310,11 @@ function renderList(source, renderItem, cache, index) {
3248
3310
  }
3249
3311
  } else if (typeof source === "number") {
3250
3312
  if (!Number.isInteger(source) || source < 0) {
3251
- warn$1(
3252
- `The v-for range expects a positive integer value but got ${source}.`
3253
- );
3313
+ {
3314
+ warn$1(
3315
+ `The v-for range expects a positive integer value but got ${source}.`
3316
+ );
3317
+ }
3254
3318
  ret = [];
3255
3319
  } else {
3256
3320
  ret = new Array(source);
@@ -4888,7 +4952,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
4888
4952
  }
4889
4953
  for (let i = 0; i < nextKeys.length; i++) {
4890
4954
  const key = nextKeys[i];
4891
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
4955
+ if (!shared.hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
4892
4956
  return true;
4893
4957
  }
4894
4958
  }
@@ -5927,15 +5991,16 @@ function baseCreateRenderer(options, createHydrationFns) {
5927
5991
  for (let i = 0; i < newChildren.length; i++) {
5928
5992
  const oldVNode = oldChildren[i];
5929
5993
  const newVNode = newChildren[i];
5994
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
5930
5995
  const container = (
5931
5996
  // oldVNode may be an errored async setup() component inside Suspense
5932
5997
  // which will not have a mounted element
5933
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
5998
+ oldEl && // - In the case of a Fragment, we need to provide the actual parent
5934
5999
  // of the Fragment itself so it can move its children.
5935
6000
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
5936
6001
  // which also requires the correct parent container
5937
6002
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
5938
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
6003
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
5939
6004
  // In other cases, the parent container is not actually used so we
5940
6005
  // just pass the block element here to avoid a DOM parentNode call.
5941
6006
  fallbackContainer
@@ -6099,7 +6164,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6099
6164
  }
6100
6165
  if (isHmrUpdating) initialVNode.el = null;
6101
6166
  if (instance.asyncDep) {
6102
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
6167
+ parentSuspense && parentSuspense.registerDep(
6168
+ instance,
6169
+ setupRenderEffect,
6170
+ optimized,
6171
+ namespace
6172
+ );
6103
6173
  if (!initialVNode.el) {
6104
6174
  const placeholder = instance.subTree = createVNode(Comment);
6105
6175
  processCommentNode(null, placeholder, container, anchor);
@@ -6129,6 +6199,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6129
6199
  pushWarningContext(n2);
6130
6200
  }
6131
6201
  n2.el = n1.el;
6202
+ n2.placeholder = n1.placeholder;
6132
6203
  updateComponentPreRender(instance, n2, optimized);
6133
6204
  {
6134
6205
  popWarningContext();
@@ -6140,6 +6211,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6140
6211
  }
6141
6212
  } else {
6142
6213
  n2.el = n1.el;
6214
+ n2.placeholder = n1.placeholder;
6143
6215
  instance.vnode = n2;
6144
6216
  }
6145
6217
  };
@@ -6793,18 +6865,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6793
6865
  };
6794
6866
  const remove = (vnode) => {
6795
6867
  const { type, el, anchor, transition } = vnode;
6796
- if (type === Fragment) {
6797
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
6798
- vnode.children.forEach((child) => {
6799
- if (child.type === Comment) {
6800
- hostRemove(child.el);
6801
- } else {
6802
- remove(child);
6803
- }
6804
- });
6805
- } else {
6806
- removeFragment(el, anchor);
6807
- }
6868
+ const isFragment = type === Fragment;
6869
+ if (isFragment && !transition) {
6870
+ removeFragment(el, anchor);
6808
6871
  return;
6809
6872
  }
6810
6873
  if (type === Static) {
@@ -6814,17 +6877,25 @@ function baseCreateRenderer(options, createHydrationFns) {
6814
6877
  }
6815
6878
  return;
6816
6879
  }
6880
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
6817
6881
  const performRemove = () => {
6818
- hostRemove(el);
6882
+ if (isFragment) {
6883
+ if (hostParentNode(el)) {
6884
+ removeFragment(el, anchor);
6885
+ }
6886
+ } else {
6887
+ hostRemove(el);
6888
+ }
6819
6889
  if (transition && !transition.persisted && transition.afterLeave) {
6820
6890
  transition.afterLeave();
6821
6891
  }
6822
6892
  };
6823
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
6893
+ if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
6824
6894
  const { leave, delayLeave } = transition;
6825
- const performLeave = () => leave(el, performRemove);
6895
+ const leavingEl = leavingNode.el;
6896
+ const performLeave = () => leave(leavingEl, performRemove);
6826
6897
  if (delayLeave) {
6827
- delayLeave(vnode.el, performRemove, performLeave);
6898
+ delayLeave(leavingEl, performRemove, performLeave);
6828
6899
  } else {
6829
6900
  performLeave();
6830
6901
  }
@@ -6885,32 +6956,26 @@ function baseCreateRenderer(options, createHydrationFns) {
6885
6956
  const teleportEnd = el && el[TeleportEndKey];
6886
6957
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
6887
6958
  };
6888
- let isFlushing = false;
6889
6959
  const render = (vnode, container, namespace) => {
6890
- let instance;
6891
- if (vnode == null) {
6892
- if (container._vnode) {
6893
- unmount(container._vnode, null, null, true);
6894
- instance = container._vnode.component;
6960
+ const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
6961
+ flushOnAppMount(() => {
6962
+ if (vnode == null) {
6963
+ if (container._vnode) {
6964
+ unmount(container._vnode, null, null, true);
6965
+ }
6966
+ } else {
6967
+ patch(
6968
+ container._vnode || null,
6969
+ vnode,
6970
+ container,
6971
+ null,
6972
+ null,
6973
+ null,
6974
+ namespace
6975
+ );
6895
6976
  }
6896
- } else {
6897
- patch(
6898
- container._vnode || null,
6899
- vnode,
6900
- container,
6901
- null,
6902
- null,
6903
- null,
6904
- namespace
6905
- );
6906
- }
6907
- container._vnode = vnode;
6908
- if (!isFlushing) {
6909
- isFlushing = true;
6910
- flushPreFlushCbs(instance);
6911
- flushPostFlushCbs();
6912
- isFlushing = false;
6913
- }
6977
+ container._vnode = vnode;
6978
+ }, minUid);
6914
6979
  };
6915
6980
  const internals = {
6916
6981
  p: patch,
@@ -7498,7 +7563,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7498
7563
  next() {
7499
7564
  return suspense.activeBranch && next(suspense.activeBranch);
7500
7565
  },
7501
- registerDep(instance, setupRenderEffect, optimized2) {
7566
+ // `namespace` intentionally shadows the boundary's own: the dep must be
7567
+ // mounted with the namespace of the position it was rendered at, which can
7568
+ // differ from the boundary's (e.g. a component nested inside an <svg>).
7569
+ registerDep(instance, setupRenderEffect, optimized2, namespace2) {
7502
7570
  const isInPendingSuspense = !!suspense.pendingBranch;
7503
7571
  if (isInPendingSuspense) {
7504
7572
  suspense.deps++;
@@ -7511,7 +7579,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7511
7579
  return;
7512
7580
  }
7513
7581
  unsetCurrentInstance();
7514
- if (hydratedEl && !instance.scope.active) {
7582
+ if (!instance.scope.active) {
7515
7583
  if (isInPendingSuspense && --suspense.deps === 0) {
7516
7584
  suspense.resolve();
7517
7585
  }
@@ -7538,7 +7606,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7538
7606
  // consider the comment placeholder case.
7539
7607
  hydratedEl ? null : next(instance.subTree),
7540
7608
  suspense,
7541
- namespace,
7609
+ namespace2,
7542
7610
  optimized2
7543
7611
  );
7544
7612
  if (placeholder) {
@@ -8072,6 +8140,9 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8072
8140
 
8073
8141
  const emptyAppContext = createAppContext();
8074
8142
  let uid = 0;
8143
+ function getNextUid() {
8144
+ return uid;
8145
+ }
8075
8146
  function createComponentInstance(vnode, parent, suspense) {
8076
8147
  const type = vnode.type;
8077
8148
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -8744,7 +8815,7 @@ function isMemoSame(cached, memo) {
8744
8815
  return true;
8745
8816
  }
8746
8817
 
8747
- const version = "3.5.43";
8818
+ const version = "3.5.44";
8748
8819
  const warn = warn$1 ;
8749
8820
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8750
8821
  const devtools = devtools$1 ;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.43
2
+ * @vue/runtime-core v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -205,15 +205,15 @@ function queuePostFlushCb(cb) {
205
205
  }
206
206
  queueFlush();
207
207
  }
208
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
208
+ function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
209
209
  for (; i < queue.length; i++) {
210
210
  const cb = queue[i];
211
211
  if (cb && cb.flags & 2) {
212
- if (instance && cb.id !== instance.uid) {
212
+ if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
213
213
  continue;
214
214
  }
215
215
  queue.splice(i, 1);
216
- i--;
216
+ i = instance ? i - 1 : flushIndex;
217
217
  if (cb.flags & 4) {
218
218
  cb.flags &= -2;
219
219
  }
@@ -224,12 +224,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
224
224
  }
225
225
  }
226
226
  }
227
- function flushPostFlushCbs(seen) {
227
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
228
228
  if (pendingPostFlushCbs.length) {
229
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
230
- (a, b) => getId(a) - getId(b)
231
- );
232
- pendingPostFlushCbs.length = 0;
229
+ let cbs = pendingPostFlushCbs;
230
+ let kept = 0;
231
+ if (skip) {
232
+ cbs = [];
233
+ for (let i = 0; i < pendingPostFlushCbs.length; i++) {
234
+ const cb = pendingPostFlushCbs[i];
235
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
236
+ pendingPostFlushCbs[kept++] = cb;
237
+ } else {
238
+ cbs.push(cb);
239
+ }
240
+ }
241
+ }
242
+ const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
243
+ pendingPostFlushCbs.length = kept;
233
244
  if (activePostFlushCbs) {
234
245
  for (let i = 0; i < deduped.length; i++) {
235
246
  activePostFlushCbs.push(deduped[i]);
@@ -249,6 +260,22 @@ function flushPostFlushCbs(seen) {
249
260
  postFlushIndex = 0;
250
261
  }
251
262
  }
263
+ let isFlushing = false;
264
+ function flushOnAppMount(fn, minUid) {
265
+ if (isFlushing) {
266
+ fn();
267
+ return;
268
+ }
269
+ const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
270
+ fn();
271
+ isFlushing = true;
272
+ try {
273
+ flushPreFlushCbs(void 0, minUid);
274
+ flushPostFlushCbs(void 0, queued, minUid);
275
+ } finally {
276
+ isFlushing = false;
277
+ }
278
+ }
252
279
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
253
280
  function flushJobs(seen) {
254
281
  try {
@@ -458,6 +485,7 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
458
485
  let isPre = false;
459
486
  if (flush === "post") {
460
487
  baseWatchOptions.scheduler = (job) => {
488
+ job.i = instance;
461
489
  queuePostRenderEffect(job, instance && instance.suspense);
462
490
  };
463
491
  } else if (flush !== "sync") {
@@ -736,7 +764,11 @@ const TeleportImpl = {
736
764
  };
737
765
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
738
766
  if (moveType === 0) {
767
+ if (vnode.targetStart) {
768
+ insert(vnode.targetStart, container, parentAnchor);
769
+ }
739
770
  insert(vnode.targetAnchor, container, parentAnchor);
771
+ parentAnchor = vnode.targetAnchor;
740
772
  }
741
773
  const { el, anchor, shapeFlag, children, props } = vnode;
742
774
  const isReorder = moveType === 2;
@@ -905,10 +937,6 @@ const BaseTransitionPropsValidators = {
905
937
  onAfterAppear: TransitionHookValidator,
906
938
  onAppearCancelled: TransitionHookValidator
907
939
  };
908
- const recursiveGetSubtree = (instance) => {
909
- const subTree = instance.subTree;
910
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
911
- };
912
940
  const BaseTransitionImpl = {
913
941
  name: `BaseTransition`,
914
942
  props: BaseTransitionPropsValidators,
@@ -946,7 +974,7 @@ const BaseTransitionImpl = {
946
974
  setTransitionHooks(innerChild, enterHooks);
947
975
  }
948
976
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
949
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
977
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
950
978
  let leavingHooks = resolveTransitionHooks(
951
979
  oldInnerChild,
952
980
  rawProps,
@@ -1072,8 +1100,15 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1072
1100
  );
1073
1101
  }
1074
1102
  const leavingVNode = leavingVNodesCache[key];
1075
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
1076
- leavingVNode.el[leaveCbKey]();
1103
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
1104
+ let leavingCb = leavingVNode.el[leaveCbKey];
1105
+ if (!leavingCb) {
1106
+ const leavingRoot = getTransitionRoot(leavingVNode);
1107
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
1108
+ }
1109
+ if (leavingCb) {
1110
+ leavingCb();
1111
+ }
1077
1112
  }
1078
1113
  callHook(hook, [el]);
1079
1114
  },
@@ -1201,6 +1236,12 @@ function setTransitionHooks(vnode, hooks) {
1201
1236
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1202
1237
  } else {
1203
1238
  vnode.transition = hooks;
1239
+ if (vnode.type === Fragment && shared.isArray(vnode.children)) {
1240
+ const child = filterSingleRoot(vnode.children, false);
1241
+ if (child) {
1242
+ setTransitionHooks(child, hooks);
1243
+ }
1244
+ }
1204
1245
  }
1205
1246
  }
1206
1247
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -1225,6 +1266,18 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
1225
1266
  }
1226
1267
  return ret;
1227
1268
  }
1269
+ function getTransitionRoot(vnode) {
1270
+ if (vnode.component) {
1271
+ return getTransitionRoot(vnode.component.subTree);
1272
+ }
1273
+ if (vnode.type === Fragment) {
1274
+ const child = shared.isArray(vnode.children) && filterSingleRoot(vnode.children, false);
1275
+ return child ? getTransitionRoot(child) : void 0;
1276
+ }
1277
+ if (vnode.type !== Comment) {
1278
+ return vnode;
1279
+ }
1280
+ }
1228
1281
 
1229
1282
  // @__NO_SIDE_EFFECTS__
1230
1283
  function defineComponent(options, extraOptions) {
@@ -1919,14 +1972,22 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
1919
1972
  break;
1920
1973
  }
1921
1974
  }, opts);
1922
- forEach((el) => {
1923
- if (!(el instanceof Element)) return;
1975
+ const observe = (el) => {
1924
1976
  if (elementIsVisibleInViewport(el)) {
1925
1977
  hydrate();
1926
1978
  ob.disconnect();
1927
1979
  return false;
1928
1980
  }
1981
+ if (getComputedStyle(el).display === "contents") {
1982
+ for (let i = 0; i < el.children.length; i++) {
1983
+ if (observe(el.children[i]) === false) return false;
1984
+ }
1985
+ }
1929
1986
  ob.observe(el);
1987
+ };
1988
+ forEach((el) => {
1989
+ if (!(el instanceof Element)) return;
1990
+ return observe(el);
1930
1991
  });
1931
1992
  return () => ob.disconnect();
1932
1993
  };
@@ -2258,6 +2319,7 @@ const KeepAliveImpl = {
2258
2319
  unmount(cached);
2259
2320
  } else if (current) {
2260
2321
  resetShapeFlag(current);
2322
+ if (cached) resetShapeFlag(cached);
2261
2323
  }
2262
2324
  cache.delete(key);
2263
2325
  keys.delete(key);
@@ -2531,7 +2593,9 @@ function renderList(source, renderItem, cache, index) {
2531
2593
  );
2532
2594
  }
2533
2595
  } else if (typeof source === "number") {
2534
- {
2596
+ if (!Number.isInteger(source) || source < 0) {
2597
+ ret = [];
2598
+ } else {
2535
2599
  ret = new Array(source);
2536
2600
  for (let i = 0; i < source; i++) {
2537
2601
  ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
@@ -3711,7 +3775,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3711
3775
  }
3712
3776
  for (let i = 0; i < nextKeys.length; i++) {
3713
3777
  const key = nextKeys[i];
3714
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
3778
+ if (!shared.hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
3715
3779
  return true;
3716
3780
  }
3717
3781
  }
@@ -4515,15 +4579,16 @@ function baseCreateRenderer(options, createHydrationFns) {
4515
4579
  for (let i = 0; i < newChildren.length; i++) {
4516
4580
  const oldVNode = oldChildren[i];
4517
4581
  const newVNode = newChildren[i];
4582
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
4518
4583
  const container = (
4519
4584
  // oldVNode may be an errored async setup() component inside Suspense
4520
4585
  // which will not have a mounted element
4521
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
4586
+ oldEl && // - In the case of a Fragment, we need to provide the actual parent
4522
4587
  // of the Fragment itself so it can move its children.
4523
4588
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
4524
4589
  // which also requires the correct parent container
4525
4590
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
4526
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
4591
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
4527
4592
  // In other cases, the parent container is not actually used so we
4528
4593
  // just pass the block element here to avoid a DOM parentNode call.
4529
4594
  fallbackContainer
@@ -4676,7 +4741,12 @@ function baseCreateRenderer(options, createHydrationFns) {
4676
4741
  setupComponent(instance, false, optimized);
4677
4742
  }
4678
4743
  if (instance.asyncDep) {
4679
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
4744
+ parentSuspense && parentSuspense.registerDep(
4745
+ instance,
4746
+ setupRenderEffect,
4747
+ optimized,
4748
+ namespace
4749
+ );
4680
4750
  if (!initialVNode.el) {
4681
4751
  const placeholder = instance.subTree = createVNode(Comment);
4682
4752
  processCommentNode(null, placeholder, container, anchor);
@@ -4699,6 +4769,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4699
4769
  if (shouldUpdateComponent(n1, n2, optimized)) {
4700
4770
  if (instance.asyncDep && !instance.asyncResolved) {
4701
4771
  n2.el = n1.el;
4772
+ n2.placeholder = n1.placeholder;
4702
4773
  updateComponentPreRender(instance, n2, optimized);
4703
4774
  return;
4704
4775
  } else {
@@ -4707,6 +4778,7 @@ function baseCreateRenderer(options, createHydrationFns) {
4707
4778
  }
4708
4779
  } else {
4709
4780
  n2.el = n1.el;
4781
+ n2.placeholder = n1.placeholder;
4710
4782
  instance.vnode = n2;
4711
4783
  }
4712
4784
  };
@@ -5301,10 +5373,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5301
5373
  };
5302
5374
  const remove = (vnode) => {
5303
5375
  const { type, el, anchor, transition } = vnode;
5304
- if (type === Fragment) {
5305
- {
5306
- removeFragment(el, anchor);
5307
- }
5376
+ const isFragment = type === Fragment;
5377
+ if (isFragment && !transition) {
5378
+ removeFragment(el, anchor);
5308
5379
  return;
5309
5380
  }
5310
5381
  if (type === Static) {
@@ -5314,17 +5385,25 @@ function baseCreateRenderer(options, createHydrationFns) {
5314
5385
  }
5315
5386
  return;
5316
5387
  }
5388
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
5317
5389
  const performRemove = () => {
5318
- hostRemove(el);
5390
+ if (isFragment) {
5391
+ if (hostParentNode(el)) {
5392
+ removeFragment(el, anchor);
5393
+ }
5394
+ } else {
5395
+ hostRemove(el);
5396
+ }
5319
5397
  if (transition && !transition.persisted && transition.afterLeave) {
5320
5398
  transition.afterLeave();
5321
5399
  }
5322
5400
  };
5323
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
5401
+ if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
5324
5402
  const { leave, delayLeave } = transition;
5325
- const performLeave = () => leave(el, performRemove);
5403
+ const leavingEl = leavingNode.el;
5404
+ const performLeave = () => leave(leavingEl, performRemove);
5326
5405
  if (delayLeave) {
5327
- delayLeave(vnode.el, performRemove, performLeave);
5406
+ delayLeave(leavingEl, performRemove, performLeave);
5328
5407
  } else {
5329
5408
  performLeave();
5330
5409
  }
@@ -5379,32 +5458,26 @@ function baseCreateRenderer(options, createHydrationFns) {
5379
5458
  const teleportEnd = el && el[TeleportEndKey];
5380
5459
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
5381
5460
  };
5382
- let isFlushing = false;
5383
5461
  const render = (vnode, container, namespace) => {
5384
- let instance;
5385
- if (vnode == null) {
5386
- if (container._vnode) {
5387
- unmount(container._vnode, null, null, true);
5388
- instance = container._vnode.component;
5462
+ const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
5463
+ flushOnAppMount(() => {
5464
+ if (vnode == null) {
5465
+ if (container._vnode) {
5466
+ unmount(container._vnode, null, null, true);
5467
+ }
5468
+ } else {
5469
+ patch(
5470
+ container._vnode || null,
5471
+ vnode,
5472
+ container,
5473
+ null,
5474
+ null,
5475
+ null,
5476
+ namespace
5477
+ );
5389
5478
  }
5390
- } else {
5391
- patch(
5392
- container._vnode || null,
5393
- vnode,
5394
- container,
5395
- null,
5396
- null,
5397
- null,
5398
- namespace
5399
- );
5400
- }
5401
- container._vnode = vnode;
5402
- if (!isFlushing) {
5403
- isFlushing = true;
5404
- flushPreFlushCbs(instance);
5405
- flushPostFlushCbs();
5406
- isFlushing = false;
5407
- }
5479
+ container._vnode = vnode;
5480
+ }, minUid);
5408
5481
  };
5409
5482
  const internals = {
5410
5483
  p: patch,
@@ -5967,7 +6040,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5967
6040
  next() {
5968
6041
  return suspense.activeBranch && next(suspense.activeBranch);
5969
6042
  },
5970
- registerDep(instance, setupRenderEffect, optimized2) {
6043
+ // `namespace` intentionally shadows the boundary's own: the dep must be
6044
+ // mounted with the namespace of the position it was rendered at, which can
6045
+ // differ from the boundary's (e.g. a component nested inside an <svg>).
6046
+ registerDep(instance, setupRenderEffect, optimized2, namespace2) {
5971
6047
  const isInPendingSuspense = !!suspense.pendingBranch;
5972
6048
  if (isInPendingSuspense) {
5973
6049
  suspense.deps++;
@@ -5980,7 +6056,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
5980
6056
  return;
5981
6057
  }
5982
6058
  unsetCurrentInstance();
5983
- if (hydratedEl && !instance.scope.active) {
6059
+ if (!instance.scope.active) {
5984
6060
  if (isInPendingSuspense && --suspense.deps === 0) {
5985
6061
  suspense.resolve();
5986
6062
  }
@@ -6004,7 +6080,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
6004
6080
  // consider the comment placeholder case.
6005
6081
  hydratedEl ? null : next(instance.subTree),
6006
6082
  suspense,
6007
- namespace,
6083
+ namespace2,
6008
6084
  optimized2
6009
6085
  );
6010
6086
  if (placeholder) {
@@ -6482,6 +6558,9 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
6482
6558
 
6483
6559
  const emptyAppContext = createAppContext();
6484
6560
  let uid = 0;
6561
+ function getNextUid() {
6562
+ return uid;
6563
+ }
6485
6564
  function createComponentInstance(vnode, parent, suspense) {
6486
6565
  const type = vnode.type;
6487
6566
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -6836,7 +6915,7 @@ function isMemoSame(cached, memo) {
6836
6915
  return true;
6837
6916
  }
6838
6917
 
6839
- const version = "3.5.43";
6918
+ const version = "3.5.44";
6840
6919
  const warn$1 = shared.NOOP;
6841
6920
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6842
6921
  const devtools = void 0;
@@ -54,8 +54,9 @@ interface SchedulerJob extends Function {
54
54
  /**
55
55
  * Attached by renderer.ts when setting up a component's render effect
56
56
  * Used to obtain component information when reporting max recursive updates.
57
+ * Also set on watcher jobs: null marks a watcher without an owner component.
57
58
  */
58
- i?: ComponentInternalInstance;
59
+ i?: ComponentInternalInstance | null;
59
60
  }
60
61
  type SchedulerJobs = SchedulerJob | SchedulerJob[];
61
62
  export declare function nextTick(): Promise<void>;
@@ -590,7 +591,7 @@ export interface SuspenseBoundary {
590
591
  fallback(fallbackVNode: VNode): void;
591
592
  move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
592
593
  next(): RendererNode | null;
593
- registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean): void;
594
+ registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean, namespace: ElementNamespace): void;
594
595
  unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
595
596
  }
596
597
  declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, hydrateNode: (node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-core v3.5.43
2
+ * @vue/runtime-core v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -337,21 +337,21 @@ function queuePostFlushCb(cb) {
337
337
  }
338
338
  queueFlush();
339
339
  }
340
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
340
+ function flushPreFlushCbs(instance, minUid, seen, i = flushIndex + 1) {
341
341
  if (!!(process.env.NODE_ENV !== "production")) {
342
342
  seen = seen || /* @__PURE__ */ new Map();
343
343
  }
344
344
  for (; i < queue.length; i++) {
345
345
  const cb = queue[i];
346
346
  if (cb && cb.flags & 2) {
347
- if (instance && cb.id !== instance.uid) {
347
+ if (instance && cb.id !== instance.uid || minUid !== void 0 && !(cb.id >= minUid)) {
348
348
  continue;
349
349
  }
350
350
  if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
351
351
  continue;
352
352
  }
353
353
  queue.splice(i, 1);
354
- i--;
354
+ i = instance ? i - 1 : flushIndex;
355
355
  if (cb.flags & 4) {
356
356
  cb.flags &= -2;
357
357
  }
@@ -362,12 +362,23 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
362
362
  }
363
363
  }
364
364
  }
365
- function flushPostFlushCbs(seen) {
365
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
366
366
  if (pendingPostFlushCbs.length) {
367
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
368
- (a, b) => getId(a) - getId(b)
369
- );
370
- pendingPostFlushCbs.length = 0;
367
+ let cbs = pendingPostFlushCbs;
368
+ let kept = 0;
369
+ if (skip) {
370
+ cbs = [];
371
+ for (let i = 0; i < pendingPostFlushCbs.length; i++) {
372
+ const cb = pendingPostFlushCbs[i];
373
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) {
374
+ pendingPostFlushCbs[kept++] = cb;
375
+ } else {
376
+ cbs.push(cb);
377
+ }
378
+ }
379
+ }
380
+ const deduped = [...new Set(cbs)].sort((a, b) => getId(a) - getId(b));
381
+ pendingPostFlushCbs.length = kept;
371
382
  if (activePostFlushCbs) {
372
383
  for (let i = 0; i < deduped.length; i++) {
373
384
  activePostFlushCbs.push(deduped[i]);
@@ -393,6 +404,22 @@ function flushPostFlushCbs(seen) {
393
404
  postFlushIndex = 0;
394
405
  }
395
406
  }
407
+ let isFlushing = false;
408
+ function flushOnAppMount(fn, minUid) {
409
+ if (isFlushing) {
410
+ fn();
411
+ return;
412
+ }
413
+ const queued = minUid === void 0 ? void 0 : new Set(pendingPostFlushCbs);
414
+ fn();
415
+ isFlushing = true;
416
+ try {
417
+ flushPreFlushCbs(void 0, minUid);
418
+ flushPostFlushCbs(void 0, queued, minUid);
419
+ } finally {
420
+ isFlushing = false;
421
+ }
422
+ }
396
423
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
397
424
  function flushJobs(seen) {
398
425
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -894,6 +921,7 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
894
921
  let isPre = false;
895
922
  if (flush === "post") {
896
923
  baseWatchOptions.scheduler = (job) => {
924
+ job.i = instance;
897
925
  queuePostRenderEffect(job, instance && instance.suspense);
898
926
  };
899
927
  } else if (flush !== "sync") {
@@ -1195,7 +1223,11 @@ const TeleportImpl = {
1195
1223
  };
1196
1224
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
1197
1225
  if (moveType === 0) {
1226
+ if (vnode.targetStart) {
1227
+ insert(vnode.targetStart, container, parentAnchor);
1228
+ }
1198
1229
  insert(vnode.targetAnchor, container, parentAnchor);
1230
+ parentAnchor = vnode.targetAnchor;
1199
1231
  }
1200
1232
  const { el, anchor, shapeFlag, children, props } = vnode;
1201
1233
  const isReorder = moveType === 2;
@@ -1364,10 +1396,6 @@ const BaseTransitionPropsValidators = {
1364
1396
  onAfterAppear: TransitionHookValidator,
1365
1397
  onAppearCancelled: TransitionHookValidator
1366
1398
  };
1367
- const recursiveGetSubtree = (instance) => {
1368
- const subTree = instance.subTree;
1369
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
1370
- };
1371
1399
  const BaseTransitionImpl = {
1372
1400
  name: `BaseTransition`,
1373
1401
  props: BaseTransitionPropsValidators,
@@ -1408,7 +1436,7 @@ const BaseTransitionImpl = {
1408
1436
  setTransitionHooks(innerChild, enterHooks);
1409
1437
  }
1410
1438
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
1411
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
1439
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && getTransitionRoot(instance.subTree)) {
1412
1440
  let leavingHooks = resolveTransitionHooks(
1413
1441
  oldInnerChild,
1414
1442
  rawProps,
@@ -1542,8 +1570,15 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
1542
1570
  );
1543
1571
  }
1544
1572
  const leavingVNode = leavingVNodesCache[key];
1545
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
1546
- leavingVNode.el[leaveCbKey]();
1573
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
1574
+ let leavingCb = leavingVNode.el[leaveCbKey];
1575
+ if (!leavingCb) {
1576
+ const leavingRoot = getTransitionRoot(leavingVNode);
1577
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
1578
+ }
1579
+ if (leavingCb) {
1580
+ leavingCb();
1581
+ }
1547
1582
  }
1548
1583
  callHook(hook, [el]);
1549
1584
  },
@@ -1671,6 +1706,12 @@ function setTransitionHooks(vnode, hooks) {
1671
1706
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
1672
1707
  } else {
1673
1708
  vnode.transition = hooks;
1709
+ if (vnode.type === Fragment && isArray(vnode.children)) {
1710
+ const child = filterSingleRoot(vnode.children, false);
1711
+ if (child) {
1712
+ setTransitionHooks(child, hooks);
1713
+ }
1714
+ }
1674
1715
  }
1675
1716
  }
1676
1717
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -1695,6 +1736,18 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
1695
1736
  }
1696
1737
  return ret;
1697
1738
  }
1739
+ function getTransitionRoot(vnode) {
1740
+ if (vnode.component) {
1741
+ return getTransitionRoot(vnode.component.subTree);
1742
+ }
1743
+ if (vnode.type === Fragment) {
1744
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
1745
+ return child ? getTransitionRoot(child) : void 0;
1746
+ }
1747
+ if (vnode.type !== Comment) {
1748
+ return vnode;
1749
+ }
1750
+ }
1698
1751
 
1699
1752
  // @__NO_SIDE_EFFECTS__
1700
1753
  function defineComponent(options, extraOptions) {
@@ -2612,14 +2665,22 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
2612
2665
  break;
2613
2666
  }
2614
2667
  }, opts);
2615
- forEach((el) => {
2616
- if (!(el instanceof Element)) return;
2668
+ const observe = (el) => {
2617
2669
  if (elementIsVisibleInViewport(el)) {
2618
2670
  hydrate();
2619
2671
  ob.disconnect();
2620
2672
  return false;
2621
2673
  }
2674
+ if (getComputedStyle(el).display === "contents") {
2675
+ for (let i = 0; i < el.children.length; i++) {
2676
+ if (observe(el.children[i]) === false) return false;
2677
+ }
2678
+ }
2622
2679
  ob.observe(el);
2680
+ };
2681
+ forEach((el) => {
2682
+ if (!(el instanceof Element)) return;
2683
+ return observe(el);
2623
2684
  });
2624
2685
  return () => ob.disconnect();
2625
2686
  };
@@ -2976,6 +3037,7 @@ const KeepAliveImpl = {
2976
3037
  unmount(cached);
2977
3038
  } else if (current) {
2978
3039
  resetShapeFlag(current);
3040
+ if (cached) resetShapeFlag(cached);
2979
3041
  }
2980
3042
  cache.delete(key);
2981
3043
  keys.delete(key);
@@ -3266,10 +3328,12 @@ function renderList(source, renderItem, cache, index) {
3266
3328
  );
3267
3329
  }
3268
3330
  } else if (typeof source === "number") {
3269
- if (!!(process.env.NODE_ENV !== "production") && (!Number.isInteger(source) || source < 0)) {
3270
- warn$1(
3271
- `The v-for range expects a positive integer value but got ${source}.`
3272
- );
3331
+ if (!Number.isInteger(source) || source < 0) {
3332
+ if (!!(process.env.NODE_ENV !== "production")) {
3333
+ warn$1(
3334
+ `The v-for range expects a positive integer value but got ${source}.`
3335
+ );
3336
+ }
3273
3337
  ret = [];
3274
3338
  } else {
3275
3339
  ret = new Array(source);
@@ -4911,7 +4975,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
4911
4975
  }
4912
4976
  for (let i = 0; i < nextKeys.length; i++) {
4913
4977
  const key = nextKeys[i];
4914
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
4978
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
4915
4979
  return true;
4916
4980
  }
4917
4981
  }
@@ -5977,15 +6041,16 @@ function baseCreateRenderer(options, createHydrationFns) {
5977
6041
  for (let i = 0; i < newChildren.length; i++) {
5978
6042
  const oldVNode = oldChildren[i];
5979
6043
  const newVNode = newChildren[i];
6044
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
5980
6045
  const container = (
5981
6046
  // oldVNode may be an errored async setup() component inside Suspense
5982
6047
  // which will not have a mounted element
5983
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
6048
+ oldEl && // - In the case of a Fragment, we need to provide the actual parent
5984
6049
  // of the Fragment itself so it can move its children.
5985
6050
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
5986
6051
  // which also requires the correct parent container
5987
6052
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
5988
- oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
6053
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldEl) : (
5989
6054
  // In other cases, the parent container is not actually used so we
5990
6055
  // just pass the block element here to avoid a DOM parentNode call.
5991
6056
  fallbackContainer
@@ -6160,7 +6225,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6160
6225
  }
6161
6226
  if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) initialVNode.el = null;
6162
6227
  if (instance.asyncDep) {
6163
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
6228
+ parentSuspense && parentSuspense.registerDep(
6229
+ instance,
6230
+ setupRenderEffect,
6231
+ optimized,
6232
+ namespace
6233
+ );
6164
6234
  if (!initialVNode.el) {
6165
6235
  const placeholder = instance.subTree = createVNode(Comment);
6166
6236
  processCommentNode(null, placeholder, container, anchor);
@@ -6190,6 +6260,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6190
6260
  pushWarningContext(n2);
6191
6261
  }
6192
6262
  n2.el = n1.el;
6263
+ n2.placeholder = n1.placeholder;
6193
6264
  updateComponentPreRender(instance, n2, optimized);
6194
6265
  if (!!(process.env.NODE_ENV !== "production")) {
6195
6266
  popWarningContext();
@@ -6201,6 +6272,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6201
6272
  }
6202
6273
  } else {
6203
6274
  n2.el = n1.el;
6275
+ n2.placeholder = n1.placeholder;
6204
6276
  instance.vnode = n2;
6205
6277
  }
6206
6278
  };
@@ -6854,18 +6926,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6854
6926
  };
6855
6927
  const remove = (vnode) => {
6856
6928
  const { type, el, anchor, transition } = vnode;
6857
- if (type === Fragment) {
6858
- if (!!(process.env.NODE_ENV !== "production") && vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
6859
- vnode.children.forEach((child) => {
6860
- if (child.type === Comment) {
6861
- hostRemove(child.el);
6862
- } else {
6863
- remove(child);
6864
- }
6865
- });
6866
- } else {
6867
- removeFragment(el, anchor);
6868
- }
6929
+ const isFragment = type === Fragment;
6930
+ if (isFragment && !transition) {
6931
+ removeFragment(el, anchor);
6869
6932
  return;
6870
6933
  }
6871
6934
  if (type === Static) {
@@ -6875,17 +6938,25 @@ function baseCreateRenderer(options, createHydrationFns) {
6875
6938
  }
6876
6939
  return;
6877
6940
  }
6941
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
6878
6942
  const performRemove = () => {
6879
- hostRemove(el);
6943
+ if (isFragment) {
6944
+ if (hostParentNode(el)) {
6945
+ removeFragment(el, anchor);
6946
+ }
6947
+ } else {
6948
+ hostRemove(el);
6949
+ }
6880
6950
  if (transition && !transition.persisted && transition.afterLeave) {
6881
6951
  transition.afterLeave();
6882
6952
  }
6883
6953
  };
6884
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
6954
+ if (leavingNode && leavingNode.shapeFlag & 1 && transition && !transition.persisted) {
6885
6955
  const { leave, delayLeave } = transition;
6886
- const performLeave = () => leave(el, performRemove);
6956
+ const leavingEl = leavingNode.el;
6957
+ const performLeave = () => leave(leavingEl, performRemove);
6887
6958
  if (delayLeave) {
6888
- delayLeave(vnode.el, performRemove, performLeave);
6959
+ delayLeave(leavingEl, performRemove, performLeave);
6889
6960
  } else {
6890
6961
  performLeave();
6891
6962
  }
@@ -6946,32 +7017,26 @@ function baseCreateRenderer(options, createHydrationFns) {
6946
7017
  const teleportEnd = el && el[TeleportEndKey];
6947
7018
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
6948
7019
  };
6949
- let isFlushing = false;
6950
7020
  const render = (vnode, container, namespace) => {
6951
- let instance;
6952
- if (vnode == null) {
6953
- if (container._vnode) {
6954
- unmount(container._vnode, null, null, true);
6955
- instance = container._vnode.component;
7021
+ const minUid = vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid();
7022
+ flushOnAppMount(() => {
7023
+ if (vnode == null) {
7024
+ if (container._vnode) {
7025
+ unmount(container._vnode, null, null, true);
7026
+ }
7027
+ } else {
7028
+ patch(
7029
+ container._vnode || null,
7030
+ vnode,
7031
+ container,
7032
+ null,
7033
+ null,
7034
+ null,
7035
+ namespace
7036
+ );
6956
7037
  }
6957
- } else {
6958
- patch(
6959
- container._vnode || null,
6960
- vnode,
6961
- container,
6962
- null,
6963
- null,
6964
- null,
6965
- namespace
6966
- );
6967
- }
6968
- container._vnode = vnode;
6969
- if (!isFlushing) {
6970
- isFlushing = true;
6971
- flushPreFlushCbs(instance);
6972
- flushPostFlushCbs();
6973
- isFlushing = false;
6974
- }
7038
+ container._vnode = vnode;
7039
+ }, minUid);
6975
7040
  };
6976
7041
  const internals = {
6977
7042
  p: patch,
@@ -7559,7 +7624,10 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7559
7624
  next() {
7560
7625
  return suspense.activeBranch && next(suspense.activeBranch);
7561
7626
  },
7562
- registerDep(instance, setupRenderEffect, optimized2) {
7627
+ // `namespace` intentionally shadows the boundary's own: the dep must be
7628
+ // mounted with the namespace of the position it was rendered at, which can
7629
+ // differ from the boundary's (e.g. a component nested inside an <svg>).
7630
+ registerDep(instance, setupRenderEffect, optimized2, namespace2) {
7563
7631
  const isInPendingSuspense = !!suspense.pendingBranch;
7564
7632
  if (isInPendingSuspense) {
7565
7633
  suspense.deps++;
@@ -7572,7 +7640,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7572
7640
  return;
7573
7641
  }
7574
7642
  unsetCurrentInstance();
7575
- if (hydratedEl && !instance.scope.active) {
7643
+ if (!instance.scope.active) {
7576
7644
  if (isInPendingSuspense && --suspense.deps === 0) {
7577
7645
  suspense.resolve();
7578
7646
  }
@@ -7599,7 +7667,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7599
7667
  // consider the comment placeholder case.
7600
7668
  hydratedEl ? null : next(instance.subTree),
7601
7669
  suspense,
7602
- namespace,
7670
+ namespace2,
7603
7671
  optimized2
7604
7672
  );
7605
7673
  if (placeholder) {
@@ -8133,6 +8201,9 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8133
8201
 
8134
8202
  const emptyAppContext = createAppContext();
8135
8203
  let uid = 0;
8204
+ function getNextUid() {
8205
+ return uid;
8206
+ }
8136
8207
  function createComponentInstance(vnode, parent, suspense) {
8137
8208
  const type = vnode.type;
8138
8209
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -8819,7 +8890,7 @@ function isMemoSame(cached, memo) {
8819
8890
  return true;
8820
8891
  }
8821
8892
 
8822
- const version = "3.5.43";
8893
+ const version = "3.5.44";
8823
8894
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8824
8895
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8825
8896
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.5.43",
3
+ "version": "3.5.44",
4
4
  "description": "@vue/runtime-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/runtime-core.esm-bundler.js",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
48
48
  "dependencies": {
49
- "@vue/shared": "3.5.43",
50
- "@vue/reactivity": "3.5.43"
49
+ "@vue/shared": "3.5.44",
50
+ "@vue/reactivity": "3.5.44"
51
51
  }
52
52
  }