@lobehub/ui 1.165.0 → 1.165.2

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.
@@ -27,6 +27,7 @@ export interface MarkdownProps extends TypographyProps {
27
27
  customRender?: (dom: ReactNode, context: {
28
28
  text: string;
29
29
  }) => ReactNode;
30
+ enableCustomFootnotes?: boolean;
30
31
  enableImageGallery?: boolean;
31
32
  enableLatex?: boolean;
32
33
  enableMermaid?: boolean;
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  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); }
4
- var _excluded = ["children", "className", "style", "fullFeaturedCodeBlock", "onDoubleClick", "enableLatex", "enableMermaid", "enableImageGallery", "componentProps", "allowHtml", "fontSize", "headerMultiple", "marginMultiple", "showFootnotes", "variant", "lineHeight", "rehypePlugins", "remarkPlugins", "remarkPluginsAhead", "components", "customRender", "citations"];
4
+ var _excluded = ["children", "className", "style", "fullFeaturedCodeBlock", "onDoubleClick", "enableLatex", "enableMermaid", "enableImageGallery", "enableCustomFootnotes", "componentProps", "allowHtml", "fontSize", "headerMultiple", "marginMultiple", "showFootnotes", "variant", "lineHeight", "rehypePlugins", "remarkPlugins", "remarkPluginsAhead", "components", "customRender", "citations"];
5
5
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
6
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
7
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -46,6 +46,7 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
46
46
  enableMermaid = _ref$enableMermaid === void 0 ? true : _ref$enableMermaid,
47
47
  _ref$enableImageGalle = _ref.enableImageGallery,
48
48
  enableImageGallery = _ref$enableImageGalle === void 0 ? true : _ref$enableImageGalle,
49
+ enableCustomFootnotes = _ref.enableCustomFootnotes,
49
50
  componentProps = _ref.componentProps,
50
51
  allowHtml = _ref.allowHtml,
51
52
  fontSize = _ref.fontSize,
@@ -121,13 +122,13 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
121
122
  }, [].concat(_toConsumableArray(Object.values(components || {})), _toConsumableArray(Object.values(componentProps || {})), [enableImageGallery, enableMermaid, fullFeaturedCodeBlock], _toConsumableArray(citations || []), [showFootnotes]));
122
123
  var innerRehypePlugins = Array.isArray(rehypePlugins) ? rehypePlugins : [rehypePlugins];
123
124
  var memoRehypePlugins = useMemo(function () {
124
- return [allowHtml && rehypeRaw, enableLatex && rehypeKatex, enableLatex && rehypeKatexDir, rehypeFootnoteLinks].concat(_toConsumableArray(innerRehypePlugins)).filter(Boolean);
125
- }, [allowHtml, enableLatex].concat(_toConsumableArray(innerRehypePlugins)));
125
+ return [allowHtml && rehypeRaw, enableLatex && rehypeKatex, enableLatex && rehypeKatexDir, enableCustomFootnotes && rehypeFootnoteLinks].concat(_toConsumableArray(innerRehypePlugins)).filter(Boolean);
126
+ }, [allowHtml, enableLatex, enableCustomFootnotes].concat(_toConsumableArray(innerRehypePlugins)));
126
127
  var innerRemarkPlugins = Array.isArray(remarkPlugins) ? remarkPlugins : [remarkPlugins];
127
128
  var innerRemarkPluginsAhead = Array.isArray(remarkPluginsAhead) ? remarkPluginsAhead : [remarkPluginsAhead];
128
129
  var memoRemarkPlugins = useMemo(function () {
129
- return [].concat(_toConsumableArray(innerRemarkPluginsAhead), [remarkGfm, remarkCustomFootnotes, enableLatex && remarkMath, isChatMode && remarkBreaks], _toConsumableArray(innerRemarkPlugins)).filter(Boolean);
130
- }, [isChatMode, enableLatex].concat(_toConsumableArray(innerRemarkPluginsAhead), _toConsumableArray(innerRemarkPlugins)));
130
+ return [].concat(_toConsumableArray(innerRemarkPluginsAhead), [remarkGfm, enableCustomFootnotes && remarkCustomFootnotes, enableLatex && remarkMath, isChatMode && remarkBreaks], _toConsumableArray(innerRemarkPlugins)).filter(Boolean);
131
+ }, [isChatMode, enableCustomFootnotes, enableLatex].concat(_toConsumableArray(innerRemarkPluginsAhead), _toConsumableArray(innerRemarkPlugins)));
131
132
  var defaultDOM = /*#__PURE__*/_jsx(ImageGallery, {
132
133
  enable: enableImageGallery,
133
134
  children: /*#__PURE__*/_jsx(ReactMarkdown, _objectSpread(_objectSpread({
@@ -21,7 +21,7 @@ var useStyles = createStyles(function (_ref) {
21
21
  token = _ref.token;
22
22
  return {
23
23
  link: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n color: ", ";\n\n :hover {\n color: ", ";\n }\n "])), token.colorTextSecondary, token.colorText),
24
- url: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n\n text-overflow: ellipsis;\n "])))
24
+ url: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n\n max-width: 400px;\n\n text-overflow: ellipsis;\n "])))
25
25
  };
26
26
  });
27
27
  var PopoverPanel = /*#__PURE__*/memo(function (_ref2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.165.0",
3
+ "version": "1.165.2",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",