@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,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,41 @@
|
|
|
1
|
-
const
|
|
2
|
-
container:
|
|
3
|
-
root:
|
|
4
|
-
carouselRoot:
|
|
1
|
+
const n = "_container_nqf56_1", o = "_root_nqf56_13", t = "_carouselRoot_nqf56_27", e = "_carouselViewport_nqf56_35", a = "_carouselSlide_nqf56_43", _ = "_navButton_nqf56_57", r = "_navButtonPrev_nqf56_83", i = "_navButtonNext_nqf56_91", c = "_headerAction_nqf56_99", d = "_modalContent_nqf56_127", s = "_modalBody_nqf56_137", u = "_videoContainer_nqf56_149", f = "_imageContainer_nqf56_159", l = "_pdfContainer_nqf56_173", m = "_pdfFrame_nqf56_189", q = "_audioContainer_nqf56_203", v = "_audioName_nqf56_233", C = "_audioElement_nqf56_249", B = {
|
|
2
|
+
container: n,
|
|
3
|
+
root: o,
|
|
4
|
+
carouselRoot: t,
|
|
5
5
|
carouselViewport: e,
|
|
6
6
|
carouselSlide: a,
|
|
7
|
-
navButton:
|
|
8
|
-
navButtonPrev:
|
|
9
|
-
navButtonNext:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
navButton: _,
|
|
8
|
+
navButtonPrev: r,
|
|
9
|
+
navButtonNext: i,
|
|
10
|
+
headerAction: c,
|
|
11
|
+
modalContent: d,
|
|
12
|
+
modalBody: s,
|
|
13
|
+
videoContainer: u,
|
|
14
|
+
imageContainer: f,
|
|
15
|
+
pdfContainer: l,
|
|
16
|
+
pdfFrame: m,
|
|
17
|
+
audioContainer: q,
|
|
18
|
+
audioName: v,
|
|
19
|
+
audioElement: C
|
|
14
20
|
};
|
|
15
21
|
export {
|
|
16
|
-
|
|
22
|
+
q as audioContainer,
|
|
23
|
+
C as audioElement,
|
|
24
|
+
v as audioName,
|
|
25
|
+
t as carouselRoot,
|
|
17
26
|
a as carouselSlide,
|
|
18
27
|
e as carouselViewport,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
n as container,
|
|
29
|
+
B as default,
|
|
30
|
+
c as headerAction,
|
|
31
|
+
f as imageContainer,
|
|
32
|
+
s as modalBody,
|
|
33
|
+
d as modalContent,
|
|
34
|
+
_ as navButton,
|
|
35
|
+
i as navButtonNext,
|
|
36
|
+
r as navButtonPrev,
|
|
37
|
+
l as pdfContainer,
|
|
38
|
+
m as pdfFrame,
|
|
39
|
+
o as root,
|
|
40
|
+
u as videoContainer
|
|
29
41
|
};
|
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAKA,OAAO,EAIL,gBAAgB,EAEhB,SAAS,EAKV,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAyGhC,UAAU,gBACR,SAAQ,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,EACrC,IAAI,CACF,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,MAAM,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CACtC;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,QAAQ,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,6GAiFvB,CAAC;AASF,eAAO,MAAM,WAAW;;;;CAItB,CAAC"}
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import V from "
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as k, useState as g } from "react";
|
|
3
|
+
import { useTranslation as j } from "react-i18next";
|
|
4
|
+
import { Tick02Icon as A } from "@hugeicons/core-free-icons";
|
|
5
|
+
import { HugeiconsIcon as E } from "@hugeicons/react";
|
|
6
|
+
import { useMantineTheme as z, getThemeColor as R, Flex as x, Tooltip as D, ColorSwatch as F, parseThemeColor as H, ColorInput as M, ActionIcon as y } from "@mantine/core";
|
|
7
|
+
import { IconPalette as U, IconPencil as V } from "@tabler/icons-react";
|
|
8
|
+
import q from "styled-components";
|
|
9
|
+
import { DEFAULT_VALUES as w } from "../../constants.js";
|
|
10
10
|
import { ColorPickerList as _ } from "./ColorPickerList.js";
|
|
11
|
-
import {
|
|
12
|
-
|
|
11
|
+
import { ColorPickerToolbar as B } from "./ColorPickerToolbar.js";
|
|
12
|
+
import { resolveColorLabel as G, normalizeColorItem as J } from "./types.js";
|
|
13
|
+
const K = k(
|
|
13
14
|
({
|
|
14
15
|
value: o,
|
|
15
16
|
onChange: l,
|
|
16
17
|
allowCustomColor: n,
|
|
17
18
|
colors: s,
|
|
18
|
-
swatchShape:
|
|
19
|
+
swatchShape: c = "circle",
|
|
19
20
|
swatchVariant: m = "filled",
|
|
20
21
|
withTick: d = !1,
|
|
21
22
|
fullWidth: p = !1,
|
|
22
23
|
swatchSize: i = 30,
|
|
23
24
|
...u
|
|
24
25
|
}, f) => {
|
|
25
|
-
const
|
|
26
|
-
color: o ||
|
|
27
|
-
theme:
|
|
28
|
-
}), [
|
|
29
|
-
return
|
|
26
|
+
const h = z(), r = H({
|
|
27
|
+
color: o || w.COLORS[0],
|
|
28
|
+
theme: h
|
|
29
|
+
}), [t, C] = g(r.value), [L, v] = g(!1);
|
|
30
|
+
return L ? /* @__PURE__ */ b(x, { align: "center", mih: 30, children: [
|
|
30
31
|
/* @__PURE__ */ e(
|
|
31
|
-
|
|
32
|
+
M,
|
|
32
33
|
{
|
|
33
34
|
w: "100%",
|
|
34
35
|
popoverProps: {
|
|
@@ -38,57 +39,62 @@ const G = y(
|
|
|
38
39
|
maxLength: 7,
|
|
39
40
|
withEyeDropper: !1,
|
|
40
41
|
size: "xs",
|
|
41
|
-
value:
|
|
42
|
-
onChange:
|
|
42
|
+
value: t,
|
|
43
|
+
onChange: C,
|
|
43
44
|
onChangeEnd: l,
|
|
44
45
|
placeholder: "Select custom color"
|
|
45
46
|
}
|
|
46
47
|
),
|
|
47
48
|
/* @__PURE__ */ e(
|
|
48
|
-
|
|
49
|
+
y,
|
|
49
50
|
{
|
|
50
51
|
radius: "xl",
|
|
51
52
|
variant: "default",
|
|
52
53
|
color: "gray",
|
|
53
|
-
onClick: () =>
|
|
54
|
-
children: /* @__PURE__ */ e(
|
|
54
|
+
onClick: () => v(!1),
|
|
55
|
+
children: /* @__PURE__ */ e(U, { size: 16 })
|
|
55
56
|
}
|
|
56
57
|
)
|
|
57
|
-
] }, 1) : /* @__PURE__ */
|
|
58
|
-
|
|
58
|
+
] }, 1) : /* @__PURE__ */ b(
|
|
59
|
+
x,
|
|
59
60
|
{
|
|
60
61
|
ref: f,
|
|
61
62
|
...u,
|
|
62
63
|
justify: p ? "space-between" : "flex-start",
|
|
63
64
|
align: "center",
|
|
64
65
|
children: [
|
|
65
|
-
(s ||
|
|
66
|
-
const {
|
|
66
|
+
(s || w.COLORS).map((O, T) => {
|
|
67
|
+
const {
|
|
68
|
+
value: a,
|
|
69
|
+
border: P,
|
|
70
|
+
bg: S,
|
|
71
|
+
label: $
|
|
72
|
+
} = J(O);
|
|
67
73
|
return /* @__PURE__ */ e(
|
|
68
|
-
|
|
74
|
+
N,
|
|
69
75
|
{
|
|
70
|
-
value:
|
|
76
|
+
value: a,
|
|
71
77
|
label: $,
|
|
72
|
-
isActive:
|
|
78
|
+
isActive: a === o,
|
|
73
79
|
size: i - 4,
|
|
74
|
-
swatchShape:
|
|
80
|
+
swatchShape: c,
|
|
75
81
|
swatchVariant: m,
|
|
76
82
|
withTick: d,
|
|
77
|
-
borderColor:
|
|
78
|
-
bgColor:
|
|
79
|
-
onClick: () => l?.(
|
|
83
|
+
borderColor: P,
|
|
84
|
+
bgColor: S,
|
|
85
|
+
onClick: () => l?.(a)
|
|
80
86
|
},
|
|
81
|
-
|
|
87
|
+
a || T
|
|
82
88
|
);
|
|
83
89
|
}),
|
|
84
90
|
n && /* @__PURE__ */ e(
|
|
85
|
-
|
|
91
|
+
y,
|
|
86
92
|
{
|
|
87
93
|
radius: "xl",
|
|
88
94
|
variant: "default",
|
|
89
95
|
color: "gray",
|
|
90
|
-
onClick: () =>
|
|
91
|
-
children: /* @__PURE__ */ e(
|
|
96
|
+
onClick: () => v(!0),
|
|
97
|
+
children: /* @__PURE__ */ e(V, { size: 16 })
|
|
92
98
|
}
|
|
93
99
|
)
|
|
94
100
|
]
|
|
@@ -96,58 +102,78 @@ const G = y(
|
|
|
96
102
|
2
|
|
97
103
|
);
|
|
98
104
|
}
|
|
99
|
-
),
|
|
100
|
-
({
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
), I = k(
|
|
106
|
+
({
|
|
107
|
+
value: o,
|
|
108
|
+
label: l,
|
|
109
|
+
isActive: n,
|
|
110
|
+
swatchShape: s,
|
|
111
|
+
swatchVariant: c = "filled",
|
|
112
|
+
withTick: m,
|
|
113
|
+
borderColor: d,
|
|
114
|
+
bgColor: p,
|
|
115
|
+
...i
|
|
116
|
+
}, u) => {
|
|
117
|
+
const f = z(), { t: h } = j("ui"), r = o ? R(o, f) : "", t = c === "outline", C = G(h, o, l);
|
|
118
|
+
return /* @__PURE__ */ e(
|
|
119
|
+
x,
|
|
104
120
|
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
121
|
+
w: i.size || 24,
|
|
122
|
+
h: i.size || 24,
|
|
123
|
+
justify: "center",
|
|
124
|
+
align: "center",
|
|
125
|
+
style: { position: "relative" },
|
|
126
|
+
children: /* @__PURE__ */ e(D, { label: C, withArrow: !0, zIndex: 300, children: /* @__PURE__ */ b(
|
|
127
|
+
F,
|
|
128
|
+
{
|
|
129
|
+
ref: u,
|
|
130
|
+
color: t ? "transparent" : r,
|
|
131
|
+
radius: s === "circle" ? "xl" : "sm",
|
|
132
|
+
styles: t ? {
|
|
133
|
+
alphaOverlay: { display: "none" },
|
|
134
|
+
shadowOverlay: { display: "none" }
|
|
135
|
+
} : void 0,
|
|
136
|
+
style: {
|
|
137
|
+
cursor: "pointer",
|
|
138
|
+
color: "var(--mantine-color-white)",
|
|
139
|
+
background: t ? p || `var(--mantine-color-${o}-light, ${r}20)` : void 0,
|
|
140
|
+
border: t ? `2px solid ${d || `var(--mantine-color-${o}-outline, ${r})`}` : void 0
|
|
141
|
+
},
|
|
142
|
+
...i,
|
|
143
|
+
children: [
|
|
144
|
+
n && /* @__PURE__ */ e(
|
|
145
|
+
"span",
|
|
146
|
+
{
|
|
147
|
+
style: {
|
|
148
|
+
position: "absolute",
|
|
149
|
+
top: -4,
|
|
150
|
+
left: -4,
|
|
151
|
+
right: -4,
|
|
152
|
+
bottom: -4,
|
|
153
|
+
border: `2px solid ${r}`,
|
|
154
|
+
borderRadius: s === "circle" ? "var(--mantine-radius-xl)" : "var(--mantine-radius-sm)",
|
|
155
|
+
pointerEvents: "none",
|
|
156
|
+
boxSizing: "border-box"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
m && n && /* @__PURE__ */ e(E, { size: 20, icon: A })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
) })
|
|
138
164
|
}
|
|
139
|
-
)
|
|
165
|
+
);
|
|
140
166
|
}
|
|
141
|
-
),
|
|
167
|
+
), N = q(I)`
|
|
142
168
|
.mantine-ColorSwatch-colorOverlay {
|
|
143
169
|
border-radius: ${({ swatchShape: o }) => o === "square" ? "3px" : "50%"};
|
|
144
170
|
}
|
|
145
|
-
`,
|
|
146
|
-
ColorCircle:
|
|
171
|
+
`, ao = Object.assign(K, {
|
|
172
|
+
ColorCircle: I,
|
|
147
173
|
List: _,
|
|
148
|
-
Toolbar:
|
|
174
|
+
Toolbar: B
|
|
149
175
|
});
|
|
150
176
|
export {
|
|
151
|
-
|
|
152
|
-
|
|
177
|
+
I as ColorCircle,
|
|
178
|
+
ao as ColorPicker
|
|
153
179
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerList.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorPickerList.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerList.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAgB,MAAM,SAAS,CAAC;AAqHlE;;oEAEoE;AACpE,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,OAAW,EACX,gBAAgB,GACjB,EAAE,oBAAoB,2CA4CtB"}
|