@ichaingo/image 1.5.13 → 1.5.15

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.
@@ -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;;AA4ED,wBAAiC"}
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;;AA+ED,wBAAiC"}
package/dist/index.js CHANGED
@@ -1,48 +1,49 @@
1
1
  'use client';
2
- import { jsx as m } from "react/jsx-runtime";
3
- import { memo as l, useState as g, useMemo as _ } from "react";
2
+ import { jsx as l } from "react/jsx-runtime";
3
+ import { memo as m, useState as g, useMemo as _ } from "react";
4
4
  import h from "next/image";
5
- const i = new RegExp("http(s)?://{image_base_path}"), E = ({ src: e, width: a }) => {
6
- if (i.test(e))
7
- return e.replace(i, process.env.NEXT_PUBLIC_IMAGE_BASE_PATH || "");
5
+ const a = new RegExp("http(s)?://{image_base_path}"), E = ({ src: e, width: o }) => {
6
+ if (a.test(e))
7
+ return e.replace(a, process.env.NEXT_PUBLIC_IMAGES_URL || "");
8
8
  if (typeof e != "string" || e.includes("default_image_bd46f9a3d8.png") || e.includes("default_f7fac00bf2.png"))
9
9
  return e;
10
10
  if (e.includes("ichainfo.com") || e.includes("ichatgo.ai")) {
11
11
  const t = new URL(e.startsWith("//") ? "https:" + e : e);
12
- return t.searchParams.set("format", "auto"), t.searchParams.set("width", a.toString()), t.toString();
12
+ return t.searchParams.set("format", "auto"), t.searchParams.set("width", o.toString()), t.toString();
13
13
  }
14
14
  return e;
15
- }, c = ({
15
+ }, L = ({
16
16
  src: e = `${process.env.NEXT_PUBLIC_CDN_URL}/uploads/default_image_bd46f9a3d8.png`,
17
- width: a = 24,
17
+ width: o = 24,
18
18
  height: t = 24,
19
19
  alt: r,
20
- objectFit: s = "cover",
21
- errorSrc: o = `${process.env.NEXT_PUBLIC_CDN_URL}/uploads/default_f7fac00bf2.png`,
22
- ...u
20
+ objectFit: f = "cover",
21
+ errorSrc: n = `${process.env.NEXT_PUBLIC_CDN_URL}/uploads/default_f7fac00bf2.png`,
22
+ ...s
23
23
  }) => {
24
- const [n, f] = g(!1);
25
- (!e || typeof e == "string" && e.trim() === "") && (e = o);
26
- const d = () => {
27
- n || f(!0);
28
- }, p = _(() => typeof e != "string" ? !1 : e.includes("ichainfo.com") || e.includes("ichatgo.ai"), [e]);
29
- return /* @__PURE__ */ m(
24
+ typeof e == "string" && a.test(e) && (e = e.replace(a, process.env.NEXT_PUBLIC_IMAGES_URL || ""));
25
+ const [i, u] = g(!1);
26
+ (!e || typeof e == "string" && e.trim() === "") && (e = n);
27
+ const p = () => {
28
+ i || u(!0);
29
+ }, d = _(() => typeof e != "string" ? !1 : e.includes("ichainfo.com") || e.includes("ichatgo.ai"), [e]);
30
+ return /* @__PURE__ */ l(
30
31
  h,
31
32
  {
32
- src: n ? o : e,
33
+ src: i ? n : e,
33
34
  alt: r || "",
34
35
  "data-link": e,
35
- width: a,
36
+ width: o,
36
37
  height: t,
37
38
  suppressHydrationWarning: !0,
38
- style: { objectFit: s },
39
- onError: d,
40
- loader: p ? E : void 0,
39
+ style: { objectFit: f },
40
+ onError: p,
41
+ loader: d ? E : void 0,
41
42
  unoptimized: !0,
42
- ...u
43
+ ...s
43
44
  }
44
45
  );
45
- }, P = l(c);
46
+ }, c = m(L);
46
47
  export {
47
- P as default
48
+ c as default
48
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/image",
3
- "version": "1.5.13",
3
+ "version": "1.5.15",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",