Skip to content

Commit ef187b0

Browse files
committed
Merge branch 'main' into userquin/feat-add-contributors-popup-card
# Conflicts: # app/components/Link/Base.vue
2 parents 201d4f1 + 975bb0a commit ef187b0

File tree

30 files changed

+2483
-149
lines changed

30 files changed

+2483
-149
lines changed

app/components/Compare/PackageSelector.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function handleFocus() {
307307
v-if="result.description"
308308
class="text-xs text-fg-muted truncate mt-0.5 w-full block"
309309
>
310-
{{ result.description }}
310+
{{ decodeHtmlEntities(result.description) }}
311311
</span>
312312
</ButtonBase>
313313
</div>

app/components/Header/SearchBox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const showSearchBar = computed(() => {
1616
return route.name !== 'index'
1717
})
1818
19-
const { model: searchQuery, flushUpdateUrlQuery } = useGlobalSearch()
19+
const { model: searchQuery, flushUpdateUrlQuery } = useGlobalSearch('header')
2020
2121
function handleSubmit() {
2222
flushUpdateUrlQuery()

app/components/Link/Base.vue

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,46 @@ import type { NuxtLinkProps } from '#app'
33
import type { IconClass } from '~/types'
44
55
const props = withDefaults(
6-
defineProps<
7-
{
8-
/** Disabled links will be displayed as plain text */
9-
disabled?: boolean
10-
/**
11-
* `type` should never be used, because this will always be a link.
12-
* */
13-
type?: never
14-
variant?: 'button-primary' | 'button-secondary' | 'link'
15-
size?: 'small' | 'medium'
16-
block?: boolean
6+
defineProps<{
7+
/** Disabled links will be displayed as plain text */
8+
disabled?: boolean
9+
/**
10+
* `type` should never be used, because this will always be a link.
11+
* */
12+
type?: never
13+
variant?: 'button-primary' | 'button-secondary' | 'link'
14+
size?: 'small' | 'medium'
15+
block?: boolean
1716
18-
ariaKeyshortcuts?: string
17+
ariaKeyshortcuts?: string
1918
20-
/**
21-
* Don't use this directly. This will automatically be set to `_blank` for external links passed via `to`.
22-
*/
23-
target?: never
19+
/**
20+
* Don't use this directly. This will automatically be set to `_blank` for external links passed via `to`.
21+
*/
22+
target?: never
2423
25-
/**
26-
* Don't use this directly. This will automatically be set for external links passed via `to`.
27-
*/
28-
rel?: never
24+
/**
25+
* Don't use this directly. This will automatically be set for external links passed via `to`.
26+
*/
27+
rel?: never
2928
30-
classicon?: IconClass
29+
classicon?: IconClass
3130
32-
to?: NuxtLinkProps['to']
31+
to?: NuxtLinkProps['to']
3332
34-
/** always use `to` instead of `href` */
35-
href?: never
33+
/** always use `to` instead of `href` */
34+
href?: never
3635
37-
/** should only be used for links where the context makes it very clear they are clickable. Don't just use this, because you don't like underlines. */
38-
noUnderline?: boolean
36+
/** should only be used for links where the context makes it very clear they are clickable. Don't just use this, because you don't like underlines. */
37+
noUnderline?: boolean
3938
40-
/**
41-
* should external link icon be displayed?.
42-
*
43-
* @default false
44-
*/
45-
noExternalIcon?: boolean
46-
} & NuxtLinkProps
47-
>(),
39+
/**
40+
* should external link icon be displayed?.
41+
*
42+
* @default false
43+
*/
44+
noExternalIcon?: boolean
45+
}>(),
4846
{ variant: 'link', size: 'medium', noUnderline: false, noExternalIcon: false },
4947
)
5048

app/components/Package/TableRow.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const allMaintainersText = computed(() => {
4444

4545
<template>
4646
<tr
47-
class="group relative border-b border-border hover:bg-bg-muted transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-inset focus-visible:outline-none focus:bg-bg-muted"
47+
class="group relative transform scale-100 border-b border-border hover:bg-bg-muted transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-fg focus-visible:ring-inset focus-visible:outline-none focus:bg-bg-muted"
4848
tabindex="0"
4949
:data-result-index="index"
5050
>
@@ -69,7 +69,7 @@ const allMaintainersText = computed(() => {
6969
v-if="isColumnVisible('description')"
7070
class="py-2 px-3 text-sm text-fg-muted max-w-xs truncate"
7171
>
72-
{{ pkg.description || '-' }}
72+
{{ decodeHtmlEntities(pkg.description || '-') }}
7373
</td>
7474

7575
<!-- Downloads -->

app/components/Package/Versions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ function majorGroupContainsCurrent(group: (typeof otherMajorGroups.value)[0]): b
486486
<div class="space-y-0.5 min-w-0">
487487
<!-- Semver range filter -->
488488
<div class="px-1 pb-1">
489-
<div class="flex items-center gap-1.5">
489+
<div class="flex items-center gap-1.5 py-1">
490490
<InputBase
491491
v-model="semverFilter"
492492
type="text"

app/components/Package/WeeklyDownloadStats.vue

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const props = defineProps<{
1313
1414
const router = useRouter()
1515
const route = useRoute()
16+
const { settings } = useSettings()
1617
1718
const chartModal = useModal('chart-modal')
1819
const hasChartModalTransitioned = shallowRef(false)
@@ -87,6 +88,12 @@ const { colors } = useCssVariables(
8788
},
8889
)
8990
91+
function toggleSparklineAnimation() {
92+
settings.value.sidebar.animateSparkline = !settings.value.sidebar.animateSparkline
93+
}
94+
95+
const hasSparklineAnimation = computed(() => settings.value.sidebar.animateSparkline)
96+
9097
const isDarkMode = computed(() => resolvedMode.value === 'dark')
9198
9299
const accentColorValueById = computed<Record<string, string>>(() => {
@@ -224,7 +231,7 @@ const config = computed(() => {
224231
line: {
225232
color: colors.value.borderHover,
226233
pulse: {
227-
show: true, // the pulse will not show if prefers-reduced-motion (enforced by vue-data-ui)
234+
show: hasSparklineAnimation.value, // the pulse will not show if prefers-reduced-motion (enforced by vue-data-ui)
228235
loop: true, // runs only once if false
229236
radius: 1.5,
230237
color: pulseColor.value,
@@ -302,6 +309,16 @@ const config = computed(() => {
302309
</div>
303310
</template>
304311
</ClientOnly>
312+
313+
<div v-if="hasWeeklyDownloads" class="hidden motion-safe:flex justify-end p-1">
314+
<ButtonBase size="small" @click="toggleSparklineAnimation">
315+
{{
316+
hasSparklineAnimation
317+
? $t('package.trends.pause_animation')
318+
: $t('package.trends.play_animation')
319+
}}
320+
</ButtonBase>
321+
</div>
305322
</template>
306323
<p v-else class="py-2 text-sm font-mono text-fg-subtle">
307324
{{ $t('package.trends.no_data') }}

app/composables/useGlobalSearch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { debounce } from 'perfect-debounce'
44
// Pages that have their own local filter using ?q
55
const pagesWithLocalFilter = new Set(['~username', 'org'])
66

7-
export function useGlobalSearch() {
7+
export function useGlobalSearch(place: 'header' | 'content' = 'content') {
88
const { searchProvider } = useSearchProvider()
99
const searchProviderValue = computed(() => {
1010
const p = normalizeSearchParam(route.query.p)
@@ -32,7 +32,7 @@ export function useGlobalSearch() {
3232
const updateUrlQueryImpl = (value: string, provider: 'npm' | 'algolia') => {
3333
const isSameQuery = route.query.q === value && route.query.p === provider
3434
// Don't navigate away from pages that use ?q for local filtering
35-
if (pagesWithLocalFilter.has(route.name as string) || isSameQuery) {
35+
if ((pagesWithLocalFilter.has(route.name as string) && place === 'content') || isSameQuery) {
3636
return
3737
}
3838

app/composables/useSettings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export interface AppSettings {
3636
}
3737
sidebar: {
3838
collapsed: string[]
39+
animateSparkline: boolean
3940
}
4041
}
4142

@@ -52,6 +53,7 @@ const DEFAULT_SETTINGS: AppSettings = {
5253
},
5354
sidebar: {
5455
collapsed: [],
56+
animateSparkline: true,
5557
},
5658
}
5759

app/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ defineOgImageComponent('Default', {
109109

110110
<nav
111111
:aria-label="$t('nav.popular_packages')"
112-
class="pt-4 pb-36 sm:pb-40 text-center motion-safe:animate-fade-in motion-safe:animate-fill-both"
112+
class="pt-4 pb-36 sm:pb-40 text-center motion-safe:animate-fade-in motion-safe:animate-fill-both max-w-xl mx-auto"
113113
style="animation-delay: 0.3s"
114114
>
115115
<ul class="flex flex-wrap items-center justify-center gap-x-6 gap-y-3 list-none m-0 p-0">

app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ definePageMeta({
1313
'/package/code/:packageName/v/:version/:filePath(.*)?',
1414
// '/code/@:org?/:packageName/v/:version/:filePath(.*)?',
1515
],
16+
scrollMargin: 160,
1617
})
1718
1819
const route = useRoute('code')

0 commit comments

Comments
 (0)