@player-ui/async-node-plugin 0.14.0-next.2 → 0.14.0-next.4

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.
@@ -8154,7 +8154,7 @@ var AsyncNodePlugin = function() {
8154
8154
  var createAsyncTransform = function(options) {
8155
8155
  var transformAssetType = options.transformAssetType, wrapperAssetType = options.wrapperAssetType, getNestedAsset = options.getNestedAsset, _options_getAsyncNodeId = options.getAsyncNodeId, getAsyncNodeId = _options_getAsyncNodeId === void 0 ? defaultGetNodeId : _options_getAsyncNodeId, _options_path = options.path, path = _options_path === void 0 ? [
8156
8156
  "values"
8157
- ] : _options_path, tmp = options.flatten, flatten2 = tmp === void 0 ? true : tmp;
8157
+ ] : _options_path, tmp = options.flatten, flatten2 = tmp === void 0 ? true : tmp, _options_asyncNodePosition = options.asyncNodePosition, asyncNodePosition = _options_asyncNodePosition === void 0 ? "append" : _options_asyncNodePosition;
8158
8158
  var replaceNode = function(node) {
8159
8159
  var unwrapped = unwrapAsset(node);
8160
8160
  if (unwrapped.type !== NodeType.Asset || unwrapped.value.type !== transformAssetType) {
@@ -8168,26 +8168,33 @@ var AsyncNodePlugin = function() {
8168
8168
  return traverseAndReplace(node, replaceNode);
8169
8169
  };
8170
8170
  var asyncTransform2 = function(node) {
8171
+ var _Builder;
8171
8172
  var id = getAsyncNodeId(node);
8172
8173
  var asset = getNestedAsset === null || getNestedAsset === void 0 ? void 0 : getNestedAsset(node);
8173
8174
  var replaceFunction = flatten2 ? replacer : void 0;
8174
8175
  var asyncNode = Builder.asyncNode(id, flatten2, replaceFunction);
8175
- var multiNode;
8176
+ var values = [
8177
+ asyncNode
8178
+ ];
8176
8179
  if (asset) {
8180
+ var otherValues = [];
8177
8181
  if (requiresAssetWrapper(asset)) {
8178
- var assetWrappedNode = Builder.assetWrapper(asset);
8179
- multiNode = Builder.multiNode(assetWrappedNode, asyncNode);
8182
+ otherValues.push(Builder.assetWrapper(asset));
8180
8183
  } else if (asset.type === NodeType.MultiNode) {
8181
- var _Builder;
8182
- multiNode = (_Builder = Builder).multiNode.apply(_Builder, _to_consumable_array(asset.values).concat([
8183
- asyncNode
8184
- ]));
8184
+ var _otherValues;
8185
+ (_otherValues = otherValues).push.apply(_otherValues, _to_consumable_array(asset.values));
8185
8186
  } else {
8186
- multiNode = Builder.multiNode(asset, asyncNode);
8187
+ otherValues.push(asset);
8188
+ }
8189
+ if (asyncNodePosition === "append") {
8190
+ var _values;
8191
+ (_values = values).unshift.apply(_values, _to_consumable_array(otherValues));
8192
+ } else {
8193
+ var _values1;
8194
+ (_values1 = values).push.apply(_values1, _to_consumable_array(otherValues));
8187
8195
  }
8188
- } else {
8189
- multiNode = Builder.multiNode(asyncNode);
8190
8196
  }
8197
+ var multiNode = (_Builder = Builder).multiNode.apply(_Builder, _to_consumable_array(values));
8191
8198
  var wrapperAsset = Builder.asset({
8192
8199
  id: wrapperAssetType + "-" + id,
8193
8200
  type: wrapperAssetType