Skip to content

Commit 69b15bb

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/payload-fallback
2 parents 92abf69 + 3880138 commit 69b15bb

File tree

135 files changed

+4313
-1601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+4313
-1601
lines changed

.github/workflows/autofix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
- name: 📦 Install dependencies
3333
run: pnpm install
3434

35-
- name: 🎨 Check for non-RTL CSS classes
36-
run: pnpm rtl:check
35+
- name: 🎨 Check for non-RTL/non-a11y CSS classes
36+
run: pnpm lint:css
3737

3838
- name: 🌐 Compare translations
3939
run: pnpm i18n:check

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
run: pnpm install
8585

8686
- name: 🧪 Unit tests
87-
run: pnpm test:unit run --coverage --reporter=junit --outputFile=test-report.junit.xml
87+
run: pnpm test:unit run --coverage --reporter=default --reporter=junit --outputFile=test-report.junit.xml
8888

8989
- name: ⬆︎ Upload test results to Codecov
9090
if: ${{ !cancelled() }}
@@ -115,7 +115,7 @@ jobs:
115115
run: pnpm playwright install chromium-headless-shell
116116

117117
- name: 🧪 Component tests
118-
run: pnpm test:nuxt run --coverage --reporter=junit --outputFile=test-report.junit.xml
118+
run: pnpm test:nuxt run --coverage --reporter=default --reporter=junit --outputFile=test-report.junit.xml
119119

120120
- name: ⬆︎ Upload coverage reports to Codecov
121121
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5

app/assets/main.css

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,32 @@
171171
}
172172
}
173173

174+
/*
175+
* Forced Colors Mode (WHCM) Override for Icons
176+
*
177+
* By default, `forced-color-adjust: preserve-parent-color` (from UnoConfig) works fine
178+
* for most icons as they inherit the correct text color.
179+
*
180+
* However, if icons disappear in specific contexts (e.g., inside buttons with
181+
* complex backgrounds or transparent states), uncomment the following block
182+
* to enforce visibility using `CanvasText`.
183+
*/
184+
/*
185+
@media (forced-colors: active) {
186+
[class^='i-'],
187+
[class*=' i-'] {
188+
forced-color-adjust: none !important;
189+
color: CanvasText !important;
190+
}
191+
}
192+
*/
193+
174194
html {
195+
@apply scroll-pt-20;
175196
-webkit-font-smoothing: antialiased;
176197
-moz-osx-font-smoothing: grayscale;
177198
text-rendering: optimizeLegibility;
178199
/* Offset for fixed header - otherwise anchor headers are cutted */
179-
scroll-padding-top: 5rem;
180200
scrollbar-gutter: stable;
181201
}
182202

@@ -216,11 +236,6 @@ dd {
216236
margin: 0;
217237
}
218238

219-
/* Reset button styles */
220-
button {
221-
cursor: pointer;
222-
}
223-
224239
/* Selection */
225240
::selection {
226241
background-color: var(--fg-muted);

app/components/AppFooter.vue

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<script setup lang="ts">
22
const route = useRoute()
33
const isHome = computed(() => route.name === 'index')
4+
5+
const modalRef = useTemplateRef('modalRef')
6+
const showModal = () => modalRef.value?.showModal?.()
47
</script>
58

69
<template>
@@ -33,6 +36,73 @@ const isHome = computed(() => route.name === 'index')
3336
<LinkBase to="https://chat.npmx.dev">
3437
{{ $t('footer.chat') }}
3538
</LinkBase>
39+
40+
<button
41+
type="button"
42+
class="group inline-flex gap-x-1 items-center justify-center underline-offset-[0.2rem] underline decoration-1 decoration-fg/30 font-mono text-fg hover:(decoration-accent text-accent) focus-visible:(decoration-accent text-accent) transition-colors duration-200"
43+
@click.prevent="showModal"
44+
aria-haspopup="dialog"
45+
>
46+
{{ $t('footer.keyboard_shortcuts') }}
47+
</button>
48+
49+
<Modal
50+
ref="modalRef"
51+
:modalTitle="$t('footer.keyboard_shortcuts')"
52+
class="w-auto max-w-lg"
53+
>
54+
<p class="mb-2 font-mono text-fg-subtle">
55+
{{ $t('shortcuts.section.global') }}
56+
</p>
57+
<ul class="mb-6 flex flex-col gap-2">
58+
<li class="flex gap-2 items-center">
59+
<kbd class="kbd">/</kbd>
60+
<span>{{ $t('shortcuts.focus_search') }}</span>
61+
</li>
62+
<li class="flex gap-2 items-center">
63+
<kbd class="kbd">?</kbd>
64+
<span>{{ $t('shortcuts.show_kbd_hints') }}</span>
65+
</li>
66+
<li class="flex gap-2 items-center">
67+
<kbd class="kbd">,</kbd>
68+
<span>{{ $t('shortcuts.settings') }}</span>
69+
</li>
70+
<li class="flex gap-2 items-center">
71+
<kbd class="kbd">c</kbd>
72+
<span>{{ $t('shortcuts.compare') }}</span>
73+
</li>
74+
</ul>
75+
<p class="mb-2 font-mono text-fg-subtle">
76+
{{ $t('shortcuts.section.search') }}
77+
</p>
78+
<ul class="mb-6 flex flex-col gap-2">
79+
<li class="flex gap-2 items-center">
80+
<kbd class="kbd">↑</kbd>/<kbd class="kbd">↓</kbd>
81+
<span>{{ $t('shortcuts.navigate_results') }}</span>
82+
</li>
83+
<li class="flex gap-2 items-center">
84+
<kbd class="kbd">Enter</kbd>
85+
<span>{{ $t('shortcuts.go_to_result') }}</span>
86+
</li>
87+
</ul>
88+
<p class="mb-2 font-mono text-fg-subtle">
89+
{{ $t('shortcuts.section.package') }}
90+
</p>
91+
<ul class="mb-6 flex flex-col gap-2">
92+
<li class="flex gap-2 items-center">
93+
<kbd class="kbd">.</kbd>
94+
<span>{{ $t('shortcuts.open_code_view') }}</span>
95+
</li>
96+
<li class="flex gap-2 items-center">
97+
<kbd class="kbd">d</kbd>
98+
<span>{{ $t('shortcuts.open_docs') }}</span>
99+
</li>
100+
<li class="flex gap-2 items-center">
101+
<kbd class="kbd">c</kbd>
102+
<span>{{ $t('shortcuts.compare_from_package') }}</span>
103+
</li>
104+
</ul>
105+
</Modal>
36106
</div>
37107
</div>
38108
<p class="text-xs text-fg-muted text-center sm:text-start m-0">
@@ -42,3 +112,9 @@ const isHome = computed(() => route.name === 'index')
42112
</div>
43113
</footer>
44114
</template>
115+
116+
<style scoped>
117+
.kbd {
118+
@apply items-center justify-center text-sm text-fg bg-bg-muted border border-border rounded px-2;
119+
}
120+
</style>

app/components/AppHeader.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,12 @@ onKeyStroke(
122122

123123
<!-- Center: Search bar + nav items -->
124124
<div
125-
class="flex-1 flex items-center justify-center md:gap-6"
126-
:class="{ 'hidden sm:flex': !isSearchExpanded }"
125+
class="flex-1 flex items-center md:gap-6"
126+
:class="{
127+
'hidden sm:flex': !isSearchExpanded,
128+
'justify-end': isOnHomePage,
129+
'justify-center': !isOnHomePage,
130+
}"
127131
>
128132
<!-- Search bar (hidden on mobile unless expanded) -->
129133
<HeaderSearchBox

app/components/CollapsibleSection.vue

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { shallowRef, computed } from 'vue'
3+
import { LinkBase } from '#components'
34
45
interface Props {
56
title: string
@@ -18,7 +19,6 @@ const appSettings = useSettings()
1819
1920
const buttonId = `${props.id}-collapsible-button`
2021
const contentId = `${props.id}-collapsible-content`
21-
const headingId = `${props.id}-heading`
2222
2323
const isOpen = shallowRef(true)
2424
@@ -75,11 +75,10 @@ useHead({
7575
</script>
7676

7777
<template>
78-
<section class="scroll-mt-20" :data-anchor-id="id">
78+
<section :id="id" :data-anchor-id="id" class="scroll-mt-20 xl:scroll-mt-0">
7979
<div class="flex items-center justify-between mb-3 px-1">
8080
<component
8181
:is="headingLevel"
82-
:id="headingId"
8382
class="group text-xs text-fg-subtle uppercase tracking-wider flex items-center gap-2"
8483
>
8584
<button
@@ -104,17 +103,9 @@ useHead({
104103
/>
105104
</button>
106105

107-
<a
108-
:href="`#${id}`"
109-
class="inline-flex items-center gap-1.5 text-fg-subtle hover:text-fg-muted transition-colors duration-200 no-underline"
110-
>
111-
<span v-if="icon" :class="icon" aria-hidden="true" />
106+
<LinkBase :to="`#${id}`" class="">
112107
{{ title }}
113-
<span
114-
class="i-carbon:link w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity duration-200"
115-
aria-hidden="true"
116-
/>
117-
</a>
108+
</LinkBase>
118109
</component>
119110

120111
<!-- Actions slot for buttons or other elements -->

app/components/ColumnPicker.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,7 @@ function handleReset() {
102102
v-for="column in toggleableColumns"
103103
:key="column.id"
104104
class="flex gap-2 items-center px-3 py-2 transition-colors duration-200"
105-
:class="
106-
column.disabled
107-
? 'opacity-50 cursor-not-allowed'
108-
: 'hover:bg-bg-muted cursor-pointer'
109-
"
105+
:class="column.disabled ? 'opacity-50 cursor-not-allowed' : 'hover:bg-bg-muted'"
110106
>
111107
<input
112108
type="checkbox"

app/components/Compare/PackageSelector.vue

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,18 @@ function removePackage(name: string) {
7777
}
7878
7979
function handleKeydown(e: KeyboardEvent) {
80-
if (e.key === 'Enter' && inputValue.value.trim()) {
80+
const inputValueTrim = inputValue.value.trim()
81+
const hasMatchInPackages = filteredResults.value.find(result => {
82+
return result.name === inputValueTrim
83+
})
84+
85+
if (e.key === 'Enter' && inputValueTrim) {
8186
e.preventDefault()
82-
addPackage(inputValue.value.trim())
87+
if (showNoDependencyOption.value) {
88+
addPackage(NO_DEPENDENCY_ID)
89+
} else if (hasMatchInPackages) {
90+
addPackage(inputValueTrim)
91+
}
8392
}
8493
}
8594
@@ -130,17 +139,16 @@ function handleBlur() {
130139

131140
<!-- Add package input -->
132141
<div v-if="packages.length < maxPackages" class="relative">
133-
<div class="relative group">
142+
<div class="relative group flex items-center">
134143
<label for="package-search" class="sr-only">
135144
{{ $t('compare.selector.search_label') }}
136145
</label>
137146
<span
138-
class="absolute inset-y-0 start-3 flex items-center text-fg-subtle pointer-events-none group-focus-within:text-accent"
139-
aria-hidden="true"
147+
class="absolute inset-is-3 text-fg-subtle font-mono text-md pointer-events-none transition-colors duration-200 motion-reduce:transition-none [.group:hover:not(:focus-within)_&]:text-fg/80 group-focus-within:text-accent z-1"
140148
>
141-
<span class="i-carbon:search w-4 h-4" />
149+
/
142150
</span>
143-
<input
151+
<InputBase
144152
id="package-search"
145153
v-model="inputValue"
146154
type="text"
@@ -149,7 +157,9 @@ function handleBlur() {
149157
? $t('compare.selector.search_first')
150158
: $t('compare.selector.search_add')
151159
"
152-
class="w-full bg-bg-subtle border border-border rounded-lg ps-10 pe-4 py-2.5 font-mono text-sm text-fg placeholder:text-fg-subtle motion-reduce:transition-none duration-200 focus:border-accent focus-visible:(outline-2 outline-accent/70)"
160+
no-correct
161+
size="medium"
162+
class="w-full min-w-25 ps-7"
153163
aria-autocomplete="list"
154164
@focus="isInputFocused = true"
155165
@blur="handleBlur"

app/components/Compare/ReplacementSuggestion.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ const emit = defineEmits<{
1616
1717
const docUrl = computed(() => {
1818
if (props.replacement.type !== 'documented' || !props.replacement.docPath) return null
19-
// TODO(serhalp): Once the e18e docs site is complete, link there instead
20-
return `https://github.com/es-tooling/module-replacements/blob/main/docs/modules/${props.replacement.docPath}.md`
19+
return `https://e18e.dev/docs/replacements/${props.replacement.docPath}.html`
2120
})
2221
</script>
2322

app/components/DependencyPathPopup.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function parsePackageString(pkg: string): { name: string; version: string } {
6868
<!-- Path badge button -->
6969
<button
7070
type="button"
71-
class="path-badge font-mono text-3xs px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400 cursor-pointer transition-all duration-200 ease-out whitespace-nowrap flex items-center gap-1 hover:bg-amber-500/20 hover:border-amber-500/50"
71+
class="path-badge font-mono text-3xs px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400 transition-all duration-200 ease-out whitespace-nowrap flex items-center gap-1 hover:bg-amber-500/20 hover:border-amber-500/50"
7272
:aria-expanded="isOpen"
7373
@click.stop="togglePopup"
7474
>

0 commit comments

Comments
 (0)