@layers-app/shared 0.3.9 → 0.4.0

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 (190) hide show
  1. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +10 -10
  2. package/dist/components/AnimatedFigurePage/useParallax.d.ts +2 -2
  3. package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
  4. package/dist/components/AppContainer/components/AppSidebarButton.d.ts +1 -4
  5. package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
  6. package/dist/components/AppContainer/components/AppSidebarButton.js +15 -22
  7. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
  8. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +21 -22
  9. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  10. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +91 -48
  11. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  12. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  13. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts +1 -3
  14. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
  15. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +63 -89
  16. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts +1 -1
  17. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
  18. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +26 -35
  19. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  20. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +1 -1
  21. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
  22. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +36 -43
  23. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts +0 -4
  24. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
  25. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +20 -59
  26. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +18 -28
  27. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  28. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +18 -22
  29. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  30. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  31. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  32. package/dist/components/ColorPicker/ColorPicker.d.ts +18 -23
  33. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  34. package/dist/components/ColorPicker/ColorPicker.js +139 -145
  35. package/dist/components/ColorPicker/ColorPicker.module.css.js +8 -8
  36. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  37. package/dist/components/ColorPicker/ColorPickerToolbar.js +88 -71
  38. package/dist/components/ColorPicker/icons.js +4 -4
  39. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  40. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  41. package/dist/components/CommentComposer/CommentEditorHotkeys.js +4 -3
  42. package/dist/components/CommentComposer/index.js +1 -1
  43. package/dist/components/CommentComposer/useVirtualAnchor.d.ts +1 -1
  44. package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -1
  45. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  46. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  47. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  48. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  49. package/dist/components/EmojiPicker/EmojiPanel.js +22 -22
  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/EmojiPicker/EmojiPicker.js +1 -0
  53. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  54. package/dist/components/EmojiPicker/IconsPanel.js +13 -13
  55. package/dist/components/EntityIcon.d.ts.map +1 -1
  56. package/dist/components/EntityIcon.js +33 -43
  57. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  58. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  59. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  60. package/dist/components/FilePicker/FilePicker.d.ts +4 -2
  61. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  62. package/dist/components/FilePicker/FilePicker.js +241 -226
  63. package/dist/components/FilePicker/FilePicker.module.css.js +14 -12
  64. package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
  65. package/dist/components/FilePicker/FilePickerGallery.js +60 -34
  66. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  67. package/dist/components/FilePicker/FilePickerGiphy.js +38 -39
  68. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  69. package/dist/components/FilePicker/FilePickerLink.js +29 -26
  70. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  71. package/dist/components/FilePicker/FilePickerUnsplash.js +42 -43
  72. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  73. package/dist/components/FilePicker/FilePickerUpload.js +51 -35
  74. package/dist/components/FilePicker/coverCollections.d.ts +4 -0
  75. package/dist/components/FilePicker/coverCollections.d.ts.map +1 -0
  76. package/dist/components/FilePicker/coverCollections.js +164 -0
  77. package/dist/components/FilePicker/index.d.ts +1 -0
  78. package/dist/components/FilePicker/index.d.ts.map +1 -1
  79. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  80. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  81. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  82. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  83. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  84. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  85. package/dist/components/FormViewer/helpers/conditions.d.ts +38 -38
  86. package/dist/components/FormViewer/helpers/helpers.d.ts +38 -38
  87. package/dist/components/FormViewer/helpers/steps.d.ts +38 -38
  88. package/dist/components/FormViewer/hooks/useActiveControl.d.ts +19 -19
  89. package/dist/components/FormViewer/hooks/useActiveStep.d.ts +38 -38
  90. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +0 -6
  91. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts.map +1 -1
  92. package/dist/components/FormViewer/hooks/useFormGlobalTheme.js +3 -4
  93. package/dist/components/FormViewer/hooks/useFormMobile.d.ts +1 -1
  94. package/dist/components/FormViewer/hooks/useFormMobile.d.ts.map +1 -1
  95. package/dist/components/FormViewer/store/formStore.d.ts +248 -248
  96. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  97. package/dist/components/FormViewer/store/formStoreApi.d.ts +124 -124
  98. package/dist/components/FormViewer/store/selectors.d.ts +11655 -11655
  99. package/dist/components/FormViewer/types/form.d.ts +1 -1
  100. package/dist/components/FormViewer/types/form.d.ts.map +1 -1
  101. package/dist/components/FormViewer/types/schemes.d.ts +6358 -381
  102. package/dist/components/FormViewer/types/schemes.d.ts.map +1 -1
  103. package/dist/components/FormViewer/types/schemes.js +1 -1
  104. package/dist/components/GroupAvatar/index.d.ts +1 -3
  105. package/dist/components/GroupAvatar/index.d.ts.map +1 -1
  106. package/dist/components/GroupAvatar/index.js +21 -24
  107. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  108. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  109. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  110. package/dist/components/Loaders/styles.module.css.js +6 -6
  111. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  112. package/dist/components/MediaLibrary/MediaLibraryRow.js +7 -7
  113. package/dist/components/NavMenu/NavMenu.d.ts +1 -3
  114. package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
  115. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  116. package/dist/components/NavMenu/components/DnDProvider.d.ts +1 -1
  117. package/dist/components/NavMenu/components/DnDProvider.d.ts.map +1 -1
  118. package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts +1 -7
  119. package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts.map +1 -1
  120. package/dist/components/NavMenu/components/NavMenuActionIcon.js +23 -21
  121. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  122. package/dist/components/NewColorPicker/components/Target.d.ts +1 -3
  123. package/dist/components/NewColorPicker/components/Target.d.ts.map +1 -1
  124. package/dist/components/NewColorPicker/components/Target.js +43 -48
  125. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  126. package/dist/components/Notification/Notification.js +1 -3
  127. package/dist/components/Notification/Notification.module.css.js +1 -1
  128. package/dist/components/Notification/NotificationCard.d.ts +1 -3
  129. package/dist/components/Notification/NotificationCard.d.ts.map +1 -1
  130. package/dist/components/Notification/NotificationCard.js +86 -87
  131. package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
  132. package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
  133. package/dist/components/OnBoarding/styles.module.css.js +7 -7
  134. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +1 -1
  135. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -1
  136. package/dist/components/OnboardingTour/OnboardingTourWrapper.js +74 -70
  137. package/dist/components/ProjectIcon/ProjectIcon.d.ts +12 -7
  138. package/dist/components/ProjectIcon/ProjectIcon.d.ts.map +1 -1
  139. package/dist/components/ProjectIcon/ProjectIcon.js +60 -58
  140. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  141. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  142. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  143. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  144. package/dist/components/UserAvatar/index.d.ts +1 -2
  145. package/dist/components/UserAvatar/index.d.ts.map +1 -1
  146. package/dist/components/UserAvatar/index.js +35 -38
  147. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +3 -3
  148. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts.map +1 -1
  149. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +18 -19
  150. package/dist/components/WorkspaceMenu/WorkspaceItem.js +17 -17
  151. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +7 -7
  152. package/dist/components/table/FrontTable.d.ts.map +1 -1
  153. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  154. package/dist/config/envConfig.d.ts +0 -8
  155. package/dist/config/envConfig.d.ts.map +1 -1
  156. package/dist/config/envConfig.js +13 -21
  157. package/dist/helpers/getFileIcons.d.ts.map +1 -1
  158. package/dist/helpers/getFileIcons.js +45 -63
  159. package/dist/helpers/getFileType.d.ts +1 -1
  160. package/dist/helpers/getFileType.d.ts.map +1 -1
  161. package/dist/helpers/getFileType.js +8 -29
  162. package/dist/helpers/getPartOfTheDay.d.ts +1 -1
  163. package/dist/helpers/platform.d.ts +1 -1
  164. package/dist/helpers/platform.d.ts.map +1 -1
  165. package/dist/helpers/platform.js +4 -5
  166. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  167. package/dist/helpers/showNotifications.d.ts.map +1 -1
  168. package/dist/helpers/showNotifications.js +29 -30
  169. package/dist/helpers/showNotifications.module.css.js +1 -1
  170. package/dist/hooks/useOutsideClick.d.ts +1 -1
  171. package/dist/hooks/useOutsideClick.d.ts.map +1 -1
  172. package/dist/index.css +1 -1
  173. package/dist/index.d.ts +1 -2
  174. package/dist/index.d.ts.map +1 -1
  175. package/dist/index.js +465 -467
  176. package/dist/lang/locales/ui_en.json.js +20 -18
  177. package/dist/lang/locales/ui_es.json.js +14 -12
  178. package/dist/lang/locales/ui_ru.json.js +15 -13
  179. package/dist/node_modules/countries-and-timezones/esm/index.js +4011 -281
  180. package/docs/README.md +499 -499
  181. package/package.json +75 -75
  182. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +0 -6
  183. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +0 -1
  184. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +0 -16
  185. package/dist/components/TextColorIcon.d.ts +0 -8
  186. package/dist/components/TextColorIcon.d.ts.map +0 -1
  187. package/dist/components/TextColorIcon.js +0 -60
  188. package/dist/helpers/offlineSuppression.d.ts +0 -3
  189. package/dist/helpers/offlineSuppression.d.ts.map +0 -1
  190. package/dist/helpers/offlineSuppression.js +0 -8
@@ -1,95 +1,69 @@
1
- import { jsx as r, jsxs as P } from "react/jsx-runtime";
2
- import { memo as F } from "react";
3
- import { TransformWrapper as U, TransformComponent as y } from "react-zoom-pan-pinch";
4
- import { Box as l } from "@mantine/core";
5
- import { BaseLoader as E } from "../../Loaders/BaseLoader.js";
6
- import { ShakaVideoPlayer as O } from "./ShakePlayer/ShakaPlayer.js";
7
- import { ZOOM_CONFIG as a, TRANSFORM_COMPONENT_STYLES as c } from "../constants.js";
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
8
  import { useGetPreviewUrl as b } from "../hooks/useGetPreviewUrl.js";
9
- import { usePanning as x } from "../hooks/usePanning.js";
10
- import { ErrorSection as p } from "./ErrorSection.js";
11
- import { UnsupportedSection as T } from "./UnsupportedSection.js";
12
- import i from "../styles.module.css.js";
13
- const h = F(
14
- ({ onTransformed: S, attachment: e, isActive: s, ref: N }) => {
15
- const {
16
- isError: m,
17
- setIsError: g,
18
- fileUrl: o,
19
- isFetching: n,
20
- isVideo: d,
21
- isPdf: t,
22
- isAudio: f,
23
- isSupported: u
24
- } = b(e), C = x({ isFetching: n, isVideo: d });
25
- return /* @__PURE__ */ r(
26
- U,
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: n || d || t || f || !u,
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
- y,
49
- {
50
- wrapperStyle: c,
51
- contentStyle: c,
52
- wrapperProps: C,
53
- children: u ? n ? /* @__PURE__ */ r(E, {}) : d ? /* @__PURE__ */ r(l, { className: i.videoContainer, children: /* @__PURE__ */ r(
54
- O,
55
- {
56
- isActive: s,
57
- autoPlay: s,
58
- attachmentId: e.id
59
- }
60
- ) }) : t ? m || !(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 ? m || !(e?.Url || o) ? /* @__PURE__ */ r(p, {}) : /* @__PURE__ */ P(l, { className: i.audioContainer, children: [
68
- /* @__PURE__ */ r(l, { className: i.audioName, children: e.originalFileName || "audio" }),
69
- /* @__PURE__ */ r(
70
- "audio",
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,
71
46
  {
72
- src: e?.Url ?? o ?? "",
73
- controls: !0,
74
- autoPlay: s,
75
- className: i.audioElement
47
+ isActive: s,
48
+ autoPlay: !1,
49
+ attachmentId: e.id
76
50
  }
77
- )
78
- ] }) : m ? /* @__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(T, { filename: e.originalFileName })
87
- }
88
- )
89
- }
90
- );
91
- }
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
+ )
92
66
  );
93
67
  export {
94
- h as GallerySlide
68
+ k as GallerySlide
95
69
  };
@@ -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 | 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;
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;
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":"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":"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,53 +1,44 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { useRef as d, useEffect as g } from "react";
3
2
  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";
9
- const q = ({
10
- attachmentId: l,
11
- autoPlay: o,
12
- isActive: n,
13
- loader: f,
14
- stylesContainer: m,
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,
15
14
  classNameContainer: p
16
15
  }) => {
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(
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(
28
22
  "div",
29
23
  {
30
- ref: u,
31
- style: m,
24
+ ref: c,
25
+ style: l,
32
26
  className: a(
33
- i["vod-player"],
27
+ t["vod-player"],
34
28
  "shaka-vod-player-wrapper",
35
29
  p
36
30
  ),
37
31
  children: /* @__PURE__ */ r(
38
- h,
32
+ n,
39
33
  {
40
- ref: t,
41
- autoPlay: o ?? !0,
42
- className: a(i["vod-player__player"]),
43
- src: e,
44
- crossOrigin: "use-credentials",
45
- controls: !0
34
+ autoPlay: e ?? !0,
35
+ className: a(t["vod-player__player"]),
36
+ src: o
46
37
  }
47
38
  )
48
39
  }
49
- ) : f ?? /* @__PURE__ */ r(k, {});
40
+ ) : i ?? /* @__PURE__ */ r(y, {});
50
41
  };
51
42
  export {
52
- q as ShakaVideoPlayer
43
+ N as ShakaVideoPlayer
53
44
  };
@@ -1,7 +1,7 @@
1
- const e = {
2
- "vod-player": "_vod-player_be6om_1",
3
- "vod-player__player": "_vod-player__player_be6om_13"
1
+ const a = {
2
+ "vod-player": "_vod-player_1paib_1",
3
+ "vod-player__player": "_vod-player__player_1paib_25"
4
4
  };
5
5
  export {
6
- e as default
6
+ a as default
7
7
  };
@@ -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 | null>;
6
+ containerRef: import("react").RefObject<HTMLDivElement>;
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":"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":"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,61 +1,54 @@
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,
1
+ import { useState as g, useRef as c, useEffect as E } from "react";
2
+ const y = ({
3
+ attachmentId: o,
8
4
  isActive: i,
9
5
  autoPlay: a
10
6
  }) => {
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)
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)
13
9
  return;
14
10
  r.current && r.current.abort();
15
- const t = new AbortController();
16
- r.current = t;
11
+ const e = new AbortController();
12
+ r.current = e;
17
13
  try {
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);
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);
35
28
  } else
36
- n.current = setTimeout(() => {
37
- g();
29
+ t.current = setTimeout(() => {
30
+ b();
38
31
  }, 3e3);
39
- } catch (o) {
40
- if (o instanceof Error && o.name === "AbortError" || !u.current || t.signal.aborted) return;
32
+ } catch (n) {
33
+ if (n instanceof Error && n.name === "AbortError" || !u.current || e.signal.aborted) return;
41
34
  d(!0);
42
35
  }
43
36
  };
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);
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);
48
41
  };
49
- }, [e]), m(() => {
42
+ }, [o]), E(() => {
50
43
  if (!l || !s.current) return;
51
- const t = s.current.querySelector(
44
+ const e = s.current.querySelector(
52
45
  "video"
53
46
  );
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 };
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 };
58
51
  };
59
52
  export {
60
- C as useShakePlayer
53
+ y as useShakePlayer
61
54
  };
@@ -5,9 +5,5 @@ 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;
12
8
  };
13
9
  //# sourceMappingURL=useGetPreviewUrl.d.ts.map
@@ -1 +1 @@
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"}
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,67 +1,28 @@
1
- import { useState as p, useEffect as F, useMemo as T } from "react";
2
- import { getEnvConfig as L } from "../../../config/envConfig.js";
3
- import { isVideoFile as v } from "../../../helpers/fileUtils.js";
4
- const h = () => {
5
- const e = L().apiBaseUrl || "";
6
- return e.endsWith("/") ? e.slice(0, -1) : e;
7
- }, B = (e) => {
8
- const [u, y] = p(null), [d, n] = p(!1), [w, a] = p(!1);
9
- async function g(i) {
10
- return fetch(`${h()}/v1/attachments/${i}`, {
11
- method: "GET",
12
- credentials: "include"
1
+ import { useState as t, useEffect as w, useMemo as U } from "react";
2
+ import { isVideoFile as E } from "../../../helpers/fileUtils.js";
3
+ const p = (e) => {
4
+ const [l, c] = t(null), [n, s] = t(!1), [f, o] = t(!1);
5
+ async function u(d) {
6
+ s(!0);
7
+ const i = await fetch(`/v1/attachments/${d}`, {
8
+ method: "GET"
13
9
  });
10
+ if (!i.ok)
11
+ throw s(!1), o(!0), new Error(`Error loading: ${i.statusText}`);
12
+ const a = await i.blob();
13
+ c(window.URL.createObjectURL(a)), s(!1), o(!1);
14
14
  }
15
- async function m() {
16
- try {
17
- return (await fetch(`${h()}/v1/auth/refresh`, {
18
- method: "POST",
19
- credentials: "include"
20
- })).ok;
21
- } catch {
22
- return !1;
23
- }
24
- }
25
- async function U(i, b) {
26
- n(!0);
27
- let s = await g(i);
28
- if ((s.status === 401 || s.status === 403) && await m() && (s = await g(i)), !s.ok)
29
- throw n(!1), a(!0), new Error(`Error loading: ${s.statusText}`);
30
- const f = await s.blob(), E = b && f.type !== "application/pdf" ? new Blob([f], { type: "application/pdf" }) : f;
31
- y(window.URL.createObjectURL(E)), n(!1), a(!1);
32
- }
33
- const t = v(
15
+ const r = E(
34
16
  e.contentType,
35
17
  e.originalFileName
36
- ), o = (e.contentType || "").toLowerCase() === "application/pdf" || (e.originalFileName || "").toLowerCase().endsWith(".pdf"), c = (e.contentType || "").toLowerCase().startsWith("image/"), l = (e.contentType || "").toLowerCase().startsWith("audio/") || /\.(mp3|wav|ogg|flac|m4a|aac|opus|weba)$/i.test(
37
- e.originalFileName || ""
38
- ), r = c || t || o || l;
39
- return F(() => {
40
- e.id && !t && r && !e.Url && U(e.id, o);
41
- }, [e.Url, e.id, t, o, r]), T(
42
- () => ({
43
- fileUrl: u,
44
- isFetching: d,
45
- isError: w,
46
- setIsError: a,
47
- isVideo: t,
48
- isPdf: o,
49
- isImage: c,
50
- isAudio: l,
51
- isSupported: r
52
- }),
53
- [
54
- u,
55
- w,
56
- d,
57
- t,
58
- o,
59
- c,
60
- l,
61
- r
62
- ]
18
+ );
19
+ return w(() => {
20
+ e.id && !r && !e.Url && u(e.id);
21
+ }, [e.Url, e.id, r]), U(
22
+ () => ({ fileUrl: l, isFetching: n, isError: f, setIsError: o, isVideo: r }),
23
+ [l, f, n, r]
63
24
  );
64
25
  };
65
26
  export {
66
- B as useGetPreviewUrl
27
+ p as useGetPreviewUrl
67
28
  };
@@ -1,39 +1,29 @@
1
- const o = "_container_13fbv_1", n = "_root_13fbv_7", t = "_carouselRoot_13fbv_14", e = "_carouselViewport_13fbv_18", a = "_carouselSlide_13fbv_22", _ = "_navButton_13fbv_29", r = "_navButtonPrev_13fbv_42", i = "_navButtonNext_13fbv_46", v = "_modalContent_13fbv_50", d = "_modalBody_13fbv_55", c = "_videoContainer_13fbv_61", s = "_imageContainer_13fbv_66", u = "_pdfContainer_13fbv_73", f = "_pdfFrame_13fbv_81", l = "_audioContainer_13fbv_88", m = "_audioName_13fbv_103", b = "_audioElement_13fbv_111", C = {
1
+ const o = "_container_sq5v9_1", t = "_root_sq5v9_13", n = "_carouselRoot_sq5v9_27", e = "_carouselViewport_sq5v9_35", a = "_carouselSlide_sq5v9_43", s = "_navButton_sq5v9_57", _ = "_navButtonPrev_sq5v9_83", r = "_navButtonNext_sq5v9_91", v = "_modalContent_sq5v9_99", c = "_modalBody_sq5v9_109", i = "_videoContainer_sq5v9_121", l = "_imageContainer_sq5v9_131", u = {
2
2
  container: o,
3
- root: n,
4
- carouselRoot: t,
3
+ root: t,
4
+ carouselRoot: n,
5
5
  carouselViewport: e,
6
6
  carouselSlide: a,
7
- navButton: _,
8
- navButtonPrev: r,
9
- navButtonNext: i,
7
+ navButton: s,
8
+ navButtonPrev: _,
9
+ navButtonNext: r,
10
10
  modalContent: v,
11
- modalBody: d,
12
- videoContainer: c,
13
- imageContainer: s,
14
- pdfContainer: u,
15
- pdfFrame: f,
16
- audioContainer: l,
17
- audioName: m,
18
- audioElement: b
11
+ modalBody: c,
12
+ videoContainer: i,
13
+ imageContainer: l
19
14
  };
20
15
  export {
21
- l as audioContainer,
22
- b as audioElement,
23
- m as audioName,
24
- t as carouselRoot,
16
+ n as carouselRoot,
25
17
  a as carouselSlide,
26
18
  e as carouselViewport,
27
19
  o as container,
28
- C as default,
29
- s as imageContainer,
30
- d as modalBody,
20
+ u as default,
21
+ l as imageContainer,
22
+ c as modalBody,
31
23
  v as modalContent,
32
- _ as navButton,
33
- i as navButtonNext,
34
- r as navButtonPrev,
35
- u as pdfContainer,
36
- f as pdfFrame,
37
- n as root,
38
- c as videoContainer
24
+ s as navButton,
25
+ r as navButtonNext,
26
+ _ as navButtonPrev,
27
+ t as root,
28
+ i as videoContainer
39
29
  };
@@ -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,mDAgNhC,CAAC"}