@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.
Files changed (142) hide show
  1. package/dist/assets/default-workspace-avatar.jpg.js +4 -0
  2. package/dist/assets/layers-logo-full.svg.js +2 -3
  3. package/dist/assets/layers-logo-full.svg2.js +3 -2
  4. package/dist/assets/layers-logo-icon.svg.js +2 -3
  5. package/dist/assets/layers-logo-icon.svg2.js +3 -2
  6. package/dist/assets/projects/figureA.svg.js +4 -0
  7. package/dist/assets/projects/figureB.svg.js +4 -0
  8. package/dist/assets/qwebchannel.d.ts +15 -0
  9. package/dist/assets/qwebchannel.d.ts.map +1 -0
  10. package/dist/assets/taskPriorities/high.svg.js +5 -0
  11. package/dist/assets/taskPriorities/low.svg.js +5 -0
  12. package/dist/assets/taskPriorities/none.svg.js +5 -0
  13. package/dist/assets/taskPriorities/normal.svg.js +5 -0
  14. package/dist/assets/taskPriorities/urgent.svg.js +5 -0
  15. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts +3 -0
  16. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.d.ts.map +1 -0
  17. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.js +69 -0
  18. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +27 -0
  19. package/dist/components/AnimatedFigurePage/types.d.ts +15 -0
  20. package/dist/components/AnimatedFigurePage/types.d.ts.map +1 -0
  21. package/dist/components/AnimatedFigurePage/useParallax.d.ts +6 -0
  22. package/dist/components/AnimatedFigurePage/useParallax.d.ts.map +1 -0
  23. package/dist/components/AnimatedFigurePage/useParallax.js +29 -0
  24. package/dist/components/AppContainer/AppContainer.d.ts +1 -1
  25. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  26. package/dist/components/AppContainer/AppContainer.js +37 -36
  27. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  28. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +80 -45
  29. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
  30. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +60 -69
  31. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  32. package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
  33. package/dist/components/AppContainer/hooks/useAppContainer.js +57 -51
  34. package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
  35. package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +3 -1
  36. package/dist/components/AppContainer/types.d.ts +3 -0
  37. package/dist/components/AppContainer/types.d.ts.map +1 -1
  38. package/dist/components/ColorPicker/ColorPicker.d.ts +9 -1
  39. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  40. package/dist/components/ColorPicker/ColorPicker.js +88 -74
  41. package/dist/components/ColorPicker/ColorPicker.module.css.js +31 -0
  42. package/dist/components/ColorPicker/ColorPickerList.d.ts +6 -0
  43. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -0
  44. package/dist/components/ColorPicker/ColorPickerList.js +134 -0
  45. package/dist/components/ColorPicker/ColorPickerPopover.d.ts +6 -6
  46. package/dist/components/ColorPicker/ColorPickerPopover.d.ts.map +1 -1
  47. package/dist/components/ColorPicker/ColorPickerPopover.js +29 -31
  48. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +13 -0
  49. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -0
  50. package/dist/components/ColorPicker/ColorPickerToolbar.js +132 -0
  51. package/dist/components/ColorPicker/icons.d.ts +11 -0
  52. package/dist/components/ColorPicker/icons.d.ts.map +1 -0
  53. package/dist/components/ColorPicker/icons.js +71 -0
  54. package/dist/components/ColorPicker/types.d.ts +49 -0
  55. package/dist/components/ColorPicker/types.d.ts.map +1 -0
  56. package/dist/components/ColorPicker/types.js +10 -0
  57. package/dist/components/ColorPicker/useRecentColors.d.ts +13 -0
  58. package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -0
  59. package/dist/components/ColorPicker/useRecentColors.js +39 -0
  60. package/dist/components/CommentComposer/index.d.ts.map +1 -1
  61. package/dist/components/CommentComposer/index.js +115 -111
  62. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  63. package/dist/components/EmojiPicker/EmojiPanel.js +12 -10
  64. package/dist/components/EmojiPicker/EmojiPicker.d.ts +3 -1
  65. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  66. package/dist/components/EmojiPicker/EmojiPicker.js +49 -46
  67. package/dist/components/EmojiPicker/IconsPanel.d.ts +2 -1
  68. package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
  69. package/dist/components/EmojiPicker/IconsPanel.js +47 -45
  70. package/dist/components/EmojiPicker/custom-icons/customIcons.d.ts.map +1 -1
  71. package/dist/components/EmojiPicker/custom-icons/customIcons.js +66 -31
  72. package/dist/components/EntityIcon.d.ts +3 -3
  73. package/dist/components/EntityIcon.d.ts.map +1 -1
  74. package/dist/components/EntityIcon.js +59 -35
  75. package/dist/components/EntityTitle/EntityTitle.d.ts +1 -1
  76. package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
  77. package/dist/components/EntityTitle/EntityTitle.js +34 -34
  78. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  79. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  80. package/dist/components/FilePicker/FilePicker.js +111 -123
  81. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  82. package/dist/components/FilePicker/FilePickerUpload.js +41 -39
  83. package/dist/components/FormViewer/components/fields/UploadField/UploadField.d.ts.map +1 -1
  84. package/dist/components/FormViewer/components/fields/UploadField/UploadField.js +34 -33
  85. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +3 -3
  86. package/dist/components/Logotype.d.ts +2 -1
  87. package/dist/components/Logotype.d.ts.map +1 -1
  88. package/dist/components/Logotype.js +58 -49
  89. package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
  90. package/dist/components/NavMenu/components/NavMenuItem.js +122 -107
  91. package/dist/components/NavMenu/types.d.ts +1 -0
  92. package/dist/components/NavMenu/types.d.ts.map +1 -1
  93. package/dist/components/ProjectIcon/ProjectIcon.js +13 -13
  94. package/dist/components/TreeIndent/TreeIndent.d.ts +9 -0
  95. package/dist/components/TreeIndent/TreeIndent.d.ts.map +1 -0
  96. package/dist/components/TreeIndent/TreeIndent.js +15 -0
  97. package/dist/components/TreeIndent/TreeIndent.module.css.js +11 -0
  98. package/dist/components/TreeIndent/index.d.ts +2 -0
  99. package/dist/components/TreeIndent/index.d.ts.map +1 -0
  100. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +11 -11
  101. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
  102. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +97 -101
  103. package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
  104. package/dist/config/brand.d.ts +1 -0
  105. package/dist/config/brand.d.ts.map +1 -1
  106. package/dist/config/brand.js +42 -34
  107. package/dist/config/envConfig.d.ts +40 -0
  108. package/dist/config/envConfig.d.ts.map +1 -1
  109. package/dist/config/envConfig.js +29 -10
  110. package/dist/constants.d.ts.map +1 -1
  111. package/dist/constants.js +15 -4
  112. package/dist/helpers/getFileIcons.d.ts.map +1 -1
  113. package/dist/helpers/getFileIcons.js +34 -29
  114. package/dist/helpers/getFileType.d.ts +1 -1
  115. package/dist/helpers/getFileType.d.ts.map +1 -1
  116. package/dist/helpers/getFileType.js +3 -3
  117. package/dist/helpers/hotjar.d.ts.map +1 -1
  118. package/dist/helpers/hotjar.js +11 -7
  119. package/dist/helpers/platform.js +4 -4
  120. package/dist/helpers/showNotifications.d.ts +3 -0
  121. package/dist/helpers/showNotifications.d.ts.map +1 -1
  122. package/dist/helpers/showNotifications.js +79 -44
  123. package/dist/hooks/useDateFnsLocale.d.ts +2 -0
  124. package/dist/hooks/useDateFnsLocale.d.ts.map +1 -1
  125. package/dist/hooks/useDateFnsLocale.js +9 -8
  126. package/dist/hooks/useDateUtils.d.ts.map +1 -1
  127. package/dist/hooks/useDateUtils.js +19 -19
  128. package/dist/hooks/useFormatDistance.d.ts.map +1 -1
  129. package/dist/hooks/useFormatDistance.js +6 -6
  130. package/dist/hooks/useNumberQueryParam.d.ts +1 -1
  131. package/dist/hooks/useNumberQueryParam.d.ts.map +1 -1
  132. package/dist/index.css +1 -1
  133. package/dist/index.d.ts +8 -0
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +516 -494
  136. package/dist/lang/locales/ui_en.json.js +7 -7
  137. package/dist/lang/locales/ui_es.json.js +1 -1
  138. package/dist/lang/locales/ui_ru.json.js +11 -11
  139. package/dist/utils/formatStorage.d.ts +9 -0
  140. package/dist/utils/formatStorage.d.ts.map +1 -1
  141. package/dist/utils/formatStorage.js +14 -10
  142. package/package.json +1 -1
@@ -1,76 +1,77 @@
1
- import { jsx as r, jsxs as C } from "react/jsx-runtime";
2
- import { useState as Q, useRef as v, useMemo as O, useCallback as ee, useEffect as L } from "react";
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 ne } from "@hugeicons/core-free-icons";
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 re, Box as se, Group as B, FileButton as ie, ActionIcon as U, UnstyledButton as le, Text as ce, Button as ae, Popover as _ } from "@mantine/core";
7
- import { showErrorNotification as P } from "../../helpers/showNotifications.js";
8
- import { AttachmentsPreview as de } from "../AttachmentsPreview/AttachmentsPreview.js";
9
- import { CommentEditorHandler as me } from "./CommentEditorHotkeys.js";
10
- import { useVirtualAnchor as fe } from "./useVirtualAnchor.js";
11
- import x from "./CommentComposer.module.css.js";
12
- function W(n) {
13
- return "id" in n;
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 ue(n) {
16
- return typeof n == "object" && "isTemp" in n;
16
+ function pe(r) {
17
+ return typeof r == "object" && "isTemp" in r;
17
18
  }
18
- function pe(n) {
19
- const a = URL.createObjectURL(n);
19
+ function he(r) {
20
+ const c = URL.createObjectURL(r);
20
21
  return {
21
22
  id: `temp-${crypto.randomUUID()}`,
22
- name: n.name,
23
- type: n.type,
24
- size: n.size,
25
- url: a,
26
- src: a,
27
- isImage: n.type.startsWith("image/"),
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: n
30
+ raw: r
30
31
  };
31
32
  }
32
- const he = 5 * 1024 * 1024, ge = 10;
33
- function j(n, a) {
34
- return n(`composer.${a}`, { defaultValue: "" }) || n(`editor.composer.${a}`);
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 _e = ({
37
- children: n,
38
- onSubmit: a,
37
+ const Ne = ({
38
+ children: r,
39
+ onSubmit: c,
39
40
  initialDraft: d,
40
- updateLocation: z,
41
+ updateLocation: N,
41
42
  onBlur: k,
42
- setEdit: N,
43
- ns: I = "comments"
43
+ setEdit: R,
44
+ ns: S = "comments"
44
45
  }) => {
45
- const [m, R] = Q({
46
+ const [m, _] = Z({
46
47
  text: d?.text ?? "",
47
48
  files: d?.files ?? []
48
- }), { t: y } = te(I), G = y(I === "comments" ? "composer.placeholder" : "editor.composer.placeholder"), h = v(null), f = typeof d?.text < "u", c = {
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 = O(
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
- ), q = v(null), u = !!z, J = fe({
58
+ ), V = v(null), u = !!N, q = ue({
58
59
  isFloat: u,
59
- updateLocation: z,
60
- selectionRef: q,
60
+ updateLocation: N,
61
+ selectionRef: V,
61
62
  selectionState: Y
62
- }), S = 10 * 30 * 0.7, b = ee(() => {
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 > S, l = s > 35, i = e.closest(
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 = `${S}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"));
70
- }, [p, u, S]);
71
- L(() => {
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]), L(() => {
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]), L(() => {
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: K, newFiles: V, deletedFiles: Z, hasChanges: F } = O(() => {
91
- const e = d?.files || [], t = m.files, s = d?.text !== c.text, o = t.filter((i) => i.isTemp), g = new Set(
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) => W(i)
94
+ (i) => j(i)
94
95
  ).map((i) => i.id)
95
- ), l = e.filter(W).filter((i) => !g.has(i.id)), E = f ? JSON.stringify(d) === JSON.stringify(m) : c.text.trim().length > 0 || o.length > 0 || l.length > 0;
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, c.text]), H = () => {
103
- N ? N({
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
- R((s) => {
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
- }, D = (e, t) => {
119
+ }, Q = (e, t) => {
119
120
  e && t((s) => {
120
- const o = s.files, g = ge - o.length, l = [], E = [];
121
- e.forEach((A) => {
122
- A.size > he ? E.push(A) : l.push(A);
123
- }), E.length > 0 && P({
124
- message: j(y, "uploadErrors.fileTooLarge")
125
- }), l.length > g && P({
126
- message: j(y, "uploadErrors.tooManyFiles")
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, g);
132
+ const i = l.slice(0, x);
129
133
  return {
130
134
  ...s,
131
- files: [...o, ...i.map(pe)]
135
+ files: [...o, ...i.map(he)]
132
136
  };
133
137
  });
134
138
  }, w = async () => {
135
139
  try {
136
- f ? await a({
140
+ f ? await c({
137
141
  mode: "edit",
138
142
  data: {
139
- textChanged: K,
140
- newFiles: V,
141
- deletedFiles: Z,
142
- newText: c.text
143
+ textChanged: J,
144
+ newFiles: K,
145
+ deletedFiles: D,
146
+ newText: a.text
143
147
  }
144
- }) : await a({
148
+ }) : await c({
145
149
  mode: "create",
146
150
  data: {
147
- text: c.text,
148
- files: m.files.filter(ue)
151
+ text: a.text,
152
+ files: m.files.filter(pe)
149
153
  }
150
154
  });
151
155
  } catch {
152
156
  return;
153
157
  }
154
- H(), h.current && h.current.update(() => {
155
- const e = h.current._editorState._nodeMap.get("root");
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 = h.current._nodes.get("paragraph");
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
- }, M = /* @__PURE__ */ r(
164
- re,
167
+ }, O = /* @__PURE__ */ n(
168
+ ne,
165
169
  {
166
170
  ref: p,
167
171
  className: `
168
- ${x.commentComposerWrapper}
169
- ${f ? x.editMode : ""}
170
- ${u ? x.commentComposerFloat : ""}
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: x.composerContainer,
179
+ className: y.composerContainer,
176
180
  style: {
177
181
  "--placeholder-text": `"${G}"`
178
182
  },
179
183
  children: [
180
- /* @__PURE__ */ r("div", { className: x.editorWrapper, children: /* @__PURE__ */ r(
181
- me,
184
+ /* @__PURE__ */ n("div", { className: y.editorWrapper, children: /* @__PURE__ */ n(
185
+ fe,
182
186
  {
183
187
  onSubmit: w,
184
- editorRef: h,
188
+ editorRef: g,
185
189
  inputContainerRef: p,
186
- commentDraft: c,
190
+ commentDraft: a,
187
191
  onBlur: H,
188
192
  isEdit: f,
189
193
  isFloat: u,
190
194
  hasChanges: F,
191
- ns: I,
192
- children: n?.({
195
+ ns: S,
196
+ children: r?.({
193
197
  onSubmit: w,
194
198
  handleBlur: () => {
195
199
  },
196
200
  setCommentDraft: T,
197
- commentDraft: c,
198
- editorRef: h,
201
+ commentDraft: a,
202
+ editorRef: g,
199
203
  initialContent: d?.text ?? ""
200
204
  })
201
205
  }
202
206
  ) }),
203
- /* @__PURE__ */ r(se, { h: 10, "data-editor-spacer": !0, tabIndex: 0, style: { width: "100%" } }),
204
- /* @__PURE__ */ r(
205
- de,
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) => R((t) => ({
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__ */ r(
230
+ /* @__PURE__ */ n(
227
231
  ie,
228
232
  {
229
- onChange: (e) => D(e, T),
233
+ onChange: (e) => Q(e, T),
230
234
  multiple: !0,
231
- children: (e) => /* @__PURE__ */ r(U, { ...e, variant: "subtle", size: "lg", color: "gray", children: /* @__PURE__ */ r(
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__ */ r(
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__ */ r(ce, { size: "sm", c: "dimmed", children: y("composer.cancel") })
258
+ children: /* @__PURE__ */ n(ae, { size: "sm", c: "dimmed", children: h("composer.cancel") })
255
259
  }
256
260
  ),
257
- /* @__PURE__ */ r(
258
- ae,
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: y("composer.save")
268
+ children: h("composer.save")
265
269
  }
266
270
  )
267
- ] }) : /* @__PURE__ */ r(
268
- U,
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: !c.text.trim() && c.files.length === 0,
276
- children: /* @__PURE__ */ r($, { icon: ne, size: 20 })
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__ */ r(_.Target, { children: /* @__PURE__ */ r(
325
+ /* @__PURE__ */ n(L.Target, { children: /* @__PURE__ */ n(
322
326
  "div",
323
327
  {
324
- ref: J,
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__ */ r(
337
- _.Dropdown,
340
+ /* @__PURE__ */ n(
341
+ L.Dropdown,
338
342
  {
339
343
  ref: X,
340
- className: x.commentComposerFloat,
341
- children: M
344
+ className: y.commentComposerFloat,
345
+ children: O
342
346
  }
343
347
  )
344
348
  ]
345
349
  }
346
- ) : M;
350
+ ) : O;
347
351
  };
348
352
  export {
349
- _e as CommentComposer
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,4CAiTA,CAAC"}
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 x, TextInput as ie, Tooltip as ce, ActionIcon as A, Paper as F, Text as q, SimpleGrid as N } from "@mantine/core";
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"), I = d("frequent"), h = d({}), z = d(null), [w, S] = u(""), [Q, O] = u([]), [a, B] = u(null), [E, j] = u([]), { t: G } = L(), g = d(!1), l = d(null);
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 = z.current, r = h.current[e.i];
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 = z.current;
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, I.current = l.current, k(l.current), l.current = null);
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 !== I.current && (I.current = r, k(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
- x,
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: z,
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(x, { flex: 1, justify: "center", align: "stretch", children: /* @__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
- x,
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;CACpB,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,yNAkBzB,iBAAiB,CAAC,gBAAgB,CAAC,4CA8MrC,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"}