@player-ui/check-path-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.
|
@@ -4819,7 +4819,6 @@ var CheckPathPlugin = function() {
|
|
|
4819
4819
|
]);
|
|
4820
4820
|
return ViewInstance;
|
|
4821
4821
|
}();
|
|
4822
|
-
var templateSymbol = Symbol("template");
|
|
4823
4822
|
var TemplatePlugin = /*#__PURE__*/ function() {
|
|
4824
4823
|
function TemplatePlugin(options) {
|
|
4825
4824
|
_class_call_check(this, TemplatePlugin);
|
|
@@ -4890,9 +4889,6 @@ var CheckPathPlugin = function() {
|
|
|
4890
4889
|
override: false,
|
|
4891
4890
|
values: values
|
|
4892
4891
|
};
|
|
4893
|
-
if (node.placement !== void 0) {
|
|
4894
|
-
result[templateSymbol] = node.placement;
|
|
4895
|
-
}
|
|
4896
4892
|
return result;
|
|
4897
4893
|
}
|
|
4898
4894
|
},
|
|
@@ -4906,38 +4902,6 @@ var CheckPathPlugin = function() {
|
|
|
4906
4902
|
}
|
|
4907
4903
|
return node;
|
|
4908
4904
|
});
|
|
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 pathsEqual = a.path.join() === b.path.join();
|
|
4921
|
-
if (pathsEqual) {
|
|
4922
|
-
var aPlacement = getTemplateSymbolValue(a.value);
|
|
4923
|
-
var bPlacement = getTemplateSymbolValue(b.value);
|
|
4924
|
-
if (aPlacement !== void 0 && bPlacement === void 0) {
|
|
4925
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
4926
|
-
} else if (bPlacement !== void 0 && aPlacement === void 0) {
|
|
4927
|
-
return bPlacement === "prepend" ? 1 : -1;
|
|
4928
|
-
} else if (aPlacement !== void 0 && bPlacement !== void 0) {
|
|
4929
|
-
if (aPlacement === bPlacement) {
|
|
4930
|
-
return 0;
|
|
4931
|
-
}
|
|
4932
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
4933
|
-
}
|
|
4934
|
-
return 0;
|
|
4935
|
-
}
|
|
4936
|
-
return 0;
|
|
4937
|
-
});
|
|
4938
|
-
}
|
|
4939
|
-
return node;
|
|
4940
|
-
});
|
|
4941
4905
|
parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
|
|
4942
4906
|
if (childOptions && hasTemplateKey(childOptions.key)) {
|
|
4943
4907
|
return obj.map(function(template) {
|
|
@@ -4947,8 +4911,7 @@ var CheckPathPlugin = function() {
|
|
|
4947
4911
|
depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
|
|
4948
4912
|
data: template.data,
|
|
4949
4913
|
template: template.value,
|
|
4950
|
-
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
4951
|
-
placement: template.placement
|
|
4914
|
+
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
4952
4915
|
}, template);
|
|
4953
4916
|
if (!templateAST) return;
|
|
4954
4917
|
if (templateAST.type === "multi-node") {
|