@layers-app/shared 0.4.4 → 0.4.6
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/AnimatedFigurePage.module.css.js +13 -13
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +72 -79
- package/dist/components/AppContainer/AppContainer.module.css.js +6 -6
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +24 -22
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +46 -37
- package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
- package/dist/components/AppContainer/components/Header.js +6 -5
- package/dist/components/AppContainer/components/Main.js +4 -4
- package/dist/components/AppContainer/components/SidebarToggleButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/SidebarToggleButton.js +25 -16
- package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
- package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolSidebar.js +161 -128
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +131 -121
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +59 -56
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AppShell/AppShell.module.css.js +5 -5
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +33 -33
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +37 -37
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +54 -36
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +2 -0
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +84 -37
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts +8 -0
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/helpers.js +22 -17
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.js +28 -25
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +36 -41
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +7 -7
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +138 -84
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +24 -14
- package/dist/components/BouncingLogo/BouncingLogo.d.ts +1 -3
- package/dist/components/BouncingLogo/BouncingLogo.d.ts.map +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.js +14 -20
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -8
- package/dist/components/Chat/CallMessage/CallMessage.module.css.js +15 -0
- package/dist/components/Chat/CallMessage/index.d.ts +21 -0
- package/dist/components/Chat/CallMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/CallMessage/index.js +49 -0
- package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +9 -0
- package/dist/components/Chat/ChatBubble/index.d.ts +14 -0
- package/dist/components/Chat/ChatBubble/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatBubble/index.js +32 -0
- package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +17 -0
- package/dist/components/Chat/ChatHeader/index.d.ts +42 -0
- package/dist/components/Chat/ChatHeader/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatHeader/index.js +78 -0
- package/dist/components/Chat/ChatInput/ChatInput.module.css.js +49 -0
- package/dist/components/Chat/ChatInput/index.d.ts +74 -0
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/index.js +288 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts +3 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.js +49 -0
- package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +15 -0
- package/dist/components/Chat/ChatLayout/index.d.ts +17 -0
- package/dist/components/Chat/ChatLayout/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatLayout/index.js +43 -0
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +21 -0
- package/dist/components/Chat/ChatMessage/index.d.ts +47 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatMessage/index.js +206 -0
- package/dist/components/Chat/ChatPill/ChatPill.module.css.js +11 -0
- package/dist/components/Chat/ChatPill/index.d.ts +12 -0
- package/dist/components/Chat/ChatPill/index.d.ts.map +1 -0
- package/dist/components/Chat/ChatPill/index.js +21 -0
- package/dist/components/Chat/DayMeta/index.d.ts +11 -0
- package/dist/components/Chat/DayMeta/index.d.ts.map +1 -0
- package/dist/components/Chat/DayMeta/index.js +9 -0
- package/dist/components/Chat/DialogItem/DialogItem.module.css.js +17 -0
- package/dist/components/Chat/DialogItem/index.d.ts +41 -0
- package/dist/components/Chat/DialogItem/index.d.ts.map +1 -0
- package/dist/components/Chat/DialogItem/index.js +107 -0
- package/dist/components/Chat/DialogList/DialogList.module.css.js +7 -0
- package/dist/components/Chat/DialogList/index.d.ts +11 -0
- package/dist/components/Chat/DialogList/index.d.ts.map +1 -0
- package/dist/components/Chat/DialogList/index.js +19 -0
- package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +13 -0
- package/dist/components/Chat/MediaDocument/index.d.ts +15 -0
- package/dist/components/Chat/MediaDocument/index.d.ts.map +1 -0
- package/dist/components/Chat/MediaDocument/index.js +73 -0
- package/dist/components/Chat/MessageActions/MessageActions.module.css.js +7 -0
- package/dist/components/Chat/MessageActions/index.d.ts +23 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageActions/index.js +68 -0
- package/dist/components/Chat/MessageAuthor/index.d.ts +20 -0
- package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageAuthor/index.js +36 -0
- package/dist/components/Chat/MessageForward/MessageForward.module.css.js +7 -0
- package/dist/components/Chat/MessageForward/index.d.ts +13 -0
- package/dist/components/Chat/MessageForward/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageForward/index.js +30 -0
- package/dist/components/Chat/MessageList/MessageList.module.css.js +21 -0
- package/dist/components/Chat/MessageList/index.d.ts +39 -0
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageList/index.js +159 -0
- package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +13 -0
- package/dist/components/Chat/MessageMeta/index.d.ts +16 -0
- package/dist/components/Chat/MessageMeta/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageMeta/index.js +33 -0
- package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +15 -0
- package/dist/components/Chat/MessageReactions/index.d.ts +32 -0
- package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageReactions/index.js +72 -0
- package/dist/components/Chat/MessageReply/MessageReply.module.css.js +15 -0
- package/dist/components/Chat/MessageReply/index.d.ts +15 -0
- package/dist/components/Chat/MessageReply/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageReply/index.js +40 -0
- package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +11 -0
- package/dist/components/Chat/MessageStatus/index.d.ts +14 -0
- package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -0
- package/dist/components/Chat/MessageStatus/index.js +68 -0
- package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +11 -0
- package/dist/components/Chat/ServiceMessage/index.d.ts +13 -0
- package/dist/components/Chat/ServiceMessage/index.d.ts.map +1 -0
- package/dist/components/Chat/ServiceMessage/index.js +21 -0
- package/dist/components/Chat/UnreadSeparator/index.d.ts +11 -0
- package/dist/components/Chat/UnreadSeparator/index.d.ts.map +1 -0
- package/dist/components/Chat/UnreadSeparator/index.js +13 -0
- package/dist/components/Chat/colors.d.ts +7 -0
- package/dist/components/Chat/colors.d.ts.map +1 -0
- package/dist/components/Chat/colors.js +30 -0
- package/dist/components/Chat/icons.d.ts +9 -0
- package/dist/components/Chat/icons.d.ts.map +1 -0
- package/dist/components/Chat/icons.js +49 -0
- package/dist/components/Chat/index.d.ts +24 -0
- package/dist/components/Chat/index.d.ts.map +1 -0
- package/dist/components/Chat/mock-data.d.ts +32 -0
- package/dist/components/Chat/mock-data.d.ts.map +1 -0
- package/dist/components/Chat/types.d.ts +159 -0
- package/dist/components/Chat/types.d.ts.map +1 -0
- package/dist/components/CircleColorPicker/CircleColorPicker.d.ts.map +1 -1
- package/dist/components/CircleColorPicker/CircleColorPicker.js +17 -15
- package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
- package/dist/components/ColorPicker/ColorPicker.module.css.js +32 -26
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +81 -68
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +75 -70
- package/dist/components/ColorPicker/icons.js +5 -5
- package/dist/components/ColorPicker/types.d.ts +6 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +53 -11
- package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
- package/dist/components/ColorPicker/useRecentColors.js +43 -20
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/types.js +9 -0
- package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
- package/dist/components/Copyright/Copyright.module.css.js +1 -1
- package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +73 -72
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +23 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +126 -88
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +28 -25
- package/dist/components/EntityIcon.d.ts +1 -0
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +90 -33
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/ErrorPage/components/Error403.d.ts +5 -1
- package/dist/components/ErrorPage/components/Error403.d.ts.map +1 -1
- package/dist/components/ErrorPage/components/Error403.js +25 -21
- package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.d.ts +5 -1
- package/dist/components/ErrorPage/index.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.js +17 -10
- package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +135 -161
- package/dist/components/FilePicker/FilePicker.module.css.js +8 -12
- package/dist/components/FilePicker/FilePickerGallery.js +13 -13
- package/dist/components/FilePicker/FilePickerGiphy.js +4 -4
- package/dist/components/FilePicker/FilePickerGoogleDrive.js +3 -3
- package/dist/components/FilePicker/FilePickerUnsplash.js +18 -18
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +55 -47
- package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
- package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
- package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
- package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
- package/dist/components/Loaders/styles.module.css.js +6 -6
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
- package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +23 -23
- package/dist/components/MusicPlayerBar/components/HoverActions.js +28 -28
- package/dist/components/NavMenu/NavMenu.d.ts +7 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/NavMenu.js +54 -44
- package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +84 -84
- package/dist/components/NavMenu/types.d.ts +4 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
- package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
- package/dist/components/Notification/Notification.module.css.js +1 -1
- package/dist/components/PillTabs/PillTabs.d.ts +19 -0
- package/dist/components/PillTabs/PillTabs.d.ts.map +1 -0
- package/dist/components/PillTabs/PillTabs.js +50 -0
- package/dist/components/PillTabs/PillTabs.module.css.js +11 -0
- package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
- package/dist/components/SettingsSection/styles.module.css.js +1 -1
- package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
- package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
- package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +16 -14
- package/dist/components/modals/RemoveConfirmModal.js +1 -1
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/config/envConfig.d.ts +2 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +41 -37
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.d.ts +15 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +114 -72
- package/dist/helpers/showNotifications.module.css.js +16 -4
- package/dist/hooks/useUiPref.d.ts +2 -0
- package/dist/hooks/useUiPref.d.ts.map +1 -0
- package/dist/hooks/useUiPref.js +80 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +588 -527
- package/dist/lang/locales/ui_en.json.js +5 -5
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/docs/README.md +499 -499
- package/package.json +78 -75
|
@@ -1,45 +1,52 @@
|
|
|
1
1
|
import { jsx as r, jsxs as C } from "react/jsx-runtime";
|
|
2
2
|
import { memo as P } from "react";
|
|
3
3
|
import { TransformWrapper as F, TransformComponent as T } from "react-zoom-pan-pinch";
|
|
4
|
-
import { Box as
|
|
4
|
+
import { Box as a } from "@mantine/core";
|
|
5
5
|
import { BaseLoader as U } from "../../Loaders/BaseLoader.js";
|
|
6
6
|
import { ShakaVideoPlayer as E } from "./ShakePlayer/ShakaPlayer.js";
|
|
7
|
-
import {
|
|
7
|
+
import { TRANSFORM_COMPONENT_STYLES as p, ZOOM_CONFIG as s } from "../constants.js";
|
|
8
8
|
import { useGetPreviewUrl as O } from "../hooks/useGetPreviewUrl.js";
|
|
9
9
|
import { usePanning as b } from "../hooks/usePanning.js";
|
|
10
|
-
import { ErrorSection as
|
|
10
|
+
import { ErrorSection as t } from "./ErrorSection.js";
|
|
11
11
|
import { UnsupportedSection as x } from "./UnsupportedSection.js";
|
|
12
12
|
import i from "../styles.module.css.js";
|
|
13
|
-
const
|
|
14
|
-
({ onTransformed: S, attachment: e, isActive:
|
|
13
|
+
const h = P(
|
|
14
|
+
({ onTransformed: S, attachment: e, isActive: n, ref: N }) => {
|
|
15
15
|
const {
|
|
16
|
-
isError:
|
|
16
|
+
isError: m,
|
|
17
17
|
setIsError: g,
|
|
18
18
|
fileUrl: o,
|
|
19
|
-
isFetching:
|
|
20
|
-
isVideo:
|
|
21
|
-
isPdf:
|
|
22
|
-
isAudio:
|
|
23
|
-
isSupported:
|
|
24
|
-
} = O(e), y = b({ isFetching:
|
|
25
|
-
return /* @__PURE__ */ r(
|
|
19
|
+
isFetching: l,
|
|
20
|
+
isVideo: f,
|
|
21
|
+
isPdf: c,
|
|
22
|
+
isAudio: u,
|
|
23
|
+
isSupported: d
|
|
24
|
+
} = O(e), y = b({ isFetching: l, isVideo: f });
|
|
25
|
+
return f && !l && d ? /* @__PURE__ */ r("div", { style: p, children: /* @__PURE__ */ r(a, { className: i.videoContainer, children: /* @__PURE__ */ r(
|
|
26
|
+
E,
|
|
27
|
+
{
|
|
28
|
+
isActive: n,
|
|
29
|
+
autoPlay: n,
|
|
30
|
+
attachmentId: e.id
|
|
31
|
+
}
|
|
32
|
+
) }) }) : /* @__PURE__ */ r(
|
|
26
33
|
F,
|
|
27
34
|
{
|
|
28
35
|
panning: {
|
|
29
36
|
disabled: !0
|
|
30
37
|
},
|
|
31
38
|
onTransformed: S,
|
|
32
|
-
initialScale:
|
|
33
|
-
minScale:
|
|
34
|
-
maxScale:
|
|
39
|
+
initialScale: s.initialScale,
|
|
40
|
+
minScale: s.minScale,
|
|
41
|
+
maxScale: s.maxScale,
|
|
35
42
|
limitToBounds: !0,
|
|
36
|
-
disabled:
|
|
43
|
+
disabled: l || c || u || !d,
|
|
37
44
|
disablePadding: !0,
|
|
38
45
|
centerZoomedOut: !0,
|
|
39
46
|
ref: N,
|
|
40
47
|
wheel: {
|
|
41
48
|
disabled: !1,
|
|
42
|
-
step:
|
|
49
|
+
step: s.wheelStep
|
|
43
50
|
},
|
|
44
51
|
doubleClick: {
|
|
45
52
|
disabled: !0
|
|
@@ -47,35 +54,28 @@ const A = P(
|
|
|
47
54
|
children: /* @__PURE__ */ r(
|
|
48
55
|
T,
|
|
49
56
|
{
|
|
50
|
-
wrapperStyle:
|
|
51
|
-
contentStyle:
|
|
57
|
+
wrapperStyle: p,
|
|
58
|
+
contentStyle: p,
|
|
52
59
|
wrapperProps: y,
|
|
53
|
-
children:
|
|
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(
|
|
60
|
+
children: d ? l ? /* @__PURE__ */ r(U, {}) : c ? m || !(e?.Url || o) ? /* @__PURE__ */ r(t, {}) : /* @__PURE__ */ r(a, { className: i.pdfContainer, children: /* @__PURE__ */ r(
|
|
61
61
|
"iframe",
|
|
62
62
|
{
|
|
63
63
|
title: e.originalFileName || "pdf",
|
|
64
64
|
src: e?.Url ?? o ?? "",
|
|
65
65
|
className: i.pdfFrame
|
|
66
66
|
}
|
|
67
|
-
) }) :
|
|
68
|
-
/* @__PURE__ */ r(
|
|
67
|
+
) }) : u ? m || !(e?.Url || o) ? /* @__PURE__ */ r(t, {}) : /* @__PURE__ */ C(a, { className: i.audioContainer, children: [
|
|
68
|
+
/* @__PURE__ */ r(a, { className: i.audioName, children: e.originalFileName || "audio" }),
|
|
69
69
|
/* @__PURE__ */ r(
|
|
70
70
|
"audio",
|
|
71
71
|
{
|
|
72
72
|
src: e?.Url ?? o ?? "",
|
|
73
73
|
controls: !0,
|
|
74
|
-
autoPlay:
|
|
74
|
+
autoPlay: n,
|
|
75
75
|
className: i.audioElement
|
|
76
76
|
}
|
|
77
77
|
)
|
|
78
|
-
] }) :
|
|
78
|
+
] }) : m ? /* @__PURE__ */ r(t, {}) : /* @__PURE__ */ r(
|
|
79
79
|
"img",
|
|
80
80
|
{
|
|
81
81
|
onError: () => g(!0),
|
|
@@ -97,5 +97,5 @@ const A = P(
|
|
|
97
97
|
}
|
|
98
98
|
);
|
|
99
99
|
export {
|
|
100
|
-
|
|
100
|
+
h as GallerySlide
|
|
101
101
|
};
|
|
@@ -1 +1 @@
|
|
|
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;AAQrD,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,WAAW,iEACK,gBAAgB,
|
|
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;AAQrD,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,WAAW,iEACK,gBAAgB,6CA2I5C,CAAC"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { memo as v, useRef as I } from "react";
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { Box as
|
|
5
|
-
import { IconDownload as
|
|
3
|
+
import { useTranslation as F } from "react-i18next";
|
|
4
|
+
import { Box as C, Tooltip as t, ActionIcon as i, Flex as s, Text as u } from "@mantine/core";
|
|
5
|
+
import { IconDownload as f, IconMinus as N, IconPlus as R, IconX as k } from "@tabler/icons-react";
|
|
6
6
|
import { getFileIcons as T } from "../../../helpers/getFileIcons.js";
|
|
7
|
-
import { getFileType as
|
|
8
|
-
import { useAttachmentsGalleryContext as
|
|
9
|
-
import { zoomStep as
|
|
7
|
+
import { getFileType as Z } from "../../../helpers/getFileType.js";
|
|
8
|
+
import { useAttachmentsGalleryContext as j } from "../AttachmentsGalleryContext.js";
|
|
9
|
+
import { getAttachmentFormat as D, zoomStep as p } from "../helpers.js";
|
|
10
10
|
import { useDownloadFile as M } from "../hooks/useDownloadFile.js";
|
|
11
|
-
import { useZoomReset as
|
|
11
|
+
import { useZoomReset as O } from "../hooks/useZoomReset.js";
|
|
12
12
|
import n from "../styles.module.css.js";
|
|
13
|
-
const
|
|
13
|
+
const U = v(
|
|
14
14
|
({ onClose: w, attachments: z }) => {
|
|
15
|
-
|
|
16
|
-
const { t: r } =
|
|
17
|
-
|
|
15
|
+
O();
|
|
16
|
+
const { t: r } = F("ui"), c = I(null), { zoomPercentage: y, transformRefs: m, selectedIndex: a } = j(), o = z?.[a], b = () => {
|
|
17
|
+
p({
|
|
18
18
|
animationRef: c,
|
|
19
19
|
dir: "in",
|
|
20
20
|
activeRef: m.current[a]
|
|
21
21
|
});
|
|
22
|
-
},
|
|
23
|
-
|
|
22
|
+
}, x = () => {
|
|
23
|
+
p({
|
|
24
24
|
animationRef: c,
|
|
25
25
|
dir: "out",
|
|
26
26
|
activeRef: m.current[a]
|
|
27
27
|
});
|
|
28
|
-
}, {
|
|
28
|
+
}, { isFetching: d, onDownload: g, isMobile: h } = M(o), A = o ? D(o).isImage : !1;
|
|
29
29
|
return /* @__PURE__ */ l(
|
|
30
|
-
|
|
30
|
+
C,
|
|
31
31
|
{
|
|
32
32
|
style: {
|
|
33
33
|
borderRadius: 8,
|
|
@@ -41,19 +41,19 @@ const L = v(
|
|
|
41
41
|
py: 8,
|
|
42
42
|
bg: "var(--mantine-color-dark-6)",
|
|
43
43
|
children: [
|
|
44
|
-
h ? /* @__PURE__ */ e(
|
|
45
|
-
|
|
44
|
+
h ? /* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.download"), children: /* @__PURE__ */ e(
|
|
45
|
+
i,
|
|
46
46
|
{
|
|
47
47
|
className: n.headerAction,
|
|
48
48
|
size: "lg",
|
|
49
49
|
variant: "subtle",
|
|
50
50
|
loading: d,
|
|
51
|
-
onClick:
|
|
52
|
-
children: /* @__PURE__ */ e(
|
|
51
|
+
onClick: g,
|
|
52
|
+
children: /* @__PURE__ */ e(f, { size: 20 })
|
|
53
53
|
}
|
|
54
54
|
) }) : /* @__PURE__ */ l(s, { align: "center", gap: 8, ml: 6, miw: 0, children: [
|
|
55
55
|
o ? T(
|
|
56
|
-
|
|
56
|
+
Z(
|
|
57
57
|
o.contentType ?? "",
|
|
58
58
|
!1,
|
|
59
59
|
o.originalFileName
|
|
@@ -61,21 +61,21 @@ const L = v(
|
|
|
61
61
|
!1,
|
|
62
62
|
20
|
|
63
63
|
) : null,
|
|
64
|
-
/* @__PURE__ */ e(
|
|
64
|
+
/* @__PURE__ */ e(u, { fw: 500, fz: 14, c: "var(--app-gallary-text)", truncate: !0, children: o?.originalFileName || "" })
|
|
65
65
|
] }),
|
|
66
|
-
A ? /* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */ e(
|
|
68
|
-
|
|
66
|
+
A ? /* @__PURE__ */ l(s, { gap: "xs", children: [
|
|
67
|
+
/* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.zoomOut"), children: /* @__PURE__ */ e(
|
|
68
|
+
i,
|
|
69
69
|
{
|
|
70
70
|
className: n.headerAction,
|
|
71
71
|
size: "lg",
|
|
72
72
|
variant: "subtle",
|
|
73
|
-
onClick:
|
|
73
|
+
onClick: x,
|
|
74
74
|
children: /* @__PURE__ */ e(N, { size: 20 })
|
|
75
75
|
}
|
|
76
76
|
) }),
|
|
77
77
|
/* @__PURE__ */ l(
|
|
78
|
-
|
|
78
|
+
u,
|
|
79
79
|
{
|
|
80
80
|
fw: 500,
|
|
81
81
|
fz: 14,
|
|
@@ -88,31 +88,31 @@ const L = v(
|
|
|
88
88
|
]
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
|
-
/* @__PURE__ */ e(
|
|
92
|
-
|
|
91
|
+
/* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.zoomIn"), children: /* @__PURE__ */ e(
|
|
92
|
+
i,
|
|
93
93
|
{
|
|
94
94
|
className: n.headerAction,
|
|
95
95
|
size: "lg",
|
|
96
96
|
variant: "subtle",
|
|
97
|
-
onClick:
|
|
97
|
+
onClick: b,
|
|
98
98
|
children: /* @__PURE__ */ e(R, { size: 20 })
|
|
99
99
|
}
|
|
100
100
|
) })
|
|
101
|
-
] }),
|
|
101
|
+
] }) : /* @__PURE__ */ e("div", {}),
|
|
102
102
|
/* @__PURE__ */ l(s, { justify: "end", gap: "xs", children: [
|
|
103
|
-
!h && /* @__PURE__ */ e(
|
|
104
|
-
|
|
103
|
+
!h && /* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.download"), children: /* @__PURE__ */ e(
|
|
104
|
+
i,
|
|
105
105
|
{
|
|
106
106
|
className: n.headerAction,
|
|
107
107
|
size: "lg",
|
|
108
108
|
variant: "subtle",
|
|
109
109
|
loading: d,
|
|
110
|
-
onClick:
|
|
111
|
-
children: /* @__PURE__ */ e(
|
|
110
|
+
onClick: g,
|
|
111
|
+
children: /* @__PURE__ */ e(f, { size: 20 })
|
|
112
112
|
}
|
|
113
113
|
) }),
|
|
114
|
-
/* @__PURE__ */ e(
|
|
115
|
-
|
|
114
|
+
/* @__PURE__ */ e(t, { withArrow: !0, label: r("gallery.close"), children: /* @__PURE__ */ e(
|
|
115
|
+
i,
|
|
116
116
|
{
|
|
117
117
|
className: n.headerAction,
|
|
118
118
|
size: "lg",
|
|
@@ -128,5 +128,5 @@ const L = v(
|
|
|
128
128
|
}
|
|
129
129
|
);
|
|
130
130
|
export {
|
|
131
|
-
|
|
131
|
+
U as ModalHeader
|
|
132
132
|
};
|
|
@@ -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":"AA2BA,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,yVAoEX,CAAC"}
|
|
@@ -1,52 +1,70 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { BaseLoader as
|
|
6
|
-
import { ErrorSection as
|
|
7
|
-
import { useShakePlayer as
|
|
8
|
-
import
|
|
2
|
+
import { useRef as g, useEffect as k } from "react";
|
|
3
|
+
import s from "clsx";
|
|
4
|
+
import S from "shaka-player-react";
|
|
5
|
+
import { BaseLoader as w } from "../../../Loaders/BaseLoader.js";
|
|
6
|
+
import { ErrorSection as R } from "../ErrorSection.js";
|
|
7
|
+
import { useShakePlayer as _ } from "./useShakePlayer.js";
|
|
8
|
+
import n from "./ShakaPlayer.module.css.js";
|
|
9
9
|
const q = ({
|
|
10
|
-
attachmentId:
|
|
11
|
-
autoPlay:
|
|
12
|
-
isActive:
|
|
13
|
-
loader:
|
|
14
|
-
stylesContainer:
|
|
15
|
-
classNameContainer:
|
|
10
|
+
attachmentId: p,
|
|
11
|
+
autoPlay: t,
|
|
12
|
+
isActive: f,
|
|
13
|
+
loader: u,
|
|
14
|
+
stylesContainer: d,
|
|
15
|
+
classNameContainer: y
|
|
16
16
|
}) => {
|
|
17
|
-
const { isError:
|
|
18
|
-
autoPlay:
|
|
19
|
-
isActive:
|
|
20
|
-
attachmentId:
|
|
21
|
-
}),
|
|
22
|
-
return
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
const { fallbackToRawAttachment: e, isError: v, containerRef: E, vodUrl: o, rawUrl: i } = _({
|
|
18
|
+
autoPlay: t,
|
|
19
|
+
isActive: f,
|
|
20
|
+
attachmentId: p
|
|
21
|
+
}), l = g(null);
|
|
22
|
+
return k(() => {
|
|
23
|
+
const a = l.current?.player, c = a?.getNetworkingEngine?.();
|
|
24
|
+
if (!c) return;
|
|
25
|
+
c.registerRequestFilter((N, h) => {
|
|
26
|
+
h.allowCrossSiteCredentials = !0;
|
|
26
27
|
});
|
|
27
|
-
|
|
28
|
+
const m = () => {
|
|
29
|
+
e();
|
|
30
|
+
};
|
|
31
|
+
return a?.addEventListener?.("error", m), () => {
|
|
32
|
+
a?.removeEventListener?.("error", m);
|
|
33
|
+
};
|
|
34
|
+
}, [e, o]), v ? /* @__PURE__ */ r(R, {}) : !o && !i ? u ?? /* @__PURE__ */ r(w, {}) : /* @__PURE__ */ r(
|
|
28
35
|
"div",
|
|
29
36
|
{
|
|
30
|
-
ref:
|
|
31
|
-
style:
|
|
32
|
-
className:
|
|
33
|
-
|
|
37
|
+
ref: E,
|
|
38
|
+
style: d,
|
|
39
|
+
className: s(
|
|
40
|
+
n["vod-player"],
|
|
34
41
|
"shaka-vod-player-wrapper",
|
|
35
|
-
|
|
42
|
+
y
|
|
36
43
|
),
|
|
37
|
-
children: /* @__PURE__ */ r(
|
|
38
|
-
|
|
44
|
+
children: o ? /* @__PURE__ */ r(
|
|
45
|
+
S,
|
|
39
46
|
{
|
|
40
|
-
ref:
|
|
41
|
-
autoPlay:
|
|
42
|
-
className:
|
|
43
|
-
src:
|
|
47
|
+
ref: l,
|
|
48
|
+
autoPlay: t ?? !0,
|
|
49
|
+
className: s(n["vod-player__player"]),
|
|
50
|
+
src: o,
|
|
44
51
|
crossOrigin: "use-credentials",
|
|
45
|
-
controls: !0
|
|
52
|
+
controls: !0,
|
|
53
|
+
onError: e
|
|
54
|
+
}
|
|
55
|
+
) : /* @__PURE__ */ r(
|
|
56
|
+
"video",
|
|
57
|
+
{
|
|
58
|
+
autoPlay: t ?? !0,
|
|
59
|
+
className: s(n["vod-player__player"]),
|
|
60
|
+
src: i ?? void 0,
|
|
61
|
+
crossOrigin: "use-credentials",
|
|
62
|
+
controls: !0,
|
|
63
|
+
onError: e
|
|
46
64
|
}
|
|
47
65
|
)
|
|
48
66
|
}
|
|
49
|
-
)
|
|
67
|
+
);
|
|
50
68
|
};
|
|
51
69
|
export {
|
|
52
70
|
q as ShakaVideoPlayer
|
package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
"vod-player": "_vod-
|
|
3
|
-
"vod-player__player": "_vod-
|
|
1
|
+
const _ = {
|
|
2
|
+
"vod-player": "_vod-player_11682_1",
|
|
3
|
+
"vod-player__player": "_vod-player__player_11682_25"
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_ as default
|
|
7
7
|
};
|
|
@@ -4,7 +4,9 @@ export declare const useShakePlayer: ({ attachmentId, isActive, autoPlay, }: {
|
|
|
4
4
|
autoPlay?: boolean;
|
|
5
5
|
}) => {
|
|
6
6
|
containerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
7
|
+
fallbackToRawAttachment: () => Promise<void>;
|
|
7
8
|
isError: boolean;
|
|
8
9
|
vodUrl: string | null;
|
|
10
|
+
rawUrl: string | null;
|
|
9
11
|
};
|
|
10
12
|
//# sourceMappingURL=useShakePlayer.d.ts.map
|
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":"AAkDA,eAAO,MAAM,cAAc,GAAI,uCAI5B;IACD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;;;;;;CAqLA,CAAC"}
|
|
@@ -1,61 +1,108 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { getEnvConfig as
|
|
3
|
-
const
|
|
4
|
-
const e =
|
|
1
|
+
import { useState as R, useRef as f, useCallback as A, useEffect as C } from "react";
|
|
2
|
+
import { getEnvConfig as S } from "../../../../config/envConfig.js";
|
|
3
|
+
const U = () => {
|
|
4
|
+
const e = S().apiBaseUrl || "";
|
|
5
5
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
6
|
-
},
|
|
6
|
+
}, E = async (e) => {
|
|
7
|
+
const s = U();
|
|
8
|
+
return (await fetch(`${s}/v1/auth/refresh`, {
|
|
9
|
+
method: "POST",
|
|
10
|
+
credentials: "include",
|
|
11
|
+
signal: e
|
|
12
|
+
})).ok;
|
|
13
|
+
}, $ = async (e, s) => {
|
|
14
|
+
const l = await fetch(e, {
|
|
15
|
+
...s,
|
|
16
|
+
credentials: "include"
|
|
17
|
+
});
|
|
18
|
+
return l.status !== 401 && l.status !== 403 || !await E(s.signal) || s.signal.aborted ? l : fetch(e, {
|
|
19
|
+
...s,
|
|
20
|
+
credentials: "include"
|
|
21
|
+
});
|
|
22
|
+
}, q = () => !!window.layersDesktop || (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1") && window.location.port !== "3000", V = ({
|
|
7
23
|
attachmentId: e,
|
|
8
|
-
isActive:
|
|
9
|
-
autoPlay:
|
|
24
|
+
isActive: s,
|
|
25
|
+
autoPlay: l
|
|
10
26
|
}) => {
|
|
11
|
-
const [
|
|
27
|
+
const [w, g] = R(null), [b, p] = R(null), [T, d] = R(!1), m = f(null), c = f(!0), o = f(null), t = f(null), u = f(null), a = A(
|
|
28
|
+
(r) => {
|
|
29
|
+
if (!e || u.current || !c.current || r.aborted) return;
|
|
30
|
+
const h = U() || window.location.origin, i = new URL(
|
|
31
|
+
`/v1/attachments/${e}`,
|
|
32
|
+
h
|
|
33
|
+
).toString();
|
|
34
|
+
u.current = i, g(null), p(i);
|
|
35
|
+
},
|
|
36
|
+
[e]
|
|
37
|
+
), k = A(async () => {
|
|
38
|
+
if (!e || u.current) return;
|
|
39
|
+
o.current && (clearTimeout(o.current), o.current = null), t.current && t.current.abort();
|
|
40
|
+
const r = new AbortController();
|
|
41
|
+
t.current = r, d(!1);
|
|
42
|
+
try {
|
|
43
|
+
await E(r.signal), a(r.signal);
|
|
44
|
+
} catch (n) {
|
|
45
|
+
if (n instanceof Error && n.name === "AbortError" || !c.current || r.signal.aborted) return;
|
|
46
|
+
d(!0);
|
|
47
|
+
}
|
|
48
|
+
}, [e, a]), y = async () => {
|
|
12
49
|
if (!e)
|
|
13
50
|
return;
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
51
|
+
t.current && t.current.abort();
|
|
52
|
+
const r = new AbortController();
|
|
53
|
+
t.current = r;
|
|
17
54
|
try {
|
|
18
|
-
const
|
|
19
|
-
`${
|
|
55
|
+
const n = U(), h = await $(
|
|
56
|
+
`${n}/v1/attachments/${e}/vod`,
|
|
20
57
|
{
|
|
21
58
|
method: "GET",
|
|
22
|
-
credentials: "include",
|
|
23
59
|
headers: {
|
|
24
60
|
Accept: "*/*"
|
|
25
61
|
},
|
|
26
|
-
signal:
|
|
62
|
+
signal: r.signal
|
|
27
63
|
}
|
|
28
64
|
);
|
|
29
|
-
if (!
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
65
|
+
if (!h.ok) {
|
|
66
|
+
await a(r.signal);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const i = await h.json();
|
|
70
|
+
if (!c.current || r.signal.aborted) return;
|
|
71
|
+
const v = n || window.location.origin;
|
|
72
|
+
if (i.ready) {
|
|
73
|
+
const B = new URL(i.url, v).toString();
|
|
74
|
+
if (u.current) return;
|
|
75
|
+
p(null), g(B);
|
|
35
76
|
} else
|
|
36
|
-
|
|
37
|
-
|
|
77
|
+
a(r.signal), o.current = setTimeout(() => {
|
|
78
|
+
y();
|
|
38
79
|
}, 3e3);
|
|
39
|
-
} catch (
|
|
40
|
-
if (
|
|
80
|
+
} catch (n) {
|
|
81
|
+
if (n instanceof Error && n.name === "AbortError" || !c.current || r.signal.aborted) return;
|
|
41
82
|
d(!0);
|
|
42
83
|
}
|
|
43
84
|
};
|
|
44
|
-
return
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
85
|
+
return C(() => {
|
|
86
|
+
if (c.current = !0, g(null), p(null), d(!1), u.current = null, o.current && (clearTimeout(o.current), o.current = null), t.current && (t.current.abort(), t.current = null), !!e) {
|
|
87
|
+
if (q()) {
|
|
88
|
+
const r = new AbortController();
|
|
89
|
+
t.current = r, a(r.signal);
|
|
90
|
+
} else
|
|
91
|
+
y();
|
|
92
|
+
return () => {
|
|
93
|
+
c.current = !1, o.current && (clearTimeout(o.current), o.current = null), t.current && (t.current.abort(), t.current = null), u.current = null;
|
|
48
94
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
95
|
+
}
|
|
96
|
+
}, [e]), C(() => {
|
|
97
|
+
if (!w && !b || !m.current) return;
|
|
98
|
+
const r = m.current.querySelector(
|
|
52
99
|
"video"
|
|
53
100
|
);
|
|
54
|
-
|
|
55
|
-
console.error("Ошибка при воспроизведении видео:",
|
|
56
|
-
}) :
|
|
57
|
-
}, [
|
|
101
|
+
r && (s ? l !== !1 && r.play().catch((n) => {
|
|
102
|
+
console.error("Ошибка при воспроизведении видео:", n);
|
|
103
|
+
}) : r.pause());
|
|
104
|
+
}, [s, w, b, l]), { containerRef: m, fallbackToRawAttachment: k, isError: T, vodUrl: w, rawUrl: b };
|
|
58
105
|
};
|
|
59
106
|
export {
|
|
60
|
-
|
|
107
|
+
V as useShakePlayer
|
|
61
108
|
};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
2
|
import { ReactZoomPanPinchContentRef } from 'react-zoom-pan-pinch';
|
|
3
|
+
import { IFileResponse } from '../../types/files';
|
|
4
|
+
export declare const getAttachmentFormat: (attachment: Pick<IFileResponse, "contentType" | "originalFileName">) => {
|
|
5
|
+
isVideo: boolean;
|
|
6
|
+
isPdf: boolean;
|
|
7
|
+
isImage: boolean;
|
|
8
|
+
isAudio: boolean;
|
|
9
|
+
isSupported: boolean;
|
|
10
|
+
};
|
|
3
11
|
export declare const animateTransform: ({ instance, from, to, duration, animationRef, }: {
|
|
4
12
|
instance: ReactZoomPanPinchContentRef["instance"];
|
|
5
13
|
from: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentsGalleryModal/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentsGalleryModal/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,eAAO,MAAM,mBAAmB,GAC9B,YAAY,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,kBAAkB,CAAC;;;;;;CAkBpE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,iDAM9B;IACD,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,gBAAgB,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC/C,SAuBA,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,mCAItB;IACD,GAAG,EAAE,IAAI,GAAG,KAAK,CAAC;IAClB,SAAS,EAAE,2BAA2B,CAAC;IACvC,YAAY,EAAE,gBAAgB,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC/C,SA2BA,CAAC"}
|