@jelinek/ui 0.9.2 → 0.9.3
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.
|
@@ -232,6 +232,17 @@
|
|
|
232
232
|
menuOpen = false;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
// A tapped link in the drawer navigates away. In a SvelteKit app that is a
|
|
236
|
+
// client-side navigation: this component stays mounted and, without this,
|
|
237
|
+
// the drawer would stay open over the new page (the dismissal below ignores
|
|
238
|
+
// pointerdowns inside linksEl on purpose, so taps on the accordion work).
|
|
239
|
+
// One delegated listener covers items, chapters and `actions` links alike.
|
|
240
|
+
// A modifier click opens a new tab and leaves this page as it was.
|
|
241
|
+
function onDrawerClick(event: MouseEvent) {
|
|
242
|
+
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
243
|
+
if ((event.target as Element | null)?.closest('a[href]')) closeMenu();
|
|
244
|
+
}
|
|
245
|
+
|
|
235
246
|
// Dismissal, matching assets/js/jelinek.js's own initHeaderMenu().
|
|
236
247
|
// `pointerdown`, not `click`: iOS Safari does not propagate a click from an
|
|
237
248
|
// element that is not itself clickable up to `document`, so a tap on body
|
|
@@ -901,7 +912,9 @@
|
|
|
901
912
|
<!-- The phone drawer. A SIBLING of the glass bar, not a child — see
|
|
902
913
|
DRAWER's comment for the measurement that forced that. Hidden from
|
|
903
914
|
640px up, so only one of the two navs is ever in the a11y tree. -->
|
|
904
|
-
|
|
915
|
+
<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_noninteractive_element_interactions
|
|
916
|
+
(delegated: the clicks come from the links inside, which are keyboard-operable themselves) -->
|
|
917
|
+
<nav id={panelId} bind:this={linksEl} class={drawer} aria-label={navLabel} onclick={onDrawerClick}>
|
|
905
918
|
<div class={DRAWER_HEAD}>
|
|
906
919
|
<span class={DRAWER_LABEL}>Menu</span>
|
|
907
920
|
<button type="button" class={DRAWER_CLOSE} aria-label={menuLabelClose} onclick={closeMenu}>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jelinek/ui",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "JELÍNEK Svelte 5 component kit, generated from the brand guide",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
"tailwindcss": "^4.3.1",
|
|
81
81
|
"typescript": "^5.7.2",
|
|
82
82
|
"vite": "^6.0.7",
|
|
83
|
-
"vitest": "^
|
|
83
|
+
"vitest": "^4.1.11"
|
|
84
84
|
}
|
|
85
85
|
}
|