@firecms/ui 3.0.0-canary.95 → 3.0.0-canary.97
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/dist/icons/Icon.d.ts +1 -1
- package/dist/index.es.js +116 -1325
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +116 -1325
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/icons/Icon.tsx +2 -7
- package/src/icons/icon_keys.ts +114 -1301
- package/src/scripts/generateIconKeys.ts +20 -10
@@ -2,17 +2,27 @@ import fs from "fs";
|
|
2
2
|
import path from "path";
|
3
3
|
import { fileURLToPath } from "url";
|
4
4
|
|
5
|
+
const extractIconKeys = (cssData: string): string[] => {
|
6
|
+
const iconKeys: string[] = [];
|
7
|
+
console.log("cssData", cssData);
|
8
|
+
const regex = /\.mi-(.*?)::before/g;
|
9
|
+
let match;
|
10
|
+
|
11
|
+
while ((match = regex.exec(cssData)) !== null) {
|
12
|
+
if (match[1]) {
|
13
|
+
iconKeys.push(match[1].replaceAll("-", "_"));
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
return iconKeys;
|
18
|
+
};
|
19
|
+
|
5
20
|
//https://github.com/google/material-design-icons/blob/master/variablefont/MaterialSymbolsRounded%5BFILL%2CGRAD%2Copsz%2Cwght%5D.codepoints
|
6
|
-
export function generateIconKeys() {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
const words = lines.map((line) => line.split(" ")[0]);
|
12
|
-
const keys = words.filter(Boolean).filter((word) => word !== "addchart");
|
13
|
-
saveIconKeys(keys);
|
14
|
-
return keys;
|
15
|
-
});
|
21
|
+
export async function generateIconKeys() {
|
22
|
+
const cssData = await fs.promises.readFile("../../node_modules/material-icons/css/material-icons.css", 'utf-8');
|
23
|
+
const keys = extractIconKeys(cssData);
|
24
|
+
saveIconKeys(keys);
|
25
|
+
return keys;
|
16
26
|
}
|
17
27
|
|
18
28
|
function saveIconKeys(keys: string[]) {
|