@layers-app/shared 0.2.7 → 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 (165) 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/AppsSidebar/AppsSection.d.ts.map +1 -1
  7. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +39 -31
  8. package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
  9. package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +42 -34
  10. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  11. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +53 -44
  12. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
  13. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +150 -50
  14. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  15. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  16. package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
  17. package/dist/components/AppContainer/hooks/useAppContainer.js +23 -23
  18. package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +1 -1
  19. package/dist/components/AppContainer/types.d.ts +1 -1
  20. package/dist/components/AppContainer/types.d.ts.map +1 -1
  21. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  22. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  23. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +14 -14
  24. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  25. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  26. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  27. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  28. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  29. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  30. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  31. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  32. package/dist/components/EmojiPicker/EmojiPicker.js +28 -29
  33. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  34. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  35. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  36. package/dist/components/FeatureProgress/FeatureProgress.d.ts +11 -0
  37. package/dist/components/FeatureProgress/FeatureProgress.d.ts.map +1 -0
  38. package/dist/components/FeatureProgress/FeatureProgress.js +148 -0
  39. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +81 -0
  40. package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.d.ts +2 -0
  41. package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.d.ts.map +1 -0
  42. package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.js +88 -0
  43. package/dist/components/FeatureProgress/FeatureProgressCompleteModal.d.ts +9 -0
  44. package/dist/components/FeatureProgress/FeatureProgressCompleteModal.d.ts.map +1 -0
  45. package/dist/components/FeatureProgress/FeatureProgressCompleteModal.js +35 -0
  46. package/dist/components/FeatureProgress/constants.d.ts +4 -0
  47. package/dist/components/FeatureProgress/constants.d.ts.map +1 -0
  48. package/dist/components/FeatureProgress/constants.js +4 -0
  49. package/dist/components/FeatureProgress/index.d.ts +3 -0
  50. package/dist/components/FeatureProgress/index.d.ts.map +1 -0
  51. package/dist/components/FilePicker/FilePicker.d.ts +4 -2
  52. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  53. package/dist/components/FilePicker/FilePicker.js +247 -229
  54. package/dist/components/FilePicker/FilePicker.module.css.js +12 -10
  55. package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
  56. package/dist/components/FilePicker/FilePickerGallery.js +59 -33
  57. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  58. package/dist/components/FilePicker/FilePickerGiphy.js +38 -38
  59. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  60. package/dist/components/FilePicker/FilePickerLink.js +18 -15
  61. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  62. package/dist/components/FilePicker/FilePickerUnsplash.js +39 -39
  63. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  64. package/dist/components/FilePicker/FilePickerUpload.js +51 -35
  65. package/dist/components/FilePicker/api/giphyApi.js +10 -10
  66. package/dist/components/FilePicker/coverCollections.d.ts +4 -0
  67. package/dist/components/FilePicker/coverCollections.d.ts.map +1 -0
  68. package/dist/components/FilePicker/coverCollections.js +164 -0
  69. package/dist/components/FilePicker/index.d.ts +1 -0
  70. package/dist/components/FilePicker/index.d.ts.map +1 -1
  71. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  72. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  73. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  74. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  75. package/dist/components/FormViewer/components/fields/SelectableCard/PictureSelectableCard.js +42 -42
  76. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  77. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  78. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  79. package/dist/components/ImageCropper/ImageCropper.d.ts.map +1 -1
  80. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  81. package/dist/components/ImageCropper/index.d.ts +1 -1
  82. package/dist/components/ImageCropper/index.d.ts.map +1 -1
  83. package/dist/components/ImageCropper/useCropInteraction.d.ts.map +1 -1
  84. package/dist/components/ImageCropper/useCropInteraction.js +13 -2
  85. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts.map +1 -1
  86. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +7 -7
  87. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts +1 -1
  88. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts.map +1 -1
  89. package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.js +3 -1
  90. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts +1 -1
  91. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts.map +1 -1
  92. package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.js +3 -1
  93. package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
  94. package/dist/components/LanguagePicker/LanguagePicker.js +27 -26
  95. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +2 -2
  96. package/dist/components/Loaders/styles.module.css.js +6 -6
  97. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  98. package/dist/components/MediaLibrary/MediaLibraryRow.d.ts.map +1 -1
  99. package/dist/components/MediaLibrary/MediaLibraryRow.js +16 -4
  100. package/dist/components/NavMenu/NavMenu.d.ts +2 -1
  101. package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
  102. package/dist/components/NavMenu/NavMenu.module.css.js +16 -16
  103. package/dist/components/NavMenu/components/NavMenuItem.d.ts +2 -1
  104. package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
  105. package/dist/components/NavMenu/components/NavMenuItem.js +119 -100
  106. package/dist/components/NavMenu/types.d.ts.map +1 -1
  107. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  108. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  109. package/dist/components/Notification/Notification.module.css.js +1 -1
  110. package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
  111. package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
  112. package/dist/components/OnBoarding/styles.module.css.js +7 -7
  113. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts +17 -0
  114. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts.map +1 -0
  115. package/dist/components/OnboardingTour/OnboardingTourFooter.js +40 -0
  116. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +13 -0
  117. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -0
  118. package/dist/components/OnboardingTour/OnboardingTourWrapper.js +164 -0
  119. package/dist/components/OnboardingTour/index.d.ts +4 -0
  120. package/dist/components/OnboardingTour/index.d.ts.map +1 -0
  121. package/dist/components/OnboardingTour/useOnboardingTour.d.ts +14 -0
  122. package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -0
  123. package/dist/components/OnboardingTour/useOnboardingTour.js +50 -0
  124. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  125. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  126. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  127. package/dist/components/TimezonePicker/index.d.ts.map +1 -1
  128. package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
  129. package/dist/components/WorkspaceMenu/WorkspaceItem.js +21 -21
  130. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
  131. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +74 -74
  132. package/dist/components/table/FrontTable.d.ts.map +1 -1
  133. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  134. package/dist/helpers/getFileIcons.js +1 -1
  135. package/dist/helpers/getFileType.d.ts +1 -1
  136. package/dist/helpers/getFileType.d.ts.map +1 -1
  137. package/dist/helpers/platform.d.ts +14 -0
  138. package/dist/helpers/platform.d.ts.map +1 -0
  139. package/dist/helpers/platform.js +33 -0
  140. package/dist/helpers/showFeatureFeedback.d.ts +1 -1
  141. package/dist/helpers/showFeatureFeedback.d.ts.map +1 -1
  142. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  143. package/dist/helpers/showNotifications.module.css.js +1 -1
  144. package/dist/hooks/useFeatureFeedback.d.ts.map +1 -1
  145. package/dist/hooks/useFeatureFeedback.js +1 -4
  146. package/dist/hooks/usePlatform.d.ts +3 -0
  147. package/dist/hooks/usePlatform.d.ts.map +1 -0
  148. package/dist/hooks/usePlatform.js +10 -0
  149. package/dist/index.css +1 -1
  150. package/dist/index.d.ts +5 -0
  151. package/dist/index.d.ts.map +1 -1
  152. package/dist/index.js +364 -337
  153. package/dist/lang/locales/ui_en.json.js +15 -15
  154. package/dist/lang/locales/ui_es.json.js +13 -13
  155. package/dist/lang/locales/ui_ru.json.js +12 -12
  156. package/dist/lib/contentImport/lexicalSerializer.js +59 -47
  157. package/dist/lib/contentImport/utils.d.ts.map +1 -1
  158. package/dist/lib/layersVisitData.d.ts.map +1 -1
  159. package/dist/store/featureProgress.d.ts +39 -0
  160. package/dist/store/featureProgress.d.ts.map +1 -0
  161. package/dist/store/featureProgress.js +68 -0
  162. package/dist/store/plansModal.d.ts.map +1 -1
  163. package/dist/store/plansModal.js +8 -6
  164. package/docs/README.md +499 -499
  165. package/package.json +75 -74
@@ -1,28 +1,28 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import { useState as m, useMemo as x, useEffect as b, useCallback as S } from "react";
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { useState as l, useMemo as I, useEffect as b, useCallback as S } from "react";
3
3
  import { useTranslation as P } from "react-i18next";
4
- import { Search01Icon as w } from "@hugeicons/core-free-icons";
5
- import { HugeiconsIcon as z } from "@hugeicons/react";
6
- import { Stack as C, TextInput as L, Loader as T, Box as k, SimpleGrid as j, AspectRatio as D, Button as G } from "@mantine/core";
4
+ import { Search01Icon as T } from "@hugeicons/core-free-icons";
5
+ import { HugeiconsIcon as w } from "@hugeicons/react";
6
+ import { Stack as C, FocusTrap as z, TextInput as G, Loader as L, Box as k, SimpleGrid as j, AspectRatio as D, Button as F } from "@mantine/core";
7
7
  import { useDebouncedValue as M, useDebouncedCallback as q } from "@mantine/hooks";
8
8
  import { NoData as B } from "../NoData/NoData.js";
9
- import { FilePickerSkeletonLoader as F } from "./FilePickerSkeletonLoader.js";
10
- import { useGiphyPhotos as N } from "./api/giphyApi.js";
11
- import Q from "./FilePicker.module.css.js";
12
- const v = (n) => (n || []).reduce((r, o) => (r[o.id] = o, r), {}), U = ({
13
- token: n,
9
+ import { FilePickerSkeletonLoader as N } from "./FilePickerSkeletonLoader.js";
10
+ import { useGiphyPhotos as Q } from "./api/giphyApi.js";
11
+ import R from "./FilePicker.module.css.js";
12
+ const v = (c) => (c || []).reduce((r, o) => (r[o.id] = o, r), {}), W = ({
13
+ token: c,
14
14
  onChange: r
15
15
  }) => {
16
- const { t: o } = P("ui"), [l, y] = m(""), [u] = M(l, 800), [d, p] = m(1), [h, g] = m({}), { data: i, isLoading: s } = N(
16
+ const { t: o } = P("ui"), [m, y] = l(""), [u] = M(m, 800), [d, p] = l(1), [h, g] = l({}), { data: i, isLoading: s } = Q(
17
17
  { q: u, limit: 24, offset: (d - 1) * 24 + 1 },
18
18
  d,
19
- n
20
- ), a = x(
19
+ c
20
+ ), a = I(
21
21
  () => Object.values({ ...h, ...v(i?.items) }),
22
22
  [h, i?.items]
23
23
  ), f = q(() => {
24
24
  setTimeout(() => {
25
- g((e) => ({ ...e, ...v(i?.items) }));
25
+ g((t) => ({ ...t, ...v(i?.items) }));
26
26
  }, 0);
27
27
  }, 100);
28
28
  b(() => {
@@ -30,49 +30,49 @@ const v = (n) => (n || []).reduce((r, o) => (r[o.id] = o, r), {}), U = ({
30
30
  }, [i?.items, f]), b(() => {
31
31
  g({});
32
32
  }, [u]);
33
- const I = S(
34
- (e) => {
35
- y(e.currentTarget.value), p(1);
33
+ const x = S(
34
+ (t) => {
35
+ y(t.currentTarget.value), p(1);
36
36
  },
37
37
  []
38
38
  );
39
- return /* @__PURE__ */ c(C, { gap: "sm", children: [
40
- /* @__PURE__ */ t(
41
- L,
39
+ return /* @__PURE__ */ n(C, { gap: "sm", children: [
40
+ /* @__PURE__ */ e(z, { active: !0, children: /* @__PURE__ */ e(
41
+ G,
42
42
  {
43
- leftSection: s ? /* @__PURE__ */ t(T, { size: 16 }) : /* @__PURE__ */ t(z, { size: 16, icon: w }),
43
+ leftSection: s ? /* @__PURE__ */ e(L, { size: 16 }) : /* @__PURE__ */ e(w, { size: 16, icon: T }),
44
44
  maxLength: 50,
45
- placeholder: o("changeCover.searchImage"),
45
+ placeholder: o("changeCover.searchGifs"),
46
46
  "data-autofocus": !0,
47
- value: l,
48
- onChange: I
47
+ value: m,
48
+ onChange: x
49
49
  }
50
- ),
51
- /* @__PURE__ */ c(k, { mah: 300, w: "100%", style: { overflowY: "auto" }, children: [
52
- !!a.length && /* @__PURE__ */ c(C, { gap: 8, children: [
53
- /* @__PURE__ */ t(j, { cols: 4, spacing: 10, children: a.map((e) => /* @__PURE__ */ t(
50
+ ) }),
51
+ /* @__PURE__ */ n(k, { mah: 300, w: "100%", style: { overflowY: "auto" }, children: [
52
+ !!a.length && /* @__PURE__ */ n(C, { gap: 8, children: [
53
+ /* @__PURE__ */ e(j, { cols: 4, spacing: 10, children: a.map((t) => /* @__PURE__ */ e(
54
54
  D,
55
55
  {
56
- onClick: () => r?.(e.images.original.url),
56
+ onClick: () => r?.(t.images.original.url),
57
57
  ratio: 120 / 65,
58
- className: Q.itemImage,
58
+ className: R.itemImage,
59
59
  style: {
60
- backgroundImage: `url(${e.images.preview_webp.url})`
60
+ backgroundImage: `url(${t.images.preview_webp.url})`
61
61
  }
62
62
  },
63
- e.id
63
+ t.id
64
64
  )) }),
65
- i?.hasMore && /* @__PURE__ */ t(
66
- G,
65
+ i?.hasMore && /* @__PURE__ */ e(
66
+ F,
67
67
  {
68
68
  variant: "subtle",
69
69
  loading: s,
70
- onClick: () => p((e) => e + 1),
70
+ onClick: () => p((t) => t + 1),
71
71
  children: o("loadMode")
72
72
  }
73
73
  )
74
74
  ] }),
75
- !a.length && !s && /* @__PURE__ */ t(k, { pb: 16, children: /* @__PURE__ */ t(
75
+ !a.length && !s && /* @__PURE__ */ e(k, { pb: 16, children: /* @__PURE__ */ e(
76
76
  B,
77
77
  {
78
78
  size: 120,
@@ -81,10 +81,10 @@ const v = (n) => (n || []).reduce((r, o) => (r[o.id] = o, r), {}), U = ({
81
81
  titleProps: { size: "xs", c: "dimmed" }
82
82
  }
83
83
  ) }),
84
- !a.length && s && /* @__PURE__ */ t(F, {})
84
+ !a.length && s && /* @__PURE__ */ e(N, {})
85
85
  ] })
86
86
  ] });
87
87
  };
88
88
  export {
89
- U as FilePickerGiphy
89
+ W as FilePickerGiphy
90
90
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FilePickerLink.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerLink.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAInC,eAAO,MAAM,cAAc,GAAI,sCAI5B;IACD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5C,4CA+DA,CAAC"}
1
+ {"version":3,"file":"FilePickerLink.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerLink.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMnC,eAAO,MAAM,cAAc,GAAI,sCAI5B;IACD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5C,4CAkEA,CAAC"}
@@ -1,48 +1,51 @@
1
- import { jsxs as u, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
2
  import { useTranslation as c } from "react-i18next";
3
3
  import { Stack as m, FocusTrap as d, TextInput as f, Flex as p, Button as h } from "@mantine/core";
4
4
  import { useForm as g } from "@mantine/form";
5
5
  import { isValidUrl as v, isImageUrl as k, isVideoUrl as x, isAudioUrl as F } from "../../helpers/validation.js";
6
- import L from "./FilePicker.module.css.js";
7
- const U = ({
8
- onChange: o,
9
- type: a,
6
+ import I from "./FilePicker.module.css.js";
7
+ import { Search01Icon as L } from "@hugeicons/core-free-icons";
8
+ import { HugeiconsIcon as w } from "@hugeicons/react";
9
+ const P = ({
10
+ onChange: a,
11
+ type: o,
10
12
  isValidMediaUrl: s
11
13
  }) => {
12
- const { t: i } = c("ui"), l = g({
14
+ const { t } = c("ui"), l = g({
13
15
  initialValues: {
14
16
  url: ""
15
17
  },
16
18
  validate: {
17
- url: (e) => (e || "").trim().length > 0 && v(e) ? null : i("changeCover.invalidLink")
19
+ url: (e) => (e || "").trim().length > 0 && v(e) ? null : t("changeCover.invalidLink")
18
20
  }
19
21
  }), n = async () => {
20
22
  const { values: e } = l;
21
- let r;
22
- a === "image" ? r = await k(e.url) : a === "video" ? s && s(e.url) ? r = !0 : r = await x(e.url) : a === "audio" ? r = await F(e.url) : r = !0, r ? o?.(e.url) : l.setFieldError("url", i("changeCover.invalidLink"));
23
+ let i;
24
+ o === "image" ? i = await k(e.url) : o === "video" ? s && s(e.url) ? i = !0 : i = await x(e.url) : o === "audio" ? i = await F(e.url) : i = !0, i ? a?.(e.url) : l.setFieldError("url", t("changeCover.invalidLink"));
23
25
  };
24
26
  return /* @__PURE__ */ u(m, { gap: "sm", children: [
25
- /* @__PURE__ */ t(d, { active: !0, children: /* @__PURE__ */ t(
27
+ /* @__PURE__ */ r(d, { active: !0, children: /* @__PURE__ */ r(
26
28
  f,
27
29
  {
28
30
  maxLength: 500,
29
31
  size: "sm",
30
- placeholder: i("changeCover.pasteLink"),
32
+ placeholder: t("changeCover.pasteLink"),
33
+ leftSection: /* @__PURE__ */ r(w, { size: 16, icon: L }),
31
34
  "data-autofocus": !0,
32
35
  ...l.getInputProps("url")
33
36
  }
34
37
  ) }),
35
- /* @__PURE__ */ t(p, { justify: "flex-end", align: "center", children: /* @__PURE__ */ t(
38
+ /* @__PURE__ */ r(p, { justify: "flex-end", align: "center", mt: "sm", children: /* @__PURE__ */ r(
36
39
  h,
37
40
  {
38
41
  onClick: n,
39
- className: L.button,
42
+ className: I.button,
40
43
  disabled: !l.values.url,
41
- children: i("customDrawer.save")
44
+ children: t("customDrawer.save")
42
45
  }
43
46
  ) })
44
47
  ] });
45
48
  };
46
49
  export {
47
- U as FilePickerLink
50
+ P as FilePickerLink
48
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FilePickerUnsplash.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerUnsplash.tsx"],"names":[],"mappings":"AAoCA,eAAO,MAAM,kBAAkB,GAAI,yBAGhC;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAwHA,CAAC"}
1
+ {"version":3,"file":"FilePickerUnsplash.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerUnsplash.tsx"],"names":[],"mappings":"AA+BA,eAAO,MAAM,kBAAkB,GAAI,yBAGhC;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CA0HA,CAAC"}
@@ -1,19 +1,19 @@
1
- import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
- import { useState as m, useMemo as z, useEffect as k, useCallback as T } from "react";
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import { useState as m, useMemo as T, useEffect as k, useCallback as z } from "react";
3
3
  import { useTranslation as L } from "react-i18next";
4
4
  import { Search01Icon as j } from "@hugeicons/core-free-icons";
5
5
  import { HugeiconsIcon as B } from "@hugeicons/react";
6
- import { Stack as C, TextInput as D, Loader as M, Box as c, SimpleGrid as N, AspectRatio as _, Text as b, Button as q } from "@mantine/core";
6
+ import { Stack as C, FocusTrap as D, TextInput as F, Loader as M, Box as c, SimpleGrid as N, AspectRatio as _, Text as b, Button as q } from "@mantine/core";
7
7
  import { useDebouncedValue as w, useDebouncedCallback as A } from "@mantine/hooks";
8
- import { NoData as F } from "../NoData/NoData.js";
9
- import { FilePickerSkeletonLoader as Q } from "./FilePickerSkeletonLoader.js";
10
- import { useUnsplashPhotos as R } from "./api/unsplashApi.js";
8
+ import { NoData as Q } from "../NoData/NoData.js";
9
+ import { FilePickerSkeletonLoader as R } from "./FilePickerSkeletonLoader.js";
10
+ import { useUnsplashPhotos as U } from "./api/unsplashApi.js";
11
11
  import y from "./FilePicker.module.css.js";
12
- const x = (l) => (l || []).reduce((s, o) => (s[o.id] = o, s), {}), X = ({
12
+ const v = (l) => (l || []).reduce((s, r) => (s[r.id] = r, s), {}), Z = ({
13
13
  onChange: l,
14
14
  clientId: s
15
15
  }) => {
16
- const { t: o } = L("ui"), [u, v] = m(""), [h] = w(u, 800), [I, p] = m(1), [d, g] = m({}), { data: r, isLoading: n } = R(
16
+ const { t: r } = L("ui"), [u, x] = m(""), [h] = w(u, 800), [I, p] = m(1), [d, g] = m({}), { data: o, isLoading: n } = U(
17
17
  {
18
18
  query: h,
19
19
  page: I,
@@ -21,91 +21,91 @@ const x = (l) => (l || []).reduce((s, o) => (s[o.id] = o, s), {}), X = ({
21
21
  order_by: "popular"
22
22
  },
23
23
  s
24
- ), i = z(
25
- () => Object.values({ ...d, ...x(r?.items) }),
26
- [d, r?.items]
24
+ ), i = T(
25
+ () => Object.values({ ...d, ...v(o?.items) }),
26
+ [d, o?.items]
27
27
  ), f = A(() => {
28
28
  setTimeout(() => {
29
- g((e) => ({ ...e, ...x(r?.items) }));
29
+ g((t) => ({ ...t, ...v(o?.items) }));
30
30
  }, 0);
31
31
  }, 100);
32
32
  k(() => {
33
33
  f();
34
- }, [r?.items, f]), k(() => {
34
+ }, [o?.items, f]), k(() => {
35
35
  g({});
36
36
  }, [h]);
37
- const S = T(
38
- (e) => {
39
- v(e.currentTarget.value), p(1);
37
+ const S = z(
38
+ (t) => {
39
+ x(t.currentTarget.value), p(1);
40
40
  },
41
41
  []
42
42
  );
43
43
  return /* @__PURE__ */ a(C, { gap: "sm", children: [
44
- /* @__PURE__ */ t(
45
- D,
44
+ /* @__PURE__ */ e(D, { active: !0, children: /* @__PURE__ */ e(
45
+ F,
46
46
  {
47
- leftSection: n ? /* @__PURE__ */ t(M, { size: 16 }) : /* @__PURE__ */ t(B, { size: 16, icon: j }),
47
+ leftSection: n ? /* @__PURE__ */ e(M, { size: 16 }) : /* @__PURE__ */ e(B, { size: 16, icon: j }),
48
48
  maxLength: 50,
49
- placeholder: o("changeCover.searchImage"),
49
+ placeholder: r("changeCover.searchImage"),
50
50
  "data-autofocus": !0,
51
51
  value: u,
52
52
  onChange: S
53
53
  }
54
- ),
54
+ ) }),
55
55
  /* @__PURE__ */ a(c, { mah: 300, w: "100%", style: { overflowY: "auto" }, children: [
56
56
  !!i.length && /* @__PURE__ */ a(C, { gap: 8, children: [
57
- /* @__PURE__ */ t(N, { cols: 4, spacing: 10, children: i.map((e) => /* @__PURE__ */ a(c, { children: [
58
- /* @__PURE__ */ t(
57
+ /* @__PURE__ */ e(N, { cols: 4, spacing: 10, children: i.map((t) => /* @__PURE__ */ a(c, { children: [
58
+ /* @__PURE__ */ e(
59
59
  _,
60
60
  {
61
- onClick: () => l?.(e.urls.regular),
61
+ onClick: () => l?.(t.urls.regular),
62
62
  ratio: 120 / 65,
63
63
  className: y.itemImage,
64
64
  style: {
65
- backgroundImage: `url(${e.urls.small})`
65
+ backgroundImage: `url(${t.urls.small})`
66
66
  }
67
67
  }
68
68
  ),
69
- /* @__PURE__ */ t(c, { className: y.imageAuthor, children: /* @__PURE__ */ a(b, { truncate: !0, c: "gray", size: "xs", children: [
70
- o("changeCover.photoBy"),
69
+ /* @__PURE__ */ e(c, { className: y.imageAuthor, children: /* @__PURE__ */ a(b, { truncate: !0, c: "gray", size: "xs", children: [
70
+ r("changeCover.photoBy"),
71
71
  " ",
72
- /* @__PURE__ */ t(
72
+ /* @__PURE__ */ e(
73
73
  b,
74
74
  {
75
75
  component: "a",
76
76
  inherit: !0,
77
- href: e.user.links.html,
77
+ href: t.user.links.html,
78
78
  target: "_blank",
79
79
  rel: "noopener noreferrer",
80
80
  onClick: (P) => P.stopPropagation(),
81
- children: e.user.name
81
+ children: t.user.name
82
82
  }
83
83
  )
84
84
  ] }) })
85
- ] }, e.id)) }),
86
- r?.hasMore && /* @__PURE__ */ t(
85
+ ] }, t.id)) }),
86
+ o?.hasMore && /* @__PURE__ */ e(
87
87
  q,
88
88
  {
89
89
  variant: "subtle",
90
90
  loading: n,
91
- onClick: () => p((e) => e + 1),
92
- children: o("loadMore")
91
+ onClick: () => p((t) => t + 1),
92
+ children: r("loadMore")
93
93
  }
94
94
  )
95
95
  ] }),
96
- !i.length && !n && /* @__PURE__ */ t(c, { pb: 16, children: /* @__PURE__ */ t(
97
- F,
96
+ !i.length && !n && /* @__PURE__ */ e(c, { pb: 16, children: /* @__PURE__ */ e(
97
+ Q,
98
98
  {
99
99
  size: 120,
100
100
  illustration: "noImage",
101
- description: o("changeCover.noResult"),
101
+ description: r("changeCover.noResult"),
102
102
  titleProps: { size: "xs", c: "dimmed" }
103
103
  }
104
104
  ) }),
105
- !i.length && n && /* @__PURE__ */ t(Q, {})
105
+ !i.length && n && /* @__PURE__ */ e(R, {})
106
106
  ] })
107
107
  ] });
108
108
  };
109
109
  export {
110
- X as FilePickerUnsplash
110
+ Z as FilePickerUnsplash
111
111
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FilePickerUpload.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerUpload.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEL,aAAa,EAEb,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,8BAA8B,CAAC;AAEtC,eAAO,MAAM,gBAAgB,GAAI,+CAK9B;IACD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAC9C,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;CAC3C,4CAkGA,CAAC"}
1
+ {"version":3,"file":"FilePickerUpload.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerUpload.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEL,aAAa,EAEb,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,8BAA8B,CAAC;AAEtC,eAAO,MAAM,gBAAgB,GAAI,+CAK9B;IACD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAC9C,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;CAC3C,4CA2GA,CAAC"}
@@ -1,28 +1,27 @@
1
- import { jsx as n, jsxs as m } from "react/jsx-runtime";
2
- import { useCallback as f } from "react";
3
- import { useTranslation as M } from "react-i18next";
4
- import { Image02Icon as k } from "@hugeicons/core-free-icons";
1
+ import { jsx as o, jsxs as f } from "react/jsx-runtime";
2
+ import { useCallback as p } from "react";
3
+ import { useTranslation as k, Trans as z } from "react-i18next";
4
+ import { Image02Icon as M } from "@hugeicons/core-free-icons";
5
5
  import { HugeiconsIcon as v } from "@hugeicons/react";
6
- import { Stack as d, Text as p } from "@mantine/core";
7
- import { Dropzone as E, IMAGE_MIME_TYPE as I } from "@mantine/dropzone";
6
+ import { Stack as d, Text as l } from "@mantine/core";
7
+ import { Dropzone as I, IMAGE_MIME_TYPE as E } from "@mantine/dropzone";
8
8
  import { showNotification as h } from "@mantine/notifications";
9
- import { showErrorNotification as S } from "../../helpers/showNotifications.js";
9
+ import { showErrorNotification as N } from "../../helpers/showNotifications.js";
10
+ import S from "./FilePicker.module.css.js";
10
11
  import "@mantine/dropzone/styles.css";
11
- const $ = ({
12
- type: l = "image",
12
+ const C = ({
13
+ type: s = "image",
13
14
  uploading: g,
14
- dropZoneProps: t,
15
- onUpload: s
15
+ dropZoneProps: n,
16
+ onUpload: c
16
17
  }) => {
17
- const { t: e } = M("ui"), u = t?.maxSize != null ? Math.round(t.maxSize / (1024 * 1024)) : 5, x = `filePicker.dropFileHere.${l}`, c = `filePicker.description.${l}`, F = e(x, {
18
- defaultValue: e("dropFileHere")
19
- }), a = (() => {
20
- const r = e(c, { maxSize: u });
21
- return r !== c ? r : null;
22
- })(), y = f(
18
+ const { t: e } = k("ui"), u = n?.maxSize != null ? Math.round(n.maxSize / (1024 * 1024)) : 5, a = `filePicker.description.${s}`, x = `filePicker.dropFileHere.${s}`, m = (() => {
19
+ const r = e(a, { maxSize: u });
20
+ return r !== a ? r : null;
21
+ })(), y = p(
23
22
  (r) => {
24
23
  if (r.filter(
25
- (o) => o.errors.some((i) => i.code === "file-invalid-type")
24
+ (i) => i.errors.some((t) => t.code === "file-invalid-type")
26
25
  ).length > 0) {
27
26
  h({
28
27
  color: "blue",
@@ -30,15 +29,15 @@ const $ = ({
30
29
  });
31
30
  return;
32
31
  }
33
- if (r.some((o) => o.errors.some((i) => i.code === "file-too-large"))) {
34
- S({
32
+ if (r.some((i) => i.errors.some((t) => t.code === "file-too-large"))) {
33
+ N({
35
34
  title: e("errorMessage"),
36
35
  message: e("filePicker.errors.shouldNotExceed")
37
36
  });
38
37
  return;
39
38
  }
40
39
  if (r.filter(
41
- (o) => o.errors.some((i) => i.code === "too-many-files")
40
+ (i) => i.errors.some((t) => t.code === "too-many-files")
42
41
  ).length > 0) {
43
42
  h({
44
43
  color: "blue",
@@ -48,19 +47,20 @@ const $ = ({
48
47
  }
49
48
  },
50
49
  [e]
51
- ), z = f(s, [s]);
52
- return /* @__PURE__ */ n(
53
- E,
50
+ ), F = p(c, [c]);
51
+ return /* @__PURE__ */ o(
52
+ I,
54
53
  {
55
54
  loading: g,
56
- onDrop: z,
55
+ onDrop: F,
57
56
  onReject: y,
58
- maxFiles: t?.maxFiles || 1,
59
- accept: I,
57
+ maxFiles: n?.maxFiles || 1,
58
+ accept: E,
60
59
  px: 60,
61
60
  py: "xl",
62
- ...t || {},
63
- children: /* @__PURE__ */ m(
61
+ className: `${S.pickerDropZone}`,
62
+ ...n || {},
63
+ children: /* @__PURE__ */ f(
64
64
  d,
65
65
  {
66
66
  justify: "center",
@@ -69,17 +69,33 @@ const $ = ({
69
69
  mih: 89,
70
70
  style: { pointerEvents: "none" },
71
71
  children: [
72
- /* @__PURE__ */ n(
72
+ /* @__PURE__ */ o(
73
73
  v,
74
74
  {
75
75
  size: 32,
76
76
  color: "var(--mantine-color-bright)",
77
- icon: k
77
+ icon: M
78
78
  }
79
79
  ),
80
- /* @__PURE__ */ m(d, { gap: 8, align: "center", children: [
81
- /* @__PURE__ */ n(p, { fw: 500, fz: "sm", c: "bright", lh: "sm", ta: "center", children: F }),
82
- a && /* @__PURE__ */ n(p, { fz: "xs", fw: 400, lh: "140%", c: "dimmed", ta: "center", children: a })
80
+ /* @__PURE__ */ f(d, { gap: 8, align: "center", children: [
81
+ /* @__PURE__ */ o(l, { fw: 500, fz: "sm", c: "bright", lh: "sm", ta: "center", children: /* @__PURE__ */ o(
82
+ z,
83
+ {
84
+ ns: "ui",
85
+ i18nKey: x,
86
+ components: {
87
+ choose: /* @__PURE__ */ o(
88
+ l,
89
+ {
90
+ component: "span",
91
+ td: "underline",
92
+ c: "var(--primary-color-text, var(--mantine-primary-color-filled))"
93
+ }
94
+ )
95
+ }
96
+ }
97
+ ) }),
98
+ m && /* @__PURE__ */ o(l, { fz: "xs", fw: 400, lh: "140%", c: "dimmed", ta: "center", children: m })
83
99
  ] })
84
100
  ]
85
101
  }
@@ -88,5 +104,5 @@ const $ = ({
88
104
  );
89
105
  };
90
106
  export {
91
- $ as FilePickerUpload
107
+ C as FilePickerUpload
92
108
  };
@@ -1,26 +1,26 @@
1
1
  import { useQuery as h } from "@tanstack/react-query";
2
2
  import p from "query-string";
3
- const y = "TBp2lqNzl0orFQtaXgwymH4UDM0kbAVe", g = async (o, n = 1, i) => {
4
- const s = o.q ? "/gifs/search" : "/gifs/trending", a = await fetch(
5
- `https://api.giphy.com/v1${s}?${p.stringify({
3
+ const u = "1kKxu8nbV5rsb4ieGGw0zERUSw0knTNr", y = async (o, n = 1, i) => {
4
+ const a = o.q ? "/gifs/search" : "/gifs/trending", s = await fetch(
5
+ `https://api.giphy.com/v1${a}?${p.stringify({
6
6
  ...o,
7
- api_key: i || y
7
+ api_key: i || u
8
8
  })}`
9
9
  );
10
- if (!a.ok)
10
+ if (!s.ok)
11
11
  throw new Error("Failed to fetch Giphy photos");
12
- const t = await a.json(), e = t.data, r = Math.ceil(t.pagination.total_count / 12), c = t.pagination.total_count % 12 === 0 || t.pagination.total_count > t.pagination.count + t.pagination.offset;
12
+ const t = await s.json(), e = t.data, r = Math.ceil(t.pagination.total_count / 12), c = t.pagination.total_count % 12 === 0 || t.pagination.total_count > t.pagination.count + t.pagination.offset;
13
13
  return {
14
14
  items: e,
15
15
  page: n,
16
16
  totalPages: r,
17
17
  hasMore: c
18
18
  };
19
- }, d = (o, n, i) => h({
19
+ }, w = (o, n, i) => h({
20
20
  queryKey: ["giphyPhotos", o, n],
21
- queryFn: () => g(o, n, i)
21
+ queryFn: () => y(o, n, i)
22
22
  });
23
23
  export {
24
- g as fetchGiphyPhotos,
25
- d as useGiphyPhotos
24
+ y as fetchGiphyPhotos,
25
+ w as useGiphyPhotos
26
26
  };
@@ -0,0 +1,4 @@
1
+ import type { ImagePickerGalleryCollection } from './types';
2
+ export type CoverGallerySource = Omit<ImagePickerGalleryCollection, 'title'>;
3
+ export declare const coverCollections: CoverGallerySource[];
4
+ //# sourceMappingURL=coverCollections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverCollections.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/coverCollections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;AAE7E,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,EAgKhD,CAAC"}