@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.
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +72 -79
- package/dist/components/AppContainer/AppContainer.module.css.js +6 -6
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +24 -22
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +46 -37
- package/dist/components/AppContainer/components/Header.d.ts.map +1 -1
- package/dist/components/AppContainer/components/Header.js +6 -5
- package/dist/components/AppContainer/components/Main.js +4 -4
- package/dist/components/AppContainer/components/SlideAnimation.js +4 -4
- package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
- package/dist/components/AppContainer/components/ToolSidebar.js +161 -128
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.d.ts.map +1 -1
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +131 -121
- 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 +59 -56
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +4 -3
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +37 -37
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +68 -62
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts +8 -0
- package/dist/components/AttachmentsGalleryModal/helpers.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/helpers.js +22 -17
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useDownloadFile.js +28 -25
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
- package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +36 -41
- package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
- package/dist/components/AttachmentsPreview/AttachmentsPreview.js +135 -80
- package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +24 -14
- package/dist/components/BouncingLogo/BouncingLogo.d.ts +1 -3
- package/dist/components/BouncingLogo/BouncingLogo.d.ts.map +1 -1
- package/dist/components/BouncingLogo/BouncingLogo.js +14 -20
- package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -8
- package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +5 -5
- package/dist/components/Chat/ChatInput/ChatInput.module.css.js +40 -28
- package/dist/components/Chat/ChatInput/index.d.ts +29 -1
- package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatInput/index.js +178 -118
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts +3 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.d.ts.map +1 -0
- package/dist/components/Chat/ChatInput/smilePlusIcon.js +49 -0
- package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +9 -9
- package/dist/components/Chat/ChatMessage/index.d.ts +2 -0
- package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
- package/dist/components/Chat/ChatMessage/index.js +136 -118
- package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +4 -4
- package/dist/components/Chat/MessageActions/index.d.ts +7 -0
- package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageActions/index.js +33 -30
- package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -10
- package/dist/components/Chat/MessageList/index.d.ts +30 -3
- package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageList/index.js +154 -66
- package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +7 -7
- package/dist/components/Chat/MessageReactions/index.d.ts +17 -0
- package/dist/components/Chat/MessageReactions/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageReactions/index.js +60 -28
- package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +6 -4
- package/dist/components/Chat/MessageStatus/index.d.ts +1 -1
- package/dist/components/Chat/MessageStatus/index.d.ts.map +1 -1
- package/dist/components/Chat/MessageStatus/index.js +49 -34
- package/dist/components/CircleColorPicker/CircleColorPicker.d.ts.map +1 -1
- package/dist/components/CircleColorPicker/CircleColorPicker.js +17 -15
- package/dist/components/ColorPicker/ColorPicker.module.css.js +26 -20
- package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerList.js +81 -68
- package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPickerToolbar.js +75 -70
- package/dist/components/ColorPicker/icons.js +5 -5
- package/dist/components/ColorPicker/types.d.ts +6 -0
- package/dist/components/ColorPicker/types.d.ts.map +1 -1
- package/dist/components/ColorPicker/types.js +53 -11
- package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
- package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
- package/dist/components/ColorPicker/useRecentColors.js +43 -20
- package/dist/components/EmojiPicker/EmojiPanel.d.ts +2 -1
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +73 -72
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +16 -1
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.js +121 -86
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +28 -25
- package/dist/components/EntityIcon.d.ts +1 -0
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +80 -32
- package/dist/components/ErrorPage/components/Error403.d.ts +5 -1
- package/dist/components/ErrorPage/components/Error403.d.ts.map +1 -1
- package/dist/components/ErrorPage/components/Error403.js +25 -21
- package/dist/components/ErrorPage/index.d.ts +5 -1
- package/dist/components/ErrorPage/index.d.ts.map +1 -1
- package/dist/components/ErrorPage/index.js +17 -10
- package/dist/components/MusicPlayerBar/components/HoverActions.js +28 -28
- package/dist/components/NavMenu/NavMenu.d.ts +7 -1
- package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
- package/dist/components/NavMenu/NavMenu.js +54 -44
- package/dist/components/NavMenu/NavMenu.module.css.js +10 -10
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +84 -84
- package/dist/components/NavMenu/types.d.ts +4 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +16 -14
- package/dist/config/envConfig.d.ts +2 -0
- package/dist/config/envConfig.d.ts.map +1 -1
- package/dist/config/envConfig.js +41 -37
- package/dist/helpers/showNotifications.d.ts +15 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +114 -72
- package/dist/helpers/showNotifications.module.css.js +16 -4
- package/dist/hooks/useUiPref.d.ts +2 -0
- package/dist/hooks/useUiPref.d.ts.map +1 -0
- package/dist/hooks/useUiPref.js +80 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +550 -540
- package/dist/lang/locales/ui_en.json.js +1 -1
- package/dist/lang/locales/ui_es.json.js +1 -1
- package/dist/lang/locales/ui_ru.json.js +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,58 @@
|
|
|
1
|
-
function f(
|
|
2
|
-
return
|
|
1
|
+
function f(t) {
|
|
2
|
+
return t === "textColor" || t === "color";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function g(t) {
|
|
5
|
+
return f(t) ? "text" : "highlight";
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const h = typeof navigator < "u" && /Mac|iPhone|iPod|iPad/i.test(navigator.platform || navigator.userAgent), d = h ? "⌘⇧H" : "Ctrl+Shift+H";
|
|
8
|
+
function $(t) {
|
|
9
|
+
return typeof t == "string" ? { value: t } : t;
|
|
10
|
+
}
|
|
11
|
+
function p(t) {
|
|
12
|
+
return t === "inherit" || t === "" || t === "default";
|
|
13
|
+
}
|
|
14
|
+
function c(t) {
|
|
15
|
+
if (!t) return null;
|
|
16
|
+
const r = t.trim().toLowerCase();
|
|
17
|
+
if (r === "" || r === "inherit" || r === "default" || r === "transparent")
|
|
18
|
+
return "default";
|
|
19
|
+
const o = r.match(/^#([0-9a-f]{3,8})$/);
|
|
20
|
+
if (o) {
|
|
21
|
+
let n = o[1];
|
|
22
|
+
if ((n.length === 3 || n.length === 4) && (n = n.split("").map((e) => e + e).join("")), n.length === 6 || n.length === 8) {
|
|
23
|
+
const e = parseInt(n.slice(0, 2), 16), a = parseInt(n.slice(2, 4), 16), i = parseInt(n.slice(4, 6), 16), l = n.length === 8 ? parseInt(n.slice(6, 8), 16) / 255 : 1;
|
|
24
|
+
return `${e},${a},${i},${Math.round(l * 1e3) / 1e3}`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const s = r.match(/^rgba?\(([^)]+)\)$/);
|
|
28
|
+
if (s) {
|
|
29
|
+
const n = s[1].split(",").map((e) => e.trim());
|
|
30
|
+
if (n.length >= 3) {
|
|
31
|
+
const e = parseInt(n[0], 10), a = parseInt(n[1], 10), i = parseInt(n[2], 10), l = n[3] !== void 0 ? parseFloat(n[3]) : 1;
|
|
32
|
+
if (![e, a, i].some(Number.isNaN)) {
|
|
33
|
+
const u = Number.isNaN(l) ? 1 : l;
|
|
34
|
+
return `${e},${a},${i},${Math.round(u * 1e3) / 1e3}`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return r;
|
|
39
|
+
}
|
|
40
|
+
function m(t, r) {
|
|
41
|
+
const o = c(t), s = c(r);
|
|
42
|
+
return o !== null && s !== null && o === s;
|
|
43
|
+
}
|
|
44
|
+
const C = (t, r, o) => {
|
|
45
|
+
if (o) return o;
|
|
46
|
+
const s = !r || p(r) ? "standard" : r;
|
|
47
|
+
return t(`colorPicker.colors.${s}`, { defaultValue: r || "" });
|
|
11
48
|
};
|
|
12
49
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
50
|
+
h as IS_APPLE,
|
|
51
|
+
d as RECENT_COLOR_HOTKEY,
|
|
52
|
+
m as colorsEqual,
|
|
53
|
+
p as isDefaultColor,
|
|
54
|
+
f as isTextSectionKey,
|
|
55
|
+
$ as normalizeColorItem,
|
|
56
|
+
C as resolveColorLabel,
|
|
57
|
+
g as resolveRecentKind
|
|
16
58
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { RecentColorEntry } from './types';
|
|
1
|
+
import type { RecentColorEntry, RecentColorKind } from './types';
|
|
2
2
|
interface UseRecentColorsOptions {
|
|
3
3
|
storageKey?: string;
|
|
4
4
|
maxItems?: number;
|
|
5
|
+
onApplyShortcut?: (color: string, kind: RecentColorKind) => void;
|
|
6
|
+
shortcutScoped?: boolean;
|
|
5
7
|
}
|
|
6
8
|
export declare function useRecentColors(options?: UseRecentColorsOptions): {
|
|
7
9
|
recentColors: RecentColorEntry[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRecentColors.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/useRecentColors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useRecentColors.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/useRecentColors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQjE,UAAU,sBAAsB;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IACjE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA2BD,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,sBAAsB;;uBAepD,MAAM,eAAe,MAAM,WAAW,MAAM;;;EAkDvD"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useState as R, useCallback as f, useRef as A, useEffect as w } from "react";
|
|
2
|
+
import { resolveRecentKind as I, IS_APPLE as C } from "./types.js";
|
|
3
|
+
const k = "color-picker-recent", L = 11;
|
|
4
|
+
let i = 0;
|
|
5
|
+
function a(e) {
|
|
4
6
|
try {
|
|
5
7
|
const t = localStorage.getItem(e);
|
|
6
8
|
return t ? JSON.parse(t) : [];
|
|
@@ -8,32 +10,53 @@ function n(e) {
|
|
|
8
10
|
return [];
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
|
-
function
|
|
13
|
+
function T(e, t, r) {
|
|
12
14
|
try {
|
|
13
|
-
localStorage.setItem(e, JSON.stringify(t.slice(0,
|
|
15
|
+
localStorage.setItem(e, JSON.stringify(t.slice(0, r)));
|
|
14
16
|
} catch {
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
function _(e) {
|
|
20
|
+
return e.code !== "KeyH" || !e.shiftKey || e.altKey ? !1 : C ? e.metaKey && !e.ctrlKey : e.ctrlKey && !e.metaKey;
|
|
21
|
+
}
|
|
22
|
+
function F(e) {
|
|
23
|
+
const t = e?.storageKey ?? k, r = e?.maxItems ?? L, l = e?.onApplyShortcut, s = e?.shortcutScoped ?? !1, [p, u] = R(
|
|
24
|
+
() => a(t)
|
|
25
|
+
), h = f(() => {
|
|
26
|
+
u(a(t));
|
|
27
|
+
}, [t]), K = f(
|
|
28
|
+
(o, c, n) => {
|
|
29
|
+
const g = a(t).filter(
|
|
30
|
+
(S) => !(S.value === o && S.sectionKey === c)
|
|
31
|
+
), m = [{ value: o, sectionKey: c, border: n }, ...g].slice(
|
|
32
|
+
0,
|
|
33
|
+
r
|
|
34
|
+
);
|
|
35
|
+
T(t, m, r), u(m);
|
|
26
36
|
},
|
|
27
|
-
[t,
|
|
28
|
-
),
|
|
37
|
+
[t, r]
|
|
38
|
+
), E = f(() => {
|
|
29
39
|
try {
|
|
30
40
|
localStorage.removeItem(t);
|
|
31
41
|
} catch {
|
|
32
42
|
}
|
|
33
|
-
|
|
34
|
-
}, [t]);
|
|
35
|
-
|
|
43
|
+
u([]);
|
|
44
|
+
}, [t]), y = A(l);
|
|
45
|
+
y.current = l;
|
|
46
|
+
const d = !!l;
|
|
47
|
+
return w(() => {
|
|
48
|
+
if (!d) return;
|
|
49
|
+
s && (i += 1);
|
|
50
|
+
const o = (c) => {
|
|
51
|
+
if (!_(c) || !s && i > 0) return;
|
|
52
|
+
const n = a(t)[0];
|
|
53
|
+
n && (c.preventDefault(), y.current?.(n.value, I(n.sectionKey)));
|
|
54
|
+
};
|
|
55
|
+
return window.addEventListener("keydown", o), () => {
|
|
56
|
+
window.removeEventListener("keydown", o), s && (i -= 1);
|
|
57
|
+
};
|
|
58
|
+
}, [d, s, t]), { recentColors: p, addRecent: K, clearRecent: E, reload: h };
|
|
36
59
|
}
|
|
37
60
|
export {
|
|
38
|
-
|
|
61
|
+
F as useRecentColors
|
|
39
62
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EmojiPickerProps } from './EmojiPicker';
|
|
2
|
-
export declare const EmojiPanel: ({ locales, onChange, onClose, setRandomIcon, querySearch, }: Pick<EmojiPickerProps, "locales" | "value" | "onChange" | "querySearch"> & {
|
|
2
|
+
export declare const EmojiPanel: ({ locales, onChange, onClose, setRandomIcon, querySearch, showRandomButton, }: Pick<EmojiPickerProps, "locales" | "value" | "onChange" | "querySearch"> & {
|
|
3
3
|
onClose: () => void;
|
|
4
4
|
setRandomIcon: (icon: string) => void;
|
|
5
|
+
showRandomButton?: boolean;
|
|
5
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
//# sourceMappingURL=EmojiPanel.d.ts.map
|
|
@@ -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,
|
|
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,+EAOxB,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;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,4CAqTA,CAAC"}
|
|
@@ -1,61 +1,62 @@
|
|
|
1
1
|
import { jsxs as y, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as d, useRef as p, useEffect as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { Search01Icon as
|
|
2
|
+
import { useState as d, useRef as p, useEffect as A, useCallback as L } from "react";
|
|
3
|
+
import { useTranslation as U } from "react-i18next";
|
|
4
|
+
import { Search01Icon as V, ShuffleIcon as W, Clock01Icon as X, SmileIcon as Z, Pizza01Icon as _, FootballIcon as ee, Airplane01Icon as te, BulbIcon as oe, Asterisk02Icon as re, Flag02Icon as ne } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as c } from "@hugeicons/react";
|
|
6
|
-
import { useEvent as
|
|
7
|
-
import { Stack as v, FocusTrap as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { pickRandomEmoji as
|
|
11
|
-
import { NoData as
|
|
12
|
-
import { IconEntity as
|
|
13
|
-
import { frequentEmoji as
|
|
14
|
-
import { getEmojis as
|
|
6
|
+
import { useEvent as ie } from "@layers-app/draggable-ui";
|
|
7
|
+
import { Stack as v, FocusTrap as ce, Flex as z, TextInput as se, Tooltip as ae, ActionIcon as F, Paper as q, Text as N, SimpleGrid as M } from "@mantine/core";
|
|
8
|
+
import le from "fuse.js";
|
|
9
|
+
import fe from "../../assets/svg/dog.svg.js";
|
|
10
|
+
import { pickRandomEmoji as ue } from "../../helpers/pickRandomEmoji.js";
|
|
11
|
+
import { NoData as de } from "../NoData/NoData.js";
|
|
12
|
+
import { IconEntity as pe } from "../ProjectIcon/ProjectIcon.js";
|
|
13
|
+
import { frequentEmoji as me } from "./constants.js";
|
|
14
|
+
import { getEmojis as he } from "./utils.js";
|
|
15
15
|
import T from "./EmojiPicker.module.css.js";
|
|
16
|
-
const
|
|
17
|
-
{ i: "frequent", icon: /* @__PURE__ */ t(c, { size: 20, icon:
|
|
18
|
-
{ i: "people", icon: /* @__PURE__ */ t(c, { size: 20, icon:
|
|
16
|
+
const ge = [
|
|
17
|
+
{ i: "frequent", icon: /* @__PURE__ */ t(c, { size: 20, icon: X }) },
|
|
18
|
+
{ i: "people", icon: /* @__PURE__ */ t(c, { size: 20, icon: Z }) },
|
|
19
19
|
{
|
|
20
20
|
i: "nature",
|
|
21
|
-
icon: /* @__PURE__ */ t(
|
|
21
|
+
icon: /* @__PURE__ */ t(fe, { width: 20, height: 20 })
|
|
22
22
|
},
|
|
23
|
-
{ i: "foods", icon: /* @__PURE__ */ t(c, { size: 20, icon:
|
|
24
|
-
{ i: "activity", icon: /* @__PURE__ */ t(c, { size: 20, icon:
|
|
25
|
-
{ i: "places", icon: /* @__PURE__ */ t(c, { size: 20, icon:
|
|
26
|
-
{ i: "objects", icon: /* @__PURE__ */ t(c, { size: 20, icon:
|
|
27
|
-
{ i: "symbols", icon: /* @__PURE__ */ t(c, { size: 20, icon:
|
|
28
|
-
{ i: "flags", icon: /* @__PURE__ */ t(c, { size: 20, icon:
|
|
29
|
-
],
|
|
23
|
+
{ i: "foods", icon: /* @__PURE__ */ t(c, { size: 20, icon: _ }) },
|
|
24
|
+
{ i: "activity", icon: /* @__PURE__ */ t(c, { size: 20, icon: ee }) },
|
|
25
|
+
{ i: "places", icon: /* @__PURE__ */ t(c, { size: 20, icon: te }) },
|
|
26
|
+
{ i: "objects", icon: /* @__PURE__ */ t(c, { size: 20, icon: oe }) },
|
|
27
|
+
{ i: "symbols", icon: /* @__PURE__ */ t(c, { size: 20, icon: re }) },
|
|
28
|
+
{ i: "flags", icon: /* @__PURE__ */ t(c, { size: 20, icon: ne }) }
|
|
29
|
+
], Ae = ({
|
|
30
30
|
locales: u,
|
|
31
31
|
onChange: C,
|
|
32
|
-
onClose:
|
|
33
|
-
setRandomIcon:
|
|
34
|
-
querySearch: m
|
|
32
|
+
onClose: P,
|
|
33
|
+
setRandomIcon: Q,
|
|
34
|
+
querySearch: m,
|
|
35
|
+
showRandomButton: w = !0
|
|
35
36
|
}) => {
|
|
36
|
-
const [b, k] = d("frequent"), x = p("frequent"), h = p({}), I = p(null), [S,
|
|
37
|
-
|
|
37
|
+
const [b, k] = d("frequent"), x = p("frequent"), h = p({}), I = p(null), [S, E] = d(""), [O, G] = d([]), [a, H] = d(null), [j, D] = d([]), { t: Y } = U(), g = p(!1), l = p(null);
|
|
38
|
+
A(() => {
|
|
38
39
|
if (typeof m == "string") {
|
|
39
40
|
const e = m.slice(1);
|
|
40
|
-
if (
|
|
41
|
+
if (E(e), a) {
|
|
41
42
|
const o = a.search(e);
|
|
42
|
-
|
|
43
|
+
D(o.map((r) => r.item.e));
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
}, [m, a]),
|
|
46
|
+
}, [m, a]), A(() => {
|
|
46
47
|
(async () => {
|
|
47
|
-
const o = await
|
|
48
|
+
const o = await he(), r = o.flatMap(
|
|
48
49
|
(i) => i.e.map((n) => ({
|
|
49
50
|
e: n.e,
|
|
50
51
|
n: n.n,
|
|
51
52
|
k: n.k
|
|
52
53
|
// категория
|
|
53
54
|
}))
|
|
54
|
-
), s =
|
|
55
|
+
), s = me.map(
|
|
55
56
|
(i) => r.find((n) => n.e === i)
|
|
56
57
|
);
|
|
57
|
-
|
|
58
|
-
const f = new
|
|
58
|
+
G([{ i: "frequent", e: s }, ...o]);
|
|
59
|
+
const f = new le(
|
|
59
60
|
o.flatMap(
|
|
60
61
|
(i) => i.e.map((n) => ({
|
|
61
62
|
e: n.e,
|
|
@@ -68,32 +69,32 @@ const he = [
|
|
|
68
69
|
threshold: 0.3
|
|
69
70
|
}
|
|
70
71
|
);
|
|
71
|
-
|
|
72
|
+
H(f);
|
|
72
73
|
})();
|
|
73
74
|
}, []);
|
|
74
|
-
const
|
|
75
|
+
const $ = L(
|
|
75
76
|
(e) => {
|
|
76
77
|
const o = e.currentTarget.value;
|
|
77
|
-
if (
|
|
78
|
+
if (E(o), a) {
|
|
78
79
|
const r = a.search(o);
|
|
79
|
-
|
|
80
|
+
D(r.map((s) => s.item.e));
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
83
|
[a]
|
|
83
|
-
),
|
|
84
|
+
), R = ie((e) => {
|
|
84
85
|
const o = e.currentTarget.getAttribute("data-icon");
|
|
85
86
|
o && (C?.(
|
|
86
|
-
|
|
87
|
+
pe.stringify({
|
|
87
88
|
emoji: o.replace("e:", "")
|
|
88
89
|
})
|
|
89
|
-
),
|
|
90
|
-
}),
|
|
90
|
+
), P());
|
|
91
|
+
}), B = (e) => {
|
|
91
92
|
const o = I.current, r = h.current[e.i];
|
|
92
93
|
if (!o || !r) return;
|
|
93
94
|
g.current = !0, l.current = e.i, k(e.i);
|
|
94
95
|
const s = r.offsetTop - o.offsetTop;
|
|
95
96
|
o.scrollTo({ top: s, behavior: "smooth" });
|
|
96
|
-
},
|
|
97
|
+
}, J = () => {
|
|
97
98
|
const e = I.current;
|
|
98
99
|
if (!e) return;
|
|
99
100
|
const o = e.scrollTop;
|
|
@@ -112,9 +113,9 @@ const he = [
|
|
|
112
113
|
n < s && (s = n, r = f);
|
|
113
114
|
}
|
|
114
115
|
}), r !== x.current && (x.current = r, k(r));
|
|
115
|
-
},
|
|
116
|
+
}, K = typeof m == "string";
|
|
116
117
|
return /* @__PURE__ */ y(v, { gap: 0, h: "100%", children: [
|
|
117
|
-
/* @__PURE__ */ t(
|
|
118
|
+
/* @__PURE__ */ t(ce, { active: !0, children: /* @__PURE__ */ y(
|
|
118
119
|
z,
|
|
119
120
|
{
|
|
120
121
|
my: "sm",
|
|
@@ -125,9 +126,9 @@ const he = [
|
|
|
125
126
|
h: 38,
|
|
126
127
|
children: [
|
|
127
128
|
/* @__PURE__ */ t(
|
|
128
|
-
|
|
129
|
+
se,
|
|
129
130
|
{
|
|
130
|
-
leftSection: /* @__PURE__ */ t(c, { size: 16, icon:
|
|
131
|
+
leftSection: /* @__PURE__ */ t(c, { size: 16, icon: V }),
|
|
131
132
|
value: S,
|
|
132
133
|
placeholder: `${u?.search}...`,
|
|
133
134
|
"data-autofocus": !0,
|
|
@@ -137,26 +138,26 @@ const he = [
|
|
|
137
138
|
borderRadius: "var(--mantine-radius-default)"
|
|
138
139
|
}
|
|
139
140
|
},
|
|
140
|
-
w: 320,
|
|
141
|
-
onChange:
|
|
141
|
+
w: w ? 320 : "100%",
|
|
142
|
+
onChange: $,
|
|
142
143
|
radius: "var(--mantine-radius-default)"
|
|
143
144
|
}
|
|
144
145
|
),
|
|
145
|
-
/* @__PURE__ */ t(
|
|
146
|
-
|
|
146
|
+
w && /* @__PURE__ */ t(ae, { withArrow: !0, label: u?.random || Y("random"), children: /* @__PURE__ */ t(
|
|
147
|
+
F,
|
|
147
148
|
{
|
|
148
149
|
h: 36,
|
|
149
150
|
w: 36,
|
|
150
151
|
variant: "outline",
|
|
151
152
|
color: "var(--mantine-color-default-border)",
|
|
152
|
-
onClick: () =>
|
|
153
|
+
onClick: () => ue(Q, C),
|
|
153
154
|
className: T.randomIcon,
|
|
154
155
|
children: /* @__PURE__ */ t(
|
|
155
156
|
c,
|
|
156
157
|
{
|
|
157
158
|
color: "var(--mantine-color-default-color)",
|
|
158
159
|
size: 20,
|
|
159
|
-
icon:
|
|
160
|
+
icon: W
|
|
160
161
|
}
|
|
161
162
|
)
|
|
162
163
|
}
|
|
@@ -174,10 +175,10 @@ const he = [
|
|
|
174
175
|
overflowY: "auto"
|
|
175
176
|
},
|
|
176
177
|
ref: I,
|
|
177
|
-
onScroll:
|
|
178
|
-
children: S ? /* @__PURE__ */ y(v, { flex: 1, align: "stretch", children: [
|
|
179
|
-
!
|
|
180
|
-
|
|
178
|
+
onScroll: J,
|
|
179
|
+
children: S ? /* @__PURE__ */ y(v, { flex: 1, align: "stretch", gap: 0, children: [
|
|
180
|
+
!K && /* @__PURE__ */ t(
|
|
181
|
+
q,
|
|
181
182
|
{
|
|
182
183
|
py: 6,
|
|
183
184
|
px: 6,
|
|
@@ -185,20 +186,20 @@ const he = [
|
|
|
185
186
|
top: -1,
|
|
186
187
|
style: { zIndex: 1 },
|
|
187
188
|
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-6))",
|
|
188
|
-
children: /* @__PURE__ */ t(
|
|
189
|
+
children: /* @__PURE__ */ t(N, { fz: "xs", fw: 500, lh: "140%", c: "dimmed", children: u?.searchResults })
|
|
189
190
|
}
|
|
190
191
|
),
|
|
191
|
-
|
|
192
|
+
j.length ? /* @__PURE__ */ t(M, { cols: 10, spacing: 0, children: j.map((e) => /* @__PURE__ */ t(
|
|
192
193
|
"div",
|
|
193
194
|
{
|
|
194
195
|
className: T.item,
|
|
195
196
|
"data-icon": e,
|
|
196
|
-
onClick:
|
|
197
|
+
onClick: R,
|
|
197
198
|
children: e
|
|
198
199
|
},
|
|
199
200
|
e
|
|
200
201
|
)) }) : /* @__PURE__ */ t(z, { flex: 1, justify: "center", align: "stretch", children: /* @__PURE__ */ t(
|
|
201
|
-
|
|
202
|
+
de,
|
|
202
203
|
{
|
|
203
204
|
size: 100,
|
|
204
205
|
description: u?.searchNoResults,
|
|
@@ -207,7 +208,7 @@ const he = [
|
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
210
|
) })
|
|
210
|
-
] }) :
|
|
211
|
+
] }) : O.map((e) => /* @__PURE__ */ y(
|
|
211
212
|
"div",
|
|
212
213
|
{
|
|
213
214
|
ref: (o) => {
|
|
@@ -215,24 +216,24 @@ const he = [
|
|
|
215
216
|
},
|
|
216
217
|
children: [
|
|
217
218
|
/* @__PURE__ */ t(
|
|
218
|
-
|
|
219
|
+
q,
|
|
219
220
|
{
|
|
220
|
-
bg: "
|
|
221
|
+
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-6))",
|
|
221
222
|
py: 2,
|
|
222
223
|
px: 6,
|
|
223
224
|
pos: "sticky",
|
|
224
225
|
top: -1,
|
|
225
226
|
h: 23,
|
|
226
227
|
style: { zIndex: 1 },
|
|
227
|
-
children: /* @__PURE__ */ t(
|
|
228
|
+
children: /* @__PURE__ */ t(N, { fz: "xs", fw: 500, lh: "140%", c: "dimmed", children: u?.emojiCategory?.[e.i] })
|
|
228
229
|
}
|
|
229
230
|
),
|
|
230
|
-
/* @__PURE__ */ t(
|
|
231
|
+
/* @__PURE__ */ t(M, { cols: 10, spacing: 0, children: e.e.map((o) => /* @__PURE__ */ t(
|
|
231
232
|
"div",
|
|
232
233
|
{
|
|
233
234
|
className: T.item,
|
|
234
235
|
"data-icon": o.e,
|
|
235
|
-
onClick:
|
|
236
|
+
onClick: R,
|
|
236
237
|
children: o.e
|
|
237
238
|
},
|
|
238
239
|
o.e
|
|
@@ -252,14 +253,14 @@ const he = [
|
|
|
252
253
|
justify: "space-between",
|
|
253
254
|
h: "56px",
|
|
254
255
|
px: 8,
|
|
255
|
-
children:
|
|
256
|
-
|
|
256
|
+
children: ge.map((e) => /* @__PURE__ */ t(
|
|
257
|
+
F,
|
|
257
258
|
{
|
|
258
259
|
variant: b === e.i ? "light" : "subtle",
|
|
259
260
|
color: b === e.i ? "var(--mantine-color-default-color)" : "var(--mantine-color-dimmed)",
|
|
260
261
|
radius: "default",
|
|
261
262
|
size: 32,
|
|
262
|
-
onClick: () =>
|
|
263
|
+
onClick: () => B(e),
|
|
263
264
|
"data-active": b === e.i,
|
|
264
265
|
children: e.icon
|
|
265
266
|
},
|
|
@@ -270,5 +271,5 @@ const he = [
|
|
|
270
271
|
] });
|
|
271
272
|
};
|
|
272
273
|
export {
|
|
273
|
-
|
|
274
|
+
Ae as EmojiPanel
|
|
274
275
|
};
|
|
@@ -12,6 +12,14 @@ export type EmojiPickerProps = {
|
|
|
12
12
|
showIcons?: boolean;
|
|
13
13
|
showColors?: boolean;
|
|
14
14
|
showEmojis?: boolean;
|
|
15
|
+
showGifs?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Called when a GIF is picked from the GIF tab. Receives the GIF's URL.
|
|
18
|
+
* Distinct from {@link onChange} because hosts treat a GIF differently from
|
|
19
|
+
* an emoji/icon — chat composers send it as a message rather than inserting
|
|
20
|
+
* it into the text.
|
|
21
|
+
*/
|
|
22
|
+
onSelectGif?: (url: string) => void;
|
|
15
23
|
querySearch?: string;
|
|
16
24
|
defaultActiveTab?: string | null;
|
|
17
25
|
/** Controls how the popover opens. 'click' preserves current behavior; 'realtime' opens only when typing matches triggerRegex. */
|
|
@@ -22,6 +30,12 @@ export type EmojiPickerProps = {
|
|
|
22
30
|
typingSeq?: number;
|
|
23
31
|
/** If true, clicking the random icon button will not close the popover. Default: false */
|
|
24
32
|
keepOpenOnRandom?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Show the "Random" (shuffle) button next to the search field. Default: true.
|
|
35
|
+
* Connect chat composer + message reactions pass false — a random emoji is
|
|
36
|
+
* meaningless there.
|
|
37
|
+
*/
|
|
38
|
+
showRandomButton?: boolean;
|
|
25
39
|
/**
|
|
26
40
|
* If false, picking an emoji does NOT close the popover — useful for chat
|
|
27
41
|
* composers where users typically want to insert several emoji at once.
|
|
@@ -39,7 +53,8 @@ export type EmojiPickerLocales = {
|
|
|
39
53
|
remove?: string;
|
|
40
54
|
random?: string;
|
|
41
55
|
icons?: string;
|
|
56
|
+
gifs?: string;
|
|
42
57
|
emojiCategory?: Record<string, string>;
|
|
43
58
|
};
|
|
44
|
-
export declare const EmojiPicker: ({ project, value, querySearch, children, onChange, position, popoverProps, showIcons, showColors, defaultActiveTab, showEmojis, withinPortal, locales: _locales, openWhen, triggerRegex, typingSeq, showRemoveButton, keepOpenOnRandom, closeOnSelect, }: PropsWithChildren<EmojiPickerProps>) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare const EmojiPicker: ({ project, value, querySearch, children, onChange, position, popoverProps, showIcons, showColors, showGifs, onSelectGif, defaultActiveTab, showEmojis, withinPortal, locales: _locales, openWhen, triggerRegex, typingSeq, showRemoveButton, keepOpenOnRandom, showRandomButton, closeOnSelect, }: PropsWithChildren<EmojiPickerProps>) => import("react/jsx-runtime").JSX.Element;
|
|
45
60
|
//# 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;
|
|
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;AAWvB,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,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,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;IAC3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,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,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,mSAuBzB,iBAAiB,CAAC,gBAAgB,CAAC,4CA2PrC,CAAC"}
|