@layers-app/shared 0.2.8 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/default-workspace-avatar.jpg.js +4 -0
- package/dist/assets/layers-logo-full.svg.js +2 -3
- package/dist/assets/layers-logo-full.svg2.js +5 -0
- package/dist/assets/layers-logo-icon.svg.js +2 -3
- package/dist/assets/layers-logo-icon.svg2.js +5 -0
- package/dist/assets/projects/figureA.svg.js +4 -0
- package/dist/assets/projects/figureB.svg.js +4 -0
- package/dist/assets/qwebchannel.d.ts +15 -0
- package/dist/assets/qwebchannel.d.ts.map +1 -0
- package/dist/assets/taskPriorities/high.svg.js +5 -0
- package/dist/assets/taskPriorities/low.svg.js +5 -0
- package/dist/assets/taskPriorities/none.svg.js +5 -0
- package/dist/assets/taskPriorities/normal.svg.js +5 -0
- package/dist/assets/taskPriorities/urgent.svg.js +5 -0
- package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
- package/dist/components/AliasTextInput/AliasTextInput.js +8 -7
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts +3 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.js +69 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +27 -0
- package/dist/components/AnimatedFigurePage/types.d.ts +15 -0
- package/dist/components/AnimatedFigurePage/types.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/useParallax.d.ts +6 -0
- package/dist/components/AnimatedFigurePage/useParallax.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/useParallax.js +29 -0
- package/dist/components/AppContainer/AppContainer.d.ts +1 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +37 -36
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +80 -45
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +120 -120
- 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 +57 -51
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +3 -1
- package/dist/components/AppContainer/types.d.ts +3 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerPopover.d.ts +6 -6
- package/dist/components/ColorPicker/ColorPickerPopover.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerPopover.js +29 -31
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +115 -111
- package/dist/components/CommunitiesDialog/index.d.ts.map +1 -1
- package/dist/components/CommunitiesDialog/index.js +47 -46
- package/dist/components/Copyright/index.d.ts.map +1 -1
- package/dist/components/Copyright/index.js +8 -7
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +12 -10
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +3 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +49 -46
- package/dist/components/EmojiPicker/IconsPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +47 -45
- package/dist/components/EmojiPicker/custom-icons/customIcons.d.ts.map +1 -1
- package/dist/components/EmojiPicker/custom-icons/customIcons.js +66 -31
- package/dist/components/EntityIcon.d.ts +3 -3
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +59 -35
- package/dist/components/EntityTitle/EntityTitle.d.ts +1 -1
- package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
- package/dist/components/EntityTitle/EntityTitle.js +34 -34
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/FilePicker/FilePicker.d.ts +1 -1
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +144 -152
- package/dist/components/FilePicker/FilePicker.module.css.js +10 -10
- package/dist/components/FilePicker/FilePickerGallery.js +13 -13
- 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 +46 -48
- package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerLink.js +16 -16
- 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 +49 -51
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +44 -42
- 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/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/UploadField/UploadField.d.ts.map +1 -1
- package/dist/components/FormViewer/components/fields/UploadField/UploadField.js +34 -33
- 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/hooks/useFormGlobalTheme.d.ts +3 -3
- package/dist/components/FormViewer/store/formStore.d.ts +357 -357
- 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/Logotype.d.ts +6 -4
- package/dist/components/Logotype.d.ts.map +1 -1
- package/dist/components/Logotype.js +62 -30
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +122 -107
- package/dist/components/NavMenu/types.d.ts +1 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/OnBoarding/OnBoardingPage.js +35 -35
- package/dist/components/ProjectIcon/ProjectIcon.js +13 -13
- package/dist/components/TreeIndent/TreeIndent.d.ts +9 -0
- package/dist/components/TreeIndent/TreeIndent.d.ts.map +1 -0
- package/dist/components/TreeIndent/TreeIndent.js +15 -0
- package/dist/components/TreeIndent/TreeIndent.module.css.js +11 -0
- package/dist/components/TreeIndent/index.d.ts +2 -0
- package/dist/components/TreeIndent/index.d.ts.map +1 -0
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +6 -6
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +97 -101
- package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
- package/dist/config/brand.d.ts +49 -0
- package/dist/config/brand.d.ts.map +1 -0
- package/dist/config/brand.js +77 -0
- package/dist/config/envConfig.d.ts +110 -0
- package/dist/config/envConfig.d.ts.map +1 -0
- package/dist/config/envConfig.js +48 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +19 -7
- package/dist/helpers/getFileIcons.d.ts.map +1 -1
- package/dist/helpers/getFileIcons.js +34 -29
- package/dist/helpers/getFileType.d.ts +1 -1
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +3 -3
- package/dist/helpers/hotjar.d.ts.map +1 -1
- package/dist/helpers/hotjar.js +11 -7
- package/dist/helpers/platform.js +4 -4
- package/dist/helpers/showNotifications.d.ts +3 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +79 -44
- package/dist/hooks/useDateFnsLocale.d.ts +2 -0
- package/dist/hooks/useDateFnsLocale.d.ts.map +1 -1
- package/dist/hooks/useDateFnsLocale.js +9 -8
- package/dist/hooks/useDateUtils.d.ts.map +1 -1
- package/dist/hooks/useDateUtils.js +19 -19
- package/dist/hooks/useDisableWindowScroll.js +3 -3
- package/dist/hooks/useFormatDistance.d.ts.map +1 -1
- package/dist/hooks/useFormatDistance.js +6 -6
- package/dist/hooks/useNumberQueryParam.d.ts +1 -1
- package/dist/hooks/useNumberQueryParam.d.ts.map +1 -1
- 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 +505 -487
- package/dist/lang/locales/ui_en.json.js +1 -1
- package/dist/lang/locales/ui_es.json.js +5 -5
- package/dist/lang/locales/ui_ru.json.js +5 -5
- package/dist/utils/formatStorage.d.ts +9 -0
- package/dist/utils/formatStorage.d.ts.map +1 -1
- package/dist/utils/formatStorage.js +14 -10
- package/package.json +3 -6
- package/dist/assets/svg/default_icon.svg.js +0 -4
- package/dist/assets/svg/layers-logo-full.svg.js +0 -4
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { jsx 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 {
|
|
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";
|
|
13
15
|
import { FilePickerUnsplash as me } from "./FilePickerUnsplash.js";
|
|
14
|
-
import { FilePickerGoogleDrive as
|
|
15
|
-
import { FilePickerUpload as
|
|
16
|
-
import { coverCollections as
|
|
16
|
+
import { FilePickerGoogleDrive as fe } from "./FilePickerGoogleDrive.js";
|
|
17
|
+
import { FilePickerUpload as ge } from "./FilePickerUpload.js";
|
|
18
|
+
import { coverCollections as ve } from "./coverCollections.js";
|
|
17
19
|
import w from "./FilePicker.module.css.js";
|
|
18
|
-
const
|
|
20
|
+
const be = [
|
|
19
21
|
"gallery",
|
|
20
22
|
"upload",
|
|
21
23
|
"link",
|
|
@@ -23,176 +25,166 @@ const ve = [
|
|
|
23
25
|
"giphy",
|
|
24
26
|
"googleDrive",
|
|
25
27
|
"media"
|
|
26
|
-
],
|
|
28
|
+
], _e = ({
|
|
27
29
|
onChange: N,
|
|
28
30
|
onRemove: U,
|
|
29
31
|
onUpload: b,
|
|
30
|
-
uploading:
|
|
31
|
-
showTabs: o =
|
|
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:
|
|
46
|
-
googleDrive:
|
|
47
|
-
mediaLibrary:
|
|
48
|
-
inline:
|
|
49
|
-
tab:
|
|
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
|
|
50
52
|
}) => {
|
|
51
|
-
const { t:
|
|
52
|
-
...
|
|
53
|
-
title:
|
|
54
|
-
})) :
|
|
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(() => [
|
|
55
57
|
{
|
|
56
58
|
value: "gallery",
|
|
57
|
-
label: /* @__PURE__ */
|
|
59
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.gallery") }) }),
|
|
58
60
|
visible: o.includes("gallery") && !!f.length
|
|
59
61
|
},
|
|
60
62
|
{
|
|
61
63
|
value: "upload",
|
|
62
|
-
label: /* @__PURE__ */
|
|
64
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.upload") }) }),
|
|
63
65
|
visible: o.includes("upload") && !!b
|
|
64
66
|
},
|
|
65
67
|
{
|
|
66
68
|
value: "link",
|
|
67
|
-
label: /* @__PURE__ */
|
|
69
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.link") }) }),
|
|
68
70
|
visible: o.includes("link")
|
|
69
71
|
},
|
|
70
72
|
{
|
|
71
73
|
value: "unsplash",
|
|
72
|
-
label: /* @__PURE__ */
|
|
73
|
-
visible: o.includes("unsplash") &&
|
|
74
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.searchImages") }) }),
|
|
75
|
+
visible: o.includes("unsplash") && L().media?.unsplashEnabled !== !1
|
|
74
76
|
},
|
|
75
77
|
{
|
|
76
78
|
value: "giphy",
|
|
77
|
-
label: /* @__PURE__ */
|
|
78
|
-
visible: o.includes("giphy") &&
|
|
79
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
|
|
80
|
+
visible: o.includes("giphy") && M.has("giphy") && L().media?.giphyEnabled !== !1
|
|
79
81
|
},
|
|
80
82
|
{
|
|
81
83
|
value: "googleDrive",
|
|
82
|
-
label: /* @__PURE__ */
|
|
84
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.googleDrive", {
|
|
83
85
|
defaultValue: "Google Drive"
|
|
84
86
|
}) }) }),
|
|
85
|
-
visible: o.includes("googleDrive") && !!
|
|
87
|
+
visible: o.includes("googleDrive") && !!l
|
|
86
88
|
},
|
|
87
89
|
{
|
|
88
90
|
value: "media",
|
|
89
|
-
label: /* @__PURE__ */
|
|
90
|
-
visible: o.includes("media") && !!
|
|
91
|
+
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.media", { defaultValue: "Media" }) }) }),
|
|
92
|
+
visible: o.includes("media") && !!a && se()
|
|
91
93
|
}
|
|
92
|
-
].filter((
|
|
94
|
+
].filter((y) => y.visible), [
|
|
93
95
|
o,
|
|
94
|
-
|
|
96
|
+
M,
|
|
97
|
+
i,
|
|
95
98
|
f.length,
|
|
96
99
|
b,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
]), g =
|
|
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
|
-
});
|
|
100
|
+
l,
|
|
101
|
+
a
|
|
102
|
+
]), g = C !== void 0, [Y, P] = E(() => C !== void 0 ? "" : s[0]?.value ?? "");
|
|
105
103
|
ne(() => {
|
|
106
|
-
g ||
|
|
107
|
-
}, [
|
|
108
|
-
const
|
|
109
|
-
g ||
|
|
110
|
-
},
|
|
111
|
-
b?.(
|
|
112
|
-
},
|
|
113
|
-
N?.(
|
|
114
|
-
}, D =
|
|
115
|
-
/* @__PURE__ */
|
|
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 }),
|
|
116
114
|
" "
|
|
117
|
-
] }) : /* @__PURE__ */
|
|
118
|
-
|
|
115
|
+
] }) : /* @__PURE__ */ e(
|
|
116
|
+
A,
|
|
119
117
|
{
|
|
120
118
|
variant: "default",
|
|
121
119
|
size: "xs",
|
|
122
|
-
leftSection: /* @__PURE__ */
|
|
123
|
-
children: /* @__PURE__ */
|
|
120
|
+
leftSection: /* @__PURE__ */ e(j, { icon: V, size: 16 }),
|
|
121
|
+
children: /* @__PURE__ */ e(re, { fw: 600, size: "sm", children: i("changeCover.change") })
|
|
124
122
|
}
|
|
125
|
-
), [
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
|
|
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,
|
|
130
128
|
{
|
|
131
129
|
galleryCollection: f,
|
|
132
|
-
onChange:
|
|
130
|
+
onChange: c
|
|
133
131
|
}
|
|
134
132
|
),
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
t === "upload" && /* @__PURE__ */ e(
|
|
134
|
+
ge,
|
|
137
135
|
{
|
|
138
|
-
type:
|
|
139
|
-
uploading:
|
|
140
|
-
dropZoneProps:
|
|
141
|
-
onUpload:
|
|
136
|
+
type: S || "image",
|
|
137
|
+
uploading: _,
|
|
138
|
+
dropZoneProps: Q,
|
|
139
|
+
onUpload: Z
|
|
142
140
|
}
|
|
143
141
|
),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
{
|
|
147
|
-
type: P || "image",
|
|
148
|
-
onChange: d,
|
|
149
|
-
isValidMediaUrl: K
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
s === "unsplash" && /* @__PURE__ */ n(
|
|
153
|
-
me,
|
|
142
|
+
t === "link" && /* @__PURE__ */ e(
|
|
143
|
+
pe,
|
|
154
144
|
{
|
|
155
|
-
|
|
156
|
-
onChange:
|
|
145
|
+
type: S || "image",
|
|
146
|
+
onChange: c,
|
|
147
|
+
isValidMediaUrl: J
|
|
157
148
|
}
|
|
158
149
|
),
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
150
|
+
t === "unsplash" && /* @__PURE__ */ e(me, { onChange: c }),
|
|
151
|
+
t === "giphy" && /* @__PURE__ */ e(he, { onChange: c }),
|
|
152
|
+
t === "googleDrive" && l && /* @__PURE__ */ e(
|
|
153
|
+
fe,
|
|
162
154
|
{
|
|
163
|
-
isConnected:
|
|
164
|
-
connectedEmail:
|
|
165
|
-
files:
|
|
166
|
-
isLoading:
|
|
167
|
-
hasMore:
|
|
168
|
-
isImporting:
|
|
169
|
-
onSearch:
|
|
170
|
-
onLoadMore:
|
|
171
|
-
onSelect: (
|
|
172
|
-
|
|
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);
|
|
173
165
|
},
|
|
174
|
-
error:
|
|
166
|
+
error: l.error
|
|
175
167
|
}
|
|
176
168
|
),
|
|
177
|
-
|
|
178
|
-
|
|
169
|
+
t === "media" && a && /* @__PURE__ */ e(
|
|
170
|
+
de,
|
|
179
171
|
{
|
|
180
|
-
items:
|
|
181
|
-
isLoading:
|
|
182
|
-
breadcrumbs:
|
|
183
|
-
onFolderClick:
|
|
184
|
-
onBreadcrumbClick:
|
|
185
|
-
onSelect: (
|
|
186
|
-
|
|
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);
|
|
187
179
|
}
|
|
188
180
|
}
|
|
189
181
|
)
|
|
190
|
-
] }), ee = /* @__PURE__ */
|
|
191
|
-
|
|
182
|
+
] }), ee = /* @__PURE__ */ e(r, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
|
|
183
|
+
x,
|
|
192
184
|
{
|
|
193
185
|
defaultValue: "gallery",
|
|
194
|
-
value:
|
|
195
|
-
onChange: (
|
|
186
|
+
value: t,
|
|
187
|
+
onChange: (n) => n && z(n),
|
|
196
188
|
styles: {
|
|
197
189
|
list: {
|
|
198
190
|
alignItems: "center",
|
|
@@ -200,8 +192,8 @@ const ve = [
|
|
|
200
192
|
}
|
|
201
193
|
},
|
|
202
194
|
w: "100%",
|
|
203
|
-
children: /* @__PURE__ */
|
|
204
|
-
|
|
195
|
+
children: /* @__PURE__ */ d(
|
|
196
|
+
x.List,
|
|
205
197
|
{
|
|
206
198
|
style: {
|
|
207
199
|
gap: "4px"
|
|
@@ -209,21 +201,21 @@ const ve = [
|
|
|
209
201
|
px: 8,
|
|
210
202
|
h: 54,
|
|
211
203
|
children: [
|
|
212
|
-
|
|
213
|
-
|
|
204
|
+
s.map((n) => /* @__PURE__ */ e(
|
|
205
|
+
x.Tab,
|
|
214
206
|
{
|
|
215
207
|
className: w.originalTab,
|
|
216
|
-
disabled:
|
|
208
|
+
disabled: $,
|
|
217
209
|
h: "100%",
|
|
218
210
|
p: 0,
|
|
219
|
-
value:
|
|
220
|
-
onClick: () =>
|
|
221
|
-
children: /* @__PURE__ */
|
|
211
|
+
value: n.value,
|
|
212
|
+
onClick: () => z(n.value),
|
|
213
|
+
children: /* @__PURE__ */ e(r, { className: w.customTab, px: "sm", h: 36, children: n.label })
|
|
222
214
|
},
|
|
223
|
-
|
|
215
|
+
n.value
|
|
224
216
|
)),
|
|
225
|
-
|
|
226
|
-
|
|
217
|
+
q && /* @__PURE__ */ e(
|
|
218
|
+
A,
|
|
227
219
|
{
|
|
228
220
|
variant: "subtle",
|
|
229
221
|
fz: "sm",
|
|
@@ -234,7 +226,7 @@ const ve = [
|
|
|
234
226
|
onClick: U,
|
|
235
227
|
color: "var(--mantine-color-gray-light-color)",
|
|
236
228
|
style: { marginLeft: "auto" },
|
|
237
|
-
children:
|
|
229
|
+
children: i("remove")
|
|
238
230
|
}
|
|
239
231
|
)
|
|
240
232
|
]
|
|
@@ -242,36 +234,36 @@ const ve = [
|
|
|
242
234
|
)
|
|
243
235
|
}
|
|
244
236
|
) });
|
|
245
|
-
return
|
|
237
|
+
return p ? /* @__PURE__ */ e(
|
|
246
238
|
ae,
|
|
247
239
|
{
|
|
248
240
|
"data-file-picker-inline": !0,
|
|
249
241
|
bdrs: 8,
|
|
250
242
|
p: 12,
|
|
251
243
|
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-7))",
|
|
252
|
-
children:
|
|
244
|
+
children: B
|
|
253
245
|
}
|
|
254
|
-
) : /* @__PURE__ */
|
|
255
|
-
|
|
246
|
+
) : /* @__PURE__ */ d(
|
|
247
|
+
F,
|
|
256
248
|
{
|
|
257
|
-
width:
|
|
249
|
+
width: O,
|
|
258
250
|
radius: "var(--mantine-spacing-sm)",
|
|
259
|
-
position:
|
|
251
|
+
position: R,
|
|
260
252
|
shadow: "md",
|
|
261
|
-
opened:
|
|
262
|
-
onChange:
|
|
253
|
+
opened: T,
|
|
254
|
+
onChange: G,
|
|
263
255
|
withinPortal: !0,
|
|
264
|
-
...
|
|
256
|
+
...K || {},
|
|
265
257
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ e(F.Target, { children: /* @__PURE__ */ e(r, { onClick: () => G(!T), ...W, children: H ?? D }) }),
|
|
259
|
+
/* @__PURE__ */ d(F.Dropdown, { p: 0, children: [
|
|
268
260
|
ee,
|
|
269
|
-
|
|
261
|
+
B
|
|
270
262
|
] })
|
|
271
263
|
]
|
|
272
264
|
}
|
|
273
265
|
);
|
|
274
266
|
};
|
|
275
267
|
export {
|
|
276
|
-
|
|
268
|
+
_e as FilePicker
|
|
277
269
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const o = "
|
|
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
2
|
itemImage: o,
|
|
3
3
|
imageAuthor: t,
|
|
4
|
-
originalTab:
|
|
5
|
-
customTab:
|
|
6
|
-
button:
|
|
7
|
-
pickerDropZone:
|
|
4
|
+
originalTab: e,
|
|
5
|
+
customTab: _,
|
|
6
|
+
button: a,
|
|
7
|
+
pickerDropZone: n
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
a as button,
|
|
11
|
+
_ as customTab,
|
|
12
|
+
b as default,
|
|
13
13
|
t as imageAuthor,
|
|
14
14
|
o as itemImage,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
e as originalTab,
|
|
16
|
+
n as pickerDropZone
|
|
17
17
|
};
|
|
@@ -3,26 +3,26 @@ import { useState as d, useMemo as f } from "react";
|
|
|
3
3
|
import { useTranslation as x } from "react-i18next";
|
|
4
4
|
import { Search01Icon as $ } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as v } from "@hugeicons/react";
|
|
6
|
-
import { Stack as m, FocusTrap as g, TextInput as
|
|
6
|
+
import { Stack as m, FocusTrap as g, TextInput as I, Text as u, SimpleGrid as w, AspectRatio as C } from "@mantine/core";
|
|
7
7
|
import S from "./FilePicker.module.css.js";
|
|
8
|
-
const
|
|
9
|
-
galleryCollection:
|
|
8
|
+
const G = ({
|
|
9
|
+
galleryCollection: n,
|
|
10
10
|
onChange: p
|
|
11
11
|
}) => {
|
|
12
12
|
const { t: a } = x("ui"), [i, h] = d(""), l = f(() => {
|
|
13
13
|
const e = i.trim().toLowerCase();
|
|
14
|
-
return e ?
|
|
14
|
+
return e ? n.map((t) => ({
|
|
15
15
|
...t,
|
|
16
|
-
items: t.items.filter((
|
|
17
|
-
})).filter((t) => t.items.length > 0) :
|
|
18
|
-
}, [
|
|
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
19
|
return /* @__PURE__ */ c(m, { gap: "sm", children: [
|
|
20
20
|
/* @__PURE__ */ r(g, { active: !0, children: /* @__PURE__ */ r(
|
|
21
|
-
|
|
21
|
+
I,
|
|
22
22
|
{
|
|
23
23
|
leftSection: /* @__PURE__ */ r(v, { size: 16, icon: $ }),
|
|
24
24
|
maxLength: 50,
|
|
25
|
-
placeholder: a("changeCover.
|
|
25
|
+
placeholder: a("changeCover.searchImage"),
|
|
26
26
|
"data-autofocus": !0,
|
|
27
27
|
value: i,
|
|
28
28
|
onChange: (e) => h(e.currentTarget.value)
|
|
@@ -41,10 +41,10 @@ const F = ({
|
|
|
41
41
|
children: e.title
|
|
42
42
|
}
|
|
43
43
|
) }),
|
|
44
|
-
/* @__PURE__ */ r(
|
|
44
|
+
/* @__PURE__ */ r(w, { spacing: 10, cols: 4, children: e.items.map((t, s) => {
|
|
45
45
|
const o = "/images/covers/" + e.path + t;
|
|
46
46
|
return /* @__PURE__ */ r(
|
|
47
|
-
|
|
47
|
+
C,
|
|
48
48
|
{
|
|
49
49
|
onClick: () => p?.(o),
|
|
50
50
|
ratio: 120 / 65,
|
|
@@ -53,12 +53,12 @@ const F = ({
|
|
|
53
53
|
backgroundImage: `url(${o})`
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
`${e.id}-${t}-${
|
|
56
|
+
`${e.id}-${t}-${s}`
|
|
57
57
|
);
|
|
58
58
|
}) })
|
|
59
59
|
] }, e.id)) })
|
|
60
60
|
] });
|
|
61
61
|
};
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
G as FilePickerGallery
|
|
64
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePickerGiphy.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGiphy.tsx"],"names":[],"mappings":"AAoCA,eAAO,MAAM,eAAe,GAAI,
|
|
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"}
|