f04968c854
Updated the add bookmark popup with a more modern Material card style, clearer field labels, and improved layout. The icon picker now fetches the full list of Material Icons asynchronously from Google Fonts, with a fallback to a minimal static set for immediate use. Enhanced the icon grid UI and selection logic for better usability.
21 lines
720 B
JavaScript
21 lines
720 B
JavaScript
// This file is automatically generated from Google's Material Icons.
|
|
/**
|
|
* Fetches the full list of Material Icon names from Google Fonts.
|
|
* Returns an array of strings like ["3d_rotation","access_alarm",…]
|
|
*/
|
|
export async function fetchAllIcons() {
|
|
const res = await fetch("https://fonts.google.com/metadata/icons");
|
|
let txt = await res.text();
|
|
// strip the weird prefix )]}'\n
|
|
txt = txt.replace(/^\)\]\}'\s*/, "");
|
|
const json = JSON.parse(txt);
|
|
return json.icons.map(icon => icon.name);
|
|
}
|
|
|
|
// Fallback static array for immediate use (e.g. the "+" button and bookmark icons)
|
|
export const icons = [
|
|
'add',
|
|
'bookmark',
|
|
'star',
|
|
// …add any other icons your components expect synchronously…
|
|
]; |