@sendbird/ai-agent-messenger-react 1.6.1 → 1.6.3
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/cjs/Cgpjda0S.cjs +285 -0
- package/dist/cjs/sh5EIfKj.cjs +1 -0
- package/dist/es/{HxOZjoSV.js → C5fhbPfo.js} +15 -15
- package/dist/es/{CQ8KW62U.js → DgtM1NIG.js} +1444 -1428
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +45 -9
- package/dist/index.js +1 -1
- package/package.json +7 -7
- package/dist/cjs/B4N6zW7u.cjs +0 -1
- package/dist/cjs/Dk7KndGT.cjs +0 -285
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),x=require("dompurify"),s=require("markdown-to-jsx"),g=require("styled-components"),o=require("./Cgpjda0S.cjs"),a=t=>t&&t.__esModule?t:{default:t};function b(t){if(t&&t.__esModule)return t;const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const e=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(i,r,e.get?e:{enumerable:!0,get:()=>t[r]})}}return i.default=t,Object.freeze(i)}const d=b(l),u=a(x),m=a(s),f=a(g),w=(t,i,r,e)=>i.type===s.RuleType.textStrikethroughed?d.createElement("span",{key:e.key},`~~${r(i.children,e)}~~`):t(),y=({className:t,children:i,style:r,onClickImage:e})=>{const p=l.useCallback(n=>d.createElement("img",{...n,onClick:()=>n.src&&(e==null?void 0:e(n.src))}),[]),c=n=>n.replace(/\[([^\]]+)\](?!\()/g,"\\[$1\\]");return d.createElement(_,{className:t,style:r},d.createElement(m.default,{options:{renderRule:w,overrides:{a:{component:({children:n,...h})=>d.createElement("a",{...h,target:"_blank",rel:o.ANCHOR_REL},n)},img:{component:p}}}},u.default.sanitize(c(i))))},_=f.default.div`*{&:first-child{margin-top:0;}&:last-child{margin-bottom:0;}}hr{border-top:1px solid ${o.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:${o.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:${o.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:${o.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:${o.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;}img{max-width:100%;height:auto;}`;exports.MarkdownText=y;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as r from "react";
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { A as
|
|
7
|
-
const m = (d, o, n,
|
|
8
|
-
const a =
|
|
9
|
-
(
|
|
2
|
+
import { useCallback as s } from "react";
|
|
3
|
+
import h from "dompurify";
|
|
4
|
+
import x, { RuleType as g } from "markdown-to-jsx";
|
|
5
|
+
import b from "styled-components";
|
|
6
|
+
import { A as c, c as i } from "./DgtM1NIG.js";
|
|
7
|
+
const m = (d, o, n, e) => o.type === g.textStrikethroughed ? /* @__PURE__ */ r.createElement("span", { key: e.key }, `~~${n(o.children, e)}~~`) : d(), v = ({ className: d, children: o, style: n, onClickImage: e }) => {
|
|
8
|
+
const a = s(
|
|
9
|
+
(t) => /* @__PURE__ */ r.createElement("img", { ...t, onClick: () => t.src && (e == null ? void 0 : e(t.src)) }),
|
|
10
10
|
[]
|
|
11
|
-
);
|
|
12
|
-
return /* @__PURE__ */ r.createElement(
|
|
13
|
-
|
|
11
|
+
), l = (t) => t.replace(/\[([^\]]+)\](?!\()/g, "\\[$1\\]");
|
|
12
|
+
return /* @__PURE__ */ r.createElement(w, { className: d, style: n }, /* @__PURE__ */ r.createElement(
|
|
13
|
+
x,
|
|
14
14
|
{
|
|
15
15
|
options: {
|
|
16
16
|
renderRule: m,
|
|
17
17
|
overrides: {
|
|
18
18
|
a: {
|
|
19
|
-
component: ({ children:
|
|
19
|
+
component: ({ children: t, ...p }) => /* @__PURE__ */ r.createElement("a", { ...p, target: "_blank", rel: c }, t)
|
|
20
20
|
},
|
|
21
21
|
img: {
|
|
22
22
|
component: a
|
|
@@ -24,9 +24,9 @@ const m = (d, o, n, t) => o.type === x.textStrikethroughed ? /* @__PURE__ */ r.c
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
-
|
|
27
|
+
h.sanitize(l(o))
|
|
28
28
|
));
|
|
29
|
-
},
|
|
29
|
+
}, w = b.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
30
|
export {
|
|
31
|
-
|
|
31
|
+
v as MarkdownText
|
|
32
32
|
};
|