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