@vue/compat 3.5.32 → 3.5.34

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/compat v3.5.32
2
+ * @vue/compat v3.5.34
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -354,12 +354,18 @@ class EffectScope {
354
354
  */
355
355
  this.cleanups = [];
356
356
  this._isPaused = false;
357
+ this._warnOnRun = true;
357
358
  this.__v_skip = true;
358
- this.parent = activeEffectScope;
359
359
  if (!detached && activeEffectScope) {
360
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
361
- this
362
- ) - 1;
360
+ if (activeEffectScope.active) {
361
+ this.parent = activeEffectScope;
362
+ this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
363
+ this
364
+ ) - 1;
365
+ } else {
366
+ this._active = false;
367
+ this._warnOnRun = false;
368
+ }
363
369
  }
364
370
  }
365
371
  get active() {
@@ -407,7 +413,7 @@ class EffectScope {
407
413
  } finally {
408
414
  activeEffectScope = currentEffectScope;
409
415
  }
410
- } else {
416
+ } else if (this._warnOnRun) {
411
417
  warn$2(`cannot run an inactive effect scope.`);
412
418
  }
413
419
  }
@@ -427,7 +433,18 @@ class EffectScope {
427
433
  */
428
434
  off() {
429
435
  if (this._on > 0 && --this._on === 0) {
430
- activeEffectScope = this.prevScope;
436
+ if (activeEffectScope === this) {
437
+ activeEffectScope = this.prevScope;
438
+ } else {
439
+ let current = activeEffectScope;
440
+ while (current) {
441
+ if (current.prevScope === this) {
442
+ current.prevScope = this.prevScope;
443
+ break;
444
+ }
445
+ current = current.prevScope;
446
+ }
447
+ }
431
448
  this.prevScope = void 0;
432
449
  }
433
450
  }
@@ -502,8 +519,12 @@ class ReactiveEffect {
502
519
  */
503
520
  this.cleanup = void 0;
504
521
  this.scheduler = void 0;
505
- if (activeEffectScope && activeEffectScope.active) {
506
- activeEffectScope.effects.push(this);
522
+ if (activeEffectScope) {
523
+ if (activeEffectScope.active) {
524
+ activeEffectScope.effects.push(this);
525
+ } else {
526
+ this.flags &= -2;
527
+ }
507
528
  }
508
529
  }
509
530
  pause() {
@@ -3696,7 +3717,7 @@ const TeleportImpl = {
3696
3717
  mc: mountChildren,
3697
3718
  pc: patchChildren,
3698
3719
  pbc: patchBlockChildren,
3699
- o: { insert, querySelector, createText, createComment }
3720
+ o: { insert, querySelector, createText, createComment, parentNode }
3700
3721
  } = internals;
3701
3722
  const disabled = isTeleportDisabled(n2.props);
3702
3723
  let { dynamicChildren } = n2;
@@ -3744,7 +3765,8 @@ const TeleportImpl = {
3744
3765
  if (pendingMounts.get(vnode) !== mountJob) return;
3745
3766
  pendingMounts.delete(vnode);
3746
3767
  if (isTeleportDisabled(vnode.props)) {
3747
- mount(vnode, container, vnode.anchor);
3768
+ const mountContainer = parentNode(vnode.el) || container;
3769
+ mount(vnode, mountContainer, vnode.anchor);
3748
3770
  updateCssVars(vnode, true);
3749
3771
  }
3750
3772
  mountToTarget(vnode);
@@ -3906,7 +3928,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3906
3928
  if (isReorder) {
3907
3929
  insert(el, container, parentAnchor);
3908
3930
  }
3909
- if (!isReorder || isTeleportDisabled(props)) {
3931
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3910
3932
  if (shapeFlag & 16) {
3911
3933
  for (let i = 0; i < children.length; i++) {
3912
3934
  move(
@@ -4080,10 +4102,14 @@ const BaseTransitionImpl = {
4080
4102
  const state = useTransitionState();
4081
4103
  return () => {
4082
4104
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
4083
- if (!children || !children.length) {
4105
+ const child = children && children.length ? findNonCommentChild(children) : (
4106
+ // Keep explicit default-slot conditionals on the same transition path
4107
+ // as regular v-if branches, which render a comment placeholder.
4108
+ instance.subTree ? createCommentVNode() : void 0
4109
+ );
4110
+ if (!child) {
4084
4111
  return;
4085
4112
  }
4086
- const child = findNonCommentChild(children);
4087
4113
  const rawProps = toRaw(props);
4088
4114
  const { mode } = rawProps;
4089
4115
  if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
@@ -7448,7 +7474,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7448
7474
  return vm;
7449
7475
  }
7450
7476
  }
7451
- Vue.version = `2.6.14-compat:${"3.5.32"}`;
7477
+ Vue.version = `2.6.14-compat:${"3.5.34"}`;
7452
7478
  Vue.config = singletonApp.config;
7453
7479
  Vue.use = (plugin, ...options) => {
7454
7480
  if (plugin && isFunction(plugin.install)) {
@@ -9083,7 +9109,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
9083
9109
  const receivedType = toRawType(value);
9084
9110
  const expectedValue = styleValue(value, expectedType);
9085
9111
  const receivedValue = styleValue(value, receivedType);
9086
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
9112
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) {
9087
9113
  message += ` with value ${expectedValue}`;
9088
9114
  }
9089
9115
  message += `, got ${receivedType} `;
@@ -9093,7 +9119,9 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
9093
9119
  return message;
9094
9120
  }
9095
9121
  function styleValue(value, type) {
9096
- if (type === "String") {
9122
+ if (isSymbol(value)) {
9123
+ return value.toString();
9124
+ } else if (type === "String") {
9097
9125
  return `"${value}"`;
9098
9126
  } else if (type === "Number") {
9099
9127
  return `${Number(value)}`;
@@ -9105,8 +9133,11 @@ function isExplicable(type) {
9105
9133
  const explicitTypes = ["string", "number", "boolean"];
9106
9134
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
9107
9135
  }
9108
- function isBoolean(...args) {
9109
- return args.some((elem) => elem.toLowerCase() === "boolean");
9136
+ function isCoercible(...args) {
9137
+ return args.every((elem) => {
9138
+ const value = elem.toLowerCase();
9139
+ return value !== "boolean" && value !== "symbol";
9140
+ });
9110
9141
  }
9111
9142
 
9112
9143
  const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
@@ -11160,13 +11191,14 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11160
11191
  suspense.isHydrating = false;
11161
11192
  } else if (!resume) {
11162
11193
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
11194
+ let hasUpdatedAnchor = false;
11163
11195
  if (delayEnter) {
11164
11196
  activeBranch.transition.afterLeave = () => {
11165
11197
  if (pendingId === suspense.pendingId) {
11166
11198
  move(
11167
11199
  pendingBranch,
11168
11200
  container2,
11169
- anchor === initialAnchor ? next(activeBranch) : anchor,
11201
+ anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
11170
11202
  0
11171
11203
  );
11172
11204
  queuePostFlushCb(effects);
@@ -11179,6 +11211,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11179
11211
  if (activeBranch && !suspense.isFallbackMountPending) {
11180
11212
  if (parentNode(activeBranch.el) === container2) {
11181
11213
  anchor = next(activeBranch);
11214
+ hasUpdatedAnchor = true;
11182
11215
  }
11183
11216
  unmount(activeBranch, parentComponent2, suspense, true);
11184
11217
  if (!delayEnter && isInFallback && vnode2.ssFallback) {
@@ -12564,7 +12597,7 @@ function isMemoSame(cached, memo) {
12564
12597
  return true;
12565
12598
  }
12566
12599
 
12567
- const version = "3.5.32";
12600
+ const version = "3.5.34";
12568
12601
  const warn = warn$1 ;
12569
12602
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12570
12603
  const devtools = devtools$1 ;
@@ -13155,7 +13188,19 @@ function patchStyle(el, prev, next) {
13155
13188
  if (key === "display") {
13156
13189
  hasControlledDisplay = true;
13157
13190
  }
13158
- setStyle(style, key, next[key]);
13191
+ const value = next[key];
13192
+ if (value != null) {
13193
+ if (!shouldPreserveTextareaResizeStyle(
13194
+ el,
13195
+ key,
13196
+ !isString(prev) && prev ? prev[key] : void 0,
13197
+ value
13198
+ )) {
13199
+ setStyle(style, key, value);
13200
+ }
13201
+ } else {
13202
+ setStyle(style, key, "");
13203
+ }
13159
13204
  }
13160
13205
  } else {
13161
13206
  if (isCssString) {
@@ -13228,6 +13273,9 @@ function autoPrefix(style, rawName) {
13228
13273
  }
13229
13274
  return rawName;
13230
13275
  }
13276
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
13277
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
13278
+ }
13231
13279
 
13232
13280
  const xlinkNS = "http://www.w3.org/1999/xlink";
13233
13281
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {