cometchat-visual-builder-no-code 1.0.20-authtest3 → 1.0.20-authtest30

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.
@@ -7,6 +7,8 @@ interface CometChatAppProps {
7
7
  group?: CometChat.Group;
8
8
  /** Show or hide group action messages (optional). */
9
9
  showGroupActionMessages?: boolean;
10
+ autoOpenFirstItem?: boolean;
11
+ defaultActiveTab?: 'chats' | 'calls' | 'users' | 'groups';
10
12
  }
11
13
  /**
12
14
  * Main application component for the CometChat Builder.
@@ -14,5 +16,5 @@ interface CometChatAppProps {
14
16
  * @param {CometChatAppProps} props - The component props.
15
17
  * @returns {JSX.Element} The rendered CometChatApp component.
16
18
  */
17
- declare function CometChatApp({ user, group, showGroupActionMessages }: CometChatAppProps): import("react/jsx-runtime").JSX.Element;
19
+ declare function CometChatApp({ user, group, showGroupActionMessages, autoOpenFirstItem, defaultActiveTab, }: CometChatAppProps): import("react/jsx-runtime").JSX.Element;
18
20
  export default CometChatApp;
@@ -14,6 +14,7 @@ export interface CometChatSettingsInterface {
14
14
  conversationAndAdvancedSearch?: boolean;
15
15
  moderation?: boolean;
16
16
  quotedReplies?: boolean;
17
+ markAsUnread?: boolean;
17
18
  };
18
19
  deeperUserEngagement: {
19
20
  mentions: boolean;
@@ -9,7 +9,9 @@ interface CometChatHomeProps {
9
9
  defaultUser?: CometChat.User;
10
10
  defaultGroup?: CometChat.Group;
11
11
  showGroupActionMessages?: boolean;
12
+ autoOpenFirstItem?: boolean;
13
+ defaultActiveTab?: 'chats' | 'calls' | 'users' | 'groups';
12
14
  }
13
- declare function CometChatHome({ defaultUser, defaultGroup, showGroupActionMessages }: CometChatHomeProps): import("react/jsx-runtime").JSX.Element | null;
15
+ declare function CometChatHome({ defaultUser, defaultGroup, showGroupActionMessages, autoOpenFirstItem, defaultActiveTab, }: CometChatHomeProps): import("react/jsx-runtime").JSX.Element | null;
14
16
  declare const MemoizedCometChatHome: React.MemoExoticComponent<typeof CometChatHome>;
15
17
  export { MemoizedCometChatHome as CometChatHome };
@@ -35,6 +35,7 @@ export interface CometChatSettingsInterface {
35
35
  conversationAndAdvancedSearch?: boolean;
36
36
  moderation?: boolean;
37
37
  quotedReplies?: boolean;
38
+ markAsUnread?: boolean;
38
39
  };
39
40
  deeperUserEngagement: {
40
41
  mentions: boolean;
@@ -0,0 +1,24 @@
1
+ import { CometChatSettingsInterface } from '../context/CometChatContext';
2
+ /**
3
+ * Recursively merges API settings with default settings.
4
+ *
5
+ * Rules:
6
+ * - If a key exists in API response (even if false or null), use the API value
7
+ * - If a key is undefined or missing in API response, use the default value
8
+ * - For nested objects, recursively apply the same merge logic
9
+ * - For arrays, use API value if present, otherwise use default
10
+ *
11
+ * @param apiSettings - Settings from the API (may be partial)
12
+ * @param defaultSettings - Complete default settings
13
+ * @returns Merged settings object with all required keys
14
+ */
15
+ export declare function mergeWithDefaults<T extends Record<string, unknown>>(apiSettings: Partial<T> | undefined, defaultSettings: T): T;
16
+ /**
17
+ * Merges API builder settings with default CometChat settings.
18
+ * Ensures all required keys and nested properties are present.
19
+ *
20
+ * @param apiSettings - Partial settings from the API
21
+ * @param defaultSettings - Complete default CometChatSettings
22
+ * @returns Complete CometChatSettingsInterface with all required keys
23
+ */
24
+ export declare function mergeBuilderSettings(apiSettings: Partial<CometChatSettingsInterface> | undefined, defaultSettings: CometChatSettingsInterface): CometChatSettingsInterface;
@@ -1,4 +1,4 @@
1
- import { CometChat } from "@cometchat/chat-sdk-javascript";
1
+ import { CometChat, CometChatNotifications } from "@cometchat/chat-sdk-javascript";
2
2
  declare let appID: string;
3
3
  declare let appRegion: string;
4
4
  declare let authKey: string;
@@ -21,6 +21,7 @@ export interface VcbData {
21
21
  showGroupActionMessages?: boolean;
22
22
  storageMode?: string;
23
23
  callInitiatedViaAPI?: boolean;
24
+ autoOpenFirstItem?: boolean;
24
25
  }
25
26
  export declare const vcbData: VcbData;
26
27
  export declare const listeners: Record<string, Function>;
@@ -48,6 +49,7 @@ declare const CometChatApp: {
48
49
  aiAssistantTools?: any;
49
50
  showDockedUnreadCount?: boolean;
50
51
  showGroupActionMessages?: boolean;
52
+ autoOpenFirstItem?: boolean;
51
53
  }) => Promise<void>;
52
54
  uiEvent: (eventName: string, callback: Function) => void;
53
55
  callUser: (uid: string) => Promise<void>;
@@ -61,5 +63,20 @@ declare const CometChatApp: {
61
63
  showDockedUnreadCount: (show?: boolean) => void;
62
64
  showGroupActionMessages: (show?: boolean) => void;
63
65
  CometChat: typeof CometChat;
66
+ CometChatAuth: {
67
+ _config: import("./auth/cometchat-auth").CometChatWidgetConfig & {
68
+ [key: string]: any;
69
+ };
70
+ start(config: import("./auth/cometchat-auth").CometChatWidgetConfig): Promise<void>;
71
+ _validateConfig(): void;
72
+ _initSDK(): Promise<void>;
73
+ _login(): Promise<any>;
74
+ _ensureUserExists(uid: string, isGuest?: boolean): Promise<void>;
75
+ _authCreateOrUpdateUser(user: any, userNameAvailable: boolean): Promise<any>;
76
+ _getOrCreateGuestUID(): string;
77
+ _getCookie(name: string): string | undefined;
78
+ _launchWidget(): Promise<any>;
79
+ };
80
+ CometChatNotifications: typeof CometChatNotifications;
64
81
  };
65
82
  export default CometChatApp;
@@ -0,0 +1,46 @@
1
+ export interface CometChatWidgetConfig {
2
+ appID: string;
3
+ region: string;
4
+ storageMode?: string;
5
+ mode: string;
6
+ authKey?: string;
7
+ uid?: string;
8
+ authToken?: string;
9
+ user?: {
10
+ name?: string;
11
+ avatar?: string;
12
+ link?: string;
13
+ metadata?: any;
14
+ };
15
+ mount: string;
16
+ width?: string;
17
+ height?: string;
18
+ isDocked?: boolean;
19
+ variantID?: string;
20
+ chatType?: string;
21
+ defaultChatID?: string;
22
+ autoOpenFirstItem?: boolean;
23
+ dockedAlignment?: string;
24
+ targetElementID?: string;
25
+ }
26
+ type InternalConfig = CometChatWidgetConfig & {
27
+ [key: string]: any;
28
+ };
29
+ declare global {
30
+ interface Window {
31
+ CometChatApp: any;
32
+ }
33
+ }
34
+ export declare const CometChatAuth: {
35
+ _config: InternalConfig;
36
+ start(config: CometChatWidgetConfig): Promise<void>;
37
+ _validateConfig(): void;
38
+ _initSDK(): Promise<void>;
39
+ _login(): Promise<any>;
40
+ _ensureUserExists(uid: string, isGuest?: boolean): Promise<void>;
41
+ _authCreateOrUpdateUser(user: any, userNameAvailable: boolean): Promise<any>;
42
+ _getOrCreateGuestUID(): string;
43
+ _getCookie(name: string): string | undefined;
44
+ _launchWidget(): Promise<any>;
45
+ };
46
+ export default CometChatAuth;
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "cometchat-visual-builder-no-code",
3
- "version": "1.0.20-authtest3",
3
+ "version": "1.0.20-authtest30",
4
4
  "description": "CometChat Widget Builder No-Code Integration",
5
5
  "cometChatCustomConfig": {
6
- "prodVersion": "1.0.19",
7
- "devStagingVersion": "1.0.20-authtest3",
6
+ "prodVersion": "1.0.26",
7
+ "devStagingVersion": "1.0.20-authtest7",
8
8
  "prodName": "@cometchat/chat-embed",
9
9
  "devName": "cometchat-visual-builder-no-code",
10
10
  "name": "cometchat-visual-builder-react-no-code",
11
- "version": "1.0.19",
11
+ "version": "1.0.26",
12
12
  "production": true
13
13
  },
14
14
  "author": "CometChat",
15
15
  "dependencies": {
16
- "@cometchat/calls-sdk-javascript": "4.2.1",
17
- "@cometchat/chat-uikit-react": "6.3.5",
16
+ "@cometchat/calls-sdk-javascript": "4.2.2",
17
+ "@cometchat/chat-uikit-react": "6.3.7",
18
18
  "react": "18.2.0",
19
19
  "react-dom": "18.2.0",
20
20
  "react-frame-component": "^5.2.7",