@connectycube/chat-widget 0.11.0 → 0.13.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.
@@ -0,0 +1,6 @@
1
+ import { TypedUseSelectorHook } from 'react-redux';
2
+ import { AppStore, AppDispatch } from './store';
3
+ type DispatchFunc = () => AppDispatch;
4
+ export declare const useAppDispatch: DispatchFunc;
5
+ export declare const useAppSelector: TypedUseSelectorHook<AppStore>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const muted: import('redux').Reducer<boolean>;
2
+ export declare const setMuted: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "muted/setMuted">, resetMuted: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"muted/resetMuted">;
3
+ export declare const splitView: import('redux').Reducer<boolean>;
4
+ export declare const setSplitView: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "splitView/setSplitView">, resetSplitView: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"splitView/resetSplitView">;
5
+ export declare const showOnlineUsersTab: import('redux').Reducer<boolean>;
6
+ export declare const setShowOnlineUsersTab: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "showOnlineUsersTab/setShowOnlineUsersTab">, resetShowOnlineUsersTab: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"showOnlineUsersTab/resetShowOnlineUsersTab">;
@@ -0,0 +1,9 @@
1
+ import { Middleware } from '@reduxjs/toolkit';
2
+ type DraftMessage = {
3
+ [dialogId: string]: string;
4
+ };
5
+ export declare const DRAFT_MESSAGES_KEY = "@connectycube/chat-widget:draftMessages";
6
+ export declare const draftMessages: import('redux').Reducer<DraftMessage>;
7
+ export declare const setDraftMessages: import('@reduxjs/toolkit').ActionCreatorWithPayload<DraftMessage, "draftMessages/setDraftMessages">, upsertDraftMessage: import('@reduxjs/toolkit').ActionCreatorWithPayload<DraftMessage, "draftMessages/upsertDraftMessage">, deleteDraftMessage: import('@reduxjs/toolkit').ActionCreatorWithPayload<string, "draftMessages/deleteDraftMessage">, resetDraftMessages: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"draftMessages/resetDraftMessages">;
8
+ export declare const localStorageMiddleware: Middleware;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ export type QuickActions = {
2
+ title?: string;
3
+ description?: string;
4
+ actions: string[];
5
+ };
6
+ export declare const quickActions: import('redux').Reducer<QuickActions>;
7
+ export declare const setQuickActions: import('@reduxjs/toolkit').ActionCreatorWithPayload<QuickActions, "quickActions/setQuickActions">, resetQuickActions: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"quickActions/resetQuickActions">;
@@ -0,0 +1,2 @@
1
+ export declare const unreadCount: import('redux').Reducer<number>;
2
+ export declare const setUnreadCount: import('@reduxjs/toolkit').ActionCreatorWithPayload<number, "unreadCount/setUnreadCount">, resetUnreadCount: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"unreadCount/resetUnreadCount">;
@@ -0,0 +1,44 @@
1
+ export declare const rootReducer: import('redux').Reducer<{
2
+ unreadCount: number;
3
+ muted: boolean;
4
+ splitView: boolean;
5
+ showOnlineUsersTab: boolean;
6
+ draftMessages: {
7
+ [dialogId: string]: string;
8
+ };
9
+ quickActions: import('./slices/quickActions').QuickActions;
10
+ }, import('redux').UnknownAction, Partial<{
11
+ unreadCount: number | undefined;
12
+ muted: boolean | undefined;
13
+ splitView: boolean | undefined;
14
+ showOnlineUsersTab: boolean | undefined;
15
+ draftMessages: {
16
+ [dialogId: string]: string;
17
+ } | undefined;
18
+ quickActions: import('./slices/quickActions').QuickActions | undefined;
19
+ }>>;
20
+ export declare const store: import('@reduxjs/toolkit').EnhancedStore<{
21
+ unreadCount: number;
22
+ muted: boolean;
23
+ splitView: boolean;
24
+ showOnlineUsersTab: boolean;
25
+ draftMessages: {
26
+ [dialogId: string]: string;
27
+ };
28
+ quickActions: import('./slices/quickActions').QuickActions;
29
+ }, import('redux').UnknownAction, import('@reduxjs/toolkit').Tuple<[import('redux').StoreEnhancer<{
30
+ dispatch: import('redux-thunk').ThunkDispatch<{
31
+ unreadCount: number;
32
+ muted: boolean;
33
+ splitView: boolean;
34
+ showOnlineUsersTab: boolean;
35
+ draftMessages: {
36
+ [dialogId: string]: string;
37
+ };
38
+ quickActions: import('./slices/quickActions').QuickActions;
39
+ }, undefined, import('redux').UnknownAction>;
40
+ }>, import('redux').StoreEnhancer]>>;
41
+ export type AppDispatch = typeof store.dispatch;
42
+ export type RootState = ReturnType<typeof store.getState>;
43
+ export type AppStore = ReturnType<typeof rootReducer>;
44
+ export declare const resetStore: (force?: boolean) => void;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@connectycube/chat-widget",
3
3
  "description": "A React component that seamlessly integrates ConnectyCube's real-time chat capabilities into your web applications. This widget offers an out-of-the-box solution for embedding chat features—such as instant messaging, user presence, and file sharing—without the overhead of building a complete chat system from scratch.",
4
- "version": "0.11.0",
4
+ "version": "0.13.0",
5
5
  "keywords": [
6
6
  "chat-widget",
7
7
  "widget",
@@ -43,6 +43,8 @@
43
43
  "vite:dev": "vite",
44
44
  "vite:build": "tsc -b && vite build",
45
45
  "vite:preview": "vite preview",
46
+ "test": "vitest",
47
+ "coverage": "vitest run --coverage",
46
48
  "tailwindcss:watch": "npx tailwindcss -i ./src/index.css -o ./src/styles.css --watch",
47
49
  "tailwindcss:minify": "npx tailwindcss -i ./src/index.css -o ./src/styles.css --minify",
48
50
  "dev": "npm-run-all --parallel vite:dev tailwindcss:watch",
@@ -52,49 +54,55 @@
52
54
  },
53
55
  "dependencies": {
54
56
  "@connectycube/use-chat": "^0.13.0",
55
- "@radix-ui/react-alert-dialog": "^1.1.5",
56
- "@radix-ui/react-avatar": "^1.1.2",
57
- "@radix-ui/react-dialog": "^1.1.5",
58
- "@radix-ui/react-dropdown-menu": "^2.1.5",
59
- "@radix-ui/react-label": "^2.1.1",
60
- "@radix-ui/react-slot": "^1.1.1",
61
- "@radix-ui/react-switch": "^1.1.2",
62
- "@radix-ui/react-tabs": "^1.1.2",
57
+ "@radix-ui/react-alert-dialog": "^1.1.6",
58
+ "@radix-ui/react-avatar": "^1.1.3",
59
+ "@radix-ui/react-dialog": "^1.1.6",
60
+ "@radix-ui/react-dropdown-menu": "^2.1.6",
61
+ "@radix-ui/react-label": "^2.1.2",
62
+ "@radix-ui/react-slot": "^1.1.2",
63
+ "@radix-ui/react-switch": "^1.1.3",
64
+ "@radix-ui/react-tabs": "^1.1.3",
65
+ "@reduxjs/toolkit": "^2.5.1",
63
66
  "class-variance-authority": "^0.7.1",
64
67
  "clsx": "^2.1.1",
65
68
  "connectycube": "^4.1.0",
66
- "lucide-react": "^0.474.0",
69
+ "jsdom": "^26.0.0",
70
+ "lucide-react": "^0.475.0",
67
71
  "react": "^18.3.1",
68
72
  "react-dom": "^18.3.1",
69
73
  "react-hook-form": "^7.54.2",
70
74
  "react-icons": "^5.4.0",
71
75
  "react-intersection-observer": "^9.15.1",
76
+ "react-redux": "^9.2.0",
72
77
  "react-router": "^7.1.5",
73
78
  "react-router-dom": "^7.1.3",
74
- "react-scroll": "^1.9.0"
79
+ "react-scroll": "^1.9.2",
80
+ "redux": "^5.0.1"
75
81
  },
76
82
  "devDependencies": {
77
- "@eslint/js": "^9.19.0",
83
+ "@eslint/js": "^9.20.0",
78
84
  "@types/node": "^22.13.1",
79
85
  "@types/react": "18.3.12",
80
86
  "@types/react-dom": "^18.3.5",
81
87
  "@types/react-scroll": "^1.8.10",
82
88
  "@vitejs/plugin-react": "^4.3.4",
89
+ "@vitest/coverage-v8": "^3.0.5",
83
90
  "autoprefixer": "^10.4.20",
84
- "eslint": "^9.19.0",
91
+ "eslint": "^9.20.0",
85
92
  "eslint-plugin-react-hooks": "^5.1.0",
86
- "eslint-plugin-react-refresh": "^0.4.18",
93
+ "eslint-plugin-react-refresh": "^0.4.19",
87
94
  "globals": "^15.14.0",
88
95
  "npm-run-all": "^4.1.5",
89
- "postcss": "^8.5.1",
90
- "prettier": "3.4.2",
96
+ "postcss": "^8.5.2",
97
+ "prettier": "3.5.0",
91
98
  "tailwind-merge": "^2.6.0",
92
99
  "tailwindcss": "^3.4.17",
93
100
  "tailwindcss-animate": "^1.0.7",
94
101
  "typescript": "~5.7.3",
95
- "typescript-eslint": "^8.23.0",
96
- "vite": "^6.0.11",
102
+ "typescript-eslint": "^8.24.0",
103
+ "vite": "^6.1.0",
97
104
  "vite-plugin-css-injected-by-js": "^3.5.2",
98
- "vite-plugin-dts": "^4.5.0"
105
+ "vite-plugin-dts": "^4.5.0",
106
+ "vitest": "^3.0.5"
99
107
  }
100
108
  }
@@ -1,7 +0,0 @@
1
- export interface AppContextProps {
2
- muted: boolean;
3
- splitView: boolean;
4
- showOnlineUsersTab: boolean;
5
- setUnreadCount: (c: number) => void;
6
- }
7
- export declare const AppContext: import('react').Context<AppContextProps | undefined>;
@@ -1,10 +0,0 @@
1
- import { default as React } from 'react';
2
- interface AppProviderProps {
3
- children?: React.ReactNode;
4
- muted: boolean;
5
- splitView: boolean;
6
- showOnlineUsersTab: boolean;
7
- setUnreadCount: (c: number) => void;
8
- }
9
- export declare const AppProvider: React.FC<AppProviderProps>;
10
- export {};
@@ -1,3 +0,0 @@
1
- import { AppContextProps } from '../AppContext';
2
- declare function useAppContext(): AppContextProps;
3
- export default useAppContext;