@connectycube/chat-widget 0.15.2 → 0.16.0

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/README.md CHANGED
@@ -24,9 +24,9 @@ Single-view chat widget:
24
24
 
25
25
  <kbd><img alt="ConnectyCube chat widget, single view image demo" src="https://developers.connectycube.com/images/chat_widget/chat-widget-2.png" width="400" /></kbd>
26
26
 
27
- ## Documentation
27
+ ## Documentation
28
28
 
29
- https://developers.connectycube.com/js/chat-widget
29
+ <https://developers.connectycube.com/js/chat-widget>
30
30
 
31
31
  ## Installation
32
32
 
@@ -142,22 +142,23 @@ See chat widget code samples <https://github.com/ConnectyCube/connectycube-chat-
142
142
 
143
143
  ## Props
144
144
 
145
- See all available props https://developers.connectycube.com/js/chat-widget/#props
145
+ See all available props <https://developers.connectycube.com/js/chat-widget/#props>
146
146
 
147
147
  ## Recipes
148
148
 
149
- See all available recipes https://developers.connectycube.com/js/chat-widget/#recipes
149
+ See all available recipes <https://developers.connectycube.com/js/chat-widget/#recipes>
150
150
 
151
- ## Changelog
151
+ ## Have an issue?
152
152
 
153
- <https://github.com/ConnectyCube/connectycube-chat-widget-samples/blob/main/CHANGELOG.md>
153
+ Join our [Discord](https://discord.gg/tEnXnp2M) for quick answers to your questions
154
154
 
155
155
  ## Community and support
156
156
 
157
+ - [Discord](https://discord.gg/tEnXnp2M)
157
158
  - [Blog](https://connectycube.com/blog)
158
159
  - X (twitter)[@ConnectyCube](https://x.com/ConnectyCube)
159
160
  - [Facebook](https://www.facebook.com/ConnectyCube)
160
161
 
161
- ## Website
162
+ ## Changelog
162
163
 
163
- [https://connectycube.com](https://connectycube.com)
164
+ <https://github.com/ConnectyCube/connectycube-chat-widget-samples/blob/main/CHANGELOG.md>
package/dist/App.d.ts CHANGED
@@ -1,3 +1,34 @@
1
- import { AppProps } from './AppContainer';
1
+ import { Config } from '../../../node_modules/connectycube/dist/types/types';
2
+ import { QuickActions } from './hooks/store/useAppStore';
3
+ export type AppProps = {
4
+ appId: Config.Credentials['appId'];
5
+ authKey: Config.Credentials['authKey'];
6
+ userId?: string;
7
+ userName?: string;
8
+ userAvatar?: string;
9
+ userProfileLink?: string;
10
+ config?: Config.Options;
11
+ splitView?: boolean;
12
+ showOnlineUsersTab?: boolean;
13
+ quickActions?: QuickActions;
14
+ hideNewChatButton?: boolean;
15
+ hideWidgetButton?: boolean;
16
+ enableContentReporting?: boolean;
17
+ enableBlockList?: boolean;
18
+ translation?: 'en' | 'el' | 'ua';
19
+ buttonTitle?: string;
20
+ portalStyle?: React.CSSProperties;
21
+ buttonStyle?: React.CSSProperties;
22
+ badgeStyle?: React.CSSProperties;
23
+ portalClassName?: string;
24
+ buttonClassName?: string;
25
+ badgeClassName?: string;
26
+ open?: boolean;
27
+ onOpenChange?: (open: boolean) => void;
28
+ onUnreadCountChange?: (count: number) => void;
29
+ muted?: boolean;
30
+ showNotifications?: boolean;
31
+ playSound?: boolean;
32
+ };
2
33
  declare const App: React.FC<AppProps>;
3
34
  export default App;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ export interface ChatInfoMembersProps {
3
+ }
4
+ declare const _default: React.NamedExoticComponent<ChatInfoMembersProps>;
5
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ export interface ChatInfoUserProps {
3
+ profileUrl: string | null;
4
+ userId: number;
5
+ }
6
+ declare const _default: React.NamedExoticComponent<ChatInfoUserProps>;
7
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface ReportUserDialogProps {
3
+ userId: number;
4
+ }
5
+ declare const _default: React.NamedExoticComponent<ReportUserDialogProps>;
6
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
4
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
5
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
@@ -0,0 +1,3 @@
1
+ import { ToasterProps } from 'sonner';
2
+ declare const Toaster: ({ ...props }: ToasterProps) => import("react/jsx-runtime").JSX.Element;
3
+ export { Toaster };
@@ -1,6 +1,10 @@
1
+ export declare const resetStore: (force?: boolean) => void;
1
2
  export { debounce as debounce } from './debounce';
2
3
  export { throttle as throttle } from './throttle';
4
+ export { default as useNotification } from './useNotification';
3
5
  export { default as useNotificationSound } from './useNotificationSound';
4
6
  export { default as usePageFocus } from './usePageFocus';
5
7
  export { default as useValue } from './useValue';
6
- export * from '../redux/hooks';
8
+ export { default as useAppStore } from './store/useAppStore';
9
+ export { default as useDraftMessagesStore } from './store/useDraftMessagesStore';
10
+ export { default as useUnreadCountStore } from './store/useUnreadCountStore';
@@ -0,0 +1,64 @@
1
+ export declare enum Tab {
2
+ CHATS = "chats",
3
+ USERS = "users"
4
+ }
5
+ export type QuickActions = {
6
+ title?: string;
7
+ description?: string;
8
+ actions: string[];
9
+ };
10
+ export interface AppStoreState {
11
+ opened: boolean;
12
+ splitView: boolean;
13
+ showOnlineUsersTab: boolean;
14
+ activeTab: Tab;
15
+ hideNewChatButton: boolean;
16
+ quickActions: QuickActions;
17
+ enableContentReporting: boolean;
18
+ enableBlockList: boolean;
19
+ muted: boolean;
20
+ showNotifications: boolean;
21
+ playSound: boolean;
22
+ setOpened: (opened: boolean) => void;
23
+ setSplitView: (splitView: boolean) => void;
24
+ setShowOnlineUsersTab: (showOnlineUsersTab: boolean) => void;
25
+ setActiveTab: (activeTab: Tab) => void;
26
+ setHideNewChatButton: (hideNewChatButton: boolean) => void;
27
+ setQuickActions: (quickActions: QuickActions) => void;
28
+ setEnableContentReporting: (enableContentReporting: boolean) => void;
29
+ setEnableBlockList: (enableBlockList: boolean) => void;
30
+ setMuted: (muted: boolean) => void;
31
+ setShowNotifications: (showNotifications: boolean) => void;
32
+ setPlaySound: (playSound: boolean) => void;
33
+ resetOpened: () => void;
34
+ resetSplitView: () => void;
35
+ resetShowOnlineUsersTab: () => void;
36
+ resetActiveTab: () => void;
37
+ resetHideNewChatButton: () => void;
38
+ resetQuickActions: () => void;
39
+ resetEnableContentReporting: () => void;
40
+ resetEnableBlockList: () => void;
41
+ resetMuted: () => void;
42
+ resetShowNotifications: () => void;
43
+ resetPlaySound: () => void;
44
+ }
45
+ export declare const appStoreInitialState: {
46
+ opened: boolean;
47
+ splitView: boolean;
48
+ showOnlineUsersTab: boolean;
49
+ activeTab: Tab;
50
+ hideNewChatButton: boolean;
51
+ quickActions: {
52
+ title: string;
53
+ description: string;
54
+ actions: never[];
55
+ };
56
+ muted: boolean;
57
+ showNotifications: boolean;
58
+ playSound: boolean;
59
+ enableContentReporting: boolean;
60
+ enableBlockList: boolean;
61
+ };
62
+ declare const useAppStore: import('zustand').UseBoundStore<import('zustand').StoreApi<AppStoreState>>;
63
+ export declare const resetAppStore: () => void;
64
+ export default useAppStore;
@@ -0,0 +1,14 @@
1
+ type DraftMessage = {
2
+ [dialogId: string]: string;
3
+ };
4
+ export declare const DRAFT_MESSAGES_KEY = "@connectycube/chat-widget:draftMessages";
5
+ interface DraftMessagesState {
6
+ draftMessages: DraftMessage;
7
+ setDraftMessages: (messages: DraftMessage) => void;
8
+ upsertDraftMessage: (message: DraftMessage) => void;
9
+ deleteDraftMessage: (dialogId: string) => void;
10
+ resetDraftMessages: () => void;
11
+ }
12
+ declare const useDraftMessagesStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DraftMessagesState>>;
13
+ export declare const resetDraftMessagesStore: () => void;
14
+ export default useDraftMessagesStore;
@@ -0,0 +1,8 @@
1
+ interface UnreadCountState {
2
+ unreadCount: number;
3
+ setUnreadCount: (count: number) => void;
4
+ resetUnreadCount: () => void;
5
+ }
6
+ declare const useUnreadCountStore: import('zustand').UseBoundStore<import('zustand').StoreApi<UnreadCountState>>;
7
+ export declare const resetUnreadCountStore: () => void;
8
+ export default useUnreadCountStore;
@@ -0,0 +1,3 @@
1
+ import { Chat } from '../../../../node_modules/connectycube/dist/types/types';
2
+ declare function useNotification(): (userId: number, message: Chat.Message) => Promise<void>;
3
+ export default useNotification;