@@ -10,7 +10,7 @@ const props = defineProps<{
1010 latestVersion? : SlimVersion | null
1111 provenanceData? : ProvenanceDetails | null
1212 provenanceStatus? : string | null
13- page: ' main' | ' docs' | ' code' | ' diff'
13+ page: ' main' | ' docs' | ' code' | ' diff' | ' timeline '
1414 versionUrlPattern: string
1515}>()
1616
@@ -162,12 +162,26 @@ const diffLink = computed((): RouteLocationRaw | null => {
162162 return diffRoute (props .pkg .name , props .resolvedVersion , props .latestVersion .version )
163163})
164164
165+ const timelineLink = computed ((): RouteLocationRaw | null => {
166+ if (props .pkg == null || props .resolvedVersion == null ) return null
167+ const split = props .pkg .name .split (' /' )
168+ return {
169+ name: ' timeline' ,
170+ params: {
171+ org: split .length === 2 ? split [0 ] : undefined ,
172+ packageName: split .length === 2 ? split [1 ]! : split [0 ]! ,
173+ version: props .resolvedVersion ,
174+ },
175+ }
176+ })
177+
165178useShortcuts ({
166179 ' .' : () => codeLink .value ,
167180 ' m' : () => mainLink .value ,
168181 ' d' : () => docsLink .value ,
169182 ' c' : () => props .pkg && { name: ' compare' as const , query: { packages: props .pkg .name } },
170183 ' f' : () => diffLink .value ,
184+ ' t' : () => timelineLink .value ,
171185})
172186 </script >
173187
@@ -330,6 +344,15 @@ useShortcuts({
330344 >
331345 {{ $t('compare.compare_versions') }}
332346 </LinkBase >
347+ <LinkBase
348+ v-if =" timelineLink"
349+ :to =" timelineLink"
350+ aria-keyshortcuts =" t"
351+ class =" decoration-none border-b-2 p-1 hover:border-accent/50 focus-visible:[outline-offset:-2px]!"
352+ :class =" page === 'timeline' ? 'border-accent text-accent!' : 'border-transparent'"
353+ >
354+ {{ $t('package.links.timeline') }}
355+ </LinkBase >
333356 </nav >
334357 </div >
335358 </div >
0 commit comments