@layers-app/shared 0.4.0 → 0.4.2
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 +13 -13
- package/dist/components/AnimatedFigurePage/useParallax.d.ts +2 -2
- package/dist/components/AppContainer/AppContainer.d.ts +6 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts +4 -1
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.js +22 -15
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +22 -21
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +48 -91
- package/dist/components/AppContainer/components/ToolbarNewButton.d.ts +7 -2
- package/dist/components/AppContainer/components/ToolbarNewButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolbarNewButton.js +14 -14
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts +3 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +96 -64
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +76 -67
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +35 -26
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +43 -36
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +7 -0
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +1 -0
- package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +17 -0
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts +4 -0
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +59 -20
- package/dist/components/AttachmentsGalleryModal/styles.module.css.js +34 -22
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +22 -18
- package/dist/components/ColorPicker/ColorPicker.d.ts +12 -11
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +109 -83
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +62 -63
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +128 -120
- package/dist/components/ColorPicker/icons.js +3 -3
- package/dist/components/ColorPicker/types.d.ts +3 -1
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +11 -5
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.js +55 -45
- package/dist/components/CommentComposer/useVirtualAnchor.d.ts +1 -1
- package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +43 -33
- package/dist/components/FilePicker/FilePicker.d.ts +3 -1
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +44 -42
- package/dist/components/FilePicker/FilePickerUpload.d.ts +3 -1
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +28 -28
- package/dist/components/FormViewer/helpers/conditions.d.ts +38 -38
- package/dist/components/FormViewer/helpers/helpers.d.ts +38 -38
- package/dist/components/FormViewer/helpers/steps.d.ts +38 -38
- package/dist/components/FormViewer/hooks/useActiveControl.d.ts +19 -19
- package/dist/components/FormViewer/hooks/useActiveStep.d.ts +38 -38
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +6 -0
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts.map +1 -1
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.js +4 -3
- package/dist/components/FormViewer/hooks/useFormMobile.d.ts +1 -1
- package/dist/components/FormViewer/hooks/useFormMobile.d.ts.map +1 -1
- package/dist/components/FormViewer/store/formStore.d.ts +248 -248
- package/dist/components/FormViewer/store/formStoreApi.d.ts +124 -124
- package/dist/components/FormViewer/store/selectors.d.ts +11655 -11655
- package/dist/components/FormViewer/types/form.d.ts +1 -1
- package/dist/components/FormViewer/types/form.d.ts.map +1 -1
- package/dist/components/FormViewer/types/schemes.d.ts +381 -6358
- package/dist/components/FormViewer/types/schemes.d.ts.map +1 -1
- package/dist/components/FormViewer/types/schemes.js +1 -1
- package/dist/components/GroupAvatar/index.d.ts +3 -1
- package/dist/components/GroupAvatar/index.d.ts.map +1 -1
- package/dist/components/GroupAvatar/index.js +24 -21
- package/dist/components/LanguagePicker/LanguagePicker.d.ts +13 -3
- package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
- package/dist/components/LanguagePicker/LanguagePicker.js +65 -43
- package/dist/components/MediaLibrary/MediaLibraryRow.js +7 -7
- package/dist/components/NavMenu/NavMenu.d.ts +3 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/components/DnDProvider.d.ts +1 -1
- package/dist/components/NavMenu/components/DnDProvider.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts +7 -1
- package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuActionIcon.js +21 -23
- package/dist/components/NewColorPicker/components/Target.d.ts +3 -1
- package/dist/components/NewColorPicker/components/Target.d.ts.map +1 -1
- package/dist/components/NewColorPicker/components/Target.js +48 -43
- package/dist/components/Notification/Notification.js +3 -1
- package/dist/components/Notification/NotificationCard.d.ts +3 -1
- package/dist/components/Notification/NotificationCard.d.ts.map +1 -1
- package/dist/components/Notification/NotificationCard.js +87 -86
- package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts +6 -1
- package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts.map +1 -1
- package/dist/components/OnboardingTour/OnboardingTourFooter.js +39 -21
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +4 -5
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -1
- package/dist/components/OnboardingTour/OnboardingTourWrapper.js +83 -119
- package/dist/components/OnboardingTour/index.d.ts +1 -1
- package/dist/components/OnboardingTour/index.d.ts.map +1 -1
- package/dist/components/OnboardingTour/useOnboardingTour.d.ts +4 -0
- package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -1
- package/dist/components/OnboardingTour/useOnboardingTour.js +65 -36
- package/dist/components/ProjectIcon/ProjectIcon.d.ts +7 -12
- package/dist/components/ProjectIcon/ProjectIcon.d.ts.map +1 -1
- package/dist/components/ProjectIcon/ProjectIcon.js +58 -60
- package/dist/components/UserAvatar/index.d.ts +2 -1
- package/dist/components/UserAvatar/index.d.ts.map +1 -1
- package/dist/components/UserAvatar/index.js +42 -32
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +3 -3
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts.map +1 -1
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +19 -18
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +17 -17
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +7 -7
- package/dist/config/brand.d.ts +2 -0
- package/dist/config/brand.d.ts.map +1 -1
- package/dist/config/brand.js +28 -22
- package/dist/config/envConfig.d.ts +12 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +21 -13
- package/dist/helpers/getFileIcons.d.ts.map +1 -1
- package/dist/helpers/getFileIcons.js +63 -45
- package/dist/helpers/getFileType.d.ts +1 -1
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +29 -8
- package/dist/helpers/getPartOfTheDay.d.ts +1 -1
- package/dist/helpers/offlineSuppression.d.ts +3 -0
- package/dist/helpers/offlineSuppression.d.ts.map +1 -0
- package/dist/helpers/offlineSuppression.js +8 -0
- package/dist/helpers/platform.d.ts +1 -1
- package/dist/helpers/platform.d.ts.map +1 -1
- package/dist/helpers/platform.js +5 -4
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +30 -29
- package/dist/hooks/useOutsideClick.d.ts +1 -1
- package/dist/hooks/useOutsideClick.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +462 -451
- package/dist/lang/locales/ui_en.json.js +1 -1
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/dist/node_modules/countries-and-timezones/esm/index.js +281 -4011
- package/dist/store/featureProgress.d.ts +3 -6
- package/dist/store/featureProgress.d.ts.map +1 -1
- package/dist/store/featureProgress.js +56 -22
- package/dist/store/plansModal.d.ts.map +1 -1
- package/dist/store/plansModal.js +10 -10
- package/package.json +13 -13
|
@@ -1,63 +1,72 @@
|
|
|
1
1
|
import { jsx as S } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { openRemoveConfirmModal as
|
|
2
|
+
import { useRef as C, useEffect as u } from "react";
|
|
3
|
+
import { useTranslation as k } from "react-i18next";
|
|
4
|
+
import { openRemoveConfirmModal as P } from "../modals/RemoveConfirmModal.js";
|
|
5
5
|
import w from "./CommentComposer.module.css.js";
|
|
6
|
-
const
|
|
7
|
-
children:
|
|
8
|
-
onSubmit:
|
|
9
|
-
editorRef:
|
|
10
|
-
commentDraft:
|
|
6
|
+
const M = ({
|
|
7
|
+
children: b,
|
|
8
|
+
onSubmit: E,
|
|
9
|
+
editorRef: m,
|
|
10
|
+
commentDraft: f,
|
|
11
11
|
onBlur: c,
|
|
12
|
-
inputContainerRef:
|
|
13
|
-
isFloat:
|
|
12
|
+
inputContainerRef: p,
|
|
13
|
+
isFloat: v,
|
|
14
14
|
isEdit: i,
|
|
15
15
|
hasChanges: s,
|
|
16
|
-
ns:
|
|
16
|
+
ns: y
|
|
17
17
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
const
|
|
18
|
+
const d = C(null), L = i || v, { t: r } = k(y);
|
|
19
|
+
return u(() => {
|
|
20
|
+
const t = (e) => {
|
|
21
21
|
if (e.code === "Enter" && !e.shiftKey) {
|
|
22
22
|
if (e.stopPropagation(), i ? s : !s) return;
|
|
23
|
-
|
|
23
|
+
d.current && d.current.contains(document.activeElement) && (e.preventDefault(), E());
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
return document.addEventListener("keydown",
|
|
27
|
-
}, [
|
|
26
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
27
|
+
}, [E, i, s]), u(() => {
|
|
28
28
|
if (!L) return;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const t = m.current;
|
|
30
|
+
t && setTimeout(() => {
|
|
31
|
+
t.focus(() => ({ defaultSelection: "rootEnd" }));
|
|
32
32
|
}, 100);
|
|
33
|
-
}, []),
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
33
|
+
}, []), u(() => {
|
|
34
|
+
const t = m.current;
|
|
35
|
+
if (!t) return;
|
|
36
36
|
const e = () => setTimeout(() => {
|
|
37
|
-
|
|
38
|
-
}, 0),
|
|
39
|
-
const n =
|
|
37
|
+
t.focus(() => ({ defaultSelection: "rootEnd" }));
|
|
38
|
+
}, 0), o = (a) => {
|
|
39
|
+
const n = a.target;
|
|
40
40
|
if (!n || n.closest("button") || n.closest("[data-no-focus]")) return;
|
|
41
41
|
if (n.closest("[data-editor-spacer='true']")) {
|
|
42
42
|
e();
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
|
|
45
|
+
const l = n.closest(`.${w.commentComposerWrapper}`);
|
|
46
|
+
if (!l) return;
|
|
47
|
+
const g = l.querySelector("[data-comment-footer]");
|
|
48
|
+
if (!g || !g.contains(n)) return;
|
|
49
|
+
l.querySelector(`.${w.imagePreviewWrapper}`) || l.querySelector(`.${w.filePreviewWrapper}`) || e();
|
|
50
50
|
};
|
|
51
|
-
return document.addEventListener("mousedown",
|
|
52
|
-
}, [
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
52
|
+
}, [m]), u(() => {
|
|
53
|
+
const t = d.current;
|
|
54
|
+
if (!t) return;
|
|
55
|
+
const e = () => {
|
|
56
|
+
requestAnimationFrame(() => {
|
|
57
|
+
p.current?.scrollIntoView({ block: "nearest" });
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
return t.addEventListener("paste", e), () => t.removeEventListener("paste", e);
|
|
61
|
+
}, [p]), u(() => {
|
|
62
|
+
const t = (e) => {
|
|
63
|
+
const o = e.target;
|
|
64
|
+
if (!o) return;
|
|
65
|
+
const a = p.current;
|
|
66
|
+
if (a && !a.contains(o) && !(o.closest(".mantine-Modal-root") || o.closest(".floating-text-format-popup") || o.closest('[data-test-id="floating-link-dropdown"]'))) {
|
|
58
67
|
if (i) {
|
|
59
68
|
if (!s) {
|
|
60
|
-
e.stopPropagation(), e.preventDefault(),
|
|
69
|
+
e.stopPropagation(), e.preventDefault(), P({
|
|
61
70
|
title: r("composer.discardTitle"),
|
|
62
71
|
children: r("composer.discardDescription"),
|
|
63
72
|
labels: {
|
|
@@ -75,9 +84,9 @@ const W = ({
|
|
|
75
84
|
c?.();
|
|
76
85
|
return;
|
|
77
86
|
}
|
|
78
|
-
if (
|
|
79
|
-
if (
|
|
80
|
-
e.stopPropagation(), e.preventDefault(),
|
|
87
|
+
if (v) {
|
|
88
|
+
if (f.text.trim() !== "" || (f.files?.length ?? 0) > 0) {
|
|
89
|
+
e.stopPropagation(), e.preventDefault(), P({
|
|
81
90
|
title: r("editor.composer.discardCommentTitle"),
|
|
82
91
|
children: r("editor.composer.discardCommentDescription"),
|
|
83
92
|
labels: {
|
|
@@ -93,11 +102,12 @@ const W = ({
|
|
|
93
102
|
c?.();
|
|
94
103
|
return;
|
|
95
104
|
}
|
|
105
|
+
o.closest('button, [role="button"]') && (window.getSelection()?.removeAllRanges(), document.activeElement?.blur());
|
|
96
106
|
}
|
|
97
107
|
};
|
|
98
|
-
return document.addEventListener("mousedown",
|
|
99
|
-
}, [i,
|
|
108
|
+
return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
|
|
109
|
+
}, [i, v, s, f, c]), /* @__PURE__ */ S("div", { ref: d, children: b });
|
|
100
110
|
};
|
|
101
111
|
export {
|
|
102
|
-
|
|
112
|
+
M as CommentEditorHandler
|
|
103
113
|
};
|
|
@@ -10,6 +10,6 @@ interface UseVirtualAnchorProps {
|
|
|
10
10
|
elements: HTMLSpanElement[];
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
export declare function useVirtualAnchor({ isFloat, updateLocation, selectionRef, selectionState, }: UseVirtualAnchorProps): import("react").
|
|
13
|
+
export declare function useVirtualAnchor({ isFloat, updateLocation, selectionRef, selectionState, }: UseVirtualAnchorProps): import("react").RefObject<HTMLDivElement | null>;
|
|
14
14
|
export {};
|
|
15
15
|
//# sourceMappingURL=useVirtualAnchor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVirtualAnchor.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/useVirtualAnchor.ts"],"names":[],"mappings":"AAEA,UAAU,qBAAqB;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,EACzC,cAAc,EAAE;QACd,SAAS,EAAE,cAAc,CAAC;QAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;KAC7B,KACE,IAAI,CAAC;IACV,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,cAAc,EAAE;QACd,SAAS,EAAE,cAAc,CAAC;QAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;KAC7B,CAAC;CACH;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,cAAc,EACd,YAAY,EACZ,cAAc,GACf,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"useVirtualAnchor.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/useVirtualAnchor.ts"],"names":[],"mappings":"AAEA,UAAU,qBAAqB;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,EACzC,cAAc,EAAE;QACd,SAAS,EAAE,cAAc,CAAC;QAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;KAC7B,KACE,IAAI,CAAC;IACV,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,cAAc,EAAE;QACd,SAAS,EAAE,cAAc,CAAC;QAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;KAC7B,CAAC;CACH;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,cAAc,EACd,YAAY,EACZ,cAAc,GACf,EAAE,qBAAqB,oDAsHvB"}
|
|
@@ -30,8 +30,8 @@ export type EmojiPickerLocales = {
|
|
|
30
30
|
chooseColor?: string;
|
|
31
31
|
searchNoResults?: string;
|
|
32
32
|
remove?: string;
|
|
33
|
-
icons?: string;
|
|
34
33
|
random?: string;
|
|
34
|
+
icons?: string;
|
|
35
35
|
emojiCategory?: Record<string, string>;
|
|
36
36
|
};
|
|
37
37
|
export declare const EmojiPicker: ({ project, value, querySearch, children, onChange, position, popoverProps, showIcons, showColors, defaultActiveTab, showEmojis, withinPortal, locales: _locales, openWhen, triggerRegex, typingSeq, showRemoveButton, keepOpenOnRandom, }: PropsWithChildren<EmojiPickerProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmojiPicker.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgC,MAAM,OAAO,CAAC;AAGxE,OAAO,EAIL,gBAAgB,EAEhB,YAAY,EAEb,MAAM,eAAe,CAAC;AAQvB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,YAAY,CAAC,EAAE,YAAY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Icon.d.ts","sourceRoot":"","sources":["../../src/components/EntityIcon.tsx"],"names":[],"mappings":"AA2BA,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAQD,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,cAAc,EAAE,WAElD;IACD,IAAI,CAAC,EAAE,CAAC,CAAC;CACV,mDAwIA,CAAC"}
|
|
@@ -1,56 +1,66 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { HugeiconsIcon as
|
|
4
|
-
import { Text as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { DEFAULT_VALUES as
|
|
10
|
-
import { IconEntity as
|
|
11
|
-
const
|
|
2
|
+
import { StarIcon as p, File01Icon as u, Folder02Icon as h, Folder01Icon as y } from "@hugeicons/core-free-icons";
|
|
3
|
+
import { HugeiconsIcon as i } from "@hugeicons/react";
|
|
4
|
+
import { Text as s, Box as g, Avatar as I, useMantineTheme as v, parseThemeColor as C } from "@mantine/core";
|
|
5
|
+
import z from "../assets/enitityIcons/flow.svg.js";
|
|
6
|
+
import F from "../assets/enitityIcons/form.svg.js";
|
|
7
|
+
import O from "../assets/enitityIcons/page.svg.js";
|
|
8
|
+
import E from "../assets/enitityIcons/sprint.svg.js";
|
|
9
|
+
import { DEFAULT_VALUES as a } from "../constants.js";
|
|
10
|
+
import { IconEntity as c, ProjectIcon as l, renderIcon as S } from "./ProjectIcon/ProjectIcon.js";
|
|
11
|
+
const f = (o) => !!o && a.COLORS.includes(o), R = (o) => o.type === "FOLDER" || o.isFolder || o.type === "PROJECT" && o?.pathById?.findIndex((r) => r === o?.parentId) === 1, _ = ({
|
|
12
12
|
item: o
|
|
13
13
|
}) => {
|
|
14
14
|
const r = o?.size || 16;
|
|
15
15
|
if (!o) return null;
|
|
16
16
|
if (R(o)) {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
if (o.title === "_system.favorites")
|
|
18
|
+
return /* @__PURE__ */ n(
|
|
19
|
+
i,
|
|
20
|
+
{
|
|
21
|
+
icon: p,
|
|
22
|
+
size: r,
|
|
23
|
+
color: "var(--mantine-color-yellow-5)",
|
|
24
|
+
fill: "var(--mantine-color-yellow-5)"
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const e = c.parse(o.icon), t = f(e?.color) ? e.color : a.FOLDER_COLOR;
|
|
28
|
+
return /* @__PURE__ */ n(T, { color: t, size: r, opened: o.isOpen });
|
|
19
29
|
}
|
|
20
30
|
if (o.type === "ATTACHMENT")
|
|
21
|
-
return /* @__PURE__ */ n(
|
|
31
|
+
return /* @__PURE__ */ n(i, { icon: u, size: r });
|
|
22
32
|
if (o.type === "PAGE")
|
|
23
33
|
return /* @__PURE__ */ n(
|
|
24
|
-
|
|
34
|
+
l,
|
|
25
35
|
{
|
|
26
36
|
fallbackColor: o.icon ? void 0 : "var(--default-page-icon-color)",
|
|
27
37
|
name: o.title,
|
|
28
38
|
icon: o.icon,
|
|
29
|
-
fallback: /* @__PURE__ */ n(
|
|
39
|
+
fallback: /* @__PURE__ */ n(O, { width: r, height: r })
|
|
30
40
|
}
|
|
31
41
|
);
|
|
32
42
|
if (o.type === "FORM")
|
|
33
43
|
return /* @__PURE__ */ n(
|
|
34
|
-
|
|
44
|
+
l,
|
|
35
45
|
{
|
|
36
46
|
fallbackColor: "var(--default-form-icon-color)",
|
|
37
47
|
icon: o.icon,
|
|
38
|
-
fallback: /* @__PURE__ */ n(
|
|
48
|
+
fallback: /* @__PURE__ */ n(F, { width: r, height: r })
|
|
39
49
|
}
|
|
40
50
|
);
|
|
41
51
|
if (o.type === "FLOW")
|
|
42
52
|
return /* @__PURE__ */ n(
|
|
43
|
-
|
|
53
|
+
l,
|
|
44
54
|
{
|
|
45
55
|
icon: o.icon,
|
|
46
56
|
fallbackColor: "var(--default-flow-icon-color)",
|
|
47
|
-
fallback: /* @__PURE__ */ n(
|
|
57
|
+
fallback: /* @__PURE__ */ n(z, { width: r, height: r })
|
|
48
58
|
}
|
|
49
59
|
);
|
|
50
60
|
if (o.type === "SPRINT") {
|
|
51
|
-
const e =
|
|
61
|
+
const e = c.parse(o.icon), t = f(e?.color) ? e.color : a.SPRINT_COLOR;
|
|
52
62
|
return /* @__PURE__ */ n(
|
|
53
|
-
|
|
63
|
+
s,
|
|
54
64
|
{
|
|
55
65
|
fz: r,
|
|
56
66
|
c: t,
|
|
@@ -61,14 +71,14 @@ const s = (o) => !!o && l.COLORS.includes(o), R = (o) => o.type === "FOLDER" ||
|
|
|
61
71
|
lineHeight: "normal",
|
|
62
72
|
width: r + 4
|
|
63
73
|
},
|
|
64
|
-
children: /* @__PURE__ */ n(
|
|
74
|
+
children: /* @__PURE__ */ n(E, {})
|
|
65
75
|
}
|
|
66
76
|
);
|
|
67
77
|
}
|
|
68
78
|
if (o.type === "PROJECT") {
|
|
69
|
-
const e =
|
|
79
|
+
const e = c.parse(o.icon);
|
|
70
80
|
return e?.emoji ? /* @__PURE__ */ n(
|
|
71
|
-
|
|
81
|
+
g,
|
|
72
82
|
{
|
|
73
83
|
bg: "gray.1",
|
|
74
84
|
style: {
|
|
@@ -80,7 +90,7 @@ const s = (o) => !!o && l.COLORS.includes(o), R = (o) => o.type === "FOLDER" ||
|
|
|
80
90
|
height: r
|
|
81
91
|
},
|
|
82
92
|
children: /* @__PURE__ */ n(
|
|
83
|
-
|
|
93
|
+
l,
|
|
84
94
|
{
|
|
85
95
|
p: 0,
|
|
86
96
|
icon: o.icon,
|
|
@@ -90,7 +100,7 @@ const s = (o) => !!o && l.COLORS.includes(o), R = (o) => o.type === "FOLDER" ||
|
|
|
90
100
|
)
|
|
91
101
|
}
|
|
92
102
|
) : /* @__PURE__ */ n(
|
|
93
|
-
|
|
103
|
+
I,
|
|
94
104
|
{
|
|
95
105
|
variant: "filled",
|
|
96
106
|
radius: 4,
|
|
@@ -98,7 +108,7 @@ const s = (o) => !!o && l.COLORS.includes(o), R = (o) => o.type === "FOLDER" ||
|
|
|
98
108
|
size: o.size ?? 16,
|
|
99
109
|
color: e?.color || "initials",
|
|
100
110
|
children: /* @__PURE__ */ n(
|
|
101
|
-
|
|
111
|
+
s,
|
|
102
112
|
{
|
|
103
113
|
fz: o.fz ?? 12,
|
|
104
114
|
fw: 500,
|
|
@@ -110,31 +120,31 @@ const s = (o) => !!o && l.COLORS.includes(o), R = (o) => o.type === "FOLDER" ||
|
|
|
110
120
|
justifyContent: "center",
|
|
111
121
|
lineHeight: "normal"
|
|
112
122
|
},
|
|
113
|
-
children:
|
|
123
|
+
children: S(e, void 0, !0, o.title)
|
|
114
124
|
}
|
|
115
125
|
)
|
|
116
126
|
}
|
|
117
127
|
);
|
|
118
128
|
}
|
|
119
129
|
return null;
|
|
120
|
-
},
|
|
130
|
+
}, T = ({
|
|
121
131
|
color: o,
|
|
122
132
|
size: r,
|
|
123
133
|
opened: e
|
|
124
134
|
}) => {
|
|
125
|
-
const t =
|
|
135
|
+
const t = v(), d = C({
|
|
126
136
|
color: o || "gray",
|
|
127
137
|
theme: t
|
|
128
138
|
});
|
|
129
139
|
return /* @__PURE__ */ n(
|
|
130
|
-
|
|
140
|
+
i,
|
|
131
141
|
{
|
|
132
142
|
color: d.value || void 0,
|
|
133
|
-
icon: e ?
|
|
143
|
+
icon: e ? h : y,
|
|
134
144
|
size: r
|
|
135
145
|
}
|
|
136
146
|
);
|
|
137
147
|
};
|
|
138
148
|
export {
|
|
139
|
-
|
|
149
|
+
_ as EntityIcon
|
|
140
150
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { type IconSvgElement } from '@hugeicons/react';
|
|
2
3
|
import { FlexProps, FloatingPosition, PopoverProps } from '@mantine/core';
|
|
3
4
|
import { DropzoneProps, FileWithPath } from '@mantine/dropzone';
|
|
4
5
|
import type { BreadcrumbItem, MediaFile } from '../MediaLibrary/types';
|
|
@@ -56,7 +57,8 @@ export type FilePickerProps = PropsWithChildren<{
|
|
|
56
57
|
};
|
|
57
58
|
inline?: boolean;
|
|
58
59
|
tab?: TabType | string;
|
|
60
|
+
uploadIcon?: IconSvgElement;
|
|
59
61
|
}>;
|
|
60
|
-
export declare const FilePicker: ({ onChange, onRemove, onUpload, uploading, showTabs, children, width, position, readOnly, hasImage, giphyToken: _giphyToken, unsplashClientId: _unsplashClientId, type, galleryCollection, isValidMediaUrl, popoverProps, dropZoneProps, targetProps, onOpenedChange, googleDrive, mediaLibrary, inline, tab: tabProp, }: PropsWithChildren<FilePickerProps>) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export declare const FilePicker: ({ onChange, onRemove, onUpload, uploading, showTabs, children, width, position, readOnly, hasImage, giphyToken: _giphyToken, unsplashClientId: _unsplashClientId, type, galleryCollection, isValidMediaUrl, popoverProps, dropZoneProps, targetProps, onOpenedChange, googleDrive, mediaLibrary, inline, tab: tabProp, uploadIcon, }: PropsWithChildren<FilePickerProps>) => import("react/jsx-runtime").JSX.Element;
|
|
61
63
|
export {};
|
|
62
64
|
//# sourceMappingURL=FilePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePicker.tsx"],"names":[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AC,EAAE,OAAO,CAAC;QACpB,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;QAC/B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;QAC5C,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACnE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;KACtC,CAAC;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B,CAAC,CAAC;AAEH,eAAO,MAAM,UAAU,GAAI,sUAyBxB,iBAAiB,CAAC,eAAe,CAAC,4CAuUpC,CAAC"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { useState as E, useMemo as u, useEffect as
|
|
3
|
-
import { useTranslation as
|
|
2
|
+
import { useState as E, useMemo as u, useEffect as le } from "react";
|
|
3
|
+
import { useTranslation as ie } from "react-i18next";
|
|
4
4
|
import { ImageAdd02Icon as V } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as j } from "@hugeicons/react";
|
|
6
|
-
import { Flex as r, ActionIcon as
|
|
6
|
+
import { Flex as r, ActionIcon as re, Button as A, Text as ae, Tabs as x, Box as oe, Popover as F, Stack as se } from "@mantine/core";
|
|
7
7
|
import { getEnvConfig as L } from "../../config/envConfig.js";
|
|
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 { FilePickerLink as
|
|
15
|
-
import { FilePickerUnsplash as
|
|
16
|
-
import { FilePickerGoogleDrive as
|
|
17
|
-
import { FilePickerUpload as
|
|
18
|
-
import { coverCollections as
|
|
8
|
+
import { isFeature as te } from "../../helpers/feature.js";
|
|
9
|
+
import { useMenu as ce } from "../../hooks/useMenu.js";
|
|
10
|
+
import { usePlatform as de } from "../../hooks/usePlatform.js";
|
|
11
|
+
import { MediaLibraryBrowser as ue } from "../MediaLibrary/MediaLibraryBrowser.js";
|
|
12
|
+
import { FilePickerGallery as he } from "./FilePickerGallery.js";
|
|
13
|
+
import { FilePickerGiphy as pe } from "./FilePickerGiphy.js";
|
|
14
|
+
import { FilePickerLink as me } from "./FilePickerLink.js";
|
|
15
|
+
import { FilePickerUnsplash as fe } from "./FilePickerUnsplash.js";
|
|
16
|
+
import { FilePickerGoogleDrive as ge } from "./FilePickerGoogleDrive.js";
|
|
17
|
+
import { FilePickerUpload as ve } from "./FilePickerUpload.js";
|
|
18
|
+
import { coverCollections as be } from "./coverCollections.js";
|
|
19
19
|
import w from "./FilePicker.module.css.js";
|
|
20
|
-
const
|
|
20
|
+
const Ce = [
|
|
21
21
|
"gallery",
|
|
22
22
|
"upload",
|
|
23
23
|
"link",
|
|
@@ -25,19 +25,19 @@ const be = [
|
|
|
25
25
|
"giphy",
|
|
26
26
|
"googleDrive",
|
|
27
27
|
"media"
|
|
28
|
-
],
|
|
28
|
+
], He = ({
|
|
29
29
|
onChange: N,
|
|
30
30
|
onRemove: U,
|
|
31
31
|
onUpload: b,
|
|
32
32
|
uploading: _ = !1,
|
|
33
|
-
showTabs: o =
|
|
33
|
+
showTabs: o = Ce,
|
|
34
34
|
children: H,
|
|
35
35
|
width: O = 610,
|
|
36
36
|
position: R = "bottom-end",
|
|
37
37
|
readOnly: $ = !1,
|
|
38
38
|
hasImage: q,
|
|
39
|
-
giphyToken:
|
|
40
|
-
unsplashClientId:
|
|
39
|
+
giphyToken: ke,
|
|
40
|
+
unsplashClientId: ye,
|
|
41
41
|
type: S = "image",
|
|
42
42
|
galleryCollection: h = [],
|
|
43
43
|
isValidMediaUrl: J,
|
|
@@ -48,9 +48,10 @@ const be = [
|
|
|
48
48
|
googleDrive: l,
|
|
49
49
|
mediaLibrary: a,
|
|
50
50
|
inline: p = !1,
|
|
51
|
-
tab: C
|
|
51
|
+
tab: C,
|
|
52
|
+
uploadIcon: Y
|
|
52
53
|
}) => {
|
|
53
|
-
const { t: i } =
|
|
54
|
+
const { t: i } = ie("ui"), [T, m] = E(!1), { isMobile: I } = ce(), M = de(), f = u(() => h.length > 0 ? h : p ? be.map((n) => ({
|
|
54
55
|
...n,
|
|
55
56
|
title: i(`coverGroups.${n.id}`, { defaultValue: n.id })
|
|
56
57
|
})) : h, [h, p, i]), s = u(() => [
|
|
@@ -89,7 +90,7 @@ const be = [
|
|
|
89
90
|
{
|
|
90
91
|
value: "media",
|
|
91
92
|
label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.media", { defaultValue: "Media" }) }) }),
|
|
92
|
-
visible: o.includes("media") && !!a &&
|
|
93
|
+
visible: o.includes("media") && !!a && te()
|
|
93
94
|
}
|
|
94
95
|
].filter((y) => y.visible), [
|
|
95
96
|
o,
|
|
@@ -99,17 +100,17 @@ const be = [
|
|
|
99
100
|
b,
|
|
100
101
|
l,
|
|
101
102
|
a
|
|
102
|
-
]), g = C !== void 0, [
|
|
103
|
-
|
|
103
|
+
]), g = C !== void 0, [Z, P] = E(() => C !== void 0 ? "" : s[0]?.value ?? "");
|
|
104
|
+
le(() => {
|
|
104
105
|
g || s.length && P((n) => n && s.some((y) => y.value === n) ? n : s[0].value);
|
|
105
106
|
}, [s, g]);
|
|
106
|
-
const k = u(() => s.map((n) => n.value), [s]), v = g ? C :
|
|
107
|
+
const k = u(() => s.map((n) => n.value), [s]), v = g ? C : Z, t = u(() => v && k.includes(v) ? v : k[0] ?? "", [v, k]), z = (n) => {
|
|
107
108
|
g || P(n);
|
|
108
|
-
},
|
|
109
|
+
}, D = (n) => {
|
|
109
110
|
b?.(n, m);
|
|
110
111
|
}, c = (n) => {
|
|
111
112
|
N?.(n), p || m(!1);
|
|
112
|
-
},
|
|
113
|
+
}, ee = u(() => I ? /* @__PURE__ */ d(re, { size: "lg", children: [
|
|
113
114
|
/* @__PURE__ */ e(j, { icon: V, size: 22 }),
|
|
114
115
|
" "
|
|
115
116
|
] }) : /* @__PURE__ */ e(
|
|
@@ -118,39 +119,40 @@ const be = [
|
|
|
118
119
|
variant: "default",
|
|
119
120
|
size: "xs",
|
|
120
121
|
leftSection: /* @__PURE__ */ e(j, { icon: V, size: 16 }),
|
|
121
|
-
children: /* @__PURE__ */ e(
|
|
122
|
+
children: /* @__PURE__ */ e(ae, { fw: 600, size: "sm", children: i("changeCover.change") })
|
|
122
123
|
}
|
|
123
124
|
), [i, I]), G = (n) => {
|
|
124
125
|
m(n), X?.(n);
|
|
125
|
-
}, B = /* @__PURE__ */ d(
|
|
126
|
+
}, B = /* @__PURE__ */ d(se, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
|
|
126
127
|
t === "gallery" && !!f.length && /* @__PURE__ */ e(
|
|
127
|
-
|
|
128
|
+
he,
|
|
128
129
|
{
|
|
129
130
|
galleryCollection: f,
|
|
130
131
|
onChange: c
|
|
131
132
|
}
|
|
132
133
|
),
|
|
133
134
|
t === "upload" && /* @__PURE__ */ e(
|
|
134
|
-
|
|
135
|
+
ve,
|
|
135
136
|
{
|
|
136
137
|
type: S || "image",
|
|
137
138
|
uploading: _,
|
|
138
139
|
dropZoneProps: Q,
|
|
139
|
-
onUpload:
|
|
140
|
+
onUpload: D,
|
|
141
|
+
icon: Y
|
|
140
142
|
}
|
|
141
143
|
),
|
|
142
144
|
t === "link" && /* @__PURE__ */ e(
|
|
143
|
-
|
|
145
|
+
me,
|
|
144
146
|
{
|
|
145
147
|
type: S || "image",
|
|
146
148
|
onChange: c,
|
|
147
149
|
isValidMediaUrl: J
|
|
148
150
|
}
|
|
149
151
|
),
|
|
150
|
-
t === "unsplash" && /* @__PURE__ */ e(
|
|
151
|
-
t === "giphy" && /* @__PURE__ */ e(
|
|
152
|
+
t === "unsplash" && /* @__PURE__ */ e(fe, { onChange: c }),
|
|
153
|
+
t === "giphy" && /* @__PURE__ */ e(pe, { onChange: c }),
|
|
152
154
|
t === "googleDrive" && l && /* @__PURE__ */ e(
|
|
153
|
-
|
|
155
|
+
ge,
|
|
154
156
|
{
|
|
155
157
|
isConnected: l.isConnected,
|
|
156
158
|
connectedEmail: l.connectedEmail,
|
|
@@ -167,7 +169,7 @@ const be = [
|
|
|
167
169
|
}
|
|
168
170
|
),
|
|
169
171
|
t === "media" && a && /* @__PURE__ */ e(
|
|
170
|
-
|
|
172
|
+
ue,
|
|
171
173
|
{
|
|
172
174
|
items: a.items,
|
|
173
175
|
isLoading: a.isLoading,
|
|
@@ -179,7 +181,7 @@ const be = [
|
|
|
179
181
|
}
|
|
180
182
|
}
|
|
181
183
|
)
|
|
182
|
-
] }),
|
|
184
|
+
] }), ne = /* @__PURE__ */ e(r, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
|
|
183
185
|
x,
|
|
184
186
|
{
|
|
185
187
|
defaultValue: "gallery",
|
|
@@ -235,7 +237,7 @@ const be = [
|
|
|
235
237
|
}
|
|
236
238
|
) });
|
|
237
239
|
return p ? /* @__PURE__ */ e(
|
|
238
|
-
|
|
240
|
+
oe,
|
|
239
241
|
{
|
|
240
242
|
"data-file-picker-inline": !0,
|
|
241
243
|
bdrs: 8,
|
|
@@ -255,9 +257,9 @@ const be = [
|
|
|
255
257
|
withinPortal: !0,
|
|
256
258
|
...K || {},
|
|
257
259
|
children: [
|
|
258
|
-
/* @__PURE__ */ e(F.Target, { children: /* @__PURE__ */ e(r, { onClick: () => G(!T), ...W, children: H ??
|
|
260
|
+
/* @__PURE__ */ e(F.Target, { children: /* @__PURE__ */ e(r, { onClick: () => G(!T), ...W, children: H ?? ee }) }),
|
|
259
261
|
/* @__PURE__ */ d(F.Dropdown, { p: 0, children: [
|
|
260
|
-
|
|
262
|
+
ne,
|
|
261
263
|
B
|
|
262
264
|
] })
|
|
263
265
|
]
|
|
@@ -265,5 +267,5 @@ const be = [
|
|
|
265
267
|
);
|
|
266
268
|
};
|
|
267
269
|
export {
|
|
268
|
-
|
|
270
|
+
He as FilePicker
|
|
269
271
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { type IconSvgElement } from '@hugeicons/react';
|
|
1
2
|
import { DropzoneProps, FileWithPath } from '@mantine/dropzone';
|
|
2
3
|
import { FileType } from './types';
|
|
3
4
|
import '@mantine/dropzone/styles.css';
|
|
4
|
-
export declare const FilePickerUpload: ({ type, uploading, dropZoneProps, onUpload, }: {
|
|
5
|
+
export declare const FilePickerUpload: ({ type, uploading, dropZoneProps, onUpload, icon, }: {
|
|
5
6
|
type?: FileType;
|
|
6
7
|
uploading: boolean;
|
|
7
8
|
dropZoneProps?: Omit<DropzoneProps, "onDrop">;
|
|
8
9
|
onUpload: (files: FileWithPath[]) => void;
|
|
10
|
+
icon?: IconSvgElement;
|
|
9
11
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
//# sourceMappingURL=FilePickerUpload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePickerUpload.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerUpload.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilePickerUpload.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerUpload.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAEL,aAAa,EAEb,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,OAAO,8BAA8B,CAAC;AAEtC,eAAO,MAAM,gBAAgB,GAAI,qDAM9B;IACD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAC9C,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;IAC1C,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB,4CA6GA,CAAC"}
|