@layers-app/shared 0.4.0 → 0.4.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.
Files changed (156) hide show
  1. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
  2. package/dist/components/AnimatedFigurePage/useParallax.d.ts +2 -2
  3. package/dist/components/AppContainer/AppContainer.d.ts +6 -1
  4. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  5. package/dist/components/AppContainer/components/AppSidebarButton.d.ts +4 -1
  6. package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
  7. package/dist/components/AppContainer/components/AppSidebarButton.js +22 -15
  8. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
  9. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +22 -21
  10. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  11. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +48 -91
  12. package/dist/components/AppContainer/components/ToolbarNewButton.d.ts +7 -2
  13. package/dist/components/AppContainer/components/ToolbarNewButton.d.ts.map +1 -1
  14. package/dist/components/AppContainer/components/ToolbarNewButton.js +14 -14
  15. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts +3 -1
  16. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
  17. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +96 -64
  18. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  19. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +76 -67
  20. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts +1 -1
  21. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
  22. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +35 -26
  23. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +1 -1
  24. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
  25. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +43 -36
  26. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +7 -0
  27. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +1 -0
  28. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +17 -0
  29. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts +4 -0
  30. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
  31. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +59 -20
  32. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +34 -22
  33. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  34. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +22 -18
  35. package/dist/components/ColorPicker/ColorPicker.d.ts +12 -11
  36. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  37. package/dist/components/ColorPicker/ColorPicker.js +109 -83
  38. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
  39. package/dist/components/ColorPicker/ColorPickerList.js +62 -63
  40. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  41. package/dist/components/ColorPicker/ColorPickerToolbar.js +128 -120
  42. package/dist/components/ColorPicker/icons.js +3 -3
  43. package/dist/components/ColorPicker/types.d.ts +3 -1
  44. package/dist/components/ColorPicker/types.d.ts.map +1 -1
  45. package/dist/components/ColorPicker/types.js +11 -5
  46. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  47. package/dist/components/CommentComposer/CommentEditorHotkeys.js +55 -45
  48. package/dist/components/CommentComposer/useVirtualAnchor.d.ts +1 -1
  49. package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -1
  50. package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -1
  51. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  52. package/dist/components/EntityIcon.d.ts.map +1 -1
  53. package/dist/components/EntityIcon.js +43 -33
  54. package/dist/components/FilePicker/FilePicker.d.ts +3 -1
  55. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  56. package/dist/components/FilePicker/FilePicker.js +44 -42
  57. package/dist/components/FilePicker/FilePickerUpload.d.ts +3 -1
  58. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  59. package/dist/components/FilePicker/FilePickerUpload.js +28 -28
  60. package/dist/components/FormViewer/helpers/conditions.d.ts +38 -38
  61. package/dist/components/FormViewer/helpers/helpers.d.ts +38 -38
  62. package/dist/components/FormViewer/helpers/steps.d.ts +38 -38
  63. package/dist/components/FormViewer/hooks/useActiveControl.d.ts +19 -19
  64. package/dist/components/FormViewer/hooks/useActiveStep.d.ts +38 -38
  65. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +6 -0
  66. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts.map +1 -1
  67. package/dist/components/FormViewer/hooks/useFormGlobalTheme.js +4 -3
  68. package/dist/components/FormViewer/hooks/useFormMobile.d.ts +1 -1
  69. package/dist/components/FormViewer/hooks/useFormMobile.d.ts.map +1 -1
  70. package/dist/components/FormViewer/store/formStore.d.ts +248 -248
  71. package/dist/components/FormViewer/store/formStoreApi.d.ts +124 -124
  72. package/dist/components/FormViewer/store/selectors.d.ts +11655 -11655
  73. package/dist/components/FormViewer/types/form.d.ts +1 -1
  74. package/dist/components/FormViewer/types/form.d.ts.map +1 -1
  75. package/dist/components/FormViewer/types/schemes.d.ts +381 -6358
  76. package/dist/components/FormViewer/types/schemes.d.ts.map +1 -1
  77. package/dist/components/FormViewer/types/schemes.js +1 -1
  78. package/dist/components/GroupAvatar/index.d.ts +3 -1
  79. package/dist/components/GroupAvatar/index.d.ts.map +1 -1
  80. package/dist/components/GroupAvatar/index.js +24 -21
  81. package/dist/components/LanguagePicker/LanguagePicker.d.ts +13 -3
  82. package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
  83. package/dist/components/LanguagePicker/LanguagePicker.js +65 -43
  84. package/dist/components/MediaLibrary/MediaLibraryRow.js +7 -7
  85. package/dist/components/NavMenu/NavMenu.d.ts +3 -1
  86. package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
  87. package/dist/components/NavMenu/components/DnDProvider.d.ts +1 -1
  88. package/dist/components/NavMenu/components/DnDProvider.d.ts.map +1 -1
  89. package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts +7 -1
  90. package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts.map +1 -1
  91. package/dist/components/NavMenu/components/NavMenuActionIcon.js +21 -23
  92. package/dist/components/NewColorPicker/components/Target.d.ts +3 -1
  93. package/dist/components/NewColorPicker/components/Target.d.ts.map +1 -1
  94. package/dist/components/NewColorPicker/components/Target.js +48 -43
  95. package/dist/components/Notification/Notification.js +3 -1
  96. package/dist/components/Notification/NotificationCard.d.ts +3 -1
  97. package/dist/components/Notification/NotificationCard.d.ts.map +1 -1
  98. package/dist/components/Notification/NotificationCard.js +87 -86
  99. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts +6 -1
  100. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts.map +1 -1
  101. package/dist/components/OnboardingTour/OnboardingTourFooter.js +39 -21
  102. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +4 -5
  103. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -1
  104. package/dist/components/OnboardingTour/OnboardingTourWrapper.js +83 -119
  105. package/dist/components/OnboardingTour/index.d.ts +1 -1
  106. package/dist/components/OnboardingTour/index.d.ts.map +1 -1
  107. package/dist/components/OnboardingTour/useOnboardingTour.d.ts +4 -0
  108. package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -1
  109. package/dist/components/OnboardingTour/useOnboardingTour.js +65 -36
  110. package/dist/components/ProjectIcon/ProjectIcon.d.ts +7 -12
  111. package/dist/components/ProjectIcon/ProjectIcon.d.ts.map +1 -1
  112. package/dist/components/ProjectIcon/ProjectIcon.js +58 -60
  113. package/dist/components/UserAvatar/index.d.ts +2 -1
  114. package/dist/components/UserAvatar/index.d.ts.map +1 -1
  115. package/dist/components/UserAvatar/index.js +42 -32
  116. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +3 -3
  117. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts.map +1 -1
  118. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +19 -18
  119. package/dist/components/WorkspaceMenu/WorkspaceItem.js +17 -17
  120. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +7 -7
  121. package/dist/config/brand.d.ts +2 -0
  122. package/dist/config/brand.d.ts.map +1 -1
  123. package/dist/config/brand.js +28 -22
  124. package/dist/config/envConfig.d.ts +12 -0
  125. package/dist/config/envConfig.d.ts.map +1 -1
  126. package/dist/config/envConfig.js +21 -13
  127. package/dist/helpers/getFileIcons.d.ts.map +1 -1
  128. package/dist/helpers/getFileIcons.js +63 -45
  129. package/dist/helpers/getFileType.d.ts +1 -1
  130. package/dist/helpers/getFileType.d.ts.map +1 -1
  131. package/dist/helpers/getFileType.js +29 -8
  132. package/dist/helpers/getPartOfTheDay.d.ts +1 -1
  133. package/dist/helpers/offlineSuppression.d.ts +3 -0
  134. package/dist/helpers/offlineSuppression.d.ts.map +1 -0
  135. package/dist/helpers/offlineSuppression.js +8 -0
  136. package/dist/helpers/platform.d.ts +1 -1
  137. package/dist/helpers/platform.d.ts.map +1 -1
  138. package/dist/helpers/platform.js +5 -4
  139. package/dist/helpers/showNotifications.d.ts.map +1 -1
  140. package/dist/helpers/showNotifications.js +30 -29
  141. package/dist/hooks/useOutsideClick.d.ts +1 -1
  142. package/dist/hooks/useOutsideClick.d.ts.map +1 -1
  143. package/dist/index.css +1 -1
  144. package/dist/index.d.ts +1 -0
  145. package/dist/index.d.ts.map +1 -1
  146. package/dist/index.js +462 -451
  147. package/dist/lang/locales/ui_en.json.js +1 -1
  148. package/dist/lang/locales/ui_es.json.js +1 -1
  149. package/dist/lang/locales/ui_ru.json.js +1 -1
  150. package/dist/node_modules/countries-and-timezones/esm/index.js +281 -4011
  151. package/dist/store/featureProgress.d.ts +3 -6
  152. package/dist/store/featureProgress.d.ts.map +1 -1
  153. package/dist/store/featureProgress.js +56 -22
  154. package/dist/store/plansModal.d.ts.map +1 -1
  155. package/dist/store/plansModal.js +10 -10
  156. package/package.json +13 -13
@@ -1,69 +1,101 @@
1
- import { jsx as r, Fragment as a } from "react/jsx-runtime";
2
- import { memo as u, forwardRef as g } from "react";
3
- import { TransformWrapper as h, TransformComponent as C } from "react-zoom-pan-pinch";
4
- import { Box as N } from "@mantine/core";
5
- import { BaseLoader as O } from "../../Loaders/BaseLoader.js";
6
- import { ShakaVideoPlayer as P } from "./ShakePlayer/ShakaPlayer.js";
7
- import { ZOOM_CONFIG as o, TRANSFORM_COMPONENT_STYLES as t } from "../constants.js";
8
- import { useGetPreviewUrl as b } from "../hooks/useGetPreviewUrl.js";
9
- import { usePanning as w } from "../hooks/usePanning.js";
10
- import { ErrorSection as y } from "./ErrorSection.js";
11
- import m from "../styles.module.css.js";
12
- const k = u(
13
- g(
14
- ({ onTransformed: n, attachment: e, isActive: s }, d) => {
15
- const { isError: p, setIsError: c, fileUrl: f, isFetching: i, isVideo: l } = b(e), S = w({ isFetching: i, isVideo: l });
16
- return /* @__PURE__ */ r(
17
- h,
18
- {
19
- panning: {
20
- disabled: !0
21
- },
22
- onTransformed: n,
23
- initialScale: o.initialScale,
24
- minScale: o.minScale,
25
- maxScale: o.maxScale,
26
- limitToBounds: !0,
27
- disabled: i || l,
28
- disablePadding: !0,
29
- centerZoomedOut: !0,
30
- ref: d,
31
- wheel: {
32
- disabled: !1,
33
- step: o.wheelStep
34
- },
35
- doubleClick: {
36
- disabled: !0
37
- },
38
- children: /* @__PURE__ */ r(
39
- C,
40
- {
41
- wrapperStyle: t,
42
- contentStyle: t,
43
- wrapperProps: S,
44
- children: i ? /* @__PURE__ */ r(O, {}) : /* @__PURE__ */ r(a, { children: l ? /* @__PURE__ */ r(N, { className: m.videoContainer, children: /* @__PURE__ */ r(
45
- P,
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
- isActive: s,
48
- autoPlay: !1,
49
- attachmentId: e.id
72
+ src: e?.Url ?? o ?? "",
73
+ controls: !0,
74
+ autoPlay: s,
75
+ className: i.audioElement
50
76
  }
51
- ) }) : /* @__PURE__ */ r(a, { children: p ? /* @__PURE__ */ r(y, {}) : /* @__PURE__ */ r(
52
- "img",
53
- {
54
- onError: () => c(!0),
55
- alt: e.originalFileName || "file",
56
- className: m.imageContainer,
57
- src: e?.Url ?? f ?? ""
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
- k as GallerySlide
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":"AAMA,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,6CAgI5C,CAAC"}
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,6CAwI5C,CAAC"}
@@ -1,30 +1,33 @@
1
- import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
- import { memo as I, useRef as b } from "react";
3
- import { useTranslation as A } from "react-i18next";
4
- import { Box as C, Tooltip as l, ActionIcon as o, Text as m, Flex as p } from "@mantine/core";
5
- import { IconDownload as h, IconMinus as R, IconPlus as k, IconX as F } from "@tabler/icons-react";
6
- import { useAttachmentsGalleryContext as T } from "../AttachmentsGalleryContext.js";
7
- import { zoomStep as u } from "../helpers.js";
8
- import { useDownloadFile as j } from "../hooks/useDownloadFile.js";
9
- import { useZoomReset as D } from "../hooks/useZoomReset.js";
10
- const V = I(
11
- ({ onClose: f, attachments: y }) => {
12
- D();
13
- const { t: e } = A("ui"), i = b(null), { zoomPercentage: x, transformRefs: n, selectedIndex: a } = T(), c = y?.[a], w = () => {
14
- u({
15
- animationRef: i,
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import { memo as v, useRef as I } from "react";
3
+ import { useTranslation as C } from "react-i18next";
4
+ import { Box as F, Tooltip as i, ActionIcon as t, Flex as s, Text as g } from "@mantine/core";
5
+ import { IconDownload as p, IconMinus as N, 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
+ import n from "../styles.module.css.js";
13
+ const L = v(
14
+ ({ onClose: w, attachments: z }) => {
15
+ Z();
16
+ const { t: r } = C("ui"), c = I(null), { zoomPercentage: y, transformRefs: m, selectedIndex: a } = D(), o = z?.[a], x = () => {
17
+ f({
18
+ animationRef: c,
16
19
  dir: "in",
17
- activeRef: n.current[a]
20
+ activeRef: m.current[a]
18
21
  });
19
- }, v = () => {
20
- u({
21
- animationRef: i,
22
+ }, b = () => {
23
+ f({
24
+ animationRef: c,
22
25
  dir: "out",
23
- activeRef: n.current[a]
26
+ activeRef: m.current[a]
24
27
  });
25
- }, { isVideo: z, isFetching: s, onDownload: d, isMobile: g } = j(c);
26
- return /* @__PURE__ */ t(
27
- C,
28
+ }, { isVideo: A, isFetching: d, onDownload: u, isMobile: h } = M(o);
29
+ return /* @__PURE__ */ l(
30
+ F,
28
31
  {
29
32
  style: {
30
33
  borderRadius: 8,
@@ -38,32 +41,41 @@ const V = I(
38
41
  py: 8,
39
42
  bg: "var(--mantine-color-dark-6)",
40
43
  children: [
41
- g ? /* @__PURE__ */ r(l, { withArrow: !0, label: e("gallery.download"), children: /* @__PURE__ */ r(
42
- o,
44
+ h ? /* @__PURE__ */ e(i, { withArrow: !0, label: r("gallery.download"), children: /* @__PURE__ */ e(
45
+ t,
43
46
  {
44
- c: "var(--app-gallary-text)",
45
- color: "gray",
47
+ className: n.headerAction,
46
48
  size: "lg",
47
- variant: "light",
48
- loading: s,
49
- onClick: d,
50
- children: /* @__PURE__ */ r(h, { size: 20 })
49
+ variant: "subtle",
50
+ loading: d,
51
+ onClick: u,
52
+ children: /* @__PURE__ */ e(p, { size: 20 })
51
53
  }
52
- ) }) : /* @__PURE__ */ r(m, { ml: 6, fw: 500, fz: 14, c: "var(--app-gallary-text)", truncate: !0, children: c?.originalFileName || "" }),
53
- z ? /* @__PURE__ */ r("div", {}) : /* @__PURE__ */ t(p, { gap: "xs", children: [
54
- /* @__PURE__ */ r(l, { withArrow: !0, label: e("gallery.zoomOut"), children: /* @__PURE__ */ r(
55
- o,
54
+ ) }) : /* @__PURE__ */ l(s, { align: "center", gap: 8, ml: 6, miw: 0, children: [
55
+ o ? T(
56
+ j(
57
+ o.contentType ?? "",
58
+ !1,
59
+ o.originalFileName
60
+ ),
61
+ !1,
62
+ 20
63
+ ) : null,
64
+ /* @__PURE__ */ e(g, { fw: 500, fz: 14, c: "var(--app-gallary-text)", truncate: !0, children: o?.originalFileName || "" })
65
+ ] }),
66
+ A ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ l(s, { gap: "xs", children: [
67
+ /* @__PURE__ */ e(i, { withArrow: !0, label: r("gallery.zoomOut"), children: /* @__PURE__ */ e(
68
+ t,
56
69
  {
57
- c: "var(--app-gallary-text)",
58
- color: "gray",
70
+ className: n.headerAction,
59
71
  size: "lg",
60
- variant: "light",
61
- onClick: v,
62
- children: /* @__PURE__ */ r(R, { size: 20 })
72
+ variant: "subtle",
73
+ onClick: b,
74
+ children: /* @__PURE__ */ e(N, { size: 20 })
63
75
  }
64
76
  ) }),
65
- /* @__PURE__ */ t(
66
- m,
77
+ /* @__PURE__ */ l(
78
+ g,
67
79
  {
68
80
  fw: 500,
69
81
  fz: 14,
@@ -71,45 +83,42 @@ const V = I(
71
83
  miw: 50,
72
84
  ta: "center",
73
85
  children: [
74
- x,
86
+ y,
75
87
  "%"
76
88
  ]
77
89
  }
78
90
  ),
79
- /* @__PURE__ */ r(l, { withArrow: !0, label: e("gallery.zoomIn"), children: /* @__PURE__ */ r(
80
- o,
91
+ /* @__PURE__ */ e(i, { withArrow: !0, label: r("gallery.zoomIn"), children: /* @__PURE__ */ e(
92
+ t,
81
93
  {
82
- c: "var(--app-gallary-text)",
83
- color: "gray",
94
+ className: n.headerAction,
84
95
  size: "lg",
85
- variant: "light",
86
- onClick: w,
87
- children: /* @__PURE__ */ r(k, { size: 20 })
96
+ variant: "subtle",
97
+ onClick: x,
98
+ children: /* @__PURE__ */ e(R, { size: 20 })
88
99
  }
89
100
  ) })
90
101
  ] }),
91
- /* @__PURE__ */ t(p, { justify: "end", gap: "xs", children: [
92
- !g && /* @__PURE__ */ r(l, { withArrow: !0, label: e("gallery.download"), children: /* @__PURE__ */ r(
93
- o,
102
+ /* @__PURE__ */ l(s, { justify: "end", gap: "xs", children: [
103
+ !h && /* @__PURE__ */ e(i, { withArrow: !0, label: r("gallery.download"), children: /* @__PURE__ */ e(
104
+ t,
94
105
  {
95
- c: "var(--app-gallary-text)",
106
+ className: n.headerAction,
96
107
  size: "lg",
97
- color: "gray",
98
- variant: "light",
99
- loading: s,
100
- onClick: d,
101
- children: /* @__PURE__ */ r(h, { size: 20 })
108
+ variant: "subtle",
109
+ loading: d,
110
+ onClick: u,
111
+ children: /* @__PURE__ */ e(p, { size: 20 })
102
112
  }
103
113
  ) }),
104
- /* @__PURE__ */ r(l, { withArrow: !0, label: e("gallery.close"), children: /* @__PURE__ */ r(
105
- o,
114
+ /* @__PURE__ */ e(i, { withArrow: !0, label: r("gallery.close"), children: /* @__PURE__ */ e(
115
+ t,
106
116
  {
107
- c: "var(--app-gallary-text)",
117
+ className: n.headerAction,
108
118
  size: "lg",
109
- color: "gray",
110
- variant: "light",
111
- onClick: f,
112
- children: /* @__PURE__ */ r(F, { size: 20 })
119
+ variant: "subtle",
120
+ onClick: w,
121
+ children: /* @__PURE__ */ e(k, { size: 20 })
113
122
  }
114
123
  ) })
115
124
  ] })
@@ -119,5 +128,5 @@ const V = I(
119
128
  }
120
129
  );
121
130
  export {
122
- V as ModalHeader
131
+ L as ModalHeader
123
132
  };
@@ -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":"AASA,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,8GAgCX,CAAC"}
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 n from "shaka-player-react";
4
- import { BaseLoader as y } from "../../../Loaders/BaseLoader.js";
5
- import { ErrorSection as d } from "../ErrorSection.js";
6
- import { useShakePlayer as h } from "./useShakePlayer.js";
7
- import t from "./ShakaPlayer.module.css.js";
8
- const N = ({
9
- attachmentId: m,
10
- autoPlay: e,
11
- isActive: s,
12
- loader: i,
13
- stylesContainer: l,
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: f, containerRef: c, vodUrl: o } = h({
17
- autoPlay: e,
18
- isActive: s,
19
- attachmentId: m
20
- });
21
- return f ? /* @__PURE__ */ r(d, {}) : o ? /* @__PURE__ */ r(
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: c,
25
- style: l,
30
+ ref: u,
31
+ style: m,
26
32
  className: a(
27
- t["vod-player"],
33
+ i["vod-player"],
28
34
  "shaka-vod-player-wrapper",
29
35
  p
30
36
  ),
31
37
  children: /* @__PURE__ */ r(
32
- n,
38
+ h,
33
39
  {
34
- autoPlay: e ?? !0,
35
- className: a(t["vod-player__player"]),
36
- src: o
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
- ) : i ?? /* @__PURE__ */ r(y, {});
49
+ ) : f ?? /* @__PURE__ */ r(k, {});
41
50
  };
42
51
  export {
43
- N as ShakaVideoPlayer
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
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useShakePlayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,GAAI,uCAI5B;IACD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;;;;CA+GA,CAAC"}
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 g, useRef as c, useEffect as E } from "react";
2
- const y = ({
3
- attachmentId: o,
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] = g(null), [h, d] = g(!1), s = c(null), u = c(!0), t = c(null), r = c(null), b = async () => {
8
- if (!o)
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 e = new AbortController();
12
- r.current = e;
15
+ const t = new AbortController();
16
+ r.current = t;
13
17
  try {
14
- const n = await fetch(`/v1/attachments/${o}/vod`, {
15
- method: "GET",
16
- credentials: "include",
17
- headers: {
18
- Accept: "*/*"
19
- },
20
- signal: e.signal
21
- });
22
- if (!n.ok) throw new Error("Failed to get VOD URL");
23
- const w = await n.json();
24
- if (!u.current || e.signal.aborted) return;
25
- if (w.ready) {
26
- const m = new URL(w.url, window.location.origin).toString();
27
- f(m);
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
- t.current = setTimeout(() => {
30
- b();
36
+ n.current = setTimeout(() => {
37
+ g();
31
38
  }, 3e3);
32
- } catch (n) {
33
- if (n instanceof Error && n.name === "AbortError" || !u.current || e.signal.aborted) return;
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 E(() => {
38
- if (u.current = !0, f(null), d(!1), t.current && (clearTimeout(t.current), t.current = null), r.current && (r.current.abort(), r.current = null), !!o)
39
- return b(), () => {
40
- u.current = !1, t.current && (clearTimeout(t.current), t.current = null), r.current && (r.current.abort(), r.current = null);
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
- }, [o]), E(() => {
49
+ }, [e]), m(() => {
43
50
  if (!l || !s.current) return;
44
- const e = s.current.querySelector(
51
+ const t = s.current.querySelector(
45
52
  "video"
46
53
  );
47
- e && (i ? a !== !1 && e.play().catch((n) => {
48
- console.error("Ошибка при воспроизведении видео:", n);
49
- }) : e.pause());
50
- }, [i, l, a]), { containerRef: s, isError: h, vodUrl: l };
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
- y as useShakePlayer
60
+ C as useShakePlayer
54
61
  };
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ filename?: string;
3
+ contentType?: string;
4
+ }
5
+ export declare const UnsupportedSection: ({ filename, contentType }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=UnsupportedSection.d.ts.map
@@ -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":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,eAAO,MAAM,gBAAgB,GAAI,YAAY,aAAa;;;;;;CAwCzD,CAAC"}
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"}