unfold-nav 0.1.0 → 1.0.0
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.
- package/CHANGELOG.md +19 -0
- package/README.md +9 -2
- package/dist/layout.d.cts +2 -2
- package/dist/layout.d.ts +2 -2
- package/dist/unfold-nav.js +368 -316
- package/dist/unfold-nav.js.map +1 -1
- package/dist/unfold-nav.umd.cjs +9 -8
- package/dist/unfold-nav.umd.cjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
The existing navigation, public options, events and styling API become the stable 1.x API.
|
|
6
|
+
|
|
7
|
+
- Reuse graph geometry and SVG paths during hover and keyboard focus changes; coalesce resize work and read animation timing once per batch.
|
|
8
|
+
- Refresh current-page markers immediately, honor document base URLs, and remeasure labels after resizing, font loading and reopening.
|
|
9
|
+
- Cancel interrupted animation timers and label animations; keep collapsing children out of keyboard and screen-reader navigation.
|
|
10
|
+
- Handle rapid clicks, repeated typeahead letters, held activation keys, input composition and event listeners that close or remove the menu while it opens.
|
|
11
|
+
- Keep user page IDs separate from internal hub and label bookkeeping, including IDs with separator characters.
|
|
12
|
+
- Fall back safely from failing icon callbacks, refresh visible icons when the resolver changes, and copy validated offset objects.
|
|
13
|
+
- Keep inline menus aligned when an ancestor scrolls and let page controls receive pointer input during the closing animation.
|
|
14
|
+
- Add regression coverage for these behaviors while retaining the exhaustive showcase and Circuit layout checks.
|
|
15
|
+
|
|
16
|
+
## 0.1.1
|
|
17
|
+
|
|
18
|
+
- Link the npm homepage and README to the [live showcase](https://unfold-nav.romagnolo.eu).
|
|
19
|
+
- Document container deployment and check the static showcase container in CI.
|
|
20
|
+
- Allow the exhaustive Circuit regression sweep to finish on slower CI runners.
|
|
21
|
+
|
|
3
22
|
## 0.1.0
|
|
4
23
|
|
|
5
24
|
Initial release of the dependency-free `<unfold-nav>` Web Component.
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# unfold-nav
|
|
2
2
|
|
|
3
|
+
**[Live demo](https://unfold-nav.romagnolo.eu)**
|
|
4
|
+
|
|
3
5
|
One button for your whole site map. Press and hold it, and your pages unfold around it as a small graph.
|
|
4
6
|
Drag along the graph and release on a page to go there. Or tap the button and tap your way through. The
|
|
5
7
|
same component works with a mouse, a finger or a keyboard, on desktop and on phones.
|
|
@@ -11,7 +13,8 @@ same component works with a mouse, a finger or a keyboard, on desktop and on pho
|
|
|
11
13
|
- **Customisable:** options, `--unfold-*` CSS variables, `::part()` selectors, a slot for the button icon, per-page colours, and a hook to plug in any icon library.
|
|
12
14
|
- **Accessibility features:** a modal dialog with a standard tree of pages for screen readers, full keyboard support, focus management, high-contrast and forced-colors support, text that follows the reader's font size, and reduced motion. See [Accessibility](#accessibility).
|
|
13
15
|
|
|
14
|
-
Version
|
|
16
|
+
Version 1.x keeps the public options, events and styling API stable. It is designed for compact site maps;
|
|
17
|
+
see [layout limits](#layout-limits) and test your real menu content.
|
|
15
18
|
|
|
16
19
|
## Quick start
|
|
17
20
|
|
|
@@ -352,6 +355,8 @@ Those two properties drive the unfold animation.
|
|
|
352
355
|
|
|
353
356
|
## Showcase: 9 industries × 9 designs
|
|
354
357
|
|
|
358
|
+
[Try the live demo](https://unfold-nav.romagnolo.eu).
|
|
359
|
+
|
|
355
360
|
`pnpm dev` opens a showcase with a desktop and a phone frame side by side, running the same mock website. Pick:
|
|
356
361
|
|
|
357
362
|
- **an industry:** restaurant, fashion, SaaS, healthcare, real estate, developer docs, creative agency, banking, travel. Each is a fictional brand with its own site map, typography and artwork.
|
|
@@ -368,6 +373,8 @@ pnpm build:showcase # static site in showcase-dist/ (relative paths, host i
|
|
|
368
373
|
pnpm preview:showcase # serve that build locally
|
|
369
374
|
```
|
|
370
375
|
|
|
376
|
+
For container hosting and the Romagnolo deployment workflow, see [Showcase deployment](https://github.com/NikoKaranatsios/unfold-nav/blob/main/deploy/README.md).
|
|
377
|
+
|
|
371
378
|
## How the layout works
|
|
372
379
|
|
|
373
380
|
All the geometry lives in `src/layout.ts` as pure functions.
|
|
@@ -403,7 +410,7 @@ pnpm build # dist/unfold-nav.js (ESM), dist/unfold-nav.umd.cjs, type defi
|
|
|
403
410
|
|
|
404
411
|
Browser target: modern evergreen browsers with Custom Elements, Shadow DOM, `<dialog>` and modern CSS (`color-mix`, individual transforms). Chrome has been checked interactively; test Safari, Firefox and assistive technology in your target environments before rollout. The Popover API puts drag navigation in the top layer; browsers without it use a non-modal dialog. IE and legacy browsers are not supported.
|
|
405
412
|
|
|
406
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for the development workflow and reproducible bug reports. GitHub Actions runs the checks and showcase build on Node 22 and 24.
|
|
413
|
+
See [CONTRIBUTING.md](https://github.com/NikoKaranatsios/unfold-nav/blob/main/CONTRIBUTING.md) for the development workflow and reproducible bug reports. GitHub Actions runs the checks and showcase build on Node 22 and 24, and smoke-tests the static showcase container.
|
|
407
414
|
|
|
408
415
|
A note on SEO: the graph only exists while it is open, so keep a plain list of links somewhere (a footer or a sitemap) for crawlers and no-JS visitors.
|
|
409
416
|
|
package/dist/layout.d.cts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Pure geometry: where nodes go, where their labels go, and how edges are drawn.
|
|
3
3
|
* Coordinates are viewport pixels (y grows downwards, angles are clockwise from +x).
|
|
4
4
|
*
|
|
5
|
-
* The
|
|
5
|
+
* The layout prefers clearance: every node reserves room for its label at
|
|
6
6
|
* the moment its fan is placed, a fan is only accepted when all of its nodes *and* labels fit clear of
|
|
7
7
|
* everything already on screen (nodes, labels, edges, the viewport edge), and later fans have to keep
|
|
8
8
|
* clear of what's reserved. When that's impossible (a tiny screen, a huge menu) labels that don't fit
|
|
9
|
-
* are left out
|
|
9
|
+
* are left out. Extreme density can also exhaust node clearance; see the documented layout limits.
|
|
10
10
|
*/
|
|
11
11
|
export interface Vec {
|
|
12
12
|
x: number;
|
package/dist/layout.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Pure geometry: where nodes go, where their labels go, and how edges are drawn.
|
|
3
3
|
* Coordinates are viewport pixels (y grows downwards, angles are clockwise from +x).
|
|
4
4
|
*
|
|
5
|
-
* The
|
|
5
|
+
* The layout prefers clearance: every node reserves room for its label at
|
|
6
6
|
* the moment its fan is placed, a fan is only accepted when all of its nodes *and* labels fit clear of
|
|
7
7
|
* everything already on screen (nodes, labels, edges, the viewport edge), and later fans have to keep
|
|
8
8
|
* clear of what's reserved. When that's impossible (a tiny screen, a huge menu) labels that don't fit
|
|
9
|
-
* are left out
|
|
9
|
+
* are left out. Extreme density can also exhaust node clearance; see the documented layout limits.
|
|
10
10
|
*/
|
|
11
11
|
export interface Vec {
|
|
12
12
|
x: number;
|