@webinex/chatify 2.0.0-alpha10 → 2.0.0-alpha12
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/{Chatify-DGRV4QKP.js → Chatify-CwAfN1wu.js} +310 -117
- package/dist/Chatify-CwAfN1wu.js.map +1 -0
- package/dist/Chatify.css +54 -7
- package/dist/audit.js +2 -2
- package/dist/audit.js.map +1 -1
- package/dist/index.js +82 -75
- package/dist/types/audit/auditApi.d.ts +5 -1
- package/dist/types/core/client.d.ts +4 -1
- package/dist/types/ui/ChatGroup/AutoReply/AutoReplyButton.d.ts +1 -0
- package/dist/types/ui/ChatGroup/AutoReply/AutoReplyForm.d.ts +12 -0
- package/dist/types/ui/ChatGroup/AutoReply/AutoReplyPanel.d.ts +1 -0
- package/dist/types/ui/ChatGroup/AutoReply/AutoReplyPeriodInput.d.ts +4 -0
- package/dist/types/ui/ChatGroup/AutoReply/AutoReplyTextInput.d.ts +4 -0
- package/dist/types/ui/ChatGroup/AutoReply/index.d.ts +17 -0
- package/dist/types/ui/ChatGroup/ChatGroupContext.d.ts +2 -1
- package/dist/types/ui/ChatGroup/ChatGroupPanel.d.ts +2 -1
- package/dist/types/ui/ChatGroup/Layout/ChatGroupActions.d.ts +1 -0
- package/dist/types/ui/ChatGroup/Layout/index.d.ts +3 -0
- package/dist/types/ui/ChatGroup/index.d.ts +1 -0
- package/dist/types/ui/common/Icon.d.ts +1 -0
- package/dist/types/ui/localizer.d.ts +15 -0
- package/package.json +1 -1
- package/src/audit/AuditSearch.tsx +1 -1
- package/src/core/api/api.ts +16 -2
- package/src/core/client.ts +13 -2
- package/src/styles/index.scss +65 -6
- package/src/ui/Chat/Members/ChatMembersPanel.tsx +2 -2
- package/src/ui/ChatGroup/AutoReply/AutoReplyButton.tsx +21 -0
- package/src/ui/ChatGroup/AutoReply/AutoReplyForm.tsx +50 -0
- package/src/ui/ChatGroup/AutoReply/AutoReplyPanel.tsx +94 -0
- package/src/ui/ChatGroup/AutoReply/AutoReplyPeriodInput.tsx +22 -0
- package/src/ui/ChatGroup/AutoReply/AutoReplyTextInput.tsx +22 -0
- package/src/ui/ChatGroup/AutoReply/index.ts +19 -0
- package/src/ui/ChatGroup/ChatGroupContext.tsx +12 -1
- package/src/ui/ChatGroup/ChatGroupPanel.tsx +2 -0
- package/src/ui/ChatGroup/Create/CreateChatMemberInput.tsx +1 -1
- package/src/ui/ChatGroup/Layout/ChatGroupActions.tsx +15 -0
- package/src/ui/ChatGroup/Layout/ChatGroupAside.tsx +2 -2
- package/src/ui/ChatGroup/Layout/ChatGroupMain.tsx +2 -0
- package/src/ui/ChatGroup/Layout/index.ts +3 -0
- package/src/ui/ChatGroup/index.ts +1 -0
- package/src/ui/common/Icon.tsx +2 -0
- package/src/ui/localizer.tsx +29 -0
- package/dist/Chatify-DGRV4QKP.js.map +0 -1
- package/dist/types/core/api/api.d.ts +0 -17295
|
@@ -2,9 +2,9 @@ import './Chatify.css';var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
|
-
import { Button, Avatar as Avatar$1, List, Space, Tooltip, Input, Skeleton, Menu, Row, Col, Form, Checkbox } from "antd";
|
|
5
|
+
import { Button, Avatar as Avatar$1, List, Space, Tooltip, Input, Skeleton, Menu, Row, Col, Form, DatePicker, Checkbox } from "antd";
|
|
6
6
|
import React, { useContext, useState, useMemo, forwardRef, useCallback, useRef, useEffect, memo, useLayoutEffect } from "react";
|
|
7
|
-
import { DownloadOutlined, DeleteOutlined, EyeInvisibleOutlined, EyeOutlined, TeamOutlined, CloseOutlined, EditOutlined, UsergroupAddOutlined, UserAddOutlined, UsergroupDeleteOutlined, UserDeleteOutlined, SendOutlined, PaperClipOutlined } from "@ant-design/icons";
|
|
7
|
+
import { SettingOutlined, DownloadOutlined, DeleteOutlined, EyeInvisibleOutlined, EyeOutlined, TeamOutlined, CloseOutlined, EditOutlined, UsergroupAddOutlined, UserAddOutlined, UsergroupDeleteOutlined, UserDeleteOutlined, SendOutlined, PaperClipOutlined } from "@ant-design/icons";
|
|
8
8
|
import { createApi, fakeBaseQuery } from "@reduxjs/toolkit/query/react";
|
|
9
9
|
import { useSelector } from "react-redux";
|
|
10
10
|
import * as SignalR from "@microsoft/signalr";
|
|
@@ -67,7 +67,8 @@ const ICONS = {
|
|
|
67
67
|
watch: EyeOutlined,
|
|
68
68
|
unwatch: EyeInvisibleOutlined,
|
|
69
69
|
"delete-file": DeleteOutlined,
|
|
70
|
-
"open-file": DownloadOutlined
|
|
70
|
+
"open-file": DownloadOutlined,
|
|
71
|
+
settings: SettingOutlined
|
|
71
72
|
};
|
|
72
73
|
const Icon = customize("Icon", (props) => {
|
|
73
74
|
const { type } = props;
|
|
@@ -259,8 +260,17 @@ class ChatifyClient {
|
|
|
259
260
|
this._reconnectSubscribers.push(subscriber);
|
|
260
261
|
return () => this._reconnectSubscribers.filter((x) => x !== subscriber);
|
|
261
262
|
});
|
|
262
|
-
__publicField(this, "accounts", async () => {
|
|
263
|
-
|
|
263
|
+
__publicField(this, "accounts", async (args) => {
|
|
264
|
+
var _a;
|
|
265
|
+
const searchParams = new URLSearchParams();
|
|
266
|
+
(_a = args == null ? void 0 : args.ids) == null ? void 0 : _a.forEach((id) => {
|
|
267
|
+
searchParams.append("ids", encodeURIComponent(id));
|
|
268
|
+
});
|
|
269
|
+
const { data } = await this.axios.get(`account?${searchParams.toString()}`);
|
|
270
|
+
return data;
|
|
271
|
+
});
|
|
272
|
+
__publicField(this, "currentUserAccount", async () => {
|
|
273
|
+
const { data } = await this.axios.get("account/me");
|
|
264
274
|
return data;
|
|
265
275
|
});
|
|
266
276
|
__publicField(this, "updateAccount", async (request) => {
|
|
@@ -384,9 +394,20 @@ const __chatifyApi = __baseApi.injectEndpoints({
|
|
|
384
394
|
// ============== ACCOUNT ======================
|
|
385
395
|
// ====================================================
|
|
386
396
|
getAccountList: builder.query({
|
|
387
|
-
queryFn: async () => ({ data: await __settings.client.accounts() }),
|
|
397
|
+
queryFn: async (args) => ({ data: await __settings.client.accounts(args) }),
|
|
388
398
|
providesTags: ["account"]
|
|
389
399
|
}),
|
|
400
|
+
geCurrentUserAccount: builder.query({
|
|
401
|
+
queryFn: async () => ({ data: await __settings.client.currentUserAccount() }),
|
|
402
|
+
providesTags: ["account"]
|
|
403
|
+
}),
|
|
404
|
+
updateAccount: builder.mutation({
|
|
405
|
+
queryFn: async (request) => {
|
|
406
|
+
await __settings.client.updateAccount(request);
|
|
407
|
+
return { data: null };
|
|
408
|
+
},
|
|
409
|
+
invalidatesTags: ["account"]
|
|
410
|
+
}),
|
|
390
411
|
// ====================================================
|
|
391
412
|
// ================ CHAT =======================
|
|
392
413
|
// ====================================================
|
|
@@ -929,7 +950,7 @@ function useRemove(chatId2, accountId, deleteHistory) {
|
|
|
929
950
|
const ChatMemberListItem = customize("ChatMemberListItem", (props) => {
|
|
930
951
|
const { chatId: chatId2 } = props;
|
|
931
952
|
const { data: chat } = chatifyApi.useGetChatQuery({ id: chatId2 });
|
|
932
|
-
const { data: accounts } = chatifyApi.useGetAccountListQuery();
|
|
953
|
+
const { data: accounts } = chatifyApi.useGetAccountListQuery({});
|
|
933
954
|
const account = accounts.find((x) => x.id === props.id);
|
|
934
955
|
const isMember = chat.members.some((x) => x.id === account.id);
|
|
935
956
|
const [onAddWithoutHistory] = useAdd(chatId2, account.id, false);
|
|
@@ -971,7 +992,7 @@ const ChatMemberListItem = customize("ChatMemberListItem", (props) => {
|
|
|
971
992
|
const ChatMembersPanel = customize("ChatMembersPanel", () => {
|
|
972
993
|
const { id } = useChatContext();
|
|
973
994
|
const { data: chat } = chatifyApi.useGetChatQuery({ id });
|
|
974
|
-
const { data: accounts } = chatifyApi.useGetAccountListQuery();
|
|
995
|
+
const { data: accounts } = chatifyApi.useGetAccountListQuery({});
|
|
975
996
|
const ordered = useMemo(
|
|
976
997
|
() => accounts == null ? void 0 : accounts.slice().sort(
|
|
977
998
|
(a, b) => ((chat == null ? void 0 : chat.members.some((m) => m.id === a.id)) ? -100 : 0) - ((chat == null ? void 0 : chat.members.some((m) => m.id === b.id)) ? -100 : 0) + a.name.localeCompare(b.name)
|
|
@@ -1110,6 +1131,18 @@ const base = {
|
|
|
1110
1131
|
},
|
|
1111
1132
|
chatList: {
|
|
1112
1133
|
topShown: (count) => `Latest active ${count} chat${count !== 1 ? "s" : ""} shown`
|
|
1134
|
+
},
|
|
1135
|
+
autoReply: {
|
|
1136
|
+
buttonTitle: () => "Auto-reply",
|
|
1137
|
+
title: () => "Auto-reply",
|
|
1138
|
+
period: {
|
|
1139
|
+
label: () => "Period",
|
|
1140
|
+
required: () => "Please select start and end date",
|
|
1141
|
+
format: () => "DD/MM/YYYY"
|
|
1142
|
+
},
|
|
1143
|
+
text: { label: () => "Message", required: () => "Please enter message" },
|
|
1144
|
+
submitBtn: () => "Submit",
|
|
1145
|
+
clearBtn: () => "Clear"
|
|
1113
1146
|
}
|
|
1114
1147
|
};
|
|
1115
1148
|
const defaultLocalizer = base;
|
|
@@ -1804,6 +1837,183 @@ function ChatPanel(props) {
|
|
|
1804
1837
|
const { data: chat } = chatifyApi.useGetChatQuery({ id });
|
|
1805
1838
|
return /* @__PURE__ */ jsx("div", { className: `wxchtf-chatify wxchtf-chat-panel ${className}`, style, children: /* @__PURE__ */ jsx(LocalizerContext.Provider, { value: localizer, children: /* @__PURE__ */ jsx(CustomizeContext.Provider, { value: customize2, children: chat && /* @__PURE__ */ jsx(ChatView, { value: chat }, id) }) }) });
|
|
1806
1839
|
}
|
|
1840
|
+
const ChatGroupReactContext = React.createContext(null);
|
|
1841
|
+
function useChatGroupContext() {
|
|
1842
|
+
return useContext(ChatGroupReactContext);
|
|
1843
|
+
}
|
|
1844
|
+
function ChatGroupContext(props) {
|
|
1845
|
+
const { children } = props;
|
|
1846
|
+
const [state, setState] = useState({
|
|
1847
|
+
chatId: null,
|
|
1848
|
+
view: null,
|
|
1849
|
+
showMembers: false
|
|
1850
|
+
});
|
|
1851
|
+
const value = useMemo(
|
|
1852
|
+
() => ({
|
|
1853
|
+
...state,
|
|
1854
|
+
openChat: (chatId2) => setState((prev) => ({ ...prev, view: "chat", chatId: chatId2 })),
|
|
1855
|
+
none: () => setState((prev) => ({ ...prev, view: null, chatId: null })),
|
|
1856
|
+
toggleMembers: () => setState((prev) => ({ ...prev, showMembers: !prev.showMembers })),
|
|
1857
|
+
toggleNewChat: () => setState((prev) => {
|
|
1858
|
+
if (prev.view === "new-chat" && !prev.chatId) {
|
|
1859
|
+
return { ...prev, view: null };
|
|
1860
|
+
} else if (prev.view === "new-chat" && prev.chatId) {
|
|
1861
|
+
return { ...prev, view: "chat" };
|
|
1862
|
+
} else {
|
|
1863
|
+
return { ...prev, view: "new-chat" };
|
|
1864
|
+
}
|
|
1865
|
+
}),
|
|
1866
|
+
toggleAutoReply: () => setState((prev) => {
|
|
1867
|
+
if (prev.view === "auto-reply" && prev.chatId) {
|
|
1868
|
+
return { ...prev, view: "chat" };
|
|
1869
|
+
} else if (prev.view === "auto-reply" && !prev.chatId) {
|
|
1870
|
+
return { ...prev, view: null };
|
|
1871
|
+
} else {
|
|
1872
|
+
return { ...prev, view: "auto-reply" };
|
|
1873
|
+
}
|
|
1874
|
+
})
|
|
1875
|
+
}),
|
|
1876
|
+
[state]
|
|
1877
|
+
);
|
|
1878
|
+
return /* @__PURE__ */ jsx(ChatGroupReactContext.Provider, { value, children });
|
|
1879
|
+
}
|
|
1880
|
+
const AutoReplyButton = customize("AutoReplyButton", () => {
|
|
1881
|
+
const { toggleAutoReply } = useChatGroupContext();
|
|
1882
|
+
const localizer = useLocalizer();
|
|
1883
|
+
const titleText = localizer.autoReply.buttonTitle();
|
|
1884
|
+
return /* @__PURE__ */ jsx(
|
|
1885
|
+
Button,
|
|
1886
|
+
{
|
|
1887
|
+
className: "wxchtf-add-btn-settings",
|
|
1888
|
+
onClick: toggleAutoReply,
|
|
1889
|
+
icon: /* @__PURE__ */ jsx(Icon, { type: "settings" }),
|
|
1890
|
+
title: titleText,
|
|
1891
|
+
"aria-label": titleText
|
|
1892
|
+
}
|
|
1893
|
+
);
|
|
1894
|
+
});
|
|
1895
|
+
const AutoReplyPeriodInput = customize("AutoReplyPeriodInput", (props) => {
|
|
1896
|
+
const { name } = props;
|
|
1897
|
+
const localizer = useLocalizer();
|
|
1898
|
+
return /* @__PURE__ */ jsx(
|
|
1899
|
+
Form.Item,
|
|
1900
|
+
{
|
|
1901
|
+
label: localizer.autoReply.period.label(),
|
|
1902
|
+
name,
|
|
1903
|
+
rules: [{ required: true, message: localizer.autoReply.period.required() }],
|
|
1904
|
+
children: /* @__PURE__ */ jsx(DatePicker.RangePicker, { format: localizer.autoReply.period.format() })
|
|
1905
|
+
}
|
|
1906
|
+
);
|
|
1907
|
+
});
|
|
1908
|
+
const AutoReplyTextInput = customize("AutoReplyTextInput", (props) => {
|
|
1909
|
+
const { name } = props;
|
|
1910
|
+
const localizer = useLocalizer();
|
|
1911
|
+
return /* @__PURE__ */ jsx(
|
|
1912
|
+
Form.Item,
|
|
1913
|
+
{
|
|
1914
|
+
label: localizer.autoReply.text.label(),
|
|
1915
|
+
name,
|
|
1916
|
+
rules: [{ required: true, message: localizer.autoReply.text.required() }],
|
|
1917
|
+
children: /* @__PURE__ */ jsx(Input.TextArea, { rows: 4 })
|
|
1918
|
+
}
|
|
1919
|
+
);
|
|
1920
|
+
});
|
|
1921
|
+
const AUTO_REPLY_FORM_INITIAL_VALUE = {
|
|
1922
|
+
period: [],
|
|
1923
|
+
text: ""
|
|
1924
|
+
};
|
|
1925
|
+
const AutoReplyForm = customize("AutoReplyForm", (props) => {
|
|
1926
|
+
const { value, busy = false, onSubmit } = props;
|
|
1927
|
+
const localizer = useLocalizer();
|
|
1928
|
+
const [form] = Form.useForm();
|
|
1929
|
+
useEffect(() => {
|
|
1930
|
+
form.setFieldsValue(value);
|
|
1931
|
+
}, [value, form]);
|
|
1932
|
+
return /* @__PURE__ */ jsxs(
|
|
1933
|
+
Form,
|
|
1934
|
+
{
|
|
1935
|
+
form,
|
|
1936
|
+
layout: "vertical",
|
|
1937
|
+
onFinish: onSubmit,
|
|
1938
|
+
disabled: busy,
|
|
1939
|
+
initialValues: value,
|
|
1940
|
+
children: [
|
|
1941
|
+
/* @__PURE__ */ jsx(AutoReplyPeriodInput, { name: "period" }),
|
|
1942
|
+
/* @__PURE__ */ jsx(AutoReplyTextInput, { name: "text" }),
|
|
1943
|
+
/* @__PURE__ */ jsx(Button, { loading: busy, type: "primary", block: true, htmlType: "submit", children: localizer.autoReply.submitBtn() })
|
|
1944
|
+
]
|
|
1945
|
+
}
|
|
1946
|
+
);
|
|
1947
|
+
});
|
|
1948
|
+
function mapToFormValue(autoReply) {
|
|
1949
|
+
if (!autoReply) {
|
|
1950
|
+
return AUTO_REPLY_FORM_INITIAL_VALUE;
|
|
1951
|
+
}
|
|
1952
|
+
return {
|
|
1953
|
+
period: [dayjs(autoReply.period.start), dayjs(autoReply.period.end)],
|
|
1954
|
+
text: autoReply.text
|
|
1955
|
+
};
|
|
1956
|
+
}
|
|
1957
|
+
function useValue() {
|
|
1958
|
+
const { data: me } = chatifyApi.useGeCurrentUserAccountQuery();
|
|
1959
|
+
const value = useMemo(() => {
|
|
1960
|
+
return mapToFormValue(me == null ? void 0 : me.autoReply);
|
|
1961
|
+
}, [me]);
|
|
1962
|
+
return value;
|
|
1963
|
+
}
|
|
1964
|
+
function useAutoReplyActions() {
|
|
1965
|
+
const meId = chatifyApi.settings.me();
|
|
1966
|
+
const [updateAccount, { isLoading }] = chatifyApi.useUpdateAccountMutation();
|
|
1967
|
+
const onSubmit = useCallback(
|
|
1968
|
+
(value) => updateAccount({
|
|
1969
|
+
id: meId,
|
|
1970
|
+
autoReply: {
|
|
1971
|
+
hasValue: true,
|
|
1972
|
+
value: {
|
|
1973
|
+
text: value.text,
|
|
1974
|
+
period: {
|
|
1975
|
+
start: value.period[0].toISOString(),
|
|
1976
|
+
end: value.period[1].toISOString()
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
}).unwrap(),
|
|
1981
|
+
[updateAccount, meId]
|
|
1982
|
+
);
|
|
1983
|
+
const onClear = useCallback(
|
|
1984
|
+
() => updateAccount({
|
|
1985
|
+
id: meId,
|
|
1986
|
+
autoReply: {
|
|
1987
|
+
hasValue: true,
|
|
1988
|
+
value: null
|
|
1989
|
+
}
|
|
1990
|
+
}).unwrap(),
|
|
1991
|
+
[updateAccount, meId]
|
|
1992
|
+
);
|
|
1993
|
+
return [onSubmit, isLoading, onClear];
|
|
1994
|
+
}
|
|
1995
|
+
const AutoReplyPanel = customize("AutoReplyPanel", () => {
|
|
1996
|
+
const localizer = useLocalizer();
|
|
1997
|
+
const { toggleAutoReply } = useChatGroupContext();
|
|
1998
|
+
const value = useValue();
|
|
1999
|
+
const [onSubmit, submitting, onClear] = useAutoReplyActions();
|
|
2000
|
+
return /* @__PURE__ */ jsxs("div", { className: "wxchtf-auto-reply-panel", children: [
|
|
2001
|
+
/* @__PURE__ */ jsx(
|
|
2002
|
+
Button,
|
|
2003
|
+
{
|
|
2004
|
+
onClick: toggleAutoReply,
|
|
2005
|
+
className: "wxchtf-auto-reply-panel-close",
|
|
2006
|
+
type: "link",
|
|
2007
|
+
icon: /* @__PURE__ */ jsx(Icon, { type: "close" })
|
|
2008
|
+
}
|
|
2009
|
+
),
|
|
2010
|
+
/* @__PURE__ */ jsxs("div", { className: "wxchtf-auto-reply-panel-header", children: [
|
|
2011
|
+
/* @__PURE__ */ jsx("h3", { children: localizer.autoReply.title() }),
|
|
2012
|
+
/* @__PURE__ */ jsx(Button, { type: "link", onClick: onClear, disabled: submitting, className: "wxchtf-auto-reply-panel-clear", children: localizer.autoReply.clearBtn() })
|
|
2013
|
+
] }),
|
|
2014
|
+
/* @__PURE__ */ jsx(AutoReplyForm, { value, busy: submitting ?? false, onSubmit })
|
|
2015
|
+
] });
|
|
2016
|
+
});
|
|
1807
2017
|
const CreateChatNameInput = customize("CreateChatNameInput", (props) => {
|
|
1808
2018
|
const { name } = props;
|
|
1809
2019
|
const localizer = useLocalizer();
|
|
@@ -1822,7 +2032,7 @@ const CreateChatNameInput = customize("CreateChatNameInput", (props) => {
|
|
|
1822
2032
|
});
|
|
1823
2033
|
function CheckboxList(props) {
|
|
1824
2034
|
const { value, onChange } = props;
|
|
1825
|
-
const { data: accounts, isFetching } = chatifyApi.useGetAccountListQuery();
|
|
2035
|
+
const { data: accounts, isFetching } = chatifyApi.useGetAccountListQuery({});
|
|
1826
2036
|
const me = chatifyApi.settings.me();
|
|
1827
2037
|
const dataSource = useMemo(() => (accounts == null ? void 0 : accounts.filter((x) => x.id !== me)) ?? [], [accounts, me]);
|
|
1828
2038
|
return /* @__PURE__ */ jsx(
|
|
@@ -1875,37 +2085,6 @@ const CreateChatForm = customize("CreateChatForm", (props) => {
|
|
|
1875
2085
|
/* @__PURE__ */ jsx(Button, { loading: busy, type: "primary", block: true, htmlType: "submit", children: localizer.addChat.submitBtn() })
|
|
1876
2086
|
] });
|
|
1877
2087
|
});
|
|
1878
|
-
const ChatGroupReactContext = React.createContext(null);
|
|
1879
|
-
function useChatGroupContext() {
|
|
1880
|
-
return useContext(ChatGroupReactContext);
|
|
1881
|
-
}
|
|
1882
|
-
function ChatGroupContext(props) {
|
|
1883
|
-
const { children } = props;
|
|
1884
|
-
const [state, setState] = useState({
|
|
1885
|
-
chatId: null,
|
|
1886
|
-
view: null,
|
|
1887
|
-
showMembers: false
|
|
1888
|
-
});
|
|
1889
|
-
const value = useMemo(
|
|
1890
|
-
() => ({
|
|
1891
|
-
...state,
|
|
1892
|
-
openChat: (chatId2) => setState((prev) => ({ ...prev, view: "chat", chatId: chatId2 })),
|
|
1893
|
-
none: () => setState((prev) => ({ ...prev, view: null, chatId: null })),
|
|
1894
|
-
toggleMembers: () => setState((prev) => ({ ...prev, showMembers: !prev.showMembers })),
|
|
1895
|
-
toggleNewChat: () => setState((prev) => {
|
|
1896
|
-
if (prev.view === "new-chat" && !prev.chatId) {
|
|
1897
|
-
return { ...prev, view: null };
|
|
1898
|
-
} else if (prev.view === "new-chat" && prev.chatId) {
|
|
1899
|
-
return { ...prev, view: "chat" };
|
|
1900
|
-
} else {
|
|
1901
|
-
return { ...prev, view: "new-chat" };
|
|
1902
|
-
}
|
|
1903
|
-
})
|
|
1904
|
-
}),
|
|
1905
|
-
[state]
|
|
1906
|
-
);
|
|
1907
|
-
return /* @__PURE__ */ jsx(ChatGroupReactContext.Provider, { value, children });
|
|
1908
|
-
}
|
|
1909
2088
|
function useSubmit() {
|
|
1910
2089
|
const [add, { isLoading }] = chatifyApi.useAddChatMutation();
|
|
1911
2090
|
const { openChat } = useChatGroupContext();
|
|
@@ -1940,6 +2119,12 @@ const CreateChatButton = customize("CreateChatButton", () => {
|
|
|
1940
2119
|
const { toggleNewChat } = useChatGroupContext();
|
|
1941
2120
|
return /* @__PURE__ */ jsx("span", { className: "wxchtf-add-btn-wrapper", children: /* @__PURE__ */ jsx(Button, { className: "wxchtf-add-btn", onClick: toggleNewChat, icon: "+", children: "Add chat" }) });
|
|
1942
2121
|
});
|
|
2122
|
+
const ChatGroupActions = customize("ChatGroupActions", () => {
|
|
2123
|
+
return /* @__PURE__ */ jsx("span", { className: "wxchtf-add-btn-wrapper", children: /* @__PURE__ */ jsxs(Space.Compact, { className: "wxchtf-add-btn-group", children: [
|
|
2124
|
+
/* @__PURE__ */ jsx(CreateChatButton, {}),
|
|
2125
|
+
/* @__PURE__ */ jsx(AutoReplyButton, {})
|
|
2126
|
+
] }) });
|
|
2127
|
+
});
|
|
1943
2128
|
function useData() {
|
|
1944
2129
|
const { data: chats } = chatifyApi.useGetChatListQuery();
|
|
1945
2130
|
return useMemo(
|
|
@@ -1961,7 +2146,7 @@ const ChatListPanel = customize("ChatListPanel", () => {
|
|
|
1961
2146
|
});
|
|
1962
2147
|
const ChatGroupAside = customize("ChatGroupAside", () => {
|
|
1963
2148
|
return /* @__PURE__ */ jsxs("div", { className: "wxchtf-aside", children: [
|
|
1964
|
-
/* @__PURE__ */ jsx(
|
|
2149
|
+
/* @__PURE__ */ jsx(ChatGroupActions, {}),
|
|
1965
2150
|
/* @__PURE__ */ jsx(ChatListPanel, {})
|
|
1966
2151
|
] });
|
|
1967
2152
|
});
|
|
@@ -1974,7 +2159,8 @@ const ChatGroupMain = customize("ChatGroupMain", () => {
|
|
|
1974
2159
|
const chat = chatifyApi.useChatListItem(chatId2);
|
|
1975
2160
|
return /* @__PURE__ */ jsxs("div", { className: "wxchtf-main", children: [
|
|
1976
2161
|
view === "chat" && chat && /* @__PURE__ */ jsx(ChatView, { value: chat }, chatId2),
|
|
1977
|
-
view === "new-chat" && /* @__PURE__ */ jsx(CreateChatPanel, {})
|
|
2162
|
+
view === "new-chat" && /* @__PURE__ */ jsx(CreateChatPanel, {}),
|
|
2163
|
+
view === "auto-reply" && /* @__PURE__ */ jsx(AutoReplyPanel, {})
|
|
1978
2164
|
] });
|
|
1979
2165
|
});
|
|
1980
2166
|
const ChatGroupBody = customize("ChatGroupBody", () => /* @__PURE__ */ jsxs("div", { className: "wxchtf-body", children: [
|
|
@@ -2106,74 +2292,81 @@ const Chatify = {
|
|
|
2106
2292
|
Chat: ChatPanel
|
|
2107
2293
|
};
|
|
2108
2294
|
export {
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2295
|
+
MessageFileList as $,
|
|
2296
|
+
AutoReplyButton as A,
|
|
2297
|
+
ChatGroupActions as B,
|
|
2112
2298
|
CustomizeContext as C,
|
|
2113
2299
|
DEFAULT_CHAT_VIEW_CUSTOMIZE_VALUE as D,
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2300
|
+
ChatGroupAside as E,
|
|
2301
|
+
ChatGroupHeader as F,
|
|
2302
|
+
ChatGroupFooter as G,
|
|
2303
|
+
ChatGroupMain as H,
|
|
2304
|
+
ChatGroupBody as I,
|
|
2305
|
+
ChatListPanel as J,
|
|
2306
|
+
useChatGroupContext as K,
|
|
2121
2307
|
LocalizerContext as L,
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2308
|
+
ChatGroupContext as M,
|
|
2309
|
+
ChatGroupPanel as N,
|
|
2310
|
+
InputBox as O,
|
|
2311
|
+
InputFileButton as P,
|
|
2312
|
+
InputFilesBox as Q,
|
|
2313
|
+
InputSubmitButtonBox as R,
|
|
2314
|
+
InputTextBox as S,
|
|
2315
|
+
InputBoxFileList as T,
|
|
2316
|
+
InputBoxFile as U,
|
|
2317
|
+
MessageAuthor as V,
|
|
2318
|
+
MessageBox as W,
|
|
2319
|
+
MessageContent as X,
|
|
2320
|
+
MessageInfoBox as Y,
|
|
2321
|
+
MessageRow as Z,
|
|
2322
|
+
MessageText as _,
|
|
2137
2323
|
useCustomize as a,
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2324
|
+
MessageFile as a0,
|
|
2325
|
+
NextMessagesObserver as a1,
|
|
2326
|
+
MessageReadObserver as a2,
|
|
2327
|
+
SendingMessageBox as a3,
|
|
2328
|
+
SendingMessageContent as a4,
|
|
2329
|
+
SendingMessageInfoBox as a5,
|
|
2330
|
+
SendingMessageText as a6,
|
|
2331
|
+
SystemMessageBox as a7,
|
|
2332
|
+
formatSystemMessage as a8,
|
|
2333
|
+
SystemMessageRow as a9,
|
|
2334
|
+
messageSequencePart as aA,
|
|
2335
|
+
parseThreadMessageId as aB,
|
|
2336
|
+
calcThreadUnreadCount as aC,
|
|
2337
|
+
calcThreadListUnreadCount as aD,
|
|
2338
|
+
useChatListItem as aE,
|
|
2339
|
+
useUnreadThreadMessageCount as aF,
|
|
2340
|
+
chatifyApi as aG,
|
|
2341
|
+
CHATIFY_SIGNALR_METHODS as aH,
|
|
2342
|
+
ChatifyClient as aI,
|
|
2343
|
+
unsubscribe as aJ,
|
|
2344
|
+
ConversationActions as aa,
|
|
2345
|
+
ConversationBody as ab,
|
|
2346
|
+
ConversationHeader as ac,
|
|
2347
|
+
ConversationName as ad,
|
|
2348
|
+
ConversationContext as ae,
|
|
2349
|
+
useConversation$1 as af,
|
|
2350
|
+
Conversation as ag,
|
|
2351
|
+
ThreadActions as ah,
|
|
2352
|
+
ThreadPanel as ai,
|
|
2353
|
+
ThreadContext as aj,
|
|
2354
|
+
useThreadContext as ak,
|
|
2355
|
+
Avatar as al,
|
|
2356
|
+
ICONS as am,
|
|
2357
|
+
Icon as an,
|
|
2358
|
+
MessageSkeleton as ao,
|
|
2359
|
+
ChatList as ap,
|
|
2360
|
+
ChatListItemAvatar as aq,
|
|
2361
|
+
ChatListItemBox as ar,
|
|
2362
|
+
ChatListItemLastMessage as as,
|
|
2363
|
+
ChatListItemLastMessageAuthor as at,
|
|
2364
|
+
ChatListItemLastMessageContent as au,
|
|
2365
|
+
ChatListItemLastMessageSentAt as av,
|
|
2366
|
+
ChatListItemName as aw,
|
|
2367
|
+
ChatListItemUnreadCount as ax,
|
|
2368
|
+
SYSTEM_ID as ay,
|
|
2369
|
+
chatId as az,
|
|
2177
2370
|
customize as b,
|
|
2178
2371
|
color as c,
|
|
2179
2372
|
Chatify as d,
|
|
@@ -2188,16 +2381,16 @@ export {
|
|
|
2188
2381
|
ChatEditableHeaderName as m,
|
|
2189
2382
|
ChatHeaderActions as n,
|
|
2190
2383
|
ChatPanel as o,
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2384
|
+
AUTO_REPLY_FORM_INITIAL_VALUE as p,
|
|
2385
|
+
AutoReplyForm as q,
|
|
2386
|
+
AutoReplyPanel as r,
|
|
2387
|
+
AutoReplyPeriodInput as s,
|
|
2388
|
+
AutoReplyTextInput as t,
|
|
2196
2389
|
useCustomizeContext as u,
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2390
|
+
CreateChatForm as v,
|
|
2391
|
+
CreateChatMemberInput as w,
|
|
2392
|
+
CreateChatNameInput as x,
|
|
2393
|
+
CreateChatPanel as y,
|
|
2394
|
+
CreateChatButton as z
|
|
2202
2395
|
};
|
|
2203
|
-
//# sourceMappingURL=Chatify-
|
|
2396
|
+
//# sourceMappingURL=Chatify-CwAfN1wu.js.map
|