@player-ui/reference-assets-plugin 0.10.5--canary.630.22572 → 0.10.5--canary.642.22625
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 +1 -61
- 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/package.json +5 -5
|
@@ -5180,32 +5180,10 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5180
5180
|
node.children.push(newChild);
|
|
5181
5181
|
return node;
|
|
5182
5182
|
}
|
|
5183
|
-
},
|
|
5184
|
-
{
|
|
5185
|
-
key: "updateChildrenByPath",
|
|
5186
|
-
value: /**
|
|
5187
|
-
* Updates children of a node of the same path and preserves order
|
|
5188
|
-
*
|
|
5189
|
-
* @param node - The node to update children for
|
|
5190
|
-
* @param pathToMatch - The path to match against child paths
|
|
5191
|
-
* @param mapFn - Function to transform matching children
|
|
5192
|
-
*/ function updateChildrenByPath(node, pathToMatch, updateFn) {
|
|
5193
|
-
if (!node.children) return node;
|
|
5194
|
-
var updatedChildren = node.children.map(function(child) {
|
|
5195
|
-
return(// Check if paths match exactly
|
|
5196
|
-
child.path.join() === pathToMatch.join() ? _object_spread_props(_object_spread({}, child), {
|
|
5197
|
-
value: updateFn(child)
|
|
5198
|
-
}) : child);
|
|
5199
|
-
});
|
|
5200
|
-
return _object_spread_props(_object_spread({}, node), {
|
|
5201
|
-
children: updatedChildren
|
|
5202
|
-
});
|
|
5203
|
-
}
|
|
5204
5183
|
}
|
|
5205
5184
|
]);
|
|
5206
5185
|
return _Builder;
|
|
5207
5186
|
}();
|
|
5208
|
-
var templateSymbol = Symbol("template");
|
|
5209
5187
|
var TemplatePlugin = /*#__PURE__*/ function() {
|
|
5210
5188
|
function TemplatePlugin(options) {
|
|
5211
5189
|
_class_call_check(this, TemplatePlugin);
|
|
@@ -5276,9 +5254,6 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5276
5254
|
override: false,
|
|
5277
5255
|
values: values
|
|
5278
5256
|
};
|
|
5279
|
-
if (node.placement !== void 0) {
|
|
5280
|
-
result[templateSymbol] = node.placement;
|
|
5281
|
-
}
|
|
5282
5257
|
return result;
|
|
5283
5258
|
}
|
|
5284
5259
|
},
|
|
@@ -5292,40 +5267,6 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5292
5267
|
}
|
|
5293
5268
|
return node;
|
|
5294
5269
|
});
|
|
5295
|
-
parser.hooks.onCreateASTNode.tap("template", function(node) {
|
|
5296
|
-
var getTemplateSymbolValue = function getTemplateSymbolValue(node2) {
|
|
5297
|
-
if (node2.type === "multi-node") {
|
|
5298
|
-
return node2[templateSymbol];
|
|
5299
|
-
} else if (node2.type === "template") {
|
|
5300
|
-
return node2.placement;
|
|
5301
|
-
}
|
|
5302
|
-
return void 0;
|
|
5303
|
-
};
|
|
5304
|
-
if (node && (node.type === "view" || node.type === "asset") && Array.isArray(node.children)) {
|
|
5305
|
-
node.children = node.children.sort(function(a, b) {
|
|
5306
|
-
var aPath = a.path.join();
|
|
5307
|
-
var bPath = b.path.join();
|
|
5308
|
-
var pathsEqual = aPath === bPath;
|
|
5309
|
-
if (pathsEqual) {
|
|
5310
|
-
var aPlacement = getTemplateSymbolValue(a.value);
|
|
5311
|
-
var bPlacement = getTemplateSymbolValue(b.value);
|
|
5312
|
-
if (aPlacement !== void 0 && bPlacement === void 0) {
|
|
5313
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
5314
|
-
} else if (bPlacement !== void 0 && aPlacement === void 0) {
|
|
5315
|
-
return bPlacement === "prepend" ? 1 : -1;
|
|
5316
|
-
} else if (aPlacement !== void 0 && bPlacement !== void 0) {
|
|
5317
|
-
if (aPlacement === bPlacement) {
|
|
5318
|
-
return 0;
|
|
5319
|
-
}
|
|
5320
|
-
return aPlacement === "prepend" ? -1 : 1;
|
|
5321
|
-
}
|
|
5322
|
-
return 0;
|
|
5323
|
-
}
|
|
5324
|
-
return aPath > bPath ? 1 : -1;
|
|
5325
|
-
});
|
|
5326
|
-
}
|
|
5327
|
-
return node;
|
|
5328
|
-
});
|
|
5329
5270
|
parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
|
|
5330
5271
|
if (childOptions && hasTemplateKey(childOptions.key)) {
|
|
5331
5272
|
return obj.map(function(template) {
|
|
@@ -5335,8 +5276,7 @@ var ReferenceAssetsPlugin = function() {
|
|
|
5335
5276
|
depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
|
|
5336
5277
|
data: template.data,
|
|
5337
5278
|
template: template.value,
|
|
5338
|
-
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
5339
|
-
placement: template.placement
|
|
5279
|
+
dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
|
|
5340
5280
|
}, template);
|
|
5341
5281
|
if (!templateAST) return;
|
|
5342
5282
|
if (templateAST.type === "multi-node") {
|