@yahoo/uds-create-config 5.72.1 → 5.72.2
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.
|
@@ -286,7 +286,7 @@ const ForwardDefinition = defineSubEntity({
|
|
|
286
286
|
ctx.issues.push({
|
|
287
287
|
code: "custom",
|
|
288
288
|
input: ctx.value,
|
|
289
|
-
message: `layer "${key}" renders ${typeof element === "string" ? `<${element}>` : "no component"}, which declares no props to forward
|
|
289
|
+
message: `layer "${key}" renders ${typeof element === "string" ? `<${element}>` : "no component"}, which declares no props to forward. To send a call site's prop there, declare it as a route: \`{ "type": "forward", "target": "${key}/<prop>" }\`.`
|
|
290
290
|
});
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
@@ -1313,6 +1313,20 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
|
|
|
1313
1313
|
if (name === "__udsForceStates") continue;
|
|
1314
1314
|
if (!consumed.has(name) && !stateNames.has(name)) bag[name] = value;
|
|
1315
1315
|
}
|
|
1316
|
+
const forwardedSplits = /* @__PURE__ */ new Map();
|
|
1317
|
+
for (const [layer, names] of forwardedLayers(config, path)) {
|
|
1318
|
+
const picked = {};
|
|
1319
|
+
for (const name of names) {
|
|
1320
|
+
if (!(name in bag)) continue;
|
|
1321
|
+
picked[name] = bag[name];
|
|
1322
|
+
delete bag[name];
|
|
1323
|
+
}
|
|
1324
|
+
forwardedSplits.set(layer, splitStyleProps({
|
|
1325
|
+
config,
|
|
1326
|
+
bag: picked,
|
|
1327
|
+
through: [path]
|
|
1328
|
+
}));
|
|
1329
|
+
}
|
|
1316
1330
|
const { className: styleClasses, rest } = splitStyleProps({
|
|
1317
1331
|
config,
|
|
1318
1332
|
bag,
|
|
@@ -1446,12 +1460,12 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
|
|
|
1446
1460
|
...Object.fromEntries((valueRoutes.get(layer) ?? []).filter(({ from }) => state[from] !== void 0).map(({ from, into }) => [into, state[from]])),
|
|
1447
1461
|
...isRoot ? componentStateAttributes(componentStates(config, path), state) : {},
|
|
1448
1462
|
...isRoot || type === void 0 || kindOf(type) !== "component" ? forcedModifierAttributes(pins, path) : {},
|
|
1449
|
-
...isRoot ? rest :
|
|
1463
|
+
...isRoot ? rest : forwardedSplits.get(layer)?.rest,
|
|
1450
1464
|
...siblingValues,
|
|
1451
1465
|
...slot && slotValue !== void 0 ? { [intoName(slot.into)]: slotValue } : {},
|
|
1452
1466
|
...layerProps[layer],
|
|
1453
1467
|
className: classesFor(config, path, layer, state, [
|
|
1454
|
-
isRoot ? styleClasses :
|
|
1468
|
+
isRoot ? styleClasses : forwardedSplits.get(layer)?.className,
|
|
1455
1469
|
isRoot && !forwardsClassName ? instanceProps.className : void 0,
|
|
1456
1470
|
...(valueRoutes.get(layer) ?? []).filter(({ into }) => into === "className").map(({ from }) => state[from]),
|
|
1457
1471
|
layerProps[layer]?.className
|