@agentscope-ai/chat 1.1.44 → 1.1.45-beta.1766027835357

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.
@@ -61,7 +61,8 @@ export default memo(function (props: MarkdownProps) {
61
61
  img: props.disableImage ? DisabledImage : Media,
62
62
  citation: CitationComponent,
63
63
  'custom-cursor': CursorComponent,
64
- }), [props.disableImage, CitationComponent]);
64
+ ...components,
65
+ }), [props.disableImage, CitationComponent, props.components]);
65
66
 
66
67
 
67
68
  const dompurifyConfig = useMemo(() =>
@@ -53,10 +53,8 @@ export interface MarkdownProps {
53
53
  * @descriptionEn CSS class name for the component
54
54
  */
55
55
  className?: string;
56
-
57
-
58
-
59
-
56
+
57
+ components?: XMarkdownProps['components'];
60
58
  citations?: {
61
59
  title?: string;
62
60
  url?: string;
@@ -1,3 +1,9 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
7
  import { memo, useMemo } from 'react';
2
8
  import MarkdownX from "./core";
3
9
  import useTyping from "./core/hooks/useTyping";
@@ -54,15 +60,15 @@ export default /*#__PURE__*/memo(function (props) {
54
60
  citationsDataCount = _useCitationsData.citationsDataCount,
55
61
  CitationComponent = _useCitationsData.CitationComponent;
56
62
  var components = useMemo(function () {
57
- return {
63
+ return _objectSpread({
58
64
  pre: CodeBlock,
59
65
  style: Null,
60
66
  script: Null,
61
67
  img: props.disableImage ? DisabledImage : Media,
62
68
  citation: CitationComponent,
63
69
  'custom-cursor': CursorComponent
64
- };
65
- }, [props.disableImage, CitationComponent]);
70
+ }, components);
71
+ }, [props.disableImage, CitationComponent, props.components]);
66
72
  var dompurifyConfig = useMemo(function () {
67
73
  return allowHtml ? {
68
74
  ADD_TAGS: ['custom-cursor', 'citation']
@@ -46,6 +46,7 @@ export interface MarkdownProps {
46
46
  * @descriptionEn CSS class name for the component
47
47
  */
48
48
  className?: string;
49
+ components?: XMarkdownProps['components'];
49
50
  citations?: {
50
51
  title?: string;
51
52
  url?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/chat",
3
- "version": "1.1.44",
3
+ "version": "1.1.45-beta.1766027835357",
4
4
  "description": "a free and open-source chat framework for building excellent LLM-powered chat experiences",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": [