vue 3.5.12 → 3.5.13

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 v3.5.12
2
+ * vue v3.5.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -144,10 +144,9 @@ var Vue = (function (exports) {
144
144
  return ret;
145
145
  }
146
146
  function stringifyStyle(styles) {
147
+ if (!styles) return "";
148
+ if (isString(styles)) return styles;
147
149
  let ret = "";
148
- if (!styles || isString(styles)) {
149
- return ret;
150
- }
151
150
  for (const key in styles) {
152
151
  const value = styles[key];
153
152
  if (isString(value) || typeof value === "number") {
@@ -408,17 +407,21 @@ var Vue = (function (exports) {
408
407
  }
409
408
  stop(fromParent) {
410
409
  if (this._active) {
410
+ this._active = false;
411
411
  let i, l;
412
412
  for (i = 0, l = this.effects.length; i < l; i++) {
413
413
  this.effects[i].stop();
414
414
  }
415
+ this.effects.length = 0;
415
416
  for (i = 0, l = this.cleanups.length; i < l; i++) {
416
417
  this.cleanups[i]();
417
418
  }
419
+ this.cleanups.length = 0;
418
420
  if (this.scopes) {
419
421
  for (i = 0, l = this.scopes.length; i < l; i++) {
420
422
  this.scopes[i].stop(true);
421
423
  }
424
+ this.scopes.length = 0;
422
425
  }
423
426
  if (!this.detached && this.parent && !fromParent) {
424
427
  const last = this.parent.scopes.pop();
@@ -428,7 +431,6 @@ var Vue = (function (exports) {
428
431
  }
429
432
  }
430
433
  this.parent = void 0;
431
- this._active = false;
432
434
  }
433
435
  }
434
436
  }
@@ -1194,6 +1196,7 @@ var Vue = (function (exports) {
1194
1196
  this._isShallow = _isShallow;
1195
1197
  }
1196
1198
  get(target, key, receiver) {
1199
+ if (key === "__v_skip") return target["__v_skip"];
1197
1200
  const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
1198
1201
  if (key === "__v_isReactive") {
1199
1202
  return !isReadonly2;
@@ -2030,7 +2033,7 @@ var Vue = (function (exports) {
2030
2033
  const scope = getCurrentScope();
2031
2034
  const watchHandle = () => {
2032
2035
  effect.stop();
2033
- if (scope) {
2036
+ if (scope && scope.active) {
2034
2037
  remove(scope.effects, effect);
2035
2038
  }
2036
2039
  };
@@ -2990,11 +2993,32 @@ var Vue = (function (exports) {
2990
2993
  updateCssVars(n2, true);
2991
2994
  }
2992
2995
  if (isTeleportDeferred(n2.props)) {
2993
- queuePostRenderEffect(mountToTarget, parentSuspense);
2996
+ queuePostRenderEffect(() => {
2997
+ mountToTarget();
2998
+ n2.el.__isMounted = true;
2999
+ }, parentSuspense);
2994
3000
  } else {
2995
3001
  mountToTarget();
2996
3002
  }
2997
3003
  } else {
3004
+ if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
3005
+ queuePostRenderEffect(() => {
3006
+ TeleportImpl.process(
3007
+ n1,
3008
+ n2,
3009
+ container,
3010
+ anchor,
3011
+ parentComponent,
3012
+ parentSuspense,
3013
+ namespace,
3014
+ slotScopeIds,
3015
+ optimized,
3016
+ internals
3017
+ );
3018
+ delete n1.el.__isMounted;
3019
+ }, parentSuspense);
3020
+ return;
3021
+ }
2998
3022
  n2.el = n1.el;
2999
3023
  n2.targetStart = n1.targetStart;
3000
3024
  const mainAnchor = n2.anchor = n1.anchor;
@@ -3300,10 +3324,9 @@ var Vue = (function (exports) {
3300
3324
  if (innerChild.type !== Comment) {
3301
3325
  setTransitionHooks(innerChild, enterHooks);
3302
3326
  }
3303
- const oldChild = instance.subTree;
3304
- const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3327
+ let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3305
3328
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3306
- const leavingHooks = resolveTransitionHooks(
3329
+ let leavingHooks = resolveTransitionHooks(
3307
3330
  oldInnerChild,
3308
3331
  rawProps,
3309
3332
  state,
@@ -3318,6 +3341,7 @@ var Vue = (function (exports) {
3318
3341
  instance.update();
3319
3342
  }
3320
3343
  delete leavingHooks.afterLeave;
3344
+ oldInnerChild = void 0;
3321
3345
  };
3322
3346
  return emptyPlaceholder(child);
3323
3347
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3331,10 +3355,19 @@ var Vue = (function (exports) {
3331
3355
  earlyRemove();
3332
3356
  el[leaveCbKey] = void 0;
3333
3357
  delete enterHooks.delayedLeave;
3358
+ oldInnerChild = void 0;
3359
+ };
3360
+ enterHooks.delayedLeave = () => {
3361
+ delayedLeave();
3362
+ delete enterHooks.delayedLeave;
3363
+ oldInnerChild = void 0;
3334
3364
  };
3335
- enterHooks.delayedLeave = delayedLeave;
3336
3365
  };
3366
+ } else {
3367
+ oldInnerChild = void 0;
3337
3368
  }
3369
+ } else if (oldInnerChild) {
3370
+ oldInnerChild = void 0;
3338
3371
  }
3339
3372
  return child;
3340
3373
  };
@@ -3639,6 +3672,9 @@ var Vue = (function (exports) {
3639
3672
  return;
3640
3673
  }
3641
3674
  if (isAsyncWrapper(vnode) && !isUnmount) {
3675
+ if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
3676
+ setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
3677
+ }
3642
3678
  return;
3643
3679
  }
3644
3680
  const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
@@ -3903,7 +3939,7 @@ var Vue = (function (exports) {
3903
3939
  getContainerType(container),
3904
3940
  optimized
3905
3941
  );
3906
- if (isAsyncWrapper(vnode)) {
3942
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
3907
3943
  let subTree;
3908
3944
  if (isFragmentStart) {
3909
3945
  subTree = createVNode(Fragment);
@@ -4172,6 +4208,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4172
4208
  getContainerType(container),
4173
4209
  slotScopeIds
4174
4210
  );
4211
+ if (parentComponent) {
4212
+ parentComponent.vnode.el = vnode.el;
4213
+ updateHOCHostEl(parentComponent, vnode.el);
4214
+ }
4175
4215
  return next;
4176
4216
  };
4177
4217
  const locateClosingAnchor = (node, open = "[", close = "]") => {
@@ -8574,7 +8614,7 @@ If you want to remount the same app, move your app creation logic into a factory
8574
8614
  }
8575
8615
  if (extraAttrs.length) {
8576
8616
  warn$1(
8577
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
8617
+ `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
8578
8618
  );
8579
8619
  }
8580
8620
  if (eventAttrs.length) {
@@ -9357,9 +9397,9 @@ If you want to remount the same app, move your app creation logic into a factory
9357
9397
  currentBlock = blockStack[blockStack.length - 1] || null;
9358
9398
  }
9359
9399
  let isBlockTreeEnabled = 1;
9360
- function setBlockTracking(value) {
9400
+ function setBlockTracking(value, inVOnce = false) {
9361
9401
  isBlockTreeEnabled += value;
9362
- if (value < 0 && currentBlock) {
9402
+ if (value < 0 && currentBlock && inVOnce) {
9363
9403
  currentBlock.hasOnce = true;
9364
9404
  }
9365
9405
  }
@@ -10369,7 +10409,7 @@ Component that was made reactive: `,
10369
10409
  return true;
10370
10410
  }
10371
10411
 
10372
- const version = "3.5.12";
10412
+ const version = "3.5.13";
10373
10413
  const warn = warn$1 ;
10374
10414
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10375
10415
  const devtools = devtools$1 ;
@@ -10541,7 +10581,8 @@ Component that was made reactive: `,
10541
10581
  onAppear = onEnter,
10542
10582
  onAppearCancelled = onEnterCancelled
10543
10583
  } = baseProps;
10544
- const finishEnter = (el, isAppear, done) => {
10584
+ const finishEnter = (el, isAppear, done, isCancelled) => {
10585
+ el._enterCancelled = isCancelled;
10545
10586
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
10546
10587
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
10547
10588
  done && done();
@@ -10584,8 +10625,13 @@ Component that was made reactive: `,
10584
10625
  el._isLeaving = true;
10585
10626
  const resolve = () => finishLeave(el, done);
10586
10627
  addTransitionClass(el, leaveFromClass);
10587
- addTransitionClass(el, leaveActiveClass);
10588
- forceReflow();
10628
+ if (!el._enterCancelled) {
10629
+ forceReflow();
10630
+ addTransitionClass(el, leaveActiveClass);
10631
+ } else {
10632
+ addTransitionClass(el, leaveActiveClass);
10633
+ forceReflow();
10634
+ }
10589
10635
  nextFrame(() => {
10590
10636
  if (!el._isLeaving) {
10591
10637
  return;
@@ -10599,11 +10645,11 @@ Component that was made reactive: `,
10599
10645
  callHook(onLeave, [el, resolve]);
10600
10646
  },
10601
10647
  onEnterCancelled(el) {
10602
- finishEnter(el, false);
10648
+ finishEnter(el, false, void 0, true);
10603
10649
  callHook(onEnterCancelled, [el]);
10604
10650
  },
10605
10651
  onAppearCancelled(el) {
10606
- finishEnter(el, true);
10652
+ finishEnter(el, true, void 0, true);
10607
10653
  callHook(onAppearCancelled, [el]);
10608
10654
  },
10609
10655
  onLeaveCancelled(el) {
@@ -10816,10 +10862,11 @@ Component that was made reactive: `,
10816
10862
  }
10817
10863
  updateTeleports(vars);
10818
10864
  };
10819
- onBeforeMount(() => {
10820
- watchPostEffect(setVars);
10865
+ onBeforeUpdate(() => {
10866
+ queuePostFlushCb(setVars);
10821
10867
  });
10822
10868
  onMounted(() => {
10869
+ watch(setVars, NOOP, { flush: "post" });
10823
10870
  const ob = new MutationObserver(setVars);
10824
10871
  ob.observe(instance.subTree.el.parentNode, { childList: true });
10825
10872
  onUnmounted(() => ob.disconnect());
@@ -11426,6 +11473,8 @@ Expected function or array of functions, received type ${typeof value}.`
11426
11473
  this._update();
11427
11474
  }
11428
11475
  if (shouldReflect) {
11476
+ const ob = this._ob;
11477
+ ob && ob.disconnect();
11429
11478
  if (val === true) {
11430
11479
  this.setAttribute(hyphenate(key), "");
11431
11480
  } else if (typeof val === "string" || typeof val === "number") {
@@ -11433,6 +11482,7 @@ Expected function or array of functions, received type ${typeof value}.`
11433
11482
  } else if (!val) {
11434
11483
  this.removeAttribute(hyphenate(key));
11435
11484
  }
11485
+ ob && ob.observe(this, { attributes: true });
11436
11486
  }
11437
11487
  }
11438
11488
  }