@lobehub/ui 1.165.1 → 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.
- package/es/Markdown/index.d.ts +1 -0
- package/es/Markdown/index.js +6 -5
- package/package.json +1 -1
package/es/Markdown/index.d.ts
CHANGED
|
@@ -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;
|
package/es/Markdown/index.js
CHANGED
|
@@ -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({
|