🔧 npm update
This commit is contained in:
2
node_modules/@vue/compiler-dom/README.md
generated
vendored
2
node_modules/@vue/compiler-dom/README.md
generated
vendored
@@ -1 +1 @@
|
||||
# @vue/compiler-dom
|
||||
# @vue/compiler-dom
|
||||
|
||||
271
node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js
generated
vendored
271
node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.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(`vModelRadio` );
|
||||
const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );
|
||||
const V_MODEL_CHECKBOX = Symbol(
|
||||
`vModelCheckbox`
|
||||
);
|
||||
const V_MODEL_TEXT = Symbol(`vModelText` );
|
||||
const V_MODEL_SELECT = Symbol(`vModelSelect` );
|
||||
const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
|
||||
const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
|
||||
const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
|
||||
const V_MODEL_SELECT = Symbol(
|
||||
`vModelSelect`
|
||||
);
|
||||
const V_MODEL_DYNAMIC = Symbol(
|
||||
`vModelDynamic`
|
||||
);
|
||||
const V_ON_WITH_MODIFIERS = Symbol(
|
||||
`vOnModifiersGuard`
|
||||
);
|
||||
const V_ON_WITH_KEYS = Symbol(
|
||||
`vOnKeysGuard`
|
||||
);
|
||||
const V_SHOW = Symbol(`vShow` );
|
||||
const TRANSITION = Symbol(`Transition` );
|
||||
const TRANSITION_GROUP = Symbol(`TransitionGroup` );
|
||||
const TRANSITION_GROUP = Symbol(
|
||||
`TransitionGroup`
|
||||
);
|
||||
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") {
|
||||
@@ -291,16 +304,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,
|
||||
@@ -312,7 +322,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);
|
||||
@@ -349,8 +359,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")) {
|
||||
@@ -366,7 +375,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)
|
||||
@@ -446,6 +455,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 = [];
|
||||
@@ -459,29 +469,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;
|
||||
}
|
||||
}
|
||||
@@ -492,14 +517,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`
|
||||
@@ -519,6 +544,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)) {
|
||||
@@ -531,6 +557,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++) {
|
||||
@@ -664,9 +693,181 @@ const ignoreSideEffectTags = (node, context) => {
|
||||
}
|
||||
};
|
||||
|
||||
function isValidHTMLNesting(parent, child) {
|
||||
if (parent in onlyValidChildren) {
|
||||
return onlyValidChildren[parent].has(child);
|
||||
}
|
||||
if (child in onlyValidParents) {
|
||||
return onlyValidParents[child].has(parent);
|
||||
}
|
||||
if (parent in knownInvalidChildren) {
|
||||
if (knownInvalidChildren[parent].has(child)) return false;
|
||||
}
|
||||
if (child in knownInvalidParents) {
|
||||
if (knownInvalidParents[child].has(parent)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
|
||||
const emptySet = /* @__PURE__ */ new Set([]);
|
||||
const onlyValidChildren = {
|
||||
head: /* @__PURE__ */ new Set([
|
||||
"base",
|
||||
"basefront",
|
||||
"bgsound",
|
||||
"link",
|
||||
"meta",
|
||||
"title",
|
||||
"noscript",
|
||||
"noframes",
|
||||
"style",
|
||||
"script",
|
||||
"template"
|
||||
]),
|
||||
optgroup: /* @__PURE__ */ new Set(["option"]),
|
||||
select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
|
||||
// table
|
||||
table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
|
||||
tr: /* @__PURE__ */ new Set(["td", "th"]),
|
||||
colgroup: /* @__PURE__ */ new Set(["col"]),
|
||||
tbody: /* @__PURE__ */ new Set(["tr"]),
|
||||
thead: /* @__PURE__ */ new Set(["tr"]),
|
||||
tfoot: /* @__PURE__ */ new Set(["tr"]),
|
||||
// these elements can not have any children elements
|
||||
script: emptySet,
|
||||
iframe: emptySet,
|
||||
option: emptySet,
|
||||
textarea: emptySet,
|
||||
style: emptySet,
|
||||
title: emptySet
|
||||
};
|
||||
const onlyValidParents = {
|
||||
// sections
|
||||
html: emptySet,
|
||||
body: /* @__PURE__ */ new Set(["html"]),
|
||||
head: /* @__PURE__ */ new Set(["html"]),
|
||||
// table
|
||||
td: /* @__PURE__ */ new Set(["tr"]),
|
||||
colgroup: /* @__PURE__ */ new Set(["table"]),
|
||||
caption: /* @__PURE__ */ new Set(["table"]),
|
||||
tbody: /* @__PURE__ */ new Set(["table"]),
|
||||
tfoot: /* @__PURE__ */ new Set(["table"]),
|
||||
col: /* @__PURE__ */ new Set(["colgroup"]),
|
||||
th: /* @__PURE__ */ new Set(["tr"]),
|
||||
thead: /* @__PURE__ */ new Set(["table"]),
|
||||
tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
|
||||
// data list
|
||||
dd: /* @__PURE__ */ new Set(["dl", "div"]),
|
||||
dt: /* @__PURE__ */ new Set(["dl", "div"]),
|
||||
// other
|
||||
figcaption: /* @__PURE__ */ new Set(["figure"]),
|
||||
// li: new Set(["ul", "ol"]),
|
||||
summary: /* @__PURE__ */ new Set(["details"]),
|
||||
area: /* @__PURE__ */ new Set(["map"])
|
||||
};
|
||||
const knownInvalidChildren = {
|
||||
p: /* @__PURE__ */ new Set([
|
||||
"address",
|
||||
"article",
|
||||
"aside",
|
||||
"blockquote",
|
||||
"center",
|
||||
"details",
|
||||
"dialog",
|
||||
"dir",
|
||||
"div",
|
||||
"dl",
|
||||
"fieldset",
|
||||
"figure",
|
||||
"footer",
|
||||
"form",
|
||||
"h1",
|
||||
"h2",
|
||||
"h3",
|
||||
"h4",
|
||||
"h5",
|
||||
"h6",
|
||||
"header",
|
||||
"hgroup",
|
||||
"hr",
|
||||
"li",
|
||||
"main",
|
||||
"nav",
|
||||
"menu",
|
||||
"ol",
|
||||
"p",
|
||||
"pre",
|
||||
"section",
|
||||
"table",
|
||||
"ul"
|
||||
]),
|
||||
svg: /* @__PURE__ */ new Set([
|
||||
"b",
|
||||
"blockquote",
|
||||
"br",
|
||||
"code",
|
||||
"dd",
|
||||
"div",
|
||||
"dl",
|
||||
"dt",
|
||||
"em",
|
||||
"embed",
|
||||
"h1",
|
||||
"h2",
|
||||
"h3",
|
||||
"h4",
|
||||
"h5",
|
||||
"h6",
|
||||
"hr",
|
||||
"i",
|
||||
"img",
|
||||
"li",
|
||||
"menu",
|
||||
"meta",
|
||||
"ol",
|
||||
"p",
|
||||
"pre",
|
||||
"ruby",
|
||||
"s",
|
||||
"small",
|
||||
"span",
|
||||
"strong",
|
||||
"sub",
|
||||
"sup",
|
||||
"table",
|
||||
"u",
|
||||
"ul",
|
||||
"var"
|
||||
])
|
||||
};
|
||||
const knownInvalidParents = {
|
||||
a: /* @__PURE__ */ new Set(["a"]),
|
||||
button: /* @__PURE__ */ new Set(["button"]),
|
||||
dd: /* @__PURE__ */ new Set(["dd", "dt"]),
|
||||
dt: /* @__PURE__ */ new Set(["dd", "dt"]),
|
||||
form: /* @__PURE__ */ new Set(["form"]),
|
||||
li: /* @__PURE__ */ new Set(["li"]),
|
||||
h1: headings,
|
||||
h2: headings,
|
||||
h3: headings,
|
||||
h4: headings,
|
||||
h5: headings,
|
||||
h6: headings
|
||||
};
|
||||
|
||||
const validateHtmlNesting = (node, context) => {
|
||||
if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
|
||||
const error = new SyntaxError(
|
||||
`<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
|
||||
);
|
||||
error.loc = node.loc;
|
||||
context.onWarn(error);
|
||||
}
|
||||
};
|
||||
|
||||
const DOMNodeTransforms = [
|
||||
transformStyle,
|
||||
...[transformTransition]
|
||||
...[transformTransition, validateHtmlNesting]
|
||||
];
|
||||
const DOMDirectiveTransforms = {
|
||||
cloak: compilerCore.noopDirectiveTransform,
|
||||
|
||||
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++) {
|
||||
|
||||
979
node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.js
generated
vendored
979
node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.js
generated
vendored
File diff suppressed because it is too large
Load Diff
11
node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js
generated
vendored
11
node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js
generated
vendored
File diff suppressed because one or more lines are too long
215
node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js
generated
vendored
215
node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.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
|
||||
**/
|
||||
@@ -8,15 +8,27 @@ export * from '@vue/compiler-core';
|
||||
import { isVoidTag, isHTMLTag, isSVGTag, isMathMLTag, parseStringStyle, capitalize, makeMap, extend } from '@vue/shared';
|
||||
|
||||
const V_MODEL_RADIO = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelRadio` : ``);
|
||||
const V_MODEL_CHECKBOX = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelCheckbox` : ``);
|
||||
const V_MODEL_CHECKBOX = Symbol(
|
||||
!!(process.env.NODE_ENV !== "production") ? `vModelCheckbox` : ``
|
||||
);
|
||||
const V_MODEL_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelText` : ``);
|
||||
const V_MODEL_SELECT = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelSelect` : ``);
|
||||
const V_MODEL_DYNAMIC = Symbol(!!(process.env.NODE_ENV !== "production") ? `vModelDynamic` : ``);
|
||||
const V_ON_WITH_MODIFIERS = Symbol(!!(process.env.NODE_ENV !== "production") ? `vOnModifiersGuard` : ``);
|
||||
const V_ON_WITH_KEYS = Symbol(!!(process.env.NODE_ENV !== "production") ? `vOnKeysGuard` : ``);
|
||||
const V_MODEL_SELECT = Symbol(
|
||||
!!(process.env.NODE_ENV !== "production") ? `vModelSelect` : ``
|
||||
);
|
||||
const V_MODEL_DYNAMIC = Symbol(
|
||||
!!(process.env.NODE_ENV !== "production") ? `vModelDynamic` : ``
|
||||
);
|
||||
const V_ON_WITH_MODIFIERS = Symbol(
|
||||
!!(process.env.NODE_ENV !== "production") ? `vOnModifiersGuard` : ``
|
||||
);
|
||||
const V_ON_WITH_KEYS = Symbol(
|
||||
!!(process.env.NODE_ENV !== "production") ? `vOnKeysGuard` : ``
|
||||
);
|
||||
const V_SHOW = Symbol(!!(process.env.NODE_ENV !== "production") ? `vShow` : ``);
|
||||
const TRANSITION = Symbol(!!(process.env.NODE_ENV !== "production") ? `Transition` : ``);
|
||||
const TRANSITION_GROUP = Symbol(!!(process.env.NODE_ENV !== "production") ? `TransitionGroup` : ``);
|
||||
const TRANSITION_GROUP = Symbol(
|
||||
!!(process.env.NODE_ENV !== "production") ? `TransitionGroup` : ``
|
||||
);
|
||||
registerRuntimeHelpers({
|
||||
[V_MODEL_RADIO]: `vModelRadio`,
|
||||
[V_MODEL_CHECKBOX]: `vModelCheckbox`,
|
||||
@@ -49,6 +61,7 @@ const parserOptions = {
|
||||
isVoidTag,
|
||||
isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
|
||||
isPreTag: (tag) => tag === "pre",
|
||||
isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
|
||||
decodeEntities: decodeHtmlBrowser ,
|
||||
isBuiltInComponent: (tag) => {
|
||||
if (tag === "Transition" || tag === "transition") {
|
||||
@@ -302,16 +315,13 @@ const isNonKeyModifier = /* @__PURE__ */ makeMap(
|
||||
`stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
|
||||
);
|
||||
const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
|
||||
const isKeyboardEvent = /* @__PURE__ */ makeMap(
|
||||
`onkeyup,onkeydown,onkeypress`,
|
||||
true
|
||||
);
|
||||
const isKeyboardEvent = /* @__PURE__ */ 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" && checkCompatEnabled(
|
||||
"COMPILER_V_ON_NATIVE",
|
||||
context,
|
||||
@@ -323,7 +333,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
||||
} else {
|
||||
if (maybeKeyModifier(modifier)) {
|
||||
if (isStaticExp(key)) {
|
||||
if (isKeyboardEvent(key.content)) {
|
||||
if (isKeyboardEvent(key.content.toLowerCase())) {
|
||||
keyModifiers.push(modifier);
|
||||
} else {
|
||||
nonKeyModifiers.push(modifier);
|
||||
@@ -360,8 +370,7 @@ const transformClick = (key, event) => {
|
||||
const transformOn = (dir, node, context) => {
|
||||
return transformOn$1(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")) {
|
||||
@@ -377,7 +386,7 @@ const transformOn = (dir, node, context) => {
|
||||
]);
|
||||
}
|
||||
if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
|
||||
(!isStaticExp(key) || isKeyboardEvent(key.content))) {
|
||||
(!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) {
|
||||
handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [
|
||||
handlerExp,
|
||||
JSON.stringify(keyModifiers)
|
||||
@@ -464,9 +473,181 @@ const ignoreSideEffectTags = (node, context) => {
|
||||
}
|
||||
};
|
||||
|
||||
function isValidHTMLNesting(parent, child) {
|
||||
if (parent in onlyValidChildren) {
|
||||
return onlyValidChildren[parent].has(child);
|
||||
}
|
||||
if (child in onlyValidParents) {
|
||||
return onlyValidParents[child].has(parent);
|
||||
}
|
||||
if (parent in knownInvalidChildren) {
|
||||
if (knownInvalidChildren[parent].has(child)) return false;
|
||||
}
|
||||
if (child in knownInvalidParents) {
|
||||
if (knownInvalidParents[child].has(parent)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
|
||||
const emptySet = /* @__PURE__ */ new Set([]);
|
||||
const onlyValidChildren = {
|
||||
head: /* @__PURE__ */ new Set([
|
||||
"base",
|
||||
"basefront",
|
||||
"bgsound",
|
||||
"link",
|
||||
"meta",
|
||||
"title",
|
||||
"noscript",
|
||||
"noframes",
|
||||
"style",
|
||||
"script",
|
||||
"template"
|
||||
]),
|
||||
optgroup: /* @__PURE__ */ new Set(["option"]),
|
||||
select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
|
||||
// table
|
||||
table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
|
||||
tr: /* @__PURE__ */ new Set(["td", "th"]),
|
||||
colgroup: /* @__PURE__ */ new Set(["col"]),
|
||||
tbody: /* @__PURE__ */ new Set(["tr"]),
|
||||
thead: /* @__PURE__ */ new Set(["tr"]),
|
||||
tfoot: /* @__PURE__ */ new Set(["tr"]),
|
||||
// these elements can not have any children elements
|
||||
script: emptySet,
|
||||
iframe: emptySet,
|
||||
option: emptySet,
|
||||
textarea: emptySet,
|
||||
style: emptySet,
|
||||
title: emptySet
|
||||
};
|
||||
const onlyValidParents = {
|
||||
// sections
|
||||
html: emptySet,
|
||||
body: /* @__PURE__ */ new Set(["html"]),
|
||||
head: /* @__PURE__ */ new Set(["html"]),
|
||||
// table
|
||||
td: /* @__PURE__ */ new Set(["tr"]),
|
||||
colgroup: /* @__PURE__ */ new Set(["table"]),
|
||||
caption: /* @__PURE__ */ new Set(["table"]),
|
||||
tbody: /* @__PURE__ */ new Set(["table"]),
|
||||
tfoot: /* @__PURE__ */ new Set(["table"]),
|
||||
col: /* @__PURE__ */ new Set(["colgroup"]),
|
||||
th: /* @__PURE__ */ new Set(["tr"]),
|
||||
thead: /* @__PURE__ */ new Set(["table"]),
|
||||
tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
|
||||
// data list
|
||||
dd: /* @__PURE__ */ new Set(["dl", "div"]),
|
||||
dt: /* @__PURE__ */ new Set(["dl", "div"]),
|
||||
// other
|
||||
figcaption: /* @__PURE__ */ new Set(["figure"]),
|
||||
// li: new Set(["ul", "ol"]),
|
||||
summary: /* @__PURE__ */ new Set(["details"]),
|
||||
area: /* @__PURE__ */ new Set(["map"])
|
||||
};
|
||||
const knownInvalidChildren = {
|
||||
p: /* @__PURE__ */ new Set([
|
||||
"address",
|
||||
"article",
|
||||
"aside",
|
||||
"blockquote",
|
||||
"center",
|
||||
"details",
|
||||
"dialog",
|
||||
"dir",
|
||||
"div",
|
||||
"dl",
|
||||
"fieldset",
|
||||
"figure",
|
||||
"footer",
|
||||
"form",
|
||||
"h1",
|
||||
"h2",
|
||||
"h3",
|
||||
"h4",
|
||||
"h5",
|
||||
"h6",
|
||||
"header",
|
||||
"hgroup",
|
||||
"hr",
|
||||
"li",
|
||||
"main",
|
||||
"nav",
|
||||
"menu",
|
||||
"ol",
|
||||
"p",
|
||||
"pre",
|
||||
"section",
|
||||
"table",
|
||||
"ul"
|
||||
]),
|
||||
svg: /* @__PURE__ */ new Set([
|
||||
"b",
|
||||
"blockquote",
|
||||
"br",
|
||||
"code",
|
||||
"dd",
|
||||
"div",
|
||||
"dl",
|
||||
"dt",
|
||||
"em",
|
||||
"embed",
|
||||
"h1",
|
||||
"h2",
|
||||
"h3",
|
||||
"h4",
|
||||
"h5",
|
||||
"h6",
|
||||
"hr",
|
||||
"i",
|
||||
"img",
|
||||
"li",
|
||||
"menu",
|
||||
"meta",
|
||||
"ol",
|
||||
"p",
|
||||
"pre",
|
||||
"ruby",
|
||||
"s",
|
||||
"small",
|
||||
"span",
|
||||
"strong",
|
||||
"sub",
|
||||
"sup",
|
||||
"table",
|
||||
"u",
|
||||
"ul",
|
||||
"var"
|
||||
])
|
||||
};
|
||||
const knownInvalidParents = {
|
||||
a: /* @__PURE__ */ new Set(["a"]),
|
||||
button: /* @__PURE__ */ new Set(["button"]),
|
||||
dd: /* @__PURE__ */ new Set(["dd", "dt"]),
|
||||
dt: /* @__PURE__ */ new Set(["dd", "dt"]),
|
||||
form: /* @__PURE__ */ new Set(["form"]),
|
||||
li: /* @__PURE__ */ new Set(["li"]),
|
||||
h1: headings,
|
||||
h2: headings,
|
||||
h3: headings,
|
||||
h4: headings,
|
||||
h5: headings,
|
||||
h6: headings
|
||||
};
|
||||
|
||||
const validateHtmlNesting = (node, context) => {
|
||||
if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
|
||||
const error = new SyntaxError(
|
||||
`<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
|
||||
);
|
||||
error.loc = node.loc;
|
||||
context.onWarn(error);
|
||||
}
|
||||
};
|
||||
|
||||
const DOMNodeTransforms = [
|
||||
transformStyle,
|
||||
...!!(process.env.NODE_ENV !== "production") ? [transformTransition] : []
|
||||
...!!(process.env.NODE_ENV !== "production") ? [transformTransition, validateHtmlNesting] : []
|
||||
];
|
||||
const DOMDirectiveTransforms = {
|
||||
cloak: noopDirectiveTransform,
|
||||
|
||||
980
node_modules/@vue/compiler-dom/dist/compiler-dom.global.js
generated
vendored
980
node_modules/@vue/compiler-dom/dist/compiler-dom.global.js
generated
vendored
File diff suppressed because it is too large
Load Diff
11
node_modules/@vue/compiler-dom/dist/compiler-dom.global.prod.js
generated
vendored
11
node_modules/@vue/compiler-dom/dist/compiler-dom.global.prod.js
generated
vendored
File diff suppressed because one or more lines are too long
6
node_modules/@vue/compiler-dom/package.json
generated
vendored
6
node_modules/@vue/compiler-dom/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/compiler-dom",
|
||||
"version": "3.4.15",
|
||||
"version": "3.5.13",
|
||||
"description": "@vue/compiler-dom",
|
||||
"main": "index.js",
|
||||
"module": "dist/compiler-dom.esm-bundler.js",
|
||||
@@ -51,7 +51,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-dom#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.4.15",
|
||||
"@vue/compiler-core": "3.4.15"
|
||||
"@vue/shared": "3.5.13",
|
||||
"@vue/compiler-core": "3.5.13"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user