fix price and modular
This commit is contained in:
+139
-178
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/compiler-core v3.5.22
|
||||
* @vue/compiler-core v3.5.14
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -1063,7 +1063,7 @@ class Tokenizer {
|
||||
this.buffer = input;
|
||||
while (this.index < this.buffer.length) {
|
||||
const c = this.buffer.charCodeAt(this.index);
|
||||
if (c === 10 && this.state !== 33) {
|
||||
if (c === 10) {
|
||||
this.newlines.push(this.index);
|
||||
}
|
||||
switch (this.state) {
|
||||
@@ -1570,34 +1570,16 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
|
||||
(id) => markScopeIdentifier(node, id, knownIds)
|
||||
);
|
||||
}
|
||||
} else if (node.type === "SwitchStatement") {
|
||||
if (node.scopeIds) {
|
||||
node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
|
||||
} else {
|
||||
walkSwitchStatement(
|
||||
node,
|
||||
false,
|
||||
(id) => markScopeIdentifier(node, id, knownIds)
|
||||
);
|
||||
}
|
||||
} else if (node.type === "CatchClause" && node.param) {
|
||||
if (node.scopeIds) {
|
||||
node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
|
||||
} else {
|
||||
for (const id of extractIdentifiers(node.param)) {
|
||||
markScopeIdentifier(node, id, knownIds);
|
||||
}
|
||||
for (const id of extractIdentifiers(node.param)) {
|
||||
markScopeIdentifier(node, id, knownIds);
|
||||
}
|
||||
} else if (isForStatement(node)) {
|
||||
if (node.scopeIds) {
|
||||
node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
|
||||
} else {
|
||||
walkForStatement(
|
||||
node,
|
||||
false,
|
||||
(id) => markScopeIdentifier(node, id, knownIds)
|
||||
);
|
||||
}
|
||||
walkForStatement(
|
||||
node,
|
||||
false,
|
||||
(id) => markScopeIdentifier(node, id, knownIds)
|
||||
);
|
||||
}
|
||||
},
|
||||
leave(node, parent) {
|
||||
@@ -1620,15 +1602,14 @@ function isReferencedIdentifier(id, parent, parentStack) {
|
||||
if (id.name === "arguments") {
|
||||
return false;
|
||||
}
|
||||
if (isReferenced(id, parent, parentStack[parentStack.length - 2])) {
|
||||
if (isReferenced(id, parent)) {
|
||||
return true;
|
||||
}
|
||||
switch (parent.type) {
|
||||
case "AssignmentExpression":
|
||||
case "AssignmentPattern":
|
||||
return true;
|
||||
case "ObjectProperty":
|
||||
return parent.key !== id && isInDestructureAssignment(parent, parentStack);
|
||||
case "ObjectPattern":
|
||||
case "ArrayPattern":
|
||||
return isInDestructureAssignment(parent, parentStack);
|
||||
}
|
||||
@@ -1668,8 +1649,7 @@ function walkFunctionParams(node, onIdent) {
|
||||
}
|
||||
}
|
||||
function walkBlockDeclarations(block, onIdent) {
|
||||
const body = block.type === "SwitchCase" ? block.consequent : block.body;
|
||||
for (const stmt of body) {
|
||||
for (const stmt of block.body) {
|
||||
if (stmt.type === "VariableDeclaration") {
|
||||
if (stmt.declare) continue;
|
||||
for (const decl of stmt.declarations) {
|
||||
@@ -1682,8 +1662,6 @@ function walkBlockDeclarations(block, onIdent) {
|
||||
onIdent(stmt.id);
|
||||
} else if (isForStatement(stmt)) {
|
||||
walkForStatement(stmt, true, onIdent);
|
||||
} else if (stmt.type === "SwitchStatement") {
|
||||
walkSwitchStatement(stmt, true, onIdent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1700,20 +1678,6 @@ function walkForStatement(stmt, isVar, onIdent) {
|
||||
}
|
||||
}
|
||||
}
|
||||
function walkSwitchStatement(stmt, isVar, onIdent) {
|
||||
for (const cs of stmt.cases) {
|
||||
for (const stmt2 of cs.consequent) {
|
||||
if (stmt2.type === "VariableDeclaration" && (stmt2.kind === "var" ? isVar : !isVar)) {
|
||||
for (const decl of stmt2.declarations) {
|
||||
for (const id of extractIdentifiers(decl.id)) {
|
||||
onIdent(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
walkBlockDeclarations(cs, onIdent);
|
||||
}
|
||||
}
|
||||
function extractIdentifiers(param, nodes = []) {
|
||||
switch (param.type) {
|
||||
case "Identifier":
|
||||
@@ -1814,7 +1778,7 @@ function isReferenced(node, parent, grandparent) {
|
||||
if (parent.key === node) {
|
||||
return !!parent.computed;
|
||||
}
|
||||
return !grandparent || grandparent.type !== "ObjectPattern";
|
||||
return true;
|
||||
// no: class { NODE = value; }
|
||||
// yes: class { [NODE] = value; }
|
||||
// yes: class { key = NODE; }
|
||||
@@ -1864,9 +1828,6 @@ function isReferenced(node, parent, grandparent) {
|
||||
// yes: export { NODE as foo };
|
||||
// no: export { NODE as foo } from "foo";
|
||||
case "ExportSpecifier":
|
||||
if (grandparent == null ? void 0 : grandparent.source) {
|
||||
return false;
|
||||
}
|
||||
return parent.local === node;
|
||||
// no: import NODE from "foo";
|
||||
// no: import * as NODE from "foo";
|
||||
@@ -1947,7 +1908,7 @@ function isCoreComponent(tag) {
|
||||
return BASE_TRANSITION;
|
||||
}
|
||||
}
|
||||
const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
|
||||
const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
|
||||
const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
|
||||
const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
|
||||
const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
|
||||
@@ -2027,7 +1988,7 @@ const isMemberExpressionNode = (exp, context) => {
|
||||
}
|
||||
};
|
||||
const isMemberExpression = isMemberExpressionNode;
|
||||
const fnExpRE = /^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
||||
const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
||||
const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
|
||||
const isFnExpressionNode = (exp, context) => {
|
||||
try {
|
||||
@@ -2112,9 +2073,6 @@ function hasDynamicKeyVBind(node) {
|
||||
function isText$1(node) {
|
||||
return node.type === 5 || node.type === 2;
|
||||
}
|
||||
function isVPre(p) {
|
||||
return p.type === 7 && p.name === "pre";
|
||||
}
|
||||
function isVSlot(p) {
|
||||
return p.type === 7 && p.name === "slot";
|
||||
}
|
||||
@@ -2413,7 +2371,7 @@ const tokenizer = new Tokenizer(stack, {
|
||||
ondirarg(start, end) {
|
||||
if (start === end) return;
|
||||
const arg = getSlice(start, end);
|
||||
if (inVPre && !isVPre(currentProp)) {
|
||||
if (inVPre) {
|
||||
currentProp.name += arg;
|
||||
setLocEnd(currentProp.nameLoc, end);
|
||||
} else {
|
||||
@@ -2428,7 +2386,7 @@ const tokenizer = new Tokenizer(stack, {
|
||||
},
|
||||
ondirmodifier(start, end) {
|
||||
const mod = getSlice(start, end);
|
||||
if (inVPre && !isVPre(currentProp)) {
|
||||
if (inVPre) {
|
||||
currentProp.name += "." + mod;
|
||||
setLocEnd(currentProp.nameLoc, end);
|
||||
} else if (currentProp.name === "slot") {
|
||||
@@ -2821,7 +2779,7 @@ function isUpperCase(c) {
|
||||
return c > 64 && c < 91;
|
||||
}
|
||||
const windowsNewlineRE = /\r\n/g;
|
||||
function condenseWhitespace(nodes) {
|
||||
function condenseWhitespace(nodes, tag) {
|
||||
const shouldCondense = currentOptions.whitespace !== "preserve";
|
||||
let removedWhitespace = false;
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
@@ -3000,12 +2958,12 @@ function cacheStatic(root, context) {
|
||||
context,
|
||||
// Root node is unfortunately non-hoistable due to potential parent
|
||||
// fallthrough attributes.
|
||||
!!getSingleElementRoot(root)
|
||||
isSingleElementRoot(root, root.children[0])
|
||||
);
|
||||
}
|
||||
function getSingleElementRoot(root) {
|
||||
const children = root.children.filter((x) => x.type !== 3);
|
||||
return children.length === 1 && children[0].type === 1 && !isSlotOutlet(children[0]) ? children[0] : null;
|
||||
function isSingleElementRoot(root, child) {
|
||||
const { children } = root;
|
||||
return children.length === 1 && child.type === 1 && !isSlotOutlet(child);
|
||||
}
|
||||
function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
||||
const { children } = node;
|
||||
@@ -3038,11 +2996,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
||||
} else if (child.type === 12) {
|
||||
const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
|
||||
if (constantType >= 2) {
|
||||
if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {
|
||||
child.codegenNode.arguments.push(
|
||||
-1 + (``)
|
||||
);
|
||||
}
|
||||
toCache.push(child);
|
||||
continue;
|
||||
}
|
||||
@@ -3071,6 +3024,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
||||
}
|
||||
}
|
||||
let cachedAsArray = false;
|
||||
const slotCacheKeys = [];
|
||||
if (toCache.length === children.length && node.type === 1) {
|
||||
if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) {
|
||||
node.codegenNode.children = getCacheExpression(
|
||||
@@ -3080,6 +3034,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
||||
} else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
||||
const slot = getSlotNode(node.codegenNode, "default");
|
||||
if (slot) {
|
||||
slotCacheKeys.push(context.cached.length);
|
||||
slot.returns = getCacheExpression(
|
||||
createArrayExpression(slot.returns)
|
||||
);
|
||||
@@ -3089,6 +3044,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
||||
const slotName = findDir(node, "slot", true);
|
||||
const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
|
||||
if (slot) {
|
||||
slotCacheKeys.push(context.cached.length);
|
||||
slot.returns = getCacheExpression(
|
||||
createArrayExpression(slot.returns)
|
||||
);
|
||||
@@ -3098,12 +3054,23 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
||||
}
|
||||
if (!cachedAsArray) {
|
||||
for (const child of toCache) {
|
||||
slotCacheKeys.push(context.cached.length);
|
||||
child.codegenNode = context.cache(child.codegenNode);
|
||||
}
|
||||
}
|
||||
if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
||||
node.codegenNode.children.properties.push(
|
||||
createObjectProperty(
|
||||
`__`,
|
||||
createSimpleExpression(JSON.stringify(slotCacheKeys), false)
|
||||
)
|
||||
);
|
||||
}
|
||||
function getCacheExpression(value) {
|
||||
const exp = context.cache(value);
|
||||
exp.needArraySpread = true;
|
||||
if (inFor && context.hmr) {
|
||||
exp.needArraySpread = true;
|
||||
}
|
||||
return exp;
|
||||
}
|
||||
function getSlotNode(node2, name) {
|
||||
@@ -3476,15 +3443,15 @@ function createRootCodegen(root, context) {
|
||||
const { helper } = context;
|
||||
const { children } = root;
|
||||
if (children.length === 1) {
|
||||
const singleElementRootChild = getSingleElementRoot(root);
|
||||
if (singleElementRootChild && singleElementRootChild.codegenNode) {
|
||||
const codegenNode = singleElementRootChild.codegenNode;
|
||||
const child = children[0];
|
||||
if (isSingleElementRoot(root, child) && child.codegenNode) {
|
||||
const codegenNode = child.codegenNode;
|
||||
if (codegenNode.type === 13) {
|
||||
convertToBlock(codegenNode, context);
|
||||
}
|
||||
root.codegenNode = codegenNode;
|
||||
} else {
|
||||
root.codegenNode = children[0];
|
||||
root.codegenNode = child;
|
||||
}
|
||||
} else if (children.length > 1) {
|
||||
let patchFlag = 64;
|
||||
@@ -3640,9 +3607,7 @@ function createCodegenContext(ast, {
|
||||
name = content;
|
||||
}
|
||||
}
|
||||
if (node.loc.source) {
|
||||
addMapping(node.loc.start, name);
|
||||
}
|
||||
addMapping(node.loc.start, name);
|
||||
}
|
||||
if (newlineIndex === -3 /* Unknown */) {
|
||||
advancePositionWithMutation(context, code);
|
||||
@@ -3658,7 +3623,7 @@ function createCodegenContext(ast, {
|
||||
context.column = code.length - newlineIndex;
|
||||
}
|
||||
}
|
||||
if (node && node.loc !== locStub && node.loc.source) {
|
||||
if (node && node.loc !== locStub) {
|
||||
addMapping(node.loc.end);
|
||||
}
|
||||
}
|
||||
@@ -4579,7 +4544,7 @@ function isConst(type) {
|
||||
}
|
||||
|
||||
const transformIf = createStructuralDirectiveTransform(
|
||||
/^(?:if|else|else-if)$/,
|
||||
/^(if|else|else-if)$/,
|
||||
(node, dir, context) => {
|
||||
return processIf(node, dir, context, (ifNode, branch, isRoot) => {
|
||||
const siblings = context.parent.children;
|
||||
@@ -4646,7 +4611,7 @@ function processIf(node, dir, context, processCodegen) {
|
||||
continue;
|
||||
}
|
||||
if (sibling && sibling.type === 9) {
|
||||
if ((dir.name === "else-if" || dir.name === "else") && sibling.branches[sibling.branches.length - 1].condition === void 0) {
|
||||
if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
|
||||
context.onError(
|
||||
createCompilerError(30, node.loc)
|
||||
);
|
||||
@@ -4788,6 +4753,90 @@ function getParentCondition(node) {
|
||||
}
|
||||
}
|
||||
|
||||
const transformBind = (dir, _node, context) => {
|
||||
const { modifiers, loc } = dir;
|
||||
const arg = dir.arg;
|
||||
let { exp } = dir;
|
||||
if (exp && exp.type === 4 && !exp.content.trim()) {
|
||||
{
|
||||
context.onError(
|
||||
createCompilerError(34, loc)
|
||||
);
|
||||
return {
|
||||
props: [
|
||||
createObjectProperty(arg, createSimpleExpression("", true, loc))
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
if (!exp) {
|
||||
if (arg.type !== 4 || !arg.isStatic) {
|
||||
context.onError(
|
||||
createCompilerError(
|
||||
52,
|
||||
arg.loc
|
||||
)
|
||||
);
|
||||
return {
|
||||
props: [
|
||||
createObjectProperty(arg, createSimpleExpression("", true, loc))
|
||||
]
|
||||
};
|
||||
}
|
||||
transformBindShorthand(dir, context);
|
||||
exp = dir.exp;
|
||||
}
|
||||
if (arg.type !== 4) {
|
||||
arg.children.unshift(`(`);
|
||||
arg.children.push(`) || ""`);
|
||||
} else if (!arg.isStatic) {
|
||||
arg.content = `${arg.content} || ""`;
|
||||
}
|
||||
if (modifiers.some((mod) => mod.content === "camel")) {
|
||||
if (arg.type === 4) {
|
||||
if (arg.isStatic) {
|
||||
arg.content = shared.camelize(arg.content);
|
||||
} else {
|
||||
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
||||
}
|
||||
} else {
|
||||
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
||||
arg.children.push(`)`);
|
||||
}
|
||||
}
|
||||
if (!context.inSSR) {
|
||||
if (modifiers.some((mod) => mod.content === "prop")) {
|
||||
injectPrefix(arg, ".");
|
||||
}
|
||||
if (modifiers.some((mod) => mod.content === "attr")) {
|
||||
injectPrefix(arg, "^");
|
||||
}
|
||||
}
|
||||
return {
|
||||
props: [createObjectProperty(arg, exp)]
|
||||
};
|
||||
};
|
||||
const transformBindShorthand = (dir, context) => {
|
||||
const arg = dir.arg;
|
||||
const propName = shared.camelize(arg.content);
|
||||
dir.exp = createSimpleExpression(propName, false, arg.loc);
|
||||
{
|
||||
dir.exp = processExpression(dir.exp, context);
|
||||
}
|
||||
};
|
||||
const injectPrefix = (arg, prefix) => {
|
||||
if (arg.type === 4) {
|
||||
if (arg.isStatic) {
|
||||
arg.content = prefix + arg.content;
|
||||
} else {
|
||||
arg.content = `\`${prefix}\${${arg.content}}\``;
|
||||
}
|
||||
} else {
|
||||
arg.children.unshift(`'${prefix}' + (`);
|
||||
arg.children.push(`)`);
|
||||
}
|
||||
};
|
||||
|
||||
const transformFor = createStructuralDirectiveTransform(
|
||||
"for",
|
||||
(node, dir, context) => {
|
||||
@@ -4800,6 +4849,9 @@ const transformFor = createStructuralDirectiveTransform(
|
||||
const memo = findDir(node, "memo");
|
||||
const keyProp = findProp(node, `key`, false, true);
|
||||
const isDirKey = keyProp && keyProp.type === 7;
|
||||
if (isDirKey && !keyProp.exp) {
|
||||
transformBindShorthand(keyProp, context);
|
||||
}
|
||||
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
||||
if (memo && keyExp && isDirKey) {
|
||||
{
|
||||
@@ -5080,9 +5132,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
||||
const dynamicSlots = [];
|
||||
let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
|
||||
if (!context.ssr && context.prefixIdentifiers) {
|
||||
hasDynamicSlots = node.props.some(
|
||||
(prop) => isVSlot(prop) && (hasScopeRef(prop.arg, context.identifiers) || hasScopeRef(prop.exp, context.identifiers))
|
||||
) || children.some((child) => hasScopeRef(child, context.identifiers));
|
||||
hasDynamicSlots = hasScopeRef(node, context.identifiers);
|
||||
}
|
||||
const onComponentSlot = findDir(node, "slot", true);
|
||||
if (onComponentSlot) {
|
||||
@@ -5145,7 +5195,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
||||
);
|
||||
} else if (vElse = findDir(
|
||||
slotElement,
|
||||
/^else(?:-if)?$/,
|
||||
/^else(-if)?$/,
|
||||
true
|
||||
/* allowEmpty */
|
||||
)) {
|
||||
@@ -5153,11 +5203,11 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
||||
let prev;
|
||||
while (j--) {
|
||||
prev = children[j];
|
||||
if (prev.type !== 3 && isNonWhitespaceContent(prev)) {
|
||||
if (prev.type !== 3) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (prev && isTemplateNode(prev) && findDir(prev, /^(?:else-)?if$/)) {
|
||||
if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
|
||||
let conditional = dynamicSlots[dynamicSlots.length - 1];
|
||||
while (conditional.alternate.type === 19) {
|
||||
conditional = conditional.alternate;
|
||||
@@ -5648,8 +5698,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
||||
hasDynamicKeys = true;
|
||||
if (exp) {
|
||||
if (isVBind) {
|
||||
pushRefVForMarker();
|
||||
pushMergeArg();
|
||||
{
|
||||
pushMergeArg();
|
||||
if (isCompatEnabled(
|
||||
"COMPILER_V_BIND_OBJECT_ORDER",
|
||||
context
|
||||
@@ -5658,8 +5709,6 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
||||
continue;
|
||||
}
|
||||
}
|
||||
pushRefVForMarker();
|
||||
pushMergeArg();
|
||||
mergeArgs.push(exp);
|
||||
} else {
|
||||
pushMergeArg({
|
||||
@@ -6082,65 +6131,6 @@ const transformOn = (dir, node, context, augmentor) => {
|
||||
return ret;
|
||||
};
|
||||
|
||||
const transformBind = (dir, _node, context) => {
|
||||
const { modifiers, loc } = dir;
|
||||
const arg = dir.arg;
|
||||
let { exp } = dir;
|
||||
if (exp && exp.type === 4 && !exp.content.trim()) {
|
||||
{
|
||||
context.onError(
|
||||
createCompilerError(34, loc)
|
||||
);
|
||||
return {
|
||||
props: [
|
||||
createObjectProperty(arg, createSimpleExpression("", true, loc))
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
if (arg.type !== 4) {
|
||||
arg.children.unshift(`(`);
|
||||
arg.children.push(`) || ""`);
|
||||
} else if (!arg.isStatic) {
|
||||
arg.content = arg.content ? `${arg.content} || ""` : `""`;
|
||||
}
|
||||
if (modifiers.some((mod) => mod.content === "camel")) {
|
||||
if (arg.type === 4) {
|
||||
if (arg.isStatic) {
|
||||
arg.content = shared.camelize(arg.content);
|
||||
} else {
|
||||
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
||||
}
|
||||
} else {
|
||||
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
||||
arg.children.push(`)`);
|
||||
}
|
||||
}
|
||||
if (!context.inSSR) {
|
||||
if (modifiers.some((mod) => mod.content === "prop")) {
|
||||
injectPrefix(arg, ".");
|
||||
}
|
||||
if (modifiers.some((mod) => mod.content === "attr")) {
|
||||
injectPrefix(arg, "^");
|
||||
}
|
||||
}
|
||||
return {
|
||||
props: [createObjectProperty(arg, exp)]
|
||||
};
|
||||
};
|
||||
const injectPrefix = (arg, prefix) => {
|
||||
if (arg.type === 4) {
|
||||
if (arg.isStatic) {
|
||||
arg.content = prefix + arg.content;
|
||||
} else {
|
||||
arg.content = `\`${prefix}\${${arg.content}}\``;
|
||||
}
|
||||
} else {
|
||||
arg.children.unshift(`'${prefix}' + (`);
|
||||
arg.children.push(`)`);
|
||||
}
|
||||
};
|
||||
|
||||
const transformText = (node, context) => {
|
||||
if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
|
||||
return () => {
|
||||
@@ -6469,7 +6459,7 @@ const seen = /* @__PURE__ */ new WeakSet();
|
||||
const transformMemo = (node, context) => {
|
||||
if (node.type === 1) {
|
||||
const dir = findDir(node, "memo");
|
||||
if (!dir || seen.has(node) || context.inSSR) {
|
||||
if (!dir || seen.has(node)) {
|
||||
return;
|
||||
}
|
||||
seen.add(node);
|
||||
@@ -6491,35 +6481,9 @@ const transformMemo = (node, context) => {
|
||||
}
|
||||
};
|
||||
|
||||
const transformVBindShorthand = (node, context) => {
|
||||
if (node.type === 1) {
|
||||
for (const prop of node.props) {
|
||||
if (prop.type === 7 && prop.name === "bind" && !prop.exp) {
|
||||
const arg = prop.arg;
|
||||
if (arg.type !== 4 || !arg.isStatic) {
|
||||
context.onError(
|
||||
createCompilerError(
|
||||
52,
|
||||
arg.loc
|
||||
)
|
||||
);
|
||||
prop.exp = createSimpleExpression("", true, arg.loc);
|
||||
} else {
|
||||
const propName = shared.camelize(arg.content);
|
||||
if (validFirstIdentCharRE.test(propName[0]) || // allow hyphen first char for https://github.com/vuejs/language-tools/pull/3424
|
||||
propName[0] === "-") {
|
||||
prop.exp = createSimpleExpression(propName, false, arg.loc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function getBaseTransformPreset(prefixIdentifiers) {
|
||||
return [
|
||||
[
|
||||
transformVBindShorthand,
|
||||
transformOnce,
|
||||
transformIf,
|
||||
transformMemo,
|
||||
@@ -6711,7 +6675,6 @@ exports.isStaticProperty = isStaticProperty;
|
||||
exports.isStaticPropertyKey = isStaticPropertyKey;
|
||||
exports.isTemplateNode = isTemplateNode;
|
||||
exports.isText = isText$1;
|
||||
exports.isVPre = isVPre;
|
||||
exports.isVSlot = isVSlot;
|
||||
exports.locStub = locStub;
|
||||
exports.noopDirectiveTransform = noopDirectiveTransform;
|
||||
@@ -6731,10 +6694,8 @@ exports.transformElement = transformElement;
|
||||
exports.transformExpression = transformExpression;
|
||||
exports.transformModel = transformModel;
|
||||
exports.transformOn = transformOn;
|
||||
exports.transformVBindShorthand = transformVBindShorthand;
|
||||
exports.traverseNode = traverseNode;
|
||||
exports.unwrapTSNode = unwrapTSNode;
|
||||
exports.validFirstIdentCharRE = validFirstIdentCharRE;
|
||||
exports.walkBlockDeclarations = walkBlockDeclarations;
|
||||
exports.walkFunctionParams = walkFunctionParams;
|
||||
exports.walkIdentifiers = walkIdentifiers;
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.14
|
||||
Generated
Vendored
Generated
Vendored
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/compiler-core",
|
||||
"version": "3.5.22",
|
||||
"version": "3.5.14",
|
||||
"description": "@vue/compiler-core",
|
||||
"main": "index.js",
|
||||
"module": "dist/compiler-core.esm-bundler.js",
|
||||
@@ -46,13 +46,13 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.28.4",
|
||||
"@babel/parser": "^7.27.2",
|
||||
"entities": "^4.5.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map-js": "^1.2.1",
|
||||
"@vue/shared": "3.5.22"
|
||||
"@vue/shared": "3.5.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/types": "^7.28.4"
|
||||
"@babel/types": "^7.27.1"
|
||||
}
|
||||
}
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.26
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../entities@7.0.0
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/compiler-core v3.5.26
|
||||
* @vue/compiler-core v3.5.27
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.27
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../entities@7.0.1
|
||||
Generated
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/compiler-core",
|
||||
"version": "3.5.26",
|
||||
"version": "3.5.27",
|
||||
"description": "@vue/compiler-core",
|
||||
"main": "index.js",
|
||||
"module": "dist/compiler-core.esm-bundler.js",
|
||||
@@ -50,7 +50,7 @@
|
||||
"entities": "^7.0.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map-js": "^1.2.1",
|
||||
"@vue/shared": "3.5.26"
|
||||
"@vue/shared": "3.5.27"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/types": "^7.28.5"
|
||||
+2
-5
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/compiler-dom v3.5.22
|
||||
* @vue/compiler-dom v3.5.14
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -458,7 +458,7 @@ const getCachedNode = (node) => {
|
||||
return node.codegenNode;
|
||||
}
|
||||
};
|
||||
const dataAriaRE = /^(?:data|aria)-/;
|
||||
const dataAriaRE = /^(data|aria)-/;
|
||||
const isStringifiableAttr = (name, ns) => {
|
||||
return (ns === 0 ? shared.isKnownHtmlAttr(name) : ns === 1 ? shared.isKnownSvgAttr(name) : ns === 2 ? shared.isKnownMathMLAttr(name) : false) || dataAriaRE.test(name);
|
||||
};
|
||||
@@ -469,9 +469,6 @@ function analyzeNode(node) {
|
||||
if (node.type === 1 && isNonStringifiable(node.tag)) {
|
||||
return false;
|
||||
}
|
||||
if (node.type === 1 && compilerCore.findDir(node, "once", true)) {
|
||||
return false;
|
||||
}
|
||||
if (node.type === 12) {
|
||||
return [1, 0];
|
||||
}
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../compiler-core@3.5.14
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.14
|
||||
Generated
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/compiler-dom",
|
||||
"version": "3.5.22",
|
||||
"version": "3.5.14",
|
||||
"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.5.22",
|
||||
"@vue/compiler-core": "3.5.22"
|
||||
"@vue/shared": "3.5.14",
|
||||
"@vue/compiler-core": "3.5.14"
|
||||
}
|
||||
}
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../compiler-core@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../compiler-core@3.5.26
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.26
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/compiler-dom v3.5.26
|
||||
* @vue/compiler-dom v3.5.27
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../compiler-core@3.5.27
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.27
|
||||
Generated
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/compiler-dom",
|
||||
"version": "3.5.26",
|
||||
"version": "3.5.27",
|
||||
"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/compiler-core": "3.5.26",
|
||||
"@vue/shared": "3.5.26"
|
||||
"@vue/shared": "3.5.27",
|
||||
"@vue/compiler-core": "3.5.27"
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+17
-24
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/compiler-ssr v3.5.22
|
||||
* @vue/compiler-ssr v3.5.14
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -59,7 +59,7 @@ const ssrHelpers = {
|
||||
compilerDom.registerRuntimeHelpers(ssrHelpers);
|
||||
|
||||
const ssrTransformIf = compilerDom.createStructuralDirectiveTransform(
|
||||
/^(?:if|else|else-if)$/,
|
||||
/^(if|else|else-if)$/,
|
||||
compilerDom.processIf
|
||||
);
|
||||
function ssrProcessIf(node, context, disableNestedFragments = false, disableComment = false) {
|
||||
@@ -298,14 +298,6 @@ const ssrTransformElement = (node, context) => {
|
||||
const hasCustomDir = node.props.some(
|
||||
(p) => p.type === 7 && !shared.isBuiltInDirective(p.name)
|
||||
);
|
||||
const vShowPropIndex = node.props.findIndex(
|
||||
(i) => i.type === 7 && i.name === "show"
|
||||
);
|
||||
if (vShowPropIndex !== -1) {
|
||||
const vShowProp = node.props[vShowPropIndex];
|
||||
node.props.splice(vShowPropIndex, 1);
|
||||
node.props.push(vShowProp);
|
||||
}
|
||||
const needMergeProps = hasDynamicVBind || hasCustomDir;
|
||||
if (needMergeProps) {
|
||||
const { props, directives } = compilerDom.buildProps(
|
||||
@@ -1094,17 +1086,6 @@ const ssrTransformModel = (dir, node, context) => {
|
||||
);
|
||||
}
|
||||
}
|
||||
const processSelectChildren = (children) => {
|
||||
children.forEach((child) => {
|
||||
if (child.type === 1) {
|
||||
processOption(child);
|
||||
} else if (child.type === 11) {
|
||||
processSelectChildren(child.children);
|
||||
} else if (child.type === 9) {
|
||||
child.branches.forEach((b) => processSelectChildren(b.children));
|
||||
}
|
||||
});
|
||||
};
|
||||
function processOption(plainNode) {
|
||||
if (plainNode.tag === "option") {
|
||||
if (plainNode.props.findIndex((p) => p.name === "selected") === -1) {
|
||||
@@ -1131,7 +1112,9 @@ const ssrTransformModel = (dir, node, context) => {
|
||||
);
|
||||
}
|
||||
} else if (plainNode.tag === "optgroup") {
|
||||
processSelectChildren(plainNode.children);
|
||||
plainNode.children.forEach(
|
||||
(option) => processOption(option)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (node.tagType === 0) {
|
||||
@@ -1216,7 +1199,18 @@ const ssrTransformModel = (dir, node, context) => {
|
||||
checkDuplicatedValue();
|
||||
node.children = [compilerDom.createInterpolation(model, model.loc)];
|
||||
} else if (node.tag === "select") {
|
||||
processSelectChildren(node.children);
|
||||
const processChildren = (children) => {
|
||||
children.forEach((child) => {
|
||||
if (child.type === 1) {
|
||||
processOption(child);
|
||||
} else if (child.type === 11) {
|
||||
processChildren(child.children);
|
||||
} else if (child.type === 9) {
|
||||
child.branches.forEach((b) => processChildren(b.children));
|
||||
}
|
||||
});
|
||||
};
|
||||
processChildren(node.children);
|
||||
} else {
|
||||
context.onError(
|
||||
compilerDom.createDOMCompilerError(
|
||||
@@ -1373,7 +1367,6 @@ function compile(source, options = {}) {
|
||||
...options,
|
||||
hoistStatic: false,
|
||||
nodeTransforms: [
|
||||
compilerDom.transformVBindShorthand,
|
||||
ssrTransformIf,
|
||||
ssrTransformFor,
|
||||
compilerDom.trackVForSlotScopes,
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../compiler-dom@3.5.14
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.14
|
||||
Generated
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/compiler-ssr",
|
||||
"version": "3.5.22",
|
||||
"version": "3.5.14",
|
||||
"description": "@vue/compiler-ssr",
|
||||
"main": "dist/compiler-ssr.cjs.js",
|
||||
"types": "dist/compiler-ssr.d.ts",
|
||||
@@ -28,7 +28,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-ssr#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.22",
|
||||
"@vue/compiler-dom": "3.5.22"
|
||||
"@vue/shared": "3.5.14",
|
||||
"@vue/compiler-dom": "3.5.14"
|
||||
}
|
||||
}
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../compiler-dom@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../compiler-dom@3.5.26
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.26
|
||||
Generated
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/compiler-ssr v3.5.26
|
||||
* @vue/compiler-ssr v3.5.27
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../compiler-dom@3.5.27
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.27
|
||||
Generated
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/compiler-ssr",
|
||||
"version": "3.5.26",
|
||||
"version": "3.5.27",
|
||||
"description": "@vue/compiler-ssr",
|
||||
"main": "dist/compiler-ssr.cjs.js",
|
||||
"types": "dist/compiler-ssr.d.ts",
|
||||
@@ -28,7 +28,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-ssr#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.26",
|
||||
"@vue/compiler-dom": "3.5.26"
|
||||
"@vue/shared": "3.5.27",
|
||||
"@vue/compiler-dom": "3.5.27"
|
||||
}
|
||||
}
|
||||
Generated
Vendored
Generated
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@vue/devtools-shared",
|
||||
"type": "module",
|
||||
"version": "7.7.7",
|
||||
"version": "7.7.9",
|
||||
"author": "webfansplz",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
+10
-16
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/reactivity v3.5.22
|
||||
* @vue/reactivity v3.5.14
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -491,7 +491,6 @@ class Link {
|
||||
}
|
||||
}
|
||||
class Dep {
|
||||
// TODO isolatedDeclarations "__v_skip"
|
||||
constructor(computed) {
|
||||
this.computed = computed;
|
||||
this.version = 0;
|
||||
@@ -512,10 +511,6 @@ class Dep {
|
||||
* Subscriber counter
|
||||
*/
|
||||
this.sc = 0;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
this.__v_skip = true;
|
||||
}
|
||||
track(debugInfo) {
|
||||
if (!activeSub || !shouldTrack || activeSub === this.computed) {
|
||||
@@ -740,7 +735,7 @@ const arrayInstrumentations = {
|
||||
join(separator) {
|
||||
return reactiveReadArray(this).join(separator);
|
||||
},
|
||||
// keys() iterator only reads `length`, no optimization required
|
||||
// keys() iterator only reads `length`, no optimisation required
|
||||
lastIndexOf(...args) {
|
||||
return searchProxy(this, "lastIndexOf", args);
|
||||
},
|
||||
@@ -792,7 +787,7 @@ function iterator(self, method, wrapValue) {
|
||||
iter._next = iter.next;
|
||||
iter.next = () => {
|
||||
const result = iter._next();
|
||||
if (!result.done) {
|
||||
if (result.value) {
|
||||
result.value = wrapValue(result.value);
|
||||
}
|
||||
return result;
|
||||
@@ -919,8 +914,7 @@ class BaseReactiveHandler {
|
||||
return res;
|
||||
}
|
||||
if (isRef(res)) {
|
||||
const value = targetIsArray && shared.isIntegerKey(key) ? res : res.value;
|
||||
return isReadonly2 && shared.isObject(value) ? readonly(value) : value;
|
||||
return targetIsArray && shared.isIntegerKey(key) ? res : res.value;
|
||||
}
|
||||
if (shared.isObject(res)) {
|
||||
return isReadonly2 ? readonly(res) : reactive(res);
|
||||
@@ -942,7 +936,7 @@ class MutableReactiveHandler extends BaseReactiveHandler {
|
||||
}
|
||||
if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) {
|
||||
if (isOldValueReadonly) {
|
||||
return true;
|
||||
return false;
|
||||
} else {
|
||||
oldValue.value = value;
|
||||
return true;
|
||||
@@ -1068,7 +1062,7 @@ function createInstrumentations(readonly, shallow) {
|
||||
get size() {
|
||||
const target = this["__v_raw"];
|
||||
!readonly && track(toRaw(target), "iterate", ITERATE_KEY);
|
||||
return target.size;
|
||||
return Reflect.get(target, "size", target);
|
||||
},
|
||||
has(key) {
|
||||
const target = this["__v_raw"];
|
||||
@@ -1676,11 +1670,11 @@ function watch(source, cb, options = shared.EMPTY_OBJ) {
|
||||
oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
|
||||
boundCleanup
|
||||
];
|
||||
oldValue = newValue;
|
||||
call ? call(cb, 3, args) : (
|
||||
// @ts-expect-error
|
||||
cb(...args)
|
||||
);
|
||||
oldValue = newValue;
|
||||
} finally {
|
||||
activeWatcher = currentWatcher;
|
||||
}
|
||||
@@ -1726,11 +1720,11 @@ function traverse(value, depth = Infinity, seen) {
|
||||
if (depth <= 0 || !shared.isObject(value) || value["__v_skip"]) {
|
||||
return value;
|
||||
}
|
||||
seen = seen || /* @__PURE__ */ new Map();
|
||||
if ((seen.get(value) || 0) >= depth) {
|
||||
seen = seen || /* @__PURE__ */ new Set();
|
||||
if (seen.has(value)) {
|
||||
return value;
|
||||
}
|
||||
seen.set(value, depth);
|
||||
seen.add(value);
|
||||
depth--;
|
||||
if (isRef(value)) {
|
||||
traverse(value.value, depth, seen);
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.14
|
||||
Generated
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/reactivity",
|
||||
"version": "3.5.22",
|
||||
"version": "3.5.14",
|
||||
"description": "@vue/reactivity",
|
||||
"main": "index.js",
|
||||
"module": "dist/reactivity.esm-bundler.js",
|
||||
@@ -50,6 +50,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/reactivity#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.22"
|
||||
"@vue/shared": "3.5.14"
|
||||
}
|
||||
}
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.26
|
||||
+42
-27
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/reactivity v3.5.26
|
||||
* @vue/reactivity v3.5.27
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -1050,20 +1050,20 @@ function createIterableMethod(method, isReadonly2, isShallow2) {
|
||||
"iterate",
|
||||
isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
|
||||
);
|
||||
return {
|
||||
// iterator protocol
|
||||
next() {
|
||||
const { value, done } = innerIterator.next();
|
||||
return done ? { value, done } : {
|
||||
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
|
||||
done
|
||||
};
|
||||
},
|
||||
// iterable protocol
|
||||
[Symbol.iterator]() {
|
||||
return this;
|
||||
return shared.extend(
|
||||
// inheriting all iterator properties
|
||||
Object.create(innerIterator),
|
||||
{
|
||||
// iterator protocol
|
||||
next() {
|
||||
const { value, done } = innerIterator.next();
|
||||
return done ? { value, done } : {
|
||||
value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
|
||||
done
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
);
|
||||
};
|
||||
}
|
||||
function createReadonlyMethod(type) {
|
||||
@@ -1254,8 +1254,9 @@ function targetTypeMap(rawType) {
|
||||
function getTargetType(value) {
|
||||
return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(shared.toRawType(value));
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function reactive(target) {
|
||||
if (isReadonly(target)) {
|
||||
if (/* @__PURE__ */ isReadonly(target)) {
|
||||
return target;
|
||||
}
|
||||
return createReactiveObject(
|
||||
@@ -1266,6 +1267,7 @@ function reactive(target) {
|
||||
reactiveMap
|
||||
);
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function shallowReactive(target) {
|
||||
return createReactiveObject(
|
||||
target,
|
||||
@@ -1275,6 +1277,7 @@ function shallowReactive(target) {
|
||||
shallowReactiveMap
|
||||
);
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function readonly(target) {
|
||||
return createReactiveObject(
|
||||
target,
|
||||
@@ -1284,6 +1287,7 @@ function readonly(target) {
|
||||
readonlyMap
|
||||
);
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function shallowReadonly(target) {
|
||||
return createReactiveObject(
|
||||
target,
|
||||
@@ -1315,24 +1319,29 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
|
||||
proxyMap.set(target, proxy);
|
||||
return proxy;
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function isReactive(value) {
|
||||
if (isReadonly(value)) {
|
||||
return isReactive(value["__v_raw"]);
|
||||
if (/* @__PURE__ */ isReadonly(value)) {
|
||||
return /* @__PURE__ */ isReactive(value["__v_raw"]);
|
||||
}
|
||||
return !!(value && value["__v_isReactive"]);
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function isReadonly(value) {
|
||||
return !!(value && value["__v_isReadonly"]);
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function isShallow(value) {
|
||||
return !!(value && value["__v_isShallow"]);
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function isProxy(value) {
|
||||
return value ? !!value["__v_raw"] : false;
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function toRaw(observed) {
|
||||
const raw = observed && observed["__v_raw"];
|
||||
return raw ? toRaw(raw) : observed;
|
||||
return raw ? /* @__PURE__ */ toRaw(raw) : observed;
|
||||
}
|
||||
function markRaw(value) {
|
||||
if (!shared.hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
|
||||
@@ -1340,20 +1349,23 @@ function markRaw(value) {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
const toReactive = (value) => shared.isObject(value) ? reactive(value) : value;
|
||||
const toReadonly = (value) => shared.isObject(value) ? readonly(value) : value;
|
||||
const toReactive = (value) => shared.isObject(value) ? /* @__PURE__ */ reactive(value) : value;
|
||||
const toReadonly = (value) => shared.isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function isRef(r) {
|
||||
return r ? r["__v_isRef"] === true : false;
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function ref(value) {
|
||||
return createRef(value, false);
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function shallowRef(value) {
|
||||
return createRef(value, true);
|
||||
}
|
||||
function createRef(rawValue, shallow) {
|
||||
if (isRef(rawValue)) {
|
||||
if (/* @__PURE__ */ isRef(rawValue)) {
|
||||
return rawValue;
|
||||
}
|
||||
return new RefImpl(rawValue, shallow);
|
||||
@@ -1394,7 +1406,7 @@ function triggerRef(ref2) {
|
||||
}
|
||||
}
|
||||
function unref(ref2) {
|
||||
return isRef(ref2) ? ref2.value : ref2;
|
||||
return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
|
||||
}
|
||||
function toValue(source) {
|
||||
return shared.isFunction(source) ? source() : unref(source);
|
||||
@@ -1403,7 +1415,7 @@ const shallowUnwrapHandlers = {
|
||||
get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
|
||||
set: (target, key, value, receiver) => {
|
||||
const oldValue = target[key];
|
||||
if (isRef(oldValue) && !isRef(value)) {
|
||||
if (/* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
|
||||
oldValue.value = value;
|
||||
return true;
|
||||
} else {
|
||||
@@ -1433,6 +1445,7 @@ class CustomRefImpl {
|
||||
function customRef(factory) {
|
||||
return new CustomRefImpl(factory);
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function toRefs(object) {
|
||||
const ret = shared.isArray(object) ? new Array(object.length) : {};
|
||||
for (const key in object) {
|
||||
@@ -1465,9 +1478,9 @@ class ObjectRefImpl {
|
||||
return this._value = val === void 0 ? this._defaultValue : val;
|
||||
}
|
||||
set value(newVal) {
|
||||
if (this._shallow && isRef(this._raw[this._key])) {
|
||||
if (this._shallow && /* @__PURE__ */ isRef(this._raw[this._key])) {
|
||||
const nestedRef = this._object[this._key];
|
||||
if (isRef(nestedRef)) {
|
||||
if (/* @__PURE__ */ isRef(nestedRef)) {
|
||||
nestedRef.value = newVal;
|
||||
return;
|
||||
}
|
||||
@@ -1489,15 +1502,16 @@ class GetterRefImpl {
|
||||
return this._value = this._getter();
|
||||
}
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function toRef(source, key, defaultValue) {
|
||||
if (isRef(source)) {
|
||||
if (/* @__PURE__ */ isRef(source)) {
|
||||
return source;
|
||||
} else if (shared.isFunction(source)) {
|
||||
return new GetterRefImpl(source);
|
||||
} else if (shared.isObject(source) && arguments.length > 1) {
|
||||
return propertyToRef(source, key, defaultValue);
|
||||
} else {
|
||||
return ref(source);
|
||||
return /* @__PURE__ */ ref(source);
|
||||
}
|
||||
}
|
||||
function propertyToRef(source, key, defaultValue) {
|
||||
@@ -1572,6 +1586,7 @@ class ComputedRefImpl {
|
||||
}
|
||||
}
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
||||
let getter;
|
||||
let setter;
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.27
|
||||
Generated
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/reactivity",
|
||||
"version": "3.5.26",
|
||||
"version": "3.5.27",
|
||||
"description": "@vue/reactivity",
|
||||
"main": "index.js",
|
||||
"module": "dist/reactivity.esm-bundler.js",
|
||||
@@ -50,6 +50,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/reactivity#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.26"
|
||||
"@vue/shared": "3.5.27"
|
||||
}
|
||||
}
|
||||
+86
-133
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/runtime-core v3.5.22
|
||||
* @vue/runtime-core v3.5.14
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -414,6 +414,9 @@ const TeleportImpl = {
|
||||
insert(mainAnchor, container, anchor);
|
||||
const mount = (container2, anchor2) => {
|
||||
if (shapeFlag & 16) {
|
||||
if (parentComponent && parentComponent.isCE) {
|
||||
parentComponent.ce._teleportTarget = container2;
|
||||
}
|
||||
mountChildren(
|
||||
children,
|
||||
container2,
|
||||
@@ -435,9 +438,6 @@ const TeleportImpl = {
|
||||
} else if (namespace !== "mathml" && isTargetMathML(target)) {
|
||||
namespace = "mathml";
|
||||
}
|
||||
if (parentComponent && parentComponent.isCE) {
|
||||
(parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
||||
}
|
||||
if (!disabled) {
|
||||
mount(target, targetAnchor);
|
||||
updateCssVars(n2, false);
|
||||
@@ -449,16 +449,15 @@ const TeleportImpl = {
|
||||
updateCssVars(n2, true);
|
||||
}
|
||||
if (isTeleportDeferred(n2.props)) {
|
||||
n2.el.__isMounted = false;
|
||||
queuePostRenderEffect(() => {
|
||||
mountToTarget();
|
||||
delete n2.el.__isMounted;
|
||||
n2.el.__isMounted = true;
|
||||
}, parentSuspense);
|
||||
} else {
|
||||
mountToTarget();
|
||||
}
|
||||
} else {
|
||||
if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
|
||||
if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
|
||||
queuePostRenderEffect(() => {
|
||||
TeleportImpl.process(
|
||||
n1,
|
||||
@@ -472,6 +471,7 @@ const TeleportImpl = {
|
||||
optimized,
|
||||
internals
|
||||
);
|
||||
delete n1.el.__isMounted;
|
||||
}, parentSuspense);
|
||||
return;
|
||||
}
|
||||
@@ -614,34 +614,26 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
||||
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
|
||||
o: { nextSibling, parentNode, querySelector, insert, createText }
|
||||
}, hydrateChildren) {
|
||||
function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
|
||||
vnode2.anchor = hydrateChildren(
|
||||
nextSibling(node2),
|
||||
vnode2,
|
||||
parentNode(node2),
|
||||
parentComponent,
|
||||
parentSuspense,
|
||||
slotScopeIds,
|
||||
optimized
|
||||
);
|
||||
vnode2.targetStart = targetStart;
|
||||
vnode2.targetAnchor = targetAnchor;
|
||||
}
|
||||
const target = vnode.target = resolveTarget(
|
||||
vnode.props,
|
||||
querySelector
|
||||
);
|
||||
const disabled = isTeleportDisabled(vnode.props);
|
||||
if (target) {
|
||||
const disabled = isTeleportDisabled(vnode.props);
|
||||
const targetNode = target._lpa || target.firstChild;
|
||||
if (vnode.shapeFlag & 16) {
|
||||
if (disabled) {
|
||||
hydrateDisabledTeleport(
|
||||
node,
|
||||
vnode.anchor = hydrateChildren(
|
||||
nextSibling(node),
|
||||
vnode,
|
||||
targetNode,
|
||||
targetNode && nextSibling(targetNode)
|
||||
parentNode(node),
|
||||
parentComponent,
|
||||
parentSuspense,
|
||||
slotScopeIds,
|
||||
optimized
|
||||
);
|
||||
vnode.targetStart = targetNode;
|
||||
vnode.targetAnchor = targetNode && nextSibling(targetNode);
|
||||
} else {
|
||||
vnode.anchor = nextSibling(node);
|
||||
let targetAnchor = targetNode;
|
||||
@@ -672,10 +664,6 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
||||
}
|
||||
}
|
||||
updateCssVars(vnode, disabled);
|
||||
} else if (disabled) {
|
||||
if (vnode.shapeFlag & 16) {
|
||||
hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
|
||||
}
|
||||
}
|
||||
return vnode.anchor && nextSibling(vnode.anchor);
|
||||
}
|
||||
@@ -784,7 +772,7 @@ const BaseTransitionImpl = {
|
||||
setTransitionHooks(innerChild, enterHooks);
|
||||
}
|
||||
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
||||
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
||||
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
||||
let leavingHooks = resolveTransitionHooks(
|
||||
oldInnerChild,
|
||||
rawProps,
|
||||
@@ -1057,6 +1045,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*! #__NO_SIDE_EFFECTS__ */
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function defineComponent(options, extraOptions) {
|
||||
return shared.isFunction(options) ? (
|
||||
@@ -1094,7 +1083,6 @@ function useTemplateRef(key) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
|
||||
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
||||
if (shared.isArray(rawRef)) {
|
||||
rawRef.forEach(
|
||||
@@ -1121,22 +1109,17 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
||||
const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
||||
const setupState = owner.setupState;
|
||||
const rawSetupState = reactivity.toRaw(setupState);
|
||||
const canSetSetupRef = setupState === shared.EMPTY_OBJ ? shared.NO : (key) => {
|
||||
const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => {
|
||||
return shared.hasOwn(rawSetupState, key);
|
||||
};
|
||||
if (oldRef != null && oldRef !== ref) {
|
||||
invalidatePendingSetRef(oldRawRef);
|
||||
if (shared.isString(oldRef)) {
|
||||
refs[oldRef] = null;
|
||||
if (canSetSetupRef(oldRef)) {
|
||||
setupState[oldRef] = null;
|
||||
}
|
||||
} else if (reactivity.isRef(oldRef)) {
|
||||
{
|
||||
oldRef.value = null;
|
||||
}
|
||||
const oldRawRefAtom = oldRawRef;
|
||||
if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
|
||||
oldRef.value = null;
|
||||
}
|
||||
}
|
||||
if (shared.isFunction(ref)) {
|
||||
@@ -1147,7 +1130,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
||||
if (_isString || _isRef) {
|
||||
const doSet = () => {
|
||||
if (rawRef.f) {
|
||||
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value ;
|
||||
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
|
||||
if (isUnmount) {
|
||||
shared.isArray(existing) && shared.remove(existing, refValue);
|
||||
} else {
|
||||
@@ -1158,11 +1141,8 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
||||
setupState[ref] = refs[ref];
|
||||
}
|
||||
} else {
|
||||
const newVal = [refValue];
|
||||
{
|
||||
ref.value = newVal;
|
||||
}
|
||||
if (rawRef.k) refs[rawRef.k] = newVal;
|
||||
ref.value = [refValue];
|
||||
if (rawRef.k) refs[rawRef.k] = ref.value;
|
||||
}
|
||||
} else if (!existing.includes(refValue)) {
|
||||
existing.push(refValue);
|
||||
@@ -1174,34 +1154,19 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
||||
setupState[ref] = value;
|
||||
}
|
||||
} else if (_isRef) {
|
||||
{
|
||||
ref.value = value;
|
||||
}
|
||||
ref.value = value;
|
||||
if (rawRef.k) refs[rawRef.k] = value;
|
||||
} else ;
|
||||
};
|
||||
if (value) {
|
||||
const job = () => {
|
||||
doSet();
|
||||
pendingSetRefMap.delete(rawRef);
|
||||
};
|
||||
job.id = -1;
|
||||
pendingSetRefMap.set(rawRef, job);
|
||||
queuePostRenderEffect(job, parentSuspense);
|
||||
doSet.id = -1;
|
||||
queuePostRenderEffect(doSet, parentSuspense);
|
||||
} else {
|
||||
invalidatePendingSetRef(rawRef);
|
||||
doSet();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function invalidatePendingSetRef(rawRef) {
|
||||
const pendingSetRef = pendingSetRefMap.get(rawRef);
|
||||
if (pendingSetRef) {
|
||||
pendingSetRef.flags |= 8;
|
||||
pendingSetRefMap.delete(rawRef);
|
||||
}
|
||||
}
|
||||
|
||||
let hasLoggedMismatchError = false;
|
||||
const logMismatchError = () => {
|
||||
@@ -1425,8 +1390,6 @@ function createHydrationFunctions(rendererInternals) {
|
||||
) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
||||
const content = el.content.firstChild;
|
||||
if (needCallTransitionHooks) {
|
||||
const cls = content.getAttribute("class");
|
||||
if (cls) content.$cls = cls;
|
||||
transition.beforeEnter(content);
|
||||
}
|
||||
replaceNode(content, el, parentComponent);
|
||||
@@ -1667,7 +1630,7 @@ function isMismatchAllowed(el, allowedType) {
|
||||
if (allowedType === 0 /* TEXT */ && list.includes("children")) {
|
||||
return true;
|
||||
}
|
||||
return list.includes(MismatchTypeString[allowedType]);
|
||||
return allowedAttr.split(",").includes(MismatchTypeString[allowedType]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1763,6 +1726,7 @@ function forEachElement(node, cb) {
|
||||
}
|
||||
|
||||
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
||||
/*! #__NO_SIDE_EFFECTS__ */
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function defineAsyncComponent(source) {
|
||||
if (shared.isFunction(source)) {
|
||||
@@ -1815,23 +1779,15 @@ function defineAsyncComponent(source) {
|
||||
name: "AsyncComponentWrapper",
|
||||
__asyncLoader: load,
|
||||
__asyncHydrate(el, instance, hydrate) {
|
||||
let patched = false;
|
||||
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
||||
const performHydrate = () => {
|
||||
if (patched) {
|
||||
return;
|
||||
}
|
||||
hydrate();
|
||||
};
|
||||
const doHydrate = hydrateStrategy ? () => {
|
||||
const teardown = hydrateStrategy(
|
||||
performHydrate,
|
||||
hydrate,
|
||||
(cb) => forEachElement(el, cb)
|
||||
);
|
||||
if (teardown) {
|
||||
(instance.bum || (instance.bum = [])).push(teardown);
|
||||
}
|
||||
} : performHydrate;
|
||||
} : hydrate;
|
||||
if (resolvedComp) {
|
||||
doHydrate();
|
||||
} else {
|
||||
@@ -2327,13 +2283,12 @@ function createSlots(slots, dynamicSlots) {
|
||||
|
||||
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
||||
if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
|
||||
const hasProps = Object.keys(props).length > 0;
|
||||
if (name !== "default") props.name = name;
|
||||
return openBlock(), createBlock(
|
||||
Fragment,
|
||||
null,
|
||||
[createVNode("slot", props, fallback && fallback())],
|
||||
hasProps ? -2 : 64
|
||||
64
|
||||
);
|
||||
}
|
||||
let slot = slots[name];
|
||||
@@ -2494,10 +2449,10 @@ const PublicInstanceProxyHandlers = {
|
||||
return true;
|
||||
},
|
||||
has({
|
||||
_: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
|
||||
_: { data, setupState, accessCache, ctx, appContext, propsOptions }
|
||||
}, key) {
|
||||
let normalizedProps, cssModules;
|
||||
return !!(accessCache[key] || data !== shared.EMPTY_OBJ && key[0] !== "$" && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
|
||||
let normalizedProps;
|
||||
return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key);
|
||||
},
|
||||
defineProperty(target, key, descriptor) {
|
||||
if (descriptor.get != null) {
|
||||
@@ -2545,7 +2500,7 @@ function useSlots() {
|
||||
function useAttrs() {
|
||||
return getContext().attrs;
|
||||
}
|
||||
function getContext(calledFunctionName) {
|
||||
function getContext() {
|
||||
const i = getCurrentInstance();
|
||||
return i.setupContext || (i.setupContext = createSetupContext(i));
|
||||
}
|
||||
@@ -2724,8 +2679,7 @@ function applyOptions(instance) {
|
||||
expose.forEach((key) => {
|
||||
Object.defineProperty(exposed, key, {
|
||||
get: () => publicThis[key],
|
||||
set: (val) => publicThis[key] = val,
|
||||
enumerable: true
|
||||
set: (val) => publicThis[key] = val
|
||||
});
|
||||
});
|
||||
} else if (!instance.exposed) {
|
||||
@@ -3086,9 +3040,9 @@ function provide(key, value) {
|
||||
}
|
||||
}
|
||||
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
||||
const instance = getCurrentInstance();
|
||||
const instance = currentInstance || currentRenderingInstance;
|
||||
if (instance || currentApp) {
|
||||
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
|
||||
const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
|
||||
if (provides && key in provides) {
|
||||
return provides[key];
|
||||
} else if (arguments.length > 1) {
|
||||
@@ -3097,7 +3051,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
||||
}
|
||||
}
|
||||
function hasInjectionContext() {
|
||||
return !!(getCurrentInstance() || currentApp);
|
||||
return !!(currentInstance || currentRenderingInstance || currentApp);
|
||||
}
|
||||
|
||||
const internalObjectProto = {};
|
||||
@@ -3376,7 +3330,7 @@ function validatePropName(key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
|
||||
const isInternalKey = (key) => key[0] === "_" || key === "$stable";
|
||||
const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
||||
const normalizeSlot = (key, rawSlot, ctx) => {
|
||||
if (rawSlot._n) {
|
||||
@@ -3577,8 +3531,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
||||
}
|
||||
if (ref != null && parentComponent) {
|
||||
setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
|
||||
} else if (ref == null && n1 && n1.ref != null) {
|
||||
setRef(n1.ref, null, parentSuspense, n1, true);
|
||||
}
|
||||
};
|
||||
const processText = (n1, n2, container, anchor) => {
|
||||
@@ -3851,7 +3803,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
||||
(oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
|
||||
// which also requires the correct parent container
|
||||
!isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
|
||||
oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
|
||||
oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
|
||||
// In other cases, the parent container is not actually used so we
|
||||
// just pass the block element here to avoid a DOM parentNode call.
|
||||
fallbackContainer
|
||||
@@ -4008,7 +3960,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
||||
if (!initialVNode.el) {
|
||||
const placeholder = instance.subTree = createVNode(Comment);
|
||||
processCommentNode(null, placeholder, container, anchor);
|
||||
initialVNode.placeholder = placeholder.el;
|
||||
}
|
||||
} else {
|
||||
setupRenderEffect(
|
||||
@@ -4073,8 +4024,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
||||
hydrateSubTree();
|
||||
}
|
||||
} else {
|
||||
if (root.ce && // @ts-expect-error _def is private
|
||||
root.ce._def.shadowRoot !== false) {
|
||||
if (root.ce) {
|
||||
root.ce._injectChildStyle(type);
|
||||
}
|
||||
const subTree = instance.subTree = renderComponentRoot(instance);
|
||||
@@ -4441,11 +4391,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
||||
for (i = toBePatched - 1; i >= 0; i--) {
|
||||
const nextIndex = s2 + i;
|
||||
const nextChild = c2[nextIndex];
|
||||
const anchorVNode = c2[nextIndex + 1];
|
||||
const anchor = nextIndex + 1 < l2 ? (
|
||||
// #13559, fallback to el placeholder for unresolved async component
|
||||
anchorVNode.el || anchorVNode.placeholder
|
||||
) : parentAnchor;
|
||||
const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
|
||||
if (newIndexToOldIndexMap[i] === 0) {
|
||||
patch(
|
||||
null,
|
||||
@@ -4510,12 +4456,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
||||
}
|
||||
};
|
||||
const performLeave = () => {
|
||||
if (el._isLeaving) {
|
||||
el[leaveCbKey](
|
||||
true
|
||||
/* cancelled */
|
||||
);
|
||||
}
|
||||
leave(el, () => {
|
||||
remove2();
|
||||
afterLeave && afterLeave();
|
||||
@@ -4650,12 +4590,27 @@ function baseCreateRenderer(options, createHydrationFns) {
|
||||
hostRemove(end);
|
||||
};
|
||||
const unmountComponent = (instance, parentSuspense, doRemove) => {
|
||||
const { bum, scope, job, subTree, um, m, a } = instance;
|
||||
const {
|
||||
bum,
|
||||
scope,
|
||||
job,
|
||||
subTree,
|
||||
um,
|
||||
m,
|
||||
a,
|
||||
parent,
|
||||
slots: { __: slotCacheKeys }
|
||||
} = instance;
|
||||
invalidateMount(m);
|
||||
invalidateMount(a);
|
||||
if (bum) {
|
||||
shared.invokeArrayFns(bum);
|
||||
}
|
||||
if (parent && shared.isArray(slotCacheKeys)) {
|
||||
slotCacheKeys.forEach((v) => {
|
||||
parent.renderCache[v] = void 0;
|
||||
});
|
||||
}
|
||||
scope.stop();
|
||||
if (job) {
|
||||
job.flags |= 8;
|
||||
@@ -4667,6 +4622,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
||||
queuePostRenderEffect(() => {
|
||||
instance.isUnmounted = true;
|
||||
}, parentSuspense);
|
||||
if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
|
||||
parentSuspense.deps--;
|
||||
if (parentSuspense.deps === 0) {
|
||||
parentSuspense.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
|
||||
for (let i = start; i < children.length; i++) {
|
||||
@@ -4764,8 +4725,7 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
||||
if (!shallow && c2.patchFlag !== -2)
|
||||
traverseStaticChildren(c1, c2);
|
||||
}
|
||||
if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
|
||||
c2.patchFlag !== -1) {
|
||||
if (c2.type === Text) {
|
||||
c2.el = c1.el;
|
||||
}
|
||||
if (c2.type === Comment && !c2.el) {
|
||||
@@ -5045,9 +5005,8 @@ function emit(instance, event, ...rawArgs) {
|
||||
);
|
||||
}
|
||||
}
|
||||
const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
|
||||
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
|
||||
const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
|
||||
const cache = appContext.emitsCache;
|
||||
const cached = cache.get(comp);
|
||||
if (cached !== void 0) {
|
||||
return cached;
|
||||
@@ -5416,7 +5375,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
||||
const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
|
||||
if (pendingBranch) {
|
||||
suspense.pendingBranch = newBranch;
|
||||
if (isSameVNodeType(pendingBranch, newBranch)) {
|
||||
if (isSameVNodeType(newBranch, pendingBranch)) {
|
||||
patch(
|
||||
pendingBranch,
|
||||
newBranch,
|
||||
@@ -5487,7 +5446,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
||||
);
|
||||
setActiveBranch(suspense, newFallback);
|
||||
}
|
||||
} else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
||||
} else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
|
||||
patch(
|
||||
activeBranch,
|
||||
newBranch,
|
||||
@@ -5518,7 +5477,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
|
||||
if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
|
||||
patch(
|
||||
activeBranch,
|
||||
newBranch,
|
||||
@@ -6091,7 +6050,6 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
||||
suspense: vnode.suspense,
|
||||
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
||||
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
||||
placeholder: vnode.placeholder,
|
||||
el: vnode.el,
|
||||
anchor: vnode.anchor,
|
||||
ctx: vnode.ctx,
|
||||
@@ -6505,28 +6463,23 @@ const computed = (getterOrOptions, debugOptions) => {
|
||||
};
|
||||
|
||||
function h(type, propsOrChildren, children) {
|
||||
try {
|
||||
setBlockTracking(-1);
|
||||
const l = arguments.length;
|
||||
if (l === 2) {
|
||||
if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) {
|
||||
if (isVNode(propsOrChildren)) {
|
||||
return createVNode(type, null, [propsOrChildren]);
|
||||
}
|
||||
return createVNode(type, propsOrChildren);
|
||||
} else {
|
||||
return createVNode(type, null, propsOrChildren);
|
||||
const l = arguments.length;
|
||||
if (l === 2) {
|
||||
if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) {
|
||||
if (isVNode(propsOrChildren)) {
|
||||
return createVNode(type, null, [propsOrChildren]);
|
||||
}
|
||||
return createVNode(type, propsOrChildren);
|
||||
} else {
|
||||
if (l > 3) {
|
||||
children = Array.prototype.slice.call(arguments, 2);
|
||||
} else if (l === 3 && isVNode(children)) {
|
||||
children = [children];
|
||||
}
|
||||
return createVNode(type, propsOrChildren, children);
|
||||
return createVNode(type, null, propsOrChildren);
|
||||
}
|
||||
} finally {
|
||||
setBlockTracking(1);
|
||||
} else {
|
||||
if (l > 3) {
|
||||
children = Array.prototype.slice.call(arguments, 2);
|
||||
} else if (l === 3 && isVNode(children)) {
|
||||
children = [children];
|
||||
}
|
||||
return createVNode(type, propsOrChildren, children);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6562,7 +6515,7 @@ function isMemoSame(cached, memo) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const version = "3.5.22";
|
||||
const version = "3.5.14";
|
||||
const warn$1 = shared.NOOP;
|
||||
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
||||
const devtools = void 0;
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../reactivity@3.5.14
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.14
|
||||
Generated
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/runtime-core",
|
||||
"version": "3.5.22",
|
||||
"version": "3.5.14",
|
||||
"description": "@vue/runtime-core",
|
||||
"main": "index.js",
|
||||
"module": "dist/runtime-core.esm-bundler.js",
|
||||
@@ -46,7 +46,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.22",
|
||||
"@vue/reactivity": "3.5.22"
|
||||
"@vue/shared": "3.5.14",
|
||||
"@vue/reactivity": "3.5.14"
|
||||
}
|
||||
}
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../reactivity@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../reactivity@3.5.26
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.26
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/runtime-core v3.5.26
|
||||
* @vue/runtime-core v3.5.27
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -1606,7 +1606,7 @@ function createHydrationFunctions(rendererInternals) {
|
||||
const isCustomElement = el.tagName.includes("-");
|
||||
for (const key in props) {
|
||||
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
||||
key[0] === "." || isCustomElement) {
|
||||
key[0] === "." || isCustomElement && !shared.isReservedProp(key)) {
|
||||
patchProp(el, key, null, props[key], void 0, parentComponent);
|
||||
}
|
||||
}
|
||||
@@ -6600,7 +6600,7 @@ function isMemoSame(cached, memo) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const version = "3.5.26";
|
||||
const version = "3.5.27";
|
||||
const warn$1 = shared.NOOP;
|
||||
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
||||
const devtools = void 0;
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../reactivity@3.5.27
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.27
|
||||
Generated
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/runtime-core",
|
||||
"version": "3.5.26",
|
||||
"version": "3.5.27",
|
||||
"description": "@vue/runtime-core",
|
||||
"main": "index.js",
|
||||
"module": "dist/runtime-core.esm-bundler.js",
|
||||
@@ -46,7 +46,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.26",
|
||||
"@vue/reactivity": "3.5.26"
|
||||
"@vue/shared": "3.5.27",
|
||||
"@vue/reactivity": "3.5.27"
|
||||
}
|
||||
}
|
||||
+49
-81
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/runtime-dom v3.5.22
|
||||
* @vue/runtime-dom v3.5.14
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -216,11 +216,11 @@ function resolveTransitionProps(rawProps) {
|
||||
const resolve = () => finishLeave(el, done);
|
||||
addTransitionClass(el, leaveFromClass);
|
||||
if (!el._enterCancelled) {
|
||||
forceReflow(el);
|
||||
forceReflow();
|
||||
addTransitionClass(el, leaveActiveClass);
|
||||
} else {
|
||||
addTransitionClass(el, leaveActiveClass);
|
||||
forceReflow(el);
|
||||
forceReflow();
|
||||
}
|
||||
nextFrame(() => {
|
||||
if (!el._isLeaving) {
|
||||
@@ -343,7 +343,7 @@ function getTransitionInfo(el, expectedType) {
|
||||
type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
|
||||
propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
|
||||
}
|
||||
const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
|
||||
const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
|
||||
getStyleProperties(`${TRANSITION}Property`).toString()
|
||||
);
|
||||
return {
|
||||
@@ -363,9 +363,8 @@ function toMs(s) {
|
||||
if (s === "auto") return 0;
|
||||
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
||||
}
|
||||
function forceReflow(el) {
|
||||
const targetDocument = el ? el.ownerDocument : document;
|
||||
return targetDocument.body.offsetHeight;
|
||||
function forceReflow() {
|
||||
return document.body.offsetHeight;
|
||||
}
|
||||
|
||||
function patchClass(el, value, isSVG) {
|
||||
@@ -385,8 +384,6 @@ function patchClass(el, value, isSVG) {
|
||||
const vShowOriginalDisplay = Symbol("_vod");
|
||||
const vShowHidden = Symbol("_vsh");
|
||||
const vShow = {
|
||||
// used for prop mismatch check during hydration
|
||||
name: "show",
|
||||
beforeMount(el, { value }, { transition }) {
|
||||
el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
|
||||
if (transition && value) {
|
||||
@@ -437,7 +434,7 @@ function useCssVars(getter) {
|
||||
return;
|
||||
}
|
||||
|
||||
const displayRE = /(?:^|;)\s*display\s*:/;
|
||||
const displayRE = /(^|;)\s*display\s*:/;
|
||||
function patchStyle(el, prev, next) {
|
||||
const style = el.style;
|
||||
const isCssString = shared.isString(next);
|
||||
@@ -736,10 +733,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
||||
}
|
||||
|
||||
const REMOVAL = {};
|
||||
/*! #__NO_SIDE_EFFECTS__ */
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function defineCustomElement(options, extraOptions, _createApp) {
|
||||
let Comp = runtimeCore.defineComponent(options, extraOptions);
|
||||
if (shared.isPlainObject(Comp)) Comp = shared.extend({}, Comp, extraOptions);
|
||||
const Comp = runtimeCore.defineComponent(options, extraOptions);
|
||||
if (shared.isPlainObject(Comp)) shared.extend(Comp, extraOptions);
|
||||
class VueCustomElement extends VueElement {
|
||||
constructor(initialProps) {
|
||||
super(Comp, initialProps, _createApp);
|
||||
@@ -748,9 +746,10 @@ function defineCustomElement(options, extraOptions, _createApp) {
|
||||
VueCustomElement.def = Comp;
|
||||
return VueCustomElement;
|
||||
}
|
||||
const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
||||
/*! #__NO_SIDE_EFFECTS__ */
|
||||
const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
||||
return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
|
||||
});
|
||||
};
|
||||
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
||||
};
|
||||
class VueElement extends BaseClass {
|
||||
@@ -781,20 +780,19 @@ class VueElement extends BaseClass {
|
||||
this._root = this.shadowRoot;
|
||||
} else {
|
||||
if (_def.shadowRoot !== false) {
|
||||
this.attachShadow(
|
||||
shared.extend({}, _def.shadowRootOptions, {
|
||||
mode: "open"
|
||||
})
|
||||
);
|
||||
this.attachShadow({ mode: "open" });
|
||||
this._root = this.shadowRoot;
|
||||
} else {
|
||||
this._root = this;
|
||||
}
|
||||
}
|
||||
if (!this._def.__asyncLoader) {
|
||||
this._resolveProps(this._def);
|
||||
}
|
||||
}
|
||||
connectedCallback() {
|
||||
if (!this.isConnected) return;
|
||||
if (!this.shadowRoot && !this._resolved) {
|
||||
if (!this.shadowRoot) {
|
||||
this._parseSlots();
|
||||
}
|
||||
this._connected = true;
|
||||
@@ -807,7 +805,8 @@ class VueElement extends BaseClass {
|
||||
}
|
||||
if (!this._instance) {
|
||||
if (this._resolved) {
|
||||
this._mount(this._def);
|
||||
this._setParent();
|
||||
this._update();
|
||||
} else {
|
||||
if (parent && parent._pendingResolve) {
|
||||
this._pendingResolve = parent._pendingResolve.then(() => {
|
||||
@@ -823,15 +822,7 @@ class VueElement extends BaseClass {
|
||||
_setParent(parent = this._parent) {
|
||||
if (parent) {
|
||||
this._instance.parent = parent._instance;
|
||||
this._inheritParentContext(parent);
|
||||
}
|
||||
}
|
||||
_inheritParentContext(parent = this._parent) {
|
||||
if (parent && this._app) {
|
||||
Object.setPrototypeOf(
|
||||
this._app._context.provides,
|
||||
parent._instance.provides
|
||||
);
|
||||
this._instance.provides = parent._instance.provides;
|
||||
}
|
||||
}
|
||||
disconnectedCallback() {
|
||||
@@ -845,18 +836,9 @@ class VueElement extends BaseClass {
|
||||
this._app && this._app.unmount();
|
||||
if (this._instance) this._instance.ce = void 0;
|
||||
this._app = this._instance = null;
|
||||
if (this._teleportTargets) {
|
||||
this._teleportTargets.clear();
|
||||
this._teleportTargets = void 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
_processMutations(mutations) {
|
||||
for (const m of mutations) {
|
||||
this._setAttr(m.attributeName);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* resolve inner component definition (handle possible async component)
|
||||
*/
|
||||
@@ -867,7 +849,11 @@ class VueElement extends BaseClass {
|
||||
for (let i = 0; i < this.attributes.length; i++) {
|
||||
this._setAttr(this.attributes[i].name);
|
||||
}
|
||||
this._ob = new MutationObserver(this._processMutations.bind(this));
|
||||
this._ob = new MutationObserver((mutations) => {
|
||||
for (const m of mutations) {
|
||||
this._setAttr(m.attributeName);
|
||||
}
|
||||
});
|
||||
this._ob.observe(this, { attributes: true });
|
||||
const resolve = (def, isAsync = false) => {
|
||||
this._resolved = true;
|
||||
@@ -886,7 +872,9 @@ class VueElement extends BaseClass {
|
||||
}
|
||||
}
|
||||
this._numberProps = numberProps;
|
||||
this._resolveProps(def);
|
||||
if (isAsync) {
|
||||
this._resolveProps(def);
|
||||
}
|
||||
if (this.shadowRoot) {
|
||||
this._applyStyles(styles);
|
||||
}
|
||||
@@ -894,17 +882,15 @@ class VueElement extends BaseClass {
|
||||
};
|
||||
const asyncDef = this._def.__asyncLoader;
|
||||
if (asyncDef) {
|
||||
this._pendingResolve = asyncDef().then((def) => {
|
||||
def.configureApp = this._def.configureApp;
|
||||
resolve(this._def = def, true);
|
||||
});
|
||||
this._pendingResolve = asyncDef().then(
|
||||
(def) => resolve(this._def = def, true)
|
||||
);
|
||||
} else {
|
||||
resolve(this._def);
|
||||
}
|
||||
}
|
||||
_mount(def) {
|
||||
this._app = this._createApp(def);
|
||||
this._inheritParentContext();
|
||||
if (def.configureApp) {
|
||||
def.configureApp(this._app);
|
||||
}
|
||||
@@ -974,10 +960,7 @@ class VueElement extends BaseClass {
|
||||
}
|
||||
if (shouldReflect) {
|
||||
const ob = this._ob;
|
||||
if (ob) {
|
||||
this._processMutations(ob.takeRecords());
|
||||
ob.disconnect();
|
||||
}
|
||||
ob && ob.disconnect();
|
||||
if (val === true) {
|
||||
this.setAttribute(shared.hyphenate(key), "");
|
||||
} else if (typeof val === "string" || typeof val === "number") {
|
||||
@@ -990,9 +973,7 @@ class VueElement extends BaseClass {
|
||||
}
|
||||
}
|
||||
_update() {
|
||||
const vnode = this._createVNode();
|
||||
if (this._app) vnode.appContext = this._app._context;
|
||||
render(vnode, this._root);
|
||||
render(this._createVNode(), this._root);
|
||||
}
|
||||
_createVNode() {
|
||||
const baseProps = {};
|
||||
@@ -1056,7 +1037,7 @@ class VueElement extends BaseClass {
|
||||
* Only called when shadowRoot is false
|
||||
*/
|
||||
_renderSlots() {
|
||||
const outlets = this._getSlots();
|
||||
const outlets = (this._teleportTarget || this).querySelectorAll("slot");
|
||||
const scopeId = this._instance.type.__scopeId;
|
||||
for (let i = 0; i < outlets.length; i++) {
|
||||
const o = outlets[i];
|
||||
@@ -1082,19 +1063,6 @@ class VueElement extends BaseClass {
|
||||
parent.removeChild(o);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
_getSlots() {
|
||||
const roots = [this];
|
||||
if (this._teleportTargets) {
|
||||
roots.push(...this._teleportTargets);
|
||||
}
|
||||
return roots.reduce((res, i) => {
|
||||
res.push(...Array.from(i.querySelectorAll("slot")));
|
||||
return res;
|
||||
}, []);
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@@ -1173,7 +1141,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
||||
prevChildren.forEach(callPendingCbs);
|
||||
prevChildren.forEach(recordPosition);
|
||||
const movedChildren = prevChildren.filter(applyTranslation);
|
||||
forceReflow(instance.vnode.el);
|
||||
forceReflow();
|
||||
movedChildren.forEach((c) => {
|
||||
const el = c.el;
|
||||
const style = el.style;
|
||||
@@ -1183,7 +1151,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
||||
if (e && e.target !== el) {
|
||||
return;
|
||||
}
|
||||
if (!e || e.propertyName.endsWith("transform")) {
|
||||
if (!e || /transform$/.test(e.propertyName)) {
|
||||
el.removeEventListener("transitionend", cb);
|
||||
el[moveCbKey] = null;
|
||||
removeTransitionClass(el, moveClass);
|
||||
@@ -1569,13 +1537,13 @@ const modifierGuards = {
|
||||
const withModifiers = (fn, modifiers) => {
|
||||
const cache = fn._withMods || (fn._withMods = {});
|
||||
const cacheKey = modifiers.join(".");
|
||||
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
|
||||
return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
|
||||
for (let i = 0; i < modifiers.length; i++) {
|
||||
const guard = modifierGuards[modifiers[i]];
|
||||
if (guard && guard(event, modifiers)) return;
|
||||
}
|
||||
return fn(event, ...args);
|
||||
}));
|
||||
});
|
||||
};
|
||||
const keyNames = {
|
||||
esc: "escape",
|
||||
@@ -1589,7 +1557,7 @@ const keyNames = {
|
||||
const withKeys = (fn, modifiers) => {
|
||||
const cache = fn._withKeys || (fn._withKeys = {});
|
||||
const cacheKey = modifiers.join(".");
|
||||
return cache[cacheKey] || (cache[cacheKey] = ((event) => {
|
||||
return cache[cacheKey] || (cache[cacheKey] = (event) => {
|
||||
if (!("key" in event)) {
|
||||
return;
|
||||
}
|
||||
@@ -1599,7 +1567,7 @@ const withKeys = (fn, modifiers) => {
|
||||
)) {
|
||||
return fn(event);
|
||||
}
|
||||
}));
|
||||
});
|
||||
};
|
||||
|
||||
const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps);
|
||||
@@ -1613,13 +1581,13 @@ function ensureHydrationRenderer() {
|
||||
enabledHydration = true;
|
||||
return renderer;
|
||||
}
|
||||
const render = ((...args) => {
|
||||
const render = (...args) => {
|
||||
ensureRenderer().render(...args);
|
||||
});
|
||||
const hydrate = ((...args) => {
|
||||
};
|
||||
const hydrate = (...args) => {
|
||||
ensureHydrationRenderer().hydrate(...args);
|
||||
});
|
||||
const createApp = ((...args) => {
|
||||
};
|
||||
const createApp = (...args) => {
|
||||
const app = ensureRenderer().createApp(...args);
|
||||
const { mount } = app;
|
||||
app.mount = (containerOrSelector) => {
|
||||
@@ -1640,8 +1608,8 @@ const createApp = ((...args) => {
|
||||
return proxy;
|
||||
};
|
||||
return app;
|
||||
});
|
||||
const createSSRApp = ((...args) => {
|
||||
};
|
||||
const createSSRApp = (...args) => {
|
||||
const app = ensureHydrationRenderer().createApp(...args);
|
||||
const { mount } = app;
|
||||
app.mount = (containerOrSelector) => {
|
||||
@@ -1651,7 +1619,7 @@ const createSSRApp = ((...args) => {
|
||||
}
|
||||
};
|
||||
return app;
|
||||
});
|
||||
};
|
||||
function resolveRootNamespace(container) {
|
||||
if (container instanceof SVGElement) {
|
||||
return "svg";
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../runtime-core@3.5.14
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.14
|
||||
Generated
Vendored
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/runtime-dom",
|
||||
"version": "3.5.22",
|
||||
"version": "3.5.14",
|
||||
"description": "@vue/runtime-dom",
|
||||
"main": "index.js",
|
||||
"module": "dist/runtime-dom.esm-bundler.js",
|
||||
@@ -50,9 +50,9 @@
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-dom#readme",
|
||||
"dependencies": {
|
||||
"csstype": "^3.1.3",
|
||||
"@vue/reactivity": "3.5.22",
|
||||
"@vue/shared": "3.5.22",
|
||||
"@vue/runtime-core": "3.5.22"
|
||||
"@vue/runtime-core": "3.5.14",
|
||||
"@vue/shared": "3.5.14",
|
||||
"@vue/reactivity": "3.5.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/trusted-types": "^2.0.7"
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../runtime-core@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../runtime-core@3.5.26
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.26
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/runtime-dom v3.5.26
|
||||
* @vue/runtime-dom v3.5.27
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../runtime-core@3.5.27
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.27
|
||||
Generated
Vendored
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/runtime-dom",
|
||||
"version": "3.5.26",
|
||||
"version": "3.5.27",
|
||||
"description": "@vue/runtime-dom",
|
||||
"main": "index.js",
|
||||
"module": "dist/runtime-dom.esm-bundler.js",
|
||||
@@ -50,9 +50,9 @@
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-dom#readme",
|
||||
"dependencies": {
|
||||
"csstype": "^3.2.3",
|
||||
"@vue/shared": "3.5.26",
|
||||
"@vue/reactivity": "3.5.26",
|
||||
"@vue/runtime-core": "3.5.26"
|
||||
"@vue/shared": "3.5.27",
|
||||
"@vue/runtime-core": "3.5.27",
|
||||
"@vue/reactivity": "3.5.27"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/trusted-types": "^2.0.7"
|
||||
+4
-26
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/server-renderer v3.5.26
|
||||
* @vue/server-renderer v3.5.14
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -78,23 +78,9 @@ function ssrRenderStyle(raw) {
|
||||
if (shared.isString(raw)) {
|
||||
return shared.escapeHtml(raw);
|
||||
}
|
||||
const styles = shared.normalizeStyle(ssrResetCssVars(raw));
|
||||
const styles = shared.normalizeStyle(raw);
|
||||
return shared.escapeHtml(shared.stringifyStyle(styles));
|
||||
}
|
||||
function ssrResetCssVars(raw) {
|
||||
if (!shared.isArray(raw) && shared.isObject(raw)) {
|
||||
const res = {};
|
||||
for (const key in raw) {
|
||||
if (key.startsWith(":--")) {
|
||||
res[key.slice(1)] = shared.normalizeCssVarValue(raw[key]);
|
||||
} else {
|
||||
res[key] = raw[key];
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return raw;
|
||||
}
|
||||
|
||||
function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
|
||||
return renderComponentVNode(
|
||||
@@ -142,8 +128,6 @@ function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push,
|
||||
);
|
||||
} else if (fallbackRenderFn) {
|
||||
fallbackRenderFn();
|
||||
} else if (transition) {
|
||||
push(`<!---->`);
|
||||
}
|
||||
} else {
|
||||
let isEmptySlot = true;
|
||||
@@ -168,19 +152,13 @@ function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push,
|
||||
start++;
|
||||
end--;
|
||||
}
|
||||
if (start < end) {
|
||||
for (let i = start; i < end; i++) {
|
||||
push(slotBuffer[i]);
|
||||
}
|
||||
} else if (transition) {
|
||||
push(`<!---->`);
|
||||
for (let i = start; i < end; i++) {
|
||||
push(slotBuffer[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (fallbackRenderFn) {
|
||||
fallbackRenderFn();
|
||||
} else if (transition) {
|
||||
push(`<!---->`);
|
||||
}
|
||||
}
|
||||
const commentTestRE = /^<!--[\s\S]*-->$/;
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../compiler-ssr@3.5.14
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.14
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../vue@3.5.14
|
||||
Generated
Vendored
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/server-renderer",
|
||||
"version": "3.5.22",
|
||||
"version": "3.5.14",
|
||||
"description": "@vue/server-renderer",
|
||||
"main": "index.js",
|
||||
"module": "dist/server-renderer.esm-bundler.js",
|
||||
@@ -46,10 +46,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/server-renderer#readme",
|
||||
"peerDependencies": {
|
||||
"vue": "3.5.22"
|
||||
"vue": "3.5.14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.22",
|
||||
"@vue/compiler-ssr": "3.5.22"
|
||||
"@vue/shared": "3.5.14",
|
||||
"@vue/compiler-ssr": "3.5.14"
|
||||
}
|
||||
}
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../compiler-ssr@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.22
|
||||
-1
@@ -1 +0,0 @@
|
||||
../../../vue@3.5.22
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../compiler-ssr@3.5.26
|
||||
Generated
Vendored
-1
@@ -1 +0,0 @@
|
||||
../../../shared@3.5.26
|
||||
-1
@@ -1 +0,0 @@
|
||||
../../../vue@3.5.26
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/server-renderer v3.5.22
|
||||
* @vue/server-renderer v3.5.27
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -29,17 +29,17 @@ const shouldIgnoreProp = /* @__PURE__ */ shared.makeMap(
|
||||
);
|
||||
function ssrRenderAttrs(props, tag) {
|
||||
let ret = "";
|
||||
for (const key in props) {
|
||||
if (shouldIgnoreProp(key) || shared.isOn(key) || tag === "textarea" && key === "value") {
|
||||
for (let key in props) {
|
||||
if (shouldIgnoreProp(key) || shared.isOn(key) || tag === "textarea" && key === "value" || // force as property (not rendered in SSR)
|
||||
key.startsWith(".")) {
|
||||
continue;
|
||||
}
|
||||
const value = props[key];
|
||||
if (key === "class") {
|
||||
if (key.startsWith("^")) key = key.slice(1);
|
||||
if (key === "class" || key === "className") {
|
||||
ret += ` class="${ssrRenderClass(value)}"`;
|
||||
} else if (key === "style") {
|
||||
ret += ` style="${ssrRenderStyle(value)}"`;
|
||||
} else if (key === "className") {
|
||||
ret += ` class="${String(value)}"`;
|
||||
} else {
|
||||
ret += ssrRenderDynamicAttr(key, value, tag);
|
||||
}
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../compiler-ssr@3.5.27
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../shared@3.5.27
|
||||
Generated
Vendored
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../../vue@3.5.27
|
||||
Generated
Vendored
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/server-renderer",
|
||||
"version": "3.5.26",
|
||||
"version": "3.5.27",
|
||||
"description": "@vue/server-renderer",
|
||||
"main": "index.js",
|
||||
"module": "dist/server-renderer.esm-bundler.js",
|
||||
@@ -46,10 +46,10 @@
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/server-renderer#readme",
|
||||
"peerDependencies": {
|
||||
"vue": "3.5.26"
|
||||
"vue": "3.5.27"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.26",
|
||||
"@vue/compiler-ssr": "3.5.26"
|
||||
"@vue/shared": "3.5.27",
|
||||
"@vue/compiler-ssr": "3.5.27"
|
||||
}
|
||||
}
|
||||
Generated
Vendored
+7
-17
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/shared v3.5.26
|
||||
* @vue/shared v3.5.14
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
/*! #__NO_SIDE_EFFECTS__ */
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function makeMap(str) {
|
||||
const map = /* @__PURE__ */ Object.create(null);
|
||||
@@ -59,15 +60,15 @@ const isBuiltInDirective = /* @__PURE__ */ makeMap(
|
||||
);
|
||||
const cacheStringFunction = (fn) => {
|
||||
const cache = /* @__PURE__ */ Object.create(null);
|
||||
return ((str) => {
|
||||
return (str) => {
|
||||
const hit = cache[str];
|
||||
return hit || (cache[str] = fn(str));
|
||||
});
|
||||
};
|
||||
};
|
||||
const camelizeRE = /-\w/g;
|
||||
const camelizeRE = /-(\w)/g;
|
||||
const camelize = cacheStringFunction(
|
||||
(str) => {
|
||||
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
||||
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
|
||||
}
|
||||
);
|
||||
const hyphenateRE = /\B([A-Z])/g;
|
||||
@@ -163,7 +164,7 @@ const PatchFlagNames = {
|
||||
[512]: `NEED_PATCH`,
|
||||
[1024]: `DYNAMIC_SLOTS`,
|
||||
[2048]: `DEV_ROOT_FRAGMENT`,
|
||||
[-1]: `CACHED`,
|
||||
[-1]: `HOISTED`,
|
||||
[-2]: `BAIL`
|
||||
};
|
||||
|
||||
@@ -519,16 +520,6 @@ const stringifySymbol = (v, i = "") => {
|
||||
);
|
||||
};
|
||||
|
||||
function normalizeCssVarValue(value) {
|
||||
if (value == null) {
|
||||
return "initial";
|
||||
}
|
||||
if (typeof value === "string") {
|
||||
return value === "" ? " " : value;
|
||||
}
|
||||
return String(value);
|
||||
}
|
||||
|
||||
exports.EMPTY_ARR = EMPTY_ARR;
|
||||
exports.EMPTY_OBJ = EMPTY_OBJ;
|
||||
exports.NO = NO;
|
||||
@@ -588,7 +579,6 @@ exports.looseIndexOf = looseIndexOf;
|
||||
exports.looseToNumber = looseToNumber;
|
||||
exports.makeMap = makeMap;
|
||||
exports.normalizeClass = normalizeClass;
|
||||
exports.normalizeCssVarValue = normalizeCssVarValue;
|
||||
exports.normalizeProps = normalizeProps;
|
||||
exports.normalizeStyle = normalizeStyle;
|
||||
exports.objectToString = objectToString;
|
||||
Generated
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/shared",
|
||||
"version": "3.5.22",
|
||||
"version": "3.5.14",
|
||||
"description": "internal utils shared across @vue packages",
|
||||
"main": "index.js",
|
||||
"module": "dist/shared.esm-bundler.js",
|
||||
Generated
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @vue/shared v3.5.22
|
||||
* @vue/shared v3.5.27
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
Generated
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vue/shared",
|
||||
"version": "3.5.26",
|
||||
"version": "3.5.27",
|
||||
"description": "internal utils shared across @vue packages",
|
||||
"main": "index.js",
|
||||
"module": "dist/shared.esm-bundler.js",
|
||||
Generated
Vendored
Generated
Vendored
+30
-30
@@ -105,6 +105,8 @@ class EntityDecoder {
|
||||
this.excess = 1;
|
||||
/** The mode in which the decoder is operating. */
|
||||
this.decodeMode = DecodingMode.Strict;
|
||||
/** The number of characters that have been consumed in the current run. */
|
||||
this.runConsumed = 0;
|
||||
}
|
||||
/** Resets the instance to make it reusable. */
|
||||
startEntity(decodeMode) {
|
||||
@@ -114,6 +116,7 @@ class EntityDecoder {
|
||||
this.treeIndex = 0;
|
||||
this.excess = 1;
|
||||
this.consumed = 1;
|
||||
this.runConsumed = 0;
|
||||
}
|
||||
/**
|
||||
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
||||
@@ -276,43 +279,40 @@ class EntityDecoder {
|
||||
// Handle compact runs (possibly inline): valueLength == 0 and SEMI_REQUIRED bit set.
|
||||
if (valueLength === 0 && (current & bin_trie_flags_js_1.BinTrieFlags.FLAG13) !== 0) {
|
||||
const runLength = (current & bin_trie_flags_js_1.BinTrieFlags.BRANCH_LENGTH) >> 7; /* 2..63 */
|
||||
const firstChar = current & bin_trie_flags_js_1.BinTrieFlags.JUMP_TABLE;
|
||||
// Fast-fail if we don't have enough remaining input for the full run (incomplete entity)
|
||||
if (offset + runLength > input.length)
|
||||
return -1;
|
||||
// Verify first char
|
||||
if (input.charCodeAt(offset) !== firstChar) {
|
||||
return this.result === 0
|
||||
? 0
|
||||
: this.emitNotTerminatedNamedEntity();
|
||||
}
|
||||
offset++;
|
||||
this.excess++;
|
||||
// Remaining characters after the first
|
||||
const remaining = runLength - 1;
|
||||
// Iterate over packed 2-char words
|
||||
for (let runPos = 1; runPos < runLength; runPos += 2) {
|
||||
const packedWord = decodeTree[this.treeIndex + 1 + ((runPos - 1) >> 1)];
|
||||
const low = packedWord & 0xff;
|
||||
if (input.charCodeAt(offset) !== low) {
|
||||
// If we are starting a run, check the first char.
|
||||
if (this.runConsumed === 0) {
|
||||
const firstChar = current & bin_trie_flags_js_1.BinTrieFlags.JUMP_TABLE;
|
||||
if (input.charCodeAt(offset) !== firstChar) {
|
||||
return this.result === 0
|
||||
? 0
|
||||
: this.emitNotTerminatedNamedEntity();
|
||||
}
|
||||
offset++;
|
||||
this.excess++;
|
||||
const high = (packedWord >> 8) & 0xff;
|
||||
if (runPos + 1 < runLength) {
|
||||
if (input.charCodeAt(offset) !== high) {
|
||||
return this.result === 0
|
||||
? 0
|
||||
: this.emitNotTerminatedNamedEntity();
|
||||
}
|
||||
offset++;
|
||||
this.excess++;
|
||||
}
|
||||
this.runConsumed++;
|
||||
}
|
||||
this.treeIndex += 1 + ((remaining + 1) >> 1);
|
||||
// Check remaining characters in the run.
|
||||
while (this.runConsumed < runLength) {
|
||||
if (offset >= input.length) {
|
||||
return -1;
|
||||
}
|
||||
const charIndexInPacked = this.runConsumed - 1;
|
||||
const packedWord = decodeTree[this.treeIndex + 1 + (charIndexInPacked >> 1)];
|
||||
const expectedChar = charIndexInPacked % 2 === 0
|
||||
? packedWord & 0xff
|
||||
: (packedWord >> 8) & 0xff;
|
||||
if (input.charCodeAt(offset) !== expectedChar) {
|
||||
this.runConsumed = 0;
|
||||
return this.result === 0
|
||||
? 0
|
||||
: this.emitNotTerminatedNamedEntity();
|
||||
}
|
||||
offset++;
|
||||
this.excess++;
|
||||
this.runConsumed++;
|
||||
}
|
||||
this.runConsumed = 0;
|
||||
this.treeIndex += 1 + (runLength >> 1);
|
||||
current = decodeTree[this.treeIndex];
|
||||
valueLength = (current & bin_trie_flags_js_1.BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
}
|
||||
Generated
Vendored
Generated
Vendored
+18
-11
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "entities",
|
||||
"version": "7.0.0",
|
||||
"version": "7.0.1",
|
||||
"description": "Encode & decode XML and HTML entities with ease & speed",
|
||||
"keywords": [
|
||||
"html entities",
|
||||
@@ -61,12 +61,14 @@
|
||||
"escape.js",
|
||||
"escape.d.ts",
|
||||
"dist",
|
||||
"src"
|
||||
"src",
|
||||
"!**/*.spec.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"build:docs": "typedoc --hideGenerator src/index.ts",
|
||||
"build:encode-trie": "node --import=tsx scripts/write-encode-map.ts",
|
||||
"build:trie": "node --import=tsx scripts/write-decode-map.ts",
|
||||
"benchmark": "node --import=tsx scripts/benchmark.ts",
|
||||
"format": "npm run format:es && npm run format:biome",
|
||||
"format:es": "npm run lint:es -- --fix",
|
||||
"format:biome": "biome check --fix .",
|
||||
@@ -79,19 +81,24 @@
|
||||
"test:vi": "vitest run"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.2.3",
|
||||
"@types/node": "^24.3.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.42.0",
|
||||
"@typescript-eslint/parser": "^8.33.1",
|
||||
"@biomejs/biome": "^2.3.11",
|
||||
"@types/node": "^25.0.9",
|
||||
"@typescript-eslint/eslint-plugin": "^8.53.1",
|
||||
"@typescript-eslint/parser": "^8.53.1",
|
||||
"@vitest/coverage-v8": "^3.2.4",
|
||||
"@types/he": "^1.2.3",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-biome": "^2.1.3",
|
||||
"eslint-plugin-n": "^17.21.3",
|
||||
"eslint-plugin-n": "^17.23.2",
|
||||
"eslint-plugin-unicorn": "^56.0.1",
|
||||
"tshy": "^3.0.2",
|
||||
"tsx": "^4.20.5",
|
||||
"typedoc": "^0.28.12",
|
||||
"typescript": "^5.9.2",
|
||||
"he": "^1.2.0",
|
||||
"html-entities": "^2.6.0",
|
||||
"parse-entities": "^4.0.2",
|
||||
"tinybench": "^5.1.0",
|
||||
"tshy": "^3.1.0",
|
||||
"tsx": "^4.21.0",
|
||||
"typedoc": "^0.28.16",
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^3.2.4"
|
||||
},
|
||||
"engines": {
|
||||
Generated
Vendored
Generated
Vendored
+266
@@ -0,0 +1,266 @@
|
||||
//#region src/utils.ts
|
||||
function flatHooks(configHooks, hooks = {}, parentName) {
|
||||
for (const key in configHooks) {
|
||||
const subHook = configHooks[key];
|
||||
const name = parentName ? `${parentName}:${key}` : key;
|
||||
if (typeof subHook === "object" && subHook !== null) flatHooks(subHook, hooks, name);
|
||||
else if (typeof subHook === "function") hooks[name] = subHook;
|
||||
}
|
||||
return hooks;
|
||||
}
|
||||
function mergeHooks(...hooks) {
|
||||
const finalHooks = {};
|
||||
for (const hook of hooks) {
|
||||
const flatenHook = flatHooks(hook);
|
||||
for (const key in flatenHook) if (finalHooks[key]) finalHooks[key].push(flatenHook[key]);
|
||||
else finalHooks[key] = [flatenHook[key]];
|
||||
}
|
||||
for (const key in finalHooks) if (finalHooks[key].length > 1) {
|
||||
const array = finalHooks[key];
|
||||
finalHooks[key] = (...arguments_) => serial(array, (function_) => function_(...arguments_));
|
||||
} else finalHooks[key] = finalHooks[key][0];
|
||||
return finalHooks;
|
||||
}
|
||||
function serial(tasks, function_) {
|
||||
return tasks.reduce((promise, task) => promise.then(() => function_(task)), Promise.resolve());
|
||||
}
|
||||
const createTask = /* @__PURE__ */ (() => {
|
||||
if (console.createTask) return console.createTask;
|
||||
const defaultTask = { run: (fn) => fn() };
|
||||
return () => defaultTask;
|
||||
})();
|
||||
function callHooks(hooks, args, startIndex, task) {
|
||||
for (let i = startIndex; i < hooks.length; i += 1) try {
|
||||
const result = task ? task.run(() => hooks[i](...args)) : hooks[i](...args);
|
||||
if (result instanceof Promise) return result.then(() => callHooks(hooks, args, i + 1, task));
|
||||
} catch (error) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
}
|
||||
function serialTaskCaller(hooks, args, name) {
|
||||
if (hooks.length > 0) return callHooks(hooks, args, 0, createTask(name));
|
||||
}
|
||||
function parallelTaskCaller(hooks, args, name) {
|
||||
if (hooks.length > 0) {
|
||||
const task = createTask(name);
|
||||
return Promise.all(hooks.map((hook) => task.run(() => hook(...args))));
|
||||
}
|
||||
}
|
||||
/** @deprecated */
|
||||
function serialCaller(hooks, arguments_) {
|
||||
return hooks.reduce((promise, hookFunction) => promise.then(() => hookFunction(...arguments_ || [])), Promise.resolve());
|
||||
}
|
||||
/** @deprecated */
|
||||
function parallelCaller(hooks, args) {
|
||||
return Promise.all(hooks.map((hook) => hook(...args || [])));
|
||||
}
|
||||
function callEachWith(callbacks, arg0) {
|
||||
for (const callback of [...callbacks]) callback(arg0);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
//#region src/hookable.ts
|
||||
var Hookable = class {
|
||||
_hooks;
|
||||
_before;
|
||||
_after;
|
||||
_deprecatedHooks;
|
||||
_deprecatedMessages;
|
||||
constructor() {
|
||||
this._hooks = {};
|
||||
this._before = void 0;
|
||||
this._after = void 0;
|
||||
this._deprecatedMessages = void 0;
|
||||
this._deprecatedHooks = {};
|
||||
this.hook = this.hook.bind(this);
|
||||
this.callHook = this.callHook.bind(this);
|
||||
this.callHookWith = this.callHookWith.bind(this);
|
||||
}
|
||||
hook(name, function_, options = {}) {
|
||||
if (!name || typeof function_ !== "function") return () => {};
|
||||
const originalName = name;
|
||||
let dep;
|
||||
while (this._deprecatedHooks[name]) {
|
||||
dep = this._deprecatedHooks[name];
|
||||
name = dep.to;
|
||||
}
|
||||
if (dep && !options.allowDeprecated) {
|
||||
let message = dep.message;
|
||||
if (!message) message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
|
||||
if (!this._deprecatedMessages) this._deprecatedMessages = /* @__PURE__ */ new Set();
|
||||
if (!this._deprecatedMessages.has(message)) {
|
||||
console.warn(message);
|
||||
this._deprecatedMessages.add(message);
|
||||
}
|
||||
}
|
||||
if (!function_.name) try {
|
||||
Object.defineProperty(function_, "name", {
|
||||
get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
|
||||
configurable: true
|
||||
});
|
||||
} catch {}
|
||||
this._hooks[name] = this._hooks[name] || [];
|
||||
this._hooks[name].push(function_);
|
||||
return () => {
|
||||
if (function_) {
|
||||
this.removeHook(name, function_);
|
||||
function_ = void 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
hookOnce(name, function_) {
|
||||
let _unreg;
|
||||
let _function = (...arguments_) => {
|
||||
if (typeof _unreg === "function") _unreg();
|
||||
_unreg = void 0;
|
||||
_function = void 0;
|
||||
return function_(...arguments_);
|
||||
};
|
||||
_unreg = this.hook(name, _function);
|
||||
return _unreg;
|
||||
}
|
||||
removeHook(name, function_) {
|
||||
const hooks = this._hooks[name];
|
||||
if (hooks) {
|
||||
const index = hooks.indexOf(function_);
|
||||
if (index !== -1) hooks.splice(index, 1);
|
||||
if (hooks.length === 0) this._hooks[name] = void 0;
|
||||
}
|
||||
}
|
||||
deprecateHook(name, deprecated) {
|
||||
this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
|
||||
const _hooks = this._hooks[name] || [];
|
||||
this._hooks[name] = void 0;
|
||||
for (const hook of _hooks) this.hook(name, hook);
|
||||
}
|
||||
deprecateHooks(deprecatedHooks) {
|
||||
for (const name in deprecatedHooks) this.deprecateHook(name, deprecatedHooks[name]);
|
||||
}
|
||||
addHooks(configHooks) {
|
||||
const hooks = flatHooks(configHooks);
|
||||
const removeFns = Object.keys(hooks).map((key) => this.hook(key, hooks[key]));
|
||||
return () => {
|
||||
for (const unreg of removeFns) unreg();
|
||||
removeFns.length = 0;
|
||||
};
|
||||
}
|
||||
removeHooks(configHooks) {
|
||||
const hooks = flatHooks(configHooks);
|
||||
for (const key in hooks) this.removeHook(key, hooks[key]);
|
||||
}
|
||||
removeAllHooks() {
|
||||
this._hooks = {};
|
||||
}
|
||||
callHook(name, ...args) {
|
||||
return this.callHookWith(serialTaskCaller, name, args);
|
||||
}
|
||||
callHookParallel(name, ...args) {
|
||||
return this.callHookWith(parallelTaskCaller, name, args);
|
||||
}
|
||||
callHookWith(caller, name, args) {
|
||||
const event = this._before || this._after ? {
|
||||
name,
|
||||
args,
|
||||
context: {}
|
||||
} : void 0;
|
||||
if (this._before) callEachWith(this._before, event);
|
||||
const result = caller(this._hooks[name] ? [...this._hooks[name]] : [], args, name);
|
||||
if (result instanceof Promise) return result.finally(() => {
|
||||
if (this._after && event) callEachWith(this._after, event);
|
||||
});
|
||||
if (this._after && event) callEachWith(this._after, event);
|
||||
return result;
|
||||
}
|
||||
beforeEach(function_) {
|
||||
this._before = this._before || [];
|
||||
this._before.push(function_);
|
||||
return () => {
|
||||
if (this._before !== void 0) {
|
||||
const index = this._before.indexOf(function_);
|
||||
if (index !== -1) this._before.splice(index, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
afterEach(function_) {
|
||||
this._after = this._after || [];
|
||||
this._after.push(function_);
|
||||
return () => {
|
||||
if (this._after !== void 0) {
|
||||
const index = this._after.indexOf(function_);
|
||||
if (index !== -1) this._after.splice(index, 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
function createHooks() {
|
||||
return new Hookable();
|
||||
}
|
||||
var HookableCore = class {
|
||||
_hooks;
|
||||
constructor() {
|
||||
this._hooks = {};
|
||||
}
|
||||
hook(name, fn) {
|
||||
if (!name || typeof fn !== "function") return () => {};
|
||||
this._hooks[name] = this._hooks[name] || [];
|
||||
this._hooks[name].push(fn);
|
||||
return () => {
|
||||
if (fn) {
|
||||
this.removeHook(name, fn);
|
||||
fn = void 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
removeHook(name, function_) {
|
||||
const hooks = this._hooks[name];
|
||||
if (hooks) {
|
||||
const index = hooks.indexOf(function_);
|
||||
if (index !== -1) hooks.splice(index, 1);
|
||||
if (hooks.length === 0) this._hooks[name] = void 0;
|
||||
}
|
||||
}
|
||||
callHook(name, ...args) {
|
||||
const hooks = this._hooks[name];
|
||||
if (!hooks || hooks.length === 0) return;
|
||||
return callHooks(hooks, args, 0);
|
||||
}
|
||||
};
|
||||
|
||||
//#endregion
|
||||
//#region src/debugger.ts
|
||||
const isBrowser = typeof window !== "undefined";
|
||||
/** Start debugging hook names and timing in console */
|
||||
function createDebugger(hooks, _options = {}) {
|
||||
const options = {
|
||||
inspect: isBrowser,
|
||||
group: isBrowser,
|
||||
filter: () => true,
|
||||
..._options
|
||||
};
|
||||
const _filter = options.filter;
|
||||
const filter = typeof _filter === "string" ? (name) => name.startsWith(_filter) : _filter;
|
||||
const _tag = options.tag ? `[${options.tag}] ` : "";
|
||||
const logPrefix = (event) => _tag + event.name + "".padEnd(event._id, "\0");
|
||||
const _idCtr = {};
|
||||
const unsubscribeBefore = hooks.beforeEach((event) => {
|
||||
if (filter !== void 0 && !filter(event.name)) return;
|
||||
_idCtr[event.name] = _idCtr[event.name] || 0;
|
||||
event._id = _idCtr[event.name]++;
|
||||
console.time(logPrefix(event));
|
||||
});
|
||||
const unsubscribeAfter = hooks.afterEach((event) => {
|
||||
if (filter !== void 0 && !filter(event.name)) return;
|
||||
if (options.group) console.groupCollapsed(event.name);
|
||||
if (options.inspect) console.timeLog(logPrefix(event), event.args);
|
||||
else console.timeEnd(logPrefix(event));
|
||||
if (options.group) console.groupEnd();
|
||||
_idCtr[event.name]--;
|
||||
});
|
||||
return { close: () => {
|
||||
unsubscribeBefore();
|
||||
unsubscribeAfter();
|
||||
} };
|
||||
}
|
||||
|
||||
//#endregion
|
||||
export { Hookable, HookableCore, createDebugger, createHooks, flatHooks, mergeHooks, parallelCaller, serial, serialCaller };
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user