@banbox/chat 1.0.10 → 1.0.11
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/index.cjs +9 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chat/ChatRoot.tsx +14 -1
- package/src/chat/InboxPopup.tsx +4 -1
- package/src/chat/SinglePopup.tsx +4 -1
package/dist/index.d.cts
CHANGED
|
@@ -316,8 +316,18 @@ type ChatRootProps = {
|
|
|
316
316
|
* <ChatRoot adapter={adapter} theme="admin" />
|
|
317
317
|
*/
|
|
318
318
|
theme?: ChatTheme;
|
|
319
|
+
/**
|
|
320
|
+
* Keys of footer toolbar actions to hide.
|
|
321
|
+
*
|
|
322
|
+
* Available keys: "attachment" | "emoji" | "businessCard" | "addressCard" | "translate"
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* // Hide the Delivery Address button in the seller app:
|
|
326
|
+
* <ChatRoot hiddenActionKeys={["addressCard"]} ... />
|
|
327
|
+
*/
|
|
328
|
+
hiddenActionKeys?: string[];
|
|
319
329
|
};
|
|
320
|
-
declare function ChatRoot({ adapter, uiCallbacks, theme }: ChatRootProps): React$1.ReactPortal | null;
|
|
330
|
+
declare function ChatRoot({ adapter, uiCallbacks, theme, hiddenActionKeys }: ChatRootProps): React$1.ReactPortal | null;
|
|
321
331
|
|
|
322
332
|
declare function ChatUIProvider({ children }: {
|
|
323
333
|
children: React__default.ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -316,8 +316,18 @@ type ChatRootProps = {
|
|
|
316
316
|
* <ChatRoot adapter={adapter} theme="admin" />
|
|
317
317
|
*/
|
|
318
318
|
theme?: ChatTheme;
|
|
319
|
+
/**
|
|
320
|
+
* Keys of footer toolbar actions to hide.
|
|
321
|
+
*
|
|
322
|
+
* Available keys: "attachment" | "emoji" | "businessCard" | "addressCard" | "translate"
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* // Hide the Delivery Address button in the seller app:
|
|
326
|
+
* <ChatRoot hiddenActionKeys={["addressCard"]} ... />
|
|
327
|
+
*/
|
|
328
|
+
hiddenActionKeys?: string[];
|
|
319
329
|
};
|
|
320
|
-
declare function ChatRoot({ adapter, uiCallbacks, theme }: ChatRootProps): React$1.ReactPortal | null;
|
|
330
|
+
declare function ChatRoot({ adapter, uiCallbacks, theme, hiddenActionKeys }: ChatRootProps): React$1.ReactPortal | null;
|
|
321
331
|
|
|
322
332
|
declare function ChatUIProvider({ children }: {
|
|
323
333
|
children: React__default.ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -3796,7 +3796,7 @@ var avatarBgByInitial = {
|
|
|
3796
3796
|
B: "#F0EDEB",
|
|
3797
3797
|
b: "#F0EDEB"
|
|
3798
3798
|
};
|
|
3799
|
-
var InboxPopup = ({ adapter, uiCallbacks, theme }) => {
|
|
3799
|
+
var InboxPopup = ({ adapter, uiCallbacks, theme, hiddenActionKeys }) => {
|
|
3800
3800
|
const { close, selectThread, selectedThreadId, reference } = useChatUI();
|
|
3801
3801
|
const { isOpen: isGalleryOpen, closeGallery } = useGallery();
|
|
3802
3802
|
const [threads, setThreads] = useState(() => adapter.threads.list(reference));
|
|
@@ -4024,6 +4024,7 @@ var InboxPopup = ({ adapter, uiCallbacks, theme }) => {
|
|
|
4024
4024
|
replyTo,
|
|
4025
4025
|
clearReply: () => setReplyTo(void 0),
|
|
4026
4026
|
onAfterSend: () => setRev((v) => v + 1),
|
|
4027
|
+
hiddenActionKeys,
|
|
4027
4028
|
onSend: (payload) => {
|
|
4028
4029
|
if (activeId) adapter.messages.send(activeId, payload);
|
|
4029
4030
|
}
|
|
@@ -4091,7 +4092,7 @@ function toRef(m) {
|
|
|
4091
4092
|
audio: m.audio
|
|
4092
4093
|
};
|
|
4093
4094
|
}
|
|
4094
|
-
var SinglePopup = ({ adapter, uiCallbacks, theme }) => {
|
|
4095
|
+
var SinglePopup = ({ adapter, uiCallbacks, theme, hiddenActionKeys }) => {
|
|
4095
4096
|
const { close, reference } = useChatUI();
|
|
4096
4097
|
const { isOpen: isGalleryOpen, closeGallery } = useGallery();
|
|
4097
4098
|
const [threads, setThreads] = React16.useState(() => adapter.threads.list(reference));
|
|
@@ -4271,6 +4272,7 @@ var SinglePopup = ({ adapter, uiCallbacks, theme }) => {
|
|
|
4271
4272
|
replyTo,
|
|
4272
4273
|
clearReply: () => setReplyTo(void 0),
|
|
4273
4274
|
onAfterSend: handleAfterSend,
|
|
4275
|
+
hiddenActionKeys,
|
|
4274
4276
|
onSend: (payload) => {
|
|
4275
4277
|
if (activeId) adapter.messages.send(activeId, payload);
|
|
4276
4278
|
}
|
|
@@ -4293,7 +4295,7 @@ var SinglePopup = ({ adapter, uiCallbacks, theme }) => {
|
|
|
4293
4295
|
] });
|
|
4294
4296
|
};
|
|
4295
4297
|
var SinglePopup_default = SinglePopup;
|
|
4296
|
-
function ChatRoot({ adapter, uiCallbacks, theme }) {
|
|
4298
|
+
function ChatRoot({ adapter, uiCallbacks, theme, hiddenActionKeys }) {
|
|
4297
4299
|
const { isOpen, variant } = useChatUI();
|
|
4298
4300
|
useDisableBodyScroll(isOpen);
|
|
4299
4301
|
if (typeof window === "undefined") {
|
|
@@ -4306,7 +4308,8 @@ function ChatRoot({ adapter, uiCallbacks, theme }) {
|
|
|
4306
4308
|
{
|
|
4307
4309
|
adapter,
|
|
4308
4310
|
uiCallbacks,
|
|
4309
|
-
theme
|
|
4311
|
+
theme,
|
|
4312
|
+
hiddenActionKeys
|
|
4310
4313
|
},
|
|
4311
4314
|
"inbox"
|
|
4312
4315
|
) : /* @__PURE__ */ jsx(
|
|
@@ -4314,7 +4317,8 @@ function ChatRoot({ adapter, uiCallbacks, theme }) {
|
|
|
4314
4317
|
{
|
|
4315
4318
|
adapter,
|
|
4316
4319
|
uiCallbacks,
|
|
4317
|
-
theme
|
|
4320
|
+
theme,
|
|
4321
|
+
hiddenActionKeys
|
|
4318
4322
|
},
|
|
4319
4323
|
"single"
|
|
4320
4324
|
)) }) }),
|