@player-ui/beacon-plugin 0.11.0--canary.614.21793 → 0.11.0-next.1
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.
|
@@ -2539,7 +2539,6 @@ var BeaconPlugin = function() {
|
|
|
2539
2539
|
try {
|
|
2540
2540
|
for(var _iterator = Object.keys(object)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2541
2541
|
var key = _step.value;
|
|
2542
|
-
"";
|
|
2543
2542
|
var val = object[key];
|
|
2544
2543
|
var nestedPath = _to_consumable_array(path).concat([
|
|
2545
2544
|
key
|
|
@@ -4868,7 +4867,6 @@ var BeaconPlugin = function() {
|
|
|
4868
4867
|
]);
|
|
4869
4868
|
return ViewInstance;
|
|
4870
4869
|
}();
|
|
4871
|
-
var templateSymbol = Symbol("template");
|
|
4872
4870
|
var TemplatePlugin = /*#__PURE__*/ function() {
|
|
4873
4871
|
function TemplatePlugin(options) {
|
|
4874
4872
|
_class_call_check(this, TemplatePlugin);
|
|
@@ -4939,9 +4937,6 @@ var BeaconPlugin = function() {
|
|
|
4939
4937
|
override: false,
|
|
4940
4938
|
values: values
|
|
4941
4939
|
};
|
|
4942
|
-
if (node.placement !== void 0) {
|
|
4943
|
-
result[templateSymbol] = node.placement;
|
|
4944
|
-
}
|
|
4945
4940
|
return result;
|
|
4946
4941
|
}
|
|
4947
4942
|
},
|
|
@@ -4955,40 +4950,6 @@ var BeaconPlugin = function() {
|
|
|
4955
4950
|
}
|
|
4956
4951
|
return node;
|
|
4957
4952
|
});
|
|
4958
|
-
parser.hooks.onCreateASTNode.tap("template-sort", function(node) {
|
|
4959
|
-
var getTemplateSymbolValue = function getTemplateSymbolValue(node2) {
|
|
4960
|
-
if (node2.type === "multi-node") {
|
|
4961
|
-
return node2[templateSymbol];
|
|
4962
|
-
} else if (node2.type === "template") {
|
|
4963
|
-
return node2.placement;
|
|
4964
|
-
}
|
|
4965
|
-
return void 0;
|
|
4966
|
-
};
|
|
4967
|
-
if (node && (node.type === "view" || node.type === "asset") && Array.isArray(node.children)) {
|
|
4968
|
-
node.children = node.children.sort(function(a, b) {
|
|
4969
|
-
var aPath = a.path.join();
|
|
4970
|
-
var bPath = b.path.join();
|
|
4971
|
-
var pathsEqual = aPath === bPath;
|
|
4972
|
-
if (pathsEqual) {
|
|
4973
|
-
var aPlacement = getTemplateSymbolValue(a.value);
|
|
4974
|
-
var bPlacement = getTemplateSymbolValue(b.value);
|
|
4975
|
-
if (aPlacement !== void 0 && bPlacement === void 0) {
|
|
4976
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
4977
|
-
} else if (bPlacement !== void 0 && aPlacement === void 0) {
|
|
4978
|
-
return bPlacement === "prepend" ? 1 : -1;
|
|
4979
|
-
} else if (aPlacement !== void 0 && bPlacement !== void 0) {
|
|
4980
|
-
if (aPlacement === bPlacement) {
|
|
4981
|
-
return 0;
|
|
4982
|
-
}
|
|
4983
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
4984
|
-
}
|
|
4985
|
-
return 0;
|
|
4986
|
-
}
|
|
4987
|
-
return aPath > bPath ? 1 : -1;
|
|
4988
|
-
});
|
|
4989
|
-
}
|
|
4990
|
-
return node;
|
|
4991
|
-
});
|
|
4992
4953
|
parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
|
|
4993
4954
|
if (childOptions && hasTemplateKey(childOptions.key)) {
|
|
4994
4955
|
return obj.map(function(template) {
|
|
@@ -4998,8 +4959,7 @@ var BeaconPlugin = function() {
|
|
|
4998
4959
|
depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
|
|
4999
4960
|
data: template.data,
|
|
5000
4961
|
template: template.value,
|
|
5001
|
-
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
5002
|
-
placement: template.placement
|
|
4962
|
+
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
5003
4963
|
}, template);
|
|
5004
4964
|
if (!templateAST) return;
|
|
5005
4965
|
if (templateAST.type === "multi-node") {
|