@layers-app/shared 0.3.0 → 0.3.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/assets/default-workspace-avatar.jpg.js +4 -0
- package/dist/assets/layers-logo-full.svg.js +2 -3
- package/dist/assets/layers-logo-full.svg2.js +3 -2
- package/dist/assets/layers-logo-icon.svg.js +2 -3
- package/dist/assets/layers-logo-icon.svg2.js +3 -2
- package/dist/assets/projects/figureA.svg.js +4 -0
- package/dist/assets/projects/figureB.svg.js +4 -0
- package/dist/assets/qwebchannel.d.ts +15 -0
- package/dist/assets/qwebchannel.d.ts.map +1 -0
- package/dist/assets/taskPriorities/high.svg.js +5 -0
- package/dist/assets/taskPriorities/low.svg.js +5 -0
- package/dist/assets/taskPriorities/none.svg.js +5 -0
- package/dist/assets/taskPriorities/normal.svg.js +5 -0
- package/dist/assets/taskPriorities/urgent.svg.js +5 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts +3 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.js +69 -0
- package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +27 -0
- package/dist/components/AnimatedFigurePage/types.d.ts +15 -0
- package/dist/components/AnimatedFigurePage/types.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/useParallax.d.ts +6 -0
- package/dist/components/AnimatedFigurePage/useParallax.d.ts.map +1 -0
- package/dist/components/AnimatedFigurePage/useParallax.js +29 -0
- package/dist/components/AppContainer/AppContainer.d.ts +1 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +37 -36
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +80 -45
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +60 -69
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +57 -51
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +3 -1
- package/dist/components/AppContainer/types.d.ts +3 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +9 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +88 -74
- package/dist/components/ColorPicker/ColorPicker.module.css.js +31 -0
- package/dist/components/ColorPicker/ColorPickerList.d.ts +6 -0
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -0
- package/dist/components/ColorPicker/ColorPickerList.js +134 -0
- package/dist/components/ColorPicker/ColorPickerPopover.d.ts +6 -6
- package/dist/components/ColorPicker/ColorPickerPopover.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerPopover.js +29 -31
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +13 -0
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -0
- package/dist/components/ColorPicker/ColorPickerToolbar.js +132 -0
- package/dist/components/ColorPicker/icons.d.ts +11 -0
- package/dist/components/ColorPicker/icons.d.ts.map +1 -0
- package/dist/components/ColorPicker/icons.js +71 -0
- package/dist/components/ColorPicker/types.d.ts +49 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -0
- package/dist/components/ColorPicker/types.js +10 -0
- package/dist/components/ColorPicker/useRecentColors.d.ts +13 -0
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -0
- package/dist/components/ColorPicker/useRecentColors.js +39 -0
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +115 -111
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +12 -10
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +3 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +49 -46
- package/dist/components/EmojiPicker/IconsPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +47 -45
- package/dist/components/EmojiPicker/custom-icons/customIcons.d.ts.map +1 -1
- package/dist/components/EmojiPicker/custom-icons/customIcons.js +66 -31
- package/dist/components/EntityIcon.d.ts +3 -3
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +59 -35
- package/dist/components/EntityTitle/EntityTitle.d.ts +1 -1
- package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
- package/dist/components/EntityTitle/EntityTitle.js +34 -34
- package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +111 -123
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +41 -39
- package/dist/components/FormViewer/components/fields/UploadField/UploadField.d.ts.map +1 -1
- package/dist/components/FormViewer/components/fields/UploadField/UploadField.js +34 -33
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +3 -3
- package/dist/components/Logotype.d.ts +2 -1
- package/dist/components/Logotype.d.ts.map +1 -1
- package/dist/components/Logotype.js +58 -49
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +122 -107
- package/dist/components/NavMenu/types.d.ts +1 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/ProjectIcon/ProjectIcon.js +13 -13
- package/dist/components/TreeIndent/TreeIndent.d.ts +9 -0
- package/dist/components/TreeIndent/TreeIndent.d.ts.map +1 -0
- package/dist/components/TreeIndent/TreeIndent.js +15 -0
- package/dist/components/TreeIndent/TreeIndent.module.css.js +11 -0
- package/dist/components/TreeIndent/index.d.ts +2 -0
- package/dist/components/TreeIndent/index.d.ts.map +1 -0
- package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +11 -11
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +97 -101
- package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
- package/dist/config/brand.d.ts +1 -0
- package/dist/config/brand.d.ts.map +1 -1
- package/dist/config/brand.js +42 -34
- package/dist/config/envConfig.d.ts +40 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +29 -10
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +15 -4
- package/dist/helpers/getFileIcons.d.ts.map +1 -1
- package/dist/helpers/getFileIcons.js +34 -29
- package/dist/helpers/getFileType.d.ts +1 -1
- package/dist/helpers/getFileType.d.ts.map +1 -1
- package/dist/helpers/getFileType.js +3 -3
- package/dist/helpers/hotjar.d.ts.map +1 -1
- package/dist/helpers/hotjar.js +11 -7
- package/dist/helpers/platform.js +4 -4
- package/dist/helpers/showNotifications.d.ts +3 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +79 -44
- package/dist/hooks/useDateFnsLocale.d.ts +2 -0
- package/dist/hooks/useDateFnsLocale.d.ts.map +1 -1
- package/dist/hooks/useDateFnsLocale.js +9 -8
- package/dist/hooks/useDateUtils.d.ts.map +1 -1
- package/dist/hooks/useDateUtils.js +19 -19
- package/dist/hooks/useFormatDistance.d.ts.map +1 -1
- package/dist/hooks/useFormatDistance.js +6 -6
- package/dist/hooks/useNumberQueryParam.d.ts +1 -1
- package/dist/hooks/useNumberQueryParam.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +516 -494
- package/dist/lang/locales/ui_en.json.js +7 -7
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +11 -11
- package/dist/utils/formatStorage.d.ts +9 -0
- package/dist/utils/formatStorage.d.ts.map +1 -1
- package/dist/utils/formatStorage.js +14 -10
- package/package.json +1 -1
|
@@ -1,76 +1,77 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as n, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Z, useRef as v, useMemo as U, useCallback as ee, useEffect as A } from "react";
|
|
3
3
|
import { useTranslation as te } from "react-i18next";
|
|
4
|
-
import { Attachment02Icon as oe, Sent02Icon as
|
|
4
|
+
import { Attachment02Icon as oe, Sent02Icon as re } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as $ } from "@hugeicons/react";
|
|
6
|
-
import { Stack as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import { Stack as ne, Box as se, Group as B, FileButton as ie, ActionIcon as P, UnstyledButton as le, Text as ae, Button as ce, Popover as L } from "@mantine/core";
|
|
7
|
+
import { getMaxUploadSize as de } from "../../config/envConfig.js";
|
|
8
|
+
import { showErrorNotification as W } from "../../helpers/showNotifications.js";
|
|
9
|
+
import { AttachmentsPreview as me } from "../AttachmentsPreview/AttachmentsPreview.js";
|
|
10
|
+
import { CommentEditorHandler as fe } from "./CommentEditorHotkeys.js";
|
|
11
|
+
import { useVirtualAnchor as ue } from "./useVirtualAnchor.js";
|
|
12
|
+
import y from "./CommentComposer.module.css.js";
|
|
13
|
+
function j(r) {
|
|
14
|
+
return "id" in r;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
return typeof
|
|
16
|
+
function pe(r) {
|
|
17
|
+
return typeof r == "object" && "isTemp" in r;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
19
|
+
function he(r) {
|
|
20
|
+
const c = URL.createObjectURL(r);
|
|
20
21
|
return {
|
|
21
22
|
id: `temp-${crypto.randomUUID()}`,
|
|
22
|
-
name:
|
|
23
|
-
type:
|
|
24
|
-
size:
|
|
25
|
-
url:
|
|
26
|
-
src:
|
|
27
|
-
isImage:
|
|
23
|
+
name: r.name,
|
|
24
|
+
type: r.type,
|
|
25
|
+
size: r.size,
|
|
26
|
+
url: c,
|
|
27
|
+
src: c,
|
|
28
|
+
isImage: r.type.startsWith("image/"),
|
|
28
29
|
isTemp: !0,
|
|
29
|
-
raw:
|
|
30
|
+
raw: r
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
const
|
|
33
|
-
function
|
|
34
|
-
return
|
|
33
|
+
const M = () => de() ?? 5 * 1024 * 1024, ge = 10;
|
|
34
|
+
function xe(r, c) {
|
|
35
|
+
return r(`composer.${c}`, { defaultValue: "" }) || r(`editor.composer.${c}`);
|
|
35
36
|
}
|
|
36
|
-
const
|
|
37
|
-
children:
|
|
38
|
-
onSubmit:
|
|
37
|
+
const Ne = ({
|
|
38
|
+
children: r,
|
|
39
|
+
onSubmit: c,
|
|
39
40
|
initialDraft: d,
|
|
40
|
-
updateLocation:
|
|
41
|
+
updateLocation: N,
|
|
41
42
|
onBlur: k,
|
|
42
|
-
setEdit:
|
|
43
|
-
ns:
|
|
43
|
+
setEdit: R,
|
|
44
|
+
ns: S = "comments"
|
|
44
45
|
}) => {
|
|
45
|
-
const [m,
|
|
46
|
+
const [m, _] = Z({
|
|
46
47
|
text: d?.text ?? "",
|
|
47
48
|
files: d?.files ?? []
|
|
48
|
-
}), { t:
|
|
49
|
+
}), { t: h } = te(S), G = h(S === "comments" ? "composer.placeholder" : "editor.composer.placeholder"), g = v(null), f = typeof d?.text < "u", a = {
|
|
49
50
|
text: m.text,
|
|
50
51
|
files: m.files
|
|
51
|
-
}, X = v(null), p = v(null), Y =
|
|
52
|
+
}, X = v(null), p = v(null), Y = U(
|
|
52
53
|
() => ({
|
|
53
54
|
container: document.createElement("div"),
|
|
54
55
|
elements: []
|
|
55
56
|
}),
|
|
56
57
|
[]
|
|
57
|
-
),
|
|
58
|
+
), V = v(null), u = !!N, q = ue({
|
|
58
59
|
isFloat: u,
|
|
59
|
-
updateLocation:
|
|
60
|
-
selectionRef:
|
|
60
|
+
updateLocation: N,
|
|
61
|
+
selectionRef: V,
|
|
61
62
|
selectionState: Y
|
|
62
|
-
}),
|
|
63
|
+
}), I = 10 * 30 * 0.7, b = ee(() => {
|
|
63
64
|
if (!p.current) return;
|
|
64
65
|
const e = p.current, t = e.querySelector(
|
|
65
66
|
'[class*="editorWrapper"]'
|
|
66
|
-
), s = t?.scrollHeight || 0, o = s >
|
|
67
|
+
), s = t?.scrollHeight || 0, o = s > I, l = s > 35, i = e.closest(
|
|
67
68
|
'[class*="commentComposerFloat"]'
|
|
68
69
|
) || e;
|
|
69
|
-
u && l ? i.setAttribute("data-multiline", "true") : i.removeAttribute("data-multiline"), o && t ? (t.style.maxHeight = `${
|
|
70
|
-
}, [p, u,
|
|
71
|
-
|
|
70
|
+
u && l ? i.setAttribute("data-multiline", "true") : i.removeAttribute("data-multiline"), o && t ? (t.style.maxHeight = `${I}px`, t.style.overflowY = "auto", t.style.scrollbarWidth = "thin", i.setAttribute("data-editor-constrained", "true")) : t && (t.style.maxHeight = "", t.style.overflowY = "", t.style.scrollbarWidth = "", i.removeAttribute("data-editor-constrained"));
|
|
71
|
+
}, [p, u, I]);
|
|
72
|
+
A(() => {
|
|
72
73
|
b();
|
|
73
|
-
}, [b]),
|
|
74
|
+
}, [b]), A(() => {
|
|
74
75
|
if (!p.current) return;
|
|
75
76
|
const e = new ResizeObserver(() => {
|
|
76
77
|
b();
|
|
@@ -78,7 +79,7 @@ const _e = ({
|
|
|
78
79
|
return e.observe(p.current), () => {
|
|
79
80
|
e.disconnect();
|
|
80
81
|
};
|
|
81
|
-
}, [b]),
|
|
82
|
+
}, [b]), A(() => {
|
|
82
83
|
const e = document.querySelector("main");
|
|
83
84
|
if (e && u) {
|
|
84
85
|
const t = e.style.overflow;
|
|
@@ -87,26 +88,26 @@ const _e = ({
|
|
|
87
88
|
};
|
|
88
89
|
}
|
|
89
90
|
}, [u]);
|
|
90
|
-
const { textChanged:
|
|
91
|
-
const e = d?.files || [], t = m.files, s = d?.text !==
|
|
91
|
+
const { textChanged: J, newFiles: K, deletedFiles: D, hasChanges: F } = U(() => {
|
|
92
|
+
const e = d?.files || [], t = m.files, s = d?.text !== a.text, o = t.filter((i) => i.isTemp), x = new Set(
|
|
92
93
|
t.filter(
|
|
93
|
-
(i) =>
|
|
94
|
+
(i) => j(i)
|
|
94
95
|
).map((i) => i.id)
|
|
95
|
-
), l = e.filter(
|
|
96
|
+
), l = e.filter(j).filter((i) => !x.has(i.id)), E = f ? JSON.stringify(d) === JSON.stringify(m) : a.text.trim().length > 0 || o.length > 0 || l.length > 0;
|
|
96
97
|
return {
|
|
97
98
|
textChanged: s,
|
|
98
99
|
newFiles: o,
|
|
99
100
|
deletedFiles: l,
|
|
100
101
|
hasChanges: E
|
|
101
102
|
};
|
|
102
|
-
}, [f, d, m,
|
|
103
|
-
|
|
103
|
+
}, [f, d, m, a.text]), H = () => {
|
|
104
|
+
R ? R({
|
|
104
105
|
id: "",
|
|
105
106
|
text: "",
|
|
106
107
|
files: []
|
|
107
108
|
}) : k?.();
|
|
108
109
|
}, T = (e, t = !1) => {
|
|
109
|
-
|
|
110
|
+
_((s) => {
|
|
110
111
|
if (t)
|
|
111
112
|
return { text: "", files: [] };
|
|
112
113
|
const o = typeof e == "function" ? e(s) : e;
|
|
@@ -115,98 +116,101 @@ const _e = ({
|
|
|
115
116
|
files: o.files
|
|
116
117
|
};
|
|
117
118
|
});
|
|
118
|
-
},
|
|
119
|
+
}, Q = (e, t) => {
|
|
119
120
|
e && t((s) => {
|
|
120
|
-
const o = s.files,
|
|
121
|
-
e.forEach((
|
|
122
|
-
|
|
123
|
-
}), E.length > 0 &&
|
|
124
|
-
message:
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
const o = s.files, x = ge - o.length, l = [], E = [];
|
|
122
|
+
e.forEach((z) => {
|
|
123
|
+
z.size > M() ? E.push(z) : l.push(z);
|
|
124
|
+
}), E.length > 0 && W({
|
|
125
|
+
message: h("composer.uploadErrors.fileTooLarge", {
|
|
126
|
+
defaultValue: h("editor.composer.uploadErrors.fileTooLarge", { maxSize: Math.round(M() / (1024 * 1024)) }),
|
|
127
|
+
maxSize: Math.round(M() / (1024 * 1024))
|
|
128
|
+
})
|
|
129
|
+
}), l.length > x && W({
|
|
130
|
+
message: xe(h, "uploadErrors.tooManyFiles")
|
|
127
131
|
});
|
|
128
|
-
const i = l.slice(0,
|
|
132
|
+
const i = l.slice(0, x);
|
|
129
133
|
return {
|
|
130
134
|
...s,
|
|
131
|
-
files: [...o, ...i.map(
|
|
135
|
+
files: [...o, ...i.map(he)]
|
|
132
136
|
};
|
|
133
137
|
});
|
|
134
138
|
}, w = async () => {
|
|
135
139
|
try {
|
|
136
|
-
f ? await
|
|
140
|
+
f ? await c({
|
|
137
141
|
mode: "edit",
|
|
138
142
|
data: {
|
|
139
|
-
textChanged:
|
|
140
|
-
newFiles:
|
|
141
|
-
deletedFiles:
|
|
142
|
-
newText:
|
|
143
|
+
textChanged: J,
|
|
144
|
+
newFiles: K,
|
|
145
|
+
deletedFiles: D,
|
|
146
|
+
newText: a.text
|
|
143
147
|
}
|
|
144
|
-
}) : await
|
|
148
|
+
}) : await c({
|
|
145
149
|
mode: "create",
|
|
146
150
|
data: {
|
|
147
|
-
text:
|
|
148
|
-
files: m.files.filter(
|
|
151
|
+
text: a.text,
|
|
152
|
+
files: m.files.filter(pe)
|
|
149
153
|
}
|
|
150
154
|
});
|
|
151
155
|
} catch {
|
|
152
156
|
return;
|
|
153
157
|
}
|
|
154
|
-
H(),
|
|
155
|
-
const e =
|
|
158
|
+
H(), g.current && g.current.update(() => {
|
|
159
|
+
const e = g.current._editorState._nodeMap.get("root");
|
|
156
160
|
if (!e) return;
|
|
157
161
|
e.clear();
|
|
158
|
-
const t =
|
|
162
|
+
const t = g.current._nodes.get("paragraph");
|
|
159
163
|
if (!t) return;
|
|
160
164
|
const s = new t.klass();
|
|
161
165
|
e.append(s), s.select();
|
|
162
166
|
}), T({ text: "", files: [] }, !0);
|
|
163
|
-
},
|
|
164
|
-
|
|
167
|
+
}, O = /* @__PURE__ */ n(
|
|
168
|
+
ne,
|
|
165
169
|
{
|
|
166
170
|
ref: p,
|
|
167
171
|
className: `
|
|
168
|
-
${
|
|
169
|
-
${f ?
|
|
170
|
-
${u ?
|
|
172
|
+
${y.commentComposerWrapper}
|
|
173
|
+
${f ? y.editMode : ""}
|
|
174
|
+
${u ? y.commentComposerFloat : ""}
|
|
171
175
|
`,
|
|
172
176
|
children: /* @__PURE__ */ C(
|
|
173
177
|
"div",
|
|
174
178
|
{
|
|
175
|
-
className:
|
|
179
|
+
className: y.composerContainer,
|
|
176
180
|
style: {
|
|
177
181
|
"--placeholder-text": `"${G}"`
|
|
178
182
|
},
|
|
179
183
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
|
|
184
|
+
/* @__PURE__ */ n("div", { className: y.editorWrapper, children: /* @__PURE__ */ n(
|
|
185
|
+
fe,
|
|
182
186
|
{
|
|
183
187
|
onSubmit: w,
|
|
184
|
-
editorRef:
|
|
188
|
+
editorRef: g,
|
|
185
189
|
inputContainerRef: p,
|
|
186
|
-
commentDraft:
|
|
190
|
+
commentDraft: a,
|
|
187
191
|
onBlur: H,
|
|
188
192
|
isEdit: f,
|
|
189
193
|
isFloat: u,
|
|
190
194
|
hasChanges: F,
|
|
191
|
-
ns:
|
|
192
|
-
children:
|
|
195
|
+
ns: S,
|
|
196
|
+
children: r?.({
|
|
193
197
|
onSubmit: w,
|
|
194
198
|
handleBlur: () => {
|
|
195
199
|
},
|
|
196
200
|
setCommentDraft: T,
|
|
197
|
-
commentDraft:
|
|
198
|
-
editorRef:
|
|
201
|
+
commentDraft: a,
|
|
202
|
+
editorRef: g,
|
|
199
203
|
initialContent: d?.text ?? ""
|
|
200
204
|
})
|
|
201
205
|
}
|
|
202
206
|
) }),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
|
|
207
|
+
/* @__PURE__ */ n(se, { h: 10, "data-editor-spacer": !0, tabIndex: 0, style: { width: "100%" } }),
|
|
208
|
+
/* @__PURE__ */ n(
|
|
209
|
+
me,
|
|
206
210
|
{
|
|
207
211
|
files: m.files,
|
|
208
212
|
mode: "draft",
|
|
209
|
-
onRemove: (e) =>
|
|
213
|
+
onRemove: (e) => _((t) => ({
|
|
210
214
|
...t,
|
|
211
215
|
files: t.files.filter((s, o) => o !== e)
|
|
212
216
|
}))
|
|
@@ -223,12 +227,12 @@ const _e = ({
|
|
|
223
227
|
tabIndex: 0,
|
|
224
228
|
gap: "4px",
|
|
225
229
|
children: [
|
|
226
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ n(
|
|
227
231
|
ie,
|
|
228
232
|
{
|
|
229
|
-
onChange: (e) =>
|
|
233
|
+
onChange: (e) => Q(e, T),
|
|
230
234
|
multiple: !0,
|
|
231
|
-
children: (e) => /* @__PURE__ */
|
|
235
|
+
children: (e) => /* @__PURE__ */ n(P, { ...e, variant: "subtle", size: "lg", color: "gray", children: /* @__PURE__ */ n(
|
|
232
236
|
$,
|
|
233
237
|
{
|
|
234
238
|
style: { transform: "rotate(35deg)" },
|
|
@@ -239,7 +243,7 @@ const _e = ({
|
|
|
239
243
|
}
|
|
240
244
|
),
|
|
241
245
|
f ? /* @__PURE__ */ C(B, { gap: "8px", children: [
|
|
242
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ n(
|
|
243
247
|
le,
|
|
244
248
|
{
|
|
245
249
|
onClick: H,
|
|
@@ -251,29 +255,29 @@ const _e = ({
|
|
|
251
255
|
background: "none",
|
|
252
256
|
border: "none"
|
|
253
257
|
},
|
|
254
|
-
children: /* @__PURE__ */
|
|
258
|
+
children: /* @__PURE__ */ n(ae, { size: "sm", c: "dimmed", children: h("composer.cancel") })
|
|
255
259
|
}
|
|
256
260
|
),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
|
|
261
|
+
/* @__PURE__ */ n(
|
|
262
|
+
ce,
|
|
259
263
|
{
|
|
260
264
|
size: "xs",
|
|
261
265
|
radius: "md",
|
|
262
266
|
onClick: w,
|
|
263
267
|
disabled: f ? F : !F,
|
|
264
|
-
children:
|
|
268
|
+
children: h("composer.save")
|
|
265
269
|
}
|
|
266
270
|
)
|
|
267
|
-
] }) : /* @__PURE__ */
|
|
268
|
-
|
|
271
|
+
] }) : /* @__PURE__ */ n(
|
|
272
|
+
P,
|
|
269
273
|
{
|
|
270
274
|
color: "var(--mantine-primary-color-filled)",
|
|
271
275
|
size: "lg",
|
|
272
276
|
"data-comment-submit-button": !0,
|
|
273
277
|
variant: "filled",
|
|
274
278
|
onClick: w,
|
|
275
|
-
disabled: !
|
|
276
|
-
children: /* @__PURE__ */
|
|
279
|
+
disabled: !a.text.trim() && a.files.length === 0,
|
|
280
|
+
children: /* @__PURE__ */ n($, { icon: re, size: 20 })
|
|
277
281
|
}
|
|
278
282
|
)
|
|
279
283
|
]
|
|
@@ -285,7 +289,7 @@ const _e = ({
|
|
|
285
289
|
}
|
|
286
290
|
);
|
|
287
291
|
return u ? /* @__PURE__ */ C(
|
|
288
|
-
|
|
292
|
+
L,
|
|
289
293
|
{
|
|
290
294
|
opened: !0,
|
|
291
295
|
position: "bottom-start",
|
|
@@ -318,10 +322,10 @@ const _e = ({
|
|
|
318
322
|
}
|
|
319
323
|
},
|
|
320
324
|
children: [
|
|
321
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ n(L.Target, { children: /* @__PURE__ */ n(
|
|
322
326
|
"div",
|
|
323
327
|
{
|
|
324
|
-
ref:
|
|
328
|
+
ref: q,
|
|
325
329
|
style: {
|
|
326
330
|
position: "fixed",
|
|
327
331
|
width: "5px",
|
|
@@ -333,18 +337,18 @@ const _e = ({
|
|
|
333
337
|
}
|
|
334
338
|
}
|
|
335
339
|
) }),
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
|
|
340
|
+
/* @__PURE__ */ n(
|
|
341
|
+
L.Dropdown,
|
|
338
342
|
{
|
|
339
343
|
ref: X,
|
|
340
|
-
className:
|
|
341
|
-
children:
|
|
344
|
+
className: y.commentComposerFloat,
|
|
345
|
+
children: O
|
|
342
346
|
}
|
|
343
347
|
)
|
|
344
348
|
]
|
|
345
349
|
}
|
|
346
|
-
) :
|
|
350
|
+
) : O;
|
|
347
351
|
};
|
|
348
352
|
export {
|
|
349
|
-
|
|
353
|
+
Ne as CommentComposer
|
|
350
354
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmojiPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPanel.tsx"],"names":[],"mappings":"AAyCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAsBjD,eAAO,MAAM,UAAU,GAAI,6DAMxB,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG;IAC5E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,
|
|
1
|
+
{"version":3,"file":"EmojiPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPanel.tsx"],"names":[],"mappings":"AAyCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAsBjD,eAAO,MAAM,UAAU,GAAI,6DAMxB,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG;IAC5E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,4CAmTA,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { useState as u, useRef as d, useEffect as R, useCallback as K } from "re
|
|
|
3
3
|
import { useTranslation as L } from "react-i18next";
|
|
4
4
|
import { Search01Icon as U, ShuffleIcon as V, Clock01Icon as W, SmileIcon as X, Pizza01Icon as Z, FootballIcon as _, Airplane01Icon as ee, BulbIcon as te, Asterisk02Icon as oe, Flag02Icon as re } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as c } from "@hugeicons/react";
|
|
6
|
-
import { Stack as v, FocusTrap as ne, Flex as
|
|
6
|
+
import { Stack as v, FocusTrap as ne, Flex as z, TextInput as ie, Tooltip as ce, ActionIcon as A, Paper as F, Text as q, SimpleGrid as N } from "@mantine/core";
|
|
7
7
|
import { useEvent as se } from "draggable-ui";
|
|
8
8
|
import ae from "fuse.js";
|
|
9
9
|
import le from "../../assets/svg/dog.svg.js";
|
|
@@ -33,7 +33,7 @@ const he = [
|
|
|
33
33
|
setRandomIcon: P,
|
|
34
34
|
querySearch: p
|
|
35
35
|
}) => {
|
|
36
|
-
const [b, k] = u("frequent"),
|
|
36
|
+
const [b, k] = u("frequent"), x = d("frequent"), h = d({}), I = d(null), [w, S] = u(""), [Q, O] = u([]), [a, B] = u(null), [E, j] = u([]), { t: G } = L(), g = d(!1), l = d(null);
|
|
37
37
|
R(() => {
|
|
38
38
|
if (typeof p == "string") {
|
|
39
39
|
const e = p.slice(1);
|
|
@@ -88,20 +88,20 @@ const he = [
|
|
|
88
88
|
})
|
|
89
89
|
), M());
|
|
90
90
|
}), Y = (e) => {
|
|
91
|
-
const o =
|
|
91
|
+
const o = I.current, r = h.current[e.i];
|
|
92
92
|
if (!o || !r) return;
|
|
93
93
|
g.current = !0, l.current = e.i, k(e.i);
|
|
94
94
|
const s = r.offsetTop - o.offsetTop;
|
|
95
95
|
o.scrollTo({ top: s, behavior: "smooth" });
|
|
96
96
|
}, $ = () => {
|
|
97
|
-
const e =
|
|
97
|
+
const e = I.current;
|
|
98
98
|
if (!e) return;
|
|
99
99
|
const o = e.scrollTop;
|
|
100
100
|
if (g.current && l.current) {
|
|
101
101
|
const f = h.current[l.current];
|
|
102
102
|
if (f) {
|
|
103
103
|
const i = f.offsetTop - e.offsetTop;
|
|
104
|
-
Math.abs(i - o) < 12 && (g.current = !1,
|
|
104
|
+
Math.abs(i - o) < 12 && (g.current = !1, x.current = l.current, k(l.current), l.current = null);
|
|
105
105
|
}
|
|
106
106
|
if (g.current) return;
|
|
107
107
|
}
|
|
@@ -111,11 +111,11 @@ const he = [
|
|
|
111
111
|
const n = Math.abs(i.offsetTop - e.offsetTop - o);
|
|
112
112
|
n < s && (s = n, r = f);
|
|
113
113
|
}
|
|
114
|
-
}), r !==
|
|
114
|
+
}), r !== x.current && (x.current = r, k(r));
|
|
115
115
|
}, J = typeof p == "string";
|
|
116
116
|
return /* @__PURE__ */ y(v, { gap: 0, h: "100%", children: [
|
|
117
117
|
/* @__PURE__ */ t(ne, { active: !0, children: /* @__PURE__ */ y(
|
|
118
|
-
|
|
118
|
+
z,
|
|
119
119
|
{
|
|
120
120
|
my: "sm",
|
|
121
121
|
justify: "space-between",
|
|
@@ -173,13 +173,14 @@ const he = [
|
|
|
173
173
|
style: {
|
|
174
174
|
overflowY: "auto"
|
|
175
175
|
},
|
|
176
|
-
ref:
|
|
176
|
+
ref: I,
|
|
177
177
|
onScroll: $,
|
|
178
178
|
children: w ? /* @__PURE__ */ y(v, { flex: 1, align: "stretch", children: [
|
|
179
179
|
!J && /* @__PURE__ */ t(
|
|
180
180
|
F,
|
|
181
181
|
{
|
|
182
182
|
py: 6,
|
|
183
|
+
px: 6,
|
|
183
184
|
pos: "sticky",
|
|
184
185
|
top: -1,
|
|
185
186
|
style: { zIndex: 1 },
|
|
@@ -196,7 +197,7 @@ const he = [
|
|
|
196
197
|
children: e
|
|
197
198
|
},
|
|
198
199
|
e
|
|
199
|
-
)) }) : /* @__PURE__ */ t(
|
|
200
|
+
)) }) : /* @__PURE__ */ t(z, { flex: 1, justify: "center", align: "stretch", children: /* @__PURE__ */ t(
|
|
200
201
|
ue,
|
|
201
202
|
{
|
|
202
203
|
size: 100,
|
|
@@ -218,6 +219,7 @@ const he = [
|
|
|
218
219
|
{
|
|
219
220
|
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-6))",
|
|
220
221
|
py: 2,
|
|
222
|
+
px: 6,
|
|
221
223
|
pos: "sticky",
|
|
222
224
|
top: -1,
|
|
223
225
|
h: 23,
|
|
@@ -242,7 +244,7 @@ const he = [
|
|
|
242
244
|
}
|
|
243
245
|
) }),
|
|
244
246
|
/* @__PURE__ */ t(
|
|
245
|
-
|
|
247
|
+
z,
|
|
246
248
|
{
|
|
247
249
|
style: {
|
|
248
250
|
borderTop: "1px solid var(--tab-border-color)"
|
|
@@ -20,6 +20,8 @@ export type EmojiPickerProps = {
|
|
|
20
20
|
triggerRegex?: RegExp;
|
|
21
21
|
/** Monotonically increasing counter updated by the parent on each keypress; used to detect real-time typing. */
|
|
22
22
|
typingSeq?: number;
|
|
23
|
+
/** If true, clicking the random icon button will not close the popover. Default: false */
|
|
24
|
+
keepOpenOnRandom?: boolean;
|
|
23
25
|
};
|
|
24
26
|
export type EmojiPickerLocales = {
|
|
25
27
|
emojis?: string;
|
|
@@ -31,5 +33,5 @@ export type EmojiPickerLocales = {
|
|
|
31
33
|
icons?: string;
|
|
32
34
|
emojiCategory?: Record<string, string>;
|
|
33
35
|
};
|
|
34
|
-
export declare const EmojiPicker: ({ project, value, querySearch, children, onChange, position, popoverProps, showIcons, showColors, defaultActiveTab, showEmojis, withinPortal, locales: _locales, openWhen, triggerRegex, typingSeq, showRemoveButton, }: PropsWithChildren<EmojiPickerProps>) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
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;
|
|
35
37
|
//# sourceMappingURL=EmojiPicker.d.ts.map
|
|
@@ -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;IAClI,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAChC,2GAA2G;IAC3G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gHAAgH;IAChH,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
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;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,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,4CAgNrC,CAAC"}
|