@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.
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +10 -10
- package/dist/components/AppContainer/AppContainer.d.ts +6 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
- package/dist/components/AppContainer/components/ToolbarNewButton.d.ts +7 -2
- package/dist/components/AppContainer/components/ToolbarNewButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolbarNewButton.js +14 -14
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
- package/dist/components/AppShell/AppShell.module.css.js +5 -5
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +33 -27
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +60 -47
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +2 -1
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +13 -12
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +17 -17
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
- package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +9 -13
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +139 -145
- package/dist/components/ColorPicker/ColorPicker.module.css.js +8 -8
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +88 -71
- package/dist/components/ColorPicker/icons.js +4 -4
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.js +4 -3
- package/dist/components/CommentComposer/index.js +1 -1
- package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
- package/dist/components/Copyright/Copyright.module.css.js +1 -1
- package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +22 -22
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +1 -0
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- package/dist/components/EmojiPicker/IconsPanel.js +13 -13
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
- package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
- package/dist/components/FilePicker/FilePicker.d.ts +4 -2
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +241 -226
- package/dist/components/FilePicker/FilePicker.module.css.js +14 -12
- package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGallery.js +60 -34
- package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGiphy.js +38 -39
- package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerLink.js +29 -26
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUnsplash.js +42 -43
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +51 -35
- package/dist/components/FilePicker/coverCollections.d.ts +4 -0
- package/dist/components/FilePicker/coverCollections.d.ts.map +1 -0
- package/dist/components/FilePicker/coverCollections.js +164 -0
- package/dist/components/FilePicker/index.d.ts +1 -0
- package/dist/components/FilePicker/index.d.ts.map +1 -1
- package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
- package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
- package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
- package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
- package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
- package/dist/components/Loaders/styles.module.css.js +6 -6
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
- package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
- package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
- package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
- package/dist/components/Notification/Notification.module.css.js +1 -1
- package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
- package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
- package/dist/components/OnBoarding/styles.module.css.js +7 -7
- package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
- package/dist/components/SettingsSection/styles.module.css.js +1 -1
- package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
- package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/helpers/getFileType.d.ts +1 -1
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.module.css.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +466 -463
- package/dist/lang/locales/ui_en.json.js +20 -18
- package/dist/lang/locales/ui_es.json.js +14 -12
- package/dist/lang/locales/ui_ru.json.js +15 -13
- package/docs/README.md +499 -499
- package/package.json +75 -75
- package/dist/components/TextColorIcon.d.ts +0 -8
- package/dist/components/TextColorIcon.d.ts.map +0 -1
- package/dist/components/TextColorIcon.js +0 -60
|
@@ -1,77 +1,76 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
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
|
|
6
|
-
import { Stack as b, TextInput as z, Loader as
|
|
7
|
-
import { useDebouncedValue as
|
|
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
|
|
11
|
-
import
|
|
12
|
-
const k = (
|
|
13
|
-
onChange:
|
|
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] =
|
|
16
|
-
{ q:
|
|
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 =
|
|
19
|
-
() => Object.values({ ...
|
|
20
|
-
[
|
|
18
|
+
), a = x(
|
|
19
|
+
() => Object.values({ ...d, ...k(r?.items) }),
|
|
20
|
+
[d, r?.items]
|
|
21
21
|
), g = M(() => {
|
|
22
22
|
setTimeout(() => {
|
|
23
|
-
h((
|
|
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
|
-
}, [
|
|
31
|
-
const y =
|
|
32
|
-
(
|
|
33
|
-
v(
|
|
30
|
+
}, [m]);
|
|
31
|
+
const y = I(
|
|
32
|
+
(t) => {
|
|
33
|
+
v(t.currentTarget.value), p(1);
|
|
34
34
|
},
|
|
35
35
|
[]
|
|
36
36
|
);
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
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__ */
|
|
41
|
+
leftSection: s ? /* @__PURE__ */ e(G, { size: 16 }) : /* @__PURE__ */ e(T, { size: 16, icon: P }),
|
|
42
42
|
maxLength: 50,
|
|
43
|
-
placeholder: o("changeCover.
|
|
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__ */
|
|
51
|
-
!!a.length && /* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */
|
|
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: () =>
|
|
54
|
+
onClick: () => c?.(t.images.original.url),
|
|
56
55
|
ratio: 120 / 65,
|
|
57
|
-
className:
|
|
56
|
+
className: Q.itemImage,
|
|
58
57
|
style: {
|
|
59
|
-
backgroundImage: `url(${
|
|
58
|
+
backgroundImage: `url(${t.images.preview_webp.url})`
|
|
60
59
|
}
|
|
61
60
|
},
|
|
62
|
-
|
|
61
|
+
t.id
|
|
63
62
|
)) }),
|
|
64
|
-
r?.hasMore && /* @__PURE__ */
|
|
63
|
+
r?.hasMore && /* @__PURE__ */ e(
|
|
65
64
|
D,
|
|
66
65
|
{
|
|
67
66
|
variant: "subtle",
|
|
68
67
|
loading: s,
|
|
69
|
-
onClick: () =>
|
|
70
|
-
children: o("
|
|
68
|
+
onClick: () => p((t) => t + 1),
|
|
69
|
+
children: o("loadMore")
|
|
71
70
|
}
|
|
72
71
|
)
|
|
73
72
|
] }),
|
|
74
|
-
!a.length && !s && /* @__PURE__ */
|
|
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__ */
|
|
82
|
+
!a.length && s && /* @__PURE__ */ e(B, {})
|
|
84
83
|
] })
|
|
85
84
|
] });
|
|
86
85
|
};
|
|
87
86
|
export {
|
|
88
|
-
|
|
87
|
+
U as FilePickerGiphy
|
|
89
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePickerLink.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerLink.tsx"],"names":[],"mappings":"
|
|
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
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
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 &&
|
|
19
|
+
url: (e) => (e || "").trim().length > 0 && x(e) ? null : t("changeCover.invalidLink")
|
|
18
20
|
}
|
|
19
21
|
}), n = async () => {
|
|
20
|
-
const { values: e } =
|
|
21
|
-
let
|
|
22
|
-
|
|
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(
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
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:
|
|
32
|
+
placeholder: t(`filePicker.pasteLink.${l}`),
|
|
33
|
+
leftSection: /* @__PURE__ */ r(f, { size: 16, icon: m }),
|
|
31
34
|
"data-autofocus": !0,
|
|
32
|
-
...
|
|
35
|
+
...o.getInputProps("url")
|
|
33
36
|
}
|
|
34
37
|
) }),
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
38
|
+
/* @__PURE__ */ r(g, { justify: "flex-end", align: "center", mt: "sm", children: /* @__PURE__ */ r(
|
|
39
|
+
v,
|
|
37
40
|
{
|
|
38
41
|
onClick: n,
|
|
39
|
-
className:
|
|
40
|
-
disabled: !
|
|
41
|
-
children:
|
|
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
|
-
|
|
50
|
+
z as FilePickerLink
|
|
48
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePickerUnsplash.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerUnsplash.tsx"],"names":[],"mappings":"
|
|
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
|
|
2
|
-
import { useState as m, useMemo as P, useEffect as f, useCallback as
|
|
3
|
-
import { useTranslation as
|
|
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
|
|
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
|
|
10
|
-
import { useUnsplashPhotos as
|
|
11
|
-
import
|
|
12
|
-
const y = (l) => (l || []).reduce((
|
|
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:
|
|
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:
|
|
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((
|
|
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 =
|
|
36
|
-
(
|
|
37
|
-
|
|
35
|
+
const I = T(
|
|
36
|
+
(t) => {
|
|
37
|
+
v(t.currentTarget.value), h(1);
|
|
38
38
|
},
|
|
39
39
|
[]
|
|
40
40
|
);
|
|
41
|
-
return /* @__PURE__ */ s(
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
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__ */
|
|
45
|
+
leftSection: n ? /* @__PURE__ */ e(F, { size: 16 }) : /* @__PURE__ */ e(j, { size: 16, icon: L }),
|
|
46
46
|
maxLength: 50,
|
|
47
|
-
placeholder:
|
|
47
|
+
placeholder: r("changeCover.searchImage"),
|
|
48
48
|
"data-autofocus": !0,
|
|
49
|
-
value:
|
|
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(
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
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?.(
|
|
59
|
+
onClick: () => l?.(t.urls.regular),
|
|
61
60
|
ratio: 120 / 65,
|
|
62
|
-
className:
|
|
61
|
+
className: b.itemImage,
|
|
63
62
|
style: {
|
|
64
|
-
backgroundImage: `url(${
|
|
63
|
+
backgroundImage: `url(${t.urls.small})`
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
66
|
),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
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__ */
|
|
72
|
-
|
|
70
|
+
/* @__PURE__ */ e(
|
|
71
|
+
C,
|
|
73
72
|
{
|
|
74
73
|
component: "a",
|
|
75
74
|
inherit: !0,
|
|
76
|
-
href:
|
|
75
|
+
href: t.user.links.html,
|
|
77
76
|
target: "_blank",
|
|
78
77
|
rel: "noopener noreferrer",
|
|
79
78
|
onClick: (S) => S.stopPropagation(),
|
|
80
|
-
children:
|
|
79
|
+
children: t.user.name
|
|
81
80
|
}
|
|
82
81
|
)
|
|
83
82
|
] }) })
|
|
84
|
-
] },
|
|
85
|
-
a?.hasMore && /* @__PURE__ */
|
|
83
|
+
] }, t.id)) }),
|
|
84
|
+
a?.hasMore && /* @__PURE__ */ e(
|
|
86
85
|
_,
|
|
87
86
|
{
|
|
88
87
|
variant: "subtle",
|
|
89
88
|
loading: n,
|
|
90
|
-
onClick: () => h((
|
|
91
|
-
children:
|
|
89
|
+
onClick: () => h((t) => t + 1),
|
|
90
|
+
children: r("loadMore")
|
|
92
91
|
}
|
|
93
92
|
)
|
|
94
93
|
] }),
|
|
95
|
-
!i.length && !n && /* @__PURE__ */
|
|
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:
|
|
99
|
+
description: r("changeCover.noResult"),
|
|
101
100
|
titleProps: { size: "xs", c: "dimmed" }
|
|
102
101
|
}
|
|
103
102
|
) }),
|
|
104
|
-
!i.length && n && /* @__PURE__ */
|
|
103
|
+
!i.length && n && /* @__PURE__ */ e(Q, {})
|
|
105
104
|
] })
|
|
106
105
|
] });
|
|
107
106
|
};
|
|
108
107
|
export {
|
|
109
|
-
|
|
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;
|
|
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
|
|
2
|
-
import { useCallback as
|
|
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
|
|
6
|
-
import { Stack as
|
|
7
|
-
import { Dropzone as
|
|
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
|
|
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
|
|
13
|
-
type:
|
|
13
|
+
const Y = ({
|
|
14
|
+
type: a = "image",
|
|
14
15
|
uploading: u,
|
|
15
16
|
dropZoneProps: i,
|
|
16
|
-
onUpload:
|
|
17
|
+
onUpload: c
|
|
17
18
|
}) => {
|
|
18
|
-
const { t: e } =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
(
|
|
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((
|
|
35
|
-
|
|
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
|
-
(
|
|
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
|
-
),
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
|
|
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:
|
|
58
|
-
onReject:
|
|
56
|
+
onDrop: M,
|
|
57
|
+
onReject: z,
|
|
59
58
|
maxFiles: i?.maxFiles || 1,
|
|
60
|
-
maxSize:
|
|
61
|
-
accept:
|
|
59
|
+
maxSize: S,
|
|
60
|
+
accept: N,
|
|
62
61
|
px: 60,
|
|
63
62
|
py: "xl",
|
|
63
|
+
className: `${b.pickerDropZone}`,
|
|
64
64
|
...i || {},
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
-
|
|
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__ */
|
|
75
|
-
|
|
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__ */
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
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
|
-
|
|
109
|
+
Y as FilePickerUpload
|
|
94
110
|
};
|
|
@@ -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"}
|