@sendbird/ai-agent-messenger-react 1.2.2 → 1.2.4

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,5 +1,5 @@
1
1
  import * as o from "react";
2
- import { P as r } from "./DLjpH35l.js";
2
+ import { P as r } from "./BoP3pcmJ.js";
3
3
  const c = ({ label: e = "No channels", ...a }) => /* @__PURE__ */ o.createElement(r, { icon: "chat", label: e, ...a });
4
4
  export {
5
5
  c as default
@@ -1,5 +1,5 @@
1
1
  import * as a from "react";
2
- import { L as o } from "./DLjpH35l.js";
2
+ import { L as o } from "./BoP3pcmJ.js";
3
3
  const m = ({ iconSize: e = 48, className: r }) => /* @__PURE__ */ a.createElement(o, { size: e, className: r });
4
4
  export {
5
5
  m as default
@@ -1,6 +1,6 @@
1
1
  import * as t from "react";
2
2
  import n from "styled-components";
3
- import { P as a, I as l, a as c, c as s } from "./DLjpH35l.js";
3
+ import { P as a, I as l, a as c, c as s } from "./BoP3pcmJ.js";
4
4
  const d = ({ label: r = "Something went wrong", action: e, ...o }) => /* @__PURE__ */ t.createElement(a, { icon: "error", label: r, ...o }, e && /* @__PURE__ */ t.createElement(i, { onClick: e.onClick, label: e.label ?? "Retry" })), i = ({ label: r, onClick: e }) => /* @__PURE__ */ t.createElement(m, { tabIndex: 0, onClick: e }, /* @__PURE__ */ t.createElement(l, { type: "refresh", size: 20 }), /* @__PURE__ */ t.createElement(c, { variant: "button", color: s.color.primary.main }, r)), m = n.button`all:unset;display:flex;cursor:pointer;gap:4px;align-items:center;justify-content:center;`;
5
5
  export {
6
6
  d as default
@@ -0,0 +1,32 @@
1
+ import * as r from "react";
2
+ import { useCallback as p } from "react";
3
+ import s from "dompurify";
4
+ import h, { RuleType as x } from "markdown-to-jsx";
5
+ import g from "styled-components";
6
+ import { A as b, c as i } from "./BoP3pcmJ.js";
7
+ const m = (d, o, n, t) => o.type === x.textStrikethroughed ? /* @__PURE__ */ r.createElement("span", { key: t.key }, `~~${n(o.children, t)}~~`) : d(), z = ({ className: d, children: o, style: n, onClickImage: t }) => {
8
+ const a = p(
9
+ (e) => /* @__PURE__ */ r.createElement("img", { ...e, onClick: () => e.src && (t == null ? void 0 : t(e.src)) }),
10
+ []
11
+ );
12
+ return /* @__PURE__ */ r.createElement(c, { className: d, style: n }, /* @__PURE__ */ r.createElement(
13
+ h,
14
+ {
15
+ options: {
16
+ renderRule: m,
17
+ overrides: {
18
+ a: {
19
+ component: ({ children: e, ...l }) => /* @__PURE__ */ r.createElement("a", { ...l, target: "_blank", rel: b }, e)
20
+ },
21
+ img: {
22
+ component: a
23
+ }
24
+ }
25
+ }
26
+ },
27
+ s.sanitize(o)
28
+ ));
29
+ }, c = g.div`*{&:first-child{margin-top:0;}&:last-child{margin-bottom:0;}}hr{border-top:1px solid ${i.themedColor.textDisabled};margin:21px 0;}h1{margin-top:0;margin-bottom:12.4px;padding:0;font-size:22.4px;line-height:27.6px;font-weight:700;letter-spacing:-0.6px;}h2{font-weight:600;margin:24px 0 12px;font-size:18.2px;line-height:22.3px;}& :where(h3 + *){margin-top:0;}h3,h4,h5,h6{font-weight:600;margin:16px 0 8px;font-size:15.4px;line-height:22.4px;}p{font-size:14px;line-height:20px;margin-bottom:8px;margin-top:0;&:not(:first-child){margin-top:8px;}}a{color:inherit;font-weight:700;text-decoration:underline;}code{white-space:pre-wrap;border-radius:0.25rem;font-size:0.875em;font-weight:500;padding:2.4px 4.8px;background-color:${i.themedColor.textDisabled};}menu{list-style:none;}ul{list-style-type:disc;}ol{list-style-type:decimal;}ul,ol{padding-inline-start:16px;margin:8px 0;& > li{padding-inline-start:0;margin:8px 0;& > ul,& > ol{margin-top:8px;& > li{margin:4px 0;}}}}p + ul,p + ol{margin-top:0;}blockquote{line-height:20px;margin:0;padding:4.8px 0;margin-inline-start:8px;padding-inline-start:16px;box-sizing:border-box;position:relative;font-style:normal;font-weight:500;border-inline-start-width:4px;&::before{border-radius:100px;content:'';position:absolute;top:0;left:0;height:100%;width:4px;background-color:${i.themedColor.textDisabled};}}input[type='checkbox']{vertical-align:middle;margin:0;}table{unicode-bidi:isolate;overflow-wrap:break-word;white-space:normal;display:block;overflow-x:scroll;max-width:100%;text-indent:0;border-collapse:separate;border-spacing:0;margin:4px 0;text-align:start;font-size:12.3px;table-layout:auto;width:100%;*,&:after,&:before{border:0 solid;box-sizing:border-box;}}th:first-child{border-start-start-radius:6px;padding-inline-start:10.5px;}th:last-child{border-inline-end-width:1px;border-start-end-radius:6px;padding-inline-end:10.5px;}th{border-inline-start-width:1px;background-color:rgba(0,0,0,0.1);border-bottom-width:1px;border-color:${i.themedColor.textDisabled};border-top-width:1px;padding:4px 10.5px;text-align:start;}& :where(thead th:first-child){padding-inline-start:0;}& :where(thead th:last-child){padding-inline-end:0;}& :where(thead th){padding-bottom:8px;padding-inline:8px;vertical-align:bottom;}& :where(tbody tr){border-bottom-width:1px;}& :where(tbody tr:last-child){border-bottom-width:0;}td:first-child{padding-inline-start:10.5px;}td:last-child{border-inline-end-width:1px;padding-inline-end:10.5px;}& :where(tbody td:first-child,tfoot td:first-child){padding-inline-start:0;}& :where(tbody td:last-child,tfoot td:last-child){padding-inline-end:0;}td{border-inline-start-width:1px;border-bottom-width:1px;border-color:${i.themedColor.textDisabled};padding:4px 10.5px;text-align:start;}& :where(tbody td,tfoot td){padding:8px;}& :where(tbody td){vertical-align:baseline;}tbody tr:last-child td:first-child{border-end-start-radius:6px;}tbody tr:last-child td:last-child{border-end-end-radius:6px;}img{max-width:100%;height:auto;}`;
30
+ export {
31
+ z as MarkdownText
32
+ };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./cjs/tVaciR-_.cjs");require("react");exports.AgentProviderContainer=e.AgentProviderContainer;exports.AgentUIProviderContainer=e.AgentUIProviderContainer;exports.CSATType=e.CSATType;exports.Commands=e.Commands;exports.Conversation=e.Conversation;exports.ConversationLayout=e.ConversationLayout;exports.ConversationList=e.ConversationList;exports.ConversationListItemLayout=e.ConversationListItemLayout;exports.ConversationListLayout=e.ConversationListLayout;exports.DefaultMessenger=e.DefaultMessenger;exports.FixedMessenger=e.FixedMessenger;exports.IncomingMessageLayout=e.IncomingMessageLayout;exports.LauncherBase=e.LauncherBase;exports.LogLevel=e.LogLevel;exports.MessageLogs=e.MessageLogs;exports.OutgoingMessageLayout=e.OutgoingMessageLayout;exports.SystemMessageLayout=e.SystemMessageLayout;exports.messengerDispatcher=e.messengerDispatcher;exports.useLocalizationContext=e.useLocalizationContext;exports.useMessengerContext=e.useMessengerContext;exports.useMessengerSessionContext=e.useMessengerSessionContext;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./cjs/O1lLHzDh.cjs");require("react");exports.AgentProviderContainer=e.AgentProviderContainer;exports.AgentUIProviderContainer=e.AgentUIProviderContainer;exports.CSATType=e.CSATType;exports.Commands=e.Commands;exports.Conversation=e.Conversation;exports.ConversationLayout=e.ConversationLayout;exports.ConversationList=e.ConversationList;exports.ConversationListItemLayout=e.ConversationListItemLayout;exports.ConversationListLayout=e.ConversationListLayout;exports.DefaultMessenger=e.DefaultMessenger;exports.FixedMessenger=e.FixedMessenger;exports.IncomingMessageLayout=e.IncomingMessageLayout;exports.LauncherBase=e.LauncherBase;exports.LogLevel=e.LogLevel;exports.MessageLogs=e.MessageLogs;exports.OutgoingMessageLayout=e.OutgoingMessageLayout;exports.SystemMessageLayout=e.SystemMessageLayout;exports.messengerDispatcher=e.messengerDispatcher;exports.useLocalizationContext=e.useLocalizationContext;exports.useMessengerContext=e.useMessengerContext;exports.useMessengerSessionContext=e.useMessengerSessionContext;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { AIAgentModule } from '@sendbird/chat/aiAgent';
4
4
  import { ComponentType } from 'react';
5
5
  import { Context } from 'react';
6
6
  import { ConversationStatus } from '@sendbird/chat/aiAgent';
7
+ import { CSSProperties } from 'react';
7
8
  import { DeskChannelFilter } from '@sendbird/chat/aiAgent';
8
9
  import { format } from 'date-fns';
9
10
  import { ForwardRefExoticComponent } from 'react';
@@ -98,6 +99,13 @@ setExpanded?: (value: boolean) => void;
98
99
  };
99
100
  /**
100
101
  * @public
102
+ * @description Custom CSS styles for the entry container element.
103
+ * This allows fine-grained control over the root container's appearance,
104
+ * particularly useful for iframe integrations where precise sizing is needed.
105
+ * */
106
+ entryStyle?: CSSProperties;
107
+ /**
108
+ * @public
101
109
  * @description AIAgent Messenger theme
102
110
  * */
103
111
  theme?: {
@@ -255,6 +263,13 @@ export declare type AIAgentProps = PropsWithChildren<{
255
263
  expanded?: boolean;
256
264
  setExpanded?: (value: boolean) => void;
257
265
  };
266
+ /**
267
+ * @public
268
+ * @description Custom CSS styles for the entry container element.
269
+ * This allows fine-grained control over the root container's appearance,
270
+ * particularly useful for iframe integrations where precise sizing is needed.
271
+ * */
272
+ entryStyle?: CSSProperties;
258
273
  /**
259
274
  * @public
260
275
  * @description AIAgent Messenger theme
@@ -574,6 +589,7 @@ setOpened?: (value: boolean) => void;
574
589
  expanded?: boolean;
575
590
  setExpanded?: (value: boolean) => void;
576
591
  };
592
+ entryStyle?: CSSProperties;
577
593
  theme?: {
578
594
  palette?: Partial<PaletteShape>;
579
595
  typography?: Partial<{ [K in keyof TypographyShape]: Partial<TypographyShape[K]>; }>;
@@ -656,6 +672,7 @@ setOpened?: (value: boolean) => void;
656
672
  expanded?: boolean;
657
673
  setExpanded?: (value: boolean) => void;
658
674
  };
675
+ entryStyle?: CSSProperties;
659
676
  theme?: {
660
677
  palette?: Partial<PaletteShape>;
661
678
  typography?: Partial<{ [K in keyof TypographyShape]: Partial<TypographyShape[K]>; }>;
@@ -1026,6 +1043,8 @@ declare interface MessengerSessionContextValue {
1026
1043
  }
1027
1044
 
1028
1045
  export declare interface MessengerSessionRef {
1046
+ chatSDK: AIAgentContextValue['chatSDK'];
1047
+ deauthenticate: () => Promise<void>;
1029
1048
  updateContext: (context: Record<string, string>) => Promise<ContextObject>;
1030
1049
  patchContext: (context: Record<string, string>) => Promise<ContextObject>;
1031
1050
  getContextObject: () => Promise<ContextObject>;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b as o, d as n, i as t, C as i, k as r, l as g, n as L, j as u, o as C, D as m, F as M, h as v, g as y, p as d, M as p, O as x, S as c, m as l, f as S, u as f, e as h } from "./es/DLjpH35l.js";
1
+ import { b as o, d as n, i as t, C as i, k as r, l as g, n as L, j as u, o as C, D as m, F as M, h as v, g as y, p as d, M as p, O as x, S as c, m as l, f as S, u as f, e as h } from "./es/BoP3pcmJ.js";
2
2
  import "react";
3
3
  export {
4
4
  o as AgentProviderContainer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendbird/ai-agent-messenger-react",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Sendbird AI Agent Messenger for React",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,9 +20,9 @@
20
20
  "sideEffects": false,
21
21
  "dependencies": {
22
22
  "@emotion/is-prop-valid": "^1.3.1",
23
- "@sendbird/react-uikit-message-template-view": "0.0.13",
24
- "@sendbird/uikit-message-template": "0.0.13",
25
- "@sendbird/uikit-tools": "0.0.13",
23
+ "@sendbird/react-uikit-message-template-view": "0.0.14",
24
+ "@sendbird/uikit-message-template": "0.0.14",
25
+ "@sendbird/uikit-tools": "0.0.14",
26
26
  "date-fns": "^4.1.0",
27
27
  "dompurify": "^3.2.4",
28
28
  "markdown-to-jsx": "^7.7.12",
@@ -45,7 +45,7 @@
45
45
  "react-dom": "^19.0.0",
46
46
  "strip-json-comments": "^5.0.1",
47
47
  "styled-components": "^6.1.15",
48
- "@sendbird/ai-agent-core": "1.2.2",
48
+ "@sendbird/ai-agent-core": "1.2.4",
49
49
  "@sendbird/vite-tools": "0.0.1"
50
50
  },
51
51
  "msw": {
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),p=require("dompurify"),a=require("markdown-to-jsx"),h=require("styled-components"),n=require("./tVaciR-_.cjs"),o=t=>t&&t.__esModule?t:{default:t};function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const d=c(s),x=o(p),b=o(a),g=o(h),u=(t,e,i,r)=>e.type===a.RuleType.textStrikethroughed?d.createElement("span",{key:r.key},`~~${i(e.children,r)}~~`):t(),m=({className:t,children:e,style:i})=>d.createElement(f,{className:t,style:i},d.createElement(b.default,{options:{renderRule:u,overrides:{a:{component:({children:r,...l})=>d.createElement("a",{...l,target:"_blank",rel:n.ANCHOR_REL},r)}}}},x.default.sanitize(e))),f=g.default.div`*{&:first-child{margin-top:0;}&:last-child{margin-bottom:0;}}hr{border-top:1px solid ${n.cssVars.themedColor.textDisabled};margin:21px 0;}h1{margin-top:0;margin-bottom:12.4px;padding:0;font-size:22.4px;line-height:27.6px;font-weight:700;letter-spacing:-0.6px;}h2{font-weight:600;margin:24px 0 12px;font-size:18.2px;line-height:22.3px;}& :where(h3 + *){margin-top:0;}h3,h4,h5,h6{font-weight:600;margin:16px 0 8px;font-size:15.4px;line-height:22.4px;}p{font-size:14px;line-height:20px;margin-bottom:8px;margin-top:0;&:not(:first-child){margin-top:8px;}}a{color:inherit;font-weight:700;text-decoration:underline;}code{white-space:pre-wrap;border-radius:0.25rem;font-size:0.875em;font-weight:500;padding:2.4px 4.8px;background-color:${n.cssVars.themedColor.textDisabled};}menu{list-style:none;}ul{list-style-type:disc;}ol{list-style-type:decimal;}ul,ol{padding-inline-start:16px;margin:8px 0;& > li{padding-inline-start:0;margin:8px 0;& > ul,& > ol{margin-top:8px;& > li{margin:4px 0;}}}}p + ul,p + ol{margin-top:0;}blockquote{line-height:20px;margin:0;padding:4.8px 0;margin-inline-start:8px;padding-inline-start:16px;box-sizing:border-box;position:relative;font-style:normal;font-weight:500;border-inline-start-width:4px;&::before{border-radius:100px;content:'';position:absolute;top:0;left:0;height:100%;width:4px;background-color:${n.cssVars.themedColor.textDisabled};}}input[type='checkbox']{vertical-align:middle;margin:0;}table{unicode-bidi:isolate;overflow-wrap:break-word;white-space:normal;display:block;overflow-x:scroll;max-width:100%;text-indent:0;border-collapse:separate;border-spacing:0;margin:4px 0;text-align:start;font-size:12.3px;table-layout:auto;width:100%;*,&:after,&:before{border:0 solid;box-sizing:border-box;}}th:first-child{border-start-start-radius:6px;padding-inline-start:10.5px;}th:last-child{border-inline-end-width:1px;border-start-end-radius:6px;padding-inline-end:10.5px;}th{border-inline-start-width:1px;background-color:rgba(0,0,0,0.1);border-bottom-width:1px;border-color:${n.cssVars.themedColor.textDisabled};border-top-width:1px;padding:4px 10.5px;text-align:start;}& :where(thead th:first-child){padding-inline-start:0;}& :where(thead th:last-child){padding-inline-end:0;}& :where(thead th){padding-bottom:8px;padding-inline:8px;vertical-align:bottom;}& :where(tbody tr){border-bottom-width:1px;}& :where(tbody tr:last-child){border-bottom-width:0;}td:first-child{padding-inline-start:10.5px;}td:last-child{border-inline-end-width:1px;padding-inline-end:10.5px;}& :where(tbody td:first-child,tfoot td:first-child){padding-inline-start:0;}& :where(tbody td:last-child,tfoot td:last-child){padding-inline-end:0;}td{border-inline-start-width:1px;border-bottom-width:1px;border-color:${n.cssVars.themedColor.textDisabled};padding:4px 10.5px;text-align:start;}& :where(tbody td,tfoot td){padding:8px;}& :where(tbody td){vertical-align:baseline;}tbody tr:last-child td:first-child{border-end-start-radius:6px;}tbody tr:last-child td:last-child{border-end-end-radius:6px;}`;exports.MarkdownText=m;
@@ -1,22 +0,0 @@
1
- import * as r from "react";
2
- import a from "dompurify";
3
- import l, { RuleType as p } from "markdown-to-jsx";
4
- import s from "styled-components";
5
- import { A as h, c as t } from "./DLjpH35l.js";
6
- const x = (d, e, o, i) => e.type === p.textStrikethroughed ? /* @__PURE__ */ r.createElement("span", { key: i.key }, `~~${o(e.children, i)}~~`) : d(), f = ({ className: d, children: e, style: o }) => /* @__PURE__ */ r.createElement(g, { className: d, style: o }, /* @__PURE__ */ r.createElement(
7
- l,
8
- {
9
- options: {
10
- renderRule: x,
11
- overrides: {
12
- a: {
13
- component: ({ children: i, ...n }) => /* @__PURE__ */ r.createElement("a", { ...n, target: "_blank", rel: h }, i)
14
- }
15
- }
16
- }
17
- },
18
- a.sanitize(e)
19
- )), g = s.div`*{&:first-child{margin-top:0;}&:last-child{margin-bottom:0;}}hr{border-top:1px solid ${t.themedColor.textDisabled};margin:21px 0;}h1{margin-top:0;margin-bottom:12.4px;padding:0;font-size:22.4px;line-height:27.6px;font-weight:700;letter-spacing:-0.6px;}h2{font-weight:600;margin:24px 0 12px;font-size:18.2px;line-height:22.3px;}& :where(h3 + *){margin-top:0;}h3,h4,h5,h6{font-weight:600;margin:16px 0 8px;font-size:15.4px;line-height:22.4px;}p{font-size:14px;line-height:20px;margin-bottom:8px;margin-top:0;&:not(:first-child){margin-top:8px;}}a{color:inherit;font-weight:700;text-decoration:underline;}code{white-space:pre-wrap;border-radius:0.25rem;font-size:0.875em;font-weight:500;padding:2.4px 4.8px;background-color:${t.themedColor.textDisabled};}menu{list-style:none;}ul{list-style-type:disc;}ol{list-style-type:decimal;}ul,ol{padding-inline-start:16px;margin:8px 0;& > li{padding-inline-start:0;margin:8px 0;& > ul,& > ol{margin-top:8px;& > li{margin:4px 0;}}}}p + ul,p + ol{margin-top:0;}blockquote{line-height:20px;margin:0;padding:4.8px 0;margin-inline-start:8px;padding-inline-start:16px;box-sizing:border-box;position:relative;font-style:normal;font-weight:500;border-inline-start-width:4px;&::before{border-radius:100px;content:'';position:absolute;top:0;left:0;height:100%;width:4px;background-color:${t.themedColor.textDisabled};}}input[type='checkbox']{vertical-align:middle;margin:0;}table{unicode-bidi:isolate;overflow-wrap:break-word;white-space:normal;display:block;overflow-x:scroll;max-width:100%;text-indent:0;border-collapse:separate;border-spacing:0;margin:4px 0;text-align:start;font-size:12.3px;table-layout:auto;width:100%;*,&:after,&:before{border:0 solid;box-sizing:border-box;}}th:first-child{border-start-start-radius:6px;padding-inline-start:10.5px;}th:last-child{border-inline-end-width:1px;border-start-end-radius:6px;padding-inline-end:10.5px;}th{border-inline-start-width:1px;background-color:rgba(0,0,0,0.1);border-bottom-width:1px;border-color:${t.themedColor.textDisabled};border-top-width:1px;padding:4px 10.5px;text-align:start;}& :where(thead th:first-child){padding-inline-start:0;}& :where(thead th:last-child){padding-inline-end:0;}& :where(thead th){padding-bottom:8px;padding-inline:8px;vertical-align:bottom;}& :where(tbody tr){border-bottom-width:1px;}& :where(tbody tr:last-child){border-bottom-width:0;}td:first-child{padding-inline-start:10.5px;}td:last-child{border-inline-end-width:1px;padding-inline-end:10.5px;}& :where(tbody td:first-child,tfoot td:first-child){padding-inline-start:0;}& :where(tbody td:last-child,tfoot td:last-child){padding-inline-end:0;}td{border-inline-start-width:1px;border-bottom-width:1px;border-color:${t.themedColor.textDisabled};padding:4px 10.5px;text-align:start;}& :where(tbody td,tfoot td){padding:8px;}& :where(tbody td){vertical-align:baseline;}tbody tr:last-child td:first-child{border-end-start-radius:6px;}tbody tr:last-child td:last-child{border-end-end-radius:6px;}`;
20
- export {
21
- f as MarkdownText
22
- };