@layers-app/shared 0.4.3 → 0.4.5

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 (142) hide show
  1. package/dist/components/AppContainer/components/SidebarToggleButton.d.ts.map +1 -1
  2. package/dist/components/AppContainer/components/SidebarToggleButton.js +25 -16
  3. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
  4. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +33 -33
  5. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
  6. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +54 -36
  7. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  8. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +2 -0
  9. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
  10. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +82 -41
  11. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  12. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +11 -12
  13. package/dist/components/Chat/CallMessage/CallMessage.module.css.js +15 -0
  14. package/dist/components/Chat/CallMessage/index.d.ts +21 -0
  15. package/dist/components/Chat/CallMessage/index.d.ts.map +1 -0
  16. package/dist/components/Chat/CallMessage/index.js +49 -0
  17. package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +9 -0
  18. package/dist/components/Chat/ChatBubble/index.d.ts +14 -0
  19. package/dist/components/Chat/ChatBubble/index.d.ts.map +1 -0
  20. package/dist/components/Chat/ChatBubble/index.js +32 -0
  21. package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +17 -0
  22. package/dist/components/Chat/ChatHeader/index.d.ts +42 -0
  23. package/dist/components/Chat/ChatHeader/index.d.ts.map +1 -0
  24. package/dist/components/Chat/ChatHeader/index.js +78 -0
  25. package/dist/components/Chat/ChatInput/ChatInput.module.css.js +37 -0
  26. package/dist/components/Chat/ChatInput/index.d.ts +46 -0
  27. package/dist/components/Chat/ChatInput/index.d.ts.map +1 -0
  28. package/dist/components/Chat/ChatInput/index.js +228 -0
  29. package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +15 -0
  30. package/dist/components/Chat/ChatLayout/index.d.ts +17 -0
  31. package/dist/components/Chat/ChatLayout/index.d.ts.map +1 -0
  32. package/dist/components/Chat/ChatLayout/index.js +43 -0
  33. package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +21 -0
  34. package/dist/components/Chat/ChatMessage/index.d.ts +45 -0
  35. package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -0
  36. package/dist/components/Chat/ChatMessage/index.js +188 -0
  37. package/dist/components/Chat/ChatPill/ChatPill.module.css.js +11 -0
  38. package/dist/components/Chat/ChatPill/index.d.ts +12 -0
  39. package/dist/components/Chat/ChatPill/index.d.ts.map +1 -0
  40. package/dist/components/Chat/ChatPill/index.js +21 -0
  41. package/dist/components/Chat/DayMeta/index.d.ts +11 -0
  42. package/dist/components/Chat/DayMeta/index.d.ts.map +1 -0
  43. package/dist/components/Chat/DayMeta/index.js +9 -0
  44. package/dist/components/Chat/DialogItem/DialogItem.module.css.js +17 -0
  45. package/dist/components/Chat/DialogItem/index.d.ts +41 -0
  46. package/dist/components/Chat/DialogItem/index.d.ts.map +1 -0
  47. package/dist/components/Chat/DialogItem/index.js +107 -0
  48. package/dist/components/Chat/DialogList/DialogList.module.css.js +7 -0
  49. package/dist/components/Chat/DialogList/index.d.ts +11 -0
  50. package/dist/components/Chat/DialogList/index.d.ts.map +1 -0
  51. package/dist/components/Chat/DialogList/index.js +19 -0
  52. package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +13 -0
  53. package/dist/components/Chat/MediaDocument/index.d.ts +15 -0
  54. package/dist/components/Chat/MediaDocument/index.d.ts.map +1 -0
  55. package/dist/components/Chat/MediaDocument/index.js +73 -0
  56. package/dist/components/Chat/MessageActions/MessageActions.module.css.js +7 -0
  57. package/dist/components/Chat/MessageActions/index.d.ts +16 -0
  58. package/dist/components/Chat/MessageActions/index.d.ts.map +1 -0
  59. package/dist/components/Chat/MessageActions/index.js +65 -0
  60. package/dist/components/Chat/MessageAuthor/index.d.ts +20 -0
  61. package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -0
  62. package/dist/components/Chat/MessageAuthor/index.js +36 -0
  63. package/dist/components/Chat/MessageForward/MessageForward.module.css.js +7 -0
  64. package/dist/components/Chat/MessageForward/index.d.ts +13 -0
  65. package/dist/components/Chat/MessageForward/index.d.ts.map +1 -0
  66. package/dist/components/Chat/MessageForward/index.js +30 -0
  67. package/dist/components/Chat/MessageList/MessageList.module.css.js +17 -0
  68. package/dist/components/Chat/MessageList/index.d.ts +12 -0
  69. package/dist/components/Chat/MessageList/index.d.ts.map +1 -0
  70. package/dist/components/Chat/MessageList/index.js +71 -0
  71. package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +13 -0
  72. package/dist/components/Chat/MessageMeta/index.d.ts +16 -0
  73. package/dist/components/Chat/MessageMeta/index.d.ts.map +1 -0
  74. package/dist/components/Chat/MessageMeta/index.js +33 -0
  75. package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +15 -0
  76. package/dist/components/Chat/MessageReactions/index.d.ts +15 -0
  77. package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -0
  78. package/dist/components/Chat/MessageReactions/index.js +40 -0
  79. package/dist/components/Chat/MessageReply/MessageReply.module.css.js +15 -0
  80. package/dist/components/Chat/MessageReply/index.d.ts +15 -0
  81. package/dist/components/Chat/MessageReply/index.d.ts.map +1 -0
  82. package/dist/components/Chat/MessageReply/index.js +40 -0
  83. package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +9 -0
  84. package/dist/components/Chat/MessageStatus/index.d.ts +14 -0
  85. package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -0
  86. package/dist/components/Chat/MessageStatus/index.js +53 -0
  87. package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +11 -0
  88. package/dist/components/Chat/ServiceMessage/index.d.ts +13 -0
  89. package/dist/components/Chat/ServiceMessage/index.d.ts.map +1 -0
  90. package/dist/components/Chat/ServiceMessage/index.js +21 -0
  91. package/dist/components/Chat/UnreadSeparator/index.d.ts +11 -0
  92. package/dist/components/Chat/UnreadSeparator/index.d.ts.map +1 -0
  93. package/dist/components/Chat/UnreadSeparator/index.js +13 -0
  94. package/dist/components/Chat/colors.d.ts +7 -0
  95. package/dist/components/Chat/colors.d.ts.map +1 -0
  96. package/dist/components/Chat/colors.js +30 -0
  97. package/dist/components/Chat/icons.d.ts +9 -0
  98. package/dist/components/Chat/icons.d.ts.map +1 -0
  99. package/dist/components/Chat/icons.js +49 -0
  100. package/dist/components/Chat/index.d.ts +24 -0
  101. package/dist/components/Chat/index.d.ts.map +1 -0
  102. package/dist/components/Chat/mock-data.d.ts +32 -0
  103. package/dist/components/Chat/mock-data.d.ts.map +1 -0
  104. package/dist/components/Chat/types.d.ts +159 -0
  105. package/dist/components/Chat/types.d.ts.map +1 -0
  106. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  107. package/dist/components/CommentComposer/index.d.ts.map +1 -1
  108. package/dist/components/CommentComposer/index.js +53 -54
  109. package/dist/components/CommentComposer/types.js +9 -0
  110. package/dist/components/EmojiPicker/EmojiPicker.d.ts +8 -1
  111. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  112. package/dist/components/EmojiPicker/EmojiPicker.js +53 -50
  113. package/dist/components/EntityIcon.d.ts.map +1 -1
  114. package/dist/components/EntityIcon.js +36 -27
  115. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  116. package/dist/components/FilePicker/FilePicker.js +135 -161
  117. package/dist/components/FilePicker/FilePicker.module.css.js +8 -12
  118. package/dist/components/FilePicker/FilePickerGallery.js +13 -13
  119. package/dist/components/FilePicker/FilePickerGiphy.js +4 -4
  120. package/dist/components/FilePicker/FilePickerGoogleDrive.js +3 -3
  121. package/dist/components/FilePicker/FilePickerUnsplash.js +18 -18
  122. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  123. package/dist/components/FilePicker/FilePickerUpload.js +55 -47
  124. package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +42 -42
  125. package/dist/components/MusicPlayerBar/components/VolumePopover.d.ts.map +1 -1
  126. package/dist/components/MusicPlayerBar/components/VolumePopover.js +22 -20
  127. package/dist/components/PillTabs/PillTabs.d.ts +19 -0
  128. package/dist/components/PillTabs/PillTabs.d.ts.map +1 -0
  129. package/dist/components/PillTabs/PillTabs.js +50 -0
  130. package/dist/components/PillTabs/PillTabs.module.css.js +11 -0
  131. package/dist/components/modals/RemoveConfirmModal.js +1 -1
  132. package/dist/hooks/useOfficePreviewAvailable.d.ts +2 -0
  133. package/dist/hooks/useOfficePreviewAvailable.d.ts.map +1 -0
  134. package/dist/hooks/useOfficePreviewAvailable.js +20 -0
  135. package/dist/index.css +1 -1
  136. package/dist/index.d.ts +4 -0
  137. package/dist/index.d.ts.map +1 -1
  138. package/dist/index.js +573 -520
  139. package/dist/lang/locales/ui_en.json.js +5 -5
  140. package/dist/lang/locales/ui_es.json.js +1 -1
  141. package/dist/lang/locales/ui_ru.json.js +1 -1
  142. package/package.json +6 -3
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/components/AppContainer/components/SidebarToggleButton.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,GAAI,aAAa;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,mDAkBrE,CAAC"}
1
+ {"version":3,"file":"SidebarToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/components/AppContainer/components/SidebarToggleButton.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,mBAAmB,GAAI,aAAa;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,mDAyBrE,CAAC"}
@@ -1,27 +1,36 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { SidebarLeft01Icon as i, SidebarRight01Icon as n } from "@hugeicons/core-free-icons";
3
- import { HugeiconsIcon as c } from "@hugeicons/react";
4
- import { ActionIcon as a } from "@mantine/core";
5
- import { appContainerStore as t } from "../hooks/useAppContainerStore.js";
6
- const g = ({ forOpen: e }) => {
7
- const { showToolbar: o } = t.useStore();
8
- return e && o ? null : /* @__PURE__ */ r(
9
- a,
2
+ import { useTranslation as n } from "react-i18next";
3
+ import { SidebarLeft01Icon as a, SidebarRight01Icon as l } from "@hugeicons/core-free-icons";
4
+ import { HugeiconsIcon as p } from "@hugeicons/react";
5
+ import { Tooltip as c, ActionIcon as m } from "@mantine/core";
6
+ import { appContainerStore as e } from "../hooks/useAppContainerStore.js";
7
+ const h = ({ forOpen: i }) => {
8
+ const { t } = n("appContainer"), { showToolbar: o } = e.useStore();
9
+ return i && o ? null : /* @__PURE__ */ r(
10
+ c,
10
11
  {
11
- variant: "subtle",
12
- size: "md",
13
- color: "gray",
14
- onClick: t.api.toggleToolbar,
12
+ label: t(o ? "hideSidebar" : "showSidebar"),
13
+ withArrow: !0,
14
+ openDelay: 400,
15
15
  children: /* @__PURE__ */ r(
16
- c,
16
+ m,
17
17
  {
18
- icon: o ? i : n,
19
- size: 20
18
+ variant: "subtle",
19
+ size: "md",
20
+ color: "gray",
21
+ onClick: e.api.toggleToolbar,
22
+ children: /* @__PURE__ */ r(
23
+ p,
24
+ {
25
+ icon: o ? a : l,
26
+ size: 20
27
+ }
28
+ )
20
29
  }
21
30
  )
22
31
  }
23
32
  );
24
33
  };
25
34
  export {
26
- g as SidebarToggleButton
35
+ h as SidebarToggleButton
27
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"GallerySlide.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/components/GallerySlide.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAAsB,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI5E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAWrD,UAAU,MAAM;IACd,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAClC,OAAO,gBAAgB,CACxB,CAAC,eAAe,CAAC,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,aAAa,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,2EACwB,MAAM,6CAoGtD,CAAC"}
1
+ {"version":3,"file":"GallerySlide.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentsGalleryModal/components/GallerySlide.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAAsB,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI5E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAWrD,UAAU,MAAM;IACd,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAClC,OAAO,gBAAgB,CACxB,CAAC,eAAe,CAAC,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,aAAa,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,2EACwB,MAAM,6CA0GtD,CAAC"}
@@ -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 l } from "@mantine/core";
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 { ZOOM_CONFIG as a, TRANSFORM_COMPONENT_STYLES as u } from "../constants.js";
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 p } from "./ErrorSection.js";
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 A = P(
14
- ({ onTransformed: S, attachment: e, isActive: s, ref: N }) => {
13
+ const h = P(
14
+ ({ onTransformed: S, attachment: e, isActive: n, ref: N }) => {
15
15
  const {
16
- isError: n,
16
+ isError: m,
17
17
  setIsError: g,
18
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(
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: a.initialScale,
33
- minScale: a.minScale,
34
- maxScale: a.maxScale,
39
+ initialScale: s.initialScale,
40
+ minScale: s.minScale,
41
+ maxScale: s.maxScale,
35
42
  limitToBounds: !0,
36
- disabled: m || d || t || f || !c,
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: a.wheelStep
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: u,
51
- contentStyle: u,
57
+ wrapperStyle: p,
58
+ contentStyle: p,
52
59
  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(
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
- ) }) : 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" }),
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: s,
74
+ autoPlay: n,
75
75
  className: i.audioElement
76
76
  }
77
77
  )
78
- ] }) : n ? /* @__PURE__ */ r(p, {}) : /* @__PURE__ */ r(
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
- A as GallerySlide
100
+ h as GallerySlide
101
101
  };
@@ -1 +1 @@
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
+ {"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 d, useEffect as g } from "react";
3
- import a from "clsx";
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";
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: l,
11
- autoPlay: o,
12
- isActive: n,
13
- loader: f,
14
- stylesContainer: m,
15
- classNameContainer: p
10
+ attachmentId: p,
11
+ autoPlay: t,
12
+ isActive: f,
13
+ loader: u,
14
+ stylesContainer: d,
15
+ classNameContainer: y
16
16
  }) => {
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;
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
- }, [e]), c ? /* @__PURE__ */ r(v, {}) : e ? /* @__PURE__ */ r(
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: u,
31
- style: m,
32
- className: a(
33
- i["vod-player"],
37
+ ref: E,
38
+ style: d,
39
+ className: s(
40
+ n["vod-player"],
34
41
  "shaka-vod-player-wrapper",
35
- p
42
+ y
36
43
  ),
37
- children: /* @__PURE__ */ r(
38
- h,
44
+ children: o ? /* @__PURE__ */ r(
45
+ S,
39
46
  {
40
- ref: t,
41
- autoPlay: o ?? !0,
42
- className: a(i["vod-player__player"]),
43
- src: e,
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
- ) : f ?? /* @__PURE__ */ r(k, {});
67
+ );
50
68
  };
51
69
  export {
52
70
  q as ShakaVideoPlayer
@@ -1,7 +1,7 @@
1
- const a = {
2
- "vod-player": "_vod-player_1paib_1",
3
- "vod-player__player": "_vod-player__player_1paib_25"
1
+ const _ = {
2
+ "vod-player": "_vod-player_11682_1",
3
+ "vod-player__player": "_vod-player__player_11682_25"
4
4
  };
5
5
  export {
6
- a as default
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
@@ -1 +1 @@
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
+ {"version":3,"file":"useShakePlayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.tsx"],"names":[],"mappings":"AA4CA,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+KA,CAAC"}
@@ -1,61 +1,102 @@
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,
8
- isActive: i,
9
- autoPlay: a
1
+ import { useState as U, useRef as i, useCallback as A, useEffect as E } from "react";
2
+ import { getEnvConfig as k } from "../../../../config/envConfig.js";
3
+ const m = () => {
4
+ const r = k().apiBaseUrl || "";
5
+ return r.endsWith("/") ? r.slice(0, -1) : r;
6
+ }, T = async (r) => {
7
+ const u = m();
8
+ return (await fetch(`${u}/v1/auth/refresh`, {
9
+ method: "POST",
10
+ credentials: "include",
11
+ signal: r
12
+ })).ok;
13
+ }, $ = async (r, u) => {
14
+ const s = await fetch(r, {
15
+ ...u,
16
+ credentials: "include"
17
+ });
18
+ return s.status !== 401 && s.status !== 403 || !await T(u.signal) || u.signal.aborted ? s : fetch(r, {
19
+ ...u,
20
+ credentials: "include"
21
+ });
22
+ }, V = ({
23
+ attachmentId: r,
24
+ isActive: u,
25
+ autoPlay: s
10
26
  }) => {
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)
27
+ const [f, h] = U(null), [b, p] = U(null), [v, w] = U(!1), R = i(null), c = i(!0), o = i(null), t = i(null), l = i(null), d = A(
28
+ (e) => {
29
+ if (!r || l.current || !c.current || e.aborted) return;
30
+ const g = m() || window.location.origin, a = new URL(
31
+ `/v1/attachments/${r}`,
32
+ g
33
+ ).toString();
34
+ l.current = a, h(null), p(a);
35
+ },
36
+ [r]
37
+ ), C = A(async () => {
38
+ if (!r || l.current) return;
39
+ o.current && (clearTimeout(o.current), o.current = null), t.current && t.current.abort();
40
+ const e = new AbortController();
41
+ t.current = e, w(!1);
42
+ try {
43
+ await T(e.signal), d(e.signal);
44
+ } catch (n) {
45
+ if (n instanceof Error && n.name === "AbortError" || !c.current || e.signal.aborted) return;
46
+ w(!0);
47
+ }
48
+ }, [r, d]), y = async () => {
49
+ if (!r)
13
50
  return;
14
- r.current && r.current.abort();
15
- const t = new AbortController();
16
- r.current = t;
51
+ t.current && t.current.abort();
52
+ const e = new AbortController();
53
+ t.current = e;
17
54
  try {
18
- const o = R(), p = await fetch(
19
- `${o}/v1/attachments/${e}/vod`,
55
+ const n = m(), g = await $(
56
+ `${n}/v1/attachments/${r}/vod`,
20
57
  {
21
58
  method: "GET",
22
- credentials: "include",
23
59
  headers: {
24
60
  Accept: "*/*"
25
61
  },
26
- signal: t.signal
62
+ signal: e.signal
27
63
  }
28
64
  );
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);
65
+ if (!g.ok) {
66
+ await d(e.signal);
67
+ return;
68
+ }
69
+ const a = await g.json();
70
+ if (!c.current || e.signal.aborted) return;
71
+ const B = n || window.location.origin;
72
+ if (a.ready) {
73
+ const S = new URL(a.url, B).toString();
74
+ if (l.current) return;
75
+ p(null), h(S);
35
76
  } else
36
- n.current = setTimeout(() => {
37
- g();
77
+ d(e.signal), o.current = setTimeout(() => {
78
+ y();
38
79
  }, 3e3);
39
- } catch (o) {
40
- if (o instanceof Error && o.name === "AbortError" || !u.current || t.signal.aborted) return;
41
- d(!0);
80
+ } catch (n) {
81
+ if (n instanceof Error && n.name === "AbortError" || !c.current || e.signal.aborted) return;
82
+ w(!0);
42
83
  }
43
84
  };
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);
85
+ return E(() => {
86
+ if (c.current = !0, h(null), p(null), w(!1), l.current = null, o.current && (clearTimeout(o.current), o.current = null), t.current && (t.current.abort(), t.current = null), !!r)
87
+ return y(), () => {
88
+ c.current = !1, o.current && (clearTimeout(o.current), o.current = null), t.current && (t.current.abort(), t.current = null), l.current = null;
48
89
  };
49
- }, [e]), m(() => {
50
- if (!l || !s.current) return;
51
- const t = s.current.querySelector(
90
+ }, [r]), E(() => {
91
+ if (!f && !b || !R.current) return;
92
+ const e = R.current.querySelector(
52
93
  "video"
53
94
  );
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 };
95
+ e && (u ? s !== !1 && e.play().catch((n) => {
96
+ console.error("Ошибка при воспроизведении видео:", n);
97
+ }) : e.pause());
98
+ }, [u, f, b, s]), { containerRef: R, fallbackToRawAttachment: C, isError: v, vodUrl: f, rawUrl: b };
58
99
  };
59
100
  export {
60
- C as useShakePlayer
101
+ V as useShakePlayer
61
102
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentsPreview.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentsPreview/AttachmentsPreview.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIhE,UAAU,8BAA8B;IACtC,KAAK,EAAE,oBAAoB,CAAC,cAAc,EAAE,CAAC;IAC7C,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,kBAAkB,GAAI,8CAKhC,8BAA8B,mDAoNhC,CAAC"}
1
+ {"version":3,"file":"AttachmentsPreview.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentsPreview/AttachmentsPreview.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIhE,UAAU,8BAA8B;IACtC,KAAK,EAAE,oBAAoB,CAAC,cAAc,EAAE,CAAC;IAC7C,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,kBAAkB,GAAI,8CAKhC,8BAA8B,mDAmNhC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as n, Fragment as C, jsx as r } from "react/jsx-runtime";
2
2
  import { Download01Icon as g } from "@hugeicons/core-free-icons";
3
3
  import { HugeiconsIcon as x } from "@hugeicons/react";
4
- import { Stack as v, Grid as z, Box as h, Image as F, LoadingOverlay as f, ActionIcon as c, CloseIcon as I, Flex as y, Text as N } from "@mantine/core";
4
+ import { Stack as v, Grid as z, Box as h, Image as F, LoadingOverlay as y, ActionIcon as c, CloseIcon as f, Flex as I, Text as N } from "@mantine/core";
5
5
  import { useDisclosure as M } from "@mantine/hooks";
6
6
  import { getFileIcons as P } from "../../helpers/getFileIcons.js";
7
7
  import { getFileType as A } from "../../helpers/getFileType.js";
@@ -16,7 +16,7 @@ const U = ({
16
16
  const [T, { open: w, close: b }] = M(!1), s = o.filter((e) => e.isImage), d = o.filter((e) => !e.isImage), D = s.map((e) => ({
17
17
  id: e.id,
18
18
  Url: e.url,
19
- contentType: "image",
19
+ contentType: e.type || "image/png",
20
20
  fileName: e.name,
21
21
  originalFileName: e.name,
22
22
  fileSize: e.size,
@@ -40,17 +40,16 @@ const U = ({
40
40
  return /* @__PURE__ */ r(z.Col, { span: "content", children: /* @__PURE__ */ n(
41
41
  h,
42
42
  {
43
- w: 56,
44
- h: 56,
45
43
  pos: "relative",
46
44
  className: a.imagePreviewWrapper,
45
+ style: { width: "var(--attachment-image-w, 56px)", height: "var(--attachment-image-h, 56px)" },
47
46
  children: [
48
47
  /* @__PURE__ */ r(
49
48
  F,
50
49
  {
51
50
  src: e.src,
52
- width: 56,
53
- height: 56,
51
+ w: "100%",
52
+ h: "100%",
54
53
  fit: "cover",
55
54
  radius: "sm",
56
55
  style: {
@@ -60,7 +59,7 @@ const U = ({
60
59
  }
61
60
  ),
62
61
  /* @__PURE__ */ r(
63
- f,
62
+ y,
64
63
  {
65
64
  visible: e.isTemp && t === "view" && u,
66
65
  loaderProps: { size: 20 }
@@ -94,7 +93,7 @@ const U = ({
94
93
  color: "dark",
95
94
  onClick: () => i(l),
96
95
  className: a.deleteButton,
97
- children: /* @__PURE__ */ r(I, { size: "12px" })
96
+ children: /* @__PURE__ */ r(f, { size: "12px" })
98
97
  }
99
98
  )
100
99
  ]
@@ -111,14 +110,14 @@ const U = ({
111
110
  const l = o.indexOf(e);
112
111
  return /* @__PURE__ */ n(h, { className: a.filePreviewWrapper, children: [
113
112
  /* @__PURE__ */ r(
114
- f,
113
+ y,
115
114
  {
116
115
  visible: e.isTemp && t === "view" && u,
117
116
  loaderProps: { size: 20 }
118
117
  }
119
118
  ),
120
119
  /* @__PURE__ */ n(
121
- y,
120
+ I,
122
121
  {
123
122
  align: "center",
124
123
  justify: "space-between",
@@ -126,7 +125,7 @@ const U = ({
126
125
  gap: 2,
127
126
  children: [
128
127
  /* @__PURE__ */ n(
129
- y,
128
+ I,
130
129
  {
131
130
  align: "center",
132
131
  gap: "xs",
@@ -190,7 +189,7 @@ const U = ({
190
189
  color: "dark",
191
190
  onClick: () => i(l),
192
191
  className: a.deleteButton,
193
- children: /* @__PURE__ */ r(I, { size: "12px" })
192
+ children: /* @__PURE__ */ r(f, { size: "12px" })
194
193
  }
195
194
  )
196
195
  ] }, e.id);
@@ -0,0 +1,15 @@
1
+ const t = "_root_1rrzr_1", o = "_icon_1rrzr_13", r = "_body_1rrzr_31", _ = "_title_1rrzr_41", c = "_meta_1rrzr_53", e = {
2
+ root: t,
3
+ icon: o,
4
+ body: r,
5
+ title: _,
6
+ meta: c
7
+ };
8
+ export {
9
+ r as body,
10
+ e as default,
11
+ o as icon,
12
+ c as meta,
13
+ t as root,
14
+ _ as title
15
+ };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ export interface CallMessageProps {
3
+ /** Call state */
4
+ variant: 'ended' | 'active' | 'missed' | 'declined';
5
+ /** Who initiated: outgoing = you called, incoming = they called */
6
+ outgoing?: boolean;
7
+ /** Audio or video call */
8
+ callType?: 'audio' | 'video';
9
+ /** DM (1:1) or channel (group) call */
10
+ mode?: 'dm' | 'channel';
11
+ /** Duration string: "20 seconds", "8 minutes" */
12
+ duration?: string;
13
+ /** Time string for DM calls: "14:03" */
14
+ time?: string;
15
+ /** Number of participants (channel mode) */
16
+ participantCount?: number;
17
+ className?: string;
18
+ style?: React.CSSProperties;
19
+ }
20
+ export declare const CallMessage: React.NamedExoticComponent<CallMessageProps>;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/CallMessage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,MAAM,WAAW,gBAAgB;IAC/B,iBAAiB;IACjB,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;IACpD,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC7B,uCAAuC;IACvC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,WAAW,8CA6EtB,CAAC"}