@singi-labs/sifa-sdk 0.19.39 → 0.19.41

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.d.cts CHANGED
@@ -1808,6 +1808,7 @@ declare const STREAM_VERBS: readonly ["posted", "reposted", "published", "presen
1808
1808
  type StreamVerb = (typeof STREAM_VERBS)[number];
1809
1809
  /** Zod enum for a {@link StreamVerb}, shared with the view-model schema. */
1810
1810
  declare const streamVerbSchema: z.ZodEnum<{
1811
+ verified: "verified";
1811
1812
  created: "created";
1812
1813
  styledCharacter: "styledCharacter";
1813
1814
  joined: "joined";
@@ -1825,7 +1826,6 @@ declare const streamVerbSchema: z.ZodEnum<{
1825
1826
  published: "published";
1826
1827
  rsvped: "rsvped";
1827
1828
  commented: "commented";
1828
- verified: "verified";
1829
1829
  received: "received";
1830
1830
  supported: "supported";
1831
1831
  endorsed: "endorsed";
@@ -2807,7 +2807,12 @@ declare const ALL_SECTIONS: readonly [{
2807
2807
  }];
2808
2808
  /** Every profile section id, in canonical render order. */
2809
2809
  type SectionId = (typeof ALL_SECTIONS)[number]['id'];
2810
- /** Whether a section has content for a given profile (used to hide empty nav entries for visitors). */
2810
+ /**
2811
+ * Whether a section has content a visitor can see (used to hide empty nav
2812
+ * entries and sections for visitors). Items the owner hid do not count: a
2813
+ * section whose only entries are hidden renders nothing for a visitor, so it
2814
+ * must not get a nav entry either.
2815
+ */
2811
2816
  declare function isSectionPopulated(profile: Profile, id: string): boolean;
2812
2817
  /**
2813
2818
  * The section ids a given viewer should see, in {@link ALL_SECTIONS} order.
package/dist/index.d.ts CHANGED
@@ -1808,6 +1808,7 @@ declare const STREAM_VERBS: readonly ["posted", "reposted", "published", "presen
1808
1808
  type StreamVerb = (typeof STREAM_VERBS)[number];
1809
1809
  /** Zod enum for a {@link StreamVerb}, shared with the view-model schema. */
1810
1810
  declare const streamVerbSchema: z.ZodEnum<{
1811
+ verified: "verified";
1811
1812
  created: "created";
1812
1813
  styledCharacter: "styledCharacter";
1813
1814
  joined: "joined";
@@ -1825,7 +1826,6 @@ declare const streamVerbSchema: z.ZodEnum<{
1825
1826
  published: "published";
1826
1827
  rsvped: "rsvped";
1827
1828
  commented: "commented";
1828
- verified: "verified";
1829
1829
  received: "received";
1830
1830
  supported: "supported";
1831
1831
  endorsed: "endorsed";
@@ -2807,7 +2807,12 @@ declare const ALL_SECTIONS: readonly [{
2807
2807
  }];
2808
2808
  /** Every profile section id, in canonical render order. */
2809
2809
  type SectionId = (typeof ALL_SECTIONS)[number]['id'];
2810
- /** Whether a section has content for a given profile (used to hide empty nav entries for visitors). */
2810
+ /**
2811
+ * Whether a section has content a visitor can see (used to hide empty nav
2812
+ * entries and sections for visitors). Items the owner hid do not count: a
2813
+ * section whose only entries are hidden renders nothing for a visitor, so it
2814
+ * must not get a nav entry either.
2815
+ */
2811
2816
  declare function isSectionPopulated(profile: Profile, id: string): boolean;
2812
2817
  /**
2813
2818
  * The section ids a given viewer should see, in {@link ALL_SECTIONS} order.
package/dist/index.js CHANGED
@@ -1089,6 +1089,12 @@ function normalizeSkillCategory(value) {
1089
1089
  return token === "" ? void 0 : token;
1090
1090
  }
1091
1091
 
1092
+ // src/format/compare-text.ts
1093
+ var COLLATOR = new Intl.Collator("en");
1094
+ function compareText(a, b) {
1095
+ return COLLATOR.compare(a, b);
1096
+ }
1097
+
1092
1098
  // src/taxonomy/skill-grouping.ts
1093
1099
  function dedupeSkills(skills) {
1094
1100
  const groups = /* @__PURE__ */ new Map();
@@ -1133,7 +1139,7 @@ function groupSkillsByCategory(skills) {
1133
1139
  groupSkills.sort((a, b) => {
1134
1140
  const countDiff = (b.endorsementCount ?? 0) - (a.endorsementCount ?? 0);
1135
1141
  if (countDiff !== 0) return countDiff;
1136
- return a.name.localeCompare(b.name);
1142
+ return compareText(a.name, b.name);
1137
1143
  });
1138
1144
  }
1139
1145
  const ordered = [];
@@ -1159,10 +1165,10 @@ function groupSkillsBySubCategory(skills) {
1159
1165
  const sortByRank = (groupSkills) => [...groupSkills].sort((a, b) => {
1160
1166
  const countDiff = (b.endorsementCount ?? 0) - (a.endorsementCount ?? 0);
1161
1167
  if (countDiff !== 0) return countDiff;
1162
- return a.name.localeCompare(b.name);
1168
+ return compareText(a.name, b.name);
1163
1169
  });
1164
1170
  const ordered = [];
1165
- for (const key of [...labels.keys()].sort((a, b) => a.localeCompare(b))) {
1171
+ for (const key of [...labels.keys()].sort(compareText)) {
1166
1172
  const label = labels.get(key);
1167
1173
  const group = grouped.get(key);
1168
1174
  if (label && group?.length) ordered.push([label, sortByRank(group)]);
@@ -3284,35 +3290,36 @@ var ALL_SECTIONS = [
3284
3290
  }
3285
3291
  ];
3286
3292
  function isSectionPopulated(profile, id) {
3293
+ const hasVisible = (items) => filterHidden(items).length > 0;
3287
3294
  switch (id) {
3288
3295
  case "about":
3289
3296
  return Boolean(profile.about && profile.headline);
3290
3297
  case "career":
3291
- return Boolean(profile.positions?.length);
3298
+ return hasVisible(profile.positions);
3292
3299
  case "education":
3293
- return Boolean(profile.education?.length);
3300
+ return hasVisible(profile.education);
3294
3301
  case "courses":
3295
- return Boolean(profile.courses?.length);
3302
+ return hasVisible(profile.courses);
3296
3303
  case "skills":
3297
3304
  return Boolean(profile.skills?.length);
3298
3305
  case "projects":
3299
- return Boolean(profile.projects?.length);
3306
+ return hasVisible(profile.projects);
3300
3307
  case "credentials":
3301
- return Boolean(profile.certifications?.length);
3308
+ return hasVisible(profile.certifications);
3302
3309
  case "publications":
3303
- return Boolean(profile.publications?.length);
3310
+ return hasVisible(profile.publications);
3304
3311
  case "presentations":
3305
- return Boolean(profile.presentations?.length) || Boolean(profile.presentationDeliveries?.length);
3312
+ return hasVisible(profile.presentations) || hasVisible(profile.presentationDeliveries);
3306
3313
  case "involvement":
3307
- return Boolean(profile.involvement?.length);
3314
+ return hasVisible(profile.involvement);
3308
3315
  case "investments":
3309
- return Boolean(profile.investments?.length);
3316
+ return hasVisible(profile.investments);
3310
3317
  case "awards":
3311
- return Boolean(profile.honors?.length);
3318
+ return hasVisible(profile.honors);
3312
3319
  case "languages":
3313
- return Boolean(profile.languages?.length);
3320
+ return hasVisible(profile.languages);
3314
3321
  case "other-profiles":
3315
- return Boolean(profile.externalAccounts?.length);
3322
+ return hasVisible(profile.externalAccounts);
3316
3323
  default:
3317
3324
  return false;
3318
3325
  }
@@ -5857,7 +5864,7 @@ function sortLanguagesByProficiency(items) {
5857
5864
  return [...items].sort((a, b) => {
5858
5865
  const diff = rank(b.proficiency) - rank(a.proficiency);
5859
5866
  if (diff !== 0) return diff;
5860
- return (a.language ?? "").localeCompare(b.language ?? "");
5867
+ return compareText(a.language ?? "", b.language ?? "");
5861
5868
  });
5862
5869
  }
5863
5870
 
@@ -6159,7 +6166,9 @@ function buildProfileHighlights(profile, { today }) {
6159
6166
  row2.push({
6160
6167
  section: "involvement",
6161
6168
  href: "#involvement",
6162
- title: involvement.role || involvement.kind || "Involvement",
6169
+ // No role: the kind's readable heading ("Volunteering"), never the raw
6170
+ // lexicon token (`id.sifa.defs#involvementCharity`).
6171
+ title: involvement.role || getInvolvementKindHeading(involvement.kind),
6163
6172
  meta: metaLine([
6164
6173
  involvement.entityName ?? involvement.upstream,
6165
6174
  coPeopleLabel(involvement.collaborators, self)
@@ -7035,7 +7044,7 @@ function describeSifaRecord(collection, value) {
7035
7044
  }
7036
7045
 
7037
7046
  // src/index.ts
7038
- var SIFA_SDK_VERSION = "0.19.39";
7047
+ var SIFA_SDK_VERSION = "0.19.41";
7039
7048
 
7040
7049
  export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ADULT_CONTENT_LABELS, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, ArtifactLinkSchema, AtmosphereFeedItemSchema, BlobRefSchema, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, COURSE_ROLE_LABELS, COURSE_ROLE_OPTIONS, COURSE_ROLE_TAKEN, COURSE_ROLE_TAUGHT, COURSE_ROLE_TEACHING_ASSISTANT, DIMENSIONS_MAX_SCORE, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EQF_LEVEL_LABELS, EQF_LEVEL_OPTIONS, EndorsementConfirmationRecordSchema, EndorsementRecordSchema, EntityImportSearchResponseSchema, EntityMintDomainResponseSchema, EntityResolveDomainRequestSchema, EntityResolveDomainResponseSchema, EntitySearchResponseSchema, EntitySearchResultSchema, EntitySelectRequestSchema, EntitySelectResponseSchema, FEATURE_FLAGS, FeatureAllowlistEntrySchema, FeedActorSchema, FollowFeedItemSchema, FollowFeedPageSchema, FollowProfilePageSchema, FollowProfileSchema, GraphFollowRecordSchema, INDUSTRY_LABELS, INDUSTRY_OPTIONS, INVESTMENT_ROLE_LABELS, INVESTMENT_ROLE_OPTIONS, INVESTMENT_STAGE_LABELS, INVESTMENT_STAGE_OPTIONS, INVESTMENT_STATUS_LABELS, INVESTMENT_STATUS_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, InvestmentAmountSchema, MIN_SKILLS, ON_BEHALF_OF_EMPLOYMENT_TYPES, OPEN_TO_GROUP_LABELS, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_LABELS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, OrgEmploymentAttestationRecordSchema, OrgProfileRecordSchema, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PROFILE_INVESTMENT_NSID, PROFILE_INVOLVEMENT_NSID, PROJECT_ROLES, PUBLICATION_TYPE_LABELS, PUBLICATION_TYPE_OPTIONS, PUBLISHERS, PresentationDurationSchema, PresentationLinkSchema, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileInvestmentRecordSchema, ProfileInvolvementRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, ProfilePresentationDeliveryRecordSchema, ProfilePresentationRecordSchema, ProfileProjectRecordSchema, ProfilePublicationRecordSchema, ProfileSelfRecordSchema, ProfileSkillRecordSchema, ProfileVolunteeringRecordSchema, PublicationAuthorSchema, ROADMAP_ISSUES_REPO, ROADMAP_ITEM_META, RelatedIdentifierSchema, SEARCH_FILTER_DEFS, SECTION_GROUPS, SECTION_LABELS, SELF_APP_ID, SIFA_REPO_GROUPS, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, SifaFeedItemSchema, VERIFICATION_PROVIDERS, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, actorShowsIdentity, agentRefSchema, atUriSchema, buildMetaDescription, buildProfileHighlights, buildTalkSlug, categoryForApp, certDateExtractor, cidSchema, classifyEntityRef, collapseContributors, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countRecentActivity, countryCodeToFlag, dateRangeExtractor, datetimeSchema, decodeFeedCursor, dedupeSkills, describeSifaRecord, detectPdsProvider, didSchema, dimensionsFromInputs, durationFromMinutes, encodeFeedCursor, entityDisambiguationLabel, entityResultKey, excludeSelfApp, externalRecordRefSchema, filterHidden, findIndustry, formatCompanyName, formatDateRange, formatDisplayUrl, formatDistanceToNow, formatEventDate, formatIsoTitle, formatLocation, formatPresentationDuration, formatRelationship, formatRelativeTime, formatSingleDate, formatSpanDate, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getActivityVerbsVersion, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getCourseRoleLabel, getDisplayLabel, getEmploymentTypeLabel, getEqfLevelLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabel, getIndustryLabelKey, getInvestmentRoleLabel, getInvestmentStageLabel, getInvestmentStatusLabel, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublicationTypeLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupPublicationVersions, groupSkillsByCategory, groupSkillsBySubCategory, groupSkillsForDisplay, hasAdultContent, hasPersonalProfileContent, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isOnBehalfOfApplicable, isPseudoEmployer, isRegistrableDomainHandle, isRelationalActivity, isRoleLineRedundant, isSectionPopulated, isSelfAuthoredRich, isTeachingCourse, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, locationSegments, looksLikeDomain, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, normalizeCompanyKey, normalizeDoi, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeSkillCategory, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseEndorsementComment, parseIntendedAudiences, parseLocationString, parsePresentationDuration, parseTalkRkey, partialDateSchema, pdsProviderFromApi, pickPrimaryFlagged, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, readEqfLevel, relativeLuminance, renderAsLine, rendersCompanyProfile, rendersPersonalProfile, repoGroupForCollection, resolveAccountFacetMode, resolveAgentRef, resolveCardHealth, resolveCardUrl, resolveEmbed, resolveVerifierProvider, rgbToString, roadmapIssueUrl, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, selfLabelsSchema, shouldRenderHighlights, singleDateExtractor, skillRefSchema, slugifyTitle, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, splitCoursesByRole, streamAddressSchema, streamAuthorSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, strongRefSchema, suggestEqfLevelFromDegree, summarizePresentationDeliveries, summarizeProfileView, toStreamCardVM, toStreamCardVMs, truncateGraphemes, uriSchema, verbForCollection, visibleItems, youtubeThumbnailUrl, youtubeVideoId };
7041
7050
  //# sourceMappingURL=index.js.map