@cometchat/skills-cli 2.4.1 → 3.0.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 +45 -37
- package/dist/index.js +1821 -13090
- package/dist/utils/error-dictionary.js +0 -69
- package/package.json +10 -12
- package/dist/registry/schemas/config.schema.json +0 -119
- package/dist/registry/schemas/template.schema.json +0 -142
- package/dist/registry/v6/experiences/1-conversation-list/astro.template.json +0 -89
- package/dist/registry/v6/experiences/1-conversation-list/nextjs-pages.template.json +0 -83
- package/dist/registry/v6/experiences/1-conversation-list/nextjs.template.json +0 -83
- package/dist/registry/v6/experiences/1-conversation-list/react-router.template.json +0 -102
- package/dist/registry/v6/experiences/1-conversation-list/reactjs-dedicated-route.template.json +0 -81
- package/dist/registry/v6/experiences/1-conversation-list/reactjs.template.json +0 -86
- package/dist/registry/v6/experiences/1-conversation-list/templates/astro/ChatApp.css.tpl +0 -43
- package/dist/registry/v6/experiences/1-conversation-list/templates/astro/ChatApp.tsx.tpl +0 -86
- package/dist/registry/v6/experiences/1-conversation-list/templates/astro/CometChatSelector.tsx.tpl +0 -40
- package/dist/registry/v6/experiences/1-conversation-list/templates/astro/chat.astro.tpl +0 -17
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatNoSSR.css.tpl +0 -43
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatNoSSR.tsx.tpl +0 -86
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatSelector.tsx.tpl +0 -41
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/chat-page.tsx.tpl +0 -11
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatNoSSR.css.tpl +0 -43
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatNoSSR.tsx.tpl +0 -88
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatSelector.tsx.tpl +0 -41
- package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/chat-page.tsx.tpl +0 -15
- package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChat-route.tsx.tpl +0 -22
- package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatNoSSR.css.tpl +0 -43
- package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatNoSSR.tsx.tpl +0 -87
- package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatSelector.tsx.tpl +0 -40
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/App.css.tpl +0 -40
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/App.tsx.tpl +0 -55
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/CometChatSelector.tsx.tpl +0 -40
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/main.tsx.tpl +0 -46
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/ChatPage.tsx.tpl +0 -87
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/CometChatMessenger.css.tpl +0 -20
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/CometChatMessenger.tsx.tpl +0 -54
- package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/CometChatSelector.tsx.tpl +0 -40
- package/dist/registry/v6/experiences/2-one-to-one/astro.template.json +0 -81
- package/dist/registry/v6/experiences/2-one-to-one/nextjs.template.json +0 -77
- package/dist/registry/v6/experiences/2-one-to-one/react-router.template.json +0 -93
- package/dist/registry/v6/experiences/2-one-to-one/reactjs-dedicated-route.template.json +0 -75
- package/dist/registry/v6/experiences/2-one-to-one/reactjs.template.json +0 -80
- package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.css.tpl +0 -21
- package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.tsx.tpl +0 -66
- package/dist/registry/v6/experiences/2-one-to-one/templates/astro/chat.astro.tpl +0 -17
- package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.css.tpl +0 -21
- package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.tsx.tpl +0 -66
- package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/chat-page.tsx.tpl +0 -11
- package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChat-route.tsx.tpl +0 -21
- package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.css.tpl +0 -21
- package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.tsx.tpl +0 -67
- package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.css.tpl +0 -4
- package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.tsx.tpl +0 -44
- package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/main.tsx.tpl +0 -46
- package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs-dedicated-route/ChatPage.tsx.tpl +0 -84
- package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs-dedicated-route/CometChatMessenger.css.tpl +0 -9
- package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs-dedicated-route/CometChatMessenger.tsx.tpl +0 -43
- package/dist/registry/v6/experiences/3-tab-based/astro.template.json +0 -93
- package/dist/registry/v6/experiences/3-tab-based/nextjs.template.json +0 -90
- package/dist/registry/v6/experiences/3-tab-based/react-router.template.json +0 -105
- package/dist/registry/v6/experiences/3-tab-based/reactjs-dedicated-route.template.json +0 -89
- package/dist/registry/v6/experiences/3-tab-based/reactjs.template.json +0 -93
- package/dist/registry/v6/experiences/3-tab-based/templates/astro/ChatApp.css.tpl +0 -39
- package/dist/registry/v6/experiences/3-tab-based/templates/astro/ChatApp.tsx.tpl +0 -93
- package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.css.tpl +0 -43
- package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.tsx.tpl +0 -72
- package/dist/registry/v6/experiences/3-tab-based/templates/astro/chat.astro.tpl +0 -17
- package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatNoSSR.css.tpl +0 -39
- package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatNoSSR.tsx.tpl +0 -93
- package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.css.tpl +0 -43
- package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.tsx.tpl +0 -73
- package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/chat-page.tsx.tpl +0 -11
- package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChat-route.tsx.tpl +0 -21
- package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatNoSSR.css.tpl +0 -39
- package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatNoSSR.tsx.tpl +0 -94
- package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.css.tpl +0 -43
- package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.tsx.tpl +0 -72
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/App.css.tpl +0 -7
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/App.tsx.tpl +0 -62
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.css.tpl +0 -43
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.tsx.tpl +0 -72
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/main.tsx.tpl +0 -46
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/ChatPage.tsx.tpl +0 -84
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatMessenger.css.tpl +0 -11
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatMessenger.tsx.tpl +0 -61
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatTabs.css.tpl +0 -43
- package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatTabs.tsx.tpl +0 -72
- package/dist/registry/v6/features/catalog.json +0 -990
- package/dist/registry/v6/production/astro/cometchat-token.ts.tpl +0 -86
- package/dist/registry/v6/production/astro.template.json +0 -51
- package/dist/registry/v6/production/nextjs/route.ts.tpl +0 -79
- package/dist/registry/v6/production/nextjs.template.json +0 -50
- package/dist/registry/v6/production/react-router/api.cometchat-token.ts.tpl +0 -73
- package/dist/registry/v6/production/react-router.template.json +0 -58
- package/dist/registry/v6/user-mgmt/astro/cometchat-user.ts.tpl +0 -164
- package/dist/registry/v6/user-mgmt/astro.template.json +0 -33
- package/dist/registry/v6/user-mgmt/nextjs/route.ts.tpl +0 -212
- package/dist/registry/v6/user-mgmt/nextjs.template.json +0 -57
- package/dist/registry/v6/user-mgmt/react-router/api.cometchat-user.ts.tpl +0 -176
- package/dist/registry/v6/user-mgmt/react-router.template.json +0 -40
- package/dist/registry/v6/widget/astro/CometChatWidget.css.tpl +0 -105
- package/dist/registry/v6/widget/astro/CometChatWidget.tsx.tpl +0 -88
- package/dist/registry/v6/widget/astro.template.json +0 -38
- package/dist/registry/v6/widget/nextjs/CometChatWidget.css.tpl +0 -105
- package/dist/registry/v6/widget/nextjs/CometChatWidget.tsx.tpl +0 -88
- package/dist/registry/v6/widget/nextjs.template.json +0 -40
- package/dist/registry/v6/widget/react-router/CometChatWidget.css.tpl +0 -105
- package/dist/registry/v6/widget/react-router/CometChatWidget.tsx.tpl +0 -98
- package/dist/registry/v6/widget/react-router.template.json +0 -36
- package/dist/registry/v6/widget/reactjs/CometChatWidget.css.tpl +0 -105
- package/dist/registry/v6/widget/reactjs/CometChatWidget.tsx.tpl +0 -89
- package/dist/registry/v6/widget/reactjs.template.json +0 -36
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CometChatWidget — floating chat overlay.
|
|
3
|
-
*
|
|
4
|
-
* Renders a fixed-position button in the bottom-right corner. Click it to
|
|
5
|
-
* open a drawer containing the CometChat conversation list + message view.
|
|
6
|
-
*
|
|
7
|
-
* Assumes CometChatUIKit.init() and CometChatUIKit.login() have already been
|
|
8
|
-
* called elsewhere (e.g. in src/main.tsx). The widget just renders the
|
|
9
|
-
* existing logged-in user's chat — it does NOT initialize CometChat.
|
|
10
|
-
*
|
|
11
|
-
* To use:
|
|
12
|
-
* import CometChatWidget from "./cometchat/CometChatWidget";
|
|
13
|
-
* // ...
|
|
14
|
-
* <CometChatWidget />
|
|
15
|
-
*/
|
|
16
|
-
import { useEffect, useState } from "react";
|
|
17
|
-
import {
|
|
18
|
-
CometChatMessageComposer,
|
|
19
|
-
CometChatMessageHeader,
|
|
20
|
-
CometChatMessageList,
|
|
21
|
-
} from "@cometchat/chat-uikit-react";
|
|
22
|
-
import { CometChat } from "@cometchat/chat-sdk-javascript";
|
|
23
|
-
import { CometChatSelector } from "./CometChatSelector";
|
|
24
|
-
import "./CometChatWidget.css";
|
|
25
|
-
|
|
26
|
-
export default function CometChatWidget() {
|
|
27
|
-
const [open, setOpen] = useState(false);
|
|
28
|
-
const [selectedUser, setSelectedUser] = useState<CometChat.User | undefined>();
|
|
29
|
-
const [selectedGroup, setSelectedGroup] = useState<CometChat.Group | undefined>();
|
|
30
|
-
|
|
31
|
-
// Close on Escape key
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (!open) return;
|
|
34
|
-
const handler = (e: KeyboardEvent) => {
|
|
35
|
-
if (e.key === "Escape") setOpen(false);
|
|
36
|
-
};
|
|
37
|
-
window.addEventListener("keydown", handler);
|
|
38
|
-
return () => window.removeEventListener("keydown", handler);
|
|
39
|
-
}, [open]);
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<>
|
|
43
|
-
<button
|
|
44
|
-
type="button"
|
|
45
|
-
className="cometchat-widget-button"
|
|
46
|
-
onClick={() => setOpen((v) => !v)}
|
|
47
|
-
aria-label={open ? "Close chat" : "Open chat"}
|
|
48
|
-
>
|
|
49
|
-
{open ? "✕" : "💬"}
|
|
50
|
-
</button>
|
|
51
|
-
|
|
52
|
-
{open && (
|
|
53
|
-
<div className="cometchat-widget-drawer" role="dialog" aria-label="Chat">
|
|
54
|
-
<div className="cometchat-widget-conversations">
|
|
55
|
-
<CometChatSelector
|
|
56
|
-
onSelectorItemClicked={(activeItem) => {
|
|
57
|
-
const item =
|
|
58
|
-
activeItem instanceof CometChat.Conversation
|
|
59
|
-
? activeItem.getConversationWith()
|
|
60
|
-
: activeItem;
|
|
61
|
-
if (item instanceof CometChat.User) {
|
|
62
|
-
setSelectedUser(item);
|
|
63
|
-
setSelectedGroup(undefined);
|
|
64
|
-
} else if (item instanceof CometChat.Group) {
|
|
65
|
-
setSelectedUser(undefined);
|
|
66
|
-
setSelectedGroup(item);
|
|
67
|
-
}
|
|
68
|
-
}}
|
|
69
|
-
/>
|
|
70
|
-
</div>
|
|
71
|
-
{selectedUser || selectedGroup ? (
|
|
72
|
-
<div className="cometchat-widget-messages">
|
|
73
|
-
{selectedUser && <CometChatMessageHeader user={selectedUser} />}
|
|
74
|
-
{selectedGroup && <CometChatMessageHeader group={selectedGroup} />}
|
|
75
|
-
{selectedUser && <CometChatMessageList user={selectedUser} />}
|
|
76
|
-
{selectedGroup && <CometChatMessageList group={selectedGroup} />}
|
|
77
|
-
{selectedUser && <CometChatMessageComposer user={selectedUser} />}
|
|
78
|
-
{selectedGroup && <CometChatMessageComposer group={selectedGroup} />}
|
|
79
|
-
</div>
|
|
80
|
-
) : (
|
|
81
|
-
<div className="cometchat-widget-empty">
|
|
82
|
-
Select a conversation to start chatting
|
|
83
|
-
</div>
|
|
84
|
-
)}
|
|
85
|
-
</div>
|
|
86
|
-
)}
|
|
87
|
-
</>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../schemas/template.schema.json",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"experience_id": 1,
|
|
5
|
-
"framework": "reactjs",
|
|
6
|
-
"sdk_compatibility": ">=6.0.0 <7.0.0",
|
|
7
|
-
"default_placement": "spa-root",
|
|
8
|
-
"deps": [],
|
|
9
|
-
"env_vars": [],
|
|
10
|
-
"files": [
|
|
11
|
-
{
|
|
12
|
-
"path": "src/cometchat/CometChatWidget.tsx",
|
|
13
|
-
"action": "create",
|
|
14
|
-
"template_ref": "CometChatWidget.tsx.tpl",
|
|
15
|
-
"owned": true
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"path": "src/cometchat/CometChatWidget.css",
|
|
19
|
-
"action": "create",
|
|
20
|
-
"template_ref": "CometChatWidget.css.tpl",
|
|
21
|
-
"owned": true
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"verify_rules": [],
|
|
25
|
-
"next_steps": [
|
|
26
|
-
"1. The widget component is now at src/cometchat/CometChatWidget.tsx.",
|
|
27
|
-
"2. Import and render it in your root layout (e.g. src/App.tsx):",
|
|
28
|
-
" import CometChatWidget from './cometchat/CometChatWidget';",
|
|
29
|
-
" // Then render <CometChatWidget /> anywhere in your component tree.",
|
|
30
|
-
"3. The widget is a fixed-position floating button in the bottom-right corner.",
|
|
31
|
-
" Click it to open a drawer with the conversation list + message thread.",
|
|
32
|
-
"4. To customize position, edit the .cometchat-widget-button class in CometChatWidget.css.",
|
|
33
|
-
"5. The widget reuses your existing CometChat init/login flow from main.tsx —",
|
|
34
|
-
" you do NOT need to call init/login again inside the widget."
|
|
35
|
-
]
|
|
36
|
-
}
|