mimir-ui-kit 1.48.0 → 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.
|
@@ -26,4 +26,4 @@ export type TListPhoto = ComponentProps<'img'> & {
|
|
|
26
26
|
/**
|
|
27
27
|
* Компонент для отображения изображения с возможностью загрузки через callback
|
|
28
28
|
*/
|
|
29
|
-
export declare const ListPhoto: import('react').ForwardRefExoticComponent<Omit<TListPhoto, "ref"> & import('react').RefAttributes<HTMLImageElement
|
|
29
|
+
export declare const ListPhoto: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<Omit<TListPhoto, "ref"> & import('react').RefAttributes<HTMLImageElement>>>;
|
|
@@ -1,34 +1,42 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
const p =
|
|
4
|
-
(
|
|
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:
|
|
7
|
-
alt:
|
|
8
|
-
className:
|
|
9
|
-
isDownloadingImage:
|
|
10
|
-
loadImage:
|
|
11
|
-
...
|
|
12
|
-
} =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
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
|
-
ref:
|
|
25
|
-
src:
|
|
26
|
-
alt:
|
|
27
|
-
className:
|
|
28
|
-
...
|
|
32
|
+
ref: m,
|
|
33
|
+
src: s,
|
|
34
|
+
alt: g,
|
|
35
|
+
className: R,
|
|
36
|
+
...U
|
|
29
37
|
}
|
|
30
|
-
);
|
|
31
|
-
}
|
|
38
|
+
) : null;
|
|
39
|
+
})
|
|
32
40
|
);
|
|
33
41
|
p.displayName = "ListPhoto";
|
|
34
42
|
export {
|