@player-ui/async-node-plugin 0.10.5--canary.614.21174 → 0.10.5--canary.609.21254
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.
|
@@ -4972,7 +4972,6 @@ var AsyncNodePlugin = function() {
|
|
|
4972
4972
|
]);
|
|
4973
4973
|
return _Builder;
|
|
4974
4974
|
}();
|
|
4975
|
-
var templateSymbol = Symbol("template");
|
|
4976
4975
|
var TemplatePlugin = /*#__PURE__*/ function() {
|
|
4977
4976
|
function TemplatePlugin(options) {
|
|
4978
4977
|
_class_call_check(this, TemplatePlugin);
|
|
@@ -5038,11 +5037,11 @@ var AsyncNodePlugin = function() {
|
|
|
5038
5037
|
values.push(parsed);
|
|
5039
5038
|
}
|
|
5040
5039
|
});
|
|
5041
|
-
var result =
|
|
5040
|
+
var result = {
|
|
5042
5041
|
type: "multi-node",
|
|
5043
5042
|
override: false,
|
|
5044
5043
|
values: values
|
|
5045
|
-
}
|
|
5044
|
+
};
|
|
5046
5045
|
return result;
|
|
5047
5046
|
}
|
|
5048
5047
|
},
|
|
@@ -5056,38 +5055,6 @@ var AsyncNodePlugin = function() {
|
|
|
5056
5055
|
}
|
|
5057
5056
|
return node;
|
|
5058
5057
|
});
|
|
5059
|
-
function getTemplateSymbolValue(node) {
|
|
5060
|
-
if (node.type === "multi-node") {
|
|
5061
|
-
return node[templateSymbol];
|
|
5062
|
-
} else if (node.type === "template") {
|
|
5063
|
-
return node.placement;
|
|
5064
|
-
}
|
|
5065
|
-
return void 0;
|
|
5066
|
-
}
|
|
5067
|
-
parser.hooks.onCreateASTNode.tap("template-sort", function(node) {
|
|
5068
|
-
if (node && (node.type === "view" || node.type === "asset") && Array.isArray(node.children)) {
|
|
5069
|
-
node.children = node.children.sort(function(a, b) {
|
|
5070
|
-
var pathsEqual = a.path.join() === b.path.join();
|
|
5071
|
-
if (pathsEqual) {
|
|
5072
|
-
var aPlacement = getTemplateSymbolValue(a.value);
|
|
5073
|
-
var bPlacement = getTemplateSymbolValue(b.value);
|
|
5074
|
-
if (aPlacement !== void 0 && bPlacement === void 0) {
|
|
5075
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
5076
|
-
} else if (bPlacement !== void 0 && aPlacement === void 0) {
|
|
5077
|
-
return bPlacement === "prepend" ? 1 : -1;
|
|
5078
|
-
} else if (aPlacement !== void 0 && bPlacement !== void 0) {
|
|
5079
|
-
if (aPlacement === bPlacement) {
|
|
5080
|
-
return 0;
|
|
5081
|
-
}
|
|
5082
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
5083
|
-
}
|
|
5084
|
-
return 0;
|
|
5085
|
-
}
|
|
5086
|
-
return 0;
|
|
5087
|
-
});
|
|
5088
|
-
}
|
|
5089
|
-
return node;
|
|
5090
|
-
});
|
|
5091
5058
|
parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
|
|
5092
5059
|
if (childOptions && hasTemplateKey(childOptions.key)) {
|
|
5093
5060
|
return obj.map(function(template) {
|
|
@@ -5097,8 +5064,7 @@ var AsyncNodePlugin = function() {
|
|
|
5097
5064
|
depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
|
|
5098
5065
|
data: template.data,
|
|
5099
5066
|
template: template.value,
|
|
5100
|
-
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
5101
|
-
placement: template.placement
|
|
5067
|
+
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
5102
5068
|
}, template);
|
|
5103
5069
|
if (!templateAST) return;
|
|
5104
5070
|
if (templateAST.type === "multi-node") {
|
|
@@ -5134,7 +5100,6 @@ var AsyncNodePlugin = function() {
|
|
|
5134
5100
|
value: function apply(view) {
|
|
5135
5101
|
view.hooks.parser.tap("template", this.applyParser.bind(this));
|
|
5136
5102
|
view.hooks.resolver.tap("template", this.applyResolverHooks.bind(this));
|
|
5137
|
-
view.hooks.onTemplatePluginCreated.call(this);
|
|
5138
5103
|
}
|
|
5139
5104
|
}
|
|
5140
5105
|
]);
|