@player-ui/markdown-plugin 0.11.1-next.0 → 0.11.2-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.
|
@@ -1405,6 +1405,22 @@ var MarkdownPlugin = function() {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
});
|
|
1407
1407
|
};
|
|
1408
|
+
var unpackNode = function unpackNode(item) {
|
|
1409
|
+
var _item_children_, _item_children, _item_children_1, _item_children1;
|
|
1410
|
+
var unpacked = [];
|
|
1411
|
+
if ("children" in item && ((_item_children = item.children) === null || _item_children === void 0 ? void 0 : (_item_children_ = _item_children[0]) === null || _item_children_ === void 0 ? void 0 : _item_children_.value.type) === "asset" && ((_item_children1 = item.children) === null || _item_children1 === void 0 ? void 0 : (_item_children_1 = _item_children1[0]) === null || _item_children_1 === void 0 ? void 0 : _item_children_1.value).children) {
|
|
1412
|
+
var _item_children__value_children_, _item_children__value_children, _item_children_2, _item_children2;
|
|
1413
|
+
if (((_item_children__value_children = ((_item_children2 = item.children) === null || _item_children2 === void 0 ? void 0 : (_item_children_2 = _item_children2[0]) === null || _item_children_2 === void 0 ? void 0 : _item_children_2.value).children) === null || _item_children__value_children === void 0 ? void 0 : (_item_children__value_children_ = _item_children__value_children[0]) === null || _item_children__value_children_ === void 0 ? void 0 : _item_children__value_children_.value.type) === "multi-node") {
|
|
1414
|
+
var _item_children__value_children_1, _item_children__value_children1, _item_children_3, _item_children3;
|
|
1415
|
+
((_item_children__value_children1 = ((_item_children3 = item.children) === null || _item_children3 === void 0 ? void 0 : (_item_children_3 = _item_children3[0]) === null || _item_children_3 === void 0 ? void 0 : _item_children_3.value).children) === null || _item_children__value_children1 === void 0 ? void 0 : (_item_children__value_children_1 = _item_children__value_children1[0]) === null || _item_children__value_children_1 === void 0 ? void 0 : _item_children__value_children_1.value).values.forEach(function(value) {
|
|
1416
|
+
unpacked.push(value);
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
} else {
|
|
1420
|
+
unpacked.push(item);
|
|
1421
|
+
}
|
|
1422
|
+
return unpacked;
|
|
1423
|
+
};
|
|
1408
1424
|
var hasSomethingToResolve = function hasSomethingToResolve(str) {
|
|
1409
1425
|
return bindingResolveLookup(str) || expressionResolveLookup(str);
|
|
1410
1426
|
};
|
|
@@ -8727,15 +8743,6 @@ var MarkdownPlugin = function() {
|
|
|
8727
8743
|
]);
|
|
8728
8744
|
return Parser;
|
|
8729
8745
|
}();
|
|
8730
|
-
function unpackAndPush(item, initial) {
|
|
8731
|
-
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
8732
|
-
item.asset.values.forEach(function(i) {
|
|
8733
|
-
unpackAndPush(i, initial);
|
|
8734
|
-
});
|
|
8735
|
-
} else {
|
|
8736
|
-
initial.push(item);
|
|
8737
|
-
}
|
|
8738
|
-
}
|
|
8739
8746
|
var withContext = function(model) {
|
|
8740
8747
|
return {
|
|
8741
8748
|
get: function(binding, options) {
|
|
@@ -8858,7 +8865,7 @@ var MarkdownPlugin = function() {
|
|
|
8858
8865
|
key: "computeTree",
|
|
8859
8866
|
value: function computeTree(node2, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
|
|
8860
8867
|
var _this = this;
|
|
8861
|
-
var _partiallyResolvedParent_parent;
|
|
8868
|
+
var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
|
|
8862
8869
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
8863
8870
|
dependencyModel.trackSubset("core");
|
|
8864
8871
|
var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -8884,7 +8891,8 @@ var MarkdownPlugin = function() {
|
|
|
8884
8891
|
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
8885
8892
|
type: "empty"
|
|
8886
8893
|
};
|
|
8887
|
-
var
|
|
8894
|
+
var isNestedMultiNodeWithAsync = resolvedAST.type === "multi-node" && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent === void 0 ? void 0 : (_partiallyResolvedParent_parent_parent = _partiallyResolvedParent_parent.parent) === null || _partiallyResolvedParent_parent_parent === void 0 ? void 0 : _partiallyResolvedParent_parent_parent.type) === "multi-node" && partiallyResolvedParent.parent.type === "value" && ((_resolvedAST_parent = resolvedAST.parent) === null || _resolvedAST_parent === void 0 ? void 0 : _resolvedAST_parent.type) === "asset" && resolvedAST.parent.value.id.includes("async");
|
|
8895
|
+
var isNestedMultiNode = resolvedAST.type === "multi-node" && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent1 = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent1 === void 0 ? void 0 : _partiallyResolvedParent_parent1.type) === "multi-node" && partiallyResolvedParent.type === "value";
|
|
8888
8896
|
if (previousResult && shouldUseLastValue) {
|
|
8889
8897
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
8890
8898
|
updated: false
|
|
@@ -8918,7 +8926,11 @@ var MarkdownPlugin = function() {
|
|
|
8918
8926
|
repopulateASTMapFromCache(previousResult, node2, rawParent);
|
|
8919
8927
|
return update2;
|
|
8920
8928
|
}
|
|
8921
|
-
|
|
8929
|
+
if (isNestedMultiNodeWithAsync) {
|
|
8930
|
+
resolvedAST.parent = partiallyResolvedParent.parent;
|
|
8931
|
+
} else {
|
|
8932
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
8933
|
+
}
|
|
8922
8934
|
resolveOptions.node = resolvedAST;
|
|
8923
8935
|
this.ASTMap.set(resolvedAST, node2);
|
|
8924
8936
|
var resolved = this.hooks.resolve.call(void 0, resolvedAST, resolveOptions);
|
|
@@ -8953,6 +8965,11 @@ var MarkdownPlugin = function() {
|
|
|
8953
8965
|
} else if (resolvedAST.type === "multi-node") {
|
|
8954
8966
|
var childValue = [];
|
|
8955
8967
|
var rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : partiallyResolvedParent.parent : node2;
|
|
8968
|
+
var hasAsync = resolvedAST.values.map(function(value, index2) {
|
|
8969
|
+
return value.type === "async" ? index2 : -1;
|
|
8970
|
+
}).filter(function(index2) {
|
|
8971
|
+
return index2 !== -1;
|
|
8972
|
+
});
|
|
8956
8973
|
var newValues = resolvedAST.values.map(function(mValue) {
|
|
8957
8974
|
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
8958
8975
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
@@ -8968,7 +8985,19 @@ var MarkdownPlugin = function() {
|
|
|
8968
8985
|
updated = updated || mTree.updated;
|
|
8969
8986
|
return mTree.node;
|
|
8970
8987
|
});
|
|
8971
|
-
|
|
8988
|
+
if (hasAsync.length > 0) {
|
|
8989
|
+
var copy = newValues;
|
|
8990
|
+
hasAsync.forEach(function(index2) {
|
|
8991
|
+
var _copy;
|
|
8992
|
+
if (copy[index2]) (_copy = copy).splice.apply(_copy, [
|
|
8993
|
+
index2,
|
|
8994
|
+
1
|
|
8995
|
+
].concat(_to_consumable_array(unpackNode(copy[index2]))));
|
|
8996
|
+
});
|
|
8997
|
+
resolvedAST.values = copy;
|
|
8998
|
+
} else {
|
|
8999
|
+
resolvedAST.values = newValues;
|
|
9000
|
+
}
|
|
8972
9001
|
resolved = childValue;
|
|
8973
9002
|
}
|
|
8974
9003
|
childDependencies.forEach(function(bindingDep) {
|
|
@@ -8997,6 +9026,15 @@ var MarkdownPlugin = function() {
|
|
|
8997
9026
|
]);
|
|
8998
9027
|
return Resolver;
|
|
8999
9028
|
}();
|
|
9029
|
+
function unpackAndPush(item, initial) {
|
|
9030
|
+
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
9031
|
+
item.asset.values.forEach(function(i) {
|
|
9032
|
+
unpackAndPush(i, initial);
|
|
9033
|
+
});
|
|
9034
|
+
} else {
|
|
9035
|
+
initial.push(item);
|
|
9036
|
+
}
|
|
9037
|
+
}
|
|
9000
9038
|
var CrossfieldProvider = /*#__PURE__*/ function() {
|
|
9001
9039
|
function CrossfieldProvider(initialView, parser, logger) {
|
|
9002
9040
|
_class_call_check(this, CrossfieldProvider);
|