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

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.11
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.11
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -3063,7 +3063,7 @@ var VueRuntimeDOM = (function(exports) {
3063
3063
  name: "Teleport",
3064
3064
  __isTeleport: true,
3065
3065
  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;
3066
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3067
3067
  const disabled = isTeleportDisabled(n2.props);
3068
3068
  let { dynamicChildren } = n2;
3069
3069
  if (isHmrUpdating) {
@@ -3092,7 +3092,7 @@ var VueRuntimeDOM = (function(exports) {
3092
3092
  if (pendingMounts.get(vnode) !== mountJob) return;
3093
3093
  pendingMounts.delete(vnode);
3094
3094
  if (isTeleportDisabled(vnode.props)) {
3095
- mount(vnode, container, vnode.anchor);
3095
+ mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
3096
3096
  updateCssVars(vnode, true);
3097
3097
  }
3098
3098
  mountToTarget(vnode);
@@ -3172,7 +3172,7 @@ var VueRuntimeDOM = (function(exports) {
3172
3172
  const { el, anchor, shapeFlag, children, props } = vnode;
3173
3173
  const isReorder = moveType === 2;
3174
3174
  if (isReorder) insert(el, container, parentAnchor);
3175
- if (!isReorder || isTeleportDisabled(props)) {
3175
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3176
3176
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3177
3177
  }
3178
3178
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3297,8 +3297,8 @@ var VueRuntimeDOM = (function(exports) {
3297
3297
  const state = useTransitionState();
3298
3298
  return () => {
3299
3299
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3300
- if (!children || !children.length) return;
3301
- const child = findNonCommentChild(children);
3300
+ const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3301
+ if (!child) return;
3302
3302
  const rawProps = /* @__PURE__ */ toRaw(props);
3303
3303
  const { mode } = rawProps;
3304
3304
  checkTransitionMode(mode);
@@ -4652,6 +4652,7 @@ var VueRuntimeDOM = (function(exports) {
4652
4652
  */
4653
4653
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4654
4654
  let slot = slots[name];
4655
+ if (fallback) fallback.__vdom = true;
4655
4656
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
4656
4657
  if (vaporSlot) {
4657
4658
  const ret = (openBlock(), createBlock(VaporSlot, props));
@@ -4690,9 +4691,7 @@ var VueRuntimeDOM = (function(exports) {
4690
4691
  }
4691
4692
  function ensureVaporSlotFallback(vnodes, fallback) {
4692
4693
  let vaporSlot;
4693
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
4694
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
4695
- }
4694
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
4696
4695
  }
4697
4696
  //#endregion
4698
4697
  //#region packages/runtime-core/src/helpers/toHandlers.ts
@@ -5064,9 +5063,14 @@ var VueRuntimeDOM = (function(exports) {
5064
5063
  setCurrentInstance(null, void 0);
5065
5064
  if (inSSRSetup) setInSSRSetupState(false);
5066
5065
  const restore = () => {
5066
+ const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5067
5067
  setCurrentInstance(ctx);
5068
5068
  if (inSSRSetup) setInSSRSetupState(true);
5069
- return restoreAsyncContext && restoreAsyncContext();
5069
+ const reset = restoreAsyncContext && restoreAsyncContext();
5070
+ return () => {
5071
+ if (reset) reset();
5072
+ if (resetStoppedScope) resetStoppedScope.reset();
5073
+ };
5070
5074
  };
5071
5075
  const cleanup = () => {
5072
5076
  setCurrentInstance(null, void 0);
@@ -6096,7 +6100,7 @@ var VueRuntimeDOM = (function(exports) {
6096
6100
  const receivedType = toRawType(value);
6097
6101
  const expectedValue = styleValue(value, expectedType);
6098
6102
  const receivedValue = styleValue(value, receivedType);
6099
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6103
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6100
6104
  message += `, got ${receivedType} `;
6101
6105
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
6102
6106
  return message;
@@ -6105,7 +6109,8 @@ var VueRuntimeDOM = (function(exports) {
6105
6109
  * dev only
6106
6110
  */
6107
6111
  function styleValue(value, type) {
6108
- if (type === "String") return `"${value}"`;
6112
+ if (isSymbol(value)) return value.toString();
6113
+ else if (type === "String") return `"${value}"`;
6109
6114
  else if (type === "Number") return `${Number(value)}`;
6110
6115
  else return `${value}`;
6111
6116
  }
@@ -6122,8 +6127,11 @@ var VueRuntimeDOM = (function(exports) {
6122
6127
  /**
6123
6128
  * dev only
6124
6129
  */
6125
- function isBoolean(...args) {
6126
- return args.some((elem) => elem.toLowerCase() === "boolean");
6130
+ function isCoercible(...args) {
6131
+ return args.every((elem) => {
6132
+ const value = elem.toLowerCase();
6133
+ return value !== "boolean" && value !== "symbol";
6134
+ });
6127
6135
  }
6128
6136
  //#endregion
6129
6137
  //#region packages/runtime-core/src/componentSlots.ts
@@ -7306,15 +7314,19 @@ var VueRuntimeDOM = (function(exports) {
7306
7314
  if (suspense.isHydrating) suspense.isHydrating = false;
7307
7315
  else if (!resume) {
7308
7316
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
7317
+ let hasUpdatedAnchor = false;
7309
7318
  if (delayEnter) activeBranch.transition.afterLeave = () => {
7310
7319
  if (pendingId === suspense.pendingId) {
7311
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7320
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7312
7321
  queuePostFlushCb(effects);
7313
7322
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
7314
7323
  }
7315
7324
  };
7316
7325
  if (activeBranch && !suspense.isFallbackMountPending) {
7317
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
7326
+ if (parentNode(activeBranch.el) === container) {
7327
+ anchor = next(activeBranch);
7328
+ hasUpdatedAnchor = true;
7329
+ }
7318
7330
  unmount(activeBranch, parentComponent, suspense, true);
7319
7331
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
7320
7332
  }
@@ -7668,11 +7680,29 @@ var VueRuntimeDOM = (function(exports) {
7668
7680
  el: vnode.el,
7669
7681
  anchor: vnode.anchor,
7670
7682
  ctx: vnode.ctx,
7671
- ce: vnode.ce
7683
+ ce: vnode.ce,
7684
+ vi: vnode.vi,
7685
+ vs: cloneVaporSlotMeta(vnode),
7686
+ vb: vnode.vb
7672
7687
  };
7673
7688
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
7674
7689
  return cloned;
7675
7690
  }
7691
+ function cloneVaporSlotMeta(vnode) {
7692
+ const vaporSlot = vnode.vs;
7693
+ if (!vaporSlot) return vaporSlot;
7694
+ const cloned = {
7695
+ slot: vaporSlot.slot,
7696
+ fallback: vaporSlot.fallback,
7697
+ outletFallback: vaporSlot.outletFallback
7698
+ };
7699
+ if (vnode.el) {
7700
+ cloned.state = vaporSlot.state;
7701
+ cloned.ref = vaporSlot.ref;
7702
+ cloned.scope = vaporSlot.scope;
7703
+ }
7704
+ return cloned;
7705
+ }
7676
7706
  /**
7677
7707
  * Dev only, for HMR of hoisted vnodes reused in v-for
7678
7708
  * https://github.com/vitejs/vite/issues/2022
@@ -8328,7 +8358,7 @@ var VueRuntimeDOM = (function(exports) {
8328
8358
  }
8329
8359
  //#endregion
8330
8360
  //#region packages/runtime-core/src/index.ts
8331
- const version = "3.6.0-beta.10";
8361
+ const version = "3.6.0-beta.11";
8332
8362
  const warn = warn$1;
8333
8363
  /**
8334
8364
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8791,7 +8821,10 @@ var VueRuntimeDOM = (function(exports) {
8791
8821
  }
8792
8822
  for (const key in next) {
8793
8823
  if (key === "display") hasControlledDisplay = true;
8794
- setStyle(style, key, next[key]);
8824
+ const value = next[key];
8825
+ if (value != null) {
8826
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
8827
+ } else setStyle(style, key, "");
8795
8828
  }
8796
8829
  } else if (isCssString) {
8797
8830
  if (prev !== next) {
@@ -8839,6 +8872,14 @@ var VueRuntimeDOM = (function(exports) {
8839
8872
  }
8840
8873
  return rawName;
8841
8874
  }
8875
+ /**
8876
+ * Browsers update textarea width/height directly during native resize.
8877
+ * Only special-case this common textarea path for now; other resize scenarios
8878
+ * still follow normal vnode style patching.
8879
+ */
8880
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
8881
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
8882
+ }
8842
8883
  //#endregion
8843
8884
  //#region packages/runtime-dom/src/modules/attrs.ts
8844
8885
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -9273,7 +9314,10 @@ var VueRuntimeDOM = (function(exports) {
9273
9314
  replacementNodes.push(child);
9274
9315
  }
9275
9316
  parent.removeChild(o);
9276
- slotReplacements.set(o, replacementNodes);
9317
+ slotReplacements.set(o, {
9318
+ nodes: replacementNodes,
9319
+ usedFallback: !content
9320
+ });
9277
9321
  }
9278
9322
  this._updateSlotNodes(slotReplacements);
9279
9323
  }