@lobehub/ui 1.151.0 → 1.151.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.
@@ -2,14 +2,13 @@
2
2
 
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["type", "items", "placement", "spotlight", "direction", "dropdownMenu", "onActionClick", "size"];
5
+ var _excluded = ["type", "items", "placement", "direction", "dropdownMenu", "onActionClick", "size"];
6
6
  import { Dropdown } from 'antd';
7
7
  import { MoreHorizontal } from 'lucide-react';
8
8
  import { memo } from 'react';
9
9
  import { Flexbox } from 'react-layout-kit';
10
10
  import ActionIcon from "../ActionIcon";
11
11
  import Icon from "../Icon";
12
- import Spotlight from "../Spotlight";
13
12
  import { useStyles } from "./style";
14
13
  import { jsx as _jsx } from "react/jsx-runtime";
15
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -19,8 +18,6 @@ var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
19
18
  _ref$items = _ref.items,
20
19
  items = _ref$items === void 0 ? [] : _ref$items,
21
20
  placement = _ref.placement,
22
- _ref$spotlight = _ref.spotlight,
23
- spotlight = _ref$spotlight === void 0 ? true : _ref$spotlight,
24
21
  _ref$direction = _ref.direction,
25
22
  direction = _ref$direction === void 0 ? 'row' : _ref$direction,
26
23
  _ref$dropdownMenu = _ref.dropdownMenu,
@@ -38,7 +35,7 @@ var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
38
35
  className: styles.container,
39
36
  horizontal: direction === 'row'
40
37
  }, rest), {}, {
41
- children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), (items === null || items === void 0 ? void 0 : items.length) > 0 && items.map(function (item) {
38
+ children: [(items === null || items === void 0 ? void 0 : items.length) > 0 && items.map(function (item) {
42
39
  return /*#__PURE__*/_jsx(ActionIcon, {
43
40
  disable: item.disable,
44
41
  icon: item.icon,
@@ -4,11 +4,10 @@ import { createStyles } from 'antd-style';
4
4
  export var useStyles = createStyles(function (_ref, _ref2) {
5
5
  var css = _ref.css,
6
6
  token = _ref.token,
7
- stylish = _ref.stylish,
8
7
  cx = _ref.cx;
9
8
  var type = _ref2.type;
10
9
  var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n "])), type === 'block' ? token.colorFillTertiary : token.colorFillQuaternary, type === 'block' ? 'transparent' : token.colorBorder);
11
10
  return {
12
- container: cx(type !== 'pure' && typeStylish, stylish.blur, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n padding: 2px;\n border-radius: ", "px;\n "])), token.borderRadius))
11
+ container: cx(type !== 'pure' && typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n padding: 2px;\n border-radius: ", "px;\n "])), token.borderRadius))
13
12
  };
14
13
  });
@@ -1,6 +1,6 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
2
  center: import("antd-style").SerializedStyles;
3
- container: string;
3
+ container: import("antd-style").SerializedStyles;
4
4
  left: import("antd-style").SerializedStyles;
5
5
  right: import("antd-style").SerializedStyles;
6
6
  }>;
@@ -4,12 +4,10 @@ import { createStyles } from 'antd-style';
4
4
  import { rgba } from 'polished';
5
5
  export var useStyles = createStyles(function (_ref) {
6
6
  var css = _ref.css,
7
- token = _ref.token,
8
- stylish = _ref.stylish,
9
- cx = _ref.cx;
7
+ token = _ref.token;
10
8
  return {
11
9
  center: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n "]))),
12
- container: cx(stylish.blurStrong, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 10;\n\n overflow: hidden;\n grid-area: header;\n align-self: stretch;\n\n width: 100%;\n height: 64px;\n\n background: linear-gradient(\n to bottom,\n ", ",\n ", "\n );\n border-block-end: 1px solid ", ";\n "])), rgba(token.colorBgLayout, 0.8), rgba(token.colorBgLayout, 0.4), token.colorBorder)),
10
+ container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 10;\n\n overflow: hidden;\n grid-area: header;\n align-self: stretch;\n\n width: 100%;\n height: 64px;\n\n background: linear-gradient(\n to bottom,\n ", ",\n ", "\n );\n border-block-end: 1px solid ", ";\n "])), rgba(token.colorBgLayout, 0.8), rgba(token.colorBgLayout, 0.4), token.colorBorder),
13
11
  left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n flex: 1;\n "]))),
14
12
  right: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n flex: none;\n "])))
15
13
  };
@@ -18,9 +18,22 @@ export function fixMarkdownBold(text) {
18
18
  var count = 0;
19
19
  var count2 = 0;
20
20
  var result = '';
21
+ var inCodeBlock = false;
22
+ var inInlineCode = false;
21
23
  for (var i = 0; i < text.length; i++) {
22
24
  var char = text[i];
23
- if (char === '*') {
25
+ if (text.slice(i, i + 3) === '```') {
26
+ inCodeBlock = !inCodeBlock;
27
+ result += '```';
28
+ i += 2;
29
+ continue;
30
+ }
31
+ if (char === '`') {
32
+ inInlineCode = !inInlineCode;
33
+ result += '`';
34
+ continue;
35
+ }
36
+ if (char === '*' && !inInlineCode && !inCodeBlock) {
24
37
  count++;
25
38
  if (count === 2) {
26
39
  count2++;
package/es/Modal/index.js CHANGED
@@ -27,7 +27,7 @@ var useStyles = createStyles(function (_ref, _ref2) {
27
27
  return {
28
28
  content: cx(maxHeight && css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-modal-body {\n overflow: auto;\n max-height: ", ";\n }\n "])), prefixCls, maxHeight), css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", "-modal-footer {\n margin: 0;\n padding: 16px;\n }\n .", "-modal-header {\n display: flex;\n gap: 4px;\n align-items: center;\n justify-content: center;\n\n height: 56px;\n margin-block-end: 0;\n padding: 16px;\n }\n .", "-modal-content {\n overflow: hidden;\n padding: 0;\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n "])), prefixCls, prefixCls, prefixCls, token.colorSplit, token.borderRadiusLG)),
29
29
  drawerContent: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", "-drawer-close {\n padding: 0;\n }\n .", "-drawer-wrapper-body {\n background: linear-gradient(to bottom, ", ", ", ");\n }\n .", "-drawer-header {\n padding: 8px;\n }\n\n .", "-drawer-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n\n padding: 16px;\n\n border: none;\n }\n "])), prefixCls, prefixCls, token.colorBgContainer, token.colorBgLayout, prefixCls, prefixCls),
30
- wrap: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden auto;\n backdrop-filter: blur(2px);\n "])))
30
+ wrap: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden auto;\n "])))
31
31
  };
32
32
  });
33
33
  var Modal = /*#__PURE__*/memo(function (_ref3) {
package/es/mdx/Card.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { TagProps } from 'antd';
1
2
  import { FC } from 'react';
2
3
  import { type FlexboxProps } from 'react-layout-kit';
3
4
  import { type IconProps } from "../Icon";
@@ -7,6 +8,8 @@ export interface CardProps extends Omit<FlexboxProps, 'children'> {
7
8
  icon?: IconProps['icon'];
8
9
  iconProps?: Omit<IconProps, 'icon'>;
9
10
  image?: string;
11
+ tag?: string;
12
+ tagColor?: TagProps['color'];
10
13
  title: string;
11
14
  }
12
15
  declare const Card: FC<CardProps>;
package/es/mdx/Card.js CHANGED
@@ -3,8 +3,9 @@
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
6
- var _excluded = ["icon", "title", "desc", "href", "iconProps", "className", "image"];
6
+ var _excluded = ["tag", "tagColor", "icon", "title", "desc", "href", "iconProps", "className", "image"];
7
7
  var _templateObject, _templateObject2, _templateObject3;
8
+ import { Tag } from 'antd';
8
9
  import { createStyles } from 'antd-style';
9
10
  import { Flexbox } from 'react-layout-kit';
10
11
  import A from "../A";
@@ -18,13 +19,16 @@ var useStyles = createStyles(function (_ref) {
18
19
  token = _ref.token;
19
20
  var icon = cx(css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-block: 0.1em;\n opacity: 0.5;\n transition: opacity 0.2s ", ";\n "])), token.motionEaseInOut));
20
21
  return {
21
- card: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n --lobe-markdown-header-multiple: 0;\n --lobe-markdown-margin-multiple: 1;\n\n overflow: hidden;\n\n height: 100%;\n\n color: ", ";\n\n border-radius: calc(var(--lobe-markdown-border-radius) * 1px);\n box-shadow: 0 0 0 1px var(--lobe-markdown-border-color);\n\n transition: all 0.2s ", ";\n\n h3,\n p {\n margin-block: 0;\n }\n\n p {\n color: ", ";\n transition: color 0.2s ", ";\n }\n\n &:hover {\n background: ", ";\n box-shadow: 0 0 0 1px ", ";\n\n p {\n color: ", ";\n }\n\n .", " {\n opacity: 1;\n }\n }\n "])), token.colorText, token.motionEaseInOut, token.colorTextDescription, token.motionEaseInOut, token.colorFillQuaternary, token.colorBorder, token.colorTextSecondary, icon),
22
- content: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n gap: 0.75em;\n width: 100%;\n padding: 1em;\n "]))),
22
+ card: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n --lobe-markdown-header-multiple: 0.2;\n --lobe-markdown-margin-multiple: 1;\n\n overflow: hidden;\n\n height: 100%;\n\n color: ", ";\n\n border-radius: calc(var(--lobe-markdown-border-radius) * 1px);\n box-shadow: 0 0 0 1px var(--lobe-markdown-border-color);\n\n transition: all 0.2s ", ";\n\n h3,\n p {\n margin-block: 0;\n }\n\n p {\n color: ", ";\n transition: color 0.2s ", ";\n }\n\n &:hover {\n background: ", ";\n box-shadow: 0 0 0 1px ", ";\n\n p {\n color: ", ";\n }\n\n .", " {\n opacity: 1;\n }\n }\n "])), token.colorText, token.motionEaseInOut, token.colorTextDescription, token.motionEaseInOut, token.colorFillQuaternary, token.colorBorder, token.colorTextSecondary, icon),
23
+ content: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n padding: 1.4em;\n "]))),
23
24
  icon: icon
24
25
  };
25
26
  });
26
27
  var Card = function Card(_ref2) {
27
- var icon = _ref2.icon,
28
+ var tag = _ref2.tag,
29
+ _ref2$tagColor = _ref2.tagColor,
30
+ tagColor = _ref2$tagColor === void 0 ? 'success' : _ref2$tagColor,
31
+ icon = _ref2.icon,
28
32
  title = _ref2.title,
29
33
  desc = _ref2.desc,
30
34
  href = _ref2.href,
@@ -50,25 +54,41 @@ var Card = function Card(_ref2) {
50
54
  width: '100%'
51
55
  },
52
56
  width: 250
53
- }), /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
57
+ }), tag && /*#__PURE__*/_jsx(Flexbox, {
58
+ align: 'flex-start',
59
+ className: styles.content,
60
+ style: {
61
+ paddingBottom: 0
62
+ },
63
+ children: /*#__PURE__*/_jsx(Tag, {
64
+ bordered: false,
65
+ color: tagColor,
66
+ style: {
67
+ borderRadius: '1em',
68
+ fontSize: '0.8em'
69
+ },
70
+ children: tag
71
+ })
72
+ }), /*#__PURE__*/_jsxs(Flexbox, {
54
73
  align: desc ? 'flex-start' : 'center',
55
74
  className: styles.content,
56
- horizontal: true
57
- }, rest), {}, {
75
+ gap: '0.75em',
76
+ horizontal: true,
58
77
  children: [!image && icon && /*#__PURE__*/_jsx(Icon, _objectSpread({
59
78
  className: styles.icon,
60
79
  icon: icon,
61
80
  size: {
62
81
  fontSize: '1.5em'
63
82
  }
64
- }, iconProps)), /*#__PURE__*/_jsxs("div", {
83
+ }, iconProps)), /*#__PURE__*/_jsxs(Flexbox, {
84
+ gap: '0.2em',
65
85
  children: [/*#__PURE__*/_jsx("h3", {
66
86
  children: title
67
87
  }), desc && /*#__PURE__*/_jsx("p", {
68
88
  children: desc
69
89
  })]
70
90
  })]
71
- }))]
91
+ })]
72
92
  }))
73
93
  });
74
94
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.151.0",
3
+ "version": "1.151.2",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -161,6 +161,7 @@
161
161
  "semantic-release": "^21.1.2",
162
162
  "stylelint": "^15.11.0",
163
163
  "typescript": "^5.5.4",
164
+ "umi": "4.3.16",
164
165
  "unist-util-is": "^6.0.0",
165
166
  "unist-util-visit": "^5.0.0",
166
167
  "vitest": "~1.2.2"