@aurodesignsystem/auro-library 4.5.0 → 5.0.1

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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # Semantic Release Automated Changelog
2
2
 
3
+ ## [5.0.1](https://github.com/AlaskaAirlines/auro-library/compare/v5.0.0...v5.0.1) (2025-06-02)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * resolve issues with isMousePressed and keeping bibs open on focus loss ([3ae2c38](https://github.com/AlaskaAirlines/auro-library/commit/3ae2c38003eda3c58f1278924844bfd9f57e349f))
9
+
10
+ # [5.0.0](https://github.com/AlaskaAirlines/auro-library/compare/v4.5.0...v5.0.0) (2025-05-29)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * update positioning strategy and remove dom node transportation from FloatingUI ([3e01ab2](https://github.com/AlaskaAirlines/auro-library/commit/3e01ab2e8cadfa76d7d057abc6626b7b09ef568f))
16
+
17
+
18
+ ### BREAKING CHANGES
19
+
20
+ * this changes the fundamental strategy for implementing FloatingUI and will require accommodating changes in consuming code to work correctly
21
+
3
22
  # [4.5.0](https://github.com/AlaskaAirlines/auro-library/compare/v4.4.1...v4.5.0) (2025-05-15)
4
23
 
5
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem/auro-library",
3
- "version": "4.5.0",
3
+ "version": "5.0.1",
4
4
  "description": "This repository holds shared scripts, utilities, and workflows utilized across repositories along the Auro Design System.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,8 +24,28 @@ export default class AuroFloatingUI {
24
24
  if (!AuroFloatingUI.isMousePressHandlerInitialized && window && window.addEventListener) {
25
25
  AuroFloatingUI.isMousePressHandlerInitialized = true;
26
26
 
27
+ // Track timeout for isMousePressed reset to avoid race conditions
28
+ if (!AuroFloatingUI._mousePressedTimeout) {
29
+ AuroFloatingUI._mousePressedTimeout = null;
30
+ }
27
31
  const mouseEventGlobalHandler = (event) => {
28
- AuroFloatingUI.isMousePressed = event.type === 'mousedown';
32
+ const isPressed = event.type === 'mousedown';
33
+ if (isPressed) {
34
+ // Clear any pending timeout to prevent race condition
35
+ if (AuroFloatingUI._mousePressedTimeout !== null) {
36
+ clearTimeout(AuroFloatingUI._mousePressedTimeout);
37
+ AuroFloatingUI._mousePressedTimeout = null;
38
+ }
39
+ if (!AuroFloatingUI.isMousePressed) {
40
+ AuroFloatingUI.isMousePressed = true;
41
+ }
42
+ } else if (AuroFloatingUI.isMousePressed && !isPressed) {
43
+ // Schedule reset and track timeout ID
44
+ AuroFloatingUI._mousePressedTimeout = setTimeout(() => {
45
+ AuroFloatingUI.isMousePressed = false;
46
+ AuroFloatingUI._mousePressedTimeout = null;
47
+ }, 0);
48
+ }
29
49
  };
30
50
 
31
51
  window.addEventListener('mousedown', mouseEventGlobalHandler);
@@ -152,6 +172,7 @@ export default class AuroFloatingUI {
152
172
 
153
173
  // Compute the position of the bib
154
174
  computePosition(this.element.trigger, this.element.bib, {
175
+ strategy: this.element.floaterConfig?.strategy || 'fixed',
155
176
  placement: this.element.floaterConfig?.placement,
156
177
  middleware: middleware || []
157
178
  }).then(({ x, y }) => { // eslint-disable-line id-length
@@ -286,8 +307,9 @@ export default class AuroFloatingUI {
286
307
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
287
308
  return;
288
309
  }
289
- // if fullscreen bib is still open and the focus is missing, do not close
290
- if (this.element.bib.hasAttribute('isfullscreen') && activeElement === document.body) {
310
+
311
+ // if fullscreen bib is in fullscreen mode, do not close
312
+ if (this.element.bib.hasAttribute('isfullscreen')) {
291
313
  return;
292
314
  }
293
315
 
@@ -589,8 +611,6 @@ export default class AuroFloatingUI {
589
611
  this.element.hoverToggle = this.element.floaterConfig.hoverToggle;
590
612
  }
591
613
 
592
- document.body.append(this.element.bib);
593
-
594
614
  this.regenerateBibId();
595
615
  this.handleTriggerTabIndex();
596
616