@layers-app/shared 0.2.6 → 0.2.8-test

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 (186) hide show
  1. package/dist/assets/svg/socials/instagram.svg.js +3 -3
  2. package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
  3. package/dist/components/AliasTextInput/AliasTextInput.js +21 -20
  4. package/dist/components/AppContainer/AppContainer.js +3 -3
  5. package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
  6. package/dist/components/AppContainer/components/AppSidebarButton.d.ts +1 -1
  7. package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
  8. package/dist/components/AppContainer/components/AppSidebarButton.js +4 -4
  9. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
  10. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +40 -32
  11. package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
  12. package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +41 -33
  13. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  14. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +58 -49
  15. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
  16. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +151 -51
  17. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  18. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  19. package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
  20. package/dist/components/AppContainer/hooks/useAppContainer.js +46 -43
  21. package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
  22. package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
  23. package/dist/components/AppContainer/types.d.ts +2 -1
  24. package/dist/components/AppContainer/types.d.ts.map +1 -1
  25. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  26. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  27. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +14 -14
  28. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  29. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  30. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  31. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  32. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  33. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  34. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  35. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  36. package/dist/components/EmojiPicker/EmojiPicker.js +28 -29
  37. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  38. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  39. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  40. package/dist/components/FeatureProgress/FeatureProgress.d.ts +11 -0
  41. package/dist/components/FeatureProgress/FeatureProgress.d.ts.map +1 -0
  42. package/dist/components/FeatureProgress/FeatureProgress.js +148 -0
  43. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +81 -0
  44. package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.d.ts +2 -0
  45. package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.d.ts.map +1 -0
  46. package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.js +88 -0
  47. package/dist/components/FeatureProgress/FeatureProgressCompleteModal.d.ts +9 -0
  48. package/dist/components/FeatureProgress/FeatureProgressCompleteModal.d.ts.map +1 -0
  49. package/dist/components/FeatureProgress/FeatureProgressCompleteModal.js +35 -0
  50. package/dist/components/FeatureProgress/constants.d.ts +4 -0
  51. package/dist/components/FeatureProgress/constants.d.ts.map +1 -0
  52. package/dist/components/FeatureProgress/constants.js +4 -0
  53. package/dist/components/FeatureProgress/index.d.ts +3 -0
  54. package/dist/components/FeatureProgress/index.d.ts.map +1 -0
  55. package/dist/components/FilePicker/FilePicker.d.ts +4 -2
  56. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  57. package/dist/components/FilePicker/FilePicker.js +247 -229
  58. package/dist/components/FilePicker/FilePicker.module.css.js +12 -10
  59. package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
  60. package/dist/components/FilePicker/FilePickerGallery.js +59 -33
  61. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  62. package/dist/components/FilePicker/FilePickerGiphy.js +38 -38
  63. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  64. package/dist/components/FilePicker/FilePickerLink.js +18 -15
  65. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  66. package/dist/components/FilePicker/FilePickerUnsplash.js +39 -39
  67. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  68. package/dist/components/FilePicker/FilePickerUpload.js +51 -35
  69. package/dist/components/FilePicker/api/giphyApi.js +10 -10
  70. package/dist/components/FilePicker/coverCollections.d.ts +4 -0
  71. package/dist/components/FilePicker/coverCollections.d.ts.map +1 -0
  72. package/dist/components/FilePicker/coverCollections.js +164 -0
  73. package/dist/components/FilePicker/index.d.ts +1 -0
  74. package/dist/components/FilePicker/index.d.ts.map +1 -1
  75. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  76. package/dist/components/FormViewer/components/OneSlideLayput.js +39 -37
  77. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  78. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  79. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  80. package/dist/components/FormViewer/components/fields/SelectableCard/PictureSelectableCard.js +42 -42
  81. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  82. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  83. package/dist/components/FormViewer/hooks/useCreateFormContext.d.ts.map +1 -1
  84. package/dist/components/FormViewer/hooks/useCreateFormContext.js +10 -10
  85. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  86. package/dist/components/FormViewer/store/formStoreApi.js +13 -13
  87. package/dist/components/ImageCropper/ImageCropper.d.ts.map +1 -1
  88. package/dist/components/ImageCropper/ImageCropper.js +185 -183
  89. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  90. package/dist/components/ImageCropper/index.d.ts +1 -1
  91. package/dist/components/ImageCropper/index.d.ts.map +1 -1
  92. package/dist/components/ImageCropper/useCropInteraction.d.ts.map +1 -1
  93. package/dist/components/ImageCropper/useCropInteraction.js +13 -2
  94. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts.map +1 -1
  95. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +7 -7
  96. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts +1 -1
  97. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts.map +1 -1
  98. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.js +3 -1
  99. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts +1 -1
  100. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts.map +1 -1
  101. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.js +3 -1
  102. package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
  103. package/dist/components/LanguagePicker/LanguagePicker.js +45 -35
  104. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +6 -4
  105. package/dist/components/Loaders/styles.module.css.js +6 -6
  106. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  107. package/dist/components/MediaLibrary/MediaLibraryRow.d.ts.map +1 -1
  108. package/dist/components/MediaLibrary/MediaLibraryRow.js +16 -4
  109. package/dist/components/NavMenu/NavMenu.d.ts +2 -1
  110. package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
  111. package/dist/components/NavMenu/NavMenu.module.css.js +16 -16
  112. package/dist/components/NavMenu/components/NavMenuItem.d.ts +2 -1
  113. package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
  114. package/dist/components/NavMenu/components/NavMenuItem.js +128 -106
  115. package/dist/components/NavMenu/types.d.ts +1 -0
  116. package/dist/components/NavMenu/types.d.ts.map +1 -1
  117. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  118. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  119. package/dist/components/Notification/Notification.module.css.js +1 -1
  120. package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
  121. package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
  122. package/dist/components/OnBoarding/styles.module.css.js +7 -7
  123. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts +17 -0
  124. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts.map +1 -0
  125. package/dist/components/OnboardingTour/OnboardingTourFooter.js +40 -0
  126. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +13 -0
  127. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -0
  128. package/dist/components/OnboardingTour/OnboardingTourWrapper.js +164 -0
  129. package/dist/components/OnboardingTour/index.d.ts +4 -0
  130. package/dist/components/OnboardingTour/index.d.ts.map +1 -0
  131. package/dist/components/OnboardingTour/useOnboardingTour.d.ts +14 -0
  132. package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -0
  133. package/dist/components/OnboardingTour/useOnboardingTour.js +50 -0
  134. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  135. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  136. package/dist/components/SocialLinkRow/index.d.ts.map +1 -1
  137. package/dist/components/SocialLinkRow/index.js +80 -58
  138. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  139. package/dist/components/TimezonePicker/index.d.ts.map +1 -1
  140. package/dist/components/TimezonePicker/index.js +42 -41
  141. package/dist/components/UserAvatar/index.d.ts.map +1 -1
  142. package/dist/components/UserAvatar/index.js +11 -10
  143. package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
  144. package/dist/components/WorkspaceMenu/WorkspaceItem.js +21 -21
  145. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
  146. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +74 -74
  147. package/dist/components/table/FrontTable.d.ts.map +1 -1
  148. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  149. package/dist/helpers/getFileIcons.js +1 -1
  150. package/dist/helpers/getFileType.d.ts +1 -1
  151. package/dist/helpers/getFileType.d.ts.map +1 -1
  152. package/dist/helpers/platform.d.ts +14 -0
  153. package/dist/helpers/platform.d.ts.map +1 -0
  154. package/dist/helpers/platform.js +33 -0
  155. package/dist/helpers/showFeatureFeedback.d.ts +16 -0
  156. package/dist/helpers/showFeatureFeedback.d.ts.map +1 -0
  157. package/dist/helpers/showFeatureFeedback.js +109 -0
  158. package/dist/helpers/showFeatureFeedback.module.css.js +9 -0
  159. package/dist/helpers/showNotifications.d.ts.map +1 -1
  160. package/dist/helpers/showNotifications.js +81 -113
  161. package/dist/helpers/showNotifications.module.css.js +10 -10
  162. package/dist/hooks/useFeatureFeedback.d.ts +23 -0
  163. package/dist/hooks/useFeatureFeedback.d.ts.map +1 -0
  164. package/dist/hooks/useFeatureFeedback.js +45 -0
  165. package/dist/hooks/usePlatform.d.ts +3 -0
  166. package/dist/hooks/usePlatform.d.ts.map +1 -0
  167. package/dist/hooks/usePlatform.js +10 -0
  168. package/dist/index.css +1 -1
  169. package/dist/index.d.ts +8 -0
  170. package/dist/index.d.ts.map +1 -1
  171. package/dist/index.js +373 -334
  172. package/dist/lang/locales/ui_en.json.js +15 -15
  173. package/dist/lang/locales/ui_es.json.js +13 -13
  174. package/dist/lang/locales/ui_ru.json.js +12 -12
  175. package/dist/lib/contentImport/lexicalSerializer.js +59 -47
  176. package/dist/lib/contentImport/utils.d.ts.map +1 -1
  177. package/dist/lib/layersVisitData.d.ts +13 -0
  178. package/dist/lib/layersVisitData.d.ts.map +1 -0
  179. package/dist/lib/layersVisitData.js +37 -0
  180. package/dist/store/featureProgress.d.ts +39 -0
  181. package/dist/store/featureProgress.d.ts.map +1 -0
  182. package/dist/store/featureProgress.js +68 -0
  183. package/dist/store/plansModal.d.ts.map +1 -1
  184. package/dist/store/plansModal.js +8 -6
  185. package/docs/README.md +499 -499
  186. package/package.json +75 -74
@@ -1 +1 @@
1
- {"version":3,"file":"FilePicker.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAqB,MAAM,OAAO,CAAC;AAK7D,OAAO,EAIL,SAAS,EACT,gBAAgB,EAEhB,YAAY,EAIb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKhE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAOvE,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAIjE,QAAA,MAAM,YAAY,qFAQR,CAAC;AAEX,KAAK,OAAO,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,EAAE,CACT,KAAK,E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Translation as Q } from "react-i18next";
4
- import { ImageAdd02Icon as P } from "@hugeicons/core-free-icons";
5
- import { HugeiconsIcon as S } from "@hugeicons/react";
6
- import { Flex as r, ActionIcon as W, Button as z, Text as X, Popover as g, Tabs as v, Stack as Y } from "@mantine/core";
7
- import { isFeature as Z } from "../../helpers/feature.js";
8
- import { useMenu as _ } from "../../hooks/useMenu.js";
9
- import { MediaLibraryBrowser as $ } from "../MediaLibrary/MediaLibraryBrowser.js";
10
- import { FilePickerGallery as T } from "./FilePickerGallery.js";
11
- import { FilePickerGiphy as D } from "./FilePickerGiphy.js";
12
- import { FilePickerLink as ee } from "./FilePickerLink.js";
13
- import { FilePickerUnsplash as ne } from "./FilePickerUnsplash.js";
14
- import { FilePickerGoogleDrive as ie } from "./FilePickerGoogleDrive.js";
15
- import { FilePickerUpload as le } from "./FilePickerUpload.js";
16
- import y from "./FilePicker.module.css.js";
17
- const re = [
1
+ import { jsx as n, jsxs as u } from "react/jsx-runtime";
2
+ import { useState as j, useMemo as h, useEffect as ne } from "react";
3
+ import { useTranslation as ie } from "react-i18next";
4
+ import { ImageAdd02Icon as A } from "@hugeicons/core-free-icons";
5
+ import { HugeiconsIcon as E } from "@hugeicons/react";
6
+ import { Flex as a, ActionIcon as le, Button as L, Text as re, Tabs as F, Box as ae, Popover as y, Stack as te } from "@mantine/core";
7
+ import { isFeature as oe } from "../../helpers/feature.js";
8
+ import { useMenu as se } from "../../hooks/useMenu.js";
9
+ import { MediaLibraryBrowser as ce } from "../MediaLibrary/MediaLibraryBrowser.js";
10
+ import { FilePickerGallery as de } from "./FilePickerGallery.js";
11
+ import { FilePickerGiphy as ue } from "./FilePickerGiphy.js";
12
+ import { FilePickerLink as he } from "./FilePickerLink.js";
13
+ import { FilePickerUnsplash as me } from "./FilePickerUnsplash.js";
14
+ import { FilePickerGoogleDrive as pe } from "./FilePickerGoogleDrive.js";
15
+ import { FilePickerUpload as fe } from "./FilePickerUpload.js";
16
+ import { coverCollections as ge } from "./coverCollections.js";
17
+ import w from "./FilePicker.module.css.js";
18
+ const ve = [
18
19
  "gallery",
19
20
  "upload",
20
21
  "link",
@@ -22,238 +23,255 @@ const re = [
22
23
  "giphy",
23
24
  "googleDrive",
24
25
  "media"
25
- ], xe = ({
26
- onChange: B,
27
- onRemove: G,
28
- onUpload: f,
29
- uploading: I = !1,
30
- showTabs: s = re,
31
- children: V,
32
- width: j = 610,
33
- position: L = "bottom-end",
34
- readOnly: A = !1,
35
- hasImage: E,
36
- giphyToken: d,
37
- unsplashClientId: m,
38
- type: b = "image",
39
- galleryCollection: u = [],
40
- isValidMediaUrl: N,
41
- popoverProps: U,
42
- dropZoneProps: H,
43
- targetProps: O,
44
- onOpenedChange: R,
26
+ ], Ee = ({
27
+ onChange: N,
28
+ onRemove: U,
29
+ onUpload: b,
30
+ uploading: H = !1,
31
+ showTabs: o = ve,
32
+ children: O,
33
+ width: R = 610,
34
+ position: $ = "bottom-end",
35
+ readOnly: q = !1,
36
+ hasImage: J,
37
+ giphyToken: S,
38
+ unsplashClientId: M,
39
+ type: P = "image",
40
+ galleryCollection: m = [],
41
+ isValidMediaUrl: K,
42
+ popoverProps: Q,
43
+ dropZoneProps: W,
44
+ targetProps: X,
45
+ onOpenedChange: Y,
45
46
  googleDrive: i,
46
- mediaLibrary: a
47
+ mediaLibrary: t,
48
+ inline: c = !1,
49
+ tab: k
47
50
  }) => {
48
- const { t: l } = Q("ui"), [k, h] = F(!1), { isMobile: C } = _(), p = M(
49
- () => [
50
- {
51
- value: "gallery",
52
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.gallery") }) }),
53
- visible: s.includes("gallery") && !!u.length
54
- },
51
+ const { t: l } = ie("ui"), [z, p] = j(!1), { isMobile: G } = se(), f = h(() => m.length > 0 ? m : c ? ge.map((e) => ({
52
+ ...e,
53
+ title: l(`coverGroups.${e.id}`, { defaultValue: e.id })
54
+ })) : m, [m, c, l]), r = h(() => [
55
+ {
56
+ value: "gallery",
57
+ label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.gallery") }) }),
58
+ visible: o.includes("gallery") && !!f.length
59
+ },
60
+ {
61
+ value: "upload",
62
+ label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.upload") }) }),
63
+ visible: o.includes("upload") && !!b
64
+ },
65
+ {
66
+ value: "link",
67
+ label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.link") }) }),
68
+ visible: o.includes("link")
69
+ },
70
+ {
71
+ value: "unsplash",
72
+ label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.searchImages") }) }),
73
+ visible: o.includes("unsplash") && M
74
+ },
75
+ {
76
+ value: "giphy",
77
+ label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: "GIFs" }) }),
78
+ visible: o.includes("giphy") && S
79
+ },
80
+ {
81
+ value: "googleDrive",
82
+ label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.googleDrive", {
83
+ defaultValue: "Google Drive"
84
+ }) }) }),
85
+ visible: o.includes("googleDrive") && !!i
86
+ },
87
+ {
88
+ value: "media",
89
+ label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.media", { defaultValue: "Media" }) }) }),
90
+ visible: o.includes("media") && !!t && oe()
91
+ }
92
+ ].filter((e) => e.visible), [
93
+ o,
94
+ l,
95
+ f.length,
96
+ b,
97
+ i,
98
+ t
99
+ ]), g = k !== void 0, [Z, I] = j(() => {
100
+ if (k !== void 0) return "";
101
+ if (r[0]) return r[0].value;
102
+ const e = r.find((x) => x.visible);
103
+ return e ? e.value : "";
104
+ });
105
+ ne(() => {
106
+ g || r.length && I((e) => e && r.some((x) => x.value === e) ? e : r[0].value);
107
+ }, [r, g]);
108
+ const C = h(() => r.map((e) => e.value), [r]), v = g ? k : Z, s = h(() => v && C.includes(v) ? v : C[0] ?? "", [v, C]), B = (e) => {
109
+ g || I(e);
110
+ }, _ = (e) => {
111
+ b?.(e, p);
112
+ }, d = (e) => {
113
+ N?.(e), c || p(!1);
114
+ }, D = h(() => G ? /* @__PURE__ */ u(le, { size: "lg", children: [
115
+ /* @__PURE__ */ n(E, { icon: A, size: 22 }),
116
+ " "
117
+ ] }) : /* @__PURE__ */ n(
118
+ L,
119
+ {
120
+ variant: "default",
121
+ size: "xs",
122
+ leftSection: /* @__PURE__ */ n(E, { icon: A, size: 16 }),
123
+ children: /* @__PURE__ */ n(re, { fw: 600, size: "sm", children: l("changeCover.change") })
124
+ }
125
+ ), [l, G]), V = (e) => {
126
+ p(e), Y?.(e);
127
+ }, T = /* @__PURE__ */ u(te, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
128
+ s === "gallery" && !!f.length && /* @__PURE__ */ n(
129
+ de,
55
130
  {
56
- value: "upload",
57
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.upload") }) }),
58
- visible: s.includes("upload") && !!f
59
- },
131
+ galleryCollection: f,
132
+ onChange: d
133
+ }
134
+ ),
135
+ s === "upload" && /* @__PURE__ */ n(
136
+ fe,
60
137
  {
61
- value: "link",
62
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.link") }) }),
63
- visible: s.includes("link")
64
- },
138
+ type: P || "image",
139
+ uploading: H,
140
+ dropZoneProps: W,
141
+ onUpload: _
142
+ }
143
+ ),
144
+ s === "link" && /* @__PURE__ */ n(
145
+ he,
65
146
  {
66
- value: "unsplash",
67
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.searchImages") }) }),
68
- visible: s.includes("unsplash") && m
69
- },
147
+ type: P || "image",
148
+ onChange: d,
149
+ isValidMediaUrl: K
150
+ }
151
+ ),
152
+ s === "unsplash" && /* @__PURE__ */ n(
153
+ me,
70
154
  {
71
- value: "giphy",
72
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
73
- visible: s.includes("giphy") && d
74
- },
155
+ clientId: M,
156
+ onChange: d
157
+ }
158
+ ),
159
+ s === "giphy" && /* @__PURE__ */ n(ue, { token: S, onChange: d }),
160
+ s === "googleDrive" && i && /* @__PURE__ */ n(
161
+ pe,
75
162
  {
76
- value: "googleDrive",
77
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.googleDrive", {
78
- defaultValue: "Google Drive"
79
- }) }) }),
80
- visible: s.includes("googleDrive") && !!i
81
- },
163
+ isConnected: i.isConnected,
164
+ connectedEmail: i.connectedEmail,
165
+ files: i.files,
166
+ isLoading: i.isLoading,
167
+ hasMore: i.hasMore,
168
+ isImporting: i.isImporting,
169
+ onSearch: i.onSearch,
170
+ onLoadMore: i.onLoadMore,
171
+ onSelect: (e) => {
172
+ i.onSelect(e, d);
173
+ },
174
+ error: i.error
175
+ }
176
+ ),
177
+ s === "media" && t && /* @__PURE__ */ n(
178
+ ce,
82
179
  {
83
- value: "media",
84
- label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.media", { defaultValue: "Media" }) }) }),
85
- visible: s.includes("media") && !!a && Z()
180
+ items: t.items,
181
+ isLoading: t.isLoading,
182
+ breadcrumbs: t.breadcrumbs,
183
+ onFolderClick: t.onFolderClick,
184
+ onBreadcrumbClick: t.onBreadcrumbClick,
185
+ onSelect: (e) => {
186
+ t.onSelect?.(e), c || p(!1);
187
+ }
86
188
  }
87
- ].filter((n) => n.visible),
88
- [
89
- s,
90
- m,
91
- d,
92
- l,
93
- u.length,
94
- f,
95
- i,
96
- a
97
- ]
98
- ), [o, q] = F(() => {
99
- if (p[0]) return p[0].value;
100
- const n = p.find((K) => K.visible);
101
- return n ? n.value : "";
102
- }), w = (n) => {
103
- f?.(n, h);
104
- }, c = (n) => {
105
- B?.(n), h(!1);
106
- }, J = M(() => C ? /* @__PURE__ */ t(W, { size: "lg", children: [
107
- /* @__PURE__ */ e(S, { icon: P, size: 22 }),
108
- " "
109
- ] }) : /* @__PURE__ */ e(
110
- z,
189
+ )
190
+ ] }), ee = /* @__PURE__ */ n(a, { justify: "space-between", align: "center", children: /* @__PURE__ */ n(
191
+ F,
111
192
  {
112
- variant: "default",
113
- size: "xs",
114
- leftSection: /* @__PURE__ */ e(S, { icon: P, size: 16 }),
115
- children: /* @__PURE__ */ e(X, { fw: 600, size: "sm", children: l("changeCover.change") })
193
+ defaultValue: "gallery",
194
+ value: s,
195
+ onChange: (e) => e && B(e),
196
+ styles: {
197
+ list: {
198
+ alignItems: "center",
199
+ paddingRight: "var(--mantine-spacing-xs)"
200
+ }
201
+ },
202
+ w: "100%",
203
+ children: /* @__PURE__ */ u(
204
+ F.List,
205
+ {
206
+ style: {
207
+ gap: "4px"
208
+ },
209
+ px: 8,
210
+ h: 54,
211
+ children: [
212
+ r.map((e) => /* @__PURE__ */ n(
213
+ F.Tab,
214
+ {
215
+ className: w.originalTab,
216
+ disabled: q,
217
+ h: "100%",
218
+ p: 0,
219
+ value: e.value,
220
+ onClick: () => B(e.value),
221
+ children: /* @__PURE__ */ n(a, { className: w.customTab, px: "sm", h: 36, children: e.label })
222
+ },
223
+ e.value
224
+ )),
225
+ J && /* @__PURE__ */ n(
226
+ L,
227
+ {
228
+ variant: "subtle",
229
+ fz: "sm",
230
+ lh: "sm",
231
+ fw: 500,
232
+ px: "sm",
233
+ size: "30px",
234
+ onClick: U,
235
+ color: "var(--mantine-color-gray-light-color)",
236
+ style: { marginLeft: "auto" },
237
+ children: l("remove")
238
+ }
239
+ )
240
+ ]
241
+ }
242
+ )
243
+ }
244
+ ) });
245
+ return c ? /* @__PURE__ */ n(
246
+ ae,
247
+ {
248
+ "data-file-picker-inline": !0,
249
+ bdrs: 8,
250
+ p: 12,
251
+ bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-7))",
252
+ children: T
116
253
  }
117
- ), [l, C]), x = (n) => {
118
- h(n), R?.(n);
119
- };
120
- return /* @__PURE__ */ t(
121
- g,
254
+ ) : /* @__PURE__ */ u(
255
+ y,
122
256
  {
123
- width: j,
257
+ width: R,
124
258
  radius: "var(--mantine-spacing-sm)",
125
- position: L,
259
+ position: $,
126
260
  shadow: "md",
127
- opened: k,
128
- onChange: x,
261
+ opened: z,
262
+ onChange: V,
129
263
  withinPortal: !0,
130
- ...U || {},
264
+ ...Q || {},
131
265
  children: [
132
- /* @__PURE__ */ e(g.Target, { children: /* @__PURE__ */ e(r, { onClick: () => x(!k), ...O, children: V ?? J }) }),
133
- /* @__PURE__ */ t(g.Dropdown, { p: 0, children: [
134
- /* @__PURE__ */ e(r, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
135
- v,
136
- {
137
- defaultValue: "gallery",
138
- value: o,
139
- styles: {
140
- list: {
141
- alignItems: "center",
142
- paddingRight: "var(--mantine-spacing-xs)"
143
- }
144
- },
145
- w: "100%",
146
- children: /* @__PURE__ */ t(
147
- v.List,
148
- {
149
- style: {
150
- gap: "4px"
151
- },
152
- px: 8,
153
- h: 54,
154
- children: [
155
- p.map((n) => /* @__PURE__ */ e(
156
- v.Tab,
157
- {
158
- className: y.originalTab,
159
- disabled: A,
160
- h: "100%",
161
- p: 0,
162
- value: n.value,
163
- onClick: () => q(n.value),
164
- children: /* @__PURE__ */ e(r, { className: y.customTab, px: "sm", h: 36, children: n.label })
165
- },
166
- n.value
167
- )),
168
- E && /* @__PURE__ */ e(
169
- z,
170
- {
171
- variant: "subtle",
172
- fz: "sm",
173
- lh: "sm",
174
- fw: 500,
175
- px: "sm",
176
- size: "30px",
177
- onClick: G,
178
- color: "var(--mantine-color-gray-light-color)",
179
- style: { marginLeft: "auto" },
180
- children: l("remove")
181
- }
182
- )
183
- ]
184
- }
185
- )
186
- }
187
- ) }),
188
- /* @__PURE__ */ t(Y, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
189
- o === "gallery" && !!u.length && /* @__PURE__ */ e(
190
- T,
191
- {
192
- galleryCollection: u,
193
- onChange: c
194
- }
195
- ),
196
- o === "upload" && /* @__PURE__ */ e(
197
- le,
198
- {
199
- type: b || "image",
200
- uploading: I,
201
- dropZoneProps: H,
202
- onUpload: w
203
- }
204
- ),
205
- o === "link" && /* @__PURE__ */ e(
206
- ee,
207
- {
208
- type: b || "image",
209
- onChange: c,
210
- isValidMediaUrl: N
211
- }
212
- ),
213
- o === "unsplash" && m && /* @__PURE__ */ e(
214
- ne,
215
- {
216
- clientId: m,
217
- onChange: c
218
- }
219
- ),
220
- o === "giphy" && d && /* @__PURE__ */ e(D, { token: d, onChange: c }),
221
- o === "googleDrive" && i && /* @__PURE__ */ e(
222
- ie,
223
- {
224
- isConnected: i.isConnected,
225
- connectedEmail: i.connectedEmail,
226
- files: i.files,
227
- isLoading: i.isLoading,
228
- hasMore: i.hasMore,
229
- isImporting: i.isImporting,
230
- onSearch: i.onSearch,
231
- onLoadMore: i.onLoadMore,
232
- onSelect: (n) => {
233
- i.onSelect(n, c);
234
- },
235
- error: i.error
236
- }
237
- ),
238
- o === "media" && a && /* @__PURE__ */ e(
239
- $,
240
- {
241
- items: a.items,
242
- isLoading: a.isLoading,
243
- breadcrumbs: a.breadcrumbs,
244
- onFolderClick: a.onFolderClick,
245
- onBreadcrumbClick: a.onBreadcrumbClick,
246
- onSelect: (n) => {
247
- a.onSelect?.(n), h(!1);
248
- }
249
- }
250
- )
251
- ] })
266
+ /* @__PURE__ */ n(y.Target, { children: /* @__PURE__ */ n(a, { onClick: () => V(!z), ...X, children: O ?? D }) }),
267
+ /* @__PURE__ */ u(y.Dropdown, { p: 0, children: [
268
+ ee,
269
+ T
252
270
  ] })
253
271
  ]
254
272
  }
255
273
  );
256
274
  };
257
275
  export {
258
- xe as FilePicker
276
+ Ee as FilePicker
259
277
  };
@@ -1,15 +1,17 @@
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,
1
+ const o = "_itemImage_5y6cx_1", t = "_imageAuthor_5y6cx_14", c = "_originalTab_5y6cx_22", e = "_customTab_5y6cx_28", _ = "_button_5y6cx_36", a = "_pickerDropZone_5y6cx_46", n = {
2
+ itemImage: o,
3
+ imageAuthor: t,
4
+ originalTab: c,
5
5
  customTab: e,
6
- button: m
6
+ button: _,
7
+ pickerDropZone: a
7
8
  };
8
9
  export {
9
- m as button,
10
+ _ as button,
10
11
  e as customTab,
11
- _ as default,
12
- o as imageAuthor,
13
- t as itemImage,
14
- a as originalTab
12
+ n as default,
13
+ t as imageAuthor,
14
+ o as itemImage,
15
+ c as originalTab,
16
+ a as pickerDropZone
15
17
  };
@@ -1 +1 @@
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
+ {"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,38 +1,64 @@
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 = ({
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 w, Text as u, SimpleGrid as C, AspectRatio as I } from "@mantine/core";
7
+ import S from "./FilePicker.module.css.js";
8
+ const F = ({
5
9
  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,
10
+ onChange: p
11
+ }) => {
12
+ const { t: a } = x("ui"), [i, h] = d(""), l = f(() => {
13
+ const e = i.trim().toLowerCase();
14
+ return e ? s.map((t) => ({
15
+ ...t,
16
+ items: t.items.filter((n) => `${t.title} ${t.id} ${t.path} ${n}`.toLowerCase().includes(e))
17
+ })).filter((t) => t.items.length > 0) : s;
18
+ }, [s, i]);
19
+ return /* @__PURE__ */ c(m, { gap: "sm", children: [
20
+ /* @__PURE__ */ r(g, { active: !0, children: /* @__PURE__ */ r(
21
+ w,
24
22
  {
25
- onClick: () => t?.(i),
26
- ratio: 120 / 65,
27
- className: d.itemImage,
28
- style: {
29
- backgroundImage: `url(${i})`
23
+ leftSection: /* @__PURE__ */ r(v, { size: 16, icon: $ }),
24
+ maxLength: 50,
25
+ placeholder: a("changeCover.searchGifs"),
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
30
42
  }
31
- },
32
- a
33
- );
34
- }) })
35
- ] }, e.id)) });
43
+ ) }),
44
+ /* @__PURE__ */ r(C, { spacing: 10, cols: 4, children: e.items.map((t, n) => {
45
+ const o = "/images/covers/" + e.path + t;
46
+ return /* @__PURE__ */ r(
47
+ I,
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}-${n}`
57
+ );
58
+ }) })
59
+ ] }, e.id)) })
60
+ ] });
61
+ };
36
62
  export {
37
- x as FilePickerGallery
63
+ F as FilePickerGallery
38
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FilePickerGiphy.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGiphy.tsx"],"names":[],"mappings":"AAmCA,eAAO,MAAM,eAAe,GAAI,sBAG7B;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAoGA,CAAC"}
1
+ {"version":3,"file":"FilePickerGiphy.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGiphy.tsx"],"names":[],"mappings":"AAoCA,eAAO,MAAM,eAAe,GAAI,sBAG7B;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAsGA,CAAC"}