@y14e/path-bar 1.0.1 → 1.0.2

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/README.md CHANGED
@@ -10,16 +10,16 @@ npm i @y14e/path-bar
10
10
 
11
11
  ```ts
12
12
  // npm
13
- import PathBar from '@y14e/path-bar@1.0.1';
13
+ import PathBar from '@y14e/path-bar@1.0.2';
14
14
  // with middleware
15
- import PathBar, { flip, offset, shift } from '@y14e/path-bar@1.0.1';
15
+ import PathBar, { flip, offset, shift } from '@y14e/path-bar@1.0.2';
16
16
 
17
17
  // CDNs
18
- import PathBar from 'https://esm.sh/@y14e/path-bar@1.0.1';
18
+ import PathBar from 'https://esm.sh/@y14e/path-bar@1.0.2';
19
19
  // or
20
- import PathBar from 'https://cdn.jsdelivr.net/npm/@y14e/path-bar@1.0.1/+esm';
20
+ import PathBar from 'https://cdn.jsdelivr.net/npm/@y14e/path-bar@1.0.2/+esm';
21
21
  // or
22
- import PathBar from 'https://esm.unpkg.com/@y14e/path-bar@1.0.1';
22
+ import PathBar from 'https://esm.unpkg.com/@y14e/path-bar@1.0.2';
23
23
  ```
24
24
 
25
25
  ## Usage
package/dist/index.cjs CHANGED
@@ -2380,7 +2380,6 @@ function createRovingTabIndex(container, options = {}) {
2380
2380
  navigationOnly = false,
2381
2381
  noMemory = false,
2382
2382
  noStart = false,
2383
- noStopPropagation = false,
2384
2383
  selector,
2385
2384
  typeahead = false,
2386
2385
  wrap = false
@@ -2401,10 +2400,6 @@ function createRovingTabIndex(container, options = {}) {
2401
2400
  console.warn("Invalid noStart option. Fallback: false.");
2402
2401
  noStart = false;
2403
2402
  }
2404
- if (typeof noStopPropagation !== "boolean") {
2405
- console.warn("Invalid noStopPropagation option. Fallback: false.");
2406
- noStopPropagation = false;
2407
- }
2408
2403
  if (typeof selector !== "undefined" && (typeof selector !== "string" || !selector.trim())) {
2409
2404
  console.warn(
2410
2405
  "Invalid selector. Fallback: all focusable elements (undefined)."
@@ -2423,7 +2418,6 @@ function createRovingTabIndex(container, options = {}) {
2423
2418
  navigationOnly,
2424
2419
  noMemory,
2425
2420
  noStart,
2426
- noStopPropagation,
2427
2421
  typeahead,
2428
2422
  wrap
2429
2423
  };
@@ -2492,7 +2486,7 @@ var RovingTabIndex = class {
2492
2486
  if (altKey || ctrlKey || metaKey || shiftKey) {
2493
2487
  return;
2494
2488
  }
2495
- const { direction, noStopPropagation, typeahead, wrap } = this.#options;
2489
+ const { direction, typeahead, wrap } = this.#options;
2496
2490
  const isBoth = !direction;
2497
2491
  const isHorizontal = direction === "horizontal";
2498
2492
  if (![
@@ -2514,7 +2508,6 @@ var RovingTabIndex = class {
2514
2508
  return;
2515
2509
  }
2516
2510
  event.preventDefault();
2517
- !noStopPropagation && event.stopPropagation();
2518
2511
  const currentIndex = current.indexOf(active);
2519
2512
  let rawIndex;
2520
2513
  let newIndex = currentIndex;
@@ -2675,7 +2668,6 @@ var Menu = class _Menu {
2675
2668
  #cleanupRovingTabIndex = null;
2676
2669
  #timers = [];
2677
2670
  #animation = null;
2678
- #animationId = 0;
2679
2671
  #buttons = [];
2680
2672
  #submenus = [];
2681
2673
  #submenuTimer;
@@ -2909,7 +2901,6 @@ var Menu = class _Menu {
2909
2901
  direction: "vertical",
2910
2902
  noMemory: true,
2911
2903
  noStart: !!this.#triggerElement,
2912
- noStopPropagation: true,
2913
2904
  selector: `${item}:not(:scope ${list} *, [data-menu-disabled])`,
2914
2905
  typeahead: true,
2915
2906
  wrap: true
@@ -3093,14 +3084,14 @@ var Menu = class _Menu {
3093
3084
  const opacity = getComputedStyle(this.#listElement).getPropertyValue(
3094
3085
  "opacity"
3095
3086
  );
3096
- const animationId = ++this.#animationId;
3097
3087
  this.#animation?.cancel();
3098
- this.#animation = this.#listElement.animate(
3088
+ const animation = this.#listElement.animate(
3099
3089
  { opacity: isOpen ? [opacity, "1"] : [opacity, "0"] },
3100
3090
  { duration: this.#settings.animation.duration, easing: "ease" }
3101
3091
  );
3092
+ this.#animation = animation;
3102
3093
  const cleanupAnimation = () => {
3103
- if (animationId === this.#animationId) {
3094
+ if (this.#animation === animation) {
3104
3095
  this.#animation = null;
3105
3096
  }
3106
3097
  };
@@ -3112,7 +3103,7 @@ var Menu = class _Menu {
3112
3103
  this.#animation.addEventListener(
3113
3104
  "finish",
3114
3105
  () => {
3115
- if (animationId !== this.#animationId) {
3106
+ if (this.#animation !== animation) {
3116
3107
  return;
3117
3108
  }
3118
3109
  cleanupAnimation();
@@ -3613,7 +3604,6 @@ function createRovingTabIndex2(container, options = {}) {
3613
3604
  navigationOnly = false,
3614
3605
  noMemory = false,
3615
3606
  noStart = false,
3616
- noStopPropagation = false,
3617
3607
  selector,
3618
3608
  typeahead = false,
3619
3609
  wrap = false
@@ -3634,10 +3624,6 @@ function createRovingTabIndex2(container, options = {}) {
3634
3624
  console.warn("Invalid noStart option. Fallback: false.");
3635
3625
  noStart = false;
3636
3626
  }
3637
- if (typeof noStopPropagation !== "boolean") {
3638
- console.warn("Invalid noStopPropagation option. Fallback: false.");
3639
- noStopPropagation = false;
3640
- }
3641
3627
  if (typeof selector !== "undefined" && (typeof selector !== "string" || !selector.trim())) {
3642
3628
  console.warn(
3643
3629
  "Invalid selector. Fallback: all focusable elements (undefined)."
@@ -3656,7 +3642,6 @@ function createRovingTabIndex2(container, options = {}) {
3656
3642
  navigationOnly,
3657
3643
  noMemory,
3658
3644
  noStart,
3659
- noStopPropagation,
3660
3645
  typeahead,
3661
3646
  wrap
3662
3647
  };
@@ -3725,7 +3710,7 @@ var RovingTabIndex2 = class {
3725
3710
  if (altKey || ctrlKey || metaKey || shiftKey) {
3726
3711
  return;
3727
3712
  }
3728
- const { direction, noStopPropagation, typeahead, wrap } = this.#options;
3713
+ const { direction, typeahead, wrap } = this.#options;
3729
3714
  const isBoth = !direction;
3730
3715
  const isHorizontal = direction === "horizontal";
3731
3716
  if (![
@@ -3747,7 +3732,6 @@ var RovingTabIndex2 = class {
3747
3732
  return;
3748
3733
  }
3749
3734
  event.preventDefault();
3750
- !noStopPropagation && event.stopPropagation();
3751
3735
  const currentIndex = current.indexOf(active);
3752
3736
  let rawIndex;
3753
3737
  let newIndex = currentIndex;
@@ -4312,7 +4296,12 @@ var PathBar = class _PathBar {
4312
4296
  }
4313
4297
  const menu = new Menu(
4314
4298
  root,
4315
- { animation, delay, popover: { menu: popover }, selector: selector.menu },
4299
+ {
4300
+ animation,
4301
+ delay,
4302
+ popover: { menu: popover },
4303
+ selector: selector.menu
4304
+ },
4316
4305
  { externalTrigger: link, isMenubar: true }
4317
4306
  );
4318
4307
  this.#bindings.set(link, createBinding(link, menu));
@@ -4413,7 +4402,7 @@ function createBinding(link, menu) {
4413
4402
  * Breadcrumb-style path bar implementation in TypeScript.
4414
4403
  * Supports keyboard navigation, integrated menus, and seamless menu traversal.
4415
4404
  *
4416
- * @version 1.0.1
4405
+ * @version 1.0.2
4417
4406
  * @author Yusuke Kamiyamane
4418
4407
  * @license MIT
4419
4408
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -4427,7 +4416,7 @@ function createBinding(link, menu) {
4427
4416
  * WAI-ARIA compliant menu (menu button) pattern implementation in TypeScript.
4428
4417
  * Supports checkbox item, radio item, and infinitely nested menus.
4429
4418
  *
4430
- * @version 1.7.2
4419
+ * @version 1.7.3
4431
4420
  * @author Yusuke Kamiyamane
4432
4421
  * @license MIT
4433
4422
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -4502,7 +4491,7 @@ function createBinding(link, menu) {
4502
4491
  * Lightweight roving tabindex utility with fully focus management.
4503
4492
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
4504
4493
  *
4505
- * @version 2.2.1
4494
+ * @version 3.0.0
4506
4495
  * @author Yusuke Kamiyamane
4507
4496
  * @license MIT
4508
4497
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -4542,7 +4531,7 @@ function createBinding(link, menu) {
4542
4531
  * Lightweight roving tabindex utility with fully focus management.
4543
4532
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
4544
4533
  *
4545
- * @version 2.2.1
4534
+ * @version 3.0.0
4546
4535
  * @author Yusuke Kamiyamane
4547
4536
  * @license MIT
4548
4537
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -6,7 +6,7 @@ export { flip, offset, shift } from '@y14e/menu';
6
6
  * Breadcrumb-style path bar implementation in TypeScript.
7
7
  * Supports keyboard navigation, integrated menus, and seamless menu traversal.
8
8
  *
9
- * @version 1.0.1
9
+ * @version 1.0.2
10
10
  * @author Yusuke Kamiyamane
11
11
  * @license MIT
12
12
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { flip, offset, shift } from '@y14e/menu';
6
6
  * Breadcrumb-style path bar implementation in TypeScript.
7
7
  * Supports keyboard navigation, integrated menus, and seamless menu traversal.
8
8
  *
9
- * @version 1.0.1
9
+ * @version 1.0.2
10
10
  * @author Yusuke Kamiyamane
11
11
  * @license MIT
12
12
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -2376,7 +2376,6 @@ function createRovingTabIndex(container, options = {}) {
2376
2376
  navigationOnly = false,
2377
2377
  noMemory = false,
2378
2378
  noStart = false,
2379
- noStopPropagation = false,
2380
2379
  selector,
2381
2380
  typeahead = false,
2382
2381
  wrap = false
@@ -2397,10 +2396,6 @@ function createRovingTabIndex(container, options = {}) {
2397
2396
  console.warn("Invalid noStart option. Fallback: false.");
2398
2397
  noStart = false;
2399
2398
  }
2400
- if (typeof noStopPropagation !== "boolean") {
2401
- console.warn("Invalid noStopPropagation option. Fallback: false.");
2402
- noStopPropagation = false;
2403
- }
2404
2399
  if (typeof selector !== "undefined" && (typeof selector !== "string" || !selector.trim())) {
2405
2400
  console.warn(
2406
2401
  "Invalid selector. Fallback: all focusable elements (undefined)."
@@ -2419,7 +2414,6 @@ function createRovingTabIndex(container, options = {}) {
2419
2414
  navigationOnly,
2420
2415
  noMemory,
2421
2416
  noStart,
2422
- noStopPropagation,
2423
2417
  typeahead,
2424
2418
  wrap
2425
2419
  };
@@ -2488,7 +2482,7 @@ var RovingTabIndex = class {
2488
2482
  if (altKey || ctrlKey || metaKey || shiftKey) {
2489
2483
  return;
2490
2484
  }
2491
- const { direction, noStopPropagation, typeahead, wrap } = this.#options;
2485
+ const { direction, typeahead, wrap } = this.#options;
2492
2486
  const isBoth = !direction;
2493
2487
  const isHorizontal = direction === "horizontal";
2494
2488
  if (![
@@ -2510,7 +2504,6 @@ var RovingTabIndex = class {
2510
2504
  return;
2511
2505
  }
2512
2506
  event.preventDefault();
2513
- !noStopPropagation && event.stopPropagation();
2514
2507
  const currentIndex = current.indexOf(active);
2515
2508
  let rawIndex;
2516
2509
  let newIndex = currentIndex;
@@ -2671,7 +2664,6 @@ var Menu = class _Menu {
2671
2664
  #cleanupRovingTabIndex = null;
2672
2665
  #timers = [];
2673
2666
  #animation = null;
2674
- #animationId = 0;
2675
2667
  #buttons = [];
2676
2668
  #submenus = [];
2677
2669
  #submenuTimer;
@@ -2905,7 +2897,6 @@ var Menu = class _Menu {
2905
2897
  direction: "vertical",
2906
2898
  noMemory: true,
2907
2899
  noStart: !!this.#triggerElement,
2908
- noStopPropagation: true,
2909
2900
  selector: `${item}:not(:scope ${list} *, [data-menu-disabled])`,
2910
2901
  typeahead: true,
2911
2902
  wrap: true
@@ -3089,14 +3080,14 @@ var Menu = class _Menu {
3089
3080
  const opacity = getComputedStyle(this.#listElement).getPropertyValue(
3090
3081
  "opacity"
3091
3082
  );
3092
- const animationId = ++this.#animationId;
3093
3083
  this.#animation?.cancel();
3094
- this.#animation = this.#listElement.animate(
3084
+ const animation = this.#listElement.animate(
3095
3085
  { opacity: isOpen ? [opacity, "1"] : [opacity, "0"] },
3096
3086
  { duration: this.#settings.animation.duration, easing: "ease" }
3097
3087
  );
3088
+ this.#animation = animation;
3098
3089
  const cleanupAnimation = () => {
3099
- if (animationId === this.#animationId) {
3090
+ if (this.#animation === animation) {
3100
3091
  this.#animation = null;
3101
3092
  }
3102
3093
  };
@@ -3108,7 +3099,7 @@ var Menu = class _Menu {
3108
3099
  this.#animation.addEventListener(
3109
3100
  "finish",
3110
3101
  () => {
3111
- if (animationId !== this.#animationId) {
3102
+ if (this.#animation !== animation) {
3112
3103
  return;
3113
3104
  }
3114
3105
  cleanupAnimation();
@@ -3609,7 +3600,6 @@ function createRovingTabIndex2(container, options = {}) {
3609
3600
  navigationOnly = false,
3610
3601
  noMemory = false,
3611
3602
  noStart = false,
3612
- noStopPropagation = false,
3613
3603
  selector,
3614
3604
  typeahead = false,
3615
3605
  wrap = false
@@ -3630,10 +3620,6 @@ function createRovingTabIndex2(container, options = {}) {
3630
3620
  console.warn("Invalid noStart option. Fallback: false.");
3631
3621
  noStart = false;
3632
3622
  }
3633
- if (typeof noStopPropagation !== "boolean") {
3634
- console.warn("Invalid noStopPropagation option. Fallback: false.");
3635
- noStopPropagation = false;
3636
- }
3637
3623
  if (typeof selector !== "undefined" && (typeof selector !== "string" || !selector.trim())) {
3638
3624
  console.warn(
3639
3625
  "Invalid selector. Fallback: all focusable elements (undefined)."
@@ -3652,7 +3638,6 @@ function createRovingTabIndex2(container, options = {}) {
3652
3638
  navigationOnly,
3653
3639
  noMemory,
3654
3640
  noStart,
3655
- noStopPropagation,
3656
3641
  typeahead,
3657
3642
  wrap
3658
3643
  };
@@ -3721,7 +3706,7 @@ var RovingTabIndex2 = class {
3721
3706
  if (altKey || ctrlKey || metaKey || shiftKey) {
3722
3707
  return;
3723
3708
  }
3724
- const { direction, noStopPropagation, typeahead, wrap } = this.#options;
3709
+ const { direction, typeahead, wrap } = this.#options;
3725
3710
  const isBoth = !direction;
3726
3711
  const isHorizontal = direction === "horizontal";
3727
3712
  if (![
@@ -3743,7 +3728,6 @@ var RovingTabIndex2 = class {
3743
3728
  return;
3744
3729
  }
3745
3730
  event.preventDefault();
3746
- !noStopPropagation && event.stopPropagation();
3747
3731
  const currentIndex = current.indexOf(active);
3748
3732
  let rawIndex;
3749
3733
  let newIndex = currentIndex;
@@ -4308,7 +4292,12 @@ var PathBar = class _PathBar {
4308
4292
  }
4309
4293
  const menu = new Menu(
4310
4294
  root,
4311
- { animation, delay, popover: { menu: popover }, selector: selector.menu },
4295
+ {
4296
+ animation,
4297
+ delay,
4298
+ popover: { menu: popover },
4299
+ selector: selector.menu
4300
+ },
4312
4301
  { externalTrigger: link, isMenubar: true }
4313
4302
  );
4314
4303
  this.#bindings.set(link, createBinding(link, menu));
@@ -4409,7 +4398,7 @@ function createBinding(link, menu) {
4409
4398
  * Breadcrumb-style path bar implementation in TypeScript.
4410
4399
  * Supports keyboard navigation, integrated menus, and seamless menu traversal.
4411
4400
  *
4412
- * @version 1.0.1
4401
+ * @version 1.0.2
4413
4402
  * @author Yusuke Kamiyamane
4414
4403
  * @license MIT
4415
4404
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -4423,7 +4412,7 @@ function createBinding(link, menu) {
4423
4412
  * WAI-ARIA compliant menu (menu button) pattern implementation in TypeScript.
4424
4413
  * Supports checkbox item, radio item, and infinitely nested menus.
4425
4414
  *
4426
- * @version 1.7.2
4415
+ * @version 1.7.3
4427
4416
  * @author Yusuke Kamiyamane
4428
4417
  * @license MIT
4429
4418
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -4498,7 +4487,7 @@ function createBinding(link, menu) {
4498
4487
  * Lightweight roving tabindex utility with fully focus management.
4499
4488
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
4500
4489
  *
4501
- * @version 2.2.1
4490
+ * @version 3.0.0
4502
4491
  * @author Yusuke Kamiyamane
4503
4492
  * @license MIT
4504
4493
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -4538,7 +4527,7 @@ function createBinding(link, menu) {
4538
4527
  * Lightweight roving tabindex utility with fully focus management.
4539
4528
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
4540
4529
  *
4541
- * @version 2.2.1
4530
+ * @version 3.0.0
4542
4531
  * @author Yusuke Kamiyamane
4543
4532
  * @license MIT
4544
4533
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/path-bar",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -44,8 +44,8 @@
44
44
  "devDependencies": {
45
45
  "@floating-ui/dom": "^1.7.6",
46
46
  "@y14e/attributes-utils": "^1.1.1",
47
- "@y14e/menu": "^1.7.2",
48
- "@y14e/roving-tabindex": "^2.2.1",
47
+ "@y14e/menu": "^1.7.3",
48
+ "@y14e/roving-tabindex": "^3.0.0",
49
49
  "bun-types": "latest",
50
50
  "power-focusable": "^4.3.2",
51
51
  "tsup": "^8.0.0",