@aurodesignsystem/auro-library 5.14.0 → 5.14.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,12 @@
|
|
|
1
1
|
# Semantic Release Automated Changelog
|
|
2
2
|
|
|
3
|
+
## [5.14.1](https://github.com/AlaskaAirlines/auro-library/compare/v5.14.0...v5.14.1) (2026-09-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **floatingUI:** add generateUUID helper with insecure-context fallback AB[#1602198](https://github.com/AlaskaAirlines/auro-library/issues/1602198) ([329db41](https://github.com/AlaskaAirlines/auro-library/commit/329db41a1dccec136573ae049867e697cd10e648))
|
|
9
|
+
|
|
3
10
|
# [5.14.0](https://github.com/AlaskaAirlines/auro-library/compare/v5.13.3...v5.14.0) (2026-08-30)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurodesignsystem/auro-library",
|
|
3
|
-
"version": "5.14.
|
|
3
|
+
"version": "5.14.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",
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
offset,
|
|
9
9
|
shift,
|
|
10
10
|
} from "@floating-ui/dom";
|
|
11
|
+
import { generateUUID } from "./generateUUID/index.mjs";
|
|
11
12
|
|
|
12
13
|
const MAX_CONFIGURATION_COUNT = 10;
|
|
13
14
|
|
|
@@ -1025,7 +1026,7 @@ export default class AuroFloatingUI {
|
|
|
1025
1026
|
|
|
1026
1027
|
this.id = element.getAttribute("id");
|
|
1027
1028
|
if (!this.id) {
|
|
1028
|
-
this.id =
|
|
1029
|
+
this.id = generateUUID();
|
|
1029
1030
|
element.setAttribute("id", this.id);
|
|
1030
1031
|
}
|
|
1031
1032
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a v4 UUID with a three-tier fallback for insecure contexts.
|
|
3
|
+
*
|
|
4
|
+
* Tier 1 (secure contexts): crypto.randomUUID() — native, fully random.
|
|
5
|
+
* Tier 2 (insecure contexts): crypto.getRandomValues() — available on all
|
|
6
|
+
* modern browsers regardless of secure-context status.
|
|
7
|
+
* Tier 3 (last resort, no crypto API): new Date().getTime() — lower entropy,
|
|
8
|
+
* but sufficient for element IDs where collision risk is negligible.
|
|
9
|
+
*
|
|
10
|
+
* See: https://w3c.github.io/webcrypto/#dom-crypto-randomuuid (secure-context restriction)
|
|
11
|
+
*/
|
|
12
|
+
export function generateUUID() {
|
|
13
|
+
let uuid;
|
|
14
|
+
|
|
15
|
+
if (
|
|
16
|
+
typeof crypto !== "undefined" &&
|
|
17
|
+
typeof crypto.randomUUID === "function"
|
|
18
|
+
) {
|
|
19
|
+
uuid = crypto.randomUUID();
|
|
20
|
+
} else if (
|
|
21
|
+
typeof crypto !== "undefined" &&
|
|
22
|
+
typeof crypto.getRandomValues === "function"
|
|
23
|
+
) {
|
|
24
|
+
const bytes = new Uint8Array(16);
|
|
25
|
+
crypto.getRandomValues(bytes);
|
|
26
|
+
bytes[6] = (bytes[6] & 0x0f) | 0x40;
|
|
27
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
28
|
+
const hex = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0"));
|
|
29
|
+
uuid = `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
|
|
30
|
+
} else {
|
|
31
|
+
let d = new Date().getTime();
|
|
32
|
+
uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
33
|
+
const r = (d % 16) | 0;
|
|
34
|
+
d = (d - r) / 16 || new Date().getTime();
|
|
35
|
+
return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// CSS selectors require IDs starting with a letter; replace a leading digit with 'a'.
|
|
40
|
+
return /^[0-9]/.test(uuid) ? `a${uuid.slice(1)}` : uuid;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./generateUUID.mjs";
|