@yahoo/uds-create-config 5.91.0 → 5.91.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.
|
@@ -1260,6 +1260,19 @@ function subtreeBinds(anatomy, key, prop) {
|
|
|
1260
1260
|
};
|
|
1261
1261
|
return visit(key);
|
|
1262
1262
|
}
|
|
1263
|
+
/** Whether a stored value is a `$computed` call that reads `prop` among its arguments. */
|
|
1264
|
+
function computesFrom(value, prop) {
|
|
1265
|
+
if (!value || typeof value !== "object") return false;
|
|
1266
|
+
const record = value;
|
|
1267
|
+
if (typeof record.$computed === "string") return readsState(record.args, prop);
|
|
1268
|
+
return Object.values(value).some((inner) => computesFrom(inner, prop));
|
|
1269
|
+
}
|
|
1270
|
+
/** Whether a stored value reads `{ $state: '/prop' }` anywhere inside it. */
|
|
1271
|
+
function readsState(value, prop) {
|
|
1272
|
+
if (!value || typeof value !== "object") return false;
|
|
1273
|
+
if (boundPropOf(value) === prop) return true;
|
|
1274
|
+
return Object.values(value).some((inner) => readsState(inner, prop));
|
|
1275
|
+
}
|
|
1263
1276
|
/**
|
|
1264
1277
|
* Replace one component instance with the tree it is made of.
|
|
1265
1278
|
*
|
|
@@ -1448,7 +1461,7 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
|
|
|
1448
1461
|
return key;
|
|
1449
1462
|
}
|
|
1450
1463
|
const slot = layer ? targets.get(layer) : void 0;
|
|
1451
|
-
const slotValue = slot && !subtreeBinds(anatomy, key, slot.from) && !(positioned.has(slot.from) && isText(instanceProps[slot.from])) ? instanceProps[slot.from] : void 0;
|
|
1464
|
+
const slotValue = slot && !subtreeBinds(anatomy, key, slot.from) && !(positioned.has(slot.from) && isText(instanceProps[slot.from])) && !(isText(instanceProps[slot.from]) && computesFrom(node.props?.[intoName(slot.into)], slot.from)) ? instanceProps[slot.from] : void 0;
|
|
1452
1465
|
const siblingRoutes = layer ? (targetedRoutes.get(layer) ?? []).filter((route) => route !== slot) : [];
|
|
1453
1466
|
const siblingValues = Object.fromEntries(siblingRoutes.filter((route) => instanceProps[route.from] !== void 0 && !subtreeBinds(anatomy, key, route.from)).map((route) => [intoName(route.into), instanceProps[route.from]]));
|
|
1454
1467
|
const authored = authoredProps(config, node.props);
|