@ibti-tech/chatbot 0.9.5 → 0.9.7

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.d.ts CHANGED
@@ -128,7 +128,7 @@ declare module '@ibti-tech/chatbot/components/ChatbotBar/styles' {
128
128
  //# sourceMappingURL=styles.d.ts.map
129
129
  }
130
130
  declare module '@ibti-tech/chatbot/components/ChatbotBar/styles.d.ts' {
131
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotBar/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAW,MAAM,eAAe,CAAA;AAIpD,eAAO,MAAM,YAAY;;oBAEgB,kBAAmB;;yBADrC,MAAM,GAAG,OAAO;gCACT,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;aACvD,OAAO;uBACG,KAAK,GAAG,QAAQ;uBAChB,OAAO;iMA4E3B,CAAA;AAED,2GAA2G;AAC3G,eAAO,MAAM,WAAW;iBAA6B,MAAM;gBAAc,MAAM;YAS9E,CAAA;AAED,eAAO,MAAM,OAAO;uBACC,KAAK,GAAG,QAAQ;yBACd,MAAM,GAAG,OAAO;aAC5B,OAAO;cACN,MAAM;iBACH,MAAM,GAAG,MAAM;mBACb,OAAO;uBACH,OAAO;gCACE,MAAM;YAwInC,CAAA"}
131
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotBar/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAW,MAAM,eAAe,CAAA;AAIpD,eAAO,MAAM,YAAY;;oBAEgB,kBAAmB;;yBADrC,MAAM,GAAG,OAAO;gCACT,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;aACvD,OAAO;uBACG,KAAK,GAAG,QAAQ;uBAChB,OAAO;iMA4E3B,CAAA;AAED,2GAA2G;AAC3G,eAAO,MAAM,WAAW;iBAA6B,MAAM;gBAAc,MAAM;YAS9E,CAAA;AAED,eAAO,MAAM,OAAO;uBACC,KAAK,GAAG,QAAQ;yBACd,MAAM,GAAG,OAAO;aAC5B,OAAO;cACN,MAAM;iBACH,MAAM,GAAG,MAAM;mBACb,OAAO;uBACH,OAAO;gCACE,MAAM;YA6InC,CAAA"}
132
132
  }
133
133
  declare module '@ibti-tech/chatbot/components/ChatbotBody/index' {
134
134
  import React from 'react';
@@ -182,7 +182,7 @@ declare module '@ibti-tech/chatbot/components/ChatbotDevice/styles' {
182
182
  //# sourceMappingURL=styles.d.ts.map
183
183
  }
184
184
  declare module '@ibti-tech/chatbot/components/ChatbotDevice/styles.d.ts' {
185
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotDevice/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;aACT,OAAO;uBACG,KAAK,GAAG,QAAQ;uBAChB,OAAO;0BACJ,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;gCAC9B,MAAM;YAgQnC,CAAA"}
185
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/ChatbotDevice/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO;aACT,OAAO;uBACG,KAAK,GAAG,QAAQ;uBAChB,OAAO;0BACJ,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;gCAC9B,MAAM;YAmQnC,CAAA"}
186
186
  }
187
187
  declare module '@ibti-tech/chatbot/components/ChatbotFooter/index' {
188
188
  import React from 'react';
@@ -286,7 +286,7 @@ declare module '@ibti-tech/chatbot/components/MessageBalloon/index' {
286
286
  //# sourceMappingURL=index.d.ts.map
287
287
  }
288
288
  declare module '@ibti-tech/chatbot/components/MessageBalloon/index.d.ts' {
289
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/MessageBalloon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAQpC,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,YAAY,CAAC,WAAW,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAOD,eAAO,MAAM,cAAc,GAAI,2BAG5B,mBAAmB,sBAiJrB,CAAA;AAED,eAAe,cAAc,CAAA"}
289
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/components/MessageBalloon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAwBpC,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,YAAY,CAAC,WAAW,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAOD,eAAO,MAAM,cAAc,GAAI,2BAG5B,mBAAmB,sBAkKrB,CAAA;AAED,eAAe,cAAc,CAAA"}
290
290
  }
291
291
  declare module '@ibti-tech/chatbot/components/MessageBalloon/styles' {
292
292
  export const Time: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
package/dist/index.mjs CHANGED
@@ -1061,8 +1061,11 @@ var Wrapper = styled.div`
1061
1061
  box-sizing: border-box;
1062
1062
  `}
1063
1063
 
1064
- ${(props) => props.$opened && props.$verticalPosition === "bottom" ? css`
1065
- max-height: 100vh;
1064
+ /* Bottom on mobile: mirror of top (opposite direction). Same height open/closed (100% of bar), transform slides up when open */
1065
+ ${(props) => props.$verticalPosition === "bottom" ? css`
1066
+ height: 100%;
1067
+ max-height: 100%;
1068
+ ${props.$opened ? css`transform: none !important;` : ""}
1066
1069
  ` : ""}
1067
1070
 
1068
1071
  ${(props) => props.$opened && props.$verticalPosition === "top" ? css`
@@ -1942,8 +1945,21 @@ var formatMessageTime = /* @__PURE__ */ __name((dateUTC, currentDateUTC, locale)
1942
1945
 
1943
1946
  // src/components/MessageBalloon/index.tsx
1944
1947
  import Markdown from "react-markdown";
1948
+ import remarkGfm from "remark-gfm";
1949
+ import rehypeRaw from "rehype-raw";
1950
+ import rehypeSanitize from "rehype-sanitize";
1945
1951
  import { CircleExclamationIcon } from "@ibti-tech/ui";
1946
1952
  import { Copy, Share2, RotateCw } from "lucide-react";
1953
+ function linkifyBareUrls(text) {
1954
+ return text.replace(
1955
+ /(?<!\]\()(https?:\/\/[^\s<>")\]]+)/gi,
1956
+ (url) => `[${url}](${url})`
1957
+ ).replace(
1958
+ /(?<!\]\()(www\.[^\s<>")\]]+)/gi,
1959
+ (url) => `[${url}](https://${url})`
1960
+ );
1961
+ }
1962
+ __name(linkifyBareUrls, "linkifyBareUrls");
1947
1963
  var messageTypes = {
1948
1964
  assistant: "received",
1949
1965
  user: "sent"
@@ -2008,7 +2024,26 @@ var MessageBalloon = /* @__PURE__ */ __name(({
2008
2024
  onMouseLeave: () => setIsHovered(false),
2009
2025
  $type: messageType
2010
2026
  },
2011
- /* @__PURE__ */ React7.createElement(BalloonContainer, { $type: messageType }, /* @__PURE__ */ React7.createElement(Balloon, { $type: messageType, $error: data.error }, data.error && /* @__PURE__ */ React7.createElement(CircleExclamationIcon, null), /* @__PURE__ */ React7.createElement(Markdown, null, data.content))),
2027
+ /* @__PURE__ */ React7.createElement(BalloonContainer, { $type: messageType }, /* @__PURE__ */ React7.createElement(Balloon, { $type: messageType, $error: data.error }, data.error && /* @__PURE__ */ React7.createElement(CircleExclamationIcon, null), /* @__PURE__ */ React7.createElement(
2028
+ Markdown,
2029
+ {
2030
+ remarkPlugins: [remarkGfm],
2031
+ rehypePlugins: [rehypeRaw, rehypeSanitize],
2032
+ components: {
2033
+ a: /* @__PURE__ */ __name(({ href, children, ...props }) => /* @__PURE__ */ React7.createElement(
2034
+ "a",
2035
+ {
2036
+ href,
2037
+ target: "_blank",
2038
+ rel: "noopener noreferrer",
2039
+ ...props
2040
+ },
2041
+ children
2042
+ ), "a")
2043
+ }
2044
+ },
2045
+ linkifyBareUrls(data.content)
2046
+ ))),
2012
2047
  /* @__PURE__ */ React7.createElement(TimestampAndActionsRow, { $type: messageType }, /* @__PURE__ */ React7.createElement(
2013
2048
  ActionsContainer,
2014
2049
  {
@@ -2799,7 +2834,7 @@ var Wrapper9 = styled10.div`
2799
2834
  // package.json
2800
2835
  var package_default = {
2801
2836
  name: "@ibti-tech/chatbot",
2802
- version: "0.9.5",
2837
+ version: "0.9.7",
2803
2838
  description: "Chatbot system developed to be embedded in any website",
2804
2839
  packageManager: "yarn@3.6.4",
2805
2840
  main: "./dist/index.mjs",
@@ -2839,6 +2874,9 @@ var package_default = {
2839
2874
  "lucide-react": "^0.263.1",
2840
2875
  polished: "^4.3.1",
2841
2876
  "react-markdown": "^9.0.1",
2877
+ "rehype-raw": "^7.0.0",
2878
+ "rehype-sanitize": "^6.0.0",
2879
+ "remark-gfm": "^4.0.0",
2842
2880
  uuid: "^9.0.1"
2843
2881
  },
2844
2882
  devDependencies: {
@@ -3175,9 +3213,16 @@ var Wrapper10 = styled11.div`
3175
3213
  padding-bottom: ${(props2) => props2.theme.spacing.components.xsmall};
3176
3214
 
3177
3215
  @media screen and (max-width: ${breakpoints3.tablet}px) {
3178
- ${props.$opened ? css6`
3179
- padding-bottom: 0;
3180
- ` : ""}
3216
+ /* Mirror of top (opposite direction): same height open/closed, no flex, last child height 100% like top */
3217
+ bottom: 0 !important;
3218
+ padding-top: env(safe-area-inset-top, 0px);
3219
+ padding-bottom: env(safe-area-inset-bottom, 0px);
3220
+ height: 100vh;
3221
+ height: 100svh;
3222
+ box-sizing: border-box;
3223
+ & > *:last-child {
3224
+ height: 100%;
3225
+ }
3181
3226
  }
3182
3227
  `}
3183
3228
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibti-tech/chatbot",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "description": "Chatbot system developed to be embedded in any website",
5
5
  "packageManager": "yarn@3.6.4",
6
6
  "main": "./dist/index.mjs",
@@ -40,6 +40,9 @@
40
40
  "lucide-react": "^0.263.1",
41
41
  "polished": "^4.3.1",
42
42
  "react-markdown": "^9.0.1",
43
+ "rehype-raw": "^7.0.0",
44
+ "rehype-sanitize": "^6.0.0",
45
+ "remark-gfm": "^4.0.0",
43
46
  "uuid": "^9.0.1"
44
47
  },
45
48
  "devDependencies": {