@connectycube/chat-widget 0.15.2 → 0.17.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.
Files changed (57) hide show
  1. package/LICENSE +231 -0
  2. package/README.md +9 -8
  3. package/dist/App.d.ts +35 -1
  4. package/dist/components/home/main/chat-header.d.ts +1 -4
  5. package/dist/components/home/main/chat-info-members.d.ts +5 -0
  6. package/dist/components/home/main/chat-info-user.d.ts +7 -0
  7. package/dist/components/home/main/chat-input.d.ts +1 -1
  8. package/dist/components/home/main/message-attachment.d.ts +1 -1
  9. package/dist/components/home/main/message.d.ts +1 -1
  10. package/dist/components/home/main/my-profile/my-block-list-item.d.ts +7 -0
  11. package/dist/components/home/main/my-profile/my-block-list.d.ts +3 -0
  12. package/dist/components/home/main/my-profile/my-profile-settings.d.ts +2 -0
  13. package/dist/components/home/main/my-profile/my-profile.d.ts +3 -0
  14. package/dist/components/home/main/profile-info.d.ts +3 -0
  15. package/dist/components/home/main/report-user-dialog.d.ts +6 -0
  16. package/dist/components/home/sidebar/chat-item.d.ts +1 -1
  17. package/dist/components/home/sidebar/new-chat/create-group-chat/create-group-chat.d.ts +1 -1
  18. package/dist/components/shadcn-ui/button.d.ts +1 -1
  19. package/dist/components/shadcn-ui/sonner.d.ts +3 -0
  20. package/dist/components/shared/empty-content-placeholder.d.ts +2 -2
  21. package/dist/{connectycube.d.ts → helpers/connectycube.d.ts} +11 -2
  22. package/dist/helpers/notifications.d.ts +1 -0
  23. package/dist/hooks/index.d.ts +14 -4
  24. package/dist/hooks/store/useActiveTabsStore.d.ts +15 -0
  25. package/dist/hooks/store/useAppDefaultChatStore.d.ts +21 -0
  26. package/dist/hooks/store/useAppInterfaceStore.d.ts +21 -0
  27. package/dist/hooks/store/useAppNotificationStore.d.ts +22 -0
  28. package/dist/hooks/store/useAppQuickActionsStore.d.ts +17 -0
  29. package/dist/hooks/store/useAppSettingsStore.d.ts +18 -0
  30. package/dist/hooks/store/useDraftMessagesStore.d.ts +14 -0
  31. package/dist/hooks/store/useProfileStore.d.ts +9 -0
  32. package/dist/hooks/store/useUnreadCountStore.d.ts +8 -0
  33. package/dist/hooks/store/useUserSettingsStore.d.ts +11 -0
  34. package/dist/hooks/useAppAuthorization.d.ts +14 -0
  35. package/dist/hooks/useNotification.d.ts +8 -0
  36. package/dist/hooks/usePageFocus.d.ts +5 -1
  37. package/dist/hooks/useResizeScreenWidth.d.ts +10 -0
  38. package/dist/index.es.js +8701 -8552
  39. package/dist/index.umd.js +44 -52
  40. package/dist/lib/utils.d.ts +4 -2
  41. package/dist/locales/el/translation.json.d.ts +21 -3
  42. package/dist/locales/en/translation.json.d.ts +21 -3
  43. package/dist/locales/ua/translation.json.d.ts +21 -3
  44. package/dist/logo.png +0 -0
  45. package/package.json +52 -41
  46. package/dist/AppContainer.d.ts +0 -30
  47. package/dist/components/home/main/chat-info.d.ts +0 -7
  48. package/dist/hooks/useNotificationSound.d.ts +0 -2
  49. package/dist/redux/hooks.d.ts +0 -6
  50. package/dist/redux/slices/app.d.ts +0 -14
  51. package/dist/redux/slices/draftMessages.d.ts +0 -9
  52. package/dist/redux/slices/quickActions.d.ts +0 -7
  53. package/dist/redux/slices/unreadCount.d.ts +0 -2
  54. package/dist/redux/store.d.ts +0 -52
  55. /package/dist/{hooks → helpers}/debounce.d.ts +0 -0
  56. /package/dist/{i18n.d.ts → helpers/i18n.d.ts} +0 -0
  57. /package/dist/{hooks → helpers}/throttle.d.ts +0 -0
@@ -0,0 +1,17 @@
1
+ export type QuickActions = {
2
+ title?: string;
3
+ description?: string;
4
+ actions: string[];
5
+ };
6
+ export type AppQuickActionsStoreProps = {
7
+ quickActions: QuickActions;
8
+ };
9
+ export interface AppQuickActionsStoreState extends AppQuickActionsStoreProps {
10
+ setQuickActions: (quickActions: QuickActions) => void;
11
+ resetQuickActions: () => void;
12
+ }
13
+ export declare const quickActionsStoreInitialState: AppQuickActionsStoreProps;
14
+ declare const useAppQuickActionsStore: import('zustand').UseBoundStore<import('zustand').StoreApi<AppQuickActionsStoreState>>;
15
+ export declare const setAppQuickActionsStore: (state: Partial<AppQuickActionsStoreProps>) => void;
16
+ export declare const resetAppQuickActionsStore: () => void;
17
+ export default useAppQuickActionsStore;
@@ -0,0 +1,18 @@
1
+ export type AppSettingStoreProps = {
2
+ attachmentsAccept: string;
3
+ enableContentReporting: boolean;
4
+ enableBlockList: boolean;
5
+ };
6
+ export interface AppSettingStoreState extends AppSettingStoreProps {
7
+ setAttachmentsAccept: (attachmentsAccept: string) => void;
8
+ setEnableContentReporting: (enableContentReporting: boolean) => void;
9
+ setEnableBlockList: (enableBlockList: boolean) => void;
10
+ resetAttachmentsAccept: () => void;
11
+ resetEnableContentReporting: () => void;
12
+ resetEnableBlockList: () => void;
13
+ }
14
+ export declare const appSettingsStoreInitialState: AppSettingStoreProps;
15
+ declare const useAppSettingsStore: import('zustand').UseBoundStore<import('zustand').StoreApi<AppSettingStoreState>>;
16
+ export declare const setAppSettingsStore: (state: Partial<AppSettingStoreProps>) => void;
17
+ export declare const resetAppSettingsStore: () => void;
18
+ export default useAppSettingsStore;
@@ -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 DraftMessagesStoreState {
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<DraftMessagesStoreState>>;
13
+ export declare const resetDraftMessagesStore: () => void;
14
+ export default useDraftMessagesStore;
@@ -0,0 +1,9 @@
1
+ interface ProfileState {
2
+ visible: boolean;
3
+ userId?: number;
4
+ showProfile: (userId?: number) => void;
5
+ hideProfile: () => void;
6
+ }
7
+ declare const useProfileStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ProfileState>>;
8
+ export declare const resetProfileStore: () => void;
9
+ export default useProfileStore;
@@ -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,11 @@
1
+ type UserSettingsStateProps = {
2
+ isNotifications: boolean;
3
+ isNotificationSound: boolean;
4
+ };
5
+ interface UserSettingsState extends UserSettingsStateProps {
6
+ setIsNotifications: (enabled: boolean) => Promise<void>;
7
+ setIsNotificationSound: (enabled: boolean) => Promise<void>;
8
+ }
9
+ declare const useUserSettingsStore: import('zustand').UseBoundStore<import('zustand').StoreApi<UserSettingsState>>;
10
+ export declare const restoreUserSettingsStore: () => void;
11
+ export default useUserSettingsStore;
@@ -0,0 +1,14 @@
1
+ import { Config } from '../../node_modules/connectycube/src/types';
2
+ type AppUser = {
3
+ id?: string;
4
+ name?: string;
5
+ avatar?: string;
6
+ userProfileLink?: string;
7
+ };
8
+ type AppAuthorizationProps = {
9
+ creds: Config.Credentials;
10
+ config?: Config.Options;
11
+ user?: AppUser;
12
+ };
13
+ declare const useAppAuthorization: ({ creds, config, user }: AppAuthorizationProps) => void;
14
+ export default useAppAuthorization;
@@ -0,0 +1,8 @@
1
+ import { Chat } from '../../node_modules/connectycube/src/types';
2
+ type NotificationHook = {
3
+ showNotification: (title: string, body: string, icon: string) => Notification | void;
4
+ notifyOnMessage: (userId: number, message: Chat.Message) => Promise<Notification | void>;
5
+ playAudio: () => void;
6
+ };
7
+ declare function useNotification(): NotificationHook;
8
+ export default useNotification;
@@ -1,2 +1,6 @@
1
- declare function usePageFocus(): boolean;
1
+ type PageFocusHook = {
2
+ isFocused: boolean;
3
+ isBlurred: boolean;
4
+ };
5
+ declare function usePageFocus(): PageFocusHook;
2
6
  export default usePageFocus;
@@ -0,0 +1,10 @@
1
+ type ResizeScreenWidthParams = {
2
+ timeout?: number;
3
+ width?: number;
4
+ };
5
+ type ResizeScreenWidthHook = {
6
+ isWideScreen: boolean;
7
+ isNarrowScreen: boolean;
8
+ };
9
+ declare const useResizeScreenWidth: (params?: ResizeScreenWidthParams) => ResizeScreenWidthHook;
10
+ export default useResizeScreenWidth;