@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.
- package/dist/assets/svg/socials/instagram.svg.js +3 -3
- package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
- package/dist/components/AliasTextInput/AliasTextInput.js +21 -20
- package/dist/components/AppContainer/AppContainer.js +3 -3
- package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +39 -31
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +42 -34
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +53 -44
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +150 -50
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +23 -23
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +1 -1
- package/dist/components/AppContainer/types.d.ts +1 -1
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AppShell/AppShell.module.css.js +5 -5
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +14 -14
- 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/CommentComposer/CommentComposer.module.css.js +4 -4
- 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/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +28 -29
- package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
- 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.d.ts +11 -0
- package/dist/components/FeatureProgress/FeatureProgress.d.ts.map +1 -0
- package/dist/components/FeatureProgress/FeatureProgress.js +148 -0
- package/dist/components/FeatureProgress/FeatureProgress.module.css.js +81 -0
- package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.d.ts +2 -0
- package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.d.ts.map +1 -0
- package/dist/components/FeatureProgress/FeatureProgressCelebrationIcon.js +88 -0
- package/dist/components/FeatureProgress/FeatureProgressCompleteModal.d.ts +9 -0
- package/dist/components/FeatureProgress/FeatureProgressCompleteModal.d.ts.map +1 -0
- package/dist/components/FeatureProgress/FeatureProgressCompleteModal.js +35 -0
- package/dist/components/FeatureProgress/constants.d.ts +4 -0
- package/dist/components/FeatureProgress/constants.d.ts.map +1 -0
- package/dist/components/FeatureProgress/constants.js +4 -0
- package/dist/components/FeatureProgress/index.d.ts +3 -0
- package/dist/components/FeatureProgress/index.d.ts.map +1 -0
- 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 +247 -229
- package/dist/components/FilePicker/FilePicker.module.css.js +12 -10
- package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGallery.js +59 -33
- package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGiphy.js +38 -38
- package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerLink.js +18 -15
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUnsplash.js +39 -39
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +51 -35
- package/dist/components/FilePicker/api/giphyApi.js +10 -10
- 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/PictureSelectableCard.js +42 -42
- 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.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
- package/dist/components/ImageCropper/index.d.ts +1 -1
- package/dist/components/ImageCropper/index.d.ts.map +1 -1
- package/dist/components/ImageCropper/useCropInteraction.d.ts.map +1 -1
- package/dist/components/ImageCropper/useCropInteraction.js +13 -2
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts.map +1 -1
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +7 -7
- package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts +1 -1
- package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts.map +1 -1
- package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.js +3 -1
- package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts +1 -1
- package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts.map +1 -1
- package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.js +3 -1
- package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
- package/dist/components/LanguagePicker/LanguagePicker.js +27 -26
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +2 -2
- package/dist/components/Loaders/styles.module.css.js +6 -6
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
- package/dist/components/MediaLibrary/MediaLibraryRow.d.ts.map +1 -1
- package/dist/components/MediaLibrary/MediaLibraryRow.js +16 -4
- package/dist/components/NavMenu/NavMenu.d.ts +2 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/NavMenu.module.css.js +16 -16
- package/dist/components/NavMenu/components/NavMenuItem.d.ts +2 -1
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +119 -100
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- 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/OnboardingTour/OnboardingTourFooter.d.ts +17 -0
- package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts.map +1 -0
- package/dist/components/OnboardingTour/OnboardingTourFooter.js +40 -0
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +13 -0
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -0
- package/dist/components/OnboardingTour/OnboardingTourWrapper.js +164 -0
- package/dist/components/OnboardingTour/index.d.ts +4 -0
- package/dist/components/OnboardingTour/index.d.ts.map +1 -0
- package/dist/components/OnboardingTour/useOnboardingTour.d.ts +14 -0
- package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -0
- package/dist/components/OnboardingTour/useOnboardingTour.js +50 -0
- 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/TimezonePicker/index.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +21 -21
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +74 -74
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/helpers/getFileIcons.js +1 -1
- package/dist/helpers/getFileType.d.ts +1 -1
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/platform.d.ts +14 -0
- package/dist/helpers/platform.d.ts.map +1 -0
- package/dist/helpers/platform.js +33 -0
- package/dist/helpers/showFeatureFeedback.d.ts +1 -1
- package/dist/helpers/showFeatureFeedback.d.ts.map +1 -1
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.module.css.js +1 -1
- package/dist/hooks/useFeatureFeedback.d.ts.map +1 -1
- package/dist/hooks/useFeatureFeedback.js +1 -4
- package/dist/hooks/usePlatform.d.ts +3 -0
- package/dist/hooks/usePlatform.d.ts.map +1 -0
- package/dist/hooks/usePlatform.js +10 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +364 -337
- package/dist/lang/locales/ui_en.json.js +15 -15
- package/dist/lang/locales/ui_es.json.js +13 -13
- package/dist/lang/locales/ui_ru.json.js +12 -12
- package/dist/lib/contentImport/lexicalSerializer.js +59 -47
- package/dist/lib/contentImport/utils.d.ts.map +1 -1
- package/dist/lib/layersVisitData.d.ts.map +1 -1
- package/dist/store/featureProgress.d.ts +39 -0
- package/dist/store/featureProgress.d.ts.map +1 -0
- package/dist/store/featureProgress.js +68 -0
- package/dist/store/plansModal.d.ts.map +1 -1
- package/dist/store/plansModal.js +8 -6
- package/docs/README.md +499 -499
- package/package.json +75 -74
|
@@ -1,28 +1,28 @@
|
|
|
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 I, useEffect as b, useCallback as S } from "react";
|
|
3
3
|
import { useTranslation as P } from "react-i18next";
|
|
4
|
-
import { Search01Icon as
|
|
5
|
-
import { HugeiconsIcon as
|
|
6
|
-
import { Stack as C, TextInput as
|
|
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
|
|
10
|
-
import { useGiphyPhotos as
|
|
11
|
-
import
|
|
12
|
-
const v = (
|
|
13
|
-
token:
|
|
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"), [
|
|
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
|
-
|
|
20
|
-
), a =
|
|
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((
|
|
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
|
|
34
|
-
(
|
|
35
|
-
y(
|
|
33
|
+
const x = S(
|
|
34
|
+
(t) => {
|
|
35
|
+
y(t.currentTarget.value), p(1);
|
|
36
36
|
},
|
|
37
37
|
[]
|
|
38
38
|
);
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
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__ */
|
|
43
|
+
leftSection: s ? /* @__PURE__ */ e(L, { size: 16 }) : /* @__PURE__ */ e(w, { size: 16, icon: T }),
|
|
44
44
|
maxLength: 50,
|
|
45
|
-
placeholder: o("changeCover.
|
|
45
|
+
placeholder: o("changeCover.searchGifs"),
|
|
46
46
|
"data-autofocus": !0,
|
|
47
|
-
value:
|
|
48
|
-
onChange:
|
|
47
|
+
value: m,
|
|
48
|
+
onChange: x
|
|
49
49
|
}
|
|
50
|
-
),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
!!a.length && /* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
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?.(
|
|
56
|
+
onClick: () => r?.(t.images.original.url),
|
|
57
57
|
ratio: 120 / 65,
|
|
58
|
-
className:
|
|
58
|
+
className: R.itemImage,
|
|
59
59
|
style: {
|
|
60
|
-
backgroundImage: `url(${
|
|
60
|
+
backgroundImage: `url(${t.images.preview_webp.url})`
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
|
|
63
|
+
t.id
|
|
64
64
|
)) }),
|
|
65
|
-
i?.hasMore && /* @__PURE__ */
|
|
66
|
-
|
|
65
|
+
i?.hasMore && /* @__PURE__ */ e(
|
|
66
|
+
F,
|
|
67
67
|
{
|
|
68
68
|
variant: "subtle",
|
|
69
69
|
loading: s,
|
|
70
|
-
onClick: () => p((
|
|
70
|
+
onClick: () => p((t) => t + 1),
|
|
71
71
|
children: o("loadMode")
|
|
72
72
|
}
|
|
73
73
|
)
|
|
74
74
|
] }),
|
|
75
|
-
!a.length && !s && /* @__PURE__ */
|
|
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__ */
|
|
84
|
+
!a.length && s && /* @__PURE__ */ e(N, {})
|
|
85
85
|
] })
|
|
86
86
|
] });
|
|
87
87
|
};
|
|
88
88
|
export {
|
|
89
|
-
|
|
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;
|
|
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
|
|
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
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
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 :
|
|
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
|
|
22
|
-
|
|
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__ */
|
|
27
|
+
/* @__PURE__ */ r(d, { active: !0, children: /* @__PURE__ */ r(
|
|
26
28
|
f,
|
|
27
29
|
{
|
|
28
30
|
maxLength: 500,
|
|
29
31
|
size: "sm",
|
|
30
|
-
placeholder:
|
|
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__ */
|
|
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:
|
|
42
|
+
className: I.button,
|
|
40
43
|
disabled: !l.values.url,
|
|
41
|
-
children:
|
|
44
|
+
children: t("customDrawer.save")
|
|
42
45
|
}
|
|
43
46
|
) })
|
|
44
47
|
] });
|
|
45
48
|
};
|
|
46
49
|
export {
|
|
47
|
-
|
|
50
|
+
P 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,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
|
|
2
|
-
import { useState as m, useMemo as
|
|
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,
|
|
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
|
|
9
|
-
import { FilePickerSkeletonLoader as
|
|
10
|
-
import { useUnsplashPhotos as
|
|
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
|
|
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:
|
|
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 =
|
|
25
|
-
() => Object.values({ ...d, ...
|
|
26
|
-
[d,
|
|
24
|
+
), i = T(
|
|
25
|
+
() => Object.values({ ...d, ...v(o?.items) }),
|
|
26
|
+
[d, o?.items]
|
|
27
27
|
), f = A(() => {
|
|
28
28
|
setTimeout(() => {
|
|
29
|
-
g((
|
|
29
|
+
g((t) => ({ ...t, ...v(o?.items) }));
|
|
30
30
|
}, 0);
|
|
31
31
|
}, 100);
|
|
32
32
|
k(() => {
|
|
33
33
|
f();
|
|
34
|
-
}, [
|
|
34
|
+
}, [o?.items, f]), k(() => {
|
|
35
35
|
g({});
|
|
36
36
|
}, [h]);
|
|
37
|
-
const S =
|
|
38
|
-
(
|
|
39
|
-
|
|
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__ */
|
|
45
|
-
|
|
44
|
+
/* @__PURE__ */ e(D, { active: !0, children: /* @__PURE__ */ e(
|
|
45
|
+
F,
|
|
46
46
|
{
|
|
47
|
-
leftSection: n ? /* @__PURE__ */
|
|
47
|
+
leftSection: n ? /* @__PURE__ */ e(M, { size: 16 }) : /* @__PURE__ */ e(B, { size: 16, icon: j }),
|
|
48
48
|
maxLength: 50,
|
|
49
|
-
placeholder:
|
|
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__ */
|
|
58
|
-
/* @__PURE__ */
|
|
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?.(
|
|
61
|
+
onClick: () => l?.(t.urls.regular),
|
|
62
62
|
ratio: 120 / 65,
|
|
63
63
|
className: y.itemImage,
|
|
64
64
|
style: {
|
|
65
|
-
backgroundImage: `url(${
|
|
65
|
+
backgroundImage: `url(${t.urls.small})`
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
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__ */
|
|
72
|
+
/* @__PURE__ */ e(
|
|
73
73
|
b,
|
|
74
74
|
{
|
|
75
75
|
component: "a",
|
|
76
76
|
inherit: !0,
|
|
77
|
-
href:
|
|
77
|
+
href: t.user.links.html,
|
|
78
78
|
target: "_blank",
|
|
79
79
|
rel: "noopener noreferrer",
|
|
80
80
|
onClick: (P) => P.stopPropagation(),
|
|
81
|
-
children:
|
|
81
|
+
children: t.user.name
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
] }) })
|
|
85
|
-
] },
|
|
86
|
-
|
|
85
|
+
] }, t.id)) }),
|
|
86
|
+
o?.hasMore && /* @__PURE__ */ e(
|
|
87
87
|
q,
|
|
88
88
|
{
|
|
89
89
|
variant: "subtle",
|
|
90
90
|
loading: n,
|
|
91
|
-
onClick: () => p((
|
|
92
|
-
children:
|
|
91
|
+
onClick: () => p((t) => t + 1),
|
|
92
|
+
children: r("loadMore")
|
|
93
93
|
}
|
|
94
94
|
)
|
|
95
95
|
] }),
|
|
96
|
-
!i.length && !n && /* @__PURE__ */
|
|
97
|
-
|
|
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:
|
|
101
|
+
description: r("changeCover.noResult"),
|
|
102
102
|
titleProps: { size: "xs", c: "dimmed" }
|
|
103
103
|
}
|
|
104
104
|
) }),
|
|
105
|
-
!i.length && n && /* @__PURE__ */
|
|
105
|
+
!i.length && n && /* @__PURE__ */ e(R, {})
|
|
106
106
|
] })
|
|
107
107
|
] });
|
|
108
108
|
};
|
|
109
109
|
export {
|
|
110
|
-
|
|
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;
|
|
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
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { Image02Icon as
|
|
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
|
|
7
|
-
import { Dropzone as
|
|
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
|
|
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:
|
|
12
|
+
const C = ({
|
|
13
|
+
type: s = "image",
|
|
13
14
|
uploading: g,
|
|
14
|
-
dropZoneProps:
|
|
15
|
-
onUpload:
|
|
15
|
+
dropZoneProps: n,
|
|
16
|
+
onUpload: c
|
|
16
17
|
}) => {
|
|
17
|
-
const { t: e } =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
(
|
|
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((
|
|
34
|
-
|
|
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
|
-
(
|
|
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
|
-
),
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
|
|
50
|
+
), F = p(c, [c]);
|
|
51
|
+
return /* @__PURE__ */ o(
|
|
52
|
+
I,
|
|
54
53
|
{
|
|
55
54
|
loading: g,
|
|
56
|
-
onDrop:
|
|
55
|
+
onDrop: F,
|
|
57
56
|
onReject: y,
|
|
58
|
-
maxFiles:
|
|
59
|
-
accept:
|
|
57
|
+
maxFiles: n?.maxFiles || 1,
|
|
58
|
+
accept: E,
|
|
60
59
|
px: 60,
|
|
61
60
|
py: "xl",
|
|
62
|
-
|
|
63
|
-
|
|
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__ */
|
|
72
|
+
/* @__PURE__ */ o(
|
|
73
73
|
v,
|
|
74
74
|
{
|
|
75
75
|
size: 32,
|
|
76
76
|
color: "var(--mantine-color-bright)",
|
|
77
|
-
icon:
|
|
77
|
+
icon: M
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
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
|
-
|
|
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
|
|
4
|
-
const
|
|
5
|
-
`https://api.giphy.com/v1${
|
|
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 ||
|
|
7
|
+
api_key: i || u
|
|
8
8
|
})}`
|
|
9
9
|
);
|
|
10
|
-
if (!
|
|
10
|
+
if (!s.ok)
|
|
11
11
|
throw new Error("Failed to fetch Giphy photos");
|
|
12
|
-
const t = await
|
|
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
|
-
},
|
|
19
|
+
}, w = (o, n, i) => h({
|
|
20
20
|
queryKey: ["giphyPhotos", o, n],
|
|
21
|
-
queryFn: () =>
|
|
21
|
+
queryFn: () => y(o, n, i)
|
|
22
22
|
});
|
|
23
23
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
y as fetchGiphyPhotos,
|
|
25
|
+
w as useGiphyPhotos
|
|
26
26
|
};
|
|
@@ -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"}
|