@layers-app/shared 0.4.0 → 0.4.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/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 +60 -47
- 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 +28 -18
- 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 +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +11 -11
- 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.map +1 -1
- 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/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/OnboardingTourWrapper.d.ts +1 -1
- package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -1
- package/dist/components/OnboardingTour/OnboardingTourWrapper.js +70 -74
- 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 +38 -35
- 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/envConfig.d.ts +8 -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 +336 -331
- 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/package.json +13 -13
|
@@ -1,28 +1,67 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { useState as p, useEffect as F, useMemo as T } from "react";
|
|
2
|
+
import { getEnvConfig as L } from "../../../config/envConfig.js";
|
|
3
|
+
import { isVideoFile as v } from "../../../helpers/fileUtils.js";
|
|
4
|
+
const h = () => {
|
|
5
|
+
const e = L().apiBaseUrl || "";
|
|
6
|
+
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
7
|
+
}, B = (e) => {
|
|
8
|
+
const [u, y] = p(null), [d, n] = p(!1), [w, a] = p(!1);
|
|
9
|
+
async function g(i) {
|
|
10
|
+
return fetch(`${h()}/v1/attachments/${i}`, {
|
|
11
|
+
method: "GET",
|
|
12
|
+
credentials: "include"
|
|
9
13
|
});
|
|
10
|
-
if (!i.ok)
|
|
11
|
-
throw s(!1), o(!0), new Error(`Error loading: ${i.statusText}`);
|
|
12
|
-
const a = await i.blob();
|
|
13
|
-
c(window.URL.createObjectURL(a)), s(!1), o(!1);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
async function m() {
|
|
16
|
+
try {
|
|
17
|
+
return (await fetch(`${h()}/v1/auth/refresh`, {
|
|
18
|
+
method: "POST",
|
|
19
|
+
credentials: "include"
|
|
20
|
+
})).ok;
|
|
21
|
+
} catch {
|
|
22
|
+
return !1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function U(i, b) {
|
|
26
|
+
n(!0);
|
|
27
|
+
let s = await g(i);
|
|
28
|
+
if ((s.status === 401 || s.status === 403) && await m() && (s = await g(i)), !s.ok)
|
|
29
|
+
throw n(!1), a(!0), new Error(`Error loading: ${s.statusText}`);
|
|
30
|
+
const f = await s.blob(), E = b && f.type !== "application/pdf" ? new Blob([f], { type: "application/pdf" }) : f;
|
|
31
|
+
y(window.URL.createObjectURL(E)), n(!1), a(!1);
|
|
32
|
+
}
|
|
33
|
+
const t = v(
|
|
16
34
|
e.contentType,
|
|
17
35
|
e.originalFileName
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
36
|
+
), o = (e.contentType || "").toLowerCase() === "application/pdf" || (e.originalFileName || "").toLowerCase().endsWith(".pdf"), c = (e.contentType || "").toLowerCase().startsWith("image/"), l = (e.contentType || "").toLowerCase().startsWith("audio/") || /\.(mp3|wav|ogg|flac|m4a|aac|opus|weba)$/i.test(
|
|
37
|
+
e.originalFileName || ""
|
|
38
|
+
), r = c || t || o || l;
|
|
39
|
+
return F(() => {
|
|
40
|
+
e.id && !t && r && !e.Url && U(e.id, o);
|
|
41
|
+
}, [e.Url, e.id, t, o, r]), T(
|
|
42
|
+
() => ({
|
|
43
|
+
fileUrl: u,
|
|
44
|
+
isFetching: d,
|
|
45
|
+
isError: w,
|
|
46
|
+
setIsError: a,
|
|
47
|
+
isVideo: t,
|
|
48
|
+
isPdf: o,
|
|
49
|
+
isImage: c,
|
|
50
|
+
isAudio: l,
|
|
51
|
+
isSupported: r
|
|
52
|
+
}),
|
|
53
|
+
[
|
|
54
|
+
u,
|
|
55
|
+
w,
|
|
56
|
+
d,
|
|
57
|
+
t,
|
|
58
|
+
o,
|
|
59
|
+
c,
|
|
60
|
+
l,
|
|
61
|
+
r
|
|
62
|
+
]
|
|
24
63
|
);
|
|
25
64
|
};
|
|
26
65
|
export {
|
|
27
|
-
|
|
66
|
+
B as useGetPreviewUrl
|
|
28
67
|
};
|
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_container_329fy_1", n = "_root_329fy_13", t = "_carouselRoot_329fy_27", e = "_carouselViewport_329fy_35", a = "_carouselSlide_329fy_43", _ = "_navButton_329fy_57", r = "_navButtonPrev_329fy_83", i = "_navButtonNext_329fy_91", d = "_modalContent_329fy_99", c = "_modalBody_329fy_109", s = "_videoContainer_329fy_121", u = "_imageContainer_329fy_131", f = "_pdfContainer_329fy_145", l = "_pdfFrame_329fy_161", y = "_audioContainer_329fy_175", m = "_audioName_329fy_205", v = "_audioElement_329fy_221", C = {
|
|
2
2
|
container: o,
|
|
3
|
-
root:
|
|
4
|
-
carouselRoot:
|
|
3
|
+
root: n,
|
|
4
|
+
carouselRoot: t,
|
|
5
5
|
carouselViewport: e,
|
|
6
6
|
carouselSlide: a,
|
|
7
|
-
navButton:
|
|
8
|
-
navButtonPrev:
|
|
9
|
-
navButtonNext:
|
|
10
|
-
modalContent:
|
|
7
|
+
navButton: _,
|
|
8
|
+
navButtonPrev: r,
|
|
9
|
+
navButtonNext: i,
|
|
10
|
+
modalContent: d,
|
|
11
11
|
modalBody: c,
|
|
12
|
-
videoContainer:
|
|
13
|
-
imageContainer:
|
|
12
|
+
videoContainer: s,
|
|
13
|
+
imageContainer: u,
|
|
14
|
+
pdfContainer: f,
|
|
15
|
+
pdfFrame: l,
|
|
16
|
+
audioContainer: y,
|
|
17
|
+
audioName: m,
|
|
18
|
+
audioElement: v
|
|
14
19
|
};
|
|
15
20
|
export {
|
|
16
|
-
|
|
21
|
+
y as audioContainer,
|
|
22
|
+
v as audioElement,
|
|
23
|
+
m as audioName,
|
|
24
|
+
t as carouselRoot,
|
|
17
25
|
a as carouselSlide,
|
|
18
26
|
e as carouselViewport,
|
|
19
27
|
o as container,
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
C as default,
|
|
29
|
+
u as imageContainer,
|
|
22
30
|
c as modalBody,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
d as modalContent,
|
|
32
|
+
_ as navButton,
|
|
33
|
+
i as navButtonNext,
|
|
34
|
+
r as navButtonPrev,
|
|
35
|
+
f as pdfContainer,
|
|
36
|
+
l as pdfFrame,
|
|
37
|
+
n as root,
|
|
38
|
+
s as videoContainer
|
|
29
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentsPreview.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentsPreview/AttachmentsPreview.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIhE,UAAU,8BAA8B;IACtC,KAAK,EAAE,oBAAoB,CAAC,cAAc,EAAE,CAAC;IAC7C,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,kBAAkB,GAAI,8CAKhC,8BAA8B,
|
|
1
|
+
{"version":3,"file":"AttachmentsPreview.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentsPreview/AttachmentsPreview.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAIhE,UAAU,8BAA8B;IACtC,KAAK,EAAE,oBAAoB,CAAC,cAAc,EAAE,CAAC;IAC7C,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,kBAAkB,GAAI,8CAKhC,8BAA8B,mDAoNhC,CAAC"}
|
|
@@ -6,11 +6,11 @@ import { useDisclosure as M } from "@mantine/hooks";
|
|
|
6
6
|
import { getFileIcons as P } from "../../helpers/getFileIcons.js";
|
|
7
7
|
import { getFileType as A } from "../../helpers/getFileType.js";
|
|
8
8
|
import { AttachmentsGalleryModal as B } from "../AttachmentsGalleryModal/AttachmentsGalleryModal.js";
|
|
9
|
-
import
|
|
9
|
+
import a from "./AttachmentsPreview.module.css.js";
|
|
10
10
|
const U = ({
|
|
11
11
|
files: o,
|
|
12
12
|
onRemove: i,
|
|
13
|
-
mode:
|
|
13
|
+
mode: t,
|
|
14
14
|
parentIsExisting: u
|
|
15
15
|
}) => {
|
|
16
16
|
const [T, { open: w, close: b }] = M(!1), s = o.filter((e) => e.isImage), d = o.filter((e) => !e.isImage), D = s.map((e) => ({
|
|
@@ -35,7 +35,7 @@ const U = ({
|
|
|
35
35
|
};
|
|
36
36
|
return o.length === 0 ? null : /* @__PURE__ */ n(C, { children: [
|
|
37
37
|
/* @__PURE__ */ n(v, { gap: "10px", w: "100%", tabIndex: 0, children: [
|
|
38
|
-
s.length > 0 && /* @__PURE__ */ r(z, {
|
|
38
|
+
s.length > 0 && /* @__PURE__ */ r(z, { gap: "xs", children: s.map((e) => {
|
|
39
39
|
const l = o.indexOf(e);
|
|
40
40
|
return /* @__PURE__ */ r(z.Col, { span: "content", children: /* @__PURE__ */ n(
|
|
41
41
|
h,
|
|
@@ -43,7 +43,7 @@ const U = ({
|
|
|
43
43
|
w: 56,
|
|
44
44
|
h: 56,
|
|
45
45
|
pos: "relative",
|
|
46
|
-
className:
|
|
46
|
+
className: a.imagePreviewWrapper,
|
|
47
47
|
children: [
|
|
48
48
|
/* @__PURE__ */ r(
|
|
49
49
|
F,
|
|
@@ -62,11 +62,11 @@ const U = ({
|
|
|
62
62
|
/* @__PURE__ */ r(
|
|
63
63
|
f,
|
|
64
64
|
{
|
|
65
|
-
visible: e.isTemp &&
|
|
65
|
+
visible: e.isTemp && t === "view" && u,
|
|
66
66
|
loaderProps: { size: 20 }
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
|
-
|
|
69
|
+
t === "view" && !e.isTemp && /* @__PURE__ */ r(
|
|
70
70
|
c,
|
|
71
71
|
{
|
|
72
72
|
component: "a",
|
|
@@ -79,11 +79,11 @@ const U = ({
|
|
|
79
79
|
top: 2,
|
|
80
80
|
right: 2,
|
|
81
81
|
bg: "var(--mantine-color-dark-filled, #2E2E2E)",
|
|
82
|
-
className:
|
|
82
|
+
className: a.downloadButton,
|
|
83
83
|
children: /* @__PURE__ */ r(x, { size: 16, icon: g })
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
|
|
86
|
+
t === "draft" && i && /* @__PURE__ */ r(
|
|
87
87
|
c,
|
|
88
88
|
{
|
|
89
89
|
size: "20px",
|
|
@@ -93,7 +93,7 @@ const U = ({
|
|
|
93
93
|
pos: "absolute",
|
|
94
94
|
color: "dark",
|
|
95
95
|
onClick: () => i(l),
|
|
96
|
-
className:
|
|
96
|
+
className: a.deleteButton,
|
|
97
97
|
children: /* @__PURE__ */ r(I, { size: "12px" })
|
|
98
98
|
}
|
|
99
99
|
)
|
|
@@ -105,15 +105,15 @@ const U = ({
|
|
|
105
105
|
h,
|
|
106
106
|
{
|
|
107
107
|
w: "100%",
|
|
108
|
-
className:
|
|
108
|
+
className: a.filePreviewList,
|
|
109
109
|
"data-many": d.length >= 4,
|
|
110
110
|
children: d.map((e) => {
|
|
111
111
|
const l = o.indexOf(e);
|
|
112
|
-
return /* @__PURE__ */ n(h, { className:
|
|
112
|
+
return /* @__PURE__ */ n(h, { className: a.filePreviewWrapper, children: [
|
|
113
113
|
/* @__PURE__ */ r(
|
|
114
114
|
f,
|
|
115
115
|
{
|
|
116
|
-
visible: e.isTemp &&
|
|
116
|
+
visible: e.isTemp && t === "view" && u,
|
|
117
117
|
loaderProps: { size: 20 }
|
|
118
118
|
}
|
|
119
119
|
),
|
|
@@ -134,7 +134,11 @@ const U = ({
|
|
|
134
134
|
flex: 1,
|
|
135
135
|
miw: 0,
|
|
136
136
|
children: [
|
|
137
|
-
P(
|
|
137
|
+
P(
|
|
138
|
+
A(e.type, !1, e.name),
|
|
139
|
+
!1,
|
|
140
|
+
36
|
|
141
|
+
),
|
|
138
142
|
/* @__PURE__ */ n(v, { gap: 0, flex: 1, miw: 0, children: [
|
|
139
143
|
/* @__PURE__ */ r(
|
|
140
144
|
N,
|
|
@@ -142,7 +146,7 @@ const U = ({
|
|
|
142
146
|
size: "sm",
|
|
143
147
|
truncate: !0,
|
|
144
148
|
title: e.name,
|
|
145
|
-
className:
|
|
149
|
+
className: a.fileDownloadName,
|
|
146
150
|
component: "a",
|
|
147
151
|
href: e.url,
|
|
148
152
|
download: e.name,
|
|
@@ -159,7 +163,7 @@ const U = ({
|
|
|
159
163
|
]
|
|
160
164
|
}
|
|
161
165
|
),
|
|
162
|
-
|
|
166
|
+
t === "view" && !e.isTemp && /* @__PURE__ */ r(
|
|
163
167
|
c,
|
|
164
168
|
{
|
|
165
169
|
component: "a",
|
|
@@ -169,14 +173,14 @@ const U = ({
|
|
|
169
173
|
variant: "subtle",
|
|
170
174
|
color: "gray",
|
|
171
175
|
size: "sm",
|
|
172
|
-
className:
|
|
176
|
+
className: a.downloadButton,
|
|
173
177
|
children: /* @__PURE__ */ r(x, { size: 16, icon: g })
|
|
174
178
|
}
|
|
175
179
|
)
|
|
176
180
|
]
|
|
177
181
|
}
|
|
178
182
|
),
|
|
179
|
-
|
|
183
|
+
t === "draft" && i && /* @__PURE__ */ r(
|
|
180
184
|
c,
|
|
181
185
|
{
|
|
182
186
|
size: "xs",
|
|
@@ -185,7 +189,7 @@ const U = ({
|
|
|
185
189
|
variant: "filled",
|
|
186
190
|
color: "dark",
|
|
187
191
|
onClick: () => i(l),
|
|
188
|
-
className:
|
|
192
|
+
className: a.deleteButton,
|
|
189
193
|
children: /* @__PURE__ */ r(I, { size: "12px" })
|
|
190
194
|
}
|
|
191
195
|
)
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { ColorSwatchProps, FlexProps } from '@mantine/core';
|
|
2
2
|
import { ColorPickerList } from './ColorPickerList';
|
|
3
3
|
import type { ColorItem } from './types';
|
|
4
|
+
type ColorPickerProps = {
|
|
5
|
+
value?: string | null;
|
|
6
|
+
onChange?: (v: string) => void;
|
|
7
|
+
allowCustomColor?: boolean;
|
|
8
|
+
colors?: ColorItem[];
|
|
9
|
+
swatchShape?: 'circle' | 'square';
|
|
10
|
+
swatchVariant?: 'filled' | 'outline';
|
|
11
|
+
withTick?: boolean;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
swatchSize?: number;
|
|
14
|
+
} & Omit<FlexProps, 'onChange'>;
|
|
4
15
|
interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<React.ComponentPropsWithoutRef<'div'>, keyof Omit<ColorSwatchProps, 'color'>> {
|
|
5
16
|
value?: string | null;
|
|
6
17
|
label?: string;
|
|
@@ -12,17 +23,7 @@ interface ColorCircleProps extends Omit<ColorSwatchProps, 'color'>, Omit<React.C
|
|
|
12
23
|
bgColor?: string;
|
|
13
24
|
}
|
|
14
25
|
export declare const ColorCircle: import("react").ForwardRefExoticComponent<ColorCircleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
-
export declare const ColorPicker: import("react").ForwardRefExoticComponent<{
|
|
16
|
-
value?: string | null;
|
|
17
|
-
onChange?: (v: string) => void;
|
|
18
|
-
allowCustomColor?: boolean;
|
|
19
|
-
colors?: ColorItem[];
|
|
20
|
-
swatchShape?: "circle" | "square";
|
|
21
|
-
swatchVariant?: "filled" | "outline";
|
|
22
|
-
withTick?: boolean;
|
|
23
|
-
fullWidth?: boolean;
|
|
24
|
-
swatchSize?: number;
|
|
25
|
-
} & Omit<FlexProps, "onChange"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
26
|
+
export declare const ColorPicker: import("react").ForwardRefExoticComponent<Omit<ColorPickerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
26
27
|
ColorCircle: import("react").ForwardRefExoticComponent<ColorCircleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
28
|
List: typeof ColorPickerList;
|
|
28
29
|
Toolbar: import("react").ForwardRefExoticComponent<import("./ColorPickerToolbar").ColorPickerToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,g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AAQ,GAAG,QAAQ,CAAC;IAClC,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,6GAmDvB,CAAC;AASF,eAAO,MAAM,WAAW;;;;CAItB,CAAC"}
|
|
@@ -99,7 +99,7 @@ const G = y(
|
|
|
99
99
|
), k = y(
|
|
100
100
|
({ value: o, label: l, isActive: n, swatchShape: s, swatchVariant: a = "filled", withTick: m, borderColor: d, bgColor: p, ...i }, u) => {
|
|
101
101
|
const f = w(), r = o ? E(o, f) : "", t = a === "outline";
|
|
102
|
-
return /* @__PURE__ */ e(C, { w: i.size || 24, h: i.size || 24, justify: "center", align: "center", style: { position: "relative" }, children: /* @__PURE__ */ e(R, { label: l || o || "", withArrow: !0, children: /* @__PURE__ */ h(
|
|
102
|
+
return /* @__PURE__ */ e(C, { w: i.size || 24, h: i.size || 24, justify: "center", align: "center", style: { position: "relative" }, children: /* @__PURE__ */ e(R, { label: l || o || "", withArrow: !0, zIndex: 300, children: /* @__PURE__ */ h(
|
|
103
103
|
D,
|
|
104
104
|
{
|
|
105
105
|
ref: u,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as S, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as T, useState as y, useCallback as w, useMemo as H } from "react";
|
|
3
3
|
import { useMantineColorScheme as j, Box as h, Flex as B, Tooltip as P, UnstyledButton as U } from "@mantine/core";
|
|
4
|
-
import { TextColorIcon as K, HighlightSwatch as
|
|
4
|
+
import { TextColorIcon as K, HighlightSwatch as z } from "./icons.js";
|
|
5
5
|
import { normalizeColorItem as $, isDefaultColor as q } from "./types.js";
|
|
6
6
|
import { useRecentColors as E } from "./useRecentColors.js";
|
|
7
7
|
import c from "./ColorPicker.module.css.js";
|
|
@@ -24,12 +24,12 @@ function k({
|
|
|
24
24
|
children: i
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
|
-
return f ? /* @__PURE__ */ r(P, { label: f, withArrow: !0, children: v }) : v;
|
|
27
|
+
return f ? /* @__PURE__ */ r(P, { label: f, withArrow: !0, zIndex: 300, children: v }) : v;
|
|
28
28
|
}
|
|
29
|
-
const Y =
|
|
30
|
-
const { colorScheme: C } = j(), x = C === "dark", { recentColors:
|
|
29
|
+
const Y = T(({ sections: s, onChange: m, withRecentColors: u, maxRecentColors: d = 9, disabled: i, recentColorsLabel: f = "Recently used" }, v) => {
|
|
30
|
+
const { colorScheme: C } = j(), x = C === "dark", { recentColors: D, addRecent: F } = E({ maxItems: d }), [L, I] = y(D), p = w(
|
|
31
31
|
(e, o, t) => {
|
|
32
|
-
u && (F(e, o, t),
|
|
32
|
+
u && (F(e, o, t), I((l) => {
|
|
33
33
|
const n = l.filter(
|
|
34
34
|
(a) => !(a.value === e && a.sectionKey === o)
|
|
35
35
|
);
|
|
@@ -37,11 +37,11 @@ const Y = z(({ sections: s, onChange: m, withRecentColors: u, maxRecentColors: d
|
|
|
37
37
|
})), m(e, o);
|
|
38
38
|
},
|
|
39
39
|
[m, u, F]
|
|
40
|
-
), g =
|
|
40
|
+
), g = H(() => {
|
|
41
41
|
const e = {};
|
|
42
42
|
for (const o of s) e[o.key] = o;
|
|
43
43
|
return e;
|
|
44
|
-
}, [s]),
|
|
44
|
+
}, [s]), M = w(
|
|
45
45
|
(e, o) => {
|
|
46
46
|
if (!o) return;
|
|
47
47
|
const t = g[o];
|
|
@@ -60,7 +60,7 @@ const Y = z(({ sections: s, onChange: m, withRecentColors: u, maxRecentColors: d
|
|
|
60
60
|
u && L.length > 0 && /* @__PURE__ */ S(h, { className: c.inlineSection, children: [
|
|
61
61
|
/* @__PURE__ */ r(h, { className: c.inlineSectionLabel, children: f }),
|
|
62
62
|
/* @__PURE__ */ r(B, { className: c.inlineRow, gap: 2, children: L.map((e, o) => {
|
|
63
|
-
const t = e.sectionKey ? g[e.sectionKey] : void 0, l = t?.key === "textColor" || t?.key === "color" || e.sectionKey === "color", n =
|
|
63
|
+
const t = e.sectionKey ? g[e.sectionKey] : void 0, l = t?.key === "textColor" || t?.key === "color" || e.sectionKey === "color", n = M(e.value, e.sectionKey);
|
|
64
64
|
return l ? /* @__PURE__ */ r(
|
|
65
65
|
k,
|
|
66
66
|
{
|
|
@@ -87,7 +87,7 @@ const Y = z(({ sections: s, onChange: m, withRecentColors: u, maxRecentColors: d
|
|
|
87
87
|
tooltipLabel: n,
|
|
88
88
|
onClick: () => p(e.value, e.sectionKey ?? ""),
|
|
89
89
|
children: /* @__PURE__ */ r(
|
|
90
|
-
|
|
90
|
+
z,
|
|
91
91
|
{
|
|
92
92
|
bgColor: e.value,
|
|
93
93
|
borderColor: e.border || "var(--mantine-color-default-border)"
|
|
@@ -113,7 +113,7 @@ const Y = z(({ sections: s, onChange: m, withRecentColors: u, maxRecentColors: d
|
|
|
113
113
|
tooltipLabel: A,
|
|
114
114
|
onClick: () => p(l, e.key, n),
|
|
115
115
|
children: /* @__PURE__ */ r(
|
|
116
|
-
|
|
116
|
+
z,
|
|
117
117
|
{
|
|
118
118
|
bgColor: l,
|
|
119
119
|
borderColor: n || R
|
|
@@ -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,CAAC;IAC5B,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kIAAkI;I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B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kIAAkI;IAClI,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAChC,2GAA2G;IAC3G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gHAAgH;IAChH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,2OAmBzB,iBAAiB,CAAC,gBAAgB,CAAC,4CAiNrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityIcon.d.ts","sourceRoot":"","sources":["../../src/components/EntityIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityIcon.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"FilePicker.d.ts","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