🔧 npm update
This commit is contained in:
97
node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js
generated
vendored
97
node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js
generated
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/compiler-dom v3.4.15
|
||||
* @vue/compiler-dom v3.5.13
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -11,15 +11,27 @@ var compilerCore = require('@vue/compiler-core');
|
||||
var shared = require('@vue/shared');
|
||||
|
||||
const V_MODEL_RADIO = Symbol(``);
|
||||
const V_MODEL_CHECKBOX = Symbol(``);
|
||||
const V_MODEL_CHECKBOX = Symbol(
|
||||
``
|
||||
);
|
||||
const V_MODEL_TEXT = Symbol(``);
|
||||
const V_MODEL_SELECT = Symbol(``);
|
||||
const V_MODEL_DYNAMIC = Symbol(``);
|
||||
const V_ON_WITH_MODIFIERS = Symbol(``);
|
||||
const V_ON_WITH_KEYS = Symbol(``);
|
||||
const V_MODEL_SELECT = Symbol(
|
||||
``
|
||||
);
|
||||
const V_MODEL_DYNAMIC = Symbol(
|
||||
``
|
||||
);
|
||||
const V_ON_WITH_MODIFIERS = Symbol(
|
||||
``
|
||||
);
|
||||
const V_ON_WITH_KEYS = Symbol(
|
||||
``
|
||||
);
|
||||
const V_SHOW = Symbol(``);
|
||||
const TRANSITION = Symbol(``);
|
||||
const TRANSITION_GROUP = Symbol(``);
|
||||
const TRANSITION_GROUP = Symbol(
|
||||
``
|
||||
);
|
||||
compilerCore.registerRuntimeHelpers({
|
||||
[V_MODEL_RADIO]: `vModelRadio`,
|
||||
[V_MODEL_CHECKBOX]: `vModelCheckbox`,
|
||||
@@ -38,6 +50,7 @@ const parserOptions = {
|
||||
isVoidTag: shared.isVoidTag,
|
||||
isNativeTag: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag),
|
||||
isPreTag: (tag) => tag === "pre",
|
||||
isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
|
||||
decodeEntities: void 0,
|
||||
isBuiltInComponent: (tag) => {
|
||||
if (tag === "Transition" || tag === "transition") {
|
||||
@@ -273,16 +286,13 @@ const isNonKeyModifier = /* @__PURE__ */ shared.makeMap(
|
||||
`stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
|
||||
);
|
||||
const maybeKeyModifier = /* @__PURE__ */ shared.makeMap("left,right");
|
||||
const isKeyboardEvent = /* @__PURE__ */ shared.makeMap(
|
||||
`onkeyup,onkeydown,onkeypress`,
|
||||
true
|
||||
);
|
||||
const isKeyboardEvent = /* @__PURE__ */ shared.makeMap(`onkeyup,onkeydown,onkeypress`);
|
||||
const resolveModifiers = (key, modifiers, context, loc) => {
|
||||
const keyModifiers = [];
|
||||
const nonKeyModifiers = [];
|
||||
const eventOptionModifiers = [];
|
||||
for (let i = 0; i < modifiers.length; i++) {
|
||||
const modifier = modifiers[i];
|
||||
const modifier = modifiers[i].content;
|
||||
if (modifier === "native" && compilerCore.checkCompatEnabled(
|
||||
"COMPILER_V_ON_NATIVE",
|
||||
context,
|
||||
@@ -294,7 +304,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
||||
} else {
|
||||
if (maybeKeyModifier(modifier)) {
|
||||
if (compilerCore.isStaticExp(key)) {
|
||||
if (isKeyboardEvent(key.content)) {
|
||||
if (isKeyboardEvent(key.content.toLowerCase())) {
|
||||
keyModifiers.push(modifier);
|
||||
} else {
|
||||
nonKeyModifiers.push(modifier);
|
||||
@@ -331,8 +341,7 @@ const transformClick = (key, event) => {
|
||||
const transformOn = (dir, node, context) => {
|
||||
return compilerCore.transformOn(dir, node, context, (baseResult) => {
|
||||
const { modifiers } = dir;
|
||||
if (!modifiers.length)
|
||||
return baseResult;
|
||||
if (!modifiers.length) return baseResult;
|
||||
let { key, value: handlerExp } = baseResult.props[0];
|
||||
const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
|
||||
if (nonKeyModifiers.includes("right")) {
|
||||
@@ -348,7 +357,7 @@ const transformOn = (dir, node, context) => {
|
||||
]);
|
||||
}
|
||||
if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
|
||||
(!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content))) {
|
||||
(!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) {
|
||||
handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [
|
||||
handlerExp,
|
||||
JSON.stringify(keyModifiers)
|
||||
@@ -382,6 +391,7 @@ const stringifyStatic = (children, context, parent) => {
|
||||
if (context.scopes.vSlot > 0) {
|
||||
return;
|
||||
}
|
||||
const isParentCached = parent.type === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 20;
|
||||
let nc = 0;
|
||||
let ec = 0;
|
||||
const currentChunk = [];
|
||||
@@ -395,29 +405,44 @@ const stringifyStatic = (children, context, parent) => {
|
||||
// will insert / hydrate
|
||||
String(currentChunk.length)
|
||||
]);
|
||||
replaceHoist(currentChunk[0], staticCall, context);
|
||||
if (currentChunk.length > 1) {
|
||||
for (let i2 = 1; i2 < currentChunk.length; i2++) {
|
||||
replaceHoist(currentChunk[i2], null, context);
|
||||
const deleteCount = currentChunk.length - 1;
|
||||
if (isParentCached) {
|
||||
children.splice(
|
||||
currentIndex - currentChunk.length,
|
||||
currentChunk.length,
|
||||
// @ts-expect-error
|
||||
staticCall
|
||||
);
|
||||
} else {
|
||||
currentChunk[0].codegenNode.value = staticCall;
|
||||
if (currentChunk.length > 1) {
|
||||
children.splice(currentIndex - currentChunk.length + 1, deleteCount);
|
||||
const cacheIndex = context.cached.indexOf(
|
||||
currentChunk[currentChunk.length - 1].codegenNode
|
||||
);
|
||||
if (cacheIndex > -1) {
|
||||
for (let i2 = cacheIndex; i2 < context.cached.length; i2++) {
|
||||
const c = context.cached[i2];
|
||||
if (c) c.index -= deleteCount;
|
||||
}
|
||||
context.cached.splice(cacheIndex - deleteCount + 1, deleteCount);
|
||||
}
|
||||
}
|
||||
const deleteCount = currentChunk.length - 1;
|
||||
children.splice(currentIndex - currentChunk.length + 1, deleteCount);
|
||||
return deleteCount;
|
||||
}
|
||||
return deleteCount;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
let i = 0;
|
||||
for (; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
const hoisted = getHoistedNode(child);
|
||||
if (hoisted) {
|
||||
const node = child;
|
||||
const result = analyzeNode(node);
|
||||
const isCached = isParentCached || getCachedNode(child);
|
||||
if (isCached) {
|
||||
const result = analyzeNode(child);
|
||||
if (result) {
|
||||
nc += result[0];
|
||||
ec += result[1];
|
||||
currentChunk.push(node);
|
||||
currentChunk.push(child);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -428,14 +453,14 @@ const stringifyStatic = (children, context, parent) => {
|
||||
}
|
||||
stringifyCurrentChunk(i);
|
||||
};
|
||||
const getHoistedNode = (node) => (node.type === 1 && node.tagType === 0 || node.type == 12) && node.codegenNode && node.codegenNode.type === 4 && node.codegenNode.hoisted;
|
||||
const getCachedNode = (node) => {
|
||||
if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) {
|
||||
return node.codegenNode;
|
||||
}
|
||||
};
|
||||
const dataAriaRE = /^(data|aria)-/;
|
||||
const isStringifiableAttr = (name, ns) => {
|
||||
return (ns === 0 ? shared.isKnownHtmlAttr(name) : ns === 1 ? shared.isKnownSvgAttr(name) : false) || dataAriaRE.test(name);
|
||||
};
|
||||
const replaceHoist = (node, replacement, context) => {
|
||||
const hoistToReplace = node.codegenNode.hoisted;
|
||||
context.hoists[context.hoists.indexOf(hoistToReplace)] = replacement;
|
||||
return (ns === 0 ? shared.isKnownHtmlAttr(name) : ns === 1 ? shared.isKnownSvgAttr(name) : ns === 2 ? shared.isKnownMathMLAttr(name) : false) || dataAriaRE.test(name);
|
||||
};
|
||||
const isNonStringifiable = /* @__PURE__ */ shared.makeMap(
|
||||
`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`
|
||||
@@ -455,6 +480,7 @@ function analyzeNode(node) {
|
||||
return false;
|
||||
};
|
||||
function walk(node2) {
|
||||
const isOptionTag = node2.tag === "option" && node2.ns === 0;
|
||||
for (let i = 0; i < node2.props.length; i++) {
|
||||
const p = node2.props[i];
|
||||
if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) {
|
||||
@@ -467,6 +493,9 @@ function analyzeNode(node) {
|
||||
if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
|
||||
return bail();
|
||||
}
|
||||
if (isOptionTag && compilerCore.isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) {
|
||||
return bail();
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < node2.children.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user