@vue/runtime-dom 3.6.0-beta.10 → 3.6.0-beta.12

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.6.0-beta.10
2
+ * @vue/runtime-dom v3.6.0-beta.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -451,7 +451,10 @@ function patchStyle(el, prev, next) {
451
451
  }
452
452
  for (const key in next) {
453
453
  if (key === "display") hasControlledDisplay = true;
454
- setStyle(style, key, next[key]);
454
+ const value = next[key];
455
+ if (value != null) {
456
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
457
+ } else setStyle(style, key, "");
455
458
  }
456
459
  } else if (isCssString) {
457
460
  if (prev !== next) {
@@ -501,6 +504,14 @@ function autoPrefix(style, rawName) {
501
504
  }
502
505
  return rawName;
503
506
  }
507
+ /**
508
+ * Browsers update textarea width/height directly during native resize.
509
+ * Only special-case this common textarea path for now; other resize scenarios
510
+ * still follow normal vnode style patching.
511
+ */
512
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
513
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
514
+ }
504
515
  //#endregion
505
516
  //#region packages/runtime-dom/src/modules/attrs.ts
506
517
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -935,7 +946,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
935
946
  replacementNodes.push(child);
936
947
  }
937
948
  parent.removeChild(o);
938
- slotReplacements.set(o, replacementNodes);
949
+ slotReplacements.set(o, {
950
+ nodes: replacementNodes,
951
+ usedFallback: !content
952
+ });
939
953
  }
940
954
  this._updateSlotNodes(slotReplacements);
941
955
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.10
2
+ * @vue/runtime-dom v3.6.0-beta.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -433,6 +433,13 @@ var VueRuntimeDOM = (function(exports) {
433
433
  const notifyBuffer = [];
434
434
  let batchDepth = 0;
435
435
  let activeSub = void 0;
436
+ let runDepth = 0;
437
+ function incRunDepth() {
438
+ ++runDepth;
439
+ }
440
+ function decRunDepth() {
441
+ --runDepth;
442
+ }
436
443
  let globalVersion = 0;
437
444
  let notifyIndex = 0;
438
445
  let notifyBufferLength = 0;
@@ -506,8 +513,10 @@ var VueRuntimeDOM = (function(exports) {
506
513
  const sub = link.sub;
507
514
  let flags = sub.flags;
508
515
  if (flags & 3) {
509
- if (!(flags & 60)) sub.flags = flags | 32;
510
- else if (!(flags & 12)) flags = 0;
516
+ if (!(flags & 60)) {
517
+ sub.flags = flags | 32;
518
+ if (runDepth) sub.flags |= 8;
519
+ } else if (!(flags & 12)) flags = 0;
511
520
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
512
521
  else if (!(flags & 48) && isValidLink(link, sub)) {
513
522
  sub.flags = flags | 40;
@@ -576,13 +585,13 @@ var VueRuntimeDOM = (function(exports) {
576
585
  let dirty = false;
577
586
  if (sub.flags & 16) dirty = true;
578
587
  else if ((depFlags & 17) === 17) {
588
+ const subs = dep.subs;
579
589
  if (dep.update()) {
580
- const subs = dep.subs;
581
590
  if (subs.nextSub !== void 0) shallowPropagate(subs);
582
591
  dirty = true;
583
592
  }
584
593
  } else if ((depFlags & 33) === 33) {
585
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
594
+ stack = {
586
595
  value: link,
587
596
  prev: stack
588
597
  };
@@ -597,15 +606,12 @@ var VueRuntimeDOM = (function(exports) {
597
606
  }
598
607
  while (checkDepth) {
599
608
  --checkDepth;
600
- const firstSub = sub.subs;
601
- const hasMultipleSubs = firstSub.nextSub !== void 0;
602
- if (hasMultipleSubs) {
603
- link = stack.value;
604
- stack = stack.prev;
605
- } else link = firstSub;
609
+ link = stack.value;
610
+ stack = stack.prev;
606
611
  if (dirty) {
612
+ const subs = sub.subs;
607
613
  if (sub.update()) {
608
- if (hasMultipleSubs) shallowPropagate(firstSub);
614
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
609
615
  sub = link.sub;
610
616
  continue;
611
617
  }
@@ -617,7 +623,7 @@ var VueRuntimeDOM = (function(exports) {
617
623
  }
618
624
  dirty = false;
619
625
  }
620
- return dirty;
626
+ return dirty && !!sub.flags;
621
627
  } while (true);
622
628
  }
623
629
  function shallowPropagate(link) {
@@ -1769,9 +1775,11 @@ var VueRuntimeDOM = (function(exports) {
1769
1775
  if (!this.active) return this.fn();
1770
1776
  cleanup(this);
1771
1777
  const prevSub = startTracking(this);
1778
+ incRunDepth();
1772
1779
  try {
1773
1780
  return this.fn();
1774
1781
  } finally {
1782
+ decRunDepth();
1775
1783
  endTracking(this, prevSub);
1776
1784
  const flags = this.flags;
1777
1785
  if ((flags & 136) === 136) {
@@ -3063,7 +3071,7 @@ var VueRuntimeDOM = (function(exports) {
3063
3071
  name: "Teleport",
3064
3072
  __isTeleport: true,
3065
3073
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
3066
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
3074
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3067
3075
  const disabled = isTeleportDisabled(n2.props);
3068
3076
  let { dynamicChildren } = n2;
3069
3077
  if (isHmrUpdating) {
@@ -3092,7 +3100,7 @@ var VueRuntimeDOM = (function(exports) {
3092
3100
  if (pendingMounts.get(vnode) !== mountJob) return;
3093
3101
  pendingMounts.delete(vnode);
3094
3102
  if (isTeleportDisabled(vnode.props)) {
3095
- mount(vnode, container, vnode.anchor);
3103
+ mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
3096
3104
  updateCssVars(vnode, true);
3097
3105
  }
3098
3106
  mountToTarget(vnode);
@@ -3172,7 +3180,7 @@ var VueRuntimeDOM = (function(exports) {
3172
3180
  const { el, anchor, shapeFlag, children, props } = vnode;
3173
3181
  const isReorder = moveType === 2;
3174
3182
  if (isReorder) insert(el, container, parentAnchor);
3175
- if (!isReorder || isTeleportDisabled(props)) {
3183
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3176
3184
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3177
3185
  }
3178
3186
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3297,8 +3305,8 @@ var VueRuntimeDOM = (function(exports) {
3297
3305
  const state = useTransitionState();
3298
3306
  return () => {
3299
3307
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3300
- if (!children || !children.length) return;
3301
- const child = findNonCommentChild(children);
3308
+ const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3309
+ if (!child) return;
3302
3310
  const rawProps = /* @__PURE__ */ toRaw(props);
3303
3311
  const { mode } = rawProps;
3304
3312
  checkTransitionMode(mode);
@@ -4652,6 +4660,7 @@ var VueRuntimeDOM = (function(exports) {
4652
4660
  */
4653
4661
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4654
4662
  let slot = slots[name];
4663
+ if (fallback) fallback.__vdom = true;
4655
4664
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
4656
4665
  if (vaporSlot) {
4657
4666
  const ret = (openBlock(), createBlock(VaporSlot, props));
@@ -4690,9 +4699,7 @@ var VueRuntimeDOM = (function(exports) {
4690
4699
  }
4691
4700
  function ensureVaporSlotFallback(vnodes, fallback) {
4692
4701
  let vaporSlot;
4693
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
4694
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
4695
- }
4702
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
4696
4703
  }
4697
4704
  //#endregion
4698
4705
  //#region packages/runtime-core/src/helpers/toHandlers.ts
@@ -5064,9 +5071,14 @@ var VueRuntimeDOM = (function(exports) {
5064
5071
  setCurrentInstance(null, void 0);
5065
5072
  if (inSSRSetup) setInSSRSetupState(false);
5066
5073
  const restore = () => {
5074
+ const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5067
5075
  setCurrentInstance(ctx);
5068
5076
  if (inSSRSetup) setInSSRSetupState(true);
5069
- return restoreAsyncContext && restoreAsyncContext();
5077
+ const reset = restoreAsyncContext && restoreAsyncContext();
5078
+ return () => {
5079
+ if (reset) reset();
5080
+ if (resetStoppedScope) resetStoppedScope.reset();
5081
+ };
5070
5082
  };
5071
5083
  const cleanup = () => {
5072
5084
  setCurrentInstance(null, void 0);
@@ -6096,7 +6108,7 @@ var VueRuntimeDOM = (function(exports) {
6096
6108
  const receivedType = toRawType(value);
6097
6109
  const expectedValue = styleValue(value, expectedType);
6098
6110
  const receivedValue = styleValue(value, receivedType);
6099
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6111
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6100
6112
  message += `, got ${receivedType} `;
6101
6113
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
6102
6114
  return message;
@@ -6105,7 +6117,8 @@ var VueRuntimeDOM = (function(exports) {
6105
6117
  * dev only
6106
6118
  */
6107
6119
  function styleValue(value, type) {
6108
- if (type === "String") return `"${value}"`;
6120
+ if (isSymbol(value)) return value.toString();
6121
+ else if (type === "String") return `"${value}"`;
6109
6122
  else if (type === "Number") return `${Number(value)}`;
6110
6123
  else return `${value}`;
6111
6124
  }
@@ -6122,8 +6135,11 @@ var VueRuntimeDOM = (function(exports) {
6122
6135
  /**
6123
6136
  * dev only
6124
6137
  */
6125
- function isBoolean(...args) {
6126
- return args.some((elem) => elem.toLowerCase() === "boolean");
6138
+ function isCoercible(...args) {
6139
+ return args.every((elem) => {
6140
+ const value = elem.toLowerCase();
6141
+ return value !== "boolean" && value !== "symbol";
6142
+ });
6127
6143
  }
6128
6144
  //#endregion
6129
6145
  //#region packages/runtime-core/src/componentSlots.ts
@@ -7306,15 +7322,19 @@ var VueRuntimeDOM = (function(exports) {
7306
7322
  if (suspense.isHydrating) suspense.isHydrating = false;
7307
7323
  else if (!resume) {
7308
7324
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
7325
+ let hasUpdatedAnchor = false;
7309
7326
  if (delayEnter) activeBranch.transition.afterLeave = () => {
7310
7327
  if (pendingId === suspense.pendingId) {
7311
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7328
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7312
7329
  queuePostFlushCb(effects);
7313
7330
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
7314
7331
  }
7315
7332
  };
7316
7333
  if (activeBranch && !suspense.isFallbackMountPending) {
7317
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
7334
+ if (parentNode(activeBranch.el) === container) {
7335
+ anchor = next(activeBranch);
7336
+ hasUpdatedAnchor = true;
7337
+ }
7318
7338
  unmount(activeBranch, parentComponent, suspense, true);
7319
7339
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
7320
7340
  }
@@ -7668,11 +7688,29 @@ var VueRuntimeDOM = (function(exports) {
7668
7688
  el: vnode.el,
7669
7689
  anchor: vnode.anchor,
7670
7690
  ctx: vnode.ctx,
7671
- ce: vnode.ce
7691
+ ce: vnode.ce,
7692
+ vi: vnode.vi,
7693
+ vs: cloneVaporSlotMeta(vnode),
7694
+ vb: vnode.vb
7672
7695
  };
7673
7696
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
7674
7697
  return cloned;
7675
7698
  }
7699
+ function cloneVaporSlotMeta(vnode) {
7700
+ const vaporSlot = vnode.vs;
7701
+ if (!vaporSlot) return vaporSlot;
7702
+ const cloned = {
7703
+ slot: vaporSlot.slot,
7704
+ fallback: vaporSlot.fallback,
7705
+ outletFallback: vaporSlot.outletFallback
7706
+ };
7707
+ if (vnode.el) {
7708
+ cloned.state = vaporSlot.state;
7709
+ cloned.ref = vaporSlot.ref;
7710
+ cloned.scope = vaporSlot.scope;
7711
+ }
7712
+ return cloned;
7713
+ }
7676
7714
  /**
7677
7715
  * Dev only, for HMR of hoisted vnodes reused in v-for
7678
7716
  * https://github.com/vitejs/vite/issues/2022
@@ -8328,7 +8366,7 @@ var VueRuntimeDOM = (function(exports) {
8328
8366
  }
8329
8367
  //#endregion
8330
8368
  //#region packages/runtime-core/src/index.ts
8331
- const version = "3.6.0-beta.10";
8369
+ const version = "3.6.0-beta.12";
8332
8370
  const warn = warn$1;
8333
8371
  /**
8334
8372
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8791,7 +8829,10 @@ var VueRuntimeDOM = (function(exports) {
8791
8829
  }
8792
8830
  for (const key in next) {
8793
8831
  if (key === "display") hasControlledDisplay = true;
8794
- setStyle(style, key, next[key]);
8832
+ const value = next[key];
8833
+ if (value != null) {
8834
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
8835
+ } else setStyle(style, key, "");
8795
8836
  }
8796
8837
  } else if (isCssString) {
8797
8838
  if (prev !== next) {
@@ -8839,6 +8880,14 @@ var VueRuntimeDOM = (function(exports) {
8839
8880
  }
8840
8881
  return rawName;
8841
8882
  }
8883
+ /**
8884
+ * Browsers update textarea width/height directly during native resize.
8885
+ * Only special-case this common textarea path for now; other resize scenarios
8886
+ * still follow normal vnode style patching.
8887
+ */
8888
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
8889
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
8890
+ }
8842
8891
  //#endregion
8843
8892
  //#region packages/runtime-dom/src/modules/attrs.ts
8844
8893
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -9273,7 +9322,10 @@ var VueRuntimeDOM = (function(exports) {
9273
9322
  replacementNodes.push(child);
9274
9323
  }
9275
9324
  parent.removeChild(o);
9276
- slotReplacements.set(o, replacementNodes);
9325
+ slotReplacements.set(o, {
9326
+ nodes: replacementNodes,
9327
+ usedFallback: !content
9328
+ });
9277
9329
  }
9278
9330
  this._updateSlotNodes(slotReplacements);
9279
9331
  }