@player-ui/check-path-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.
|
@@ -2477,7 +2477,6 @@ var CheckPathPlugin = function() {
|
|
|
2477
2477
|
try {
|
|
2478
2478
|
for(var _iterator = Object.keys(object)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2479
2479
|
var key = _step.value;
|
|
2480
|
-
"";
|
|
2481
2480
|
var val = object[key];
|
|
2482
2481
|
var nestedPath = _to_consumable_array(path).concat([
|
|
2483
2482
|
key
|
|
@@ -4819,7 +4818,6 @@ var CheckPathPlugin = function() {
|
|
|
4819
4818
|
]);
|
|
4820
4819
|
return ViewInstance;
|
|
4821
4820
|
}();
|
|
4822
|
-
var templateSymbol = Symbol("template");
|
|
4823
4821
|
var TemplatePlugin = /*#__PURE__*/ function() {
|
|
4824
4822
|
function TemplatePlugin(options) {
|
|
4825
4823
|
_class_call_check(this, TemplatePlugin);
|
|
@@ -4890,9 +4888,6 @@ var CheckPathPlugin = function() {
|
|
|
4890
4888
|
override: false,
|
|
4891
4889
|
values: values
|
|
4892
4890
|
};
|
|
4893
|
-
if (node.placement !== void 0) {
|
|
4894
|
-
result[templateSymbol] = node.placement;
|
|
4895
|
-
}
|
|
4896
4891
|
return result;
|
|
4897
4892
|
}
|
|
4898
4893
|
},
|
|
@@ -4906,40 +4901,6 @@ var CheckPathPlugin = function() {
|
|
|
4906
4901
|
}
|
|
4907
4902
|
return node;
|
|
4908
4903
|
});
|
|
4909
|
-
parser.hooks.onCreateASTNode.tap("template-sort", function(node) {
|
|
4910
|
-
var getTemplateSymbolValue = function getTemplateSymbolValue(node2) {
|
|
4911
|
-
if (node2.type === "multi-node") {
|
|
4912
|
-
return node2[templateSymbol];
|
|
4913
|
-
} else if (node2.type === "template") {
|
|
4914
|
-
return node2.placement;
|
|
4915
|
-
}
|
|
4916
|
-
return void 0;
|
|
4917
|
-
};
|
|
4918
|
-
if (node && (node.type === "view" || node.type === "asset") && Array.isArray(node.children)) {
|
|
4919
|
-
node.children = node.children.sort(function(a, b) {
|
|
4920
|
-
var aPath = a.path.join();
|
|
4921
|
-
var bPath = b.path.join();
|
|
4922
|
-
var pathsEqual = aPath === bPath;
|
|
4923
|
-
if (pathsEqual) {
|
|
4924
|
-
var aPlacement = getTemplateSymbolValue(a.value);
|
|
4925
|
-
var bPlacement = getTemplateSymbolValue(b.value);
|
|
4926
|
-
if (aPlacement !== void 0 && bPlacement === void 0) {
|
|
4927
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
4928
|
-
} else if (bPlacement !== void 0 && aPlacement === void 0) {
|
|
4929
|
-
return bPlacement === "prepend" ? 1 : -1;
|
|
4930
|
-
} else if (aPlacement !== void 0 && bPlacement !== void 0) {
|
|
4931
|
-
if (aPlacement === bPlacement) {
|
|
4932
|
-
return 0;
|
|
4933
|
-
}
|
|
4934
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
4935
|
-
}
|
|
4936
|
-
return 0;
|
|
4937
|
-
}
|
|
4938
|
-
return aPath > bPath ? 1 : -1;
|
|
4939
|
-
});
|
|
4940
|
-
}
|
|
4941
|
-
return node;
|
|
4942
|
-
});
|
|
4943
4904
|
parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
|
|
4944
4905
|
if (childOptions && hasTemplateKey(childOptions.key)) {
|
|
4945
4906
|
return obj.map(function(template) {
|
|
@@ -4949,8 +4910,7 @@ var CheckPathPlugin = function() {
|
|
|
4949
4910
|
depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
|
|
4950
4911
|
data: template.data,
|
|
4951
4912
|
template: template.value,
|
|
4952
|
-
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
4953
|
-
placement: template.placement
|
|
4913
|
+
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
4954
4914
|
}, template);
|
|
4955
4915
|
if (!templateAST) return;
|
|
4956
4916
|
if (templateAST.type === "multi-node") {
|