marko 6.0.0-next.3.30 → 6.0.0-next.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/translator/index.js +35 -2
- package/package.json +1 -1
package/dist/translator/index.js
CHANGED
@@ -4202,6 +4202,7 @@ function analyzeAttributeTags(tag) {
|
|
4202
4202
|
if ((0, import_babel_utils16.isAttributeTag)(child)) {
|
4203
4203
|
const name2 = getTagName(child);
|
4204
4204
|
lookup[name2] ||= createAttrTagMeta(name2, [name2]);
|
4205
|
+
(attrTagNodesByName[name2] ||= []).push(child);
|
4205
4206
|
analyzeAttributeTags(child);
|
4206
4207
|
} else {
|
4207
4208
|
const isRepeated = (0, import_babel_utils16.isLoopTag)(child);
|
@@ -8516,7 +8517,8 @@ function translateDOM(tag) {
|
|
8516
8517
|
circular: childFile.opts.filename === file.opts.filename,
|
8517
8518
|
tagSection,
|
8518
8519
|
relativePath,
|
8519
|
-
childScopeBinding
|
8520
|
+
childScopeBinding,
|
8521
|
+
attrTagCallsByTag: void 0
|
8520
8522
|
});
|
8521
8523
|
}
|
8522
8524
|
write2`${(0, import_babel_utils40.importNamed)(file, relativePath, childExports.template, `${tagName}_template`)}`;
|
@@ -8714,7 +8716,38 @@ function writeAttrsToExports(tag, templateExport, importAlias, info) {
|
|
8714
8716
|
}
|
8715
8717
|
let translatedProps = propsToExpression(translatedAttrs.properties);
|
8716
8718
|
if ((0, import_babel_utils40.isAttributeTag)(tag)) {
|
8717
|
-
|
8719
|
+
const attrTagName = getTagName(tag);
|
8720
|
+
const parentTag = tag.parentPath;
|
8721
|
+
const repeated = analyzeAttributeTags(parentTag)?.[attrTagName]?.repeated;
|
8722
|
+
if (repeated) {
|
8723
|
+
let attrTagCallsForTag = (info.attrTagCallsByTag ||= /* @__PURE__ */ new Map()).get(
|
8724
|
+
parentTag
|
8725
|
+
);
|
8726
|
+
if (!attrTagCallsForTag) {
|
8727
|
+
info.attrTagCallsByTag.set(
|
8728
|
+
parentTag,
|
8729
|
+
attrTagCallsForTag = /* @__PURE__ */ new Map()
|
8730
|
+
);
|
8731
|
+
}
|
8732
|
+
const attrTagCall = attrTagCallsForTag.get(attrTagName);
|
8733
|
+
if (attrTagCall) {
|
8734
|
+
attrTagCall.expression = callRuntime(
|
8735
|
+
"attrTags",
|
8736
|
+
attrTagCall.expression,
|
8737
|
+
translatedProps
|
8738
|
+
);
|
8739
|
+
return;
|
8740
|
+
} else {
|
8741
|
+
attrTagCallsForTag.set(
|
8742
|
+
attrTagName,
|
8743
|
+
translatedProps = import_compiler51.types.parenthesizedExpression(
|
8744
|
+
callRuntime("attrTag", translatedProps)
|
8745
|
+
)
|
8746
|
+
);
|
8747
|
+
}
|
8748
|
+
} else {
|
8749
|
+
translatedProps = callRuntime("attrTag", translatedProps);
|
8750
|
+
}
|
8718
8751
|
}
|
8719
8752
|
addValue(
|
8720
8753
|
info.tagSection,
|