@player-ui/reference-assets-plugin 0.15.0-next.5 → 0.15.0-next.6
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.
- package/dist/ReferenceAssetsPlugin.native.js +119 -113
- package/dist/ReferenceAssetsPlugin.native.js.map +1 -1
- package/dist/xlr/ActionAsset.json +2 -2
- package/dist/xlr/ChatMessageAsset.json +1 -1
- package/dist/xlr/ChoiceAsset.json +5 -5
- package/dist/xlr/CollectionAsset.json +1 -1
- package/dist/xlr/ImageAsset.json +2 -2
- package/dist/xlr/InfoAsset.json +1 -1
- package/dist/xlr/InputAsset.json +2 -2
- package/dist/xlr/TextAsset.json +4 -4
- package/dist/xlr/send.json +1 -1
- package/package.json +7 -7
|
@@ -5104,7 +5104,6 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5104
5104
|
this.ASTMap = /* @__PURE__ */ new Map();
|
|
5105
5105
|
this.logger = options.logger;
|
|
5106
5106
|
this.idCache = /* @__PURE__ */ new Set();
|
|
5107
|
-
this.AsyncIdMap = /* @__PURE__ */ new Map();
|
|
5108
5107
|
}
|
|
5109
5108
|
_create_class(Resolver, [
|
|
5110
5109
|
{
|
|
@@ -5115,27 +5114,44 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5115
5114
|
},
|
|
5116
5115
|
{
|
|
5117
5116
|
key: "update",
|
|
5118
|
-
value: function update(
|
|
5119
|
-
|
|
5120
|
-
this.hooks.beforeUpdate.call(changes);
|
|
5117
|
+
value: function update(dataChanges, nodeChanges) {
|
|
5118
|
+
this.hooks.beforeUpdate.call(dataChanges);
|
|
5121
5119
|
var resolveCache = /* @__PURE__ */ new Map();
|
|
5122
5120
|
this.idCache.clear();
|
|
5123
5121
|
var prevASTMap = new Map(this.ASTMap);
|
|
5124
5122
|
this.ASTMap.clear();
|
|
5125
|
-
var
|
|
5126
|
-
var
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
var
|
|
5131
|
-
|
|
5132
|
-
|
|
5123
|
+
var realNodeChanges = /* @__PURE__ */ new Set();
|
|
5124
|
+
var _nodeChanges_values;
|
|
5125
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5126
|
+
try {
|
|
5127
|
+
for(var _iterator = ((_nodeChanges_values = nodeChanges === null || nodeChanges === void 0 ? void 0 : nodeChanges.values()) !== null && _nodeChanges_values !== void 0 ? _nodeChanges_values : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5128
|
+
var node = _step.value;
|
|
5129
|
+
var current = node;
|
|
5130
|
+
while(current){
|
|
5131
|
+
var _prevASTMap_get;
|
|
5132
|
+
var original = (_prevASTMap_get = prevASTMap.get(current)) !== null && _prevASTMap_get !== void 0 ? _prevASTMap_get : current;
|
|
5133
|
+
if (realNodeChanges.has(original)) {
|
|
5134
|
+
break;
|
|
5135
|
+
}
|
|
5136
|
+
realNodeChanges.add(original);
|
|
5137
|
+
current = current.parent;
|
|
5133
5138
|
}
|
|
5134
|
-
current = current.parent;
|
|
5135
5139
|
}
|
|
5136
|
-
})
|
|
5137
|
-
|
|
5138
|
-
|
|
5140
|
+
} catch (err) {
|
|
5141
|
+
_didIteratorError = true;
|
|
5142
|
+
_iteratorError = err;
|
|
5143
|
+
} finally{
|
|
5144
|
+
try {
|
|
5145
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
5146
|
+
_iterator.return();
|
|
5147
|
+
}
|
|
5148
|
+
} finally{
|
|
5149
|
+
if (_didIteratorError) {
|
|
5150
|
+
throw _iteratorError;
|
|
5151
|
+
}
|
|
5152
|
+
}
|
|
5153
|
+
}
|
|
5154
|
+
var updated = this.computeTree(this.root, void 0, dataChanges, resolveCache, toNodeResolveOptions(this.options), void 0, prevASTMap, realNodeChanges);
|
|
5139
5155
|
this.resolveCache = resolveCache;
|
|
5140
5156
|
this.hooks.afterUpdate.call(updated.value);
|
|
5141
5157
|
return updated.value;
|
|
@@ -5189,7 +5205,7 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5189
5205
|
},
|
|
5190
5206
|
{
|
|
5191
5207
|
key: "computeTree",
|
|
5192
|
-
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap,
|
|
5208
|
+
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap, nodeChanges) {
|
|
5193
5209
|
var _this = this;
|
|
5194
5210
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
5195
5211
|
dependencyModel.trackSubset("core");
|
|
@@ -5207,8 +5223,9 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5207
5223
|
}), node);
|
|
5208
5224
|
var previousResult = this.getPreviousResult(node);
|
|
5209
5225
|
var previousDeps = previousResult === null || previousResult === void 0 ? void 0 : previousResult.dependencies;
|
|
5226
|
+
var isChanged = nodeChanges.has(node);
|
|
5210
5227
|
var dataChanged = caresAboutDataChanges(dataChanges, previousDeps);
|
|
5211
|
-
var shouldUseLastValue = this.hooks.skipResolve.call(!dataChanged, node, resolveOptions);
|
|
5228
|
+
var shouldUseLastValue = this.hooks.skipResolve.call(!dataChanged && !isChanged, node, resolveOptions);
|
|
5212
5229
|
if (previousResult && shouldUseLastValue) {
|
|
5213
5230
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
5214
5231
|
updated: false
|
|
@@ -5220,30 +5237,6 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5220
5237
|
updated: false
|
|
5221
5238
|
});
|
|
5222
5239
|
cacheUpdate.set(AST, resolvedUpdate);
|
|
5223
|
-
if (resolvedUpdate.node.type === "async") {
|
|
5224
|
-
nextAsyncIdMap.set(resolvedUpdate.node.id, resolvedUpdate.node);
|
|
5225
|
-
}
|
|
5226
|
-
var _resolvedUpdate_node_asyncNodesResolved;
|
|
5227
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5228
|
-
try {
|
|
5229
|
-
for(var _iterator = ((_resolvedUpdate_node_asyncNodesResolved = resolvedUpdate.node.asyncNodesResolved) !== null && _resolvedUpdate_node_asyncNodesResolved !== void 0 ? _resolvedUpdate_node_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5230
|
-
var key = _step.value;
|
|
5231
|
-
nextAsyncIdMap.set(key, resolvedUpdate.node);
|
|
5232
|
-
}
|
|
5233
|
-
} catch (err) {
|
|
5234
|
-
_didIteratorError = true;
|
|
5235
|
-
_iteratorError = err;
|
|
5236
|
-
} finally{
|
|
5237
|
-
try {
|
|
5238
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
5239
|
-
_iterator.return();
|
|
5240
|
-
}
|
|
5241
|
-
} finally{
|
|
5242
|
-
if (_didIteratorError) {
|
|
5243
|
-
throw _iteratorError;
|
|
5244
|
-
}
|
|
5245
|
-
}
|
|
5246
|
-
}
|
|
5247
5240
|
var handleChildNode = function(childNode) {
|
|
5248
5241
|
var _prevASTMap_get;
|
|
5249
5242
|
var originalChildNode = (_prevASTMap_get = prevASTMap.get(childNode)) !== null && _prevASTMap_get !== void 0 ? _prevASTMap_get : childNode;
|
|
@@ -5274,30 +5267,6 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5274
5267
|
type: "empty"
|
|
5275
5268
|
};
|
|
5276
5269
|
resolvedAST.parent = partiallyResolvedParent;
|
|
5277
|
-
if (resolvedAST.type === "async") {
|
|
5278
|
-
nextAsyncIdMap.set(resolvedAST.id, resolvedAST);
|
|
5279
|
-
}
|
|
5280
|
-
var _resolvedAST_asyncNodesResolved;
|
|
5281
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5282
|
-
try {
|
|
5283
|
-
for(var _iterator = ((_resolvedAST_asyncNodesResolved = resolvedAST.asyncNodesResolved) !== null && _resolvedAST_asyncNodesResolved !== void 0 ? _resolvedAST_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5284
|
-
var id = _step.value;
|
|
5285
|
-
nextAsyncIdMap.set(id, resolvedAST);
|
|
5286
|
-
}
|
|
5287
|
-
} catch (err) {
|
|
5288
|
-
_didIteratorError = true;
|
|
5289
|
-
_iteratorError = err;
|
|
5290
|
-
} finally{
|
|
5291
|
-
try {
|
|
5292
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
5293
|
-
_iterator.return();
|
|
5294
|
-
}
|
|
5295
|
-
} finally{
|
|
5296
|
-
if (_didIteratorError) {
|
|
5297
|
-
throw _iteratorError;
|
|
5298
|
-
}
|
|
5299
|
-
}
|
|
5300
|
-
}
|
|
5301
5270
|
resolveOptions.node = resolvedAST;
|
|
5302
5271
|
this.ASTMap.set(resolvedAST, node);
|
|
5303
5272
|
var resolved = this.hooks.resolve.call(void 0, resolvedAST, resolveOptions);
|
|
@@ -5310,7 +5279,7 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5310
5279
|
if ("children" in resolvedAST) {
|
|
5311
5280
|
var _resolvedAST_children;
|
|
5312
5281
|
var newChildren = (_resolvedAST_children = resolvedAST.children) === null || _resolvedAST_children === void 0 ? void 0 : _resolvedAST_children.map(function(child) {
|
|
5313
|
-
var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap,
|
|
5282
|
+
var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nodeChanges);
|
|
5314
5283
|
var childTreeDeps = computedChildTree.dependencies, childNode = computedChildTree.node, childUpdated = computedChildTree.updated, childValue = computedChildTree.value;
|
|
5315
5284
|
childTreeDeps.forEach(function(binding) {
|
|
5316
5285
|
return childDependencies.add(binding);
|
|
@@ -5333,7 +5302,7 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5333
5302
|
var childValue = [];
|
|
5334
5303
|
var rawParentToPassIn = node;
|
|
5335
5304
|
resolvedAST.values = resolvedAST.values.map(function(mValue) {
|
|
5336
|
-
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap,
|
|
5305
|
+
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nodeChanges);
|
|
5337
5306
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
5338
5307
|
mTree.dependencies.forEach(function(bindingDep) {
|
|
5339
5308
|
return childDependencies.add(bindingDep);
|
|
@@ -5437,19 +5406,17 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5437
5406
|
}
|
|
5438
5407
|
_create_class(ViewInstance, [
|
|
5439
5408
|
{
|
|
5440
|
-
key: "updateAsync",
|
|
5409
|
+
/** @deprecated use ViewController.updateViewAST */ key: "updateAsync",
|
|
5441
5410
|
value: function updateAsync(asyncNode) {
|
|
5442
5411
|
var _this_resolver;
|
|
5443
|
-
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update(
|
|
5444
|
-
asyncNode
|
|
5445
|
-
]));
|
|
5412
|
+
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update();
|
|
5446
5413
|
this.lastUpdate = update;
|
|
5447
5414
|
this.hooks.onUpdate.call(update);
|
|
5448
5415
|
}
|
|
5449
5416
|
},
|
|
5450
5417
|
{
|
|
5451
5418
|
key: "update",
|
|
5452
|
-
value: function update(changes) {
|
|
5419
|
+
value: function update(changes, nodeChanges) {
|
|
5453
5420
|
var _this_resolver;
|
|
5454
5421
|
if (this.rootNode === void 0) {
|
|
5455
5422
|
this.validationProvider = new CrossfieldProvider(this.initialView, this.resolverOptions.parseBinding, this.resolverOptions.logger);
|
|
@@ -5467,7 +5434,7 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5467
5434
|
}));
|
|
5468
5435
|
this.hooks.resolver.call(this.resolver);
|
|
5469
5436
|
}
|
|
5470
|
-
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update(changes);
|
|
5437
|
+
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update(changes, nodeChanges);
|
|
5471
5438
|
if (this.lastUpdate === update) {
|
|
5472
5439
|
return this.lastUpdate;
|
|
5473
5440
|
}
|
|
@@ -7385,6 +7352,10 @@ var ReferenceAssetsPlugin = function() {
|
|
|
7385
7352
|
]);
|
|
7386
7353
|
return ValidationController;
|
|
7387
7354
|
}();
|
|
7355
|
+
var mergeSets = function(setA, setB) {
|
|
7356
|
+
var _setA_values, _setB_values;
|
|
7357
|
+
return /* @__PURE__ */ new Set(_to_consumable_array((_setA_values = setA === null || setA === void 0 ? void 0 : setA.values()) !== null && _setA_values !== void 0 ? _setA_values : []).concat(_to_consumable_array((_setB_values = setB === null || setB === void 0 ? void 0 : setB.values()) !== null && _setB_values !== void 0 ? _setB_values : [])));
|
|
7358
|
+
};
|
|
7388
7359
|
var ViewController = /*#__PURE__*/ function() {
|
|
7389
7360
|
function ViewController(initialViews, options) {
|
|
7390
7361
|
var _this = this;
|
|
@@ -7414,7 +7385,7 @@ var ReferenceAssetsPlugin = function() {
|
|
|
7414
7385
|
var silent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
7415
7386
|
if (_this1.currentView) {
|
|
7416
7387
|
if (_this1.optimizeUpdates) {
|
|
7417
|
-
_this1.queueUpdate(updates, silent);
|
|
7388
|
+
_this1.queueUpdate(updates, void 0, silent);
|
|
7418
7389
|
} else {
|
|
7419
7390
|
_this1.currentView.update();
|
|
7420
7391
|
}
|
|
@@ -7444,25 +7415,26 @@ var ReferenceAssetsPlugin = function() {
|
|
|
7444
7415
|
_create_class(ViewController, [
|
|
7445
7416
|
{
|
|
7446
7417
|
key: "queueUpdate",
|
|
7447
|
-
value: function queueUpdate(bindings) {
|
|
7418
|
+
value: function queueUpdate(bindings, nodes) {
|
|
7448
7419
|
var _this = this;
|
|
7449
|
-
var silent = arguments.length >
|
|
7450
|
-
|
|
7451
|
-
if ((_this_pendingUpdate = this.pendingUpdate) === null || _this_pendingUpdate === void 0 ? void 0 : _this_pendingUpdate.changedBindings) {
|
|
7452
|
-
this.pendingUpdate.changedBindings = /* @__PURE__ */ new Set(_to_consumable_array(this.pendingUpdate.changedBindings).concat(_to_consumable_array(bindings)));
|
|
7453
|
-
} else {
|
|
7420
|
+
var silent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
7421
|
+
if (!this.pendingUpdate) {
|
|
7454
7422
|
this.pendingUpdate = {
|
|
7455
|
-
changedBindings: bindings,
|
|
7456
7423
|
scheduled: false
|
|
7457
7424
|
};
|
|
7458
7425
|
}
|
|
7426
|
+
this.pendingUpdate = _object_spread_props(_object_spread({}, this.pendingUpdate), {
|
|
7427
|
+
changedBindings: mergeSets(this.pendingUpdate.changedBindings, bindings),
|
|
7428
|
+
changedNodes: mergeSets(this.pendingUpdate.changedNodes, nodes)
|
|
7429
|
+
});
|
|
7459
7430
|
if (!this.pendingUpdate.scheduled && !silent) {
|
|
7460
7431
|
this.pendingUpdate.scheduled = true;
|
|
7461
7432
|
(0, import_queue_microtask2.default)(function() {
|
|
7462
|
-
var
|
|
7463
|
-
var
|
|
7433
|
+
var _this_currentView;
|
|
7434
|
+
var _this_pendingUpdate;
|
|
7435
|
+
var _ref = (_this_pendingUpdate = _this.pendingUpdate) !== null && _this_pendingUpdate !== void 0 ? _this_pendingUpdate : {}, changedBindings = _ref.changedBindings, changedNodes = _ref.changedNodes;
|
|
7464
7436
|
_this.pendingUpdate = void 0;
|
|
7465
|
-
(_this_currentView = _this.currentView) === null || _this_currentView === void 0 ? void 0 : _this_currentView.update(
|
|
7437
|
+
(_this_currentView = _this.currentView) === null || _this_currentView === void 0 ? void 0 : _this_currentView.update(changedBindings, changedNodes);
|
|
7466
7438
|
});
|
|
7467
7439
|
}
|
|
7468
7440
|
}
|
|
@@ -7539,6 +7511,15 @@ var ReferenceAssetsPlugin = function() {
|
|
|
7539
7511
|
new MultiNodePlugin()
|
|
7540
7512
|
];
|
|
7541
7513
|
}
|
|
7514
|
+
},
|
|
7515
|
+
{
|
|
7516
|
+
/** Marks all AST nodes in `nodes` as changed, triggering the view to update and re-resolve these nodes. View updates are triggered asynchronously and many calls to this in a short time will batch into a single update.
|
|
7517
|
+
*
|
|
7518
|
+
* NOTE: In most cases view updates are handled automatically by changes to data or any other built-in functionality that would require a view update. Only call this function if absolutely necessary.
|
|
7519
|
+
*/ key: "updateViewAST",
|
|
7520
|
+
value: function updateViewAST(nodes) {
|
|
7521
|
+
this.queueUpdate(void 0, nodes);
|
|
7522
|
+
}
|
|
7542
7523
|
}
|
|
7543
7524
|
]);
|
|
7544
7525
|
return ViewController;
|
|
@@ -7911,8 +7892,8 @@ var ReferenceAssetsPlugin = function() {
|
|
|
7911
7892
|
ref: Symbol("not-started"),
|
|
7912
7893
|
status: "not-started"
|
|
7913
7894
|
};
|
|
7914
|
-
var PLAYER_VERSION = true ? "0.15.0-next.
|
|
7915
|
-
var COMMIT = true ? "
|
|
7895
|
+
var PLAYER_VERSION = true ? "0.15.0-next.6" : "unknown";
|
|
7896
|
+
var COMMIT = true ? "9b22cee7078ed75d77b3c31bc306c758ea07da8b" : "unknown";
|
|
7916
7897
|
var _Player = /*#__PURE__*/ function() {
|
|
7917
7898
|
function _Player2(config) {
|
|
7918
7899
|
var _this = this;
|
|
@@ -8529,7 +8510,12 @@ var ReferenceAssetsPlugin = function() {
|
|
|
8529
8510
|
key: "apply",
|
|
8530
8511
|
value: function apply(player) {
|
|
8531
8512
|
var _this = this;
|
|
8513
|
+
var _this_plugins;
|
|
8532
8514
|
this.playerInstance = player;
|
|
8515
|
+
(_this_plugins = this.plugins) === null || _this_plugins === void 0 ? void 0 : _this_plugins.forEach(function(plugin) {
|
|
8516
|
+
var _plugin_applyPlayer;
|
|
8517
|
+
(_plugin_applyPlayer = plugin.applyPlayer) === null || _plugin_applyPlayer === void 0 ? void 0 : _plugin_applyPlayer.call(plugin, player);
|
|
8518
|
+
});
|
|
8533
8519
|
player.hooks.viewController.tap(this.name, function(viewController) {
|
|
8534
8520
|
viewController.hooks.view.tap(_this.name, function(view) {
|
|
8535
8521
|
var _this_plugins;
|
|
@@ -8578,10 +8564,14 @@ var ReferenceAssetsPlugin = function() {
|
|
|
8578
8564
|
* @param view The view instance where the node resides. This can be undefined if the view is not currently active.
|
|
8579
8565
|
*/ key: "handleAsyncUpdate",
|
|
8580
8566
|
value: function handleAsyncUpdate(node, context, newNode) {
|
|
8581
|
-
var nodeResolveCache = context.nodeResolveCache,
|
|
8567
|
+
var nodeResolveCache = context.nodeResolveCache, viewController = context.viewController, originalNodeCache = context.originalNodeCache;
|
|
8582
8568
|
if (nodeResolveCache.get(node.id) !== newNode) {
|
|
8583
8569
|
nodeResolveCache.set(node.id, newNode ? newNode : node);
|
|
8584
|
-
|
|
8570
|
+
var _originalNodeCache_get;
|
|
8571
|
+
var originalNode = (_originalNodeCache_get = originalNodeCache.get(node.id)) !== null && _originalNodeCache_get !== void 0 ? _originalNodeCache_get : /* @__PURE__ */ new Set([
|
|
8572
|
+
node
|
|
8573
|
+
]);
|
|
8574
|
+
viewController.updateViewAST(originalNode);
|
|
8585
8575
|
}
|
|
8586
8576
|
}
|
|
8587
8577
|
},
|
|
@@ -8605,12 +8595,13 @@ var ReferenceAssetsPlugin = function() {
|
|
|
8605
8595
|
if (!_this.isAsync(node)) {
|
|
8606
8596
|
return node === null ? node : _this.resolveAsyncChildren(node, context);
|
|
8607
8597
|
}
|
|
8598
|
+
if (options.node) {
|
|
8599
|
+
context.originalNodeCache.set(node.id, /* @__PURE__ */ new Set([
|
|
8600
|
+
options.node
|
|
8601
|
+
]));
|
|
8602
|
+
}
|
|
8608
8603
|
var resolvedNode = context.nodeResolveCache.get(node.id);
|
|
8609
8604
|
if (resolvedNode !== void 0) {
|
|
8610
|
-
if (resolvedNode.asyncNodesResolved === void 0) {
|
|
8611
|
-
resolvedNode.asyncNodesResolved = [];
|
|
8612
|
-
}
|
|
8613
|
-
resolvedNode.asyncNodesResolved.push(node.id);
|
|
8614
8605
|
return _this.resolveAsyncChildren(resolvedNode, context);
|
|
8615
8606
|
}
|
|
8616
8607
|
if (context.inProgressNodes.has(node.id)) {
|
|
@@ -8634,35 +8625,39 @@ var ReferenceAssetsPlugin = function() {
|
|
|
8634
8625
|
*/ key: "resolveAsyncChildren",
|
|
8635
8626
|
value: function resolveAsyncChildren(node, context) {
|
|
8636
8627
|
var _this = this;
|
|
8637
|
-
var _node_asyncNodesResolved;
|
|
8638
|
-
var asyncNodesResolved = (_node_asyncNodesResolved = node.asyncNodesResolved) !== null && _node_asyncNodesResolved !== void 0 ? _node_asyncNodesResolved : [];
|
|
8639
|
-
node.asyncNodesResolved = asyncNodesResolved;
|
|
8640
8628
|
if (node.type === NodeType.MultiNode) {
|
|
8641
|
-
var
|
|
8642
|
-
while(index < node.values.length){
|
|
8629
|
+
var _this1, _loop = function() {
|
|
8643
8630
|
var childNode = node.values[index];
|
|
8644
|
-
if ((childNode === null || childNode === void 0 ? void 0 : childNode.type) !== NodeType.Async || !
|
|
8631
|
+
if ((childNode === null || childNode === void 0 ? void 0 : childNode.type) !== NodeType.Async || !_this1.hasValidMapping(childNode, context)) {
|
|
8645
8632
|
index++;
|
|
8646
|
-
continue;
|
|
8633
|
+
return "continue";
|
|
8647
8634
|
}
|
|
8648
8635
|
var mappedNode = context.nodeResolveCache.get(childNode.id);
|
|
8649
|
-
|
|
8636
|
+
var nodeSet = /* @__PURE__ */ new Set();
|
|
8650
8637
|
if (mappedNode.type === NodeType.MultiNode && childNode.flatten) {
|
|
8651
8638
|
mappedNode.values.forEach(function(v) {
|
|
8652
|
-
|
|
8639
|
+
v.parent = node;
|
|
8640
|
+
nodeSet.add(v);
|
|
8653
8641
|
});
|
|
8654
8642
|
node.values = _to_consumable_array(node.values.slice(0, index)).concat(_to_consumable_array(mappedNode.values), _to_consumable_array(node.values.slice(index + 1)));
|
|
8655
8643
|
} else {
|
|
8656
8644
|
node.values[index] = mappedNode;
|
|
8657
8645
|
mappedNode.parent = node;
|
|
8646
|
+
nodeSet.add(mappedNode);
|
|
8658
8647
|
}
|
|
8659
|
-
|
|
8648
|
+
context.originalNodeCache.set(childNode.id, nodeSet);
|
|
8649
|
+
};
|
|
8650
|
+
var index = 0;
|
|
8651
|
+
while(index < node.values.length)_this1 = this, _loop();
|
|
8660
8652
|
} else if ("children" in node) {
|
|
8661
8653
|
var _node_children;
|
|
8662
8654
|
(_node_children = node.children) === null || _node_children === void 0 ? void 0 : _node_children.forEach(function(c) {
|
|
8663
8655
|
while(c.value.type === NodeType.Async && _this.hasValidMapping(c.value, context)){
|
|
8664
|
-
|
|
8665
|
-
|
|
8656
|
+
var mappedNode = context.nodeResolveCache.get(c.value.id);
|
|
8657
|
+
context.originalNodeCache.set(c.value.id, /* @__PURE__ */ new Set([
|
|
8658
|
+
mappedNode
|
|
8659
|
+
]));
|
|
8660
|
+
c.value = mappedNode;
|
|
8666
8661
|
c.value.parent = node;
|
|
8667
8662
|
}
|
|
8668
8663
|
});
|
|
@@ -8782,15 +8777,26 @@ var ReferenceAssetsPlugin = function() {
|
|
|
8782
8777
|
{
|
|
8783
8778
|
key: "apply",
|
|
8784
8779
|
value: function apply(view) {
|
|
8785
|
-
var _this = this;
|
|
8786
|
-
var context = {
|
|
8787
|
-
nodeResolveCache: /* @__PURE__ */ new Map(),
|
|
8788
|
-
inProgressNodes: /* @__PURE__ */ new Set(),
|
|
8789
|
-
view: view
|
|
8790
|
-
};
|
|
8791
8780
|
view.hooks.parser.tap("async", this.applyParser.bind(this));
|
|
8792
|
-
|
|
8793
|
-
|
|
8781
|
+
}
|
|
8782
|
+
},
|
|
8783
|
+
{
|
|
8784
|
+
key: "applyPlayer",
|
|
8785
|
+
value: function applyPlayer(player) {
|
|
8786
|
+
var _this = this;
|
|
8787
|
+
player.hooks.viewController.tap("async", function(viewController) {
|
|
8788
|
+
viewController.hooks.view.tap("async", function(view) {
|
|
8789
|
+
var context = {
|
|
8790
|
+
nodeResolveCache: /* @__PURE__ */ new Map(),
|
|
8791
|
+
inProgressNodes: /* @__PURE__ */ new Set(),
|
|
8792
|
+
view: view,
|
|
8793
|
+
viewController: viewController,
|
|
8794
|
+
originalNodeCache: /* @__PURE__ */ new Map()
|
|
8795
|
+
};
|
|
8796
|
+
view.hooks.resolver.tap("async", function(resolver) {
|
|
8797
|
+
_this.applyResolver(resolver, context);
|
|
8798
|
+
});
|
|
8799
|
+
});
|
|
8794
8800
|
});
|
|
8795
8801
|
}
|
|
8796
8802
|
},
|