@vectoriox/iox-ui 5.181.0 → 5.183.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.
@@ -6682,15 +6682,31 @@ function presetDesign(presetId, input, kept = {}, read = null) {
6682
6682
  const scrubs = scrub && SCRUB_LEVELS.includes(start.animate) ? { scrub } : {};
6683
6683
  return { ...rest, ...opens, ...scrubs, ...(seed?.used ? { seed: seed.seed } : {}), scroll: start.scroll, animate: start.animate, between: start.between, ...kept };
6684
6684
  }
6685
- /** The look a business starts from: its best-ranked style (with the references' boost), at its defaults. */
6686
- function startingDesign(input, read = null) {
6685
+ /**
6686
+ * The look a business starts from: its best-ranked style (with the references' boost), at its defaults.
6687
+ *
6688
+ * iox-ui#154 (the J10 re-score, award-ingredients-plan §7.18 SJ-D10): two sites of one studio with the same kind of
6689
+ * business STARTED from the same look (same preset, same seed). `worn` names the styles the studio's other sites already
6690
+ * wear (the fingerprints' `preset`); the start skips them and takes the next-ranked style that still fits (never a Poor
6691
+ * fit — one the kind of business or the owner advises against). A style the references' colour re-seeds is a look of its own and is
6692
+ * not skipped. When every fitting style is worn, the best-ranked one — the owner may always pick any look.
6693
+ */
6694
+ function startingDesign(input, read = null, worn = []) {
6687
6695
  const rankInput = typeof input === 'object' && input !== null ? input : { businessType: input };
6688
- const top = rankWithReferences(rankInput, read)[0];
6696
+ const ranked = rankWithReferences(rankInput, read);
6697
+ const top = unwornStart(ranked, worn, read) ?? ranked[0];
6689
6698
  const design = top ? presetDesign(top.id, rankInput, {}, read) : null;
6690
6699
  if (!top || !design)
6691
6700
  return null;
6692
6701
  return { presetId: top.id, design, referenceColour: !!referenceSeed(read, top.id)?.used };
6693
6702
  }
6703
+ /** The best-ranked style that fits and that no other site of the studio wears (a re-seeded one is its own look). */
6704
+ function unwornStart(ranked, worn, read) {
6705
+ if (!worn.length)
6706
+ return ranked[0];
6707
+ const taken = new Set(worn);
6708
+ return ranked.find(r => r.fit !== PresetFit.Poor && (!taken.has(r.id) || !!referenceSeed(read, r.id)?.used));
6709
+ }
6694
6710
 
6695
6711
  /**
6696
6712
  * The opening film, SUGGESTED (award-ingredients-plan §0b + §0b.7, AW-D26…AW-D32 — "the same moment, not the same