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