@versini/ui-icon-renderer 2.5.0 → 2.6.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/dist/{475.js → IconRenderer.js} +2 -1
- package/dist/data/icon-warning-light.js +8 -0
- package/dist/data/icon-warning.js +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -1
- package/package.json +3 -3
- package/dist/184.js +0 -28
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,28 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function useIconRenderer() {
|
|
6
|
+
const modRef = useRef(null);
|
|
7
|
+
const [mod, setMod] = useState(null);
|
|
8
|
+
useEffect(()=>{
|
|
9
|
+
/* v8 ignore start -- dynamic imports are not fully instrumented by V8 */ import("./IconRenderer.js").then((m)=>{
|
|
10
|
+
modRef.current = m;
|
|
11
|
+
setMod(m);
|
|
12
|
+
}).catch(()=>{});
|
|
13
|
+
/* v8 ignore stop */ }, []);
|
|
14
|
+
/* v8 ignore start -- dynamic imports are not fully instrumented by V8 */ const preload = useCallback((icons)=>{
|
|
15
|
+
const ensure = modRef.current ? Promise.resolve(modRef.current) : import("./IconRenderer.js").then((m)=>{
|
|
16
|
+
modRef.current = m;
|
|
17
|
+
setMod(m);
|
|
18
|
+
return m;
|
|
19
|
+
});
|
|
20
|
+
return ensure.then((m)=>m.preloadIcons(icons)).catch(()=>{});
|
|
21
|
+
}, []);
|
|
22
|
+
/* v8 ignore stop */ return [
|
|
23
|
+
mod?.IconRenderer ?? null,
|
|
24
|
+
preload
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { useIconRenderer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-icon-renderer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"clsx": ">=2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@versini/ui-icons": "4.
|
|
50
|
+
"@versini/ui-icons": "4.29.1"
|
|
51
51
|
},
|
|
52
52
|
"sideEffects": [
|
|
53
53
|
"**/*.css"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "a8dda653c1654ea4c1294ea7d5506ceb733bc696"
|
|
56
56
|
}
|
package/dist/184.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function useIconRenderer() {
|
|
6
|
-
const modRef = useRef(null);
|
|
7
|
-
const [mod, setMod] = useState(null);
|
|
8
|
-
useEffect(()=>{
|
|
9
|
-
/* v8 ignore start -- dynamic imports are not fully instrumented by V8 */ import("./475.js").then((mod) => ({ IconRenderer: mod.IconRenderer,preloadIcon: mod.preloadIcon,preloadIcons: mod.preloadIcons })).then((m)=>{
|
|
10
|
-
modRef.current = m;
|
|
11
|
-
setMod(m);
|
|
12
|
-
}).catch(()=>{});
|
|
13
|
-
/* v8 ignore stop */ }, []);
|
|
14
|
-
/* v8 ignore start -- dynamic imports are not fully instrumented by V8 */ const preload = useCallback((icons)=>{
|
|
15
|
-
const ensure = modRef.current ? Promise.resolve(modRef.current) : import("./475.js").then((mod) => ({ IconRenderer: mod.IconRenderer,preloadIcon: mod.preloadIcon,preloadIcons: mod.preloadIcons })).then((m)=>{
|
|
16
|
-
modRef.current = m;
|
|
17
|
-
setMod(m);
|
|
18
|
-
return m;
|
|
19
|
-
});
|
|
20
|
-
return ensure.then((m)=>m.preloadIcons(icons)).catch(()=>{});
|
|
21
|
-
}, []);
|
|
22
|
-
/* v8 ignore stop */ return [
|
|
23
|
-
mod?.IconRenderer ?? null,
|
|
24
|
-
preload
|
|
25
|
-
];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { useEffect, useIconRenderer, useState };
|