@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
  **/
@@ -377,7 +377,10 @@ function patchStyle(el, prev, next) {
377
377
  }
378
378
  for (const key in next) {
379
379
  if (key === "display") hasControlledDisplay = true;
380
- setStyle(style, key, next[key]);
380
+ const value = next[key];
381
+ if (value != null) {
382
+ if (!shouldPreserveTextareaResizeStyle(el, key, !(0, _vue_shared.isString)(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
383
+ } else setStyle(style, key, "");
381
384
  }
382
385
  } else if (isCssString) {
383
386
  if (prev !== next) {
@@ -425,6 +428,14 @@ function autoPrefix(style, rawName) {
425
428
  }
426
429
  return rawName;
427
430
  }
431
+ /**
432
+ * Browsers update textarea width/height directly during native resize.
433
+ * Only special-case this common textarea path for now; other resize scenarios
434
+ * still follow normal vnode style patching.
435
+ */
436
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
437
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && (0, _vue_shared.isString)(next) && prev === next;
438
+ }
428
439
  //#endregion
429
440
  //#region packages/runtime-dom/src/modules/attrs.ts
430
441
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -859,7 +870,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
859
870
  replacementNodes.push(child);
860
871
  }
861
872
  parent.removeChild(o);
862
- slotReplacements.set(o, replacementNodes);
873
+ slotReplacements.set(o, {
874
+ nodes: replacementNodes,
875
+ usedFallback: !content
876
+ });
863
877
  }
864
878
  this._updateSlotNodes(slotReplacements);
865
879
  }
@@ -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
  **/
@@ -373,7 +373,10 @@ function patchStyle(el, prev, next) {
373
373
  }
374
374
  for (const key in next) {
375
375
  if (key === "display") hasControlledDisplay = true;
376
- setStyle(style, key, next[key]);
376
+ const value = next[key];
377
+ if (value != null) {
378
+ if (!shouldPreserveTextareaResizeStyle(el, key, !(0, _vue_shared.isString)(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
379
+ } else setStyle(style, key, "");
377
380
  }
378
381
  } else if (isCssString) {
379
382
  if (prev !== next) {
@@ -419,6 +422,14 @@ function autoPrefix(style, rawName) {
419
422
  }
420
423
  return rawName;
421
424
  }
425
+ /**
426
+ * Browsers update textarea width/height directly during native resize.
427
+ * Only special-case this common textarea path for now; other resize scenarios
428
+ * still follow normal vnode style patching.
429
+ */
430
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
431
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && (0, _vue_shared.isString)(next) && prev === next;
432
+ }
422
433
  //#endregion
423
434
  //#region packages/runtime-dom/src/modules/attrs.ts
424
435
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -826,7 +837,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
826
837
  replacementNodes.push(child);
827
838
  }
828
839
  parent.removeChild(o);
829
- slotReplacements.set(o, replacementNodes);
840
+ slotReplacements.set(o, {
841
+ nodes: replacementNodes,
842
+ usedFallback: !content
843
+ });
830
844
  }
831
845
  this._updateSlotNodes(slotReplacements);
832
846
  }
@@ -1371,7 +1371,10 @@ export declare abstract class VueElementBase<E = Element, C = Component, Def ext
1371
1371
  protected abstract _mount(def: Def): void;
1372
1372
  protected abstract _update(): void;
1373
1373
  protected abstract _unmount(): void;
1374
- protected abstract _updateSlotNodes(slot: Map<Node, Node[]>): void;
1374
+ protected abstract _updateSlotNodes(slot: Map<Node, {
1375
+ nodes: Node[];
1376
+ usedFallback: boolean;
1377
+ }>): void;
1375
1378
  constructor(def: Def, props: Record<string, any> | undefined, createAppFn: CreateAppFunction<E, C>);
1376
1379
  connectedCallback(): void;
1377
1380
  disconnectedCallback(): void;
@@ -1408,7 +1411,10 @@ export declare class VueElement extends VueElementBase<Element, Component, Inner
1408
1411
  /**
1409
1412
  * Only called when shadowRoot is false
1410
1413
  */
1411
- protected _updateSlotNodes(replacements: Map<Node, Node[]>): void;
1414
+ protected _updateSlotNodes(replacements: Map<Node, {
1415
+ nodes: Node[];
1416
+ usedFallback: boolean;
1417
+ }>): void;
1412
1418
  private _createVNode;
1413
1419
  }
1414
1420
  export declare function useHost(caller?: string): VueElementBase | null;
@@ -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
  **/
@@ -431,6 +431,13 @@ function warn$2(msg, ...args) {
431
431
  const notifyBuffer = [];
432
432
  let batchDepth = 0;
433
433
  let activeSub = void 0;
434
+ let runDepth = 0;
435
+ function incRunDepth() {
436
+ ++runDepth;
437
+ }
438
+ function decRunDepth() {
439
+ --runDepth;
440
+ }
434
441
  let globalVersion = 0;
435
442
  let notifyIndex = 0;
436
443
  let notifyBufferLength = 0;
@@ -504,8 +511,10 @@ function propagate(link) {
504
511
  const sub = link.sub;
505
512
  let flags = sub.flags;
506
513
  if (flags & 3) {
507
- if (!(flags & 60)) sub.flags = flags | 32;
508
- else if (!(flags & 12)) flags = 0;
514
+ if (!(flags & 60)) {
515
+ sub.flags = flags | 32;
516
+ if (runDepth) sub.flags |= 8;
517
+ } else if (!(flags & 12)) flags = 0;
509
518
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
510
519
  else if (!(flags & 48) && isValidLink(link, sub)) {
511
520
  sub.flags = flags | 40;
@@ -574,13 +583,13 @@ function checkDirty(link, sub) {
574
583
  let dirty = false;
575
584
  if (sub.flags & 16) dirty = true;
576
585
  else if ((depFlags & 17) === 17) {
586
+ const subs = dep.subs;
577
587
  if (dep.update()) {
578
- const subs = dep.subs;
579
588
  if (subs.nextSub !== void 0) shallowPropagate(subs);
580
589
  dirty = true;
581
590
  }
582
591
  } else if ((depFlags & 33) === 33) {
583
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
592
+ stack = {
584
593
  value: link,
585
594
  prev: stack
586
595
  };
@@ -595,15 +604,12 @@ function checkDirty(link, sub) {
595
604
  }
596
605
  while (checkDepth) {
597
606
  --checkDepth;
598
- const firstSub = sub.subs;
599
- const hasMultipleSubs = firstSub.nextSub !== void 0;
600
- if (hasMultipleSubs) {
601
- link = stack.value;
602
- stack = stack.prev;
603
- } else link = firstSub;
607
+ link = stack.value;
608
+ stack = stack.prev;
604
609
  if (dirty) {
610
+ const subs = sub.subs;
605
611
  if (sub.update()) {
606
- if (hasMultipleSubs) shallowPropagate(firstSub);
612
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
607
613
  sub = link.sub;
608
614
  continue;
609
615
  }
@@ -615,7 +621,7 @@ function checkDirty(link, sub) {
615
621
  }
616
622
  dirty = false;
617
623
  }
618
- return dirty;
624
+ return dirty && !!sub.flags;
619
625
  } while (true);
620
626
  }
621
627
  function shallowPropagate(link) {
@@ -1767,9 +1773,11 @@ var ReactiveEffect = class {
1767
1773
  if (!this.active) return this.fn();
1768
1774
  cleanup(this);
1769
1775
  const prevSub = startTracking(this);
1776
+ incRunDepth();
1770
1777
  try {
1771
1778
  return this.fn();
1772
1779
  } finally {
1780
+ decRunDepth();
1773
1781
  endTracking(this, prevSub);
1774
1782
  const flags = this.flags;
1775
1783
  if ((flags & 136) === 136) {
@@ -3065,7 +3073,7 @@ const TeleportImpl = {
3065
3073
  name: "Teleport",
3066
3074
  __isTeleport: true,
3067
3075
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
3068
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
3076
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3069
3077
  const disabled = isTeleportDisabled(n2.props);
3070
3078
  let { dynamicChildren } = n2;
3071
3079
  if (isHmrUpdating) {
@@ -3094,7 +3102,7 @@ const TeleportImpl = {
3094
3102
  if (pendingMounts.get(vnode) !== mountJob) return;
3095
3103
  pendingMounts.delete(vnode);
3096
3104
  if (isTeleportDisabled(vnode.props)) {
3097
- mount(vnode, container, vnode.anchor);
3105
+ mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
3098
3106
  updateCssVars(vnode, true);
3099
3107
  }
3100
3108
  mountToTarget(vnode);
@@ -3174,7 +3182,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3174
3182
  const { el, anchor, shapeFlag, children, props } = vnode;
3175
3183
  const isReorder = moveType === 2;
3176
3184
  if (isReorder) insert(el, container, parentAnchor);
3177
- if (!isReorder || isTeleportDisabled(props)) {
3185
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3178
3186
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3179
3187
  }
3180
3188
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3299,8 +3307,8 @@ const BaseTransitionImpl = {
3299
3307
  const state = useTransitionState();
3300
3308
  return () => {
3301
3309
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3302
- if (!children || !children.length) return;
3303
- const child = findNonCommentChild(children);
3310
+ const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3311
+ if (!child) return;
3304
3312
  const rawProps = /* @__PURE__ */ toRaw(props);
3305
3313
  const { mode } = rawProps;
3306
3314
  checkTransitionMode(mode);
@@ -4654,6 +4662,7 @@ function createSlots(slots, dynamicSlots) {
4654
4662
  */
4655
4663
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4656
4664
  let slot = slots[name];
4665
+ if (fallback) fallback.__vdom = true;
4657
4666
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
4658
4667
  if (vaporSlot) {
4659
4668
  const ret = (openBlock(), createBlock(VaporSlot, props));
@@ -4692,9 +4701,7 @@ function ensureValidVNode(vnodes) {
4692
4701
  }
4693
4702
  function ensureVaporSlotFallback(vnodes, fallback) {
4694
4703
  let vaporSlot;
4695
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
4696
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
4697
- }
4704
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
4698
4705
  }
4699
4706
  //#endregion
4700
4707
  //#region packages/runtime-core/src/helpers/toHandlers.ts
@@ -5066,9 +5073,14 @@ function withAsyncContext(getAwaitable) {
5066
5073
  setCurrentInstance(null, void 0);
5067
5074
  if (inSSRSetup) setInSSRSetupState(false);
5068
5075
  const restore = () => {
5076
+ const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5069
5077
  setCurrentInstance(ctx);
5070
5078
  if (inSSRSetup) setInSSRSetupState(true);
5071
- return restoreAsyncContext && restoreAsyncContext();
5079
+ const reset = restoreAsyncContext && restoreAsyncContext();
5080
+ return () => {
5081
+ if (reset) reset();
5082
+ if (resetStoppedScope) resetStoppedScope.reset();
5083
+ };
5072
5084
  };
5073
5085
  const cleanup = () => {
5074
5086
  setCurrentInstance(null, void 0);
@@ -6098,7 +6110,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
6098
6110
  const receivedType = toRawType(value);
6099
6111
  const expectedValue = styleValue(value, expectedType);
6100
6112
  const receivedValue = styleValue(value, receivedType);
6101
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6113
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6102
6114
  message += `, got ${receivedType} `;
6103
6115
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
6104
6116
  return message;
@@ -6107,7 +6119,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
6107
6119
  * dev only
6108
6120
  */
6109
6121
  function styleValue(value, type) {
6110
- if (type === "String") return `"${value}"`;
6122
+ if (isSymbol(value)) return value.toString();
6123
+ else if (type === "String") return `"${value}"`;
6111
6124
  else if (type === "Number") return `${Number(value)}`;
6112
6125
  else return `${value}`;
6113
6126
  }
@@ -6124,8 +6137,11 @@ function isExplicable(type) {
6124
6137
  /**
6125
6138
  * dev only
6126
6139
  */
6127
- function isBoolean(...args) {
6128
- return args.some((elem) => elem.toLowerCase() === "boolean");
6140
+ function isCoercible(...args) {
6141
+ return args.every((elem) => {
6142
+ const value = elem.toLowerCase();
6143
+ return value !== "boolean" && value !== "symbol";
6144
+ });
6129
6145
  }
6130
6146
  //#endregion
6131
6147
  //#region packages/runtime-core/src/componentSlots.ts
@@ -7308,15 +7324,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7308
7324
  if (suspense.isHydrating) suspense.isHydrating = false;
7309
7325
  else if (!resume) {
7310
7326
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
7327
+ let hasUpdatedAnchor = false;
7311
7328
  if (delayEnter) activeBranch.transition.afterLeave = () => {
7312
7329
  if (pendingId === suspense.pendingId) {
7313
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7330
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7314
7331
  queuePostFlushCb(effects);
7315
7332
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
7316
7333
  }
7317
7334
  };
7318
7335
  if (activeBranch && !suspense.isFallbackMountPending) {
7319
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
7336
+ if (parentNode(activeBranch.el) === container) {
7337
+ anchor = next(activeBranch);
7338
+ hasUpdatedAnchor = true;
7339
+ }
7320
7340
  unmount(activeBranch, parentComponent, suspense, true);
7321
7341
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
7322
7342
  }
@@ -7670,11 +7690,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7670
7690
  el: vnode.el,
7671
7691
  anchor: vnode.anchor,
7672
7692
  ctx: vnode.ctx,
7673
- ce: vnode.ce
7693
+ ce: vnode.ce,
7694
+ vi: vnode.vi,
7695
+ vs: cloneVaporSlotMeta(vnode),
7696
+ vb: vnode.vb
7674
7697
  };
7675
7698
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
7676
7699
  return cloned;
7677
7700
  }
7701
+ function cloneVaporSlotMeta(vnode) {
7702
+ const vaporSlot = vnode.vs;
7703
+ if (!vaporSlot) return vaporSlot;
7704
+ const cloned = {
7705
+ slot: vaporSlot.slot,
7706
+ fallback: vaporSlot.fallback,
7707
+ outletFallback: vaporSlot.outletFallback
7708
+ };
7709
+ if (vnode.el) {
7710
+ cloned.state = vaporSlot.state;
7711
+ cloned.ref = vaporSlot.ref;
7712
+ cloned.scope = vaporSlot.scope;
7713
+ }
7714
+ return cloned;
7715
+ }
7678
7716
  /**
7679
7717
  * Dev only, for HMR of hoisted vnodes reused in v-for
7680
7718
  * https://github.com/vitejs/vite/issues/2022
@@ -8330,7 +8368,7 @@ function isMemoSame(cached, memo) {
8330
8368
  }
8331
8369
  //#endregion
8332
8370
  //#region packages/runtime-core/src/index.ts
8333
- const version = "3.6.0-beta.10";
8371
+ const version = "3.6.0-beta.12";
8334
8372
  const warn = warn$1;
8335
8373
  /**
8336
8374
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8793,7 +8831,10 @@ function patchStyle(el, prev, next) {
8793
8831
  }
8794
8832
  for (const key in next) {
8795
8833
  if (key === "display") hasControlledDisplay = true;
8796
- setStyle(style, key, next[key]);
8834
+ const value = next[key];
8835
+ if (value != null) {
8836
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
8837
+ } else setStyle(style, key, "");
8797
8838
  }
8798
8839
  } else if (isCssString) {
8799
8840
  if (prev !== next) {
@@ -8841,6 +8882,14 @@ function autoPrefix(style, rawName) {
8841
8882
  }
8842
8883
  return rawName;
8843
8884
  }
8885
+ /**
8886
+ * Browsers update textarea width/height directly during native resize.
8887
+ * Only special-case this common textarea path for now; other resize scenarios
8888
+ * still follow normal vnode style patching.
8889
+ */
8890
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
8891
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
8892
+ }
8844
8893
  //#endregion
8845
8894
  //#region packages/runtime-dom/src/modules/attrs.ts
8846
8895
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -9275,7 +9324,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
9275
9324
  replacementNodes.push(child);
9276
9325
  }
9277
9326
  parent.removeChild(o);
9278
- slotReplacements.set(o, replacementNodes);
9327
+ slotReplacements.set(o, {
9328
+ nodes: replacementNodes,
9329
+ usedFallback: !content
9330
+ });
9279
9331
  }
9280
9332
  this._updateSlotNodes(slotReplacements);
9281
9333
  }