mimir-ui-kit 1.48.1 → 1.48.2

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,36 +1,44 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { memo as d, forwardRef as h, useState as p, useEffect as s } from "react";
3
- const u = d(
4
- h((i, m) => {
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { memo as L, forwardRef as b, useState as h, useRef as l, useEffect as c } from "react";
3
+ const p = L(
4
+ b((f, m) => {
5
5
  const {
6
- src: o,
7
- alt: l = "image",
8
- className: n,
9
- isDownloadingImage: e = !1,
10
- loadImage: r,
11
- ...c
12
- } = i, [t, a] = p(o);
13
- return s(() => {
14
- o && !e && a(o);
15
- }, [o, e]), s(() => {
16
- e && r && r().then((f) => {
17
- a(f);
6
+ src: t,
7
+ alt: g = "image",
8
+ className: R,
9
+ isDownloadingImage: n = !1,
10
+ loadImage: u,
11
+ ...U
12
+ } = f, [s, a] = h(t), o = l(u);
13
+ o.current = u;
14
+ const r = l(null);
15
+ return c(() => {
16
+ t && !n && (r.current && (URL.revokeObjectURL(r.current), r.current = null), a(t));
17
+ }, [t, n]), c(() => {
18
+ if (!n || !o.current) return;
19
+ let i = !1;
20
+ return o.current().then((e) => {
21
+ i || a(() => (r.current && r.current !== e && (URL.revokeObjectURL(r.current), r.current = null), typeof e == "string" && e.startsWith("blob:") && (r.current = e), e));
18
22
  }).catch(() => {
19
23
  console.error("Error loading image");
20
- });
21
- }, [e, r]), t ? /* @__PURE__ */ g(
24
+ }), () => {
25
+ i = !0;
26
+ };
27
+ }, [n]), c(() => () => {
28
+ r.current && (URL.revokeObjectURL(r.current), r.current = null);
29
+ }, []), s ? /* @__PURE__ */ d(
22
30
  "img",
23
31
  {
24
32
  ref: m,
25
- src: t,
26
- alt: l,
27
- className: n,
28
- ...c
33
+ src: s,
34
+ alt: g,
35
+ className: R,
36
+ ...U
29
37
  }
30
38
  ) : null;
31
39
  })
32
40
  );
33
- u.displayName = "ListPhoto";
41
+ p.displayName = "ListPhoto";
34
42
  export {
35
- u as ListPhoto
43
+ p as ListPhoto
36
44
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.48.1",
4
+ "version": "1.48.2",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {