Lexical: Added basic URL field header option list

May show bad option label names on chrome/safari.
This was an easy first pass without loads of extra custom UI since we're
using native datalists.
This commit is contained in:
Dan Brown
2024-08-16 12:29:40 +01:00
parent 1ef4044419
commit ad6b26ba97
7 changed files with 135 additions and 10 deletions

View File

@ -84,6 +84,17 @@ export function uniqueId() {
return (`${S4() + S4()}-${S4()}-${S4()}-${S4()}-${S4()}${S4()}${S4()}`);
}
/**
* Generate a random smaller unique ID.
*
* @returns {string}
*/
export function uniqueIdSmall() {
// eslint-disable-next-line no-bitwise
const S4 = () => (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
return S4();
}
/**
* Create a promise that resolves after the given time.
* @param {int} timeMs