@layers-app/shared 0.3.9 → 0.4.1

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 (103) hide show
  1. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +10 -10
  2. package/dist/components/AppContainer/AppContainer.d.ts +6 -1
  3. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  4. package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
  5. package/dist/components/AppContainer/components/ToolbarNewButton.d.ts +7 -2
  6. package/dist/components/AppContainer/components/ToolbarNewButton.d.ts.map +1 -1
  7. package/dist/components/AppContainer/components/ToolbarNewButton.js +14 -14
  8. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  9. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  10. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
  11. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +33 -27
  12. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  13. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +60 -47
  14. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  15. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +2 -1
  16. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +1 -1
  17. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +13 -12
  18. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +17 -17
  19. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  20. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  21. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  22. package/dist/components/ColorPicker/ColorPicker.d.ts +9 -13
  23. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  24. package/dist/components/ColorPicker/ColorPicker.js +139 -145
  25. package/dist/components/ColorPicker/ColorPicker.module.css.js +8 -8
  26. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  27. package/dist/components/ColorPicker/ColorPickerToolbar.js +88 -71
  28. package/dist/components/ColorPicker/icons.js +4 -4
  29. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  30. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  31. package/dist/components/CommentComposer/CommentEditorHotkeys.js +4 -3
  32. package/dist/components/CommentComposer/index.js +1 -1
  33. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  34. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  35. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  36. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  37. package/dist/components/EmojiPicker/EmojiPanel.js +22 -22
  38. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  39. package/dist/components/EmojiPicker/EmojiPicker.js +1 -0
  40. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  41. package/dist/components/EmojiPicker/IconsPanel.js +13 -13
  42. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  43. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  44. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  45. package/dist/components/FilePicker/FilePicker.d.ts +4 -2
  46. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  47. package/dist/components/FilePicker/FilePicker.js +241 -226
  48. package/dist/components/FilePicker/FilePicker.module.css.js +14 -12
  49. package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
  50. package/dist/components/FilePicker/FilePickerGallery.js +60 -34
  51. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  52. package/dist/components/FilePicker/FilePickerGiphy.js +38 -39
  53. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  54. package/dist/components/FilePicker/FilePickerLink.js +29 -26
  55. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  56. package/dist/components/FilePicker/FilePickerUnsplash.js +42 -43
  57. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  58. package/dist/components/FilePicker/FilePickerUpload.js +51 -35
  59. package/dist/components/FilePicker/coverCollections.d.ts +4 -0
  60. package/dist/components/FilePicker/coverCollections.d.ts.map +1 -0
  61. package/dist/components/FilePicker/coverCollections.js +164 -0
  62. package/dist/components/FilePicker/index.d.ts +1 -0
  63. package/dist/components/FilePicker/index.d.ts.map +1 -1
  64. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  65. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  66. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  67. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  68. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  69. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  70. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  71. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  72. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  73. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  74. package/dist/components/Loaders/styles.module.css.js +6 -6
  75. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  76. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  77. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  78. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  79. package/dist/components/Notification/Notification.module.css.js +1 -1
  80. package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
  81. package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
  82. package/dist/components/OnBoarding/styles.module.css.js +7 -7
  83. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  84. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  85. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  86. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  87. package/dist/components/table/FrontTable.d.ts.map +1 -1
  88. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  89. package/dist/helpers/getFileType.d.ts +1 -1
  90. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  91. package/dist/helpers/showNotifications.module.css.js +1 -1
  92. package/dist/index.css +1 -1
  93. package/dist/index.d.ts +1 -1
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +466 -463
  96. package/dist/lang/locales/ui_en.json.js +20 -18
  97. package/dist/lang/locales/ui_es.json.js +14 -12
  98. package/dist/lang/locales/ui_ru.json.js +15 -13
  99. package/docs/README.md +499 -499
  100. package/package.json +75 -75
  101. package/dist/components/TextColorIcon.d.ts +0 -8
  102. package/dist/components/TextColorIcon.d.ts.map +0 -1
  103. package/dist/components/TextColorIcon.js +0 -60
@@ -1,77 +1,76 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import { useState as m, useMemo as I, useEffect as f, useCallback as x } from "react";
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { useState as l, useMemo as x, useEffect as f, useCallback as I } from "react";
3
3
  import { useTranslation as S } from "react-i18next";
4
4
  import { Search01Icon as P } from "@hugeicons/core-free-icons";
5
- import { HugeiconsIcon as w } from "@hugeicons/react";
6
- import { Stack as b, TextInput as z, Loader as L, Box as C, SimpleGrid as T, AspectRatio as j, Button as D } from "@mantine/core";
7
- import { useDebouncedValue as G, useDebouncedCallback as M } from "@mantine/hooks";
5
+ import { HugeiconsIcon as T } from "@hugeicons/react";
6
+ import { Stack as b, FocusTrap as w, TextInput as z, Loader as G, Box as C, SimpleGrid as L, AspectRatio as j, Button as D } from "@mantine/core";
7
+ import { useDebouncedValue as F, useDebouncedCallback as M } from "@mantine/hooks";
8
8
  import { NoData as q } from "../NoData/NoData.js";
9
9
  import { FilePickerSkeletonLoader as B } from "./FilePickerSkeletonLoader.js";
10
- import { useGiphyPhotos as F } from "./api/giphyApi.js";
11
- import N from "./FilePicker.module.css.js";
12
- const k = (n) => (n || []).reduce((o, i) => (o[i.id] = i, o), {}), K = ({
13
- onChange: n
10
+ import { useGiphyPhotos as N } from "./api/giphyApi.js";
11
+ import Q from "./FilePicker.module.css.js";
12
+ const k = (c) => (c || []).reduce((o, i) => (o[i.id] = i, o), {}), U = ({
13
+ onChange: c
14
14
  }) => {
15
- const { t: o } = S("ui"), [i, v] = m(""), [l] = G(i, 800), [u, d] = m(1), [p, h] = m({}), { data: r, isLoading: s } = F(
16
- { q: l, limit: 24, offset: (u - 1) * 24 + 1 },
15
+ const { t: o } = S("ui"), [i, v] = l(""), [m] = F(i, 800), [u, p] = l(1), [d, h] = l({}), { data: r, isLoading: s } = N(
16
+ { q: m, limit: 24, offset: (u - 1) * 24 + 1 },
17
17
  u
18
- ), a = I(
19
- () => Object.values({ ...p, ...k(r?.items) }),
20
- [p, r?.items]
18
+ ), a = x(
19
+ () => Object.values({ ...d, ...k(r?.items) }),
20
+ [d, r?.items]
21
21
  ), g = M(() => {
22
22
  setTimeout(() => {
23
- h((e) => ({ ...e, ...k(r?.items) }));
23
+ h((t) => ({ ...t, ...k(r?.items) }));
24
24
  }, 0);
25
25
  }, 100);
26
26
  f(() => {
27
27
  g();
28
28
  }, [r?.items, g]), f(() => {
29
29
  h({});
30
- }, [l]);
31
- const y = x(
32
- (e) => {
33
- v(e.currentTarget.value), d(1);
30
+ }, [m]);
31
+ const y = I(
32
+ (t) => {
33
+ v(t.currentTarget.value), p(1);
34
34
  },
35
35
  []
36
36
  );
37
- return /* @__PURE__ */ c(b, { children: [
38
- /* @__PURE__ */ t(
37
+ return /* @__PURE__ */ n(b, { gap: "sm", children: [
38
+ /* @__PURE__ */ e(w, { active: !0, children: /* @__PURE__ */ e(
39
39
  z,
40
40
  {
41
- leftSection: s ? /* @__PURE__ */ t(L, { size: 16 }) : /* @__PURE__ */ t(w, { size: 16, icon: P }),
41
+ leftSection: s ? /* @__PURE__ */ e(G, { size: 16 }) : /* @__PURE__ */ e(T, { size: 16, icon: P }),
42
42
  maxLength: 50,
43
- placeholder: o("changeCover.searchImage"),
43
+ placeholder: o("changeCover.searchGifs"),
44
44
  "data-autofocus": !0,
45
45
  value: i,
46
- onChange: y,
47
- mb: "sm"
46
+ onChange: y
48
47
  }
49
- ),
50
- /* @__PURE__ */ c(C, { mah: 300, w: "100%", style: { overflowY: "auto" }, children: [
51
- !!a.length && /* @__PURE__ */ c(b, { gap: 8, children: [
52
- /* @__PURE__ */ t(T, { cols: 4, spacing: 10, children: a.map((e) => /* @__PURE__ */ t(
48
+ ) }),
49
+ /* @__PURE__ */ n(C, { mah: 300, w: "100%", style: { overflowY: "auto" }, children: [
50
+ !!a.length && /* @__PURE__ */ n(b, { gap: 8, children: [
51
+ /* @__PURE__ */ e(L, { cols: 4, spacing: 10, children: a.map((t) => /* @__PURE__ */ e(
53
52
  j,
54
53
  {
55
- onClick: () => n?.(e.images.original.url),
54
+ onClick: () => c?.(t.images.original.url),
56
55
  ratio: 120 / 65,
57
- className: N.itemImage,
56
+ className: Q.itemImage,
58
57
  style: {
59
- backgroundImage: `url(${e.images.preview_webp.url})`
58
+ backgroundImage: `url(${t.images.preview_webp.url})`
60
59
  }
61
60
  },
62
- e.id
61
+ t.id
63
62
  )) }),
64
- r?.hasMore && /* @__PURE__ */ t(
63
+ r?.hasMore && /* @__PURE__ */ e(
65
64
  D,
66
65
  {
67
66
  variant: "subtle",
68
67
  loading: s,
69
- onClick: () => d((e) => e + 1),
70
- children: o("loadMode")
68
+ onClick: () => p((t) => t + 1),
69
+ children: o("loadMore")
71
70
  }
72
71
  )
73
72
  ] }),
74
- !a.length && !s && /* @__PURE__ */ t(C, { pb: 16, children: /* @__PURE__ */ t(
73
+ !a.length && !s && /* @__PURE__ */ e(C, { pb: 16, children: /* @__PURE__ */ e(
75
74
  q,
76
75
  {
77
76
  size: 120,
@@ -80,10 +79,10 @@ const k = (n) => (n || []).reduce((o, i) => (o[i.id] = i, o), {}), K = ({
80
79
  titleProps: { size: "xs", c: "dimmed" }
81
80
  }
82
81
  ) }),
83
- !a.length && s && /* @__PURE__ */ t(B, {})
82
+ !a.length && s && /* @__PURE__ */ e(B, {})
84
83
  ] })
85
84
  ] });
86
85
  };
87
86
  export {
88
- K as FilePickerGiphy
87
+ U as FilePickerGiphy
89
88
  };
@@ -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":"AAaA,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,4CAkEA,CAAC"}
@@ -1,48 +1,51 @@
1
- import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
- import { useTranslation as m } from "react-i18next";
3
- import { Stack as c, FocusTrap as d, TextInput as f, Flex as p, Button as h } from "@mantine/core";
4
- import { useForm as g } from "@mantine/form";
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: s,
10
- isValidMediaUrl: a
1
+ import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
+ import { useTranslation as c } from "react-i18next";
3
+ import { Search01Icon as m } from "@hugeicons/core-free-icons";
4
+ import { HugeiconsIcon as f } from "@hugeicons/react";
5
+ import { Stack as d, FocusTrap as p, TextInput as h, Flex as g, Button as v } from "@mantine/core";
6
+ import { useForm as k } from "@mantine/form";
7
+ import { isValidUrl as x, isImageUrl as F, isVideoUrl as I, isAudioUrl as L } from "../../helpers/validation.js";
8
+ import w from "./FilePicker.module.css.js";
9
+ const z = ({
10
+ onChange: a,
11
+ type: l,
12
+ isValidMediaUrl: s
11
13
  }) => {
12
- const { t: i } = m("ui"), l = g({
14
+ const { t } = c("ui"), o = k({
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 && x(e) ? null : t("changeCover.invalidLink")
18
20
  }
19
21
  }), n = async () => {
20
- const { values: e } = l;
21
- let r;
22
- s === "image" ? r = await k(e.url) : s === "video" ? a && a(e.url) ? r = !0 : r = await x(e.url) : s === "audio" ? r = await F(e.url) : r = !0, r ? o?.(e.url) : l.setFieldError("url", i("changeCover.invalidLink"));
22
+ const { values: e } = o;
23
+ let i;
24
+ l === "image" ? i = await F(e.url) : l === "video" ? s && s(e.url) ? i = !0 : i = await I(e.url) : l === "audio" ? i = await L(e.url) : i = !0, i ? a?.(e.url) : o.setFieldError("url", t("changeCover.invalidLink"));
23
25
  };
24
- return /* @__PURE__ */ u(c, { gap: "sm", children: [
25
- /* @__PURE__ */ t(d, { active: !0, children: /* @__PURE__ */ t(
26
- f,
26
+ return /* @__PURE__ */ u(d, { gap: "sm", children: [
27
+ /* @__PURE__ */ r(p, { active: !0, children: /* @__PURE__ */ r(
28
+ h,
27
29
  {
28
30
  maxLength: 500,
29
31
  size: "sm",
30
- placeholder: i("changeCover.pasteLink"),
32
+ placeholder: t(`filePicker.pasteLink.${l}`),
33
+ leftSection: /* @__PURE__ */ r(f, { size: 16, icon: m }),
31
34
  "data-autofocus": !0,
32
- ...l.getInputProps("url")
35
+ ...o.getInputProps("url")
33
36
  }
34
37
  ) }),
35
- /* @__PURE__ */ t(p, { justify: "flex-end", align: "center", mt: "sm", children: /* @__PURE__ */ t(
36
- h,
38
+ /* @__PURE__ */ r(g, { justify: "flex-end", align: "center", mt: "sm", children: /* @__PURE__ */ r(
39
+ v,
37
40
  {
38
41
  onClick: n,
39
- className: L.button,
40
- disabled: !l.values.url,
41
- children: i("customDrawer.save")
42
+ className: w.button,
43
+ disabled: !o.values.url,
44
+ children: t("customDrawer.save")
42
45
  }
43
46
  ) })
44
47
  ] });
45
48
  };
46
49
  export {
47
- U as FilePickerLink
50
+ z 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,eAEhC;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,eAEhC;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAyHA,CAAC"}
@@ -1,21 +1,21 @@
1
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import { useState as m, useMemo as P, useEffect as f, useCallback as z } from "react";
3
- import { useTranslation as T } from "react-i18next";
1
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
+ import { useState as m, useMemo as P, useEffect as f, useCallback as T } from "react";
3
+ import { useTranslation as z } from "react-i18next";
4
4
  import { Search01Icon as L } from "@hugeicons/core-free-icons";
5
5
  import { HugeiconsIcon as j } from "@hugeicons/react";
6
- import { Stack as b, TextInput as B, Loader as D, Box as c, SimpleGrid as M, AspectRatio as N, Text as k, Button as _ } from "@mantine/core";
6
+ import { Stack as k, FocusTrap as B, TextInput as D, Loader as F, Box as c, SimpleGrid as M, AspectRatio as N, Text as C, Button as _ } from "@mantine/core";
7
7
  import { useDebouncedValue as q, useDebouncedCallback as w } from "@mantine/hooks";
8
8
  import { NoData as A } from "../NoData/NoData.js";
9
- import { FilePickerSkeletonLoader as F } from "./FilePickerSkeletonLoader.js";
10
- import { useUnsplashPhotos as Q } from "./api/unsplashApi.js";
11
- import C from "./FilePicker.module.css.js";
12
- const y = (l) => (l || []).reduce((o, r) => (o[r.id] = r, o), {}), W = ({
9
+ import { FilePickerSkeletonLoader as Q } from "./FilePickerSkeletonLoader.js";
10
+ import { useUnsplashPhotos as R } from "./api/unsplashApi.js";
11
+ import b from "./FilePicker.module.css.js";
12
+ const y = (l) => (l || []).reduce((r, o) => (r[o.id] = o, r), {}), X = ({
13
13
  onChange: l
14
14
  }) => {
15
- const { t: o } = T("ui"), [r, x] = m(""), [u] = q(r, 800), [v, h] = m(1), [p, d] = m({}), { data: a, isLoading: n } = Q(
15
+ const { t: r } = z("ui"), [o, v] = m(""), [u] = q(o, 800), [x, h] = m(1), [p, d] = m({}), { data: a, isLoading: n } = R(
16
16
  {
17
17
  query: u,
18
- page: v,
18
+ page: x,
19
19
  per_page: 24,
20
20
  order_by: "popular"
21
21
  }
@@ -24,7 +24,7 @@ const y = (l) => (l || []).reduce((o, r) => (o[r.id] = r, o), {}), W = ({
24
24
  [p, a?.items]
25
25
  ), g = w(() => {
26
26
  setTimeout(() => {
27
- d((e) => ({ ...e, ...y(a?.items) }));
27
+ d((t) => ({ ...t, ...y(a?.items) }));
28
28
  }, 0);
29
29
  }, 100);
30
30
  f(() => {
@@ -32,79 +32,78 @@ const y = (l) => (l || []).reduce((o, r) => (o[r.id] = r, o), {}), W = ({
32
32
  }, [a?.items, g]), f(() => {
33
33
  d({});
34
34
  }, [u]);
35
- const I = z(
36
- (e) => {
37
- x(e.currentTarget.value), h(1);
35
+ const I = T(
36
+ (t) => {
37
+ v(t.currentTarget.value), h(1);
38
38
  },
39
39
  []
40
40
  );
41
- return /* @__PURE__ */ s(b, { children: [
42
- /* @__PURE__ */ t(
43
- B,
41
+ return /* @__PURE__ */ s(k, { gap: "sm", children: [
42
+ /* @__PURE__ */ e(B, { active: !0, children: /* @__PURE__ */ e(
43
+ D,
44
44
  {
45
- leftSection: n ? /* @__PURE__ */ t(D, { size: 16 }) : /* @__PURE__ */ t(j, { size: 16, icon: L }),
45
+ leftSection: n ? /* @__PURE__ */ e(F, { size: 16 }) : /* @__PURE__ */ e(j, { size: 16, icon: L }),
46
46
  maxLength: 50,
47
- placeholder: o("changeCover.searchImage"),
47
+ placeholder: r("changeCover.searchImage"),
48
48
  "data-autofocus": !0,
49
- value: r,
50
- onChange: I,
51
- mb: "sm"
49
+ value: o,
50
+ onChange: I
52
51
  }
53
- ),
52
+ ) }),
54
53
  /* @__PURE__ */ s(c, { mah: 300, w: "100%", style: { overflowY: "auto" }, children: [
55
- !!i.length && /* @__PURE__ */ s(b, { gap: 8, children: [
56
- /* @__PURE__ */ t(M, { cols: 4, spacing: 10, children: i.map((e) => /* @__PURE__ */ s(c, { children: [
57
- /* @__PURE__ */ t(
54
+ !!i.length && /* @__PURE__ */ s(k, { gap: 8, children: [
55
+ /* @__PURE__ */ e(M, { cols: 4, spacing: 10, children: i.map((t) => /* @__PURE__ */ s(c, { children: [
56
+ /* @__PURE__ */ e(
58
57
  N,
59
58
  {
60
- onClick: () => l?.(e.urls.regular),
59
+ onClick: () => l?.(t.urls.regular),
61
60
  ratio: 120 / 65,
62
- className: C.itemImage,
61
+ className: b.itemImage,
63
62
  style: {
64
- backgroundImage: `url(${e.urls.small})`
63
+ backgroundImage: `url(${t.urls.small})`
65
64
  }
66
65
  }
67
66
  ),
68
- /* @__PURE__ */ t(c, { className: C.imageAuthor, children: /* @__PURE__ */ s(k, { truncate: !0, c: "gray", size: "xs", children: [
69
- o("changeCover.photoBy"),
67
+ /* @__PURE__ */ e(c, { className: b.imageAuthor, children: /* @__PURE__ */ s(C, { truncate: !0, c: "gray", size: "xs", children: [
68
+ r("changeCover.photoBy"),
70
69
  " ",
71
- /* @__PURE__ */ t(
72
- k,
70
+ /* @__PURE__ */ e(
71
+ C,
73
72
  {
74
73
  component: "a",
75
74
  inherit: !0,
76
- href: e.user.links.html,
75
+ href: t.user.links.html,
77
76
  target: "_blank",
78
77
  rel: "noopener noreferrer",
79
78
  onClick: (S) => S.stopPropagation(),
80
- children: e.user.name
79
+ children: t.user.name
81
80
  }
82
81
  )
83
82
  ] }) })
84
- ] }, e.id)) }),
85
- a?.hasMore && /* @__PURE__ */ t(
83
+ ] }, t.id)) }),
84
+ a?.hasMore && /* @__PURE__ */ e(
86
85
  _,
87
86
  {
88
87
  variant: "subtle",
89
88
  loading: n,
90
- onClick: () => h((e) => e + 1),
91
- children: o("loadMore")
89
+ onClick: () => h((t) => t + 1),
90
+ children: r("loadMore")
92
91
  }
93
92
  )
94
93
  ] }),
95
- !i.length && !n && /* @__PURE__ */ t(c, { pb: 16, children: /* @__PURE__ */ t(
94
+ !i.length && !n && /* @__PURE__ */ e(c, { pb: 16, children: /* @__PURE__ */ e(
96
95
  A,
97
96
  {
98
97
  size: 120,
99
98
  illustration: "noImage",
100
- description: o("changeCover.noResult"),
99
+ description: r("changeCover.noResult"),
101
100
  titleProps: { size: "xs", c: "dimmed" }
102
101
  }
103
102
  ) }),
104
- !i.length && n && /* @__PURE__ */ t(F, {})
103
+ !i.length && n && /* @__PURE__ */ e(Q, {})
105
104
  ] })
106
105
  ] });
107
106
  };
108
107
  export {
109
- W as FilePickerUnsplash
108
+ X as FilePickerUnsplash
110
109
  };
@@ -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;AAK3B,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,4CAqGA,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;AAK3B,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,4CA8GA,CAAC"}
@@ -1,29 +1,28 @@
1
- import { jsx as n, jsxs as f } from "react/jsx-runtime";
2
- import { useCallback as d } from "react";
3
- import { useTranslation as k } from "react-i18next";
1
+ import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
+ import { useCallback as p } from "react";
3
+ import { useTranslation as F, Trans as k } from "react-i18next";
4
4
  import { Image02Icon as v } from "@hugeicons/core-free-icons";
5
- import { HugeiconsIcon as E } from "@hugeicons/react";
6
- import { Stack as p, Text as x } from "@mantine/core";
7
- import { Dropzone as I, IMAGE_MIME_TYPE as T } from "@mantine/dropzone";
5
+ import { HugeiconsIcon as I } from "@hugeicons/react";
6
+ import { Stack as x, Text as s } from "@mantine/core";
7
+ import { Dropzone as E, IMAGE_MIME_TYPE as N } from "@mantine/dropzone";
8
8
  import { showNotification as h } from "@mantine/notifications";
9
9
  import { getMaxUploadSize as g } from "../../config/envConfig.js";
10
- import { showErrorNotification as b } from "../../helpers/showNotifications.js";
10
+ import { showErrorNotification as T } from "../../helpers/showNotifications.js";
11
+ import b from "./FilePicker.module.css.js";
11
12
  import "@mantine/dropzone/styles.css";
12
- const C = ({
13
- type: s = "image",
13
+ const Y = ({
14
+ type: a = "image",
14
15
  uploading: u,
15
16
  dropZoneProps: i,
16
- onUpload: a
17
+ onUpload: c
17
18
  }) => {
18
- const { t: e } = k("ui"), l = i?.maxSize != null ? Math.round(i.maxSize / (1024 * 1024)) : Math.round((g() ?? 5 * 1024 * 1024) / (1024 * 1024)), z = `filePicker.dropFileHere.${s}`, c = `filePicker.description.${s}`, F = e(z, {
19
- defaultValue: e("dropFileHere")
20
- }), m = (() => {
21
- const r = e(c, { maxSize: l });
22
- return r !== c ? r : null;
23
- })(), M = d(
19
+ const { t: e } = F("ui"), l = i?.maxSize != null ? Math.round(i.maxSize / (1024 * 1024)) : Math.round((g() ?? 5 * 1024 * 1024) / (1024 * 1024)), m = `filePicker.description.${a}`, y = `filePicker.dropFileHere.${a}`, f = (() => {
20
+ const r = e(m, { maxSize: l });
21
+ return r !== m ? r : null;
22
+ })(), z = p(
24
23
  (r) => {
25
24
  if (r.filter(
26
- (o) => o.errors.some((t) => t.code === "file-invalid-type")
25
+ (t) => t.errors.some((n) => n.code === "file-invalid-type")
27
26
  ).length > 0) {
28
27
  h({
29
28
  color: "blue",
@@ -31,15 +30,15 @@ const C = ({
31
30
  });
32
31
  return;
33
32
  }
34
- if (r.some((o) => o.errors.some((t) => t.code === "file-too-large"))) {
35
- b({
33
+ if (r.some((t) => t.errors.some((n) => n.code === "file-too-large"))) {
34
+ T({
36
35
  title: e("errorMessage"),
37
36
  message: e("filePicker.errors.shouldNotExceed", { maxSize: l })
38
37
  });
39
38
  return;
40
39
  }
41
40
  if (r.filter(
42
- (o) => o.errors.some((t) => t.code === "too-many-files")
41
+ (t) => t.errors.some((n) => n.code === "too-many-files")
43
42
  ).length > 0) {
44
43
  h({
45
44
  color: "blue",
@@ -49,21 +48,22 @@ const C = ({
49
48
  }
50
49
  },
51
50
  [e, l]
52
- ), S = d(a, [a]), y = i?.maxSize ?? g() ?? 5 * 1024 * 1024;
53
- return /* @__PURE__ */ n(
54
- I,
51
+ ), M = p(c, [c]), S = i?.maxSize ?? g() ?? 5 * 1024 * 1024;
52
+ return /* @__PURE__ */ o(
53
+ E,
55
54
  {
56
55
  loading: u,
57
- onDrop: S,
58
- onReject: M,
56
+ onDrop: M,
57
+ onReject: z,
59
58
  maxFiles: i?.maxFiles || 1,
60
- maxSize: y,
61
- accept: T,
59
+ maxSize: S,
60
+ accept: N,
62
61
  px: 60,
63
62
  py: "xl",
63
+ className: `${b.pickerDropZone}`,
64
64
  ...i || {},
65
- children: /* @__PURE__ */ f(
66
- p,
65
+ children: /* @__PURE__ */ d(
66
+ x,
67
67
  {
68
68
  justify: "center",
69
69
  gap: "var(--mantine-font-size-xs",
@@ -71,17 +71,33 @@ const C = ({
71
71
  mih: 89,
72
72
  style: { pointerEvents: "none" },
73
73
  children: [
74
- /* @__PURE__ */ n(
75
- E,
74
+ /* @__PURE__ */ o(
75
+ I,
76
76
  {
77
77
  size: 32,
78
78
  color: "var(--mantine-color-bright)",
79
79
  icon: v
80
80
  }
81
81
  ),
82
- /* @__PURE__ */ f(p, { gap: 8, align: "center", children: [
83
- /* @__PURE__ */ n(x, { fw: 500, fz: "sm", c: "bright", lh: "sm", ta: "center", children: F }),
84
- m && /* @__PURE__ */ n(x, { fz: "xs", fw: 400, lh: "140%", c: "dimmed", ta: "center", children: m })
82
+ /* @__PURE__ */ d(x, { gap: 8, align: "center", children: [
83
+ /* @__PURE__ */ o(s, { fw: 500, fz: "sm", c: "bright", lh: "sm", ta: "center", children: /* @__PURE__ */ o(
84
+ k,
85
+ {
86
+ ns: "ui",
87
+ i18nKey: y,
88
+ components: {
89
+ choose: /* @__PURE__ */ o(
90
+ s,
91
+ {
92
+ component: "span",
93
+ td: "underline",
94
+ c: "var(--primary-color-text, var(--mantine-primary-color-filled))"
95
+ }
96
+ )
97
+ }
98
+ }
99
+ ) }),
100
+ f && /* @__PURE__ */ o(s, { fz: "xs", fw: 400, lh: "140%", c: "dimmed", ta: "center", children: f })
85
101
  ] })
86
102
  ]
87
103
  }
@@ -90,5 +106,5 @@ const C = ({
90
106
  );
91
107
  };
92
108
  export {
93
- C as FilePickerUpload
109
+ Y as FilePickerUpload
94
110
  };
@@ -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"}