@layers-app/shared 0.2.8 → 0.3.0
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/api/giphy/slice.d.ts +1 -1
- package/dist/api/giphy/slice.d.ts.map +1 -1
- package/dist/api/unsplash/slice.d.ts +1 -1
- package/dist/api/unsplash/slice.d.ts.map +1 -1
- package/dist/assets/layers-logo-icon.svg2.js +4 -0
- package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
- package/dist/components/AliasTextInput/AliasTextInput.js +8 -7
- package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +123 -114
- 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/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/index.d.ts.map +1 -1
- package/dist/components/CommunitiesDialog/index.js +47 -46
- package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
- package/dist/components/Copyright/Copyright.module.css.js +1 -1
- package/dist/components/Copyright/index.d.ts.map +1 -1
- package/dist/components/Copyright/index.js +8 -7
- package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
- 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.module.css.js +49 -49
- package/dist/components/FilePicker/FilePicker.d.ts +2 -4
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +236 -247
- package/dist/components/FilePicker/FilePicker.module.css.js +10 -12
- package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGallery.js +33 -59
- package/dist/components/FilePicker/FilePickerGiphy.d.ts +1 -1
- package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGiphy.js +51 -52
- package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerLink.js +19 -22
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts +1 -1
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUnsplash.js +64 -65
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +35 -51
- package/dist/components/FilePicker/api/giphyApi.d.ts +2 -2
- package/dist/components/FilePicker/api/giphyApi.d.ts.map +1 -1
- package/dist/components/FilePicker/api/giphyApi.js +11 -14
- package/dist/components/FilePicker/api/unsplashApi.d.ts +2 -2
- package/dist/components/FilePicker/api/unsplashApi.d.ts.map +1 -1
- package/dist/components/FilePicker/api/unsplashApi.js +14 -19
- package/dist/components/FilePicker/index.d.ts +0 -1
- 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.d.ts.map +1 -1
- package/dist/components/FormViewer/components/fields/SelectableCard/PictureSelectableCard.js +70 -72
- 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/helpers/conditions.d.ts +84 -84
- package/dist/components/FormViewer/helpers/helpers.d.ts +84 -84
- package/dist/components/FormViewer/helpers/steps.d.ts +84 -84
- package/dist/components/FormViewer/helpers/steps.d.ts.map +1 -1
- package/dist/components/FormViewer/helpers/steps.js +22 -21
- package/dist/components/FormViewer/hooks/useActiveControl.d.ts +71 -71
- package/dist/components/FormViewer/hooks/useActiveStep.d.ts +84 -84
- package/dist/components/FormViewer/store/formStore.d.ts +357 -357
- package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
- package/dist/components/FormViewer/store/formStoreApi.d.ts +178 -178
- package/dist/components/FormViewer/store/selectors.d.ts +23861 -23861
- package/dist/components/FormViewer/types/schemes.d.ts +1139 -1139
- 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/Logotype.d.ts +4 -3
- package/dist/components/Logotype.d.ts.map +1 -1
- package/dist/components/Logotype.js +56 -33
- 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/OnBoardingPage.js +35 -35
- 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/WorkspaceAvatar/WorkspaceAvatar.js +10 -10
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
- package/dist/config/brand.d.ts +48 -0
- package/dist/config/brand.d.ts.map +1 -0
- package/dist/config/brand.js +69 -0
- package/dist/config/envConfig.d.ts +70 -0
- package/dist/config/envConfig.d.ts.map +1 -0
- package/dist/config/envConfig.js +29 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +7 -6
- package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
- package/dist/helpers/showNotifications.module.css.js +1 -1
- package/dist/hooks/useDisableWindowScroll.js +3 -3
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +429 -423
- 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/docs/README.md +499 -499
- package/package.json +75 -78
- package/dist/assets/svg/default_icon.svg.js +0 -4
- package/dist/components/FilePicker/coverCollections.d.ts +0 -4
- package/dist/components/FilePicker/coverCollections.d.ts.map +0 -1
- package/dist/components/FilePicker/coverCollections.js +0 -164
- /package/dist/assets/{svg/layers-logo-full.svg.js → layers-logo-full.svg2.js} +0 -0
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { ImageAdd02Icon as
|
|
5
|
-
import { HugeiconsIcon as
|
|
6
|
-
import { Flex as a, ActionIcon as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { FilePickerGoogleDrive as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useMemo as y } from "react";
|
|
3
|
+
import { useTranslation as Q } from "react-i18next";
|
|
4
|
+
import { ImageAdd02Icon as F } from "@hugeicons/core-free-icons";
|
|
5
|
+
import { HugeiconsIcon as M } from "@hugeicons/react";
|
|
6
|
+
import { Flex as a, ActionIcon as W, Button as P, Text as X, Popover as m, Tabs as g, Stack as Y } from "@mantine/core";
|
|
7
|
+
import { getEnvConfig as S } from "../../config/envConfig.js";
|
|
8
|
+
import { isFeature as I } from "../../helpers/feature.js";
|
|
9
|
+
import { useMenu as Z } from "../../hooks/useMenu.js";
|
|
10
|
+
import { usePlatform as $ } from "../../hooks/usePlatform.js";
|
|
11
|
+
import { MediaLibraryBrowser as D } from "../MediaLibrary/MediaLibraryBrowser.js";
|
|
12
|
+
import { FilePickerGallery as w } from "./FilePickerGallery.js";
|
|
13
|
+
import { FilePickerGiphy as ee } from "./FilePickerGiphy.js";
|
|
14
|
+
import { FilePickerGoogleDrive as le } from "./FilePickerGoogleDrive.js";
|
|
15
|
+
import { FilePickerLink as ie } from "./FilePickerLink.js";
|
|
16
|
+
import { FilePickerUnsplash as ne } from "./FilePickerUnsplash.js";
|
|
17
|
+
import { FilePickerUpload as ae } from "./FilePickerUpload.js";
|
|
18
|
+
import z from "./FilePicker.module.css.js";
|
|
19
|
+
const re = [
|
|
19
20
|
"gallery",
|
|
20
21
|
"upload",
|
|
21
22
|
"link",
|
|
@@ -23,255 +24,243 @@ const ve = [
|
|
|
23
24
|
"giphy",
|
|
24
25
|
"googleDrive",
|
|
25
26
|
"media"
|
|
26
|
-
],
|
|
27
|
-
onChange:
|
|
28
|
-
onRemove:
|
|
29
|
-
onUpload:
|
|
30
|
-
uploading:
|
|
31
|
-
showTabs:
|
|
32
|
-
children:
|
|
33
|
-
width:
|
|
34
|
-
position:
|
|
35
|
-
readOnly:
|
|
36
|
-
hasImage:
|
|
37
|
-
giphyToken:
|
|
38
|
-
unsplashClientId:
|
|
39
|
-
type:
|
|
40
|
-
galleryCollection:
|
|
41
|
-
isValidMediaUrl:
|
|
42
|
-
popoverProps:
|
|
43
|
-
dropZoneProps:
|
|
44
|
-
targetProps:
|
|
45
|
-
onOpenedChange:
|
|
27
|
+
], Se = ({
|
|
28
|
+
onChange: G,
|
|
29
|
+
onRemove: V,
|
|
30
|
+
onUpload: u,
|
|
31
|
+
uploading: B = !1,
|
|
32
|
+
showTabs: r = re,
|
|
33
|
+
children: E,
|
|
34
|
+
width: j = 610,
|
|
35
|
+
position: A = "bottom-end",
|
|
36
|
+
readOnly: L = !1,
|
|
37
|
+
hasImage: N,
|
|
38
|
+
giphyToken: se,
|
|
39
|
+
unsplashClientId: oe,
|
|
40
|
+
type: f = "image",
|
|
41
|
+
galleryCollection: d = [],
|
|
42
|
+
isValidMediaUrl: T,
|
|
43
|
+
popoverProps: U,
|
|
44
|
+
dropZoneProps: _,
|
|
45
|
+
targetProps: H,
|
|
46
|
+
onOpenedChange: O,
|
|
46
47
|
googleDrive: i,
|
|
47
|
-
mediaLibrary:
|
|
48
|
-
inline: c = !1,
|
|
49
|
-
tab: k
|
|
48
|
+
mediaLibrary: s
|
|
50
49
|
}) => {
|
|
51
|
-
const { t:
|
|
52
|
-
|
|
53
|
-
title: l(`coverGroups.${e.id}`, { defaultValue: e.id })
|
|
54
|
-
})) : m, [m, c, l]), r = h(() => [
|
|
55
|
-
{
|
|
56
|
-
value: "gallery",
|
|
57
|
-
label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.gallery") }) }),
|
|
58
|
-
visible: o.includes("gallery") && !!f.length
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
value: "upload",
|
|
62
|
-
label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.upload") }) }),
|
|
63
|
-
visible: o.includes("upload") && !!b
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
value: "link",
|
|
67
|
-
label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.link") }) }),
|
|
68
|
-
visible: o.includes("link")
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
value: "unsplash",
|
|
72
|
-
label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.searchImages") }) }),
|
|
73
|
-
visible: o.includes("unsplash") && M
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
value: "giphy",
|
|
77
|
-
label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: "GIFs" }) }),
|
|
78
|
-
visible: o.includes("giphy") && S
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
value: "googleDrive",
|
|
82
|
-
label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.googleDrive", {
|
|
83
|
-
defaultValue: "Google Drive"
|
|
84
|
-
}) }) }),
|
|
85
|
-
visible: o.includes("googleDrive") && !!i
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
value: "media",
|
|
89
|
-
label: /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n("span", { children: l("changeCover.media", { defaultValue: "Media" }) }) }),
|
|
90
|
-
visible: o.includes("media") && !!t && oe()
|
|
91
|
-
}
|
|
92
|
-
].filter((e) => e.visible), [
|
|
93
|
-
o,
|
|
94
|
-
l,
|
|
95
|
-
f.length,
|
|
96
|
-
b,
|
|
97
|
-
i,
|
|
98
|
-
t
|
|
99
|
-
]), g = k !== void 0, [Z, I] = j(() => {
|
|
100
|
-
if (k !== void 0) return "";
|
|
101
|
-
if (r[0]) return r[0].value;
|
|
102
|
-
const e = r.find((x) => x.visible);
|
|
103
|
-
return e ? e.value : "";
|
|
104
|
-
});
|
|
105
|
-
ne(() => {
|
|
106
|
-
g || r.length && I((e) => e && r.some((x) => x.value === e) ? e : r[0].value);
|
|
107
|
-
}, [r, g]);
|
|
108
|
-
const C = h(() => r.map((e) => e.value), [r]), v = g ? k : Z, s = h(() => v && C.includes(v) ? v : C[0] ?? "", [v, C]), B = (e) => {
|
|
109
|
-
g || I(e);
|
|
110
|
-
}, _ = (e) => {
|
|
111
|
-
b?.(e, p);
|
|
112
|
-
}, d = (e) => {
|
|
113
|
-
N?.(e), c || p(!1);
|
|
114
|
-
}, D = h(() => G ? /* @__PURE__ */ u(le, { size: "lg", children: [
|
|
115
|
-
/* @__PURE__ */ n(E, { icon: A, size: 22 }),
|
|
116
|
-
" "
|
|
117
|
-
] }) : /* @__PURE__ */ n(
|
|
118
|
-
L,
|
|
119
|
-
{
|
|
120
|
-
variant: "default",
|
|
121
|
-
size: "xs",
|
|
122
|
-
leftSection: /* @__PURE__ */ n(E, { icon: A, size: 16 }),
|
|
123
|
-
children: /* @__PURE__ */ n(re, { fw: 600, size: "sm", children: l("changeCover.change") })
|
|
124
|
-
}
|
|
125
|
-
), [l, G]), V = (e) => {
|
|
126
|
-
p(e), Y?.(e);
|
|
127
|
-
}, T = /* @__PURE__ */ u(te, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
|
|
128
|
-
s === "gallery" && !!f.length && /* @__PURE__ */ n(
|
|
129
|
-
de,
|
|
50
|
+
const { t: n } = Q("ui"), [v, h] = x(!1), { isMobile: b } = Z(), C = $(), p = y(
|
|
51
|
+
() => [
|
|
130
52
|
{
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
s === "upload" && /* @__PURE__ */ n(
|
|
136
|
-
fe,
|
|
53
|
+
value: "gallery",
|
|
54
|
+
label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: n("changeCover.gallery") }) }),
|
|
55
|
+
visible: r.includes("gallery") && !!d.length
|
|
56
|
+
},
|
|
137
57
|
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
),
|
|
144
|
-
s === "link" && /* @__PURE__ */ n(
|
|
145
|
-
he,
|
|
58
|
+
value: "upload",
|
|
59
|
+
label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: n("changeCover.upload") }) }),
|
|
60
|
+
visible: r.includes("upload") && !!u
|
|
61
|
+
},
|
|
146
62
|
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
s === "unsplash" && /* @__PURE__ */ n(
|
|
153
|
-
me,
|
|
63
|
+
value: "link",
|
|
64
|
+
label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: n("changeCover.link") }) }),
|
|
65
|
+
visible: r.includes("link")
|
|
66
|
+
},
|
|
154
67
|
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
s === "giphy" && /* @__PURE__ */ n(ue, { token: S, onChange: d }),
|
|
160
|
-
s === "googleDrive" && i && /* @__PURE__ */ n(
|
|
161
|
-
pe,
|
|
68
|
+
value: "unsplash",
|
|
69
|
+
label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: n("changeCover.searchImages") }) }),
|
|
70
|
+
visible: r.includes("unsplash") && S().media?.unsplashEnabled !== !1
|
|
71
|
+
},
|
|
162
72
|
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
hasMore: i.hasMore,
|
|
168
|
-
isImporting: i.isImporting,
|
|
169
|
-
onSearch: i.onSearch,
|
|
170
|
-
onLoadMore: i.onLoadMore,
|
|
171
|
-
onSelect: (e) => {
|
|
172
|
-
i.onSelect(e, d);
|
|
173
|
-
},
|
|
174
|
-
error: i.error
|
|
175
|
-
}
|
|
176
|
-
),
|
|
177
|
-
s === "media" && t && /* @__PURE__ */ n(
|
|
178
|
-
ce,
|
|
73
|
+
value: "giphy",
|
|
74
|
+
label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
|
|
75
|
+
visible: r.includes("giphy") && C.has("giphy") && S().media?.giphyEnabled !== !1
|
|
76
|
+
},
|
|
179
77
|
{
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
onSelect: (e) => {
|
|
186
|
-
t.onSelect?.(e), c || p(!1);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
] }), ee = /* @__PURE__ */ n(a, { justify: "space-between", align: "center", children: /* @__PURE__ */ n(
|
|
191
|
-
F,
|
|
192
|
-
{
|
|
193
|
-
defaultValue: "gallery",
|
|
194
|
-
value: s,
|
|
195
|
-
onChange: (e) => e && B(e),
|
|
196
|
-
styles: {
|
|
197
|
-
list: {
|
|
198
|
-
alignItems: "center",
|
|
199
|
-
paddingRight: "var(--mantine-spacing-xs)"
|
|
200
|
-
}
|
|
78
|
+
value: "googleDrive",
|
|
79
|
+
label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: n("changeCover.googleDrive", {
|
|
80
|
+
defaultValue: "Google Drive"
|
|
81
|
+
}) }) }),
|
|
82
|
+
visible: r.includes("googleDrive") && !!i
|
|
201
83
|
},
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
)
|
|
243
|
-
}
|
|
244
|
-
) });
|
|
245
|
-
return c ? /* @__PURE__ */ n(
|
|
246
|
-
ae,
|
|
84
|
+
{
|
|
85
|
+
value: "media",
|
|
86
|
+
label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: n("changeCover.media", { defaultValue: "Media" }) }) }),
|
|
87
|
+
visible: r.includes("media") && !!s && I()
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
value: "googleDrive",
|
|
91
|
+
label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: n("changeCover.googleDrive", {
|
|
92
|
+
defaultValue: "Google Drive"
|
|
93
|
+
}) }) }),
|
|
94
|
+
visible: r.includes("googleDrive") && !!i
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
value: "media",
|
|
98
|
+
label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: n("changeCover.media", { defaultValue: "Media" }) }) }),
|
|
99
|
+
visible: r.includes("media") && !!s && I()
|
|
100
|
+
}
|
|
101
|
+
].filter((l) => l.visible),
|
|
102
|
+
[
|
|
103
|
+
r,
|
|
104
|
+
C,
|
|
105
|
+
n,
|
|
106
|
+
d.length,
|
|
107
|
+
u,
|
|
108
|
+
i,
|
|
109
|
+
s
|
|
110
|
+
]
|
|
111
|
+
), [o, R] = x(() => {
|
|
112
|
+
if (p[0]) return p[0].value;
|
|
113
|
+
const l = p.find((K) => K.visible);
|
|
114
|
+
return l ? l.value : "";
|
|
115
|
+
}), q = (l) => {
|
|
116
|
+
u?.(l, h);
|
|
117
|
+
}, c = (l) => {
|
|
118
|
+
G?.(l), h(!1);
|
|
119
|
+
}, J = y(() => b ? /* @__PURE__ */ t(W, { size: "lg", children: [
|
|
120
|
+
/* @__PURE__ */ e(M, { icon: F, size: 22 }),
|
|
121
|
+
" "
|
|
122
|
+
] }) : /* @__PURE__ */ e(
|
|
123
|
+
P,
|
|
247
124
|
{
|
|
248
|
-
"
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
children: T
|
|
125
|
+
variant: "default",
|
|
126
|
+
size: "xs",
|
|
127
|
+
leftSection: /* @__PURE__ */ e(M, { icon: F, size: 16 }),
|
|
128
|
+
children: /* @__PURE__ */ e(X, { fw: 600, size: "sm", children: n("changeCover.change") })
|
|
253
129
|
}
|
|
254
|
-
)
|
|
255
|
-
|
|
130
|
+
), [n, b]), k = (l) => {
|
|
131
|
+
h(l), O?.(l);
|
|
132
|
+
};
|
|
133
|
+
return /* @__PURE__ */ t(
|
|
134
|
+
m,
|
|
256
135
|
{
|
|
257
|
-
width:
|
|
136
|
+
width: j,
|
|
258
137
|
radius: "var(--mantine-spacing-sm)",
|
|
259
|
-
position:
|
|
138
|
+
position: A,
|
|
260
139
|
shadow: "md",
|
|
261
|
-
opened:
|
|
262
|
-
onChange:
|
|
140
|
+
opened: v,
|
|
141
|
+
onChange: k,
|
|
263
142
|
withinPortal: !0,
|
|
264
|
-
...
|
|
143
|
+
...U || {},
|
|
265
144
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
|
|
269
|
-
|
|
145
|
+
/* @__PURE__ */ e(m.Target, { children: /* @__PURE__ */ e(a, { onClick: () => k(!v), ...H, children: E ?? J }) }),
|
|
146
|
+
/* @__PURE__ */ t(m.Dropdown, { p: 0, children: [
|
|
147
|
+
/* @__PURE__ */ e(a, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
|
|
148
|
+
g,
|
|
149
|
+
{
|
|
150
|
+
defaultValue: "gallery",
|
|
151
|
+
value: o,
|
|
152
|
+
styles: {
|
|
153
|
+
list: {
|
|
154
|
+
alignItems: "center",
|
|
155
|
+
paddingRight: "var(--mantine-spacing-xs)"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
w: "100%",
|
|
159
|
+
children: /* @__PURE__ */ t(
|
|
160
|
+
g.List,
|
|
161
|
+
{
|
|
162
|
+
style: {
|
|
163
|
+
gap: "4px"
|
|
164
|
+
},
|
|
165
|
+
px: 8,
|
|
166
|
+
h: 54,
|
|
167
|
+
children: [
|
|
168
|
+
p.map((l) => /* @__PURE__ */ e(
|
|
169
|
+
g.Tab,
|
|
170
|
+
{
|
|
171
|
+
className: z.originalTab,
|
|
172
|
+
disabled: L,
|
|
173
|
+
h: "100%",
|
|
174
|
+
p: 0,
|
|
175
|
+
value: l.value,
|
|
176
|
+
onClick: () => R(l.value),
|
|
177
|
+
children: /* @__PURE__ */ e(a, { className: z.customTab, px: "sm", h: 36, children: l.label })
|
|
178
|
+
},
|
|
179
|
+
l.value
|
|
180
|
+
)),
|
|
181
|
+
N && /* @__PURE__ */ e(
|
|
182
|
+
P,
|
|
183
|
+
{
|
|
184
|
+
variant: "subtle",
|
|
185
|
+
fz: "sm",
|
|
186
|
+
lh: "sm",
|
|
187
|
+
fw: 500,
|
|
188
|
+
px: "sm",
|
|
189
|
+
size: "30px",
|
|
190
|
+
onClick: V,
|
|
191
|
+
color: "var(--mantine-color-gray-light-color)",
|
|
192
|
+
style: { marginLeft: "auto" },
|
|
193
|
+
children: n("remove")
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
) }),
|
|
201
|
+
/* @__PURE__ */ t(Y, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
|
|
202
|
+
o === "gallery" && !!d.length && /* @__PURE__ */ e(
|
|
203
|
+
w,
|
|
204
|
+
{
|
|
205
|
+
galleryCollection: d,
|
|
206
|
+
onChange: c
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
o === "upload" && /* @__PURE__ */ e(
|
|
210
|
+
ae,
|
|
211
|
+
{
|
|
212
|
+
type: f || "image",
|
|
213
|
+
uploading: B,
|
|
214
|
+
dropZoneProps: _,
|
|
215
|
+
onUpload: q
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
o === "link" && /* @__PURE__ */ e(
|
|
219
|
+
ie,
|
|
220
|
+
{
|
|
221
|
+
type: f || "image",
|
|
222
|
+
onChange: c,
|
|
223
|
+
isValidMediaUrl: T
|
|
224
|
+
}
|
|
225
|
+
),
|
|
226
|
+
o === "unsplash" && /* @__PURE__ */ e(ne, { onChange: c }),
|
|
227
|
+
o === "giphy" && /* @__PURE__ */ e(ee, { onChange: c }),
|
|
228
|
+
o === "googleDrive" && i && /* @__PURE__ */ e(
|
|
229
|
+
le,
|
|
230
|
+
{
|
|
231
|
+
isConnected: i.isConnected,
|
|
232
|
+
connectedEmail: i.connectedEmail,
|
|
233
|
+
files: i.files,
|
|
234
|
+
isLoading: i.isLoading,
|
|
235
|
+
hasMore: i.hasMore,
|
|
236
|
+
isImporting: i.isImporting,
|
|
237
|
+
onSearch: i.onSearch,
|
|
238
|
+
onLoadMore: i.onLoadMore,
|
|
239
|
+
onSelect: (l) => {
|
|
240
|
+
i.onSelect(l, c);
|
|
241
|
+
},
|
|
242
|
+
error: i.error
|
|
243
|
+
}
|
|
244
|
+
),
|
|
245
|
+
o === "media" && s && /* @__PURE__ */ e(
|
|
246
|
+
D,
|
|
247
|
+
{
|
|
248
|
+
items: s.items,
|
|
249
|
+
isLoading: s.isLoading,
|
|
250
|
+
breadcrumbs: s.breadcrumbs,
|
|
251
|
+
onFolderClick: s.onFolderClick,
|
|
252
|
+
onBreadcrumbClick: s.onBreadcrumbClick,
|
|
253
|
+
onSelect: (l) => {
|
|
254
|
+
s.onSelect?.(l), h(!1);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
] })
|
|
270
259
|
] })
|
|
271
260
|
]
|
|
272
261
|
}
|
|
273
262
|
);
|
|
274
263
|
};
|
|
275
264
|
export {
|
|
276
|
-
|
|
265
|
+
Se as FilePicker
|
|
277
266
|
};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
itemImage:
|
|
3
|
-
imageAuthor:
|
|
4
|
-
originalTab:
|
|
1
|
+
const t = "_itemImage_1me1c_1", o = "_imageAuthor_1me1c_14", a = "_originalTab_1me1c_22", e = "_customTab_1me1c_28", m = "_button_1me1c_36", _ = {
|
|
2
|
+
itemImage: t,
|
|
3
|
+
imageAuthor: o,
|
|
4
|
+
originalTab: a,
|
|
5
5
|
customTab: e,
|
|
6
|
-
button:
|
|
7
|
-
pickerDropZone: a
|
|
6
|
+
button: m
|
|
8
7
|
};
|
|
9
8
|
export {
|
|
10
|
-
|
|
9
|
+
m as button,
|
|
11
10
|
e as customTab,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
a as pickerDropZone
|
|
11
|
+
_ as default,
|
|
12
|
+
o as imageAuthor,
|
|
13
|
+
t as itemImage,
|
|
14
|
+
a as originalTab
|
|
17
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePickerGallery.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGallery.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilePickerGallery.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGallery.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAIvD,eAAO,MAAM,iBAAiB,GAAI,kCAG/B;IACD,iBAAiB,EAAE,4BAA4B,EAAE,CAAC;IAClD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAqCA,CAAC"}
|
|
@@ -1,64 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { HugeiconsIcon as v } from "@hugeicons/react";
|
|
6
|
-
import { Stack as m, FocusTrap as g, TextInput as w, Text as u, SimpleGrid as C, AspectRatio as I } from "@mantine/core";
|
|
7
|
-
import S from "./FilePicker.module.css.js";
|
|
8
|
-
const F = ({
|
|
1
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as l, Text as o, SimpleGrid as p, AspectRatio as c } from "@mantine/core";
|
|
3
|
+
import d from "./FilePicker.module.css.js";
|
|
4
|
+
const x = ({
|
|
9
5
|
galleryCollection: s,
|
|
10
|
-
onChange:
|
|
11
|
-
}) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
onChange: t
|
|
7
|
+
}) => /* @__PURE__ */ r(l, { gap: "xs", mah: 400, w: "100%", style: { overflow: "auto" }, children: s.map((e) => /* @__PURE__ */ n(l, { gap: 4, pb: "sm", children: [
|
|
8
|
+
/* @__PURE__ */ r("a", { target: "_blank", href: e?.url || "#", children: /* @__PURE__ */ r(
|
|
9
|
+
o,
|
|
10
|
+
{
|
|
11
|
+
fz: "xs",
|
|
12
|
+
fw: 500,
|
|
13
|
+
lh: "xs",
|
|
14
|
+
c: "dimmed",
|
|
15
|
+
component: "span",
|
|
16
|
+
td: "none",
|
|
17
|
+
children: e.title
|
|
18
|
+
}
|
|
19
|
+
) }),
|
|
20
|
+
/* @__PURE__ */ r(p, { spacing: 10, cols: 4, children: e.items.map((m, a) => {
|
|
21
|
+
const i = "/images/covers/" + e.path + m;
|
|
22
|
+
return /* @__PURE__ */ r(
|
|
23
|
+
c,
|
|
22
24
|
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
onChange: (e) => h(e.currentTarget.value)
|
|
29
|
-
}
|
|
30
|
-
) }),
|
|
31
|
-
/* @__PURE__ */ r(m, { gap: "xs", mah: 400, w: "100%", style: { overflow: "auto" }, children: l.length === 0 && i.trim() ? /* @__PURE__ */ r(u, { fz: "xs", c: "dimmed", ta: "center", py: "xs", children: a("changeCover.noResult") }) : l.map((e) => /* @__PURE__ */ c(m, { gap: 4, pb: "sm", children: [
|
|
32
|
-
/* @__PURE__ */ r("a", { target: "_blank", href: e?.url || "#", rel: "noreferrer", children: /* @__PURE__ */ r(
|
|
33
|
-
u,
|
|
34
|
-
{
|
|
35
|
-
fz: "xs",
|
|
36
|
-
fw: 500,
|
|
37
|
-
lh: "xs",
|
|
38
|
-
c: "dimmed",
|
|
39
|
-
component: "span",
|
|
40
|
-
td: "none",
|
|
41
|
-
children: e.title
|
|
25
|
+
onClick: () => t?.(i),
|
|
26
|
+
ratio: 120 / 65,
|
|
27
|
+
className: d.itemImage,
|
|
28
|
+
style: {
|
|
29
|
+
backgroundImage: `url(${i})`
|
|
42
30
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
onClick: () => p?.(o),
|
|
50
|
-
ratio: 120 / 65,
|
|
51
|
-
className: S.itemImage,
|
|
52
|
-
style: {
|
|
53
|
-
backgroundImage: `url(${o})`
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
`${e.id}-${t}-${n}`
|
|
57
|
-
);
|
|
58
|
-
}) })
|
|
59
|
-
] }, e.id)) })
|
|
60
|
-
] });
|
|
61
|
-
};
|
|
31
|
+
},
|
|
32
|
+
a
|
|
33
|
+
);
|
|
34
|
+
}) })
|
|
35
|
+
] }, e.id)) });
|
|
62
36
|
export {
|
|
63
|
-
|
|
37
|
+
x as FilePickerGallery
|
|
64
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePickerGiphy.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGiphy.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilePickerGiphy.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGiphy.tsx"],"names":[],"mappings":"AAmCA,eAAO,MAAM,eAAe,GAAI,eAE7B;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAoGA,CAAC"}
|