@lobehub/ui 1.138.26 → 1.139.1
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.js +11 -4
- package/es/Modal/index.d.ts +1 -0
- package/es/Modal/index.js +4 -2
- package/package.json +1 -1
package/es/Markdown/index.js
CHANGED
|
@@ -49,13 +49,20 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
49
49
|
marginMultiple: marginMultiple
|
|
50
50
|
}),
|
|
51
51
|
mdStyles = _useMarkdownStyles.styles;
|
|
52
|
+
var isChatMode = variant === 'chat';
|
|
52
53
|
var components = useMemo(function () {
|
|
53
54
|
return {
|
|
54
55
|
a: function a(props) {
|
|
55
56
|
return /*#__PURE__*/_jsx(Link, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.a));
|
|
56
57
|
},
|
|
57
58
|
img: enableImageGallery ? function (props) {
|
|
58
|
-
|
|
59
|
+
var _componentProps$img, _componentProps$img2;
|
|
60
|
+
return /*#__PURE__*/_jsx(Image, _objectSpread(_objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.img), {}, {
|
|
61
|
+
style: isChatMode ? _objectSpread({
|
|
62
|
+
height: 'auto',
|
|
63
|
+
maxWidth: 640
|
|
64
|
+
}, componentProps === null || componentProps === void 0 || (_componentProps$img = componentProps.img) === null || _componentProps$img === void 0 ? void 0 : _componentProps$img.style) : componentProps === null || componentProps === void 0 || (_componentProps$img2 = componentProps.img) === null || _componentProps$img2 === void 0 ? void 0 : _componentProps$img2.style
|
|
65
|
+
}));
|
|
59
66
|
} : undefined,
|
|
60
67
|
pre: function pre(props) {
|
|
61
68
|
return fullFeaturedCodeBlock ? /*#__PURE__*/_jsx(CodeFullFeatured, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.pre)) : /*#__PURE__*/_jsx(CodeLite, _objectSpread(_objectSpread({}, props), componentProps === null || componentProps === void 0 ? void 0 : componentProps.pre));
|
|
@@ -69,8 +76,8 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
69
76
|
return [allowHtml && rehypeRaw, rehypeKatex].filter(Boolean);
|
|
70
77
|
}, [allowHtml]);
|
|
71
78
|
var remarkPlugins = useMemo(function () {
|
|
72
|
-
return [remarkGfm, remarkMath,
|
|
73
|
-
}, [
|
|
79
|
+
return [remarkGfm, remarkMath, isChatMode && remarkBreaks].filter(Boolean);
|
|
80
|
+
}, [isChatMode]);
|
|
74
81
|
return /*#__PURE__*/_jsx("article", {
|
|
75
82
|
className: className,
|
|
76
83
|
"data-code-type": "markdown",
|
|
@@ -81,7 +88,7 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
|
|
|
81
88
|
children: /*#__PURE__*/_jsx(ImageGallery, {
|
|
82
89
|
enable: enableImageGallery,
|
|
83
90
|
children: /*#__PURE__*/_jsx(ReactMarkdown, _objectSpread(_objectSpread({
|
|
84
|
-
className: cx(mdStyles.__root, mdStyles.a, mdStyles.blockquote, mdStyles.code, mdStyles.details, mdStyles.header, mdStyles.hr, mdStyles.img, mdStyles.kbd, mdStyles.list, mdStyles.p, mdStyles.pre, mdStyles.strong, mdStyles.table, mdStyles.video,
|
|
91
|
+
className: cx(mdStyles.__root, mdStyles.a, mdStyles.blockquote, mdStyles.code, mdStyles.details, mdStyles.header, mdStyles.hr, mdStyles.img, mdStyles.kbd, mdStyles.list, mdStyles.p, mdStyles.pre, mdStyles.strong, mdStyles.table, mdStyles.video, isChatMode && styles.chat),
|
|
85
92
|
components: components,
|
|
86
93
|
rehypePlugins: rehypePlugins,
|
|
87
94
|
remarkPlugins: remarkPlugins
|
package/es/Modal/index.d.ts
CHANGED
package/es/Modal/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
6
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
7
|
-
var _excluded = ["allowFullscreen", "children", "title", "className", "wrapClassName", "width", "onCancel", "open", "destroyOnClose", "paddings", "maxHeight", "footer", "styles"],
|
|
7
|
+
var _excluded = ["allowFullscreen", "children", "title", "className", "wrapClassName", "width", "onCancel", "open", "destroyOnClose", "paddings", "maxHeight", "enableResponsive", "footer", "styles"],
|
|
8
8
|
_excluded2 = ["body"];
|
|
9
9
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
10
10
|
import { Modal as AntModal, ConfigProvider, Drawer } from 'antd';
|
|
@@ -46,6 +46,8 @@ var Modal = /*#__PURE__*/memo(function (_ref3) {
|
|
|
46
46
|
paddings = _ref3.paddings,
|
|
47
47
|
_ref3$maxHeight = _ref3.maxHeight,
|
|
48
48
|
maxHeight = _ref3$maxHeight === void 0 ? '75dvh' : _ref3$maxHeight,
|
|
49
|
+
_ref3$enableResponsiv = _ref3.enableResponsive,
|
|
50
|
+
enableResponsive = _ref3$enableResponsiv === void 0 ? true : _ref3$enableResponsiv,
|
|
49
51
|
footer = _ref3.footer,
|
|
50
52
|
_ref3$styles = _ref3.styles,
|
|
51
53
|
stylesProps = _ref3$styles === void 0 ? {} : _ref3$styles,
|
|
@@ -64,7 +66,7 @@ var Modal = /*#__PURE__*/memo(function (_ref3) {
|
|
|
64
66
|
theme = _useStyles.theme;
|
|
65
67
|
var body = stylesProps.body,
|
|
66
68
|
restStyles = _objectWithoutProperties(stylesProps, _excluded2);
|
|
67
|
-
if (mobile) return /*#__PURE__*/_jsx(Drawer, _objectSpread(_objectSpread({
|
|
69
|
+
if (enableResponsive && mobile) return /*#__PURE__*/_jsx(Drawer, _objectSpread(_objectSpread({
|
|
68
70
|
className: cx(styles.drawerContent, className),
|
|
69
71
|
closeIcon: /*#__PURE__*/_jsx(ActionIcon, {
|
|
70
72
|
icon: X
|