@layers-app/shared 0.4.5 → 0.4.6

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 (128) hide show
  1. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  2. package/dist/components/AppContainer/AppContainer.js +72 -79
  3. package/dist/components/AppContainer/AppContainer.module.css.js +6 -6
  4. package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
  5. package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +24 -22
  6. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  7. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +46 -37
  8. package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
  9. package/dist/components/AppContainer/components/Header.js +6 -5
  10. package/dist/components/AppContainer/components/Main.js +4 -4
  11. package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
  12. package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
  13. package/dist/components/AppContainer/components/ToolSidebar.js +161 -128
  14. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
  15. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +131 -121
  16. package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
  17. package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
  18. package/dist/components/AppContainer/hooks/useAppContainer.js +59 -56
  19. package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
  20. package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
  21. package/dist/components/AppContainer/types.d.ts +1 -0
  22. package/dist/components/AppContainer/types.d.ts.map +1 -1
  23. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  24. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +37 -37
  25. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
  26. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +68 -62
  27. package/dist/components/AttachmentsGalleryModal/helpers.d.ts +8 -0
  28. package/dist/components/AttachmentsGalleryModal/helpers.d.ts.map +1 -1
  29. package/dist/components/AttachmentsGalleryModal/helpers.js +22 -17
  30. package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts.map +1 -1
  31. package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.js +28 -25
  32. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
  33. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +36 -41
  34. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  35. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +135 -80
  36. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +24 -14
  37. package/dist/components/BouncingLogo/BouncingLogo.d.ts +1 -3
  38. package/dist/components/BouncingLogo/BouncingLogo.d.ts.map +1 -1
  39. package/dist/components/BouncingLogo/BouncingLogo.js +14 -20
  40. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -8
  41. package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +5 -5
  42. package/dist/components/Chat/ChatInput/ChatInput.module.css.js +40 -28
  43. package/dist/components/Chat/ChatInput/index.d.ts +29 -1
  44. package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
  45. package/dist/components/Chat/ChatInput/index.js +178 -118
  46. package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts +3 -0
  47. package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts.map +1 -0
  48. package/dist/components/Chat/ChatInput/smilePlusIcon.js +49 -0
  49. package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +9 -9
  50. package/dist/components/Chat/ChatMessage/index.d.ts +2 -0
  51. package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
  52. package/dist/components/Chat/ChatMessage/index.js +136 -118
  53. package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +4 -4
  54. package/dist/components/Chat/MessageActions/index.d.ts +7 -0
  55. package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
  56. package/dist/components/Chat/MessageActions/index.js +33 -30
  57. package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -10
  58. package/dist/components/Chat/MessageList/index.d.ts +30 -3
  59. package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
  60. package/dist/components/Chat/MessageList/index.js +154 -66
  61. package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +7 -7
  62. package/dist/components/Chat/MessageReactions/index.d.ts +17 -0
  63. package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -1
  64. package/dist/components/Chat/MessageReactions/index.js +60 -28
  65. package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +6 -4
  66. package/dist/components/Chat/MessageStatus/index.d.ts +1 -1
  67. package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -1
  68. package/dist/components/Chat/MessageStatus/index.js +49 -34
  69. package/dist/components/CircleColorPicker/CircleColorPicker.d.ts.map +1 -1
  70. package/dist/components/CircleColorPicker/CircleColorPicker.js +17 -15
  71. package/dist/components/ColorPicker/ColorPicker.module.css.js +26 -20
  72. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
  73. package/dist/components/ColorPicker/ColorPickerList.js +81 -68
  74. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  75. package/dist/components/ColorPicker/ColorPickerToolbar.js +75 -70
  76. package/dist/components/ColorPicker/icons.js +5 -5
  77. package/dist/components/ColorPicker/types.d.ts +6 -0
  78. package/dist/components/ColorPicker/types.d.ts.map +1 -1
  79. package/dist/components/ColorPicker/types.js +53 -11
  80. package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
  81. package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
  82. package/dist/components/ColorPicker/useRecentColors.js +43 -20
  83. package/dist/components/EmojiPicker/EmojiPanel.d.ts +2 -1
  84. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  85. package/dist/components/EmojiPicker/EmojiPanel.js +73 -72
  86. package/dist/components/EmojiPicker/EmojiPicker.d.ts +16 -1
  87. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  88. package/dist/components/EmojiPicker/EmojiPicker.js +121 -86
  89. package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
  90. package/dist/components/EmojiPicker/IconsPanel.js +28 -25
  91. package/dist/components/EntityIcon.d.ts +1 -0
  92. package/dist/components/EntityIcon.d.ts.map +1 -1
  93. package/dist/components/EntityIcon.js +80 -32
  94. package/dist/components/ErrorPage/components/Error403.d.ts +5 -1
  95. package/dist/components/ErrorPage/components/Error403.d.ts.map +1 -1
  96. package/dist/components/ErrorPage/components/Error403.js +25 -21
  97. package/dist/components/ErrorPage/index.d.ts +5 -1
  98. package/dist/components/ErrorPage/index.d.ts.map +1 -1
  99. package/dist/components/ErrorPage/index.js +17 -10
  100. package/dist/components/MusicPlayerBar/components/HoverActions.js +28 -28
  101. package/dist/components/NavMenu/NavMenu.d.ts +7 -1
  102. package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
  103. package/dist/components/NavMenu/NavMenu.js +54 -44
  104. package/dist/components/NavMenu/NavMenu.module.css.js +10 -10
  105. package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
  106. package/dist/components/NavMenu/components/NavMenuItem.js +84 -84
  107. package/dist/components/NavMenu/types.d.ts +4 -0
  108. package/dist/components/NavMenu/types.d.ts.map +1 -1
  109. package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
  110. package/dist/components/WorkspaceMenu/WorkspaceItem.js +16 -14
  111. package/dist/config/envConfig.d.ts +2 -0
  112. package/dist/config/envConfig.d.ts.map +1 -1
  113. package/dist/config/envConfig.js +41 -37
  114. package/dist/helpers/showNotifications.d.ts +15 -0
  115. package/dist/helpers/showNotifications.d.ts.map +1 -1
  116. package/dist/helpers/showNotifications.js +114 -72
  117. package/dist/helpers/showNotifications.module.css.js +16 -4
  118. package/dist/hooks/useUiPref.d.ts +2 -0
  119. package/dist/hooks/useUiPref.d.ts.map +1 -0
  120. package/dist/hooks/useUiPref.js +80 -0
  121. package/dist/index.css +1 -1
  122. package/dist/index.d.ts +1 -0
  123. package/dist/index.d.ts.map +1 -1
  124. package/dist/index.js +550 -540
  125. package/dist/lang/locales/ui_en.json.js +1 -1
  126. package/dist/lang/locales/ui_es.json.js +1 -1
  127. package/dist/lang/locales/ui_ru.json.js +1 -1
  128. package/package.json +1 -1
@@ -1,39 +1,46 @@
1
- import { jsxs as j, jsx as o } from "react/jsx-runtime";
2
- import { useState as d, useMemo as A, useEffect as T } from "react";
3
- import { useTranslation as E } from "react-i18next";
4
- import { Popover as k, Center as G, Tabs as t, Flex as C, Button as J } from "@mantine/core";
5
- import { IconEntity as K } from "../ProjectIcon/ProjectIcon.js";
6
- import { EmojiPanel as U } from "./EmojiPanel.js";
7
- import { IconsPanel as V } from "./IconsPanel.js";
8
- import f from "./EmojiPicker.module.css.js";
9
- const oe = ({
10
- project: N,
11
- value: i,
12
- querySearch: l,
13
- children: R,
1
+ import { jsxs as b, jsx as i } from "react/jsx-runtime";
2
+ import { useState as d, useMemo as U, useEffect as N } from "react";
3
+ import { useTranslation as V } from "react-i18next";
4
+ import { Popover as j, Center as X, Tabs as o, Flex as P, Button as Y } from "@mantine/core";
5
+ import { getEnvConfig as Z } from "../../config/envConfig.js";
6
+ import { usePlatform as q } from "../../hooks/usePlatform.js";
7
+ import { FilePickerGiphy as S } from "../FilePicker/FilePickerGiphy.js";
8
+ import { IconEntity as W } from "../ProjectIcon/ProjectIcon.js";
9
+ import { EmojiPanel as _ } from "./EmojiPanel.js";
10
+ import { IconsPanel as ee } from "./IconsPanel.js";
11
+ import l from "./EmojiPicker.module.css.js";
12
+ const de = ({
13
+ project: R,
14
+ value: s,
15
+ querySearch: c,
16
+ children: w,
14
17
  onChange: p,
15
18
  position: D = "bottom-start",
16
- popoverProps: P,
19
+ popoverProps: k,
17
20
  showIcons: u,
18
21
  showColors: I,
19
- defaultActiveTab: w = null,
20
- showEmojis: s = !0,
21
- withinPortal: L = !1,
22
- locales: h,
23
- openWhen: g = "click",
24
- triggerRegex: b = /(^|\s):([^\s:]{1,})$/,
25
- typingSeq: n,
26
- showRemoveButton: M = !0,
27
- keepOpenOnRandom: z = !1,
28
- closeOnSelect: y = !0
22
+ showGifs: E,
23
+ onSelectGif: F,
24
+ defaultActiveTab: L = null,
25
+ showEmojis: n = !0,
26
+ withinPortal: M = !1,
27
+ locales: g,
28
+ openWhen: h = "click",
29
+ triggerRegex: y = /(^|\s):([^\s:]{1,})$/,
30
+ typingSeq: m,
31
+ showRemoveButton: z = !0,
32
+ keepOpenOnRandom: A = !1,
33
+ showRandomButton: B = !0,
34
+ closeOnSelect: v = !0
29
35
  }) => {
30
- const { t: e } = E("ui"), [c, r] = d(!1), [B, x] = d(w), [F, H] = d(i || null), [v, O] = d(null), a = A(() => ({
36
+ const { t: e } = V("ui"), G = q(), x = !!E && G.has("giphy") && Z().media?.giphyEnabled !== !1, [f, r] = d(!1), [H, T] = d(L), [O, Q] = d(s || null), [C, $] = d(null), t = U(() => ({
31
37
  emojis: e("emojis"),
32
38
  remove: e("remove"),
33
39
  search: e("search"),
34
40
  random: e("random"),
35
41
  searchResults: e("emojiPicker.searchResults"),
36
42
  icons: e("emojiPicker.icons"),
43
+ gifs: e("emojiPicker.gifs"),
37
44
  searchNoResults: e("emojiPicker.searchNoResults"),
38
45
  chooseColor: e("emojiPicker.chooseColor"),
39
46
  emojiCategory: {
@@ -47,32 +54,32 @@ const oe = ({
47
54
  symbols: e("emojiPicker.categories.symbols"),
48
55
  flags: e("emojiPicker.categories.flags"),
49
56
  additional: e("emojiPicker.categories.additional"),
50
- ...h?.emojiCategory
57
+ ...g?.emojiCategory
51
58
  },
52
- ...h
53
- }), [e, h]);
54
- T(() => {
55
- const m = u && K.parse(i)?.icon ? "icons" : s ? "emojis" : null;
56
- !c && m && x(m);
57
- }, [c, s, u, i]), T(() => {
58
- if (g !== "realtime" || typeof n != "number" || v === n) return;
59
- O(n);
60
- const m = l ?? "", $ = !!s && b.test(m);
61
- r($);
59
+ ...g
60
+ }), [e, g]);
61
+ N(() => {
62
+ const a = u && W.parse(s)?.icon ? "icons" : n ? "emojis" : null;
63
+ !f && a && T(a);
64
+ }, [f, n, u, s]), N(() => {
65
+ if (h !== "realtime" || typeof m != "number" || C === m) return;
66
+ $(m);
67
+ const a = c ?? "", K = !!n && y.test(a);
68
+ r(K);
62
69
  }, [
63
- g,
64
- n,
65
- v,
66
- l,
67
- b,
68
- s
70
+ h,
71
+ m,
72
+ C,
73
+ c,
74
+ y,
75
+ n
69
76
  ]);
70
- const Q = typeof l == "string";
71
- return /* @__PURE__ */ j(
72
- k,
77
+ const J = typeof c == "string";
78
+ return /* @__PURE__ */ b(
79
+ j,
73
80
  {
74
- withinPortal: L,
75
- opened: c,
81
+ withinPortal: M,
82
+ opened: f,
76
83
  onChange: r,
77
84
  position: D,
78
85
  radius: "var(--mantine-spacing-sm)",
@@ -97,20 +104,20 @@ const oe = ({
97
104
  ]
98
105
  }
99
106
  },
100
- ...P || {},
107
+ ...k || {},
101
108
  children: [
102
- /* @__PURE__ */ o(k.Target, { children: /* @__PURE__ */ o(
103
- G,
109
+ /* @__PURE__ */ i(j.Target, { children: /* @__PURE__ */ i(
110
+ X,
104
111
  {
105
- onClick: g === "click" && !P?.disabled ? () => r(!c) : void 0,
106
- children: R ?? F
112
+ onClick: h === "click" && !k?.disabled ? () => r(!f) : void 0,
113
+ children: w ?? O
107
114
  }
108
115
  ) }),
109
- /* @__PURE__ */ o(k.Dropdown, { w: "380px", children: /* @__PURE__ */ j(
110
- t,
116
+ /* @__PURE__ */ i(j.Dropdown, { w: "380px", children: /* @__PURE__ */ b(
117
+ o,
111
118
  {
112
- value: B,
113
- onChange: x,
119
+ value: H,
120
+ onChange: T,
114
121
  keepMounted: !1,
115
122
  h: "100%",
116
123
  styles: {
@@ -127,8 +134,8 @@ const oe = ({
127
134
  }
128
135
  },
129
136
  children: [
130
- !Q && /* @__PURE__ */ j(
131
- t.List,
137
+ !J && /* @__PURE__ */ b(
138
+ o.List,
132
139
  {
133
140
  style: {
134
141
  gap: "4px"
@@ -136,28 +143,38 @@ const oe = ({
136
143
  h: 54,
137
144
  px: 8,
138
145
  children: [
139
- s && /* @__PURE__ */ o(
140
- t.Tab,
146
+ n && /* @__PURE__ */ i(
147
+ o.Tab,
141
148
  {
142
- className: f.originalTab,
149
+ className: l.originalTab,
143
150
  h: "100%",
144
151
  p: 0,
145
152
  value: "emojis",
146
- children: /* @__PURE__ */ o(C, { className: f.customTab, px: "sm", h: 36, children: a.emojis })
153
+ children: /* @__PURE__ */ i(P, { className: l.customTab, px: "sm", h: 36, children: t.emojis })
147
154
  }
148
155
  ),
149
- u && /* @__PURE__ */ o(
150
- t.Tab,
156
+ u && /* @__PURE__ */ i(
157
+ o.Tab,
151
158
  {
152
- className: f.originalTab,
159
+ className: l.originalTab,
153
160
  h: "100%",
154
161
  p: 0,
155
162
  value: "icons",
156
- children: /* @__PURE__ */ o(C, { className: f.customTab, px: "sm", h: 36, children: a.icons })
163
+ children: /* @__PURE__ */ i(P, { className: l.customTab, px: "sm", h: 36, children: t.icons })
157
164
  }
158
165
  ),
159
- !!String(i) && M && /* @__PURE__ */ o(
160
- J,
166
+ x && /* @__PURE__ */ i(
167
+ o.Tab,
168
+ {
169
+ className: l.originalTab,
170
+ h: "100%",
171
+ p: 0,
172
+ value: "gifs",
173
+ children: /* @__PURE__ */ i(P, { className: l.customTab, px: "sm", h: 36, children: t.gifs })
174
+ }
175
+ ),
176
+ !!String(s) && z && /* @__PURE__ */ i(
177
+ Y,
161
178
  {
162
179
  variant: "subtle",
163
180
  fz: "sm",
@@ -168,41 +185,59 @@ const oe = ({
168
185
  color: "var(--mantine-color-gray-light-color)",
169
186
  onClick: () => p?.(""),
170
187
  style: { marginLeft: "auto" },
171
- children: a.remove
188
+ children: t.remove
172
189
  }
173
190
  )
174
191
  ]
175
192
  }
176
193
  ),
177
- /* @__PURE__ */ o(t.Panel, { mah: 470, style: { overflow: "auto" }, value: "emojis", children: /* @__PURE__ */ o(
178
- U,
194
+ /* @__PURE__ */ i(o.Panel, { mah: 470, style: { overflow: "auto" }, value: "emojis", children: /* @__PURE__ */ i(
195
+ _,
179
196
  {
180
197
  onChange: p,
181
- value: i,
182
- querySearch: l,
183
- locales: a,
184
- setRandomIcon: H,
185
- onClose: y ? () => r(!1) : () => {
198
+ value: s,
199
+ querySearch: c,
200
+ locales: t,
201
+ setRandomIcon: Q,
202
+ showRandomButton: B,
203
+ onClose: v ? () => r(!1) : () => {
186
204
  }
187
205
  }
188
206
  ) }),
189
- /* @__PURE__ */ o(
190
- t.Panel,
207
+ /* @__PURE__ */ i(
208
+ o.Panel,
191
209
  {
192
210
  mah: 470,
193
211
  h: "100%",
194
212
  style: { overflow: "auto" },
195
213
  value: "icons",
196
- children: /* @__PURE__ */ o(
197
- V,
214
+ children: /* @__PURE__ */ i(
215
+ ee,
198
216
  {
199
- project: N,
217
+ project: R,
200
218
  onChange: p,
201
- value: i,
202
- locales: a,
219
+ value: s,
220
+ locales: t,
203
221
  showColors: I,
204
- keepOpenOnRandom: z,
205
- onClose: y ? () => r(!1) : () => {
222
+ keepOpenOnRandom: A,
223
+ onClose: v ? () => r(!1) : () => {
224
+ }
225
+ }
226
+ )
227
+ }
228
+ ),
229
+ x && /* @__PURE__ */ i(
230
+ o.Panel,
231
+ {
232
+ mah: 470,
233
+ style: { overflow: "auto" },
234
+ p: "sm",
235
+ value: "gifs",
236
+ children: /* @__PURE__ */ i(
237
+ S,
238
+ {
239
+ onChange: (a) => {
240
+ F?.(a), r(!1);
206
241
  }
207
242
  }
208
243
  )
@@ -216,5 +251,5 @@ const oe = ({
216
251
  );
217
252
  };
218
253
  export {
219
- oe as EmojiPicker
254
+ de as EmojiPicker
220
255
  };
@@ -1 +1 @@
1
- {"version":3,"file":"IconsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/IconsPanel.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AA0BjD,eAAO,MAAM,UAAU,sHASlB,IAAI,CACL,gBAAgB,EAChB,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAC5D,GAAG;IACF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,6CAwSF,CAAC"}
1
+ {"version":3,"file":"IconsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/IconsPanel.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AA0BjD,eAAO,MAAM,UAAU,sHASlB,IAAI,CACL,gBAAgB,EAChB,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAC5D,GAAG;IACF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,6CA4SF,CAAC"}
@@ -1,23 +1,23 @@
1
1
  import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
- import { memo as M, useState as x, useEffect as U, useCallback as V, useMemo as j } from "react";
2
+ import { memo as M, useState as k, useEffect as U, useCallback as V, useMemo as j } from "react";
3
3
  import { useTranslation as G } from "react-i18next";
4
- import { Search01Icon as Q, ShuffleIcon as Y } from "@hugeicons/core-free-icons";
4
+ import { Search01Icon as Q, ShuffleIcon as W } from "@hugeicons/core-free-icons";
5
5
  import { HugeiconsIcon as L } from "@hugeicons/react";
6
- import { useEvent as _ } from "@layers-app/draggable-ui";
7
- import { useMantineTheme as J, parseThemeColor as K, darken as W, Stack as y, Text as b, Flex as z, FocusTrap as X, TextInput as Z, Tooltip as ee, ActionIcon as oe, Box as te, Paper as E, SimpleGrid as N } from "@mantine/core";
6
+ import { useEvent as Y } from "@layers-app/draggable-ui";
7
+ import { useMantineTheme as _, parseThemeColor as J, darken as K, Stack as y, Text as b, Flex as z, FocusTrap as X, TextInput as Z, Tooltip as ee, ActionIcon as oe, Box as te, Paper as E, SimpleGrid as N } from "@mantine/core";
8
8
  import { groupBy as re } from "lodash-es";
9
9
  import { DEFAULT_VALUES as ie } from "../../constants.js";
10
10
  import { ColorPicker as ne } from "../ColorPicker/ColorPicker.js";
11
11
  import { NoData as ce } from "../NoData/NoData.js";
12
- import { IconEntity as I, IconType as A } from "../ProjectIcon/ProjectIcon.js";
12
+ import { IconEntity as w, IconType as A } from "../ProjectIcon/ProjectIcon.js";
13
13
  import { customIcons as D } from "./custom-icons/customIcons.js";
14
14
  import { getIconsList as F, getRandomIcon as ae } from "./utils.js";
15
15
  import h from "./EmojiPicker.module.css.js";
16
16
  async function le(a, c, l = 500) {
17
17
  const u = [], p = a.length;
18
18
  for (let r = 0; r < p; r += l) {
19
- const w = a.slice(r, r + l).filter(c);
20
- u.push(...w), await new Promise((f) => setTimeout(f, 0));
19
+ const I = a.slice(r, r + l).filter(c);
20
+ u.push(...I), await new Promise((f) => setTimeout(f, 0));
21
21
  }
22
22
  return u;
23
23
  }
@@ -31,7 +31,7 @@ const Ce = M(
31
31
  project: r,
32
32
  keepOpenOnRandom: C = !1
33
33
  }) => {
34
- const w = J(), [f, R] = x(""), { t: k } = G("ui"), [P, $] = x(
34
+ const I = _(), [f, R] = k(""), { t: x } = G("ui"), [P, $] = k(
35
35
  []
36
36
  );
37
37
  U(() => {
@@ -45,7 +45,7 @@ const Ce = M(
45
45
  );
46
46
  })();
47
47
  }, [r]);
48
- const [T, S] = x([]), H = V(
48
+ const [T, S] = k([]), H = V(
49
49
  async (o) => {
50
50
  const t = o.currentTarget.value;
51
51
  R(t);
@@ -57,39 +57,41 @@ const Ce = M(
57
57
  S(v.map((d) => d.n));
58
58
  },
59
59
  [r]
60
- ), i = I.parse(u), g = _((o) => {
60
+ ), i = w.parse(u), g = Y((o) => {
61
61
  const t = o.currentTarget.getAttribute("data-icon");
62
62
  t && (l?.(
63
- I.stringify({
63
+ w.stringify({
64
64
  icon: t.replace("i:", ""),
65
65
  color: i?.color,
66
66
  type: i?.type || A.FILLED
67
67
  })
68
68
  ), a || p());
69
- }), n = K({
69
+ }), n = J({
70
70
  color: i?.color || ie.COLORS[0],
71
- theme: w
71
+ theme: I
72
72
  }), O = j(() => n.isThemeColor ? {
73
73
  "--icon-color": `var(--mantine-color-${n.color}-filled)`,
74
74
  "--icon-color-hover": `var(--mantine-color-${n.color}-filled-hover)`
75
75
  } : {
76
76
  "--icon-color": n.value,
77
- "--icon-color-hover": W(n.value, 0.2)
77
+ "--icon-color-hover": K(n.value, 0.2)
78
78
  }, [n]), q = async () => {
79
79
  const o = await ae(r);
80
- S([]), l?.(I.stringify({ icon: o, color: i?.color })), !a && !C && p();
80
+ S([]), l?.(w.stringify({ icon: o, color: i?.color })), !a && !C && p();
81
81
  };
82
82
  return /* @__PURE__ */ m(y, { w: "100%", gap: "sm", pt: 12, pb: 8, h: "100%", children: [
83
83
  a && /* @__PURE__ */ m(y, { gap: 4, px: 8, w: "100%", children: [
84
- /* @__PURE__ */ e(b, { lh: "140%", fw: 500, c: "dimmed", fz: "xs", children: c?.chooseColor || k("chooseColor") }),
84
+ /* @__PURE__ */ e(b, { lh: "140%", fw: 500, c: "dimmed", fz: "xs", children: c?.chooseColor || x("chooseColor") }),
85
85
  /* @__PURE__ */ e(
86
86
  ne,
87
87
  {
88
88
  swatchSize: 24,
89
- gap: 4,
89
+ fullWidth: !0,
90
+ w: "100%",
91
+ px: 4,
90
92
  value: n.color,
91
93
  onChange: (o) => l?.(
92
- I.stringify({
94
+ w.stringify({
93
95
  color: o,
94
96
  icon: i?.icon,
95
97
  type: i?.type || A.FILLED
@@ -130,7 +132,7 @@ const Ce = M(
130
132
  radius: "var(--mantine-radius-default)"
131
133
  }
132
134
  ) }),
133
- /* @__PURE__ */ e(ee, { withArrow: !0, label: c?.random || k("random"), children: /* @__PURE__ */ e(
135
+ /* @__PURE__ */ e(ee, { withArrow: !0, label: c?.random || x("random"), children: /* @__PURE__ */ e(
134
136
  oe,
135
137
  {
136
138
  h: 36,
@@ -144,7 +146,7 @@ const Ce = M(
144
146
  {
145
147
  color: "var(--mantine-color-default-color)",
146
148
  size: 20,
147
- icon: Y
149
+ icon: W
148
150
  }
149
151
  )
150
152
  }
@@ -158,8 +160,8 @@ const Ce = M(
158
160
  style: {
159
161
  overflowY: "auto"
160
162
  },
161
- gap: 16,
162
- children: f ? /* @__PURE__ */ m(y, { flex: 1, align: "stretch", children: [
163
+ gap: "xs",
164
+ children: f ? /* @__PURE__ */ m(y, { flex: 1, align: "stretch", gap: 0, children: [
163
165
  /* @__PURE__ */ e(
164
166
  E,
165
167
  {
@@ -214,12 +216,13 @@ const Ce = M(
214
216
  E,
215
217
  {
216
218
  bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-6))",
217
- px: 4,
218
- py: 6,
219
+ px: 6,
220
+ py: 2,
221
+ h: 23,
219
222
  pos: "sticky",
220
223
  top: -1,
221
224
  style: { zIndex: 1 },
222
- children: /* @__PURE__ */ e(b, { fz: "xs", fw: 500, lh: "140%", c: "dimmed", children: o.id || k("noCat") })
225
+ children: /* @__PURE__ */ e(b, { fz: "xs", fw: 500, lh: "140%", c: "dimmed", children: o.id || x("noCat") })
223
226
  }
224
227
  ),
225
228
  /* @__PURE__ */ e(N, { cols: 10, spacing: 0, children: o.icons.map((t) => {
@@ -9,6 +9,7 @@ export interface EntityIconData {
9
9
  isFolder?: boolean;
10
10
  pathById?: string[];
11
11
  isOpen?: boolean;
12
+ avatarUrl?: string | null;
12
13
  }
13
14
  export declare const EntityIcon: <T extends EntityIconData>({ item, }: {
14
15
  item?: T;
@@ -1 +1 @@
1
- {"version":3,"file":"EntityIcon.d.ts","sourceRoot":"","sources":["../../src/components/EntityIcon.tsx"],"names":[],"mappings":"AA4BA,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAQD,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,cAAc,EAAE,WAElD;IACD,IAAI,CAAC,EAAE,CAAC,CAAC;CACV,mDAkJA,CAAC"}
1
+ {"version":3,"file":"EntityIcon.d.ts","sourceRoot":"","sources":["../../src/components/EntityIcon.tsx"],"names":[],"mappings":"AAgCA,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAQD,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,cAAc,EAAE,WAElD;IACD,IAAI,CAAC,EAAE,CAAC,CAAC;CACV,mDAmMA,CAAC"}