@layers-app/shared 0.4.0 → 0.4.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/components/AnimatedFigurePage/useParallax.d.ts +2 -2
- package/dist/components/AppContainer/AppContainer.d.ts +6 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts +4 -1
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.js +22 -15
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +22 -21
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +48 -91
- package/dist/components/AppContainer/components/ToolbarNewButton.d.ts +7 -2
- package/dist/components/AppContainer/components/ToolbarNewButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolbarNewButton.js +14 -14
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts +3 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +96 -64
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +60 -47
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +35 -26
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +43 -36
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +7 -0
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +1 -0
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +17 -0
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts +4 -0
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +59 -20
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +28 -18
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +22 -18
- package/dist/components/ColorPicker/ColorPicker.d.ts +12 -11
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +11 -11
- package/dist/components/CommentComposer/useVirtualAnchor.d.ts +1 -1
- package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +43 -33
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FormViewer/helpers/conditions.d.ts +38 -38
- package/dist/components/FormViewer/helpers/helpers.d.ts +38 -38
- package/dist/components/FormViewer/helpers/steps.d.ts +38 -38
- package/dist/components/FormViewer/hooks/useActiveControl.d.ts +19 -19
- package/dist/components/FormViewer/hooks/useActiveStep.d.ts +38 -38
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +6 -0
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts.map +1 -1
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.js +4 -3
- package/dist/components/FormViewer/hooks/useFormMobile.d.ts +1 -1
- package/dist/components/FormViewer/hooks/useFormMobile.d.ts.map +1 -1
- package/dist/components/FormViewer/store/formStore.d.ts +248 -248
- package/dist/components/FormViewer/store/formStoreApi.d.ts +124 -124
- package/dist/components/FormViewer/store/selectors.d.ts +11655 -11655
- package/dist/components/FormViewer/types/form.d.ts +1 -1
- package/dist/components/FormViewer/types/form.d.ts.map +1 -1
- package/dist/components/FormViewer/types/schemes.d.ts +381 -6358
- package/dist/components/FormViewer/types/schemes.d.ts.map +1 -1
- package/dist/components/FormViewer/types/schemes.js +1 -1
- package/dist/components/GroupAvatar/index.d.ts +3 -1
- package/dist/components/GroupAvatar/index.d.ts.map +1 -1
- package/dist/components/GroupAvatar/index.js +24 -21
- package/dist/components/MediaLibrary/MediaLibraryRow.js +7 -7
- package/dist/components/NavMenu/NavMenu.d.ts +3 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/components/DnDProvider.d.ts +1 -1
- package/dist/components/NavMenu/components/DnDProvider.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts +7 -1
- package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuActionIcon.js +21 -23
- package/dist/components/NewColorPicker/components/Target.d.ts +3 -1
- package/dist/components/NewColorPicker/components/Target.d.ts.map +1 -1
- package/dist/components/NewColorPicker/components/Target.js +48 -43
- package/dist/components/Notification/Notification.js +3 -1
- package/dist/components/Notification/NotificationCard.d.ts +3 -1
- package/dist/components/Notification/NotificationCard.d.ts.map +1 -1
- package/dist/components/Notification/NotificationCard.js +87 -86
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +1 -1
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -1
- package/dist/components/OnboardingTour/OnboardingTourWrapper.js +70 -74
- package/dist/components/ProjectIcon/ProjectIcon.d.ts +7 -12
- package/dist/components/ProjectIcon/ProjectIcon.d.ts.map +1 -1
- package/dist/components/ProjectIcon/ProjectIcon.js +58 -60
- package/dist/components/UserAvatar/index.d.ts +2 -1
- package/dist/components/UserAvatar/index.d.ts.map +1 -1
- package/dist/components/UserAvatar/index.js +38 -35
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +3 -3
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts.map +1 -1
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +19 -18
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +17 -17
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +7 -7
- package/dist/config/envConfig.d.ts +8 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +21 -13
- package/dist/helpers/getFileIcons.d.ts.map +1 -1
- package/dist/helpers/getFileIcons.js +63 -45
- package/dist/helpers/getFileType.d.ts +1 -1
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +29 -8
- package/dist/helpers/getPartOfTheDay.d.ts +1 -1
- package/dist/helpers/offlineSuppression.d.ts +3 -0
- package/dist/helpers/offlineSuppression.d.ts.map +1 -0
- package/dist/helpers/offlineSuppression.js +8 -0
- package/dist/helpers/platform.d.ts +1 -1
- package/dist/helpers/platform.d.ts.map +1 -1
- package/dist/helpers/platform.js +5 -4
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +30 -29
- package/dist/hooks/useOutsideClick.d.ts +1 -1
- package/dist/hooks/useOutsideClick.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +336 -331
- package/dist/lang/locales/ui_en.json.js +1 -1
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/dist/node_modules/countries-and-timezones/esm/index.js +281 -4011
- package/package.json +13 -13
|
@@ -1,69 +1,101 @@
|
|
|
1
|
-
import { jsx as r,
|
|
2
|
-
import { memo as
|
|
3
|
-
import { TransformWrapper as
|
|
4
|
-
import { Box as
|
|
5
|
-
import { BaseLoader as
|
|
6
|
-
import { ShakaVideoPlayer as
|
|
7
|
-
import { ZOOM_CONFIG as
|
|
8
|
-
import { useGetPreviewUrl as
|
|
9
|
-
import { usePanning as
|
|
10
|
-
import { ErrorSection as
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
import { jsx as r, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { memo as P } from "react";
|
|
3
|
+
import { TransformWrapper as F, TransformComponent as T } from "react-zoom-pan-pinch";
|
|
4
|
+
import { Box as l } from "@mantine/core";
|
|
5
|
+
import { BaseLoader as U } from "../../Loaders/BaseLoader.js";
|
|
6
|
+
import { ShakaVideoPlayer as E } from "./ShakePlayer/ShakaPlayer.js";
|
|
7
|
+
import { ZOOM_CONFIG as a, TRANSFORM_COMPONENT_STYLES as u } from "../constants.js";
|
|
8
|
+
import { useGetPreviewUrl as O } from "../hooks/useGetPreviewUrl.js";
|
|
9
|
+
import { usePanning as b } from "../hooks/usePanning.js";
|
|
10
|
+
import { ErrorSection as p } from "./ErrorSection.js";
|
|
11
|
+
import { UnsupportedSection as x } from "./UnsupportedSection.js";
|
|
12
|
+
import i from "../styles.module.css.js";
|
|
13
|
+
const A = P(
|
|
14
|
+
({ onTransformed: S, attachment: e, isActive: s, ref: N }) => {
|
|
15
|
+
const {
|
|
16
|
+
isError: n,
|
|
17
|
+
setIsError: g,
|
|
18
|
+
fileUrl: o,
|
|
19
|
+
isFetching: m,
|
|
20
|
+
isVideo: d,
|
|
21
|
+
isPdf: t,
|
|
22
|
+
isAudio: f,
|
|
23
|
+
isSupported: c
|
|
24
|
+
} = O(e), y = b({ isFetching: m, isVideo: d });
|
|
25
|
+
return /* @__PURE__ */ r(
|
|
26
|
+
F,
|
|
27
|
+
{
|
|
28
|
+
panning: {
|
|
29
|
+
disabled: !0
|
|
30
|
+
},
|
|
31
|
+
onTransformed: S,
|
|
32
|
+
initialScale: a.initialScale,
|
|
33
|
+
minScale: a.minScale,
|
|
34
|
+
maxScale: a.maxScale,
|
|
35
|
+
limitToBounds: !0,
|
|
36
|
+
disabled: m || d || t || f || !c,
|
|
37
|
+
disablePadding: !0,
|
|
38
|
+
centerZoomedOut: !0,
|
|
39
|
+
ref: N,
|
|
40
|
+
wheel: {
|
|
41
|
+
disabled: !1,
|
|
42
|
+
step: a.wheelStep
|
|
43
|
+
},
|
|
44
|
+
doubleClick: {
|
|
45
|
+
disabled: !0
|
|
46
|
+
},
|
|
47
|
+
children: /* @__PURE__ */ r(
|
|
48
|
+
T,
|
|
49
|
+
{
|
|
50
|
+
wrapperStyle: u,
|
|
51
|
+
contentStyle: u,
|
|
52
|
+
wrapperProps: y,
|
|
53
|
+
children: c ? m ? /* @__PURE__ */ r(U, {}) : d ? /* @__PURE__ */ r(l, { className: i.videoContainer, children: /* @__PURE__ */ r(
|
|
54
|
+
E,
|
|
55
|
+
{
|
|
56
|
+
isActive: s,
|
|
57
|
+
autoPlay: s,
|
|
58
|
+
attachmentId: e.id
|
|
59
|
+
}
|
|
60
|
+
) }) : t ? n || !(e?.Url || o) ? /* @__PURE__ */ r(p, {}) : /* @__PURE__ */ r(l, { className: i.pdfContainer, children: /* @__PURE__ */ r(
|
|
61
|
+
"iframe",
|
|
62
|
+
{
|
|
63
|
+
title: e.originalFileName || "pdf",
|
|
64
|
+
src: e?.Url ?? o ?? "",
|
|
65
|
+
className: i.pdfFrame
|
|
66
|
+
}
|
|
67
|
+
) }) : f ? n || !(e?.Url || o) ? /* @__PURE__ */ r(p, {}) : /* @__PURE__ */ C(l, { className: i.audioContainer, children: [
|
|
68
|
+
/* @__PURE__ */ r(l, { className: i.audioName, children: e.originalFileName || "audio" }),
|
|
69
|
+
/* @__PURE__ */ r(
|
|
70
|
+
"audio",
|
|
46
71
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
src: e?.Url ?? o ?? "",
|
|
73
|
+
controls: !0,
|
|
74
|
+
autoPlay: s,
|
|
75
|
+
className: i.audioElement
|
|
50
76
|
}
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
77
|
+
)
|
|
78
|
+
] }) : n ? /* @__PURE__ */ r(p, {}) : /* @__PURE__ */ r(
|
|
79
|
+
"img",
|
|
80
|
+
{
|
|
81
|
+
onError: () => g(!0),
|
|
82
|
+
alt: e.originalFileName || "file",
|
|
83
|
+
className: i.imageContainer,
|
|
84
|
+
src: e?.Url ?? o ?? ""
|
|
85
|
+
}
|
|
86
|
+
) : /* @__PURE__ */ r(
|
|
87
|
+
x,
|
|
88
|
+
{
|
|
89
|
+
filename: e.originalFileName,
|
|
90
|
+
contentType: e.contentType
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
66
98
|
);
|
|
67
99
|
export {
|
|
68
|
-
|
|
100
|
+
A as GallerySlide
|
|
69
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/components/ModalHeader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModalHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/components/ModalHeader.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAMrD,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,WAAW,iEACK,gBAAgB,6CA6I5C,CAAC"}
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { memo as I, useRef as b } from "react";
|
|
3
3
|
import { useTranslation as A } from "react-i18next";
|
|
4
|
-
import { Box as C, Tooltip as
|
|
5
|
-
import { IconDownload as h, IconMinus as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
import { Box as C, Tooltip as t, ActionIcon as a, Flex as n, Text as p } from "@mantine/core";
|
|
5
|
+
import { IconDownload as h, IconMinus as F, IconPlus as R, IconX as k } from "@tabler/icons-react";
|
|
6
|
+
import { getFileIcons as T } from "../../../helpers/getFileIcons.js";
|
|
7
|
+
import { getFileType as j } from "../../../helpers/getFileType.js";
|
|
8
|
+
import { useAttachmentsGalleryContext as D } from "../AttachmentsGalleryContext.js";
|
|
9
|
+
import { zoomStep as f } from "../helpers.js";
|
|
10
|
+
import { useDownloadFile as M } from "../hooks/useDownloadFile.js";
|
|
11
|
+
import { useZoomReset as Z } from "../hooks/useZoomReset.js";
|
|
12
|
+
const J = I(
|
|
13
|
+
({ onClose: u, attachments: y }) => {
|
|
14
|
+
Z();
|
|
15
|
+
const { t: r } = A("ui"), c = b(null), { zoomPercentage: w, transformRefs: s, selectedIndex: i } = D(), l = y?.[i], x = () => {
|
|
16
|
+
f({
|
|
17
|
+
animationRef: c,
|
|
16
18
|
dir: "in",
|
|
17
|
-
activeRef:
|
|
19
|
+
activeRef: s.current[i]
|
|
18
20
|
});
|
|
19
21
|
}, v = () => {
|
|
20
|
-
|
|
21
|
-
animationRef:
|
|
22
|
+
f({
|
|
23
|
+
animationRef: c,
|
|
22
24
|
dir: "out",
|
|
23
|
-
activeRef:
|
|
25
|
+
activeRef: s.current[i]
|
|
24
26
|
});
|
|
25
|
-
}, { isVideo: z, isFetching:
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
+
}, { isVideo: z, isFetching: g, onDownload: m, isMobile: d } = M(l);
|
|
28
|
+
return /* @__PURE__ */ o(
|
|
27
29
|
C,
|
|
28
30
|
{
|
|
29
31
|
style: {
|
|
@@ -38,32 +40,43 @@ const V = I(
|
|
|
38
40
|
py: 8,
|
|
39
41
|
bg: "var(--mantine-color-dark-6)",
|
|
40
42
|
children: [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
d ? /* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.download"), children: /* @__PURE__ */ e(
|
|
44
|
+
a,
|
|
43
45
|
{
|
|
44
46
|
c: "var(--app-gallary-text)",
|
|
45
47
|
color: "gray",
|
|
46
48
|
size: "lg",
|
|
47
49
|
variant: "light",
|
|
48
|
-
loading:
|
|
49
|
-
onClick:
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
loading: g,
|
|
51
|
+
onClick: m,
|
|
52
|
+
children: /* @__PURE__ */ e(h, { size: 20 })
|
|
51
53
|
}
|
|
52
|
-
) }) : /* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
) }) : /* @__PURE__ */ o(n, { align: "center", gap: 8, ml: 6, miw: 0, children: [
|
|
55
|
+
l ? T(
|
|
56
|
+
j(
|
|
57
|
+
l.contentType ?? "",
|
|
58
|
+
!1,
|
|
59
|
+
l.originalFileName
|
|
60
|
+
),
|
|
61
|
+
!1,
|
|
62
|
+
20
|
|
63
|
+
) : null,
|
|
64
|
+
/* @__PURE__ */ e(p, { fw: 500, fz: 14, c: "var(--app-gallary-text)", truncate: !0, children: l?.originalFileName || "" })
|
|
65
|
+
] }),
|
|
66
|
+
z ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ o(n, { gap: "xs", children: [
|
|
67
|
+
/* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.zoomOut"), children: /* @__PURE__ */ e(
|
|
68
|
+
a,
|
|
56
69
|
{
|
|
57
70
|
c: "var(--app-gallary-text)",
|
|
58
71
|
color: "gray",
|
|
59
72
|
size: "lg",
|
|
60
73
|
variant: "light",
|
|
61
74
|
onClick: v,
|
|
62
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ e(F, { size: 20 })
|
|
63
76
|
}
|
|
64
77
|
) }),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
78
|
+
/* @__PURE__ */ o(
|
|
79
|
+
p,
|
|
67
80
|
{
|
|
68
81
|
fw: 500,
|
|
69
82
|
fz: 14,
|
|
@@ -71,45 +84,45 @@ const V = I(
|
|
|
71
84
|
miw: 50,
|
|
72
85
|
ta: "center",
|
|
73
86
|
children: [
|
|
74
|
-
|
|
87
|
+
w,
|
|
75
88
|
"%"
|
|
76
89
|
]
|
|
77
90
|
}
|
|
78
91
|
),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
92
|
+
/* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.zoomIn"), children: /* @__PURE__ */ e(
|
|
93
|
+
a,
|
|
81
94
|
{
|
|
82
95
|
c: "var(--app-gallary-text)",
|
|
83
96
|
color: "gray",
|
|
84
97
|
size: "lg",
|
|
85
98
|
variant: "light",
|
|
86
|
-
onClick:
|
|
87
|
-
children: /* @__PURE__ */
|
|
99
|
+
onClick: x,
|
|
100
|
+
children: /* @__PURE__ */ e(R, { size: 20 })
|
|
88
101
|
}
|
|
89
102
|
) })
|
|
90
103
|
] }),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
!
|
|
93
|
-
|
|
104
|
+
/* @__PURE__ */ o(n, { justify: "end", gap: "xs", children: [
|
|
105
|
+
!d && /* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.download"), children: /* @__PURE__ */ e(
|
|
106
|
+
a,
|
|
94
107
|
{
|
|
95
108
|
c: "var(--app-gallary-text)",
|
|
96
109
|
size: "lg",
|
|
97
110
|
color: "gray",
|
|
98
111
|
variant: "light",
|
|
99
|
-
loading:
|
|
100
|
-
onClick:
|
|
101
|
-
children: /* @__PURE__ */
|
|
112
|
+
loading: g,
|
|
113
|
+
onClick: m,
|
|
114
|
+
children: /* @__PURE__ */ e(h, { size: 20 })
|
|
102
115
|
}
|
|
103
116
|
) }),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
117
|
+
/* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.close"), children: /* @__PURE__ */ e(
|
|
118
|
+
a,
|
|
106
119
|
{
|
|
107
120
|
c: "var(--app-gallary-text)",
|
|
108
121
|
size: "lg",
|
|
109
122
|
color: "gray",
|
|
110
123
|
variant: "light",
|
|
111
|
-
onClick:
|
|
112
|
-
children: /* @__PURE__ */
|
|
124
|
+
onClick: u,
|
|
125
|
+
children: /* @__PURE__ */ e(k, { size: 20 })
|
|
113
126
|
}
|
|
114
127
|
) })
|
|
115
128
|
] })
|
|
@@ -119,5 +132,5 @@ const V = I(
|
|
|
119
132
|
}
|
|
120
133
|
);
|
|
121
134
|
export {
|
|
122
|
-
|
|
135
|
+
J as ModalHeader
|
|
123
136
|
};
|
|
@@ -6,6 +6,6 @@ type BaseProps = {
|
|
|
6
6
|
stylesContainer?: React.CSSProperties;
|
|
7
7
|
classNameContainer?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const ShakaVideoPlayer: ({ attachmentId, autoPlay, isActive, loader, stylesContainer, classNameContainer, }: BaseProps) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const ShakaVideoPlayer: ({ attachmentId, autoPlay, isActive, loader, stylesContainer, classNameContainer, }: BaseProps) => string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=ShakaPlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShakaPlayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ShakaPlayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.tsx"],"names":[],"mappings":"AAsBA,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,oFAO9B,SAAS,yVA6CX,CAAC"}
|
|
@@ -1,44 +1,53 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as d, useEffect as g } from "react";
|
|
2
3
|
import a from "clsx";
|
|
3
|
-
import
|
|
4
|
-
import { BaseLoader as
|
|
5
|
-
import { ErrorSection as
|
|
6
|
-
import { useShakePlayer as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
9
|
-
attachmentId:
|
|
10
|
-
autoPlay:
|
|
11
|
-
isActive:
|
|
12
|
-
loader:
|
|
13
|
-
stylesContainer:
|
|
4
|
+
import h from "shaka-player-react";
|
|
5
|
+
import { BaseLoader as k } from "../../../Loaders/BaseLoader.js";
|
|
6
|
+
import { ErrorSection as v } from "../ErrorSection.js";
|
|
7
|
+
import { useShakePlayer as S } from "./useShakePlayer.js";
|
|
8
|
+
import i from "./ShakaPlayer.module.css.js";
|
|
9
|
+
const q = ({
|
|
10
|
+
attachmentId: l,
|
|
11
|
+
autoPlay: o,
|
|
12
|
+
isActive: n,
|
|
13
|
+
loader: f,
|
|
14
|
+
stylesContainer: m,
|
|
14
15
|
classNameContainer: p
|
|
15
16
|
}) => {
|
|
16
|
-
const { isError:
|
|
17
|
-
autoPlay:
|
|
18
|
-
isActive:
|
|
19
|
-
attachmentId:
|
|
20
|
-
});
|
|
21
|
-
return
|
|
17
|
+
const { isError: c, containerRef: u, vodUrl: e } = S({
|
|
18
|
+
autoPlay: o,
|
|
19
|
+
isActive: n,
|
|
20
|
+
attachmentId: l
|
|
21
|
+
}), t = d(null);
|
|
22
|
+
return g(() => {
|
|
23
|
+
const s = t.current?.player?.getNetworkingEngine?.();
|
|
24
|
+
s && s.registerRequestFilter((E, y) => {
|
|
25
|
+
y.allowCrossSiteCredentials = !0;
|
|
26
|
+
});
|
|
27
|
+
}, [e]), c ? /* @__PURE__ */ r(v, {}) : e ? /* @__PURE__ */ r(
|
|
22
28
|
"div",
|
|
23
29
|
{
|
|
24
|
-
ref:
|
|
25
|
-
style:
|
|
30
|
+
ref: u,
|
|
31
|
+
style: m,
|
|
26
32
|
className: a(
|
|
27
|
-
|
|
33
|
+
i["vod-player"],
|
|
28
34
|
"shaka-vod-player-wrapper",
|
|
29
35
|
p
|
|
30
36
|
),
|
|
31
37
|
children: /* @__PURE__ */ r(
|
|
32
|
-
|
|
38
|
+
h,
|
|
33
39
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
ref: t,
|
|
41
|
+
autoPlay: o ?? !0,
|
|
42
|
+
className: a(i["vod-player__player"]),
|
|
43
|
+
src: e,
|
|
44
|
+
crossOrigin: "use-credentials",
|
|
45
|
+
controls: !0
|
|
37
46
|
}
|
|
38
47
|
)
|
|
39
48
|
}
|
|
40
|
-
) :
|
|
49
|
+
) : f ?? /* @__PURE__ */ r(k, {});
|
|
41
50
|
};
|
|
42
51
|
export {
|
|
43
|
-
|
|
52
|
+
q as ShakaVideoPlayer
|
|
44
53
|
};
|
|
@@ -3,7 +3,7 @@ export declare const useShakePlayer: ({ attachmentId, isActive, autoPlay, }: {
|
|
|
3
3
|
isActive?: boolean;
|
|
4
4
|
autoPlay?: boolean;
|
|
5
5
|
}) => {
|
|
6
|
-
containerRef: import("react").RefObject<HTMLDivElement>;
|
|
6
|
+
containerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
7
7
|
isError: boolean;
|
|
8
8
|
vodUrl: string | null;
|
|
9
9
|
};
|
package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShakePlayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useShakePlayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,cAAc,GAAI,uCAI5B;IACD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;;;;CAoHA,CAAC"}
|
|
@@ -1,54 +1,61 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useState as w, useRef as c, useEffect as m } from "react";
|
|
2
|
+
import { getEnvConfig as y } from "../../../../config/envConfig.js";
|
|
3
|
+
const R = () => {
|
|
4
|
+
const e = y().apiBaseUrl || "";
|
|
5
|
+
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
6
|
+
}, C = ({
|
|
7
|
+
attachmentId: e,
|
|
4
8
|
isActive: i,
|
|
5
9
|
autoPlay: a
|
|
6
10
|
}) => {
|
|
7
|
-
const [l, f] =
|
|
8
|
-
if (!
|
|
11
|
+
const [l, f] = w(null), [E, d] = w(!1), s = c(null), u = c(!0), n = c(null), r = c(null), g = async () => {
|
|
12
|
+
if (!e)
|
|
9
13
|
return;
|
|
10
14
|
r.current && r.current.abort();
|
|
11
|
-
const
|
|
12
|
-
r.current =
|
|
15
|
+
const t = new AbortController();
|
|
16
|
+
r.current = t;
|
|
13
17
|
try {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const o = R(), p = await fetch(
|
|
19
|
+
`${o}/v1/attachments/${e}/vod`,
|
|
20
|
+
{
|
|
21
|
+
method: "GET",
|
|
22
|
+
credentials: "include",
|
|
23
|
+
headers: {
|
|
24
|
+
Accept: "*/*"
|
|
25
|
+
},
|
|
26
|
+
signal: t.signal
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
if (!p.ok) throw new Error("Failed to get VOD URL");
|
|
30
|
+
const b = await p.json();
|
|
31
|
+
if (!u.current || t.signal.aborted) return;
|
|
32
|
+
if (b.ready) {
|
|
33
|
+
const h = o || window.location.origin, U = new URL(b.url, h).toString();
|
|
34
|
+
f(U);
|
|
28
35
|
} else
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
n.current = setTimeout(() => {
|
|
37
|
+
g();
|
|
31
38
|
}, 3e3);
|
|
32
|
-
} catch (
|
|
33
|
-
if (
|
|
39
|
+
} catch (o) {
|
|
40
|
+
if (o instanceof Error && o.name === "AbortError" || !u.current || t.signal.aborted) return;
|
|
34
41
|
d(!0);
|
|
35
42
|
}
|
|
36
43
|
};
|
|
37
|
-
return
|
|
38
|
-
if (u.current = !0, f(null), d(!1),
|
|
39
|
-
return
|
|
40
|
-
u.current = !1,
|
|
44
|
+
return m(() => {
|
|
45
|
+
if (u.current = !0, f(null), d(!1), n.current && (clearTimeout(n.current), n.current = null), r.current && (r.current.abort(), r.current = null), !!e)
|
|
46
|
+
return g(), () => {
|
|
47
|
+
u.current = !1, n.current && (clearTimeout(n.current), n.current = null), r.current && (r.current.abort(), r.current = null);
|
|
41
48
|
};
|
|
42
|
-
}, [
|
|
49
|
+
}, [e]), m(() => {
|
|
43
50
|
if (!l || !s.current) return;
|
|
44
|
-
const
|
|
51
|
+
const t = s.current.querySelector(
|
|
45
52
|
"video"
|
|
46
53
|
);
|
|
47
|
-
|
|
48
|
-
console.error("Ошибка при воспроизведении видео:",
|
|
49
|
-
}) :
|
|
50
|
-
}, [i, l, a]), { containerRef: s, isError:
|
|
54
|
+
t && (i ? a !== !1 && t.play().catch((o) => {
|
|
55
|
+
console.error("Ошибка при воспроизведении видео:", o);
|
|
56
|
+
}) : t.pause());
|
|
57
|
+
}, [i, l, a]), { containerRef: s, isError: E, vodUrl: l };
|
|
51
58
|
};
|
|
52
59
|
export {
|
|
53
|
-
|
|
60
|
+
C as useShakePlayer
|
|
54
61
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedSection.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/components/UnsupportedSection.tsx"],"names":[],"mappings":"AAOA,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,GAAI,2BAA2B,KAAK,4CAuBlE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as o } from "react-i18next";
|
|
3
|
+
import { Flex as c, Stack as i, Text as r } from "@mantine/core";
|
|
4
|
+
import { getFileIcons as s } from "../../../helpers/getFileIcons.js";
|
|
5
|
+
import { getFileType as f } from "../../../helpers/getFileType.js";
|
|
6
|
+
const y = ({ filename: e, contentType: a }) => {
|
|
7
|
+
const { t: l } = o("ui"), n = f(a ?? "", !1, e);
|
|
8
|
+
return /* @__PURE__ */ t(c, { align: "center", justify: "center", children: /* @__PURE__ */ p(i, { align: "center", gap: "xs", maw: 480, p: "xl", children: [
|
|
9
|
+
s(n, !1, 48),
|
|
10
|
+
/* @__PURE__ */ t(r, { c: "var(--app-gallary-text)", fz: "lg", fw: 600, children: l("gallery.unsupportedTitle") }),
|
|
11
|
+
e ? /* @__PURE__ */ t(r, { c: "var(--app-gallary-text)", fz: "sm", ta: "center", fs: "italic", children: e }) : null,
|
|
12
|
+
/* @__PURE__ */ t(r, { c: "var(--app-gallary-text)", fz: "sm", ta: "center", children: l("gallery.unsupportedBody") })
|
|
13
|
+
] }) });
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
y as UnsupportedSection
|
|
17
|
+
};
|
|
@@ -5,5 +5,9 @@ export declare const useGetPreviewUrl: (attachment: IFileResponse) => {
|
|
|
5
5
|
isError: boolean;
|
|
6
6
|
setIsError: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
7
7
|
isVideo: boolean;
|
|
8
|
+
isPdf: boolean;
|
|
9
|
+
isImage: boolean;
|
|
10
|
+
isAudio: boolean;
|
|
11
|
+
isSupported: boolean;
|
|
8
12
|
};
|
|
9
13
|
//# sourceMappingURL=useGetPreviewUrl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetPreviewUrl.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGetPreviewUrl.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAOrD,eAAO,MAAM,gBAAgB,GAAI,YAAY,aAAa;;;;;;;;;;CA4GzD,CAAC"}
|