@droppii-org/chat-sdk 0.5.4 → 0.5.5
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/dist/components/chat-bubble/ChatBubble.d.ts.map +1 -1
- package/dist/components/chat-bubble/ChatBubble.js +2 -2
- package/dist/components/shadow-style-boundary/ShadowStyleBoundary.d.ts +14 -0
- package/dist/components/shadow-style-boundary/ShadowStyleBoundary.d.ts.map +1 -0
- package/dist/components/shadow-style-boundary/ShadowStyleBoundary.js +14 -0
- package/dist/context/ChatContext.d.ts.map +1 -1
- package/dist/context/ChatContext.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBubble.d.ts","sourceRoot":"","sources":["../../../src/components/chat-bubble/ChatBubble.tsx"],"names":[],"mappings":"AASA,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,GAAI,eAAe,eAAe,
|
|
1
|
+
{"version":3,"file":"ChatBubble.d.ts","sourceRoot":"","sources":["../../../src/components/chat-bubble/ChatBubble.tsx"],"names":[],"mappings":"AASA,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,UAAU,GAAI,eAAe,eAAe,4CAwGjD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -15,7 +15,7 @@ const ChatBubble = ({ className }) => {
|
|
|
15
15
|
const displayUnread = unreadCount > 99 ? "99+" : unreadCount;
|
|
16
16
|
const [isOpen, { setFalse: setOpenFalse, toggle: toggleChat }] = useBoolean(false);
|
|
17
17
|
if (isMobile) {
|
|
18
|
-
return (_jsxs(_Fragment, { children: [_jsx(ConfigProvider, { theme: { token: { colorPrimary: ANTD_PRIMARY_COLOR_VAR } }, children: _jsx(FloatButton, { icon: isOpen ? _jsx(CloseOutlined, {}) : _jsx(MessageOutlined, {}), type: "primary", style: {
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx(ConfigProvider, { theme: { token: { colorPrimary: ANTD_PRIMARY_COLOR_VAR } }, children: _jsx(FloatButton, { icon: _jsx("span", { className: "text-white", children: isOpen ? _jsx(CloseOutlined, {}) : _jsx(MessageOutlined, {}) }), type: "primary", style: {
|
|
19
19
|
right: 24,
|
|
20
20
|
bottom: 24,
|
|
21
21
|
width: 60,
|
|
@@ -26,7 +26,7 @@ const ChatBubble = ({ className }) => {
|
|
|
26
26
|
wrapper: "!z-[9999]",
|
|
27
27
|
}, width: "100%", push: false, children: _jsx(MessageList, { conversationId: selectedConversationId, className: "flex-1", onClose: setOpenFalse, searchClientMsgID: searchClientMsgID }) })] }));
|
|
28
28
|
}
|
|
29
|
-
return (_jsx(Popover, { placement: "topLeft", trigger: "click", open: isOpen, destroyOnHidden: true, content: () => (_jsx("div", { className: "w-[400px] h-[600px]", children: _jsx(MessageList, { conversationId: selectedConversationId, className: "flex-1", onClose: setOpenFalse, searchClientMsgID: searchClientMsgID }) })), styles: { body: { padding: 0 } }, children: _jsx(ConfigProvider, { theme: { token: { colorPrimary: ANTD_PRIMARY_COLOR_VAR } }, children: _jsx(FloatButton, { icon: isOpen ? _jsx(CloseOutlined, {}) : _jsx(MessageOutlined, {}), type: "primary", style: {
|
|
29
|
+
return (_jsx(Popover, { placement: "topLeft", trigger: "click", open: isOpen, destroyOnHidden: true, content: () => (_jsx("div", { className: "w-[400px] h-[600px]", children: _jsx(MessageList, { conversationId: selectedConversationId, className: "flex-1", onClose: setOpenFalse, searchClientMsgID: searchClientMsgID }) })), styles: { body: { padding: 0 } }, children: _jsx(ConfigProvider, { theme: { token: { colorPrimary: ANTD_PRIMARY_COLOR_VAR } }, children: _jsx(FloatButton, { icon: _jsx("span", { className: "text-white", children: isOpen ? _jsx(CloseOutlined, {}) : _jsx(MessageOutlined, {}) }), type: "primary", style: {
|
|
30
30
|
right: 24,
|
|
31
31
|
bottom: 24,
|
|
32
32
|
width: 60,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ShadowStyleBoundaryProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
/**
|
|
4
|
+
* The ShadowRoot (or other container) chat-sdk's UI renders inside.
|
|
5
|
+
* antd generates its CSS at runtime and injects it into `document.head`
|
|
6
|
+
* by default, which never applies inside a Shadow DOM — pass the
|
|
7
|
+
* ShadowRoot here so antd's dynamic styles (Drawer, Dropdown, Modal, …)
|
|
8
|
+
* land where the DOM they style actually is.
|
|
9
|
+
*/
|
|
10
|
+
styleContainer: Element | ShadowRoot;
|
|
11
|
+
}
|
|
12
|
+
declare const ShadowStyleBoundary: ({ children, styleContainer, }: ShadowStyleBoundaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default ShadowStyleBoundary;
|
|
14
|
+
//# sourceMappingURL=ShadowStyleBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShadowStyleBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/shadow-style-boundary/ShadowStyleBoundary.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;;;OAMG;IACH,cAAc,EAAE,OAAO,GAAG,UAAU,CAAC;CACtC;AAMD,QAAA,MAAM,mBAAmB,GAAI,+BAG1B,wBAAwB,4CAY1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { ConfigProvider } from "antd";
|
|
5
|
+
import { StyleProvider } from "@ant-design/cssinjs";
|
|
6
|
+
// Wrap chat-sdk UI (e.g. DChatConversationInbox, DChatBubble) in this when
|
|
7
|
+
// it renders inside a Shadow DOM. Without it, antd components that portal
|
|
8
|
+
// (Drawer with getContainer={false}, Dropdown, Modal, ...) render with no
|
|
9
|
+
// positioning CSS applied and break out of their intended bounds.
|
|
10
|
+
const ShadowStyleBoundary = ({ children, styleContainer, }) => {
|
|
11
|
+
const rootRef = useRef(null);
|
|
12
|
+
return (_jsx(StyleProvider, { container: styleContainer, children: _jsx(ConfigProvider, { getPopupContainer: () => { var _a; return (_a = rootRef.current) !== null && _a !== void 0 ? _a : document.body; }, children: _jsx("div", { ref: rootRef, className: "contents", children: children }) }) }));
|
|
13
|
+
};
|
|
14
|
+
export default ShadowStyleBoundary;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/context/ChatContext.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,iBAAiB,EAGlB,MAAM,cAAc,CAAC;AAStB,eAAO,MAAM,WAAW,0CAOtB,CAAC;AAEH,eAAO,MAAM,cAAc,uBAAgC,CAAC;AAS5D,eAAO,MAAM,YAAY,GAAI,uFAO1B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/context/ChatContext.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,iBAAiB,EAGlB,MAAM,cAAc,CAAC;AAStB,eAAO,MAAM,WAAW,0CAOtB,CAAC;AAEH,eAAO,MAAM,cAAc,uBAAgC,CAAC;AAS5D,eAAO,MAAM,YAAY,GAAI,uFAO1B,iBAAiB,4CAyHnB,CAAC"}
|
|
@@ -32,6 +32,7 @@ export const ChatProvider = ({ children, config, renderCustomMessage, onNavigate
|
|
|
32
32
|
"--dc-color-primary-light": (_c = theme === null || theme === void 0 ? void 0 : theme.primaryLight) !== null && _c !== void 0 ? _c : DEFAULT_THEME["--dc-color-primary-light"],
|
|
33
33
|
"--dc-color-primary-focus": (_d = theme === null || theme === void 0 ? void 0 : theme.primaryFocus) !== null && _d !== void 0 ? _d : DEFAULT_THEME["--dc-color-primary-focus"],
|
|
34
34
|
};
|
|
35
|
+
const rootRef = useRef(null);
|
|
35
36
|
const [connectStatus, setConnectStatus] = useState(ConnectStatus.Disconnected);
|
|
36
37
|
const [syncStatus, setSyncStatus] = useState(SyncStatus.Success);
|
|
37
38
|
const [user, setUser] = useState(null);
|
|
@@ -109,5 +110,5 @@ export const ChatProvider = ({ children, config, renderCustomMessage, onNavigate
|
|
|
109
110
|
renderCustomMessage,
|
|
110
111
|
onNavigate,
|
|
111
112
|
renderGroupAccessModal,
|
|
112
|
-
}, children: _jsx(ConfigProvider, { getPopupContainer: (
|
|
113
|
+
}, children: _jsx(ConfigProvider, { getPopupContainer: () => { var _a; return (_a = rootRef.current) !== null && _a !== void 0 ? _a : document.body; }, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx("div", { ref: rootRef, style: themeStyle, className: "contents", children: _jsx(MainLayout, { children: children }) }) }) }) }));
|
|
113
114
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export type { DChatTheme, ChatProviderProps } from "./types/chat";
|
|
|
16
16
|
export { openLink } from "./utils/openLink";
|
|
17
17
|
export { DChatDeskMessage, DChatBubble, Icon };
|
|
18
18
|
export { default as RichTextEditor } from "./components/rich-text-editor/RichTextEditor";
|
|
19
|
+
export { default as ShadowStyleBoundary } from "./components/shadow-style-boundary/ShadowStyleBoundary";
|
|
20
|
+
export type { ShadowStyleBoundaryProps } from "./components/shadow-style-boundary/ShadowStyleBoundary";
|
|
19
21
|
export { default as DChatConversationInbox } from "./screens/conversation-inbox";
|
|
20
22
|
export type { DChatConversationInboxProps } from "./screens/conversation-inbox";
|
|
21
23
|
export { default as DChatConversationDetail } from "./screens/conversation-detail";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","s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iCAAiC,EAAE,MAAM,mDAAmD,CAAC;AAGtG,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAIvE,OAAO,EACL,QAAQ,IAAI,aAAa,EACzB,QAAQ,IAAI,aAAa,EACzB,WAAW,IAAI,gBAAgB,GAChC,CAAC;AAEF,YAAY,EAAE,uBAAuB,EAAE,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export { openLink } from "./utils/openLink";
|
|
|
17
17
|
//Components
|
|
18
18
|
export { DChatDeskMessage, DChatBubble, Icon };
|
|
19
19
|
export { default as RichTextEditor } from "./components/rich-text-editor/RichTextEditor";
|
|
20
|
+
export { default as ShadowStyleBoundary } from "./components/shadow-style-boundary/ShadowStyleBoundary";
|
|
20
21
|
export { default as DChatConversationInbox } from "./screens/conversation-inbox";
|
|
21
22
|
export { default as DChatConversationDetail } from "./screens/conversation-detail";
|
|
22
23
|
export { ConversationDetailHeader, ConversationDetailInput, } from "./components/conversation-detail";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@droppii-org/chat-sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "Droppii React Chat SDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
+
"@ant-design/cssinjs": "^1.24.0",
|
|
86
87
|
"@ant-design/icons": "^6.0.0",
|
|
87
88
|
"@droppii-org/wasm-client-sdk": "0.5.0",
|
|
88
89
|
"@lexical/code": "^0.34.0",
|