@yahoo/uds-create-config 5.61.0 → 5.61.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.
@@ -366,14 +366,29 @@ function surfaceProps(config, componentPath, seen = /* @__PURE__ */ new Set()) {
366
366
  *
367
367
  * `seen` guards a forward that routes to a forward that routes back: the chain is data, so nothing
368
368
  * stops an author writing a loop, and the surface is read on every panel render.
369
+ *
370
+ * A route that ends on a prop nothing declares (a Text layer's `href`, a tag layer's `aria-label`)
371
+ * still reaches the element at runtime, so it surfaces as a plain string: there is no declaration to
372
+ * say otherwise, and the alternative is a prop with no control at all. An event handler (`onClick`)
373
+ * is never declared on the far end either, and takes a function, so it stays hidden.
369
374
  */
370
375
  function boundProp(config, layers, decl, seen) {
371
376
  const propName = intoName(decl.into);
372
- const target = isRef(decl.into) ? pathOf(decl.into) : refPath(layers?.[refPath(decl.target) ?? ""]);
373
- if (!target) return void 0;
377
+ const element = layers?.[refPath(decl.target) ?? ""];
378
+ const undeclared = /^on[A-Z]/.test(propName) ? void 0 : {
379
+ name: propName,
380
+ kind: "string",
381
+ required: false
382
+ };
383
+ const target = isRef(decl.into) ? pathOf(decl.into) : refPath(element);
384
+ if (!target) return typeof element === "string" ? undeclared : void 0;
374
385
  const key = `${target}#${propName}`;
375
386
  if (seen.has(key)) return void 0;
376
- return surfaceProps(config, target, new Set([...seen, key])).find((prop) => prop.name === propName);
387
+ const far = surfaceProps(config, target, new Set([...seen, key])).find((prop) => prop.name === propName);
388
+ if (far) return far;
389
+ const farBody = Component.get(config, target)?.toJSON();
390
+ if (!farBody) return void 0;
391
+ return propName in resolveComponentProps(config, target) || propName in (farBody.props ?? {}) ? void 0 : undeclared;
377
392
  }
378
393
  /** One prop by name, or `undefined` when the component doesn't expose it. */
379
394
  function surfaceProp(config, componentPath, name) {