@singi-labs/sifa-sdk 0.18.17 → 0.18.18

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.
package/dist/index.cjs CHANGED
@@ -5460,7 +5460,13 @@ function pickTalk(presentations, deliveries, today, self) {
5460
5460
  const date = dated.reduce((max, d) => d.date && d.date > max ? d.date : max, "");
5461
5461
  const delivery2 = dated.find((d) => d.date === date);
5462
5462
  if (!delivery2) continue;
5463
- occasions.push({ date, title: p.title, delivery: delivery2, imageUrl: p.coverImageUrl ?? void 0 });
5463
+ occasions.push({
5464
+ date,
5465
+ title: p.title,
5466
+ delivery: delivery2,
5467
+ imageUrl: p.coverImageUrl ?? void 0,
5468
+ primary: p.primary === true
5469
+ });
5464
5470
  }
5465
5471
  for (const d of deliveries) {
5466
5472
  const standalone = !d.presentationRkey || !talkRkeys.has(d.presentationRkey);
@@ -5468,7 +5474,9 @@ function pickTalk(presentations, deliveries, today, self) {
5468
5474
  occasions.push({ date: d.date, title: d.title || d.eventName || "Talk", delivery: d });
5469
5475
  }
5470
5476
  if (!occasions.length) return void 0;
5471
- const best = occasions.reduce((a, b) => b.date > a.date ? b : a);
5477
+ const primaryOccasions = occasions.filter((o) => o.primary);
5478
+ const pool = primaryOccasions.length ? primaryOccasions : occasions;
5479
+ const best = pool.reduce((a, b) => b.date > a.date ? b : a);
5472
5480
  const { delivery } = best;
5473
5481
  return {
5474
5482
  section: "talk",
@@ -5497,7 +5505,8 @@ function buildProfileHighlights(profile, { today }) {
5497
5505
  self
5498
5506
  );
5499
5507
  if (talk) row1.push(talk);
5500
- const publication = sortByDateDesc(visible(profile.publications), singleDateExtractor)[0];
5508
+ const visiblePublications = visible(profile.publications);
5509
+ const publication = pickPrimaryFlagged(visiblePublications) ?? sortByDateDesc(visiblePublications, singleDateExtractor)[0];
5501
5510
  if (publication) {
5502
5511
  const venue = publication.publicationName ?? publication.publisher;
5503
5512
  const coAuthors = coPeopleLabel(publication.contributors, self);
@@ -5524,7 +5533,8 @@ function buildProfileHighlights(profile, { today }) {
5524
5533
  status: career.endedAt ? "recent" : "current"
5525
5534
  });
5526
5535
  }
5527
- const education = sortByDateDesc(visible(profile.education), lexiconDateExtractor)[0];
5536
+ const visibleEducation = visible(profile.education);
5537
+ const education = pickPrimaryFlagged(visibleEducation) ?? sortByDateDesc(visibleEducation, lexiconDateExtractor)[0];
5528
5538
  if (education) {
5529
5539
  const institution = education.entityName ?? education.institution;
5530
5540
  const title = education.degree || education.fieldOfStudy || institution || "Education";
@@ -5550,7 +5560,7 @@ function buildProfileHighlights(profile, { today }) {
5550
5560
  }
5551
5561
  }
5552
5562
  const ongoingProjects = visible(profile.projects).filter((p) => !p.endDate);
5553
- const project = sortByDateDesc(ongoingProjects, dateRangeExtractor)[0];
5563
+ const project = pickPrimaryFlagged(ongoingProjects) ?? sortByDateDesc(ongoingProjects, dateRangeExtractor)[0];
5554
5564
  if (project) {
5555
5565
  row2.push({
5556
5566
  section: "project",
@@ -5562,7 +5572,7 @@ function buildProfileHighlights(profile, { today }) {
5562
5572
  });
5563
5573
  }
5564
5574
  const ongoingInvolvement = visible(profile.involvement).filter((i) => !i.endedAt);
5565
- const involvement = sortByDateDesc(ongoingInvolvement, lexiconDateExtractor)[0];
5575
+ const involvement = pickPrimaryFlagged(ongoingInvolvement) ?? sortByDateDesc(ongoingInvolvement, lexiconDateExtractor)[0];
5566
5576
  if (involvement) {
5567
5577
  row2.push({
5568
5578
  section: "involvement",
@@ -6407,7 +6417,7 @@ function describeSifaRecord(collection, value) {
6407
6417
  }
6408
6418
 
6409
6419
  // src/index.ts
6410
- var SIFA_SDK_VERSION = "0.18.17";
6420
+ var SIFA_SDK_VERSION = "0.18.18";
6411
6421
 
6412
6422
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
6413
6423
  exports.ACTIVITY_VERBS = ACTIVITY_VERBS;