@tellescope/chat 1.250.2 → 1.252.0

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.
@@ -86,7 +86,7 @@ var material_1 = require("@mui/material");
86
86
  var HTMLMessage = function (_a) {
87
87
  var html = _a.html;
88
88
  return ((0, jsx_runtime_1.jsx)("div", { style: { padding: 2 }, dangerouslySetInnerHTML: {
89
- __html: (0, utilities_1.remove_script_tags)(stripOuterParagraphTags(html).replace(/<a/g, '<a style="color: white;"')),
89
+ __html: (0, utilities_1.sanitize_user_html)(stripOuterParagraphTags(html).replace(/<a/g, '<a style="color: white;"')),
90
90
  } }));
91
91
  };
92
92
  exports.HTMLMessage = HTMLMessage;
@@ -68,7 +68,7 @@ var HTMLMessage = function (_a) {
68
68
  return ((0, jsx_runtime_1.jsx)(react_native_render_html_1.default, { defaultTextProps: { selectable: selectable }, baseStyle: {
69
69
  paddingTop: 4, // causes better fit into both 1-line and multiline chat bubbles
70
70
  }, contentWidth: width, source: {
71
- html: ((0, utilities_1.remove_script_tags)(html))
71
+ html: ((0, utilities_1.sanitize_user_html)(html))
72
72
  }, tagsStyles: {
73
73
  'body': {
74
74
  color: color,
@@ -48,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
48
48
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
49
  import React, { useEffect, useState } from "react";
50
50
  import { AsyncIconButton, Flex, SendIcon, useChats, } from "@tellescope/react-components";
51
- import { remove_script_tags } from "@tellescope/utilities";
51
+ import { sanitize_user_html } from "@tellescope/utilities";
52
52
  var stripOuterParagraphTags = function (html) {
53
53
  var result = html.trim();
54
54
  while (result.startsWith('<p>') && result.endsWith('</p>')) {
@@ -60,7 +60,7 @@ import { TextField } from "@mui/material";
60
60
  export var HTMLMessage = function (_a) {
61
61
  var html = _a.html;
62
62
  return (_jsx("div", { style: { padding: 2 }, dangerouslySetInnerHTML: {
63
- __html: remove_script_tags(stripOuterParagraphTags(html).replace(/<a/g, '<a style="color: white;"')),
63
+ __html: sanitize_user_html(stripOuterParagraphTags(html).replace(/<a/g, '<a style="color: white;"')),
64
64
  } }));
65
65
  };
66
66
  export var SendMessage = function (_a) {
@@ -51,7 +51,7 @@ import { Modal, TextInput, useWindowDimensions } from "react-native";
51
51
  import { Avatar } from 'react-native-paper';
52
52
  import { useFileUpload, Flex, Typography, AsyncIconButton, SendIcon, LabeledIconButton, Button, Paper, useChats, useResolvedSession, } from "@tellescope/react-components";
53
53
  import { useState } from 'react';
54
- import { remove_script_tags } from '@tellescope/utilities';
54
+ import { sanitize_user_html } from '@tellescope/utilities';
55
55
  import RenderHtml from 'react-native-render-html';
56
56
  export var HTMLMessage = function (_a) {
57
57
  var htmlUnprocessed = _a.html, _b = _a.color, color = _b === void 0 ? "white" : _b, _c = _a.selectable, selectable = _c === void 0 ? true : _c;
@@ -62,7 +62,7 @@ export var HTMLMessage = function (_a) {
62
62
  return (_jsx(RenderHtml, { defaultTextProps: { selectable: selectable }, baseStyle: {
63
63
  paddingTop: 4, // causes better fit into both 1-line and multiline chat bubbles
64
64
  }, contentWidth: width, source: {
65
- html: (remove_script_tags(html))
65
+ html: (sanitize_user_html(html))
66
66
  }, tagsStyles: {
67
67
  'body': {
68
68
  color: color,