@aurodesignsystem/auro-library 5.14.0 → 5.14.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bin/generateDocs.mjs +4 -210
  3. package/bin/generateDocs_index.mjs +4 -210
  4. package/dist/_chunks/chunk-2MOEVVSZ.mjs +308 -0
  5. package/dist/_chunks/chunk-H7YO7ERJ.mjs +69 -0
  6. package/dist/_chunks/chunk-JLCAYVRX.mjs +84 -0
  7. package/dist/_chunks/chunk-RKBXVLA5.mjs +5983 -0
  8. package/dist/_chunks/chunk-TDFKN2EP.mjs +38 -0
  9. package/dist/_chunks/chunk-UY4SIQT6.mjs +201 -0
  10. package/dist/_chunks/chunk-V7YBXHAI.mjs +32379 -0
  11. package/dist/bin/generateDocs.mjs +152 -0
  12. package/dist/bin/generateDocs_index.mjs +152 -0
  13. package/dist/build/generateDocs.mjs +18 -0
  14. package/dist/build/generateReadme.mjs +49 -0
  15. package/dist/build/generateWcaComponent.mjs +6657 -0
  16. package/dist/build/processors/defaultDocsProcessor.mjs +16 -0
  17. package/dist/build/processors/defaultDotGithubSync.mjs +12 -0
  18. package/dist/build/syncGithubFiles.mjs +18 -0
  19. package/dist/utils/auroTemplateFiller.mjs +8 -0
  20. package/dist/utils/sharedFileProcessorUtils.mjs +31 -0
  21. package/package.json +10 -5
  22. package/scripts/build/generateDocs.mjs +4 -24
  23. package/scripts/build/generateReadme.mjs +4 -60
  24. package/scripts/build/generateWcaComponent.mjs +4 -43
  25. package/scripts/build/postinstall.mjs +10 -10
  26. package/scripts/build/pre-commit.mjs +13 -7
  27. package/scripts/build/processors/defaultDocsProcessor.mjs +4 -83
  28. package/scripts/build/processors/defaultDotGithubSync.mjs +4 -83
  29. package/scripts/build/syncGithubFiles.mjs +4 -25
  30. package/scripts/runtime/floatingUI.mjs +2 -1
  31. package/scripts/runtime/generateUUID/generateUUID.mjs +41 -0
  32. package/scripts/runtime/generateUUID/index.mjs +1 -0
  33. package/scripts/utils/ansiColors.mjs +119 -0
  34. package/scripts/utils/auroLibraryUtils.mjs +87 -51
  35. package/scripts/utils/auroTemplateFiller.mjs +4 -178
  36. package/scripts/utils/logger.mjs +27 -16
  37. package/scripts/utils/sharedFileProcessorUtils.mjs +4 -270
  38. package/scripts/build/deprecatedProseToFieldPlugin.spec.js +0 -188
  39. package/scripts/runtime/ClickTracker/test/ClickTracker.test.js +0 -424
  40. package/scripts/runtime/FocusTrap/test/FocusTrap.test.js +0 -168
  41. package/scripts/runtime/Focusables/test/Focusables.test.js +0 -185
  42. package/scripts/runtime/dateUtilities/dateFormatter.test.js +0 -284
  43. package/scripts/runtime/dateUtilities/dateUtilities.test.js +0 -80
  44. package/scripts/runtime/floatingUI/test/floatingUI.test.js +0 -189
  45. package/scripts/runtime/floatingUI.test.js +0 -478
@@ -0,0 +1,16 @@
1
+ import{createRequire as __auroCreateRequire}from'node:module';const require=__auroCreateRequire(import.meta.url);
2
+ import {
3
+ defaultDocsProcessorConfig,
4
+ fileConfigs,
5
+ processDocFiles
6
+ } from "../../_chunks/chunk-H7YO7ERJ.mjs";
7
+ import "../../_chunks/chunk-UY4SIQT6.mjs";
8
+ import "../../_chunks/chunk-RKBXVLA5.mjs";
9
+ import "../../_chunks/chunk-2MOEVVSZ.mjs";
10
+ import "../../_chunks/chunk-V7YBXHAI.mjs";
11
+ import "../../_chunks/chunk-TDFKN2EP.mjs";
12
+ export {
13
+ defaultDocsProcessorConfig,
14
+ fileConfigs,
15
+ processDocFiles
16
+ };
@@ -0,0 +1,12 @@
1
+ import{createRequire as __auroCreateRequire}from'node:module';const require=__auroCreateRequire(import.meta.url);
2
+ import {
3
+ syncGithubFiles
4
+ } from "../../_chunks/chunk-JLCAYVRX.mjs";
5
+ import "../../_chunks/chunk-UY4SIQT6.mjs";
6
+ import "../../_chunks/chunk-RKBXVLA5.mjs";
7
+ import "../../_chunks/chunk-2MOEVVSZ.mjs";
8
+ import "../../_chunks/chunk-V7YBXHAI.mjs";
9
+ import "../../_chunks/chunk-TDFKN2EP.mjs";
10
+ export {
11
+ syncGithubFiles
12
+ };
@@ -0,0 +1,18 @@
1
+ import{createRequire as __auroCreateRequire}from'node:module';const require=__auroCreateRequire(import.meta.url);
2
+ import {
3
+ syncGithubFiles
4
+ } from "../_chunks/chunk-JLCAYVRX.mjs";
5
+ import "../_chunks/chunk-UY4SIQT6.mjs";
6
+ import "../_chunks/chunk-RKBXVLA5.mjs";
7
+ import {
8
+ Logger
9
+ } from "../_chunks/chunk-2MOEVVSZ.mjs";
10
+ import "../_chunks/chunk-V7YBXHAI.mjs";
11
+ import "../_chunks/chunk-TDFKN2EP.mjs";
12
+
13
+ // src/build/syncGithubFiles.mjs
14
+ syncGithubFiles().then(() => {
15
+ Logger.log("Docs processed successfully");
16
+ }).catch((err) => {
17
+ Logger.error(`Error processing docs: ${err.message}`);
18
+ });
@@ -0,0 +1,8 @@
1
+ import{createRequire as __auroCreateRequire}from'node:module';const require=__auroCreateRequire(import.meta.url);
2
+ import {
3
+ AuroTemplateFiller
4
+ } from "../_chunks/chunk-RKBXVLA5.mjs";
5
+ import "../_chunks/chunk-TDFKN2EP.mjs";
6
+ export {
7
+ AuroTemplateFiller
8
+ };
@@ -0,0 +1,31 @@
1
+ import{createRequire as __auroCreateRequire}from'node:module';const require=__auroCreateRequire(import.meta.url);
2
+ import {
3
+ MD_MAGIC_CONFIG,
4
+ auroLibraryUtils,
5
+ fromAuroComponentRoot,
6
+ generateReadmeUrl,
7
+ generateWCGeneratorUrl,
8
+ nonEsmComponents,
9
+ optionallyCopyFile,
10
+ processContentForFile,
11
+ retrieveRemoteFileCopy,
12
+ runMarkdownMagicOnFile,
13
+ templateFiller
14
+ } from "../_chunks/chunk-UY4SIQT6.mjs";
15
+ import "../_chunks/chunk-RKBXVLA5.mjs";
16
+ import "../_chunks/chunk-2MOEVVSZ.mjs";
17
+ import "../_chunks/chunk-V7YBXHAI.mjs";
18
+ import "../_chunks/chunk-TDFKN2EP.mjs";
19
+ export {
20
+ MD_MAGIC_CONFIG,
21
+ auroLibraryUtils,
22
+ fromAuroComponentRoot,
23
+ generateReadmeUrl,
24
+ generateWCGeneratorUrl,
25
+ nonEsmComponents,
26
+ optionallyCopyFile,
27
+ processContentForFile,
28
+ retrieveRemoteFileCopy,
29
+ runMarkdownMagicOnFile,
30
+ templateFiller
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem/auro-library",
3
- "version": "5.14.0",
3
+ "version": "5.14.2",
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",
@@ -15,12 +15,10 @@
15
15
  "generateDocs": "./bin/generateDocs.mjs"
16
16
  },
17
17
  "dependencies": {
18
- "handlebars": "^4.7.8",
19
- "markdown-magic": "^2.6.1",
20
18
  "@floating-ui/dom": "^1.7.4"
21
19
  },
22
20
  "devDependencies": {
23
- "@aurodesignsystem/auro-cli": "^3.5.1",
21
+ "@aurodesignsystem/auro-cli": "^3.7.1",
24
22
  "@aurodesignsystem/auro-config": "^1.3.1",
25
23
  "@commitlint/cli": "^18.5.0",
26
24
  "@commitlint/config-conventional": "^18.5.0",
@@ -28,7 +26,11 @@
28
26
  "@semantic-release/changelog": "^6.0.3",
29
27
  "@semantic-release/git": "^10.0.1",
30
28
  "@semantic-release/npm": "^13.0.0",
29
+ "esbuild": "^0.24.2",
30
+ "glob": "^11.0.3",
31
+ "handlebars": "^4.7.8",
31
32
  "husky": "^9.1.7",
33
+ "markdown-magic": "^2.6.1",
32
34
  "npm-run-all": "^4.1.5",
33
35
  "semantic-release": "^25.0.0",
34
36
  "sinon": "^20.0.0",
@@ -74,10 +76,13 @@
74
76
  "provenance": true
75
77
  },
76
78
  "scripts": {
77
- "prepare": "husky install",
79
+ "prepare": "husky install && npm run build:bundles",
80
+ "prepack": "npm run build:bundles",
78
81
  "lint": "biome check --no-errors-on-unmatched",
79
82
  "lint:fix": "biome check --fix --no-errors-on-unmatched",
83
+ "build:bundles": "node build/bundleDocsScripts.mjs",
80
84
  "build:docs": "node scripts/build/generateReadme.mjs",
85
+ "pretest:vitest": "npm run build:bundles",
81
86
  "test:vitest": "vitest --run",
82
87
  "test:vitest:watch": "vitest",
83
88
  "test:auro": "auro test --files 'scripts/**/*.test.js'",
@@ -1,24 +1,4 @@
1
- // ------------------------------------------------------
2
- // Docs Generation
3
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
- //
5
- // This script will generate the docs for the component
6
- // based on example HTML, markdown files, and more.
7
- //
8
- // The actions in this file live in:
9
- // scripts/build/processors/defaultDocsProcessor.mjs
10
- //
11
- // This script is intended to be run AS-IS without modification.
12
- // To run a different processor, please see the defaultDocsProcessor.mjs file
13
- // and re-create in your repo OR add a new processor file.
14
- // ------------------------------------------------------
15
-
16
- import {Logger} from "../utils/logger.mjs";
17
- import {processDocFiles} from "./processors/defaultDocsProcessor.mjs";
18
-
19
- processDocFiles().then(() => {
20
- Logger.log('Docs processed successfully');
21
- }).
22
- catch((err) => {
23
- Logger.error(`Error processing docs: ${err.message}`);
24
- });
1
+ // Shim for the pre-compiled build. Do not edit.
2
+ // Generated by build/bundleDocsScripts.mjs from src/build/generateDocs.mjs.
3
+ // Edit that file, then run `npm run build:bundles`.
4
+ import "../../dist/build/generateDocs.mjs";
@@ -1,60 +1,4 @@
1
- import markdownMagic from 'markdown-magic';
2
- import * as fs from 'fs';
3
-
4
- const dirDocs = './docs';
5
- const readmeFilePath = dirDocs + '/README.md';
6
-
7
- import AuroLibraryUtils from "../utils/auroLibraryUtils.mjs";
8
-
9
- const auroLibraryUtils = new AuroLibraryUtils();
10
-
11
- /**
12
- * Compiles `./docs/README.md` -> `./README.md`
13
- */
14
-
15
- function processReadme() {
16
- const callback = function() {
17
-
18
- if (fs.existsSync('./README.md')) {
19
- fs.readFile('./README.md', 'utf8', function(err, data) {
20
- auroLibraryUtils.formatFileContents(data, './README.md');
21
- });
22
- } else {
23
- console.log('ERROR: ./README.md file is missing');
24
- }
25
- };
26
-
27
- const config = {
28
- matchWord: 'AURO-GENERATED-CONTENT',
29
- outputDir: './'
30
- };
31
-
32
- const markdownPath = './docs/README.md';
33
-
34
- markdownMagic(markdownPath, config, callback);
35
-
36
- fs.copyFileSync(readmeFilePath, './README.md');
37
- }
38
-
39
- /**
40
- * Copy README.md template from static source
41
- * */
42
-
43
- function copyReadmeLocally() {
44
-
45
- if (!fs.existsSync(dirDocs)){
46
- fs.mkdirSync(dirDocs);
47
- }
48
-
49
- if (!fs.existsSync(readmeFilePath)) {
50
- fs.writeFile(readmeFilePath, '', function(err) {
51
- if(err) {
52
- console.log('ERROR: Unable to create README.md file.', err);
53
- }
54
- });
55
- }
56
-
57
- processReadme();
58
- }
59
-
60
- copyReadmeLocally();
1
+ // Shim for the pre-compiled build. Do not edit.
2
+ // Generated by build/bundleDocsScripts.mjs from src/build/generateReadme.mjs.
3
+ // Edit that file, then run `npm run build:bundles`.
4
+ import "../../dist/build/generateReadme.mjs";
@@ -1,43 +1,4 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import glob from 'glob';
4
- import util from 'util';
5
- import getTemplatedComponentCode from './prepWcaCompatibleCode.mjs';
6
-
7
- const promisifiedGlob = util.promisify(glob);
8
-
9
- const WAC_DIR = path.resolve(process.cwd(), './scripts/wca');
10
-
11
- async function globPath(sources) {
12
- try {
13
- const fileArrays = await Promise.all(
14
- sources.map(source => promisifiedGlob(source))
15
- );
16
- return fileArrays.flat();
17
- } catch (err) {
18
- console.error('Error processing glob patterns:', err);
19
- throw err; // Re-throw to handle failure at caller
20
- }
21
- }
22
-
23
- async function createExtendsFile(filePaths) {
24
- if (!fs.existsSync(WAC_DIR)) {
25
- await fs.promises.mkdir(WAC_DIR, { recursive: true });
26
- }
27
-
28
- for (const filePath of filePaths) {
29
- const resolvedPath = path.resolve(process.cwd(), filePath);
30
- const fileContent = await fs.promises.readFile(resolvedPath, 'utf-8',);
31
- const newPath = path.resolve(WAC_DIR, `${path.basename(filePath)}`);
32
- const newCode = getTemplatedComponentCode(fileContent, path.relative(WAC_DIR, filePath));
33
- await fs.promises.writeFile(newPath, newCode);
34
- }
35
- }
36
-
37
- async function main() {
38
- // files to analyze
39
- const filePaths = await globPath(process.argv.slice(2));
40
- await createExtendsFile(filePaths);
41
- }
42
-
43
- main();
1
+ // Shim for the pre-compiled build. Do not edit.
2
+ // Generated by build/bundleDocsScripts.mjs from src/build/generateWcaComponent.mjs.
3
+ // Edit that file, then run `npm run build:bundles`.
4
+ import "../../dist/build/generateWcaComponent.mjs";
@@ -1,14 +1,12 @@
1
- 'use strict';
2
-
3
- import chalk from 'chalk';
4
- import { createRequire } from 'node:module';
5
- import { resolve } from 'path';
6
-
1
+ import { createRequire } from "node:module";
2
+ import { resolve } from "path";
3
+ import { hex } from "../utils/ansiColors.mjs";
7
4
 
8
5
  const require = createRequire(import.meta.url);
9
- const pjson = require(resolve(process.cwd(), 'package.json'));
6
+ const pjson = require(resolve(process.cwd(), "package.json"));
10
7
 
11
- console.log(chalk.hex('#f26135')(`
8
+ console.log(
9
+ hex("#f26135")(`
12
10
 
13
11
  _______ __ __ __
14
12
  | __|.---.-.--.--. | |--.-----.| | |.-----.
@@ -24,8 +22,10 @@ console.log(chalk.hex('#f26135')(`
24
22
  ╭ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ──────────────────────────────╮
25
23
 
26
24
  Thanks for installing the latest version
27
- of `) + chalk.hex('#ffd200').bold(`${pjson.name} v${pjson.version}.`) + chalk.hex('#f26135')(`
25
+ of `) +
26
+ hex("#ffd200").bold(`${pjson.name} v${pjson.version}.`) +
27
+ hex("#f26135")(`
28
28
 
29
29
  ╰─────────────────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
30
- `)
30
+ `),
31
31
  );
@@ -1,17 +1,23 @@
1
1
  /* eslint-disable no-console */
2
2
 
3
- import chalk from 'chalk';
3
+ import { hex } from "../utils/ansiColors.mjs";
4
4
 
5
- console.log(chalk.hex('#ffd200')(`
5
+ console.log(
6
+ hex("#ffd200")(`
6
7
 
7
- ╭ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ──────────────────────────────╮`) + chalk.hex('#f26135')(`
8
+ ╭ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ──────────────────────────────╮`) +
9
+ hex("#f26135")(`
8
10
 
9
11
  Are you familiar with Auro's Definition of Done?
10
12
 
11
- Please be sure to review`) + chalk.hex('#ffd200')(`
12
- https://auro.alaskaair.com/definition-of-done`) + chalk.hex('#f26135')(`
13
+ Please be sure to review`) +
14
+ hex("#ffd200")(`
15
+ https://auro.alaskaair.com/definition-of-done`) +
16
+ hex("#f26135")(`
13
17
  before submitting your pull request
14
- to ensure that you are compliant.`) + chalk.hex('#ffd200')(`
18
+ to ensure that you are compliant.`) +
19
+ hex("#ffd200")(`
15
20
 
16
21
  ╰─────────────────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
17
- `));
22
+ `),
23
+ );
@@ -1,83 +1,4 @@
1
- import {Logger} from "../../utils/logger.mjs";
2
- import {
3
- fromAuroComponentRoot,
4
- generateReadmeUrl,
5
- processContentForFile,
6
- templateFiller
7
- } from "../../utils/sharedFileProcessorUtils.mjs";
8
-
9
- /**
10
- * Processor config object.
11
- * @typedef {Object} ProcessorConfig
12
- * @property {boolean} [overwriteLocalCopies=true] - The release version tag to use instead of master.
13
- * @property {string} [remoteReadmeVersion="master"] - The release version tag to use instead of master.
14
- * @property {string} [remoteReadmeVariant=""] - The variant string to use for the README source.
15
- * (like "_esm" to make README_esm.md).
16
- */
17
-
18
-
19
- /**
20
- * @param {ProcessorConfig} config - The configuration for this processor.
21
- */
22
- export const defaultDocsProcessorConfig = {
23
- overwriteLocalCopies: true,
24
- remoteReadmeVersion: "master",
25
- // eslint-disable-next-line no-warning-comments
26
- // TODO: remove this variant when all components are updated to use latest auro-library
27
- // AND the default README.md is updated to use the new paths
28
- remoteReadmeVariant: "_updated_paths"
29
- };
30
-
31
- /**
32
- * @param {ProcessorConfig} config - The configuration for this processor.
33
- * @returns {import('../utils/sharedFileProcessorUtils').FileProcessorConfig[]}
34
- */
35
- export const fileConfigs = (config) => [
36
- // README.md
37
- {
38
- identifier: 'README.md',
39
- input: {
40
- remoteUrl: generateReadmeUrl(config.remoteReadmeVersion, config.remoteReadmeVariant),
41
- fileName: fromAuroComponentRoot(`/docTemplates/README.md`),
42
- overwrite: config.overwriteLocalCopies
43
- },
44
- output: fromAuroComponentRoot("/README.md")
45
- },
46
- // index.md
47
- {
48
- identifier: 'index.md',
49
- input: fromAuroComponentRoot("/docs/partials/index.md"),
50
- output: fromAuroComponentRoot("/demo/index.md"),
51
- mdMagicConfig: {
52
- output: {
53
- directory: fromAuroComponentRoot("/demo")
54
- }
55
- }
56
- },
57
- // api.md
58
- {
59
- identifier: 'api.md',
60
- input: fromAuroComponentRoot("/docs/partials/api.md"),
61
- output: fromAuroComponentRoot("/demo/api.md"),
62
- preProcessors: [templateFiller.formatApiTable],
63
- }
64
- ];
65
-
66
- /**
67
- *
68
- * @param {ProcessorConfig} config - The configuration for this processor.
69
- * @return {Promise<void>}
70
- */
71
- export async function processDocFiles(config = defaultDocsProcessorConfig) {
72
- // setup
73
- await templateFiller.extractNames();
74
-
75
- for (const fileConfig of fileConfigs(config)) {
76
- try {
77
- // eslint-disable-next-line no-await-in-loop
78
- await processContentForFile(fileConfig);
79
- } catch (err) {
80
- Logger.error(`Error processing ${fileConfig.identifier}: ${err.message}`);
81
- }
82
- }
83
- }
1
+ // Shim for the pre-compiled build. Do not edit.
2
+ // Generated by build/bundleDocsScripts.mjs from src/build/processors/defaultDocsProcessor.mjs.
3
+ // Edit that file, then run `npm run build:bundles`.
4
+ export * from "../../../dist/build/processors/defaultDocsProcessor.mjs";
@@ -1,83 +1,4 @@
1
- import {Logger} from "../../utils/logger.mjs";
2
- import {
3
- fromAuroComponentRoot,
4
- generateWCGeneratorUrl,
5
- processContentForFile,
6
- templateFiller
7
- } from "../../utils/sharedFileProcessorUtils.mjs";
8
-
9
- /**
10
- * Processor config object.
11
- * @typedef {Object} ProcessorConfig
12
- * @property {boolean} [overwriteLocalCopies=true] - The release version tag to use instead of master.
13
- * @property {string} [generatorTemplateVersion="master"] - The release version tag to use instead of master.
14
- * (like "_esm" to make README_esm.md).
15
- */
16
-
17
- const DOT_GITHUB_PATH = '.github';
18
- const ISSUE_TEMPLATE_PATH = `${DOT_GITHUB_PATH}/ISSUE_TEMPLATE`;
19
-
20
- /**
21
- * @type {ProcessorConfig} config - The default configuration for this processor.
22
- */
23
- const defaultGitHubSyncConfig = {
24
- overwriteLocalCopies: true,
25
- generatorTemplateVersion: "master",
26
- };
27
-
28
- /**
29
- * @param {ProcessorConfig} config - The configuration for this processor.
30
- * @returns {import('../utils/sharedFileProcessorUtils').FileProcessorConfig[]}
31
- */
32
- const defaultGitHubTemplateFiles = (config = defaultGitHubSyncConfig) => [
33
- // bug_report.yml
34
- {
35
- identifier: 'bug_report.yml',
36
- input: {
37
- remoteUrl: generateWCGeneratorUrl(config.generatorTemplateVersion, `templates/${ISSUE_TEMPLATE_PATH}/bug_report.yml`),
38
- fileName: fromAuroComponentRoot(`docTemplates/${ISSUE_TEMPLATE_PATH}/bug_report.yml`),
39
- overwrite: config.overwriteLocalCopies
40
- },
41
- output: fromAuroComponentRoot(`${ISSUE_TEMPLATE_PATH}/bug_report.yml`)
42
- },
43
- // config.yml
44
- {
45
- identifier: 'config.yml',
46
- input: {
47
- remoteUrl: generateWCGeneratorUrl(config.generatorTemplateVersion, `templates/${ISSUE_TEMPLATE_PATH}/config.yml`),
48
- fileName: fromAuroComponentRoot(`docTemplates/${ISSUE_TEMPLATE_PATH}/config.yml`),
49
- overwrite: config.overwriteLocalCopies
50
- },
51
- output: fromAuroComponentRoot(`${ISSUE_TEMPLATE_PATH}/config.yml`)
52
- },
53
- // PULL_REQUEST_TEMPLATE.md
54
- {
55
- identifier: 'PULL_REQUEST_TEMPLATE.md',
56
- input: {
57
- remoteUrl: generateWCGeneratorUrl(config.generatorTemplateVersion, `templates/${DOT_GITHUB_PATH}/PULL_REQUEST_TEMPLATE.md`),
58
- fileName: fromAuroComponentRoot(`docTemplates/${DOT_GITHUB_PATH}/PULL_REQUEST_TEMPLATE.md`),
59
- overwrite: config.overwriteLocalCopies
60
- },
61
- output: fromAuroComponentRoot(`${DOT_GITHUB_PATH}/PULL_REQUEST_TEMPLATE.md`)
62
- },
63
- ];
64
-
65
- /**
66
- *
67
- * @param {ProcessorConfig} config - The configuration for this processor.
68
- * @return {Promise<void>}
69
- */
70
- export async function syncGithubFiles(config = defaultGitHubSyncConfig) {
71
- // setup
72
- await templateFiller.extractNames();
73
-
74
- for (const file of defaultGitHubTemplateFiles(config)) {
75
- try {
76
- Logger.log(`Processing file: ${file.identifier}`);
77
- // eslint-disable-next-line no-await-in-loop
78
- await processContentForFile(file);
79
- } catch (error) {
80
- Logger.error(`Error processing file: ${file.identifier}, ${error.message}`);
81
- }
82
- }
83
- }
1
+ // Shim for the pre-compiled build. Do not edit.
2
+ // Generated by build/bundleDocsScripts.mjs from src/build/processors/defaultDotGithubSync.mjs.
3
+ // Edit that file, then run `npm run build:bundles`.
4
+ export * from "../../../dist/build/processors/defaultDotGithubSync.mjs";
@@ -1,25 +1,4 @@
1
- // ------------------------------------------------------
2
- // GitHub Config Sync
3
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
- //
5
- // This script will synchronize shared GitHub config
6
- // files to the local repo (eventually, anything that lives
7
- // in the .github directory).
8
- //
9
- // The actions in this file live in:
10
- // scripts/build/processors/defaultDotGithubSync.mjs
11
- //
12
- // This script is intended to be run AS-IS without modification.
13
- // To run a different processor, please see the defaultDotGithubSync.mjs file
14
- // and re-create in your repo OR add a new processor file.
15
- // ------------------------------------------------------
16
-
17
- import {syncGithubFiles} from "./processors/defaultDotGithubSync.mjs";
18
- import {Logger} from "../utils/logger.mjs";
19
-
20
- syncGithubFiles().then(() => {
21
- Logger.log('Docs processed successfully');
22
- }).
23
- catch((err) => {
24
- Logger.error(`Error processing docs: ${err.message}`);
25
- });
1
+ // Shim for the pre-compiled build. Do not edit.
2
+ // Generated by build/bundleDocsScripts.mjs from src/build/syncGithubFiles.mjs.
3
+ // Edit that file, then run `npm run build:bundles`.
4
+ import "../../dist/build/syncGithubFiles.mjs";
@@ -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 = window.crypto.randomUUID();
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";