@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.
- package/dist/runtime-dom.cjs.js +17 -3
- package/dist/runtime-dom.cjs.prod.js +17 -3
- package/dist/runtime-dom.d.ts +8 -2
- package/dist/runtime-dom.esm-browser.js +64 -20
- package/dist/runtime-dom.esm-browser.prod.js +3 -3
- package/dist/runtime-dom.esm-bundler.js +17 -3
- package/dist/runtime-dom.global.js +64 -20
- package/dist/runtime-dom.global.prod.js +3 -3
- package/package.json +4 -4
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-beta.
|
|
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
|
**/
|
|
@@ -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
|
-
|
|
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,
|
|
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.
|
|
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
|
**/
|
|
@@ -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
|
-
|
|
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,
|
|
840
|
+
slotReplacements.set(o, {
|
|
841
|
+
nodes: replacementNodes,
|
|
842
|
+
usedFallback: !content
|
|
843
|
+
});
|
|
830
844
|
}
|
|
831
845
|
this._updateSlotNodes(slotReplacements);
|
|
832
846
|
}
|
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -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,
|
|
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,
|
|
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.
|
|
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
|
**/
|
|
@@ -3065,7 +3065,7 @@ const TeleportImpl = {
|
|
|
3065
3065
|
name: "Teleport",
|
|
3066
3066
|
__isTeleport: true,
|
|
3067
3067
|
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;
|
|
3068
|
+
const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
|
|
3069
3069
|
const disabled = isTeleportDisabled(n2.props);
|
|
3070
3070
|
let { dynamicChildren } = n2;
|
|
3071
3071
|
if (isHmrUpdating) {
|
|
@@ -3094,7 +3094,7 @@ const TeleportImpl = {
|
|
|
3094
3094
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
3095
3095
|
pendingMounts.delete(vnode);
|
|
3096
3096
|
if (isTeleportDisabled(vnode.props)) {
|
|
3097
|
-
mount(vnode, container, vnode.anchor);
|
|
3097
|
+
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
3098
3098
|
updateCssVars(vnode, true);
|
|
3099
3099
|
}
|
|
3100
3100
|
mountToTarget(vnode);
|
|
@@ -3174,7 +3174,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
3174
3174
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3175
3175
|
const isReorder = moveType === 2;
|
|
3176
3176
|
if (isReorder) insert(el, container, parentAnchor);
|
|
3177
|
-
if (!isReorder || isTeleportDisabled(props)) {
|
|
3177
|
+
if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
|
|
3178
3178
|
if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
|
|
3179
3179
|
}
|
|
3180
3180
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
@@ -3299,8 +3299,8 @@ const BaseTransitionImpl = {
|
|
|
3299
3299
|
const state = useTransitionState();
|
|
3300
3300
|
return () => {
|
|
3301
3301
|
const children = slots.default && getTransitionRawChildren(slots.default(), true);
|
|
3302
|
-
|
|
3303
|
-
|
|
3302
|
+
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
3303
|
+
if (!child) return;
|
|
3304
3304
|
const rawProps = /* @__PURE__ */ toRaw(props);
|
|
3305
3305
|
const { mode } = rawProps;
|
|
3306
3306
|
checkTransitionMode(mode);
|
|
@@ -4654,6 +4654,7 @@ function createSlots(slots, dynamicSlots) {
|
|
|
4654
4654
|
*/
|
|
4655
4655
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
4656
4656
|
let slot = slots[name];
|
|
4657
|
+
if (fallback) fallback.__vdom = true;
|
|
4657
4658
|
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
4658
4659
|
if (vaporSlot) {
|
|
4659
4660
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
@@ -4692,9 +4693,7 @@ function ensureValidVNode(vnodes) {
|
|
|
4692
4693
|
}
|
|
4693
4694
|
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
4694
4695
|
let vaporSlot;
|
|
4695
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs))
|
|
4696
|
-
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
4697
|
-
}
|
|
4696
|
+
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
4698
4697
|
}
|
|
4699
4698
|
//#endregion
|
|
4700
4699
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
@@ -5066,9 +5065,14 @@ function withAsyncContext(getAwaitable) {
|
|
|
5066
5065
|
setCurrentInstance(null, void 0);
|
|
5067
5066
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5068
5067
|
const restore = () => {
|
|
5068
|
+
const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5069
5069
|
setCurrentInstance(ctx);
|
|
5070
5070
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
5071
|
-
|
|
5071
|
+
const reset = restoreAsyncContext && restoreAsyncContext();
|
|
5072
|
+
return () => {
|
|
5073
|
+
if (reset) reset();
|
|
5074
|
+
if (resetStoppedScope) resetStoppedScope.reset();
|
|
5075
|
+
};
|
|
5072
5076
|
};
|
|
5073
5077
|
const cleanup = () => {
|
|
5074
5078
|
setCurrentInstance(null, void 0);
|
|
@@ -6098,7 +6102,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
6098
6102
|
const receivedType = toRawType(value);
|
|
6099
6103
|
const expectedValue = styleValue(value, expectedType);
|
|
6100
6104
|
const receivedValue = styleValue(value, receivedType);
|
|
6101
|
-
if (expectedTypes.length === 1 && isExplicable(expectedType) &&
|
|
6105
|
+
if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
|
|
6102
6106
|
message += `, got ${receivedType} `;
|
|
6103
6107
|
if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
|
|
6104
6108
|
return message;
|
|
@@ -6107,7 +6111,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
|
6107
6111
|
* dev only
|
|
6108
6112
|
*/
|
|
6109
6113
|
function styleValue(value, type) {
|
|
6110
|
-
if (
|
|
6114
|
+
if (isSymbol(value)) return value.toString();
|
|
6115
|
+
else if (type === "String") return `"${value}"`;
|
|
6111
6116
|
else if (type === "Number") return `${Number(value)}`;
|
|
6112
6117
|
else return `${value}`;
|
|
6113
6118
|
}
|
|
@@ -6124,8 +6129,11 @@ function isExplicable(type) {
|
|
|
6124
6129
|
/**
|
|
6125
6130
|
* dev only
|
|
6126
6131
|
*/
|
|
6127
|
-
function
|
|
6128
|
-
return args.
|
|
6132
|
+
function isCoercible(...args) {
|
|
6133
|
+
return args.every((elem) => {
|
|
6134
|
+
const value = elem.toLowerCase();
|
|
6135
|
+
return value !== "boolean" && value !== "symbol";
|
|
6136
|
+
});
|
|
6129
6137
|
}
|
|
6130
6138
|
//#endregion
|
|
6131
6139
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
@@ -7308,15 +7316,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7308
7316
|
if (suspense.isHydrating) suspense.isHydrating = false;
|
|
7309
7317
|
else if (!resume) {
|
|
7310
7318
|
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
7319
|
+
let hasUpdatedAnchor = false;
|
|
7311
7320
|
if (delayEnter) activeBranch.transition.afterLeave = () => {
|
|
7312
7321
|
if (pendingId === suspense.pendingId) {
|
|
7313
|
-
move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7322
|
+
move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
|
|
7314
7323
|
queuePostFlushCb(effects);
|
|
7315
7324
|
if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
|
|
7316
7325
|
}
|
|
7317
7326
|
};
|
|
7318
7327
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7319
|
-
if (parentNode(activeBranch.el) === container)
|
|
7328
|
+
if (parentNode(activeBranch.el) === container) {
|
|
7329
|
+
anchor = next(activeBranch);
|
|
7330
|
+
hasUpdatedAnchor = true;
|
|
7331
|
+
}
|
|
7320
7332
|
unmount(activeBranch, parentComponent, suspense, true);
|
|
7321
7333
|
if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
|
|
7322
7334
|
}
|
|
@@ -7670,11 +7682,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
7670
7682
|
el: vnode.el,
|
|
7671
7683
|
anchor: vnode.anchor,
|
|
7672
7684
|
ctx: vnode.ctx,
|
|
7673
|
-
ce: vnode.ce
|
|
7685
|
+
ce: vnode.ce,
|
|
7686
|
+
vi: vnode.vi,
|
|
7687
|
+
vs: cloneVaporSlotMeta(vnode),
|
|
7688
|
+
vb: vnode.vb
|
|
7674
7689
|
};
|
|
7675
7690
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
7676
7691
|
return cloned;
|
|
7677
7692
|
}
|
|
7693
|
+
function cloneVaporSlotMeta(vnode) {
|
|
7694
|
+
const vaporSlot = vnode.vs;
|
|
7695
|
+
if (!vaporSlot) return vaporSlot;
|
|
7696
|
+
const cloned = {
|
|
7697
|
+
slot: vaporSlot.slot,
|
|
7698
|
+
fallback: vaporSlot.fallback,
|
|
7699
|
+
outletFallback: vaporSlot.outletFallback
|
|
7700
|
+
};
|
|
7701
|
+
if (vnode.el) {
|
|
7702
|
+
cloned.state = vaporSlot.state;
|
|
7703
|
+
cloned.ref = vaporSlot.ref;
|
|
7704
|
+
cloned.scope = vaporSlot.scope;
|
|
7705
|
+
}
|
|
7706
|
+
return cloned;
|
|
7707
|
+
}
|
|
7678
7708
|
/**
|
|
7679
7709
|
* Dev only, for HMR of hoisted vnodes reused in v-for
|
|
7680
7710
|
* https://github.com/vitejs/vite/issues/2022
|
|
@@ -8330,7 +8360,7 @@ function isMemoSame(cached, memo) {
|
|
|
8330
8360
|
}
|
|
8331
8361
|
//#endregion
|
|
8332
8362
|
//#region packages/runtime-core/src/index.ts
|
|
8333
|
-
const version = "3.6.0-beta.
|
|
8363
|
+
const version = "3.6.0-beta.11";
|
|
8334
8364
|
const warn = warn$1;
|
|
8335
8365
|
/**
|
|
8336
8366
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -8793,7 +8823,10 @@ function patchStyle(el, prev, next) {
|
|
|
8793
8823
|
}
|
|
8794
8824
|
for (const key in next) {
|
|
8795
8825
|
if (key === "display") hasControlledDisplay = true;
|
|
8796
|
-
|
|
8826
|
+
const value = next[key];
|
|
8827
|
+
if (value != null) {
|
|
8828
|
+
if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
|
|
8829
|
+
} else setStyle(style, key, "");
|
|
8797
8830
|
}
|
|
8798
8831
|
} else if (isCssString) {
|
|
8799
8832
|
if (prev !== next) {
|
|
@@ -8841,6 +8874,14 @@ function autoPrefix(style, rawName) {
|
|
|
8841
8874
|
}
|
|
8842
8875
|
return rawName;
|
|
8843
8876
|
}
|
|
8877
|
+
/**
|
|
8878
|
+
* Browsers update textarea width/height directly during native resize.
|
|
8879
|
+
* Only special-case this common textarea path for now; other resize scenarios
|
|
8880
|
+
* still follow normal vnode style patching.
|
|
8881
|
+
*/
|
|
8882
|
+
function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
|
|
8883
|
+
return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
|
|
8884
|
+
}
|
|
8844
8885
|
//#endregion
|
|
8845
8886
|
//#region packages/runtime-dom/src/modules/attrs.ts
|
|
8846
8887
|
const xlinkNS = "http://www.w3.org/1999/xlink";
|
|
@@ -9275,7 +9316,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9275
9316
|
replacementNodes.push(child);
|
|
9276
9317
|
}
|
|
9277
9318
|
parent.removeChild(o);
|
|
9278
|
-
slotReplacements.set(o,
|
|
9319
|
+
slotReplacements.set(o, {
|
|
9320
|
+
nodes: replacementNodes,
|
|
9321
|
+
usedFallback: !content
|
|
9322
|
+
});
|
|
9279
9323
|
}
|
|
9280
9324
|
this._updateSlotNodes(slotReplacements);
|
|
9281
9325
|
}
|