@@ -243,6 +243,22 @@ const expandedTags = ref<Set<string>>(new Set())
243243const tagVersions = ref <Map <string , VersionDisplay []>>(new Map ())
244244const loadingTags = ref <Set <string >>(new Set ())
245245
246+ const showHiddenPrereleaseTags = ref (false )
247+
248+ const stableVisibleTagRows = computed (() =>
249+ visibleTagRows .value .filter (row => ! isPrereleaseVersion (row .primaryVersion .version )),
250+ )
251+
252+ const hiddenPrereleaseTagRows = computed (() =>
253+ visibleTagRows .value .filter (row => isPrereleaseVersion (row .primaryVersion .version )),
254+ )
255+
256+ const hiddenPrereleaseTagCount = computed (() => hiddenPrereleaseTagRows .value .length )
257+
258+ const displayedTagRows = computed (() =>
259+ hiddenPrereleaseTagCount .value === 0 ? visibleTagRows .value : stableVisibleTagRows .value ,
260+ )
261+
246262const otherVersionsExpanded = shallowRef (false )
247263const expandedMajorGroups = ref <Set <string >>(new Set ())
248264const otherMajorGroups = shallowRef <
@@ -611,7 +627,7 @@ function majorGroupContainsCurrent(group: (typeof otherMajorGroups.value)[0]): b
611627 </div >
612628
613629 <!-- Dist-tag rows (limited to MAX_VISIBLE_TAGS) -->
614- <div v-for =" row in visibleTagRows " :key =" row.id" >
630+ <div v-for =" row in displayedTagRows " :key =" row.id" >
615631 <div
616632 class =" flex items-center gap-2 pe-2 px-1 relative group/version-row hover:bg-bg-subtle focus-within:bg-bg-subtle transition-colors duration-200 rounded-lg"
617633 :class =" rowContainsCurrentVersion(row) ? 'bg-bg-subtle' : ''"
@@ -779,6 +795,96 @@ function majorGroupContainsCurrent(group: (typeof otherMajorGroups.value)[0]): b
779795 </div >
780796 </div >
781797
798+ <!-- Hidden pre-release tags expand -->
799+ <div v-if =" hiddenPrereleaseTagCount > 0" class =" p-1" >
800+ <button
801+ type =" button"
802+ class =" group/version-row flex items-center gap-2 text-start rounded-sm w-full"
803+ :aria-expanded =" showHiddenPrereleaseTags"
804+ @click =" showHiddenPrereleaseTags = !showHiddenPrereleaseTags"
805+ >
806+ <span
807+ class =" size-5 -me-1 flex items-center justify-center text-fg-subtle hover:text-fg transition-colors"
808+ >
809+ <span
810+ class =" w-3 h-3 transition-transform duration-200 rtl-flip"
811+ :class =" showHiddenPrereleaseTags ? 'i-lucide:chevron-down' : 'i-lucide:chevron-right'"
812+ aria-hidden =" true"
813+ />
814+ </span >
815+ <span
816+ class =" text-xs text-fg-muted py-1.5 group-hover/version-row:text-fg transition-colors"
817+ >
818+ {{ $t('package.versions.tags_hidden', hiddenPrereleaseTagCount) }}
819+ </span >
820+ </button >
821+
822+ <div v-if =" showHiddenPrereleaseTags" class =" ms-4 ps-2 border-is border-border space-y-0.5" >
823+ <div
824+ v-for =" row in hiddenPrereleaseTagRows"
825+ :key =" row.id"
826+ class =" py-1 relative group/version-row hover:bg-bg-subtle focus-within:bg-bg-subtle transition-colors duration-200 rounded-lg"
827+ :class =" rowContainsCurrentVersion(row) ? 'bg-bg-subtle' : ''"
828+ >
829+ <div class =" flex items-center justify-between gap-2" >
830+ <LinkBase
831+ :to =" versionRoute(row.primaryVersion.version)"
832+ block
833+ class =" text-xs after:absolute after:inset-0 after:content-['']"
834+ :class ="
835+ row.primaryVersion.deprecated
836+ ? 'text-red-800 group-hover/version-row:text-red-700 dark:text-red-400 dark:group-hover/version-row:text-red-300'
837+ : undefined
838+ "
839+ :title ="
840+ row.primaryVersion.deprecated
841+ ? $t('package.versions.deprecated_title', {
842+ version: row.primaryVersion.version,
843+ })
844+ : row.primaryVersion.version
845+ "
846+ :classicon =" row.primaryVersion.deprecated ? 'i-lucide:octagon-alert' : undefined"
847+ >
848+ <span dir =" ltr" class =" block truncate" >
849+ {{ row.primaryVersion.version }}
850+ </span >
851+ </LinkBase >
852+ <div class =" flex items-center gap-2 shrink-0 pe-2 relative z-10" >
853+ <DateTime
854+ v-if =" row.primaryVersion.time"
855+ :datetime =" row.primaryVersion.time"
856+ class =" text-3xs text-fg-subtle"
857+ year =" numeric"
858+ month =" short"
859+ day =" numeric"
860+ />
861+ <ProvenanceBadge
862+ v-if =" row.primaryVersion.hasProvenance"
863+ :package-name =" packageName"
864+ :version =" row.primaryVersion.version"
865+ compact
866+ :linked =" false"
867+ />
868+ </div >
869+ </div >
870+ <div
871+ v-if =" row.tags.length"
872+ class =" flex items-center gap-1 mt-0.5 flex-wrap relative z-10"
873+ >
874+ <span
875+ v-for =" tag in row.tags"
876+ :key =" tag"
877+ class =" text-5xs font-semibold uppercase tracking-wide truncate max-w-[120px]"
878+ :class =" tag === 'latest' ? 'text-accent' : 'text-fg-subtle'"
879+ :title =" tag"
880+ >
881+ {{ tag }}
882+ </span >
883+ </div >
884+ </div >
885+ </div >
886+ </div >
887+
782888 <!-- Other versions section -->
783889 <div class =" p-1" >
784890 <button
0 commit comments