@lobehub/ui 2.1.12 → 2.1.14

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.
@@ -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 = ["animated", "fullFeatured", "actionIconSize", "children", "language", "className", "copyable", "showLanguage", "variant", "shadow", "wrap", "bodyRender", "actionsRender", "enableTransformer", "theme"];
4
+ var _excluded = ["animated", "fullFeatured", "actionIconSize", "children", "language", "className", "copyable", "showLanguage", "variant", "shadow", "wrap", "bodyRender", "actionsRender", "enableTransformer", "theme", "icon", "fileName", "allowChangeLanguage", "defaultExpand"];
5
5
  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; }
6
6
  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; }
7
7
  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; }
@@ -39,6 +39,11 @@ export var Highlighter = /*#__PURE__*/memo(function (_ref) {
39
39
  actionsRender = _ref.actionsRender,
40
40
  enableTransformer = _ref.enableTransformer,
41
41
  theme = _ref.theme,
42
+ icon = _ref.icon,
43
+ fileName = _ref.fileName,
44
+ allowChangeLanguage = _ref.allowChangeLanguage,
45
+ _ref$defaultExpand = _ref.defaultExpand,
46
+ defaultExpand = _ref$defaultExpand === void 0 ? true : _ref$defaultExpand,
42
47
  rest = _objectWithoutProperties(_ref, _excluded);
43
48
  var _useStyles = useStyles(),
44
49
  styles = _useStyles.styles,
@@ -96,9 +101,13 @@ export var Highlighter = /*#__PURE__*/memo(function (_ref) {
96
101
  }) : originalBody;
97
102
  if (fullFeatured) return /*#__PURE__*/_jsx(FullFeatured, _objectSpread(_objectSpread({
98
103
  actionsRender: actionsRender,
104
+ allowChangeLanguage: allowChangeLanguage,
99
105
  className: className,
100
106
  content: tirmedChildren,
101
107
  copyable: copyable,
108
+ defaultExpand: defaultExpand,
109
+ fileName: fileName,
110
+ icon: icon,
102
111
  language: language,
103
112
  shadow: shadow,
104
113
  showLanguage: showLanguage,
@@ -43,8 +43,7 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
43
43
  fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize,
44
44
  _ref$headerMultiple = _ref.headerMultiple,
45
45
  headerMultiple = _ref$headerMultiple === void 0 ? 0.25 : _ref$headerMultiple,
46
- _ref$marginMultiple = _ref.marginMultiple,
47
- marginMultiple = _ref$marginMultiple === void 0 ? 1 : _ref$marginMultiple,
46
+ marginMultiple = _ref.marginMultiple,
48
47
  showFootnotes = _ref.showFootnotes,
49
48
  _ref$variant = _ref.variant,
50
49
  variant = _ref$variant === void 0 ? 'default' : _ref$variant,
@@ -125,7 +124,7 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
125
124
  fontSize: fontSize,
126
125
  headerMultiple: headerMultiple,
127
126
  lineHeight: lineHeight,
128
- marginMultiple: marginMultiple,
127
+ marginMultiple: marginMultiple || (variant === 'chat' ? 1 : 2),
129
128
  onDoubleClick: onDoubleClick,
130
129
  ref: ref,
131
130
  style: style
@@ -18,7 +18,8 @@ var Typography = /*#__PURE__*/memo(function (_ref) {
18
18
  className = _ref.className,
19
19
  fontSize = _ref.fontSize,
20
20
  headerMultiple = _ref.headerMultiple,
21
- marginMultiple = _ref.marginMultiple,
21
+ _ref$marginMultiple = _ref.marginMultiple,
22
+ marginMultiple = _ref$marginMultiple === void 0 ? 2 : _ref$marginMultiple,
22
23
  lineHeight = _ref.lineHeight,
23
24
  rest = _objectWithoutProperties(_ref, _excluded);
24
25
  var _useStyles = useStyles({
@@ -11,7 +11,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
11
11
  _ref2$headerMultiple = _ref2.headerMultiple,
12
12
  headerMultiple = _ref2$headerMultiple === void 0 ? 1 : _ref2$headerMultiple,
13
13
  _ref2$marginMultiple = _ref2.marginMultiple,
14
- marginMultiple = _ref2$marginMultiple === void 0 ? 1.5 : _ref2$marginMultiple,
14
+ marginMultiple = _ref2$marginMultiple === void 0 ? 2 : _ref2$marginMultiple,
15
15
  _ref2$lineHeight = _ref2.lineHeight,
16
16
  lineHeight = _ref2$lineHeight === void 0 ? 1.8 : _ref2$lineHeight;
17
17
  var __root = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n --lobe-markdown-font-size: ", "px;\n --lobe-markdown-header-multiple: ", ";\n --lobe-markdown-margin-multiple: ", ";\n --lobe-markdown-line-height: ", ";\n --lobe-markdown-border-radius: ", ";\n --lobe-markdown-border-color: ", ";\n\n position: relative;\n\n width: 100%;\n max-width: 100%;\n padding-inline: 1px;\n\n font-size: var(--lobe-markdown-font-size);\n line-height: var(--lobe-markdown-line-height);\n word-break: break-word;\n\n ", " {\n font-size: 14px;\n line-height: 1.5;\n }\n "])), fontSize, headerMultiple, marginMultiple, lineHeight, token.borderRadiusLG, token.colorFillQuaternary, IGNORE_CLASSNAME);
@@ -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", "actionIconSize", "fullFeatured", "copyable", "showLanguage", "language", "style", "variant", "shadow", "enablePanZoom", "defaultExpand", "className", "bodyRender", "actionsRender", "theme"];
4
+ var _excluded = ["children", "actionIconSize", "fullFeatured", "copyable", "showLanguage", "language", "style", "variant", "shadow", "enablePanZoom", "defaultExpand", "className", "bodyRender", "fileName", "actionsRender", "theme"];
5
5
  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; }
6
6
  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; }
7
7
  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; }
@@ -39,6 +39,7 @@ var Mermaid = /*#__PURE__*/memo(function (_ref) {
39
39
  defaultExpand = _ref$defaultExpand === void 0 ? true : _ref$defaultExpand,
40
40
  className = _ref.className,
41
41
  bodyRender = _ref.bodyRender,
42
+ fileName = _ref.fileName,
42
43
  actionsRender = _ref.actionsRender,
43
44
  theme = _ref.theme,
44
45
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -97,6 +98,7 @@ var Mermaid = /*#__PURE__*/memo(function (_ref) {
97
98
  content: tirmedChildren,
98
99
  copyable: copyable,
99
100
  defaultExpand: defaultExpand,
101
+ fileName: fileName,
100
102
  language: language,
101
103
  shadow: shadow,
102
104
  showLanguage: showLanguage,
@@ -13,24 +13,24 @@ var useStyles = createStyles(function (_ref) {
13
13
  var css = _ref.css,
14
14
  token = _ref.token;
15
15
  return {
16
- fallback: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-block: 1em;\n font-size: 0.875em;\n color: ", ";\n\n ol {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5em;\n\n margin: 0;\n padding: 0;\n\n list-style-type: none;\n }\n\n ol li {\n position: relative;\n\n overflow: hidden;\n display: flex;\n flex-direction: row;\n\n margin: 0 !important;\n padding-block: 0 !important;\n padding-inline: 0 0.4em !important;\n\n text-overflow: ellipsis;\n white-space: nowrap;\n\n border: 1px solid ", ";\n border-radius: 0.25em;\n\n &::before {\n content: counter(list-item);\n counter-increment: list-item;\n\n display: block;\n\n margin-inline-end: 0.4em;\n padding-inline: 0.6em;\n\n background: ", ";\n }\n\n p,\n a {\n overflow: hidden;\n\n margin: 0 !important;\n padding: 0 !important;\n\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n "])), token.colorTextSecondary, token.colorBorderSecondary, token.colorFillSecondary)
16
+ fallback: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-block: 1em;\n font-size: 0.875em;\n color: ", ";\n\n ol {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5em;\n\n margin: 0;\n padding: 0;\n\n list-style-type: none;\n }\n\n ol li {\n position: relative;\n\n overflow: hidden;\n display: flex;\n flex-direction: row;\n\n margin: 0 !important;\n padding-block: 0 !important;\n padding-inline: 0 0.4em !important;\n border: 1px solid ", ";\n border-radius: 0.25em;\n\n text-overflow: ellipsis;\n white-space: nowrap;\n\n &::before {\n content: counter(list-item);\n counter-increment: list-item;\n\n display: block;\n\n margin-inline-end: 0.4em;\n padding-inline: 0.6em;\n\n background: ", ";\n }\n\n p,\n a {\n overflow: hidden;\n\n margin: 0 !important;\n padding: 0 !important;\n\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n "])), token.colorTextSecondary, token.colorBorderSecondary, token.colorFillSecondary)
17
17
  };
18
18
  });
19
19
  var Footnotes = function Footnotes(_ref2) {
20
20
  var children = _ref2.children,
21
- res = _objectWithoutProperties(_ref2, _excluded);
21
+ rest = _objectWithoutProperties(_ref2, _excluded);
22
22
  var _useStyles = useStyles(),
23
23
  styles = _useStyles.styles,
24
24
  cx = _useStyles.cx;
25
25
  var links = useMemo(function () {
26
26
  try {
27
- return JSON.parse(res['data-footnote-links'] || '');
27
+ return JSON.parse(rest['data-footnote-links'] || '');
28
28
  } catch (error) {
29
29
  console.error(error);
30
- console.log(res);
30
+ console.log(rest);
31
31
  return [];
32
32
  }
33
- }, [res['data-footnote-links']]);
33
+ }, [rest['data-footnote-links']]);
34
34
  var isError = links.length === 0;
35
35
  return /*#__PURE__*/_jsx("section", {
36
36
  className: cx('footnotes', isError && styles.fallback),
@@ -22,7 +22,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
22
22
  var useStyles = createStyles(function (_ref) {
23
23
  var css = _ref.css;
24
24
  return {
25
- container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n margin-block: 0.5em;\n border-radius: calc(var(--lobe-markdown-border-radius) * 1px);\n box-shadow: 0 0 0 1px var(--lobe-markdown-border-color) inset;\n "])))
25
+ container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n border-radius: calc(var(--lobe-markdown-border-radius) * 1px);\n box-shadow: 0 0 0 1px var(--lobe-markdown-border-color) inset;\n "])))
26
26
  };
27
27
  });
28
28
  export var Pre = function Pre(_ref2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "2.1.12",
3
+ "version": "2.1.14",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",