@layers-app/shared 0.2.2 → 0.2.4
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/assets/svg/group_default_icon.svg.js +4 -0
- package/dist/components/AppContainer/AppContainer.d.ts +1 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +31 -23
- package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerStore.js +30 -20
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.js +25 -22
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +237 -153
- package/dist/components/CommentComposer/{useFloatingPosition.d.ts → useVirtualAnchor.d.ts} +3 -4
- package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -0
- package/dist/components/CommentComposer/useVirtualAnchor.js +71 -0
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +50 -49
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +79 -78
- package/dist/components/FilePicker/FilePicker.d.ts +2 -3
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +88 -122
- package/dist/components/FilePicker/FilePickerGiphy.d.ts +1 -3
- package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGiphy.js +43 -44
- package/dist/components/FilePicker/FilePickerLink.d.ts +2 -3
- package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerLink.js +21 -21
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts +1 -3
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUnsplash.js +45 -46
- package/dist/components/FilePicker/FilePickerUpload.d.ts +3 -3
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +49 -43
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +5 -5
- package/dist/components/GroupAvatar/index.d.ts +9 -0
- package/dist/components/GroupAvatar/index.d.ts.map +1 -0
- package/dist/components/GroupAvatar/index.js +24 -0
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +6 -5
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts +2 -2
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +100 -103
- package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
- package/dist/components/modals/RemoveConfirmModal.js +22 -21
- package/dist/components/table/FrontTable.d.ts +2 -1
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/components/TableCell.d.ts.map +1 -1
- package/dist/components/table/components/TableCell.js +63 -26
- package/dist/components/table/components/TableMenu.d.ts +2 -1
- package/dist/components/table/components/TableMenu.d.ts.map +1 -1
- package/dist/components/table/components/TableMenu.js +15 -14
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +7 -4
- 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 +390 -384
- package/dist/lang/locales/ui_en.json.js +20 -12
- package/dist/lang/locales/ui_es.json.js +18 -10
- package/dist/lang/locales/ui_ru.json.js +24 -16
- package/dist/store/accessOptionsControl.d.ts +11 -1
- package/dist/store/accessOptionsControl.d.ts.map +1 -1
- package/dist/store/accessOptionsControl.js +15 -7
- package/package.json +1 -1
- package/dist/components/CommentComposer/useFloatingPosition.d.ts.map +0 -1
- package/dist/components/CommentComposer/useFloatingPosition.js +0 -115
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const C = "data:image/svg+xml,%3csvg%20width='36'%20height='36'%20viewBox='0%200%2036%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%2018C0%208.05888%208.05888%200%2018%200C27.9411%200%2036%208.05888%2036%2018C36%2027.9411%2027.9411%2036%2018%2036C8.05888%2036%200%2027.9411%200%2018Z'%20fill='%23868E96'%20fill-opacity='0.1'/%3e%3cpath%20d='M16%2019C19.866%2019%2023%2020.7909%2023%2023C23%2025.2091%2019.866%2027%2016%2027C12.134%2027%209%2025.2091%209%2023C9%2020.7909%2012.134%2019%2016%2019ZM21.8867%2019.0322C24.7799%2019.2465%2027%2020.4938%2027%2022C27%2023.0776%2025.8635%2024.0228%2024.1572%2024.5518C24.3804%2024.0597%2024.5%2023.5388%2024.5%2023C24.5%2021.4409%2023.4974%2020.0331%2021.8867%2019.0322ZM16%209C18.2091%209%2020%2010.7909%2020%2013C20%2015.2091%2018.2091%2017%2016%2017C13.7909%2017%2012%2015.2091%2012%2013C12%2010.7909%2013.7909%209%2016%209ZM21.126%2011.0029C22.7243%2011.069%2024%2012.3854%2024%2014C24%2015.6568%2022.6568%2017%2021%2017C20.6351%2017%2020.2854%2016.9347%2019.9619%2016.8154C20.9145%2015.8265%2021.5%2014.4815%2021.5%2013C21.5%2012.2955%2021.3674%2011.622%2021.126%2011.0029Z'%20fill='%23868E96'/%3e%3c/svg%3e";
|
|
2
|
+
export {
|
|
3
|
+
C as default
|
|
4
|
+
};
|
|
@@ -5,7 +5,7 @@ declare global {
|
|
|
5
5
|
preSignMode?: boolean;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
export declare const AppContainer: (({ header, content, toolbar, navbarTitle, footer, onTitleChange, trashMenu, rightbar, onInviteClick, showAppsSidebar, }: AppContainerProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
8
|
+
export declare const AppContainer: (({ header, content, toolbar, navbarTitle, footer, onTitleChange, trashMenu, rightbar, onInviteClick, showAppsSidebar, headerBorderless, }: AppContainerProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
9
9
|
NavbarContent: ({ children }: import("react").PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
NewButton: ({ children, ...props }: import("@mantine/core").PolymorphicComponentProps<"button", import("@mantine/core").ButtonProps>) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppContainer.d.ts","sourceRoot":"","sources":["../../../src/components/AppContainer/AppContainer.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB;CACF;
|
|
1
|
+
{"version":3,"file":"AppContainer.d.ts","sourceRoot":"","sources":["../../../src/components/AppContainer/AppContainer.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB;CACF;AAyED,eAAO,MAAM,YAAY,8IA3DtB,iBAAiB;;;CA8DlB,CAAC"}
|
|
@@ -1,42 +1,50 @@
|
|
|
1
1
|
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { useMantineColorScheme as
|
|
2
|
+
import { useEffect as y } from "react";
|
|
3
|
+
import { useMantineColorScheme as v, Stack as A, Flex as j } from "@mantine/core";
|
|
4
4
|
import { useQueryParam as k } from "../../hooks/useNumberQueryParam.js";
|
|
5
5
|
import { AppShell as e } from "../AppShell/AppShell.js";
|
|
6
|
-
import { AppsSidebar as
|
|
6
|
+
import { AppsSidebar as B } from "./components/AppsSidebar/AppsSidebar.js";
|
|
7
7
|
import { Header as H } from "./components/Header.js";
|
|
8
8
|
import { Main as N } from "./components/Main.js";
|
|
9
9
|
import T from "./components/NavbarContent.js";
|
|
10
10
|
import { RightSidebar as W } from "./components/RightSidebar.js";
|
|
11
|
-
import { ToolSidebar as
|
|
12
|
-
import { ToolbarNewButton as
|
|
13
|
-
import { appContainerStore as
|
|
14
|
-
const
|
|
11
|
+
import { ToolSidebar as M } from "./components/ToolSidebar.js";
|
|
12
|
+
import { ToolbarNewButton as P } from "./components/ToolbarNewButton.js";
|
|
13
|
+
import { appContainerStore as $ } from "./hooks/useAppContainerStore.js";
|
|
14
|
+
const E = ({
|
|
15
15
|
header: h,
|
|
16
16
|
content: l,
|
|
17
17
|
toolbar: i,
|
|
18
|
-
navbarTitle:
|
|
18
|
+
navbarTitle: d,
|
|
19
19
|
footer: n,
|
|
20
|
-
onTitleChange:
|
|
21
|
-
trashMenu:
|
|
20
|
+
onTitleChange: s,
|
|
21
|
+
trashMenu: c,
|
|
22
22
|
rightbar: m,
|
|
23
23
|
onInviteClick: f,
|
|
24
|
-
showAppsSidebar:
|
|
24
|
+
showAppsSidebar: b = !0,
|
|
25
|
+
headerBorderless: u = !1
|
|
25
26
|
}) => {
|
|
26
|
-
const { toolbarWidth: S, rightbarWidth:
|
|
27
|
-
|
|
27
|
+
const { toolbarWidth: S, rightbarWidth: x, layout: a } = $.useStore(), { setColorScheme: p } = v(), t = k("theme");
|
|
28
|
+
y(() => {
|
|
28
29
|
(t === "dark" || t === "light") && p(t);
|
|
29
30
|
}, [t, p]);
|
|
30
|
-
const
|
|
31
|
+
const w = {
|
|
31
32
|
"--toolbar-width": `${S}px`,
|
|
32
|
-
"--rightbar-width": `${
|
|
33
|
-
},
|
|
34
|
-
return /* @__PURE__ */ o(e, { style:
|
|
35
|
-
|
|
33
|
+
"--rightbar-width": `${x}px`
|
|
34
|
+
}, g = a !== "nothing", C = a === "default" && i;
|
|
35
|
+
return /* @__PURE__ */ o(e, { style: w, children: [
|
|
36
|
+
b && /* @__PURE__ */ r(e.Section, { w: "var(--apps-sidebar-width)", children: /* @__PURE__ */ r(B, { onInviteClick: f, trashMenu: c }) }),
|
|
36
37
|
/* @__PURE__ */ o(e.Section, { flex: 1, display: "flex", pos: "relative", children: [
|
|
37
|
-
|
|
38
|
+
C && /* @__PURE__ */ r(M, { onTitleChange: s, navbarTitle: d, children: i }),
|
|
38
39
|
/* @__PURE__ */ o(A, { mih: 0, gap: 0, h: "100%", flex: 2, miw: 0, children: [
|
|
39
|
-
|
|
40
|
+
g && /* @__PURE__ */ r(
|
|
41
|
+
e.Header,
|
|
42
|
+
{
|
|
43
|
+
px: "sm",
|
|
44
|
+
style: u ? { borderBottom: "none" } : void 0,
|
|
45
|
+
children: /* @__PURE__ */ r(H, { children: h })
|
|
46
|
+
}
|
|
47
|
+
),
|
|
40
48
|
/* @__PURE__ */ o(j, { mih: 0, gap: 0, h: "100%", children: [
|
|
41
49
|
/* @__PURE__ */ r(e.WorkContent, { children: /* @__PURE__ */ o(N, { children: [
|
|
42
50
|
l,
|
|
@@ -47,10 +55,10 @@ const $ = ({
|
|
|
47
55
|
] })
|
|
48
56
|
] })
|
|
49
57
|
] });
|
|
50
|
-
},
|
|
58
|
+
}, U = Object.assign(E, {
|
|
51
59
|
NavbarContent: T,
|
|
52
|
-
NewButton:
|
|
60
|
+
NewButton: P
|
|
53
61
|
});
|
|
54
62
|
export {
|
|
55
|
-
|
|
63
|
+
U as AppContainer
|
|
56
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppContainerStore.d.ts","sourceRoot":"","sources":["../../../../src/components/AppContainer/hooks/useAppContainerStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAU,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useAppContainerStore.d.ts","sourceRoot":"","sources":["../../../../src/components/AppContainer/hooks/useAppContainerStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAU,MAAM,SAAS,CAAC;AAI1D,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAyHjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;iCA9CI,OAAO;iCAIP,MAAM;kCAIL,MAAM;mCAKL,MAAM;4BASb,kBAAkB;0BAIpB,MAAM;;CAoByB,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { create as
|
|
2
|
-
import { persist as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { create as l } from "zustand";
|
|
2
|
+
import { persist as n, createJSONStorage as g } from "zustand/middleware";
|
|
3
|
+
import { DEFAULT_COLOR_SCHEME as i, isValidColorScheme as b } from "../../../constants.js";
|
|
4
|
+
const r = 338, d = () => typeof window > "u" ? !0 : !window.matchMedia("(max-width: 992px)").matches, c = () => {
|
|
5
|
+
const o = l(
|
|
6
|
+
n(
|
|
6
7
|
() => ({
|
|
7
8
|
layout: "default",
|
|
8
|
-
showToolbar:
|
|
9
|
-
theme:
|
|
9
|
+
showToolbar: d(),
|
|
10
|
+
theme: i,
|
|
10
11
|
hiddenTools: [],
|
|
11
12
|
toolbarWidth: 280,
|
|
12
13
|
isTourPassed: !1,
|
|
@@ -15,18 +16,27 @@ const s = 338, n = () => {
|
|
|
15
16
|
}),
|
|
16
17
|
{
|
|
17
18
|
name: "app-menu",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
version: 3,
|
|
20
|
+
storage: g(() => localStorage),
|
|
21
|
+
migrate: (e) => {
|
|
22
|
+
const s = typeof e?.theme == "string" && b(e.theme) ? e.theme : i;
|
|
23
|
+
return {
|
|
24
|
+
...e,
|
|
25
|
+
rightbarWidth: Math.max(
|
|
26
|
+
e?.rightbarWidth || 0,
|
|
27
|
+
r
|
|
28
|
+
),
|
|
29
|
+
theme: s
|
|
30
|
+
};
|
|
31
|
+
}
|
|
22
32
|
}
|
|
23
33
|
)
|
|
24
34
|
);
|
|
25
35
|
return {
|
|
26
36
|
useStore: o,
|
|
27
|
-
api:
|
|
37
|
+
api: T(o)
|
|
28
38
|
};
|
|
29
|
-
},
|
|
39
|
+
}, T = (o) => ({
|
|
30
40
|
toggleToolbar: () => {
|
|
31
41
|
o.setState((t) => ({ ...t, showToolbar: !t.showToolbar }));
|
|
32
42
|
},
|
|
@@ -44,13 +54,13 @@ const s = 338, n = () => {
|
|
|
44
54
|
o.setState({ toolbarWidth: t });
|
|
45
55
|
},
|
|
46
56
|
setRightbarWidth: (t) => {
|
|
47
|
-
const
|
|
48
|
-
o.setState({ rightbarWidth:
|
|
57
|
+
const a = Math.max(t, r);
|
|
58
|
+
o.setState({ rightbarWidth: a });
|
|
49
59
|
},
|
|
50
60
|
toggleToolVisibility: (t) => {
|
|
51
|
-
o.setState((
|
|
52
|
-
...
|
|
53
|
-
hiddenTools:
|
|
61
|
+
o.setState((a) => ({
|
|
62
|
+
...a,
|
|
63
|
+
hiddenTools: a.hiddenTools.includes(t) ? a.hiddenTools.filter((h) => h !== t) : [...a.hiddenTools, t]
|
|
54
64
|
}));
|
|
55
65
|
},
|
|
56
66
|
setLayout: (t) => {
|
|
@@ -59,7 +69,7 @@ const s = 338, n = () => {
|
|
|
59
69
|
setTheme: (t) => {
|
|
60
70
|
o.setState({ theme: t });
|
|
61
71
|
}
|
|
62
|
-
}),
|
|
72
|
+
}), I = c();
|
|
63
73
|
export {
|
|
64
|
-
|
|
74
|
+
I as appContainerStore
|
|
65
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../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B,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,CAAC,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,qBAAqB,EAAE,CAAC,IAAI,EAAE,wBAAwB,KAAK,IAAI,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_commentComposerWrapper_1mv8w_1", e = "_commentComposerFloat_1mv8w_68", r = "_composerContainer_1mv8w_97", t = "_editorWrapper_1mv8w_113", m = "_editMode_1mv8w_181", p = {
|
|
2
2
|
commentComposerWrapper: o,
|
|
3
3
|
commentComposerFloat: e,
|
|
4
4
|
composerContainer: r,
|
|
5
5
|
editorWrapper: t,
|
|
6
|
-
editMode:
|
|
6
|
+
editMode: m
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
e as commentComposerFloat,
|
|
10
10
|
o as commentComposerWrapper,
|
|
11
11
|
r as composerContainer,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
p as default,
|
|
13
|
+
m as editMode,
|
|
14
14
|
t as editorWrapper
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentEditorHotkeys.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentEditorHotkeys.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C,eAAO,MAAM,oBAAoB,GAAI,8GAWlC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvC,iBAAiB,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC/C,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,EAAE,CAAC;KACjD,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ,
|
|
1
|
+
{"version":3,"file":"CommentEditorHotkeys.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentEditorHotkeys.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C,eAAO,MAAM,oBAAoB,GAAI,8GAWlC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvC,iBAAiB,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC/C,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,EAAE,CAAC;KACjD,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ,4CAuJA,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as S } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as D, useEffect as m } from "react";
|
|
3
3
|
import { useTranslation as T } from "react-i18next";
|
|
4
|
-
import { openRemoveConfirmModal as
|
|
4
|
+
import { openRemoveConfirmModal as g } from "../modals/RemoveConfirmModal.js";
|
|
5
5
|
import w from "./CommentComposer.module.css.js";
|
|
6
6
|
const W = ({
|
|
7
|
-
children:
|
|
7
|
+
children: y,
|
|
8
8
|
onSubmit: v,
|
|
9
9
|
editorRef: a,
|
|
10
10
|
commentDraft: l,
|
|
11
11
|
onBlur: c,
|
|
12
|
-
inputContainerRef:
|
|
12
|
+
inputContainerRef: C,
|
|
13
13
|
isFloat: f,
|
|
14
14
|
isEdit: i,
|
|
15
15
|
hasChanges: s,
|
|
@@ -17,25 +17,25 @@ const W = ({
|
|
|
17
17
|
}) => {
|
|
18
18
|
const p = D(null), L = i || f, { t: r } = T(P);
|
|
19
19
|
return m(() => {
|
|
20
|
-
const
|
|
20
|
+
const o = (e) => {
|
|
21
21
|
if (e.code === "Enter" && !e.shiftKey) {
|
|
22
22
|
if (e.stopPropagation(), i ? s : !s) return;
|
|
23
23
|
p.current && p.current.contains(document.activeElement) && (e.preventDefault(), v());
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
return document.addEventListener("keydown",
|
|
26
|
+
return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
|
|
27
27
|
}, [v, i, s]), m(() => {
|
|
28
28
|
if (!L) return;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const o = a.current;
|
|
30
|
+
o && setTimeout(() => {
|
|
31
|
+
o.focus(() => ({ defaultSelection: "rootEnd" }));
|
|
32
32
|
}, 0);
|
|
33
33
|
}, []), m(() => {
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
34
|
+
const o = a.current;
|
|
35
|
+
if (!o) return;
|
|
36
36
|
const e = () => setTimeout(() => {
|
|
37
|
-
|
|
38
|
-
}, 0),
|
|
37
|
+
o.focus(() => ({ defaultSelection: "rootEnd" }));
|
|
38
|
+
}, 0), t = (u) => {
|
|
39
39
|
const n = u.target;
|
|
40
40
|
if (!n || n.closest("button") || n.closest("[data-no-focus]")) return;
|
|
41
41
|
if (n.closest("[data-editor-spacer='true']")) {
|
|
@@ -48,22 +48,25 @@ const W = ({
|
|
|
48
48
|
if (!E || !E.contains(n)) return;
|
|
49
49
|
d.querySelector(`.${w.imagePreviewWrapper}`) || d.querySelector(`.${w.filePreviewWrapper}`) || e();
|
|
50
50
|
};
|
|
51
|
-
return document.addEventListener("mousedown",
|
|
51
|
+
return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
|
|
52
52
|
}, [a]), m(() => {
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
56
|
-
const u =
|
|
57
|
-
if (u && !u.contains(
|
|
53
|
+
const o = (e) => {
|
|
54
|
+
const t = e.target;
|
|
55
|
+
if (!t) return;
|
|
56
|
+
const u = C.current;
|
|
57
|
+
if (u && !u.contains(t) && !(t.closest(".mantine-Modal-root") || t.closest(".floating-text-format-popup") || t.closest('[data-test-id="floating-link-dropdown"]'))) {
|
|
58
58
|
if (i) {
|
|
59
59
|
if (!s) {
|
|
60
|
-
e.stopPropagation(), e.preventDefault(),
|
|
60
|
+
e.stopPropagation(), e.preventDefault(), g({
|
|
61
61
|
title: r("composer.discardTitle"),
|
|
62
62
|
children: r("composer.discardDescription"),
|
|
63
63
|
labels: {
|
|
64
64
|
confirm: r("composer.discardConfirm"),
|
|
65
65
|
cancel: r("composer.cancel")
|
|
66
66
|
},
|
|
67
|
+
confirmProps: {
|
|
68
|
+
color: "var(--mantine-color-indigo-8)"
|
|
69
|
+
},
|
|
67
70
|
icon: null,
|
|
68
71
|
onConfirm: () => c?.()
|
|
69
72
|
});
|
|
@@ -74,7 +77,7 @@ const W = ({
|
|
|
74
77
|
}
|
|
75
78
|
if (f) {
|
|
76
79
|
if (l.text.trim() !== "" || (l.files?.length ?? 0) > 0) {
|
|
77
|
-
e.stopPropagation(), e.preventDefault(),
|
|
80
|
+
e.stopPropagation(), e.preventDefault(), g({
|
|
78
81
|
title: r("editor.composer.discardCommentTitle"),
|
|
79
82
|
children: r("editor.composer.discardCommentDescription"),
|
|
80
83
|
labels: {
|
|
@@ -91,8 +94,8 @@ const W = ({
|
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
};
|
|
94
|
-
return document.addEventListener("mousedown",
|
|
95
|
-
}, [i, f, s, l, c]), /* @__PURE__ */ S("div", { ref: p, children:
|
|
97
|
+
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
98
|
+
}, [i, f, s, l, c]), /* @__PURE__ */ S("div", { ref: p, children: y });
|
|
96
99
|
};
|
|
97
100
|
export {
|
|
98
101
|
W as CommentEditorHandler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/index.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAE,oBAAoB,EAAwB,MAAM,SAAS,CAAC;AA0CrE,eAAO,MAAM,eAAe,GAAI,4EAQ7B,oBAAoB,4CAoctB,CAAC"}
|