cometchat-visual-builder-no-code 1.0.20-authtest4 → 1.0.20-authtest40

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.
@@ -1,12 +1,3 @@
1
- /**
2
- * Prism: Lightweight, robust, elegant syntax highlighting
3
- *
4
- * @license MIT <https://opensource.org/licenses/MIT>
5
- * @author Lea Verou <https://lea.verou.me>
6
- * @namespace
7
- * @public
8
- */
9
-
10
1
  /**
11
2
  * @license React
12
3
  * react-dom.production.min.js
@@ -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;
@@ -54,6 +55,10 @@ export interface CometChatSettingsInterface {
54
55
  privateMessagingWithinGroups: {
55
56
  sendPrivateMessageToGroupMembers: boolean;
56
57
  };
58
+ inAppSounds: {
59
+ incomingMessageSound?: boolean;
60
+ outgoingMessageSound?: boolean;
61
+ };
57
62
  };
58
63
  callFeatures: {
59
64
  voiceAndVideoCalling: {
@@ -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;
@@ -74,6 +75,10 @@ export interface CometChatSettingsInterface {
74
75
  privateMessagingWithinGroups: {
75
76
  sendPrivateMessageToGroupMembers: boolean;
76
77
  };
78
+ inAppSounds: {
79
+ incomingMessageSound?: boolean;
80
+ outgoingMessageSound?: boolean;
81
+ };
77
82
  };
78
83
  callFeatures: {
79
84
  voiceAndVideoCalling: {
@@ -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,9 @@ export interface VcbData {
21
21
  showGroupActionMessages?: boolean;
22
22
  storageMode?: string;
23
23
  callInitiatedViaAPI?: boolean;
24
+ autoOpenFirstItem?: boolean;
25
+ parentMessageId?: number;
26
+ loadLastAgentConversation?: boolean;
24
27
  }
25
28
  export declare const vcbData: VcbData;
26
29
  export declare const listeners: Record<string, Function>;
@@ -48,6 +51,9 @@ declare const CometChatApp: {
48
51
  aiAssistantTools?: any;
49
52
  showDockedUnreadCount?: boolean;
50
53
  showGroupActionMessages?: boolean;
54
+ autoOpenFirstItem?: boolean;
55
+ parentMessageId?: number;
56
+ loadLastAgentConversation?: boolean;
51
57
  }) => Promise<void>;
52
58
  uiEvent: (eventName: string, callback: Function) => void;
53
59
  callUser: (uid: string) => Promise<void>;
@@ -61,5 +67,20 @@ declare const CometChatApp: {
61
67
  showDockedUnreadCount: (show?: boolean) => void;
62
68
  showGroupActionMessages: (show?: boolean) => void;
63
69
  CometChat: typeof CometChat;
70
+ CometChatAuth: {
71
+ _config: import("./auth/cometchat-auth").CometChatWidgetConfig & {
72
+ [key: string]: any;
73
+ };
74
+ start(config: import("./auth/cometchat-auth").CometChatWidgetConfig): Promise<void>;
75
+ _validateConfig(): void;
76
+ _initSDK(): Promise<void>;
77
+ _login(): Promise<any>;
78
+ _ensureUserExists(uid: string, isGuest?: boolean): Promise<void>;
79
+ _authCreateOrUpdateUser(user: any, userNameAvailable: boolean): Promise<any>;
80
+ _getOrCreateGuestUID(): string;
81
+ _getCookie(name: string): string | undefined;
82
+ _launchWidget(): Promise<any>;
83
+ };
84
+ CometChatNotifications: typeof CometChatNotifications;
64
85
  };
65
86
  export default CometChatApp;
@@ -0,0 +1,48 @@
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
+ parentMessageId?: number;
26
+ loadLastAgentConversation?: boolean;
27
+ }
28
+ type InternalConfig = CometChatWidgetConfig & {
29
+ [key: string]: any;
30
+ };
31
+ declare global {
32
+ interface Window {
33
+ CometChatApp: any;
34
+ }
35
+ }
36
+ export declare const CometChatAuth: {
37
+ _config: InternalConfig;
38
+ start(config: CometChatWidgetConfig): Promise<void>;
39
+ _validateConfig(): void;
40
+ _initSDK(): Promise<void>;
41
+ _login(): Promise<any>;
42
+ _ensureUserExists(uid: string, isGuest?: boolean): Promise<void>;
43
+ _authCreateOrUpdateUser(user: any, userNameAvailable: boolean): Promise<any>;
44
+ _getOrCreateGuestUID(): string;
45
+ _getCookie(name: string): string | undefined;
46
+ _launchWidget(): Promise<any>;
47
+ };
48
+ export default CometChatAuth;
@@ -4,6 +4,8 @@ import "./AiAgentView.css";
4
4
  interface AIAgentViewProps {
5
5
  user: CometChat.User;
6
6
  aiAssistantTools?: CometChatAIAssistantTools;
7
+ parentMessageId?: number;
8
+ loadLastAgentConversation?: boolean;
7
9
  }
8
10
  declare const AIAgentView: React.FC<AIAgentViewProps>;
9
11
  export default AIAgentView;
@@ -5,6 +5,8 @@ interface EmbeddedChatViewInterface {
5
5
  group?: CometChat.Group;
6
6
  type?: string;
7
7
  aiAssistantTools?: CometChatAIAssistantTools;
8
+ parentMessageId?: number;
9
+ loadLastAgentConversation?: boolean;
8
10
  }
9
- declare const EmbeddedChatView: ({ showSidebarOnDesktop, user, group, type, aiAssistantTools }: EmbeddedChatViewInterface) => import("react/jsx-runtime").JSX.Element;
11
+ declare const EmbeddedChatView: ({ showSidebarOnDesktop, user, group, type, aiAssistantTools, parentMessageId, loadLastAgentConversation }: EmbeddedChatViewInterface) => import("react/jsx-runtime").JSX.Element;
10
12
  export default EmbeddedChatView;
@@ -1,3 +1,4 @@
1
+ import "./sdkStyleMarker";
1
2
  import "./noCodeGlobal.css";
2
3
  import "@cometchat/chat-uikit-react/css-variables.css";
3
4
  export declare const showOutgoingCallUI: (call: any) => void;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Monkeypatch document.createElement to auto-stamp all <style> elements
3
+ * created after the CometChat bundle loads with a `data-cometchat-sdk` attribute.
4
+ *
5
+ * This MUST be imported as the very first import in the bundle entry point (index.tsx).
6
+ *
7
+ * How it works:
8
+ * - Before the bundle loads, the host page may have already created <style> elements.
9
+ * Those won't have the marker.
10
+ * - After this script runs, every new <style> element created via document.createElement
11
+ * will automatically get `data-cometchat-sdk="true"`.
12
+ * - This covers: webpack style-loader injections, MUI/JSS runtime styles, CometChat Calls
13
+ * SDK styles (goober, .ccccn, .awssld), and any other SDK-created styles.
14
+ * - Host page styles added dynamically AFTER the bundle loads will also get the marker,
15
+ * but that's acceptable because host pages rarely create <style> elements after load.
16
+ * The key insight: host styles that exist BEFORE the bundle loads are the ones that
17
+ * cause CSS conflicts, and those won't have the marker.
18
+ *
19
+ * The IframePortal then uses this marker to decide what to copy into the iframe:
20
+ * - Has `data-cometchat-sdk` or `data-cometchat` → copy (SDK/widget style)
21
+ * - Doesn't have either → block (host page style)
22
+ */
23
+ declare const _origCreateElement: {
24
+ <K extends keyof HTMLElementTagNameMap>(tagName: K, options?: ElementCreationOptions | undefined): HTMLElementTagNameMap[K];
25
+ <K_1 extends keyof HTMLElementDeprecatedTagNameMap>(tagName: K_1, options?: ElementCreationOptions | undefined): HTMLElementDeprecatedTagNameMap[K_1];
26
+ (tagName: string, options?: ElementCreationOptions | undefined): HTMLElement;
27
+ };
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "cometchat-visual-builder-no-code",
3
- "version": "1.0.20-authtest4",
3
+ "version": "1.0.20-authtest40",
4
4
  "description": "CometChat Widget Builder No-Code Integration",
5
5
  "cometChatCustomConfig": {
6
- "prodVersion": "1.0.19",
7
- "devStagingVersion": "1.0.20-authtest4",
6
+ "prodVersion": "1.0.31",
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.31",
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.4",
17
+ "@cometchat/chat-uikit-react": "6.3.11",
18
18
  "react": "18.2.0",
19
19
  "react-dom": "18.2.0",
20
20
  "react-frame-component": "^5.2.7",