@player-ui/common-types-plugin 0.11.0--canary.614.21420 → 0.11.0-next.0
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.
|
@@ -4898,7 +4898,6 @@ var CommonTypesPlugin = function() {
|
|
|
4898
4898
|
]);
|
|
4899
4899
|
return ViewInstance;
|
|
4900
4900
|
}();
|
|
4901
|
-
var templateSymbol = Symbol("template");
|
|
4902
4901
|
var TemplatePlugin = /*#__PURE__*/ function() {
|
|
4903
4902
|
function TemplatePlugin(options) {
|
|
4904
4903
|
_class_call_check(this, TemplatePlugin);
|
|
@@ -4969,9 +4968,6 @@ var CommonTypesPlugin = function() {
|
|
|
4969
4968
|
override: false,
|
|
4970
4969
|
values: values
|
|
4971
4970
|
};
|
|
4972
|
-
if (node.placement !== void 0) {
|
|
4973
|
-
result[templateSymbol] = node.placement;
|
|
4974
|
-
}
|
|
4975
4971
|
return result;
|
|
4976
4972
|
}
|
|
4977
4973
|
},
|
|
@@ -4985,38 +4981,6 @@ var CommonTypesPlugin = function() {
|
|
|
4985
4981
|
}
|
|
4986
4982
|
return node;
|
|
4987
4983
|
});
|
|
4988
|
-
parser.hooks.onCreateASTNode.tap("template-sort", function(node) {
|
|
4989
|
-
var getTemplateSymbolValue = function getTemplateSymbolValue(node2) {
|
|
4990
|
-
if (node2.type === "multi-node") {
|
|
4991
|
-
return node2[templateSymbol];
|
|
4992
|
-
} else if (node2.type === "template") {
|
|
4993
|
-
return node2.placement;
|
|
4994
|
-
}
|
|
4995
|
-
return void 0;
|
|
4996
|
-
};
|
|
4997
|
-
if (node && (node.type === "view" || node.type === "asset") && Array.isArray(node.children)) {
|
|
4998
|
-
node.children = node.children.sort(function(a, b) {
|
|
4999
|
-
var pathsEqual = a.path.join() === b.path.join();
|
|
5000
|
-
if (pathsEqual) {
|
|
5001
|
-
var aPlacement = getTemplateSymbolValue(a.value);
|
|
5002
|
-
var bPlacement = getTemplateSymbolValue(b.value);
|
|
5003
|
-
if (aPlacement !== void 0 && bPlacement === void 0) {
|
|
5004
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
5005
|
-
} else if (bPlacement !== void 0 && aPlacement === void 0) {
|
|
5006
|
-
return bPlacement === "prepend" ? 1 : -1;
|
|
5007
|
-
} else if (aPlacement !== void 0 && bPlacement !== void 0) {
|
|
5008
|
-
if (aPlacement === bPlacement) {
|
|
5009
|
-
return 0;
|
|
5010
|
-
}
|
|
5011
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
5012
|
-
}
|
|
5013
|
-
return 0;
|
|
5014
|
-
}
|
|
5015
|
-
return 0;
|
|
5016
|
-
});
|
|
5017
|
-
}
|
|
5018
|
-
return node;
|
|
5019
|
-
});
|
|
5020
4984
|
parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
|
|
5021
4985
|
if (childOptions && hasTemplateKey(childOptions.key)) {
|
|
5022
4986
|
return obj.map(function(template) {
|
|
@@ -5026,8 +4990,7 @@ var CommonTypesPlugin = function() {
|
|
|
5026
4990
|
depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
|
|
5027
4991
|
data: template.data,
|
|
5028
4992
|
template: template.value,
|
|
5029
|
-
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
5030
|
-
placement: template.placement
|
|
4993
|
+
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
5031
4994
|
}, template);
|
|
5032
4995
|
if (!templateAST) return;
|
|
5033
4996
|
if (templateAST.type === "multi-node") {
|