@ichaingo/image 1.5.7 → 1.5.9
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/index.d.ts.map +1 -1
- package/dist/index.js +14 -14
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAc,EAAe,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7E,UAAU,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrF,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;CAClE;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAc,EAAe,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7E,UAAU,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrF,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;CAClE;;AAwED,wBAAiC"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as m } from "react/jsx-runtime";
|
|
3
3
|
import { memo as l, useState as p, useMemo as g } from "react";
|
|
4
4
|
import h from "next/image";
|
|
5
|
-
const
|
|
5
|
+
const _ = ({ src: t, width: a }) => {
|
|
6
6
|
if (typeof t != "string" || t.includes("default_image_bd46f9a3d8.png") || t.includes("default_f7fac00bf2.png"))
|
|
7
7
|
return t;
|
|
8
8
|
if (t.includes("ichainfo.com") || t.includes("ichatgo.ai")) {
|
|
@@ -10,37 +10,37 @@ const c = ({ src: t, width: a }) => {
|
|
|
10
10
|
return e.searchParams.set("format", "auto"), e.searchParams.set("width", a.toString()), e.toString();
|
|
11
11
|
}
|
|
12
12
|
return t;
|
|
13
|
-
},
|
|
14
|
-
src: t =
|
|
13
|
+
}, c = ({
|
|
14
|
+
src: t = `${process.env.NEXT_PUBLIC_CDN_URL}/uploads/default_image_bd46f9a3d8.png`,
|
|
15
15
|
width: a = 24,
|
|
16
16
|
height: e = 24,
|
|
17
17
|
alt: n,
|
|
18
18
|
objectFit: r = "cover",
|
|
19
|
-
errorSrc:
|
|
19
|
+
errorSrc: o = `${process.env.NEXT_PUBLIC_CDN_URL}/uploads/default_f7fac00bf2.png`,
|
|
20
20
|
...u
|
|
21
21
|
}) => {
|
|
22
|
-
const [
|
|
23
|
-
(!t || typeof t == "string" && t.trim() === "") && (t =
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
},
|
|
22
|
+
const [i, f] = p(!1);
|
|
23
|
+
(!t || typeof t == "string" && t.trim() === "") && (t = o);
|
|
24
|
+
const s = () => {
|
|
25
|
+
i || f(!0);
|
|
26
|
+
}, d = g(() => typeof t != "string" ? !1 : t.includes("ichainfo.com") || t.includes("ichatgo.ai"), [t]);
|
|
27
27
|
return /* @__PURE__ */ m(
|
|
28
28
|
h,
|
|
29
29
|
{
|
|
30
|
-
src:
|
|
30
|
+
src: i ? o : t,
|
|
31
31
|
alt: n || "",
|
|
32
32
|
"data-link": t,
|
|
33
33
|
width: a,
|
|
34
34
|
height: e,
|
|
35
35
|
suppressHydrationWarning: !0,
|
|
36
36
|
style: { objectFit: r },
|
|
37
|
-
onError:
|
|
38
|
-
loader:
|
|
37
|
+
onError: s,
|
|
38
|
+
loader: d ? _ : void 0,
|
|
39
39
|
unoptimized: !0,
|
|
40
40
|
...u
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
|
-
},
|
|
43
|
+
}, C = l(c);
|
|
44
44
|
export {
|
|
45
|
-
|
|
45
|
+
C as default
|
|
46
46
|
};
|