@layers-app/shared 0.2.5 → 0.2.7
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/flags/es.svg.js +4 -0
- package/dist/assets/svg/flags/ru.svg.js +4 -0
- package/dist/assets/svg/flags/us.svg.js +4 -0
- package/dist/assets/svg/globeIcon.svg.js +5 -0
- package/dist/assets/svg/socials/github.svg.js +5 -0
- package/dist/assets/svg/socials/instagram.svg.js +5 -0
- package/dist/assets/svg/socials/x.svg.js +5 -0
- package/dist/assets/svg/socials/youtube.svg.js +5 -0
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.js +4 -4
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +22 -22
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +25 -25
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +40 -40
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.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 +49 -43
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -2
- package/dist/components/AppContainer/types.d.ts +2 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.d.ts +33 -2
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +161 -110
- package/dist/components/FilePicker/FilePicker.module.css.js +9 -7
- package/dist/components/FilePicker/FilePickerGoogleDrive.d.ts +22 -0
- package/dist/components/FilePicker/FilePickerGoogleDrive.d.ts.map +1 -0
- package/dist/components/FilePicker/FilePickerGoogleDrive.js +86 -0
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUnsplash.js +69 -52
- package/dist/components/FormViewer/components/OneSlideLayput.js +39 -37
- package/dist/components/FormViewer/hooks/useCreateFormContext.d.ts.map +1 -1
- package/dist/components/FormViewer/hooks/useCreateFormContext.js +10 -10
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.js +15 -15
- package/dist/components/FormViewer/hooks/useInterpolateText.js +3 -3
- package/dist/components/FormViewer/store/formStore.js +3 -3
- package/dist/components/FormViewer/store/formStoreApi.js +13 -13
- package/dist/components/FormViewer/store/selectors.js +1 -1
- package/dist/components/GroupAvatar/index.d.ts +1 -0
- package/dist/components/GroupAvatar/index.d.ts.map +1 -1
- package/dist/components/GroupAvatar/index.js +9 -8
- package/dist/components/ImageCropper/ImageCropper.d.ts +19 -0
- package/dist/components/ImageCropper/ImageCropper.d.ts.map +1 -0
- package/dist/components/ImageCropper/ImageCropper.js +358 -0
- package/dist/components/ImageCropper/ImageCropper.module.css.js +51 -0
- package/dist/components/ImageCropper/cropUtils.d.ts +22 -0
- package/dist/components/ImageCropper/cropUtils.d.ts.map +1 -0
- package/dist/components/ImageCropper/cropUtils.js +42 -0
- package/dist/components/ImageCropper/index.d.ts +4 -0
- package/dist/components/ImageCropper/index.d.ts.map +1 -0
- package/dist/components/ImageCropper/useCropInteraction.d.ts +28 -0
- package/dist/components/ImageCropper/useCropInteraction.d.ts.map +1 -0
- package/dist/components/ImageCropper/useCropInteraction.js +76 -0
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts +21 -0
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.d.ts.map +1 -0
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.js +73 -0
- package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +19 -0
- package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts +6 -0
- package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.d.ts.map +1 -0
- package/dist/components/IntegrationFlowAnimation/icons/GoogleDriveIcon.js +60 -0
- package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts +6 -0
- package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.d.ts.map +1 -0
- package/dist/components/IntegrationFlowAnimation/icons/LayersCubeIcon.js +21 -0
- package/dist/components/IntegrationFlowAnimation/icons/NotionIcon.d.ts +6 -0
- package/dist/components/IntegrationFlowAnimation/icons/NotionIcon.d.ts.map +1 -0
- package/dist/components/IntegrationFlowAnimation/icons/NotionIcon.js +35 -0
- package/dist/components/IntegrationFlowAnimation/icons/index.d.ts +4 -0
- package/dist/components/IntegrationFlowAnimation/icons/index.d.ts.map +1 -0
- package/dist/components/IntegrationFlowAnimation/index.d.ts +5 -0
- package/dist/components/IntegrationFlowAnimation/index.d.ts.map +1 -0
- package/dist/components/LanguagePicker/LanguagePicker.d.ts +2 -1
- package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
- package/dist/components/LanguagePicker/LanguagePicker.js +44 -31
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +6 -4
- package/dist/components/MediaLibrary/MediaLibrary.d.ts +3 -0
- package/dist/components/MediaLibrary/MediaLibrary.d.ts.map +1 -0
- package/dist/components/MediaLibrary/MediaLibrary.js +93 -0
- package/dist/components/MediaLibrary/MediaLibrary.module.css.js +17 -0
- package/dist/components/MediaLibrary/MediaLibraryBreadcrumbs.d.ts +8 -0
- package/dist/components/MediaLibrary/MediaLibraryBreadcrumbs.d.ts.map +1 -0
- package/dist/components/MediaLibrary/MediaLibraryBreadcrumbs.js +22 -0
- package/dist/components/MediaLibrary/MediaLibraryBrowser.d.ts +12 -0
- package/dist/components/MediaLibrary/MediaLibraryBrowser.d.ts.map +1 -0
- package/dist/components/MediaLibrary/MediaLibraryBrowser.js +52 -0
- package/dist/components/MediaLibrary/MediaLibraryRow.d.ts +9 -0
- package/dist/components/MediaLibrary/MediaLibraryRow.d.ts.map +1 -0
- package/dist/components/MediaLibrary/MediaLibraryRow.js +29 -0
- package/dist/components/MediaLibrary/index.d.ts +4 -0
- package/dist/components/MediaLibrary/index.d.ts.map +1 -0
- package/dist/components/MediaLibrary/types.d.ts +31 -0
- package/dist/components/MediaLibrary/types.d.ts.map +1 -0
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +53 -50
- package/dist/components/NavMenu/types.d.ts +1 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/NoData/NoData.d.ts +6 -1
- package/dist/components/NoData/NoData.d.ts.map +1 -1
- package/dist/components/NoData/NoData.js +85 -82
- package/dist/components/SettingsSection/index.d.ts +12 -0
- package/dist/components/SettingsSection/index.d.ts.map +1 -0
- package/dist/components/SettingsSection/index.js +36 -0
- package/dist/components/SettingsSection/styles.module.css.js +7 -0
- package/dist/components/SocialLinkRow/index.d.ts +11 -0
- package/dist/components/SocialLinkRow/index.d.ts.map +1 -0
- package/dist/components/SocialLinkRow/index.js +131 -0
- package/dist/components/SortableList/components/SortableItem/SortableItem.js +3 -3
- package/dist/components/StorageUsageProgress/index.js +26 -24
- package/dist/components/TimezonePicker/index.d.ts +9 -0
- package/dist/components/TimezonePicker/index.d.ts.map +1 -0
- package/dist/components/TimezonePicker/index.js +91 -0
- package/dist/components/UserAvatar/index.d.ts.map +1 -1
- package/dist/components/UserAvatar/index.js +11 -10
- package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +18 -17
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +70 -69
- package/dist/components/modals/RemoveConfirmModal.js +1 -1
- package/dist/components/table/components/TableHeaders.js +3 -3
- package/dist/components/table/components/TablePanel.js +1 -1
- package/dist/components/table/helpers/columns.js +3 -3
- package/dist/components/table/hooks/TableProvider.js +3 -3
- package/dist/components/table/selectors.js +6 -6
- package/dist/helpers/getFileType.d.ts +1 -2
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +5 -6
- package/dist/helpers/showFeatureFeedback.d.ts +16 -0
- package/dist/helpers/showFeatureFeedback.d.ts.map +1 -0
- package/dist/helpers/showFeatureFeedback.js +109 -0
- package/dist/helpers/showFeatureFeedback.module.css.js +9 -0
- package/dist/helpers/showNotifications.d.ts +14 -3
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +120 -61
- package/dist/helpers/showNotifications.module.css.js +29 -0
- package/dist/helpers/timezones.d.ts +12 -0
- package/dist/helpers/timezones.d.ts.map +1 -0
- package/dist/helpers/timezones.js +59 -0
- package/dist/hooks/useFeatureFeedback.d.ts +23 -0
- package/dist/hooks/useFeatureFeedback.d.ts.map +1 -0
- package/dist/hooks/useFeatureFeedback.js +48 -0
- package/dist/hooks/useNumberQueryParam.js +3 -3
- package/dist/hooks/useVideoUploadGuard.d.ts +2 -0
- package/dist/hooks/useVideoUploadGuard.d.ts.map +1 -0
- package/dist/hooks/useVideoUploadGuard.js +24 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +461 -406
- package/dist/lang/locales/ui_en.json.js +24 -22
- package/dist/lang/locales/ui_es.json.js +20 -18
- package/dist/lang/locales/ui_ru.json.js +20 -18
- package/dist/lib/contentImport/index.d.ts +4 -0
- package/dist/lib/contentImport/index.d.ts.map +1 -0
- package/dist/lib/contentImport/lexicalSerializer.d.ts +19 -0
- package/dist/lib/contentImport/lexicalSerializer.d.ts.map +1 -0
- package/dist/lib/contentImport/lexicalSerializer.js +215 -0
- package/dist/lib/contentImport/types.d.ts +161 -0
- package/dist/lib/contentImport/types.d.ts.map +1 -0
- package/dist/lib/contentImport/utils.d.ts +35 -0
- package/dist/lib/contentImport/utils.d.ts.map +1 -0
- package/dist/lib/contentImport/utils.js +145 -0
- package/dist/lib/layersVisitData.d.ts +13 -0
- package/dist/lib/layersVisitData.d.ts.map +1 -0
- package/dist/lib/layersVisitData.js +37 -0
- package/dist/node_modules/countries-and-timezones/esm/index.js +4031 -0
- package/dist/store/plansModal.d.ts.map +1 -1
- package/dist/store/plansModal.js +8 -7
- package/dist/utils/formatStorage.d.ts +7 -1
- package/dist/utils/formatStorage.d.ts.map +1 -1
- package/dist/utils/formatStorage.js +10 -5
- package/dist/utils/getCroppedBlob.d.ts +3 -0
- package/dist/utils/getCroppedBlob.d.ts.map +1 -0
- package/dist/utils/getCroppedBlob.js +21 -0
- package/package.json +1 -1
- package/dist/assets/images/flags/es.svg.js +0 -4
- package/dist/assets/images/flags/ru.svg.js +0 -4
- package/dist/assets/images/flags/us.svg.js +0 -4
- package/dist/components/PaymentSuccess/PaymentSuccess.d.ts +0 -2
- package/dist/components/PaymentSuccess/PaymentSuccess.d.ts.map +0 -1
- package/dist/components/PaymentSuccess/PaymentSuccess.js +0 -41
|
@@ -1,120 +1,141 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { ImageAdd02Icon as
|
|
5
|
-
import { HugeiconsIcon as
|
|
6
|
-
import { Flex as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as F, useMemo as M } from "react";
|
|
3
|
+
import { useTranslation as Q } from "react-i18next";
|
|
4
|
+
import { ImageAdd02Icon as P } from "@hugeicons/core-free-icons";
|
|
5
|
+
import { HugeiconsIcon as S } from "@hugeicons/react";
|
|
6
|
+
import { Flex as r, ActionIcon as W, Button as z, Text as X, Popover as g, Tabs as v, Stack as Y } from "@mantine/core";
|
|
7
|
+
import { isFeature as Z } from "../../helpers/feature.js";
|
|
8
|
+
import { useMenu as _ } from "../../hooks/useMenu.js";
|
|
9
|
+
import { MediaLibraryBrowser as $ } from "../MediaLibrary/MediaLibraryBrowser.js";
|
|
10
|
+
import { FilePickerGallery as T } from "./FilePickerGallery.js";
|
|
11
|
+
import { FilePickerGiphy as D } from "./FilePickerGiphy.js";
|
|
12
|
+
import { FilePickerLink as ee } from "./FilePickerLink.js";
|
|
13
|
+
import { FilePickerUnsplash as ne } from "./FilePickerUnsplash.js";
|
|
14
|
+
import { FilePickerGoogleDrive as ie } from "./FilePickerGoogleDrive.js";
|
|
15
|
+
import { FilePickerUpload as le } from "./FilePickerUpload.js";
|
|
16
|
+
import y from "./FilePicker.module.css.js";
|
|
17
|
+
const re = [
|
|
15
18
|
"gallery",
|
|
16
19
|
"upload",
|
|
17
20
|
"link",
|
|
18
21
|
"unsplash",
|
|
19
|
-
"giphy"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
"giphy",
|
|
23
|
+
"googleDrive",
|
|
24
|
+
"media"
|
|
25
|
+
], xe = ({
|
|
26
|
+
onChange: B,
|
|
27
|
+
onRemove: G,
|
|
28
|
+
onUpload: f,
|
|
29
|
+
uploading: I = !1,
|
|
30
|
+
showTabs: s = re,
|
|
31
|
+
children: V,
|
|
32
|
+
width: j = 610,
|
|
33
|
+
position: L = "bottom-end",
|
|
34
|
+
readOnly: A = !1,
|
|
35
|
+
hasImage: E,
|
|
36
|
+
giphyToken: d,
|
|
37
|
+
unsplashClientId: m,
|
|
38
|
+
type: b = "image",
|
|
39
|
+
galleryCollection: u = [],
|
|
35
40
|
isValidMediaUrl: N,
|
|
36
41
|
popoverProps: U,
|
|
37
|
-
dropZoneProps:
|
|
38
|
-
targetProps:
|
|
39
|
-
onOpenedChange:
|
|
42
|
+
dropZoneProps: H,
|
|
43
|
+
targetProps: O,
|
|
44
|
+
onOpenedChange: R,
|
|
45
|
+
googleDrive: i,
|
|
46
|
+
mediaLibrary: a
|
|
40
47
|
}) => {
|
|
41
|
-
const { t: l } =
|
|
48
|
+
const { t: l } = Q("ui"), [k, h] = F(!1), { isMobile: C } = _(), p = M(
|
|
42
49
|
() => [
|
|
43
50
|
{
|
|
44
51
|
value: "gallery",
|
|
45
|
-
label: /* @__PURE__ */ e(
|
|
46
|
-
visible:
|
|
52
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.gallery") }) }),
|
|
53
|
+
visible: s.includes("gallery") && !!u.length
|
|
47
54
|
},
|
|
48
55
|
{
|
|
49
56
|
value: "upload",
|
|
50
|
-
label: /* @__PURE__ */ e(
|
|
51
|
-
visible:
|
|
57
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.upload") }) }),
|
|
58
|
+
visible: s.includes("upload") && !!f
|
|
52
59
|
},
|
|
53
60
|
{
|
|
54
61
|
value: "link",
|
|
55
|
-
label: /* @__PURE__ */ e(
|
|
56
|
-
visible:
|
|
62
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.link") }) }),
|
|
63
|
+
visible: s.includes("link")
|
|
57
64
|
},
|
|
58
65
|
{
|
|
59
66
|
value: "unsplash",
|
|
60
|
-
label: /* @__PURE__ */ e(
|
|
61
|
-
visible:
|
|
67
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.searchImages") }) }),
|
|
68
|
+
visible: s.includes("unsplash") && m
|
|
62
69
|
},
|
|
63
70
|
{
|
|
64
71
|
value: "giphy",
|
|
65
|
-
label: /* @__PURE__ */ e(
|
|
66
|
-
visible:
|
|
72
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
|
|
73
|
+
visible: s.includes("giphy") && d
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
value: "googleDrive",
|
|
77
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.googleDrive", {
|
|
78
|
+
defaultValue: "Google Drive"
|
|
79
|
+
}) }) }),
|
|
80
|
+
visible: s.includes("googleDrive") && !!i
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: "media",
|
|
84
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: l("changeCover.media", { defaultValue: "Media" }) }) }),
|
|
85
|
+
visible: s.includes("media") && !!a && Z()
|
|
67
86
|
}
|
|
68
|
-
].filter((
|
|
87
|
+
].filter((n) => n.visible),
|
|
69
88
|
[
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
89
|
+
s,
|
|
90
|
+
m,
|
|
91
|
+
d,
|
|
73
92
|
l,
|
|
74
|
-
|
|
75
|
-
|
|
93
|
+
u.length,
|
|
94
|
+
f,
|
|
95
|
+
i,
|
|
96
|
+
a
|
|
76
97
|
]
|
|
77
|
-
), [
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
return
|
|
81
|
-
}),
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
/* @__PURE__ */ e(
|
|
98
|
+
), [o, q] = F(() => {
|
|
99
|
+
if (p[0]) return p[0].value;
|
|
100
|
+
const n = p.find((K) => K.visible);
|
|
101
|
+
return n ? n.value : "";
|
|
102
|
+
}), w = (n) => {
|
|
103
|
+
f?.(n, h);
|
|
104
|
+
}, c = (n) => {
|
|
105
|
+
B?.(n), h(!1);
|
|
106
|
+
}, J = M(() => C ? /* @__PURE__ */ t(W, { size: "lg", children: [
|
|
107
|
+
/* @__PURE__ */ e(S, { icon: P, size: 22 }),
|
|
87
108
|
" "
|
|
88
109
|
] }) : /* @__PURE__ */ e(
|
|
89
|
-
|
|
110
|
+
z,
|
|
90
111
|
{
|
|
91
112
|
variant: "default",
|
|
92
113
|
size: "xs",
|
|
93
|
-
leftSection: /* @__PURE__ */ e(
|
|
94
|
-
children: /* @__PURE__ */ e(
|
|
114
|
+
leftSection: /* @__PURE__ */ e(S, { icon: P, size: 16 }),
|
|
115
|
+
children: /* @__PURE__ */ e(X, { fw: 600, size: "sm", children: l("changeCover.change") })
|
|
95
116
|
}
|
|
96
|
-
), [l,
|
|
97
|
-
|
|
117
|
+
), [l, C]), x = (n) => {
|
|
118
|
+
h(n), R?.(n);
|
|
98
119
|
};
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
|
|
120
|
+
return /* @__PURE__ */ t(
|
|
121
|
+
g,
|
|
101
122
|
{
|
|
102
|
-
width:
|
|
123
|
+
width: j,
|
|
103
124
|
radius: "var(--mantine-spacing-sm)",
|
|
104
|
-
position:
|
|
125
|
+
position: L,
|
|
105
126
|
shadow: "md",
|
|
106
|
-
opened:
|
|
107
|
-
onChange:
|
|
127
|
+
opened: k,
|
|
128
|
+
onChange: x,
|
|
108
129
|
withinPortal: !0,
|
|
109
130
|
...U || {},
|
|
110
131
|
children: [
|
|
111
|
-
/* @__PURE__ */ e(
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */ e(
|
|
114
|
-
|
|
132
|
+
/* @__PURE__ */ e(g.Target, { children: /* @__PURE__ */ e(r, { onClick: () => x(!k), ...O, children: V ?? J }) }),
|
|
133
|
+
/* @__PURE__ */ t(g.Dropdown, { p: 0, children: [
|
|
134
|
+
/* @__PURE__ */ e(r, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
|
|
135
|
+
v,
|
|
115
136
|
{
|
|
116
137
|
defaultValue: "gallery",
|
|
117
|
-
value:
|
|
138
|
+
value: o,
|
|
118
139
|
styles: {
|
|
119
140
|
list: {
|
|
120
141
|
alignItems: "center",
|
|
@@ -122,8 +143,8 @@ const $ = [
|
|
|
122
143
|
}
|
|
123
144
|
},
|
|
124
145
|
w: "100%",
|
|
125
|
-
children: /* @__PURE__ */
|
|
126
|
-
|
|
146
|
+
children: /* @__PURE__ */ t(
|
|
147
|
+
v.List,
|
|
127
148
|
{
|
|
128
149
|
style: {
|
|
129
150
|
gap: "4px"
|
|
@@ -131,21 +152,21 @@ const $ = [
|
|
|
131
152
|
px: 8,
|
|
132
153
|
h: 54,
|
|
133
154
|
children: [
|
|
134
|
-
|
|
135
|
-
|
|
155
|
+
p.map((n) => /* @__PURE__ */ e(
|
|
156
|
+
v.Tab,
|
|
136
157
|
{
|
|
137
|
-
className:
|
|
138
|
-
disabled:
|
|
158
|
+
className: y.originalTab,
|
|
159
|
+
disabled: A,
|
|
139
160
|
h: "100%",
|
|
140
161
|
p: 0,
|
|
141
|
-
value:
|
|
142
|
-
onClick: () =>
|
|
143
|
-
children: /* @__PURE__ */ e(
|
|
162
|
+
value: n.value,
|
|
163
|
+
onClick: () => q(n.value),
|
|
164
|
+
children: /* @__PURE__ */ e(r, { className: y.customTab, px: "sm", h: 36, children: n.label })
|
|
144
165
|
},
|
|
145
|
-
|
|
166
|
+
n.value
|
|
146
167
|
)),
|
|
147
|
-
|
|
148
|
-
|
|
168
|
+
E && /* @__PURE__ */ e(
|
|
169
|
+
z,
|
|
149
170
|
{
|
|
150
171
|
variant: "subtle",
|
|
151
172
|
fz: "sm",
|
|
@@ -153,7 +174,7 @@ const $ = [
|
|
|
153
174
|
fw: 500,
|
|
154
175
|
px: "sm",
|
|
155
176
|
size: "30px",
|
|
156
|
-
onClick:
|
|
177
|
+
onClick: G,
|
|
157
178
|
color: "var(--mantine-color-gray-light-color)",
|
|
158
179
|
style: { marginLeft: "auto" },
|
|
159
180
|
children: l("remove")
|
|
@@ -164,39 +185,69 @@ const $ = [
|
|
|
164
185
|
)
|
|
165
186
|
}
|
|
166
187
|
) }),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
|
|
169
|
-
|
|
188
|
+
/* @__PURE__ */ t(Y, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
|
|
189
|
+
o === "gallery" && !!u.length && /* @__PURE__ */ e(
|
|
190
|
+
T,
|
|
170
191
|
{
|
|
171
|
-
galleryCollection:
|
|
172
|
-
onChange:
|
|
192
|
+
galleryCollection: u,
|
|
193
|
+
onChange: c
|
|
173
194
|
}
|
|
174
195
|
),
|
|
175
|
-
|
|
176
|
-
|
|
196
|
+
o === "upload" && /* @__PURE__ */ e(
|
|
197
|
+
le,
|
|
177
198
|
{
|
|
178
|
-
type:
|
|
179
|
-
uploading:
|
|
180
|
-
dropZoneProps:
|
|
181
|
-
onUpload:
|
|
199
|
+
type: b || "image",
|
|
200
|
+
uploading: I,
|
|
201
|
+
dropZoneProps: H,
|
|
202
|
+
onUpload: w
|
|
182
203
|
}
|
|
183
204
|
),
|
|
184
|
-
|
|
185
|
-
|
|
205
|
+
o === "link" && /* @__PURE__ */ e(
|
|
206
|
+
ee,
|
|
186
207
|
{
|
|
187
|
-
type:
|
|
188
|
-
onChange:
|
|
208
|
+
type: b || "image",
|
|
209
|
+
onChange: c,
|
|
189
210
|
isValidMediaUrl: N
|
|
190
211
|
}
|
|
191
212
|
),
|
|
192
|
-
|
|
193
|
-
|
|
213
|
+
o === "unsplash" && m && /* @__PURE__ */ e(
|
|
214
|
+
ne,
|
|
215
|
+
{
|
|
216
|
+
clientId: m,
|
|
217
|
+
onChange: c
|
|
218
|
+
}
|
|
219
|
+
),
|
|
220
|
+
o === "giphy" && d && /* @__PURE__ */ e(D, { token: d, onChange: c }),
|
|
221
|
+
o === "googleDrive" && i && /* @__PURE__ */ e(
|
|
222
|
+
ie,
|
|
194
223
|
{
|
|
195
|
-
|
|
196
|
-
|
|
224
|
+
isConnected: i.isConnected,
|
|
225
|
+
connectedEmail: i.connectedEmail,
|
|
226
|
+
files: i.files,
|
|
227
|
+
isLoading: i.isLoading,
|
|
228
|
+
hasMore: i.hasMore,
|
|
229
|
+
isImporting: i.isImporting,
|
|
230
|
+
onSearch: i.onSearch,
|
|
231
|
+
onLoadMore: i.onLoadMore,
|
|
232
|
+
onSelect: (n) => {
|
|
233
|
+
i.onSelect(n, c);
|
|
234
|
+
},
|
|
235
|
+
error: i.error
|
|
197
236
|
}
|
|
198
237
|
),
|
|
199
|
-
|
|
238
|
+
o === "media" && a && /* @__PURE__ */ e(
|
|
239
|
+
$,
|
|
240
|
+
{
|
|
241
|
+
items: a.items,
|
|
242
|
+
isLoading: a.isLoading,
|
|
243
|
+
breadcrumbs: a.breadcrumbs,
|
|
244
|
+
onFolderClick: a.onFolderClick,
|
|
245
|
+
onBreadcrumbClick: a.onBreadcrumbClick,
|
|
246
|
+
onSelect: (n) => {
|
|
247
|
+
a.onSelect?.(n), h(!1);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
)
|
|
200
251
|
] })
|
|
201
252
|
] })
|
|
202
253
|
]
|
|
@@ -204,5 +255,5 @@ const $ = [
|
|
|
204
255
|
);
|
|
205
256
|
};
|
|
206
257
|
export {
|
|
207
|
-
|
|
258
|
+
xe as FilePicker
|
|
208
259
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_itemImage_1me1c_1", o = "_imageAuthor_1me1c_14", a = "_originalTab_1me1c_22", e = "_customTab_1me1c_28", m = "_button_1me1c_36", _ = {
|
|
2
2
|
itemImage: t,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
imageAuthor: o,
|
|
4
|
+
originalTab: a,
|
|
5
|
+
customTab: e,
|
|
6
|
+
button: m
|
|
6
7
|
};
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
m as button,
|
|
10
|
+
e as customTab,
|
|
10
11
|
_ as default,
|
|
12
|
+
o as imageAuthor,
|
|
11
13
|
t as itemImage,
|
|
12
|
-
|
|
14
|
+
a as originalTab
|
|
13
15
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface GoogleDriveFile {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
mimeType: string;
|
|
5
|
+
thumbnailLink?: string;
|
|
6
|
+
iconLink?: string;
|
|
7
|
+
}
|
|
8
|
+
interface FilePickerGoogleDriveProps {
|
|
9
|
+
isConnected: boolean;
|
|
10
|
+
connectedEmail?: string;
|
|
11
|
+
files: GoogleDriveFile[];
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
hasMore: boolean;
|
|
14
|
+
isImporting: boolean;
|
|
15
|
+
onSearch: (query: string) => void;
|
|
16
|
+
onLoadMore: () => void;
|
|
17
|
+
onSelect: (file: GoogleDriveFile) => void;
|
|
18
|
+
error: string | null;
|
|
19
|
+
}
|
|
20
|
+
export declare const FilePickerGoogleDrive: ({ isConnected, files, isLoading, hasMore, isImporting, onSearch, onLoadMore, onSelect, error, }: FilePickerGoogleDriveProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=FilePickerGoogleDrive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilePickerGoogleDrive.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGoogleDrive.tsx"],"names":[],"mappings":"AA6BA,UAAU,eAAe;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,0BAA0B;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,GAAI,iGAUnC,0BAA0B,4CAmH5B,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, useRef as D, useEffect as y, useCallback as I } from "react";
|
|
3
|
+
import { useTranslation as T } from "react-i18next";
|
|
4
|
+
import { Search01Icon as G } from "@hugeicons/core-free-icons";
|
|
5
|
+
import { HugeiconsIcon as R } from "@hugeicons/react";
|
|
6
|
+
import { Center as h, Stack as a, Loader as g, Text as l, TextInput as V, Box as p, SimpleGrid as F, AspectRatio as L, Button as P } from "@mantine/core";
|
|
7
|
+
import { useDebouncedValue as j } from "@mantine/hooks";
|
|
8
|
+
import { NoData as w } from "../NoData/NoData.js";
|
|
9
|
+
import { FilePickerSkeletonLoader as B } from "./FilePickerSkeletonLoader.js";
|
|
10
|
+
import N from "./FilePicker.module.css.js";
|
|
11
|
+
const O = ({
|
|
12
|
+
isConnected: f,
|
|
13
|
+
files: o,
|
|
14
|
+
isLoading: n,
|
|
15
|
+
hasMore: v,
|
|
16
|
+
isImporting: x,
|
|
17
|
+
onSearch: c,
|
|
18
|
+
onLoadMore: k,
|
|
19
|
+
onSelect: b,
|
|
20
|
+
error: s
|
|
21
|
+
}) => {
|
|
22
|
+
const { t } = T("ui"), [m, S] = C(""), [u] = j(m, 800), d = D(c);
|
|
23
|
+
d.current = c, y(() => {
|
|
24
|
+
d.current(u);
|
|
25
|
+
}, [u]);
|
|
26
|
+
const z = I(
|
|
27
|
+
(r) => {
|
|
28
|
+
S(r.currentTarget.value);
|
|
29
|
+
},
|
|
30
|
+
[]
|
|
31
|
+
);
|
|
32
|
+
return x ? /* @__PURE__ */ e(h, { h: 200, children: /* @__PURE__ */ i(a, { align: "center", gap: "xs", children: [
|
|
33
|
+
/* @__PURE__ */ e(g, { size: "sm" }),
|
|
34
|
+
/* @__PURE__ */ e(l, { size: "sm", c: "dimmed", children: t("externalDrive.importing", {
|
|
35
|
+
defaultValue: "Importing file..."
|
|
36
|
+
}) })
|
|
37
|
+
] }) }) : f ? /* @__PURE__ */ i(a, { gap: "sm", children: [
|
|
38
|
+
s && /* @__PURE__ */ e(l, { size: "xs", c: "red", children: s }),
|
|
39
|
+
/* @__PURE__ */ e(
|
|
40
|
+
V,
|
|
41
|
+
{
|
|
42
|
+
leftSection: n ? /* @__PURE__ */ e(g, { size: 16 }) : /* @__PURE__ */ e(R, { size: 16, icon: G }),
|
|
43
|
+
maxLength: 50,
|
|
44
|
+
placeholder: t("externalDrive.searchFiles", {
|
|
45
|
+
defaultValue: "Search Google Drive"
|
|
46
|
+
}),
|
|
47
|
+
"data-autofocus": !0,
|
|
48
|
+
value: m,
|
|
49
|
+
onChange: z
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ i(p, { mah: 300, w: "100%", style: { overflowY: "auto" }, children: [
|
|
53
|
+
!!o.length && /* @__PURE__ */ i(a, { gap: 8, children: [
|
|
54
|
+
/* @__PURE__ */ e(F, { cols: 4, spacing: 10, children: o.map((r) => /* @__PURE__ */ e(
|
|
55
|
+
L,
|
|
56
|
+
{
|
|
57
|
+
onClick: () => b(r),
|
|
58
|
+
ratio: 120 / 65,
|
|
59
|
+
className: N.itemImage,
|
|
60
|
+
style: {
|
|
61
|
+
backgroundImage: r.thumbnailLink ? `url(${r.thumbnailLink})` : void 0,
|
|
62
|
+
backgroundColor: r.thumbnailLink ? void 0 : "var(--mantine-color-gray-light)"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
r.id
|
|
66
|
+
)) }),
|
|
67
|
+
v && /* @__PURE__ */ e(P, { variant: "subtle", loading: n, onClick: k, children: t("loadMore") })
|
|
68
|
+
] }),
|
|
69
|
+
!o.length && !n && /* @__PURE__ */ e(p, { pb: 16, children: /* @__PURE__ */ e(
|
|
70
|
+
w,
|
|
71
|
+
{
|
|
72
|
+
size: 120,
|
|
73
|
+
illustration: "noImage",
|
|
74
|
+
description: t("changeCover.noResult"),
|
|
75
|
+
titleProps: { size: "xs", c: "dimmed" }
|
|
76
|
+
}
|
|
77
|
+
) }),
|
|
78
|
+
!o.length && n && /* @__PURE__ */ e(B, {})
|
|
79
|
+
] })
|
|
80
|
+
] }) : /* @__PURE__ */ e(h, { h: 200, children: /* @__PURE__ */ e(a, { align: "center", gap: "sm", children: /* @__PURE__ */ e(l, { size: "sm", c: "dimmed", ta: "center", children: t("externalDrive.goToSettings", {
|
|
81
|
+
defaultValue: "Connect Google Drive in Settings to import files"
|
|
82
|
+
}) }) }) });
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
O as FilePickerGoogleDrive
|
|
86
|
+
};
|
|
@@ -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":"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"}
|