@layers-app/shared 0.3.7 → 0.3.9

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 +4 -1
  5. package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
  6. package/dist/components/AppContainer/components/AppSidebarButton.js +22 -15
  7. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
  8. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +22 -21
  9. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  10. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +48 -91
  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 +3 -1
  14. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
  15. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +89 -63
  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 +35 -26
  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 +43 -36
  23. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +6 -0
  24. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +1 -0
  25. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +16 -0
  26. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts +4 -0
  27. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
  28. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +59 -20
  29. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +28 -18
  30. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  31. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +22 -18
  32. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  33. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  34. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  35. package/dist/components/ColorPicker/ColorPicker.d.ts +23 -18
  36. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  37. package/dist/components/ColorPicker/ColorPicker.js +145 -139
  38. package/dist/components/ColorPicker/ColorPicker.module.css.js +14 -14
  39. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  40. package/dist/components/ColorPicker/ColorPickerToolbar.js +71 -88
  41. package/dist/components/ColorPicker/icons.js +1 -1
  42. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  43. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  44. package/dist/components/CommentComposer/CommentEditorHotkeys.js +3 -4
  45. package/dist/components/CommentComposer/index.js +1 -1
  46. package/dist/components/CommentComposer/useVirtualAnchor.d.ts +1 -1
  47. package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -1
  48. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  49. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  50. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  51. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  52. package/dist/components/EmojiPicker/EmojiPanel.js +22 -22
  53. package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -1
  54. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  55. package/dist/components/EmojiPicker/EmojiPicker.js +0 -1
  56. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  57. package/dist/components/EmojiPicker/IconsPanel.js +13 -13
  58. package/dist/components/EntityIcon.d.ts.map +1 -1
  59. package/dist/components/EntityIcon.js +43 -33
  60. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  61. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  62. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  63. package/dist/components/FilePicker/FilePicker.d.ts +2 -4
  64. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  65. package/dist/components/FilePicker/FilePicker.js +226 -241
  66. package/dist/components/FilePicker/FilePicker.module.css.js +12 -14
  67. package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
  68. package/dist/components/FilePicker/FilePickerGallery.js +34 -60
  69. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  70. package/dist/components/FilePicker/FilePickerGiphy.js +39 -38
  71. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  72. package/dist/components/FilePicker/FilePickerLink.js +26 -29
  73. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  74. package/dist/components/FilePicker/FilePickerUnsplash.js +43 -42
  75. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  76. package/dist/components/FilePicker/FilePickerUpload.js +35 -51
  77. package/dist/components/FilePicker/index.d.ts +0 -1
  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 +6 -0
  91. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts.map +1 -1
  92. package/dist/components/FormViewer/hooks/useFormGlobalTheme.js +4 -3
  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 +381 -6358
  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 +3 -1
  105. package/dist/components/GroupAvatar/index.d.ts.map +1 -1
  106. package/dist/components/GroupAvatar/index.js +24 -21
  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 +3 -1
  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 +7 -1
  119. package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts.map +1 -1
  120. package/dist/components/NavMenu/components/NavMenuActionIcon.js +21 -23
  121. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  122. package/dist/components/NewColorPicker/components/Target.d.ts +3 -1
  123. package/dist/components/NewColorPicker/components/Target.d.ts.map +1 -1
  124. package/dist/components/NewColorPicker/components/Target.js +48 -43
  125. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  126. package/dist/components/Notification/Notification.js +3 -1
  127. package/dist/components/Notification/Notification.module.css.js +1 -1
  128. package/dist/components/Notification/NotificationCard.d.ts +3 -1
  129. package/dist/components/Notification/NotificationCard.d.ts.map +1 -1
  130. package/dist/components/Notification/NotificationCard.js +87 -86
  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 +70 -74
  137. package/dist/components/ProjectIcon/ProjectIcon.d.ts +7 -12
  138. package/dist/components/ProjectIcon/ProjectIcon.d.ts.map +1 -1
  139. package/dist/components/ProjectIcon/ProjectIcon.js +58 -60
  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/TextColorIcon.d.ts +8 -0
  144. package/dist/components/TextColorIcon.d.ts.map +1 -0
  145. package/dist/components/TextColorIcon.js +60 -0
  146. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  147. package/dist/components/UserAvatar/index.d.ts +2 -1
  148. package/dist/components/UserAvatar/index.d.ts.map +1 -1
  149. package/dist/components/UserAvatar/index.js +38 -35
  150. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +3 -3
  151. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts.map +1 -1
  152. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +19 -18
  153. package/dist/components/WorkspaceMenu/WorkspaceItem.js +17 -17
  154. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +7 -7
  155. package/dist/components/table/FrontTable.d.ts.map +1 -1
  156. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  157. package/dist/config/envConfig.d.ts +8 -0
  158. package/dist/config/envConfig.d.ts.map +1 -1
  159. package/dist/config/envConfig.js +21 -13
  160. package/dist/helpers/getFileIcons.d.ts.map +1 -1
  161. package/dist/helpers/getFileIcons.js +63 -45
  162. package/dist/helpers/getFileType.d.ts +1 -1
  163. package/dist/helpers/getFileType.d.ts.map +1 -1
  164. package/dist/helpers/getFileType.js +29 -8
  165. package/dist/helpers/getPartOfTheDay.d.ts +1 -1
  166. package/dist/helpers/offlineSuppression.d.ts +3 -0
  167. package/dist/helpers/offlineSuppression.d.ts.map +1 -0
  168. package/dist/helpers/offlineSuppression.js +8 -0
  169. package/dist/helpers/platform.d.ts +1 -1
  170. package/dist/helpers/platform.d.ts.map +1 -1
  171. package/dist/helpers/platform.js +5 -4
  172. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  173. package/dist/helpers/showNotifications.d.ts.map +1 -1
  174. package/dist/helpers/showNotifications.js +30 -29
  175. package/dist/helpers/showNotifications.module.css.js +1 -1
  176. package/dist/hooks/useOutsideClick.d.ts +1 -1
  177. package/dist/hooks/useOutsideClick.d.ts.map +1 -1
  178. package/dist/index.css +1 -1
  179. package/dist/index.d.ts +2 -1
  180. package/dist/index.d.ts.map +1 -1
  181. package/dist/index.js +467 -465
  182. package/dist/lang/locales/ui_en.json.js +18 -20
  183. package/dist/lang/locales/ui_es.json.js +12 -14
  184. package/dist/lang/locales/ui_ru.json.js +13 -15
  185. package/dist/node_modules/countries-and-timezones/esm/index.js +281 -4011
  186. package/docs/README.md +499 -499
  187. package/package.json +75 -75
  188. package/dist/components/FilePicker/coverCollections.d.ts +0 -4
  189. package/dist/components/FilePicker/coverCollections.d.ts.map +0 -1
  190. package/dist/components/FilePicker/coverCollections.js +0 -164
@@ -1,23 +1,22 @@
1
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import { useState as E, useMemo as u, useEffect as ne } from "react";
3
- import { useTranslation as le } from "react-i18next";
4
- import { ImageAdd02Icon as V } from "@hugeicons/core-free-icons";
5
- import { HugeiconsIcon as j } from "@hugeicons/react";
6
- import { Flex as r, ActionIcon as ie, Button as A, Text as re, Tabs as x, Box as ae, Popover as F, Stack as oe } from "@mantine/core";
7
- import { getEnvConfig as L } from "../../config/envConfig.js";
8
- import { isFeature as se } from "../../helpers/feature.js";
9
- import { useMenu as te } from "../../hooks/useMenu.js";
10
- import { usePlatform as ce } from "../../hooks/usePlatform.js";
11
- import { MediaLibraryBrowser as de } from "../MediaLibrary/MediaLibraryBrowser.js";
12
- import { FilePickerGallery as ue } from "./FilePickerGallery.js";
13
- import { FilePickerGiphy as he } from "./FilePickerGiphy.js";
14
- import { FilePickerLink as pe } from "./FilePickerLink.js";
15
- import { FilePickerUnsplash as me } from "./FilePickerUnsplash.js";
16
- import { FilePickerGoogleDrive as fe } from "./FilePickerGoogleDrive.js";
17
- import { FilePickerUpload as ge } from "./FilePickerUpload.js";
18
- import { coverCollections as ve } from "./coverCollections.js";
19
- import w from "./FilePicker.module.css.js";
20
- const be = [
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { useState as x, useMemo as y } from "react";
3
+ import { useTranslation as J } from "react-i18next";
4
+ import { ImageAdd02Icon as F } from "@hugeicons/core-free-icons";
5
+ import { HugeiconsIcon as P } from "@hugeicons/react";
6
+ import { Flex as a, ActionIcon as K, Button as M, Text as Q, Popover as u, Tabs as f, Stack as W } from "@mantine/core";
7
+ import { getEnvConfig as S } from "../../config/envConfig.js";
8
+ import { isFeature as X } from "../../helpers/feature.js";
9
+ import { useMenu as Y } from "../../hooks/useMenu.js";
10
+ import { usePlatform as Z } from "../../hooks/usePlatform.js";
11
+ import { MediaLibraryBrowser as $ } from "../MediaLibrary/MediaLibraryBrowser.js";
12
+ import { FilePickerGallery as D } from "./FilePickerGallery.js";
13
+ import { FilePickerGiphy as ee } from "./FilePickerGiphy.js";
14
+ import { FilePickerGoogleDrive as ne } from "./FilePickerGoogleDrive.js";
15
+ import { FilePickerLink as ie } from "./FilePickerLink.js";
16
+ import { FilePickerUnsplash as le } from "./FilePickerUnsplash.js";
17
+ import { FilePickerUpload as ae } from "./FilePickerUpload.js";
18
+ import I from "./FilePicker.module.css.js";
19
+ const re = [
21
20
  "gallery",
22
21
  "upload",
23
22
  "link",
@@ -25,245 +24,231 @@ const be = [
25
24
  "giphy",
26
25
  "googleDrive",
27
26
  "media"
28
- ], _e = ({
29
- onChange: N,
30
- onRemove: U,
31
- onUpload: b,
32
- uploading: _ = !1,
33
- showTabs: o = be,
34
- children: H,
35
- width: O = 610,
36
- position: R = "bottom-end",
37
- readOnly: $ = !1,
38
- hasImage: q,
39
- giphyToken: Ce,
40
- unsplashClientId: ke,
41
- type: S = "image",
42
- galleryCollection: h = [],
43
- isValidMediaUrl: J,
44
- popoverProps: K,
45
- dropZoneProps: Q,
46
- targetProps: W,
47
- onOpenedChange: X,
48
- googleDrive: l,
49
- mediaLibrary: a,
50
- inline: p = !1,
51
- tab: C
27
+ ], Se = ({
28
+ onChange: z,
29
+ onRemove: B,
30
+ onUpload: m,
31
+ uploading: E = !1,
32
+ showTabs: s = re,
33
+ children: G,
34
+ width: T = 610,
35
+ position: V = "bottom-end",
36
+ readOnly: j = !1,
37
+ hasImage: L,
38
+ giphyToken: se,
39
+ unsplashClientId: oe,
40
+ type: g = "image",
41
+ galleryCollection: d = [],
42
+ isValidMediaUrl: A,
43
+ popoverProps: N,
44
+ dropZoneProps: U,
45
+ targetProps: _,
46
+ onOpenedChange: H,
47
+ googleDrive: i,
48
+ mediaLibrary: r
52
49
  }) => {
53
- const { t: i } = le("ui"), [T, m] = E(!1), { isMobile: I } = te(), M = ce(), f = u(() => h.length > 0 ? h : p ? ve.map((n) => ({
54
- ...n,
55
- title: i(`coverGroups.${n.id}`, { defaultValue: n.id })
56
- })) : h, [h, p, i]), s = u(() => [
57
- {
58
- value: "gallery",
59
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.gallery") }) }),
60
- visible: o.includes("gallery") && !!f.length
61
- },
62
- {
63
- value: "upload",
64
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.upload") }) }),
65
- visible: o.includes("upload") && !!b
66
- },
67
- {
68
- value: "link",
69
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.link") }) }),
70
- visible: o.includes("link")
71
- },
72
- {
73
- value: "unsplash",
74
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.searchImages") }) }),
75
- visible: o.includes("unsplash") && L().media?.unsplashEnabled !== !1
76
- },
77
- {
78
- value: "giphy",
79
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
80
- visible: o.includes("giphy") && M.has("giphy") && L().media?.giphyEnabled !== !1
81
- },
82
- {
83
- value: "googleDrive",
84
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.googleDrive", {
85
- defaultValue: "Google Drive"
86
- }) }) }),
87
- visible: o.includes("googleDrive") && !!l
88
- },
89
- {
90
- value: "media",
91
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.media", { defaultValue: "Media" }) }) }),
92
- visible: o.includes("media") && !!a && se()
93
- }
94
- ].filter((y) => y.visible), [
95
- o,
96
- M,
97
- i,
98
- f.length,
99
- b,
100
- l,
101
- a
102
- ]), g = C !== void 0, [Y, P] = E(() => C !== void 0 ? "" : s[0]?.value ?? "");
103
- ne(() => {
104
- g || s.length && P((n) => n && s.some((y) => y.value === n) ? n : s[0].value);
105
- }, [s, g]);
106
- const k = u(() => s.map((n) => n.value), [s]), v = g ? C : Y, t = u(() => v && k.includes(v) ? v : k[0] ?? "", [v, k]), z = (n) => {
107
- g || P(n);
108
- }, Z = (n) => {
109
- b?.(n, m);
110
- }, c = (n) => {
111
- N?.(n), p || m(!1);
112
- }, D = u(() => I ? /* @__PURE__ */ d(ie, { size: "lg", children: [
113
- /* @__PURE__ */ e(j, { icon: V, size: 22 }),
114
- " "
115
- ] }) : /* @__PURE__ */ e(
116
- A,
117
- {
118
- variant: "default",
119
- size: "xs",
120
- leftSection: /* @__PURE__ */ e(j, { icon: V, size: 16 }),
121
- children: /* @__PURE__ */ e(re, { fw: 600, size: "sm", children: i("changeCover.change") })
122
- }
123
- ), [i, I]), G = (n) => {
124
- m(n), X?.(n);
125
- }, B = /* @__PURE__ */ d(oe, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
126
- t === "gallery" && !!f.length && /* @__PURE__ */ e(
127
- ue,
50
+ const { t: l } = J("ui"), [v, p] = x(!1), { isMobile: b } = Y(), k = Z(), h = y(
51
+ () => [
128
52
  {
129
- galleryCollection: f,
130
- onChange: c
131
- }
132
- ),
133
- t === "upload" && /* @__PURE__ */ e(
134
- ge,
53
+ value: "gallery",
54
+ label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.gallery") }) }),
55
+ visible: s.includes("gallery") && !!d.length
56
+ },
135
57
  {
136
- type: S || "image",
137
- uploading: _,
138
- dropZoneProps: Q,
139
- onUpload: Z
140
- }
141
- ),
142
- t === "link" && /* @__PURE__ */ e(
143
- pe,
58
+ value: "upload",
59
+ label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.upload") }) }),
60
+ visible: s.includes("upload") && !!m
61
+ },
144
62
  {
145
- type: S || "image",
146
- onChange: c,
147
- isValidMediaUrl: J
148
- }
149
- ),
150
- t === "unsplash" && /* @__PURE__ */ e(me, { onChange: c }),
151
- t === "giphy" && /* @__PURE__ */ e(he, { onChange: c }),
152
- t === "googleDrive" && l && /* @__PURE__ */ e(
153
- fe,
63
+ value: "link",
64
+ label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.link") }) }),
65
+ visible: s.includes("link")
66
+ },
154
67
  {
155
- isConnected: l.isConnected,
156
- connectedEmail: l.connectedEmail,
157
- files: l.files,
158
- isLoading: l.isLoading,
159
- hasMore: l.hasMore,
160
- isImporting: l.isImporting,
161
- onSearch: l.onSearch,
162
- onLoadMore: l.onLoadMore,
163
- onSelect: (n) => {
164
- l.onSelect(n, c);
165
- },
166
- error: l.error
167
- }
168
- ),
169
- t === "media" && a && /* @__PURE__ */ e(
170
- de,
68
+ value: "unsplash",
69
+ label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.searchImages") }) }),
70
+ visible: s.includes("unsplash") && S().media?.unsplashEnabled !== !1
71
+ },
171
72
  {
172
- items: a.items,
173
- isLoading: a.isLoading,
174
- breadcrumbs: a.breadcrumbs,
175
- onFolderClick: a.onFolderClick,
176
- onBreadcrumbClick: a.onBreadcrumbClick,
177
- onSelect: (n) => {
178
- a.onSelect?.(n), m(!1);
179
- }
180
- }
181
- )
182
- ] }), ee = /* @__PURE__ */ e(r, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
183
- x,
184
- {
185
- defaultValue: "gallery",
186
- value: t,
187
- onChange: (n) => n && z(n),
188
- styles: {
189
- list: {
190
- alignItems: "center",
191
- paddingRight: "var(--mantine-spacing-xs)"
192
- }
73
+ value: "giphy",
74
+ label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
75
+ visible: s.includes("giphy") && k.has("giphy") && S().media?.giphyEnabled !== !1
193
76
  },
194
- w: "100%",
195
- children: /* @__PURE__ */ d(
196
- x.List,
197
- {
198
- style: {
199
- gap: "4px"
200
- },
201
- px: 8,
202
- h: 54,
203
- children: [
204
- s.map((n) => /* @__PURE__ */ e(
205
- x.Tab,
206
- {
207
- className: w.originalTab,
208
- disabled: $,
209
- h: "100%",
210
- p: 0,
211
- value: n.value,
212
- onClick: () => z(n.value),
213
- children: /* @__PURE__ */ e(r, { className: w.customTab, px: "sm", h: 36, children: n.label })
214
- },
215
- n.value
216
- )),
217
- q && /* @__PURE__ */ e(
218
- A,
219
- {
220
- variant: "subtle",
221
- fz: "sm",
222
- lh: "sm",
223
- fw: 500,
224
- px: "sm",
225
- size: "30px",
226
- onClick: U,
227
- color: "var(--mantine-color-gray-light-color)",
228
- style: { marginLeft: "auto" },
229
- children: i("remove")
230
- }
231
- )
232
- ]
233
- }
234
- )
235
- }
236
- ) });
237
- return p ? /* @__PURE__ */ e(
238
- ae,
77
+ {
78
+ value: "googleDrive",
79
+ label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.googleDrive", {
80
+ defaultValue: "Google Drive"
81
+ }) }) }),
82
+ visible: s.includes("googleDrive") && !!i
83
+ },
84
+ {
85
+ value: "media",
86
+ label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.media", { defaultValue: "Media" }) }) }),
87
+ visible: s.includes("media") && !!r && X()
88
+ }
89
+ ].filter((n) => n.visible),
90
+ [
91
+ s,
92
+ k,
93
+ l,
94
+ d.length,
95
+ m,
96
+ i,
97
+ r
98
+ ]
99
+ ), [o, O] = x(() => {
100
+ if (h[0]) return h[0].value;
101
+ const n = h.find((w) => w.visible);
102
+ return n ? n.value : "";
103
+ }), R = (n) => {
104
+ m?.(n, p);
105
+ }, t = (n) => {
106
+ z?.(n), p(!1);
107
+ }, q = y(() => b ? /* @__PURE__ */ c(K, { size: "lg", children: [
108
+ /* @__PURE__ */ e(P, { icon: F, size: 22 }),
109
+ " "
110
+ ] }) : /* @__PURE__ */ e(
111
+ M,
239
112
  {
240
- "data-file-picker-inline": !0,
241
- bdrs: 8,
242
- p: 12,
243
- bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-7))",
244
- children: B
113
+ variant: "default",
114
+ size: "xs",
115
+ leftSection: /* @__PURE__ */ e(P, { icon: F, size: 16 }),
116
+ children: /* @__PURE__ */ e(Q, { fw: 600, size: "sm", children: l("changeCover.change") })
245
117
  }
246
- ) : /* @__PURE__ */ d(
247
- F,
118
+ ), [l, b]), C = (n) => {
119
+ p(n), H?.(n);
120
+ };
121
+ return /* @__PURE__ */ c(
122
+ u,
248
123
  {
249
- width: O,
124
+ width: T,
250
125
  radius: "var(--mantine-spacing-sm)",
251
- position: R,
126
+ position: V,
252
127
  shadow: "md",
253
- opened: T,
254
- onChange: G,
128
+ opened: v,
129
+ onChange: C,
255
130
  withinPortal: !0,
256
- ...K || {},
131
+ ...N || {},
257
132
  children: [
258
- /* @__PURE__ */ e(F.Target, { children: /* @__PURE__ */ e(r, { onClick: () => G(!T), ...W, children: H ?? D }) }),
259
- /* @__PURE__ */ d(F.Dropdown, { p: 0, children: [
260
- ee,
261
- B
133
+ /* @__PURE__ */ e(u.Target, { children: /* @__PURE__ */ e(a, { onClick: () => C(!v), ..._, children: G ?? q }) }),
134
+ /* @__PURE__ */ c(u.Dropdown, { p: 0, children: [
135
+ /* @__PURE__ */ e(a, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
136
+ f,
137
+ {
138
+ defaultValue: "gallery",
139
+ value: o,
140
+ styles: {
141
+ list: {
142
+ alignItems: "center",
143
+ paddingRight: "var(--mantine-spacing-xs)"
144
+ }
145
+ },
146
+ w: "100%",
147
+ children: /* @__PURE__ */ c(
148
+ f.List,
149
+ {
150
+ style: {
151
+ gap: "4px"
152
+ },
153
+ px: 8,
154
+ h: 54,
155
+ children: [
156
+ h.map((n) => /* @__PURE__ */ e(
157
+ f.Tab,
158
+ {
159
+ className: I.originalTab,
160
+ disabled: j,
161
+ h: "100%",
162
+ p: 0,
163
+ value: n.value,
164
+ onClick: () => O(n.value),
165
+ children: /* @__PURE__ */ e(a, { className: I.customTab, px: "sm", h: 36, children: n.label })
166
+ },
167
+ n.value
168
+ )),
169
+ L && /* @__PURE__ */ e(
170
+ M,
171
+ {
172
+ variant: "subtle",
173
+ fz: "sm",
174
+ lh: "sm",
175
+ fw: 500,
176
+ px: "sm",
177
+ size: "30px",
178
+ onClick: B,
179
+ color: "var(--mantine-color-gray-light-color)",
180
+ style: { marginLeft: "auto" },
181
+ children: l("remove")
182
+ }
183
+ )
184
+ ]
185
+ }
186
+ )
187
+ }
188
+ ) }),
189
+ /* @__PURE__ */ c(W, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
190
+ o === "gallery" && !!d.length && /* @__PURE__ */ e(
191
+ D,
192
+ {
193
+ galleryCollection: d,
194
+ onChange: t
195
+ }
196
+ ),
197
+ o === "upload" && /* @__PURE__ */ e(
198
+ ae,
199
+ {
200
+ type: g || "image",
201
+ uploading: E,
202
+ dropZoneProps: U,
203
+ onUpload: R
204
+ }
205
+ ),
206
+ o === "link" && /* @__PURE__ */ e(
207
+ ie,
208
+ {
209
+ type: g || "image",
210
+ onChange: t,
211
+ isValidMediaUrl: A
212
+ }
213
+ ),
214
+ o === "unsplash" && /* @__PURE__ */ e(le, { onChange: t }),
215
+ o === "giphy" && /* @__PURE__ */ e(ee, { onChange: t }),
216
+ o === "googleDrive" && i && /* @__PURE__ */ e(
217
+ ne,
218
+ {
219
+ isConnected: i.isConnected,
220
+ connectedEmail: i.connectedEmail,
221
+ files: i.files,
222
+ isLoading: i.isLoading,
223
+ hasMore: i.hasMore,
224
+ isImporting: i.isImporting,
225
+ onSearch: i.onSearch,
226
+ onLoadMore: i.onLoadMore,
227
+ onSelect: (n) => {
228
+ i.onSelect(n, t);
229
+ },
230
+ error: i.error
231
+ }
232
+ ),
233
+ o === "media" && r && /* @__PURE__ */ e(
234
+ $,
235
+ {
236
+ items: r.items,
237
+ isLoading: r.isLoading,
238
+ breadcrumbs: r.breadcrumbs,
239
+ onFolderClick: r.onFolderClick,
240
+ onBreadcrumbClick: r.onBreadcrumbClick,
241
+ onSelect: (n) => {
242
+ r.onSelect?.(n), p(!1);
243
+ }
244
+ }
245
+ )
246
+ ] })
262
247
  ] })
263
248
  ]
264
249
  }
265
250
  );
266
251
  };
267
252
  export {
268
- _e as FilePicker
253
+ Se as FilePicker
269
254
  };
@@ -1,17 +1,15 @@
1
- const o = "_itemImage_7zb8o_1", t = "_imageAuthor_7zb8o_27", e = "_originalTab_7zb8o_43", _ = "_customTab_7zb8o_55", a = "_button_7zb8o_71", n = "_pickerDropZone_7zb8o_91", b = {
2
- itemImage: o,
3
- imageAuthor: t,
4
- originalTab: e,
5
- customTab: _,
6
- button: a,
7
- pickerDropZone: n
1
+ const t = "_itemImage_1me1c_1", o = "_imageAuthor_1me1c_14", a = "_originalTab_1me1c_22", e = "_customTab_1me1c_28", m = "_button_1me1c_36", _ = {
2
+ itemImage: t,
3
+ imageAuthor: o,
4
+ originalTab: a,
5
+ customTab: e,
6
+ button: m
8
7
  };
9
8
  export {
10
- a as button,
11
- _ as customTab,
12
- b as default,
13
- t as imageAuthor,
14
- o as itemImage,
15
- e as originalTab,
16
- n as pickerDropZone
9
+ m as button,
10
+ e as customTab,
11
+ _ as default,
12
+ o as imageAuthor,
13
+ t as itemImage,
14
+ a as originalTab
17
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FilePickerGallery.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGallery.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAIvD,eAAO,MAAM,iBAAiB,GAAI,kCAG/B;IACD,iBAAiB,EAAE,4BAA4B,EAAE,CAAC;IAClD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAyEA,CAAC"}
1
+ {"version":3,"file":"FilePickerGallery.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGallery.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAIvD,eAAO,MAAM,iBAAiB,GAAI,kCAG/B;IACD,iBAAiB,EAAE,4BAA4B,EAAE,CAAC;IAClD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAqCA,CAAC"}
@@ -1,64 +1,38 @@
1
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
- import { useState as d, useMemo as f } from "react";
3
- import { useTranslation as x } from "react-i18next";
4
- import { Search01Icon as $ } from "@hugeicons/core-free-icons";
5
- import { HugeiconsIcon as v } from "@hugeicons/react";
6
- import { Stack as m, FocusTrap as g, TextInput as I, Text as u, SimpleGrid as w, AspectRatio as C } from "@mantine/core";
7
- import S from "./FilePicker.module.css.js";
8
- const G = ({
9
- galleryCollection: n,
10
- onChange: p
11
- }) => {
12
- const { t: a } = x("ui"), [i, h] = d(""), l = f(() => {
13
- const e = i.trim().toLowerCase();
14
- return e ? n.map((t) => ({
15
- ...t,
16
- items: t.items.filter((s) => `${t.title} ${t.id} ${t.path} ${s}`.toLowerCase().includes(e))
17
- })).filter((t) => t.items.length > 0) : n;
18
- }, [n, i]);
19
- return /* @__PURE__ */ c(m, { gap: "sm", children: [
20
- /* @__PURE__ */ r(g, { active: !0, children: /* @__PURE__ */ r(
21
- I,
1
+ import { jsx as r, jsxs as n } from "react/jsx-runtime";
2
+ import { Stack as l, Text as o, SimpleGrid as p, AspectRatio as c } from "@mantine/core";
3
+ import d from "./FilePicker.module.css.js";
4
+ const x = ({
5
+ galleryCollection: s,
6
+ onChange: t
7
+ }) => /* @__PURE__ */ r(l, { gap: "xs", mah: 400, w: "100%", style: { overflow: "auto" }, children: s.map((e) => /* @__PURE__ */ n(l, { gap: 4, pb: "sm", children: [
8
+ /* @__PURE__ */ r("a", { target: "_blank", href: e?.url || "#", children: /* @__PURE__ */ r(
9
+ o,
10
+ {
11
+ fz: "xs",
12
+ fw: 500,
13
+ lh: "xs",
14
+ c: "dimmed",
15
+ component: "span",
16
+ td: "none",
17
+ children: e.title
18
+ }
19
+ ) }),
20
+ /* @__PURE__ */ r(p, { spacing: 10, cols: 4, children: e.items.map((m, a) => {
21
+ const i = "/images/covers/" + e.path + m;
22
+ return /* @__PURE__ */ r(
23
+ c,
22
24
  {
23
- leftSection: /* @__PURE__ */ r(v, { size: 16, icon: $ }),
24
- maxLength: 50,
25
- placeholder: a("changeCover.searchImage"),
26
- "data-autofocus": !0,
27
- value: i,
28
- onChange: (e) => h(e.currentTarget.value)
29
- }
30
- ) }),
31
- /* @__PURE__ */ r(m, { gap: "xs", mah: 400, w: "100%", style: { overflow: "auto" }, children: l.length === 0 && i.trim() ? /* @__PURE__ */ r(u, { fz: "xs", c: "dimmed", ta: "center", py: "xs", children: a("changeCover.noResult") }) : l.map((e) => /* @__PURE__ */ c(m, { gap: 4, pb: "sm", children: [
32
- /* @__PURE__ */ r("a", { target: "_blank", href: e?.url || "#", rel: "noreferrer", children: /* @__PURE__ */ r(
33
- u,
34
- {
35
- fz: "xs",
36
- fw: 500,
37
- lh: "xs",
38
- c: "dimmed",
39
- component: "span",
40
- td: "none",
41
- children: e.title
25
+ onClick: () => t?.(i),
26
+ ratio: 120 / 65,
27
+ className: d.itemImage,
28
+ style: {
29
+ backgroundImage: `url(${i})`
42
30
  }
43
- ) }),
44
- /* @__PURE__ */ r(w, { spacing: 10, cols: 4, children: e.items.map((t, s) => {
45
- const o = "/images/covers/" + e.path + t;
46
- return /* @__PURE__ */ r(
47
- C,
48
- {
49
- onClick: () => p?.(o),
50
- ratio: 120 / 65,
51
- className: S.itemImage,
52
- style: {
53
- backgroundImage: `url(${o})`
54
- }
55
- },
56
- `${e.id}-${t}-${s}`
57
- );
58
- }) })
59
- ] }, e.id)) })
60
- ] });
61
- };
31
+ },
32
+ a
33
+ );
34
+ }) })
35
+ ] }, e.id)) });
62
36
  export {
63
- G as FilePickerGallery
37
+ x as FilePickerGallery
64
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FilePickerGiphy.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGiphy.tsx"],"names":[],"mappings":"AAoCA,eAAO,MAAM,eAAe,GAAI,eAE7B;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAqGA,CAAC"}
1
+ {"version":3,"file":"FilePickerGiphy.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGiphy.tsx"],"names":[],"mappings":"AAmCA,eAAO,MAAM,eAAe,GAAI,eAE7B;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAoGA,CAAC"}