@yschimke/compose-design-map 1.55.0 → 1.56.0

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.
Files changed (2) hide show
  1. package/design-map.mjs +12 -2
  2. package/package.json +1 -1
package/design-map.mjs CHANGED
@@ -521,8 +521,18 @@ export function declarationMisses(preview) {
521
521
  * "Malformed" is only about the entry's *shape*. An entry that is well-formed but names a width
522
522
  * this particular capture is not — the common case, since one declaration serves every size — is
523
523
  * not a fault and is not reported.
524
+ *
525
+ * Every entry is checked, including those after the one that matches: the report must not depend on
526
+ * where in the list the typo happens to sit. The first matching entry still wins.
524
527
  */
525
528
  export function breakpointKitNames(entries, widthDp, malformed = []) {
529
+ // Every entry is inspected before the match is returned, rather than returning at the one that
530
+ // matches. Returning early made the report ORDER-DEPENDENT: a typo sitting after the matching
531
+ // entry was never looked at, so it produced no diagnostic on this capture — and on a component
532
+ // with only ONE non-base breakpoint, which is the motivating Picker case, no other capture
533
+ // re-reads the list to catch it either. That is exactly the symptomless degradation the
534
+ // diagnostic exists to prevent. First match still wins.
535
+ let match = null;
526
536
  for (const entry of entries ?? []) {
527
537
  if (typeof entry !== "string") {
528
538
  malformed.push({ entry: String(entry), reason: "not a string" });
@@ -548,9 +558,9 @@ export function breakpointKitNames(entries, widthDp, malformed = []) {
548
558
  }
549
559
  // Well-formed but for another size: not a fault, and the overwhelmingly common case.
550
560
  if (width !== widthDp) continue;
551
- return { kitAxis, kitValue };
561
+ match ??= { kitAxis, kitValue };
552
562
  }
553
- return null;
563
+ return match;
554
564
  }
555
565
 
556
566
  export function variantRendersByComponent(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yschimke/compose-design-map",
3
- "version": "1.55.0",
3
+ "version": "1.56.0",
4
4
  "description": "Project a compose-preview discovery manifest into design-parity's design-map.json, plus a sidecar of unresolved variant declarations. Dependency-free.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",