@layers-app/shared 0.2.2 → 0.2.3

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 (38) hide show
  1. package/dist/assets/svg/group_default_icon.svg.js +4 -0
  2. package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts.map +1 -1
  3. package/dist/components/AppContainer/hooks/useAppContainerStore.js +26 -19
  4. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  5. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  6. package/dist/components/CommentComposer/CommentEditorHotkeys.js +25 -22
  7. package/dist/components/CommentComposer/index.d.ts.map +1 -1
  8. package/dist/components/CommentComposer/index.js +237 -153
  9. package/dist/components/CommentComposer/{useFloatingPosition.d.ts → useVirtualAnchor.d.ts} +3 -4
  10. package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -0
  11. package/dist/components/CommentComposer/useVirtualAnchor.js +71 -0
  12. package/dist/components/FilePicker/FilePicker.js +1 -1
  13. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +5 -5
  14. package/dist/components/GroupAvatar/index.d.ts +9 -0
  15. package/dist/components/GroupAvatar/index.d.ts.map +1 -0
  16. package/dist/components/GroupAvatar/index.js +24 -0
  17. package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
  18. package/dist/components/modals/RemoveConfirmModal.js +22 -21
  19. package/dist/components/table/FrontTable.d.ts +2 -1
  20. package/dist/components/table/FrontTable.d.ts.map +1 -1
  21. package/dist/components/table/components/TableCell.d.ts.map +1 -1
  22. package/dist/components/table/components/TableCell.js +63 -26
  23. package/dist/components/table/components/TableMenu.d.ts +2 -1
  24. package/dist/components/table/components/TableMenu.d.ts.map +1 -1
  25. package/dist/components/table/components/TableMenu.js +15 -14
  26. package/dist/constants.d.ts +4 -0
  27. package/dist/constants.d.ts.map +1 -1
  28. package/dist/constants.js +7 -4
  29. package/dist/index.css +1 -1
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +390 -384
  33. package/dist/store/accessOptionsControl.d.ts +11 -1
  34. package/dist/store/accessOptionsControl.d.ts.map +1 -1
  35. package/dist/store/accessOptionsControl.js +15 -7
  36. package/package.json +1 -1
  37. package/dist/components/CommentComposer/useFloatingPosition.d.ts.map +0 -1
  38. package/dist/components/CommentComposer/useFloatingPosition.js +0 -115
@@ -1,197 +1,221 @@
1
- import { jsx as o, jsxs as z } from "react/jsx-runtime";
2
- import { useState as K, useRef as v, useMemo as _ } from "react";
3
- import { useTranslation as X } from "react-i18next";
4
- import { Attachment02Icon as V, Sent02Icon as Z } from "@hugeicons/core-free-icons";
5
- import { HugeiconsIcon as A } from "@hugeicons/react";
6
- import { Stack as q, Box as Q, Group as N, FileButton as Y, ActionIcon as $, UnstyledButton as D, Text as ee, Button as te } from "@mantine/core";
7
- import { showErrorNotification as L } from "../../helpers/showNotifications.js";
8
- import { AttachmentsPreview as oe } from "../AttachmentsPreview/AttachmentsPreview.js";
9
- import { CommentEditorHandler as ne } from "./CommentEditorHotkeys.js";
10
- import { useFloatingPosition as re } from "./useFloatingPosition.js";
11
- import h from "./CommentComposer.module.css.js";
12
- function M(t) {
13
- return "id" in t;
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";
3
+ import { useTranslation as te } from "react-i18next";
4
+ import { Attachment02Icon as oe, Sent02Icon as ne } from "@hugeicons/core-free-icons";
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;
14
14
  }
15
- function se(t) {
16
- return typeof t == "object" && "isTemp" in t;
15
+ function ue(n) {
16
+ return typeof n == "object" && "isTemp" in n;
17
17
  }
18
- function ie(t) {
19
- const l = URL.createObjectURL(t);
18
+ function pe(n) {
19
+ const a = URL.createObjectURL(n);
20
20
  return {
21
21
  id: `temp-${crypto.randomUUID()}`,
22
- name: t.name,
23
- type: t.type,
24
- size: t.size,
25
- url: l,
26
- src: l,
27
- isImage: t.type.startsWith("image/"),
22
+ name: n.name,
23
+ type: n.type,
24
+ size: n.size,
25
+ url: a,
26
+ src: a,
27
+ isImage: n.type.startsWith("image/"),
28
28
  isTemp: !0,
29
- raw: t
29
+ raw: n
30
30
  };
31
31
  }
32
- const ce = 5 * 1024 * 1024, le = 10;
33
- function U(t, l) {
34
- return t(`composer.${l}`, { defaultValue: "" }) || t(`editor.composer.${l}`);
32
+ const he = 5 * 1024 * 1024, ge = 10;
33
+ function j(n, a) {
34
+ return n(`composer.${a}`, { defaultValue: "" }) || n(`editor.composer.${a}`);
35
35
  }
36
- const be = ({
37
- children: t,
38
- onSubmit: l,
39
- initialDraft: a,
40
- updateLocation: T,
41
- onBlur: j,
42
- setEdit: B,
43
- ns: C = "comments"
36
+ const _e = ({
37
+ children: n,
38
+ onSubmit: a,
39
+ initialDraft: d,
40
+ updateLocation: z,
41
+ onBlur: k,
42
+ setEdit: N,
43
+ ns: I = "comments"
44
44
  }) => {
45
- const [m, R] = K({
46
- text: a?.text ?? "",
47
- files: a?.files ?? []
48
- }), { t: p } = X(C), k = p(C === "comments" ? "composer.placeholder" : "editor.composer.placeholder"), u = v(null), d = typeof a?.text < "u", i = {
45
+ const [m, R] = Q({
46
+ text: d?.text ?? "",
47
+ 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
49
  text: m.text,
50
50
  files: m.files
51
- }, F = v(null), O = _(
51
+ }, X = v(null), p = v(null), Y = O(
52
52
  () => ({
53
53
  container: document.createElement("div"),
54
54
  elements: []
55
55
  }),
56
56
  []
57
- ), P = v(null), b = !!T;
58
- re({
59
- boxRef: F,
60
- isFloat: b,
61
- updateLocation: T,
62
- selectionRef: P,
63
- selectionState: O
64
- });
65
- const { textChanged: H, newFiles: W, deletedFiles: G, hasChanges: w } = _(() => {
66
- const e = a?.files || [], n = m.files, r = a?.text !== i.text, s = n.filter((c) => c.isTemp), x = new Set(
67
- n.filter(
68
- (c) => M(c)
69
- ).map((c) => c.id)
70
- ), f = e.filter(M).filter((c) => !x.has(c.id)), y = d ? JSON.stringify(a) === JSON.stringify(m) : i.text.trim().length > 0 || s.length > 0 || f.length > 0;
57
+ ), q = v(null), u = !!z, J = fe({
58
+ isFloat: u,
59
+ updateLocation: z,
60
+ selectionRef: q,
61
+ selectionState: Y
62
+ }), S = 10 * 30 * 0.7, b = ee(() => {
63
+ if (!p.current) return;
64
+ const e = p.current, t = e.querySelector(
65
+ '[class*="editorWrapper"]'
66
+ ), s = t?.scrollHeight || 0, o = s > S, l = s > 35, i = e.closest(
67
+ '[class*="commentComposerFloat"]'
68
+ ) || 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(() => {
72
+ b();
73
+ }, [b]), L(() => {
74
+ if (!p.current) return;
75
+ const e = new ResizeObserver(() => {
76
+ b();
77
+ });
78
+ return e.observe(p.current), () => {
79
+ e.disconnect();
80
+ };
81
+ }, [b]), L(() => {
82
+ const e = document.querySelector("main");
83
+ if (e && u) {
84
+ const t = e.style.overflow;
85
+ return e.style.overflow = "hidden", () => {
86
+ e.style.overflow = t;
87
+ };
88
+ }
89
+ }, [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(
92
+ t.filter(
93
+ (i) => W(i)
94
+ ).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;
71
96
  return {
72
- textChanged: r,
73
- newFiles: s,
74
- deletedFiles: f,
75
- hasChanges: y
97
+ textChanged: s,
98
+ newFiles: o,
99
+ deletedFiles: l,
100
+ hasChanges: E
76
101
  };
77
- }, [d, a, m, i.text]), S = () => {
78
- B ? B({
102
+ }, [f, d, m, c.text]), H = () => {
103
+ N ? N({
79
104
  id: "",
80
105
  text: "",
81
106
  files: []
82
- }) : j?.();
83
- }, I = (e, n = !1) => {
84
- R((r) => {
85
- if (n)
107
+ }) : k?.();
108
+ }, T = (e, t = !1) => {
109
+ R((s) => {
110
+ if (t)
86
111
  return { text: "", files: [] };
87
- const s = typeof e == "function" ? e(r) : e;
112
+ const o = typeof e == "function" ? e(s) : e;
88
113
  return {
89
- text: s.text,
90
- files: s.files
114
+ text: o.text,
115
+ files: o.files
91
116
  };
92
117
  });
93
- }, J = (e, n) => {
94
- e && n((r) => {
95
- const s = r.files, x = le - s.length, f = [], y = [];
96
- e.forEach((E) => {
97
- E.size > ce ? y.push(E) : f.push(E);
98
- }), y.length > 0 && L({
99
- message: U(p, "uploadErrors.fileTooLarge")
100
- }), f.length > x && L({
101
- message: U(p, "uploadErrors.tooManyFiles")
118
+ }, D = (e, t) => {
119
+ 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")
102
127
  });
103
- const c = f.slice(0, x);
128
+ const i = l.slice(0, g);
104
129
  return {
105
- ...r,
106
- files: [...s, ...c.map(ie)]
130
+ ...s,
131
+ files: [...o, ...i.map(pe)]
107
132
  };
108
133
  });
109
- }, g = async () => {
134
+ }, w = async () => {
110
135
  try {
111
- d ? await l({
136
+ f ? await a({
112
137
  mode: "edit",
113
138
  data: {
114
- textChanged: H,
115
- newFiles: W,
116
- deletedFiles: G,
117
- newText: i.text
139
+ textChanged: K,
140
+ newFiles: V,
141
+ deletedFiles: Z,
142
+ newText: c.text
118
143
  }
119
- }) : await l({
144
+ }) : await a({
120
145
  mode: "create",
121
146
  data: {
122
- text: i.text,
123
- files: m.files.filter(se)
147
+ text: c.text,
148
+ files: m.files.filter(ue)
124
149
  }
125
150
  });
126
151
  } catch {
127
152
  return;
128
153
  }
129
- S(), u.current && u.current.update(() => {
130
- const e = u.current._editorState._nodeMap.get("root");
154
+ H(), h.current && h.current.update(() => {
155
+ const e = h.current._editorState._nodeMap.get("root");
131
156
  if (!e) return;
132
157
  e.clear();
133
- const n = u.current._nodes.get("paragraph");
134
- if (!n) return;
135
- const r = new n.klass();
136
- e.append(r), r.select();
137
- }), I({ text: "", files: [] }, !0);
138
- };
139
- return /* @__PURE__ */ o(
140
- q,
158
+ const t = h.current._nodes.get("paragraph");
159
+ if (!t) return;
160
+ const s = new t.klass();
161
+ e.append(s), s.select();
162
+ }), T({ text: "", files: [] }, !0);
163
+ }, M = /* @__PURE__ */ r(
164
+ re,
141
165
  {
142
- ref: F,
166
+ ref: p,
143
167
  className: `
144
- ${h.commentComposerWrapper}
145
- ${b ? h.commentComposerFloat : ""}
146
- ${d ? h.editMode : ""}
168
+ ${x.commentComposerWrapper}
169
+ ${f ? x.editMode : ""}
170
+ ${u ? x.commentComposerFloat : ""}
147
171
  `,
148
- children: /* @__PURE__ */ z(
172
+ children: /* @__PURE__ */ C(
149
173
  "div",
150
174
  {
151
- className: h.composerContainer,
175
+ className: x.composerContainer,
152
176
  style: {
153
- "--placeholder-text": `"${k}"`
177
+ "--placeholder-text": `"${G}"`
154
178
  },
155
179
  children: [
156
- /* @__PURE__ */ o("div", { className: h.editorWrapper, children: /* @__PURE__ */ o(
157
- ne,
180
+ /* @__PURE__ */ r("div", { className: x.editorWrapper, children: /* @__PURE__ */ r(
181
+ me,
158
182
  {
159
- onSubmit: g,
160
- editorRef: u,
161
- inputContainerRef: F,
162
- commentDraft: i,
163
- onBlur: S,
164
- isEdit: d,
165
- isFloat: b,
166
- hasChanges: w,
167
- ns: C,
168
- children: t?.({
169
- onSubmit: g,
183
+ onSubmit: w,
184
+ editorRef: h,
185
+ inputContainerRef: p,
186
+ commentDraft: c,
187
+ onBlur: H,
188
+ isEdit: f,
189
+ isFloat: u,
190
+ hasChanges: F,
191
+ ns: I,
192
+ children: n?.({
193
+ onSubmit: w,
170
194
  handleBlur: () => {
171
195
  },
172
- setCommentDraft: I,
173
- commentDraft: i,
174
- editorRef: u,
175
- initialContent: a?.text ?? ""
196
+ setCommentDraft: T,
197
+ commentDraft: c,
198
+ editorRef: h,
199
+ initialContent: d?.text ?? ""
176
200
  })
177
201
  }
178
202
  ) }),
179
- /* @__PURE__ */ o(Q, { h: 10, "data-editor-spacer": !0, tabIndex: 0, style: { width: "100%" } }),
180
- /* @__PURE__ */ o(
181
- oe,
203
+ /* @__PURE__ */ r(se, { h: 10, "data-editor-spacer": !0, tabIndex: 0, style: { width: "100%" } }),
204
+ /* @__PURE__ */ r(
205
+ de,
182
206
  {
183
207
  files: m.files,
184
208
  mode: "draft",
185
- onRemove: (e) => R((n) => ({
186
- ...n,
187
- files: n.files.filter((r, s) => s !== e)
209
+ onRemove: (e) => R((t) => ({
210
+ ...t,
211
+ files: t.files.filter((s, o) => o !== e)
188
212
  }))
189
213
  }
190
214
  ),
191
- /* @__PURE__ */ z(
192
- N,
215
+ /* @__PURE__ */ C(
216
+ B,
193
217
  {
194
- justify: d ? "space-between" : "flex-end",
218
+ justify: f ? "space-between" : "flex-end",
195
219
  "data-comment-footer": !0,
196
220
  align: "center",
197
221
  w: "unset",
@@ -199,26 +223,26 @@ const be = ({
199
223
  tabIndex: 0,
200
224
  gap: "4px",
201
225
  children: [
202
- /* @__PURE__ */ o(
203
- Y,
226
+ /* @__PURE__ */ r(
227
+ ie,
204
228
  {
205
- onChange: (e) => J(e, I),
229
+ onChange: (e) => D(e, T),
206
230
  multiple: !0,
207
- children: (e) => /* @__PURE__ */ o($, { ...e, variant: "subtle", size: "lg", color: "gray", children: /* @__PURE__ */ o(
208
- A,
231
+ children: (e) => /* @__PURE__ */ r(U, { ...e, variant: "subtle", size: "lg", color: "gray", children: /* @__PURE__ */ r(
232
+ $,
209
233
  {
210
234
  style: { transform: "rotate(35deg)" },
211
- icon: V,
235
+ icon: oe,
212
236
  size: 20
213
237
  }
214
238
  ) })
215
239
  }
216
240
  ),
217
- d ? /* @__PURE__ */ z(N, { gap: "8px", children: [
218
- /* @__PURE__ */ o(
219
- D,
241
+ f ? /* @__PURE__ */ C(B, { gap: "8px", children: [
242
+ /* @__PURE__ */ r(
243
+ le,
220
244
  {
221
- onClick: S,
245
+ onClick: H,
222
246
  "data-no-focus": !0,
223
247
  style: {
224
248
  cursor: "pointer",
@@ -227,29 +251,29 @@ const be = ({
227
251
  background: "none",
228
252
  border: "none"
229
253
  },
230
- children: /* @__PURE__ */ o(ee, { size: "sm", c: "dimmed", children: p("composer.cancel") })
254
+ children: /* @__PURE__ */ r(ce, { size: "sm", c: "dimmed", children: y("composer.cancel") })
231
255
  }
232
256
  ),
233
- /* @__PURE__ */ o(
234
- te,
257
+ /* @__PURE__ */ r(
258
+ ae,
235
259
  {
236
260
  size: "xs",
237
261
  radius: "md",
238
- onClick: g,
239
- disabled: d ? w : !w,
240
- children: p("composer.save")
262
+ onClick: w,
263
+ disabled: f ? F : !F,
264
+ children: y("composer.save")
241
265
  }
242
266
  )
243
- ] }) : /* @__PURE__ */ o(
244
- $,
267
+ ] }) : /* @__PURE__ */ r(
268
+ U,
245
269
  {
246
270
  color: "var(--mantine-primary-color-filled)",
247
271
  size: "lg",
248
272
  "data-comment-submit-button": !0,
249
273
  variant: "filled",
250
- onClick: g,
251
- disabled: !i.text.trim() && i.files.length === 0,
252
- children: /* @__PURE__ */ o(A, { icon: Z, size: 20 })
274
+ onClick: w,
275
+ disabled: !c.text.trim() && c.files.length === 0,
276
+ children: /* @__PURE__ */ r($, { icon: ne, size: 20 })
253
277
  }
254
278
  )
255
279
  ]
@@ -260,7 +284,67 @@ const be = ({
260
284
  )
261
285
  }
262
286
  );
287
+ return u ? /* @__PURE__ */ C(
288
+ _,
289
+ {
290
+ opened: !0,
291
+ position: "bottom-start",
292
+ offset: 10,
293
+ withinPortal: !1,
294
+ floatingStrategy: "fixed",
295
+ zIndex: 100,
296
+ middlewares: {
297
+ flip: { padding: 8 },
298
+ shift: { padding: 8 },
299
+ size: {
300
+ padding: 8,
301
+ apply: ({ availableHeight: e, rects: t, elements: s }) => {
302
+ const o = s.floating;
303
+ if (!o) return;
304
+ if (e < t.floating.height) {
305
+ const l = Math.max(e, 120);
306
+ Object.assign(o.style, {
307
+ maxHeight: `${l}px`,
308
+ overflowY: "auto"
309
+ }), o.setAttribute("data-constrained", "true");
310
+ } else
311
+ o.style.maxHeight = "", o.style.overflowY = "", o.removeAttribute("data-constrained");
312
+ }
313
+ }
314
+ },
315
+ styles: {
316
+ dropdown: {
317
+ padding: 0
318
+ }
319
+ },
320
+ children: [
321
+ /* @__PURE__ */ r(_.Target, { children: /* @__PURE__ */ r(
322
+ "div",
323
+ {
324
+ ref: J,
325
+ style: {
326
+ position: "fixed",
327
+ width: "5px",
328
+ height: "5px",
329
+ pointerEvents: "none",
330
+ visibility: "hidden",
331
+ top: 0,
332
+ left: 0
333
+ }
334
+ }
335
+ ) }),
336
+ /* @__PURE__ */ r(
337
+ _.Dropdown,
338
+ {
339
+ ref: X,
340
+ className: x.commentComposerFloat,
341
+ children: M
342
+ }
343
+ )
344
+ ]
345
+ }
346
+ ) : M;
263
347
  };
264
348
  export {
265
- be as CommentComposer
349
+ _e as CommentComposer
266
350
  };
@@ -1,5 +1,4 @@
1
- interface UseFloatingPositionProps {
2
- boxRef: React.RefObject<HTMLDivElement>;
1
+ interface UseVirtualAnchorProps {
3
2
  isFloat: boolean;
4
3
  updateLocation?: (boxElem: HTMLDivElement, selectionRef: React.MutableRefObject<any>, selectionState: {
5
4
  container: HTMLDivElement;
@@ -11,6 +10,6 @@ interface UseFloatingPositionProps {
11
10
  elements: HTMLSpanElement[];
12
11
  };
13
12
  }
14
- export declare function useFloatingPosition({ boxRef, isFloat, updateLocation, selectionRef, selectionState, }: UseFloatingPositionProps): void;
13
+ export declare function useVirtualAnchor({ isFloat, updateLocation, selectionRef, selectionState, }: UseVirtualAnchorProps): import("react").MutableRefObject<HTMLDivElement | null>;
15
14
  export {};
16
- //# sourceMappingURL=useFloatingPosition.d.ts.map
15
+ //# sourceMappingURL=useVirtualAnchor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVirtualAnchor.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/useVirtualAnchor.ts"],"names":[],"mappings":"AAEA,UAAU,qBAAqB;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,EACzC,cAAc,EAAE;QACd,SAAS,EAAE,cAAc,CAAC;QAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;KAC7B,KACE,IAAI,CAAC;IACV,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,cAAc,EAAE;QACd,SAAS,EAAE,cAAc,CAAC;QAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;KAC7B,CAAC;CACH;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,cAAc,EACd,YAAY,EACZ,cAAc,GACf,EAAE,qBAAqB,2DAsHvB"}
@@ -0,0 +1,71 @@
1
+ import { useRef as h, useCallback as g, useLayoutEffect as p, useEffect as d } from "react";
2
+ function R({
3
+ isFloat: n,
4
+ updateLocation: f,
5
+ selectionRef: m,
6
+ selectionState: o
7
+ }) {
8
+ const u = h(null), a = h(null), b = h(!1), c = g(() => {
9
+ if (!u.current || !n) return;
10
+ const { elements: e } = o;
11
+ if (!e || e.length === 0) return;
12
+ const i = e[0], r = e[e.length - 1];
13
+ if (!i.isConnected || !r.isConnected) return;
14
+ const t = i.getBoundingClientRect(), s = r.getBoundingClientRect(), l = {
15
+ top: t.top,
16
+ bottom: s.bottom,
17
+ left: Math.min(t.left, s.left),
18
+ right: Math.max(t.right, s.right),
19
+ width: Math.max(t.right, s.right) - Math.min(t.left, s.left),
20
+ height: s.bottom - t.top,
21
+ x: Math.min(t.left, s.left),
22
+ y: t.top
23
+ };
24
+ a.current = l, u.current && (u.current.style.top = `${l.top}px`, u.current.style.left = `${l.left}px`), b.current = !0;
25
+ }, [n, o]);
26
+ return p(() => {
27
+ if (!n || !f) return;
28
+ const e = u.current;
29
+ if (!e) return;
30
+ f(e, m, o);
31
+ const i = setTimeout(() => {
32
+ c();
33
+ }, 50), r = o.container, t = document.body;
34
+ return t && r && !t.contains(r) && t.appendChild(r), () => {
35
+ clearTimeout(i), t && r && t.contains(r) && t.removeChild(r);
36
+ };
37
+ }, [
38
+ n,
39
+ f,
40
+ m,
41
+ o,
42
+ c
43
+ ]), d(() => {
44
+ if (!n) return;
45
+ const e = new ResizeObserver(() => {
46
+ c();
47
+ }), i = new MutationObserver(() => {
48
+ c();
49
+ });
50
+ return o.elements.length > 0 && o.elements.forEach((r) => {
51
+ e.observe(r), i.observe(r, {
52
+ attributes: !0,
53
+ childList: !0,
54
+ subtree: !0
55
+ });
56
+ }), () => {
57
+ e.disconnect(), i.disconnect();
58
+ };
59
+ }, [n, o.elements, c]), d(() => {
60
+ if (!n) return;
61
+ const e = () => {
62
+ c();
63
+ };
64
+ return window.addEventListener("scroll", e, { passive: !0 }), () => {
65
+ window.removeEventListener("scroll", e);
66
+ };
67
+ }, [n, c]), u;
68
+ }
69
+ export {
70
+ R as useVirtualAnchor
71
+ };
@@ -80,7 +80,7 @@ const _ = [
80
80
  },
81
81
  {
82
82
  value: "unsplash",
83
- label: /* @__PURE__ */ e(r, { children: !l && /* @__PURE__ */ e("span", { children: n?.searchImages }) }),
83
+ label: /* @__PURE__ */ e(r, { children: !l && /* @__PURE__ */ e("span", { children: n.searchImages }) }),
84
84
  visible: a.includes("unsplash") && d
85
85
  },
86
86
  {
@@ -10,19 +10,19 @@ export declare const useFormGlobalTheme: ({ innerId }: {
10
10
  black?: string | undefined;
11
11
  colors?: {
12
12
  [x: string & {}]: import("@mantine/core").MantineColorsTuple | undefined;
13
- gray?: import("@mantine/core").MantineColorsTuple | undefined;
14
13
  blue?: import("@mantine/core").MantineColorsTuple | undefined;
14
+ indigo?: import("@mantine/core").MantineColorsTuple | undefined;
15
15
  violet?: import("@mantine/core").MantineColorsTuple | undefined;
16
- cyan?: import("@mantine/core").MantineColorsTuple | undefined;
16
+ grape?: import("@mantine/core").MantineColorsTuple | undefined;
17
17
  green?: import("@mantine/core").MantineColorsTuple | undefined;
18
+ orange?: import("@mantine/core").MantineColorsTuple | undefined;
19
+ gray?: import("@mantine/core").MantineColorsTuple | undefined;
20
+ cyan?: import("@mantine/core").MantineColorsTuple | undefined;
18
21
  yellow?: import("@mantine/core").MantineColorsTuple | undefined;
19
22
  red?: import("@mantine/core").MantineColorsTuple | undefined;
20
23
  dark?: import("@mantine/core").MantineColorsTuple | undefined;
21
24
  pink?: import("@mantine/core").MantineColorsTuple | undefined;
22
- grape?: import("@mantine/core").MantineColorsTuple | undefined;
23
- indigo?: import("@mantine/core").MantineColorsTuple | undefined;
24
25
  lime?: import("@mantine/core").MantineColorsTuple | undefined;
25
- orange?: import("@mantine/core").MantineColorsTuple | undefined;
26
26
  teal?: import("@mantine/core").MantineColorsTuple | undefined;
27
27
  } | undefined;
28
28
  primaryShade?: import("@mantine/core").MantineColorShade | {
@@ -0,0 +1,9 @@
1
+ import { AvatarProps } from '@mantine/core';
2
+ export interface GroupAvatarProps extends Omit<AvatarProps, 'src'>, Omit<React.ComponentPropsWithoutRef<'div'>, keyof AvatarProps> {
3
+ groupIcon?: string | null;
4
+ groupId?: string;
5
+ groupName?: string;
6
+ size?: number | string;
7
+ }
8
+ export declare const GroupAvatar: import("react").ForwardRefExoticComponent<GroupAvatarProps & import("react").RefAttributes<HTMLDivElement>>;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GroupAvatar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAC9B,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,MAAM,WAAW,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,WAAW,6GAgBvB,CAAC"}