@lobehub/ui 1.104.0 → 1.104.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.
@@ -34,17 +34,19 @@ var Burger = /*#__PURE__*/memo(function (_ref) {
34
34
  icon: opened ? X : MenuIcon,
35
35
  size: "site"
36
36
  }), /*#__PURE__*/_jsxs(Drawer, {
37
- bodyStyle: {
38
- padding: 0
39
- },
40
37
  className: styles.drawer,
41
38
  closeIcon: undefined,
42
- headerStyle: {
43
- display: 'none'
44
- },
45
39
  open: opened,
46
40
  placement: 'left',
47
41
  rootClassName: styles.drawerRoot,
42
+ styles: {
43
+ body: {
44
+ padding: 0
45
+ },
46
+ header: {
47
+ display: 'none'
48
+ }
49
+ },
48
50
  width: '100vw',
49
51
  children: [/*#__PURE__*/_jsx(Menu, {
50
52
  className: styles.menu,
@@ -16,7 +16,7 @@ var Actions = /*#__PURE__*/memo(function (_ref) {
16
16
  return /*#__PURE__*/_jsx(Flexbox, {
17
17
  align: 'flex-start',
18
18
  className: styles.actions,
19
- role: "widget",
19
+ role: "menubar",
20
20
  children: actions
21
21
  });
22
22
  });
@@ -24,7 +24,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
24
24
  alert: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral([""]))),
25
25
  avatarContainer: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
26
26
  avatarGroupContainer: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n width: ", "px;\n "])), avatarSize),
27
- container: cx(type === 'pure' && pureContainerStylish, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n max-width: 100vw;\n padding: 12px 16px;\n\n time {\n display: inline-block;\n white-space: nowrap;\n }\n\n div[role='widget'] {\n display: flex;\n }\n\n time,\n div[role='widget'] {\n pointer-events: none;\n opacity: 0;\n transition: opacity 200ms ", ";\n }\n\n &:hover {\n time,\n div[role='widget'] {\n pointer-events: unset;\n opacity: 1;\n }\n }\n\n ", " {\n padding: 4px 16px;\n }\n "])), token.motionEaseOut, responsive.mobile)),
27
+ container: cx(type === 'pure' && pureContainerStylish, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n max-width: 100vw;\n padding: 12px 16px;\n\n time {\n display: inline-block;\n white-space: nowrap;\n }\n\n div[role='menubar'] {\n display: flex;\n }\n\n time,\n div[role='menubar'] {\n pointer-events: none;\n opacity: 0;\n transition: opacity 200ms ", ";\n }\n\n &:hover {\n time,\n div[role='menubar'] {\n pointer-events: unset;\n opacity: 1;\n }\n }\n\n ", " {\n padding: 4px 16px;\n }\n "])), token.motionEaseOut, responsive.mobile)),
28
28
  editingContainer: cx(editingStylish, css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n padding: 8px 12px 12px;\n border: 1px solid ", ";\n\n &:active,\n &:hover {\n border-color: ", ";\n }\n "])), token.colorBorderSecondary, token.colorBorder), type === 'pure' && css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n "])), token.colorFillQuaternary, token.borderRadius)),
29
29
  editingInput: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n width: 100%;\n "]))),
30
30
  loading: css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", ";\n bottom: 0;\n left: ", ";\n\n width: 16px;\n height: 16px;\n\n color: ", ";\n\n background: ", ";\n border-radius: 50%;\n "])), placement === 'left' ? '-4px' : 'unset', placement === 'right' ? '-4px' : 'unset', token.colorBgLayout, token.colorPrimary),
@@ -22,7 +22,7 @@ export interface ListItemProps {
22
22
  * @description 点击操作按钮的回调函数
23
23
  */
24
24
  onActionsClick?: {
25
- [role: RenderRole]: OnActionClick;
25
+ [actionKey: string]: OnActionClick;
26
26
  };
27
27
  /**
28
28
  * @description 消息变化的回调函数
@@ -70,22 +70,6 @@ var Item = /*#__PURE__*/memo(function (props) {
70
70
  if (!RenderFunction) return;
71
71
  return /*#__PURE__*/_jsx(RenderFunction, _objectSpread({}, data));
72
72
  }, [renderErrorMessages === null || renderErrorMessages === void 0 ? void 0 : renderErrorMessages[item === null || item === void 0 ? void 0 : (_item$error2 = item.error) === null || _item$error2 === void 0 ? void 0 : _item$error2.type]]);
73
- var _onActionClick = useCallback(function (actionKey, data) {
74
- if (!actionKey) return;
75
- var handleActionClick = _objectSpread({
76
- copy: function copy(data) {
77
- _copy(data.content);
78
- message.success((text === null || text === void 0 ? void 0 : text.copySuccess) || 'Copy Success');
79
- },
80
- edit: function edit() {
81
- return setEditing(true);
82
- }
83
- }, onActionsClick);
84
- return function () {
85
- var _handleActionClick$ac;
86
- return handleActionClick === null || handleActionClick === void 0 ? void 0 : (_handleActionClick$ac = handleActionClick[actionKey]) === null || _handleActionClick$ac === void 0 ? void 0 : _handleActionClick$ac.call(handleActionClick, data);
87
- };
88
- }, [onActionsClick === null || onActionsClick === void 0 ? void 0 : onActionsClick[item.role], text]);
89
73
  var Actions = useCallback(function (_ref4) {
90
74
  var data = _ref4.data;
91
75
  if (!renderActions || !(item !== null && item !== void 0 && item.role)) return;
@@ -93,13 +77,24 @@ var Item = /*#__PURE__*/memo(function (props) {
93
77
  if (renderActions !== null && renderActions !== void 0 && renderActions[item.role]) RenderFunction = renderActions[item.role];
94
78
  if (renderActions !== null && renderActions !== void 0 && renderActions['default']) RenderFunction = renderActions['default'];
95
79
  if (!RenderFunction) RenderFunction = ActionsBar;
80
+ var handleActionClick = _objectSpread({
81
+ copy: function copy(_ref5) {
82
+ var content = _ref5.content;
83
+ _copy(content);
84
+ message.success((text === null || text === void 0 ? void 0 : text.copySuccess) || 'Copy Success');
85
+ },
86
+ edit: function edit() {
87
+ return setEditing(true);
88
+ }
89
+ }, onActionsClick);
96
90
  return /*#__PURE__*/_jsx(RenderFunction, _objectSpread(_objectSpread({}, data), {}, {
97
91
  onActionClick: function onActionClick(actionKey) {
98
- return _onActionClick(actionKey, data);
92
+ var _handleActionClick$ac;
93
+ return handleActionClick === null || handleActionClick === void 0 ? void 0 : (_handleActionClick$ac = handleActionClick[actionKey]) === null || _handleActionClick$ac === void 0 ? void 0 : _handleActionClick$ac.call(handleActionClick, data);
99
94
  },
100
95
  text: text
101
96
  }));
102
- }, [renderActions === null || renderActions === void 0 ? void 0 : renderActions[item.role], text, _onActionClick]);
97
+ }, [renderActions === null || renderActions === void 0 ? void 0 : renderActions[item.role], text, onActionsClick]);
103
98
  var error = useMemo(function () {
104
99
  var _item$error3;
105
100
  if (!item.error) return;
@@ -43,9 +43,6 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
43
43
  overflowY: 'auto'
44
44
  };
45
45
  return /*#__PURE__*/_jsx(Modal, {
46
- bodyStyle: mobile ? {
47
- padding: 16
48
- } : {},
49
46
  cancelText: (text === null || text === void 0 ? void 0 : text.cancel) || 'Cancel',
50
47
  footer: isEdit ? null : undefined,
51
48
  okText: (text === null || text === void 0 ? void 0 : text.edit) || 'Edit',
@@ -56,6 +53,11 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
56
53
  return setTyping(true);
57
54
  },
58
55
  open: expand,
56
+ styles: mobile ? {
57
+ body: {
58
+ padding: 16
59
+ }
60
+ } : {},
59
61
  title: (text === null || text === void 0 ? void 0 : text.title) || 'Prompt',
60
62
  children: isEdit ? /*#__PURE__*/_jsx(MessageInput, {
61
63
  defaultValue: value,
package/es/Modal/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
4
- var _excluded = ["children", "title", "className", "wrapClassName", "width", "onCancel", "open", "destroyOnClose", "bodyStyle"];
4
+ var _excluded = ["children", "title", "className", "wrapClassName", "width", "onCancel", "open", "destroyOnClose"];
5
5
  var _templateObject, _templateObject2;
6
6
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -32,7 +32,6 @@ var Modal = /*#__PURE__*/memo(function (_ref2) {
32
32
  onCancel = _ref2.onCancel,
33
33
  open = _ref2.open,
34
34
  destroyOnClose = _ref2.destroyOnClose,
35
- bodyStyle = _ref2.bodyStyle,
36
35
  props = _objectWithoutProperties(_ref2, _excluded);
37
36
  var _useResponsive = useResponsive(),
38
37
  mobile = _useResponsive.mobile;
@@ -41,9 +40,6 @@ var Modal = /*#__PURE__*/memo(function (_ref2) {
41
40
  cx = _useStyles.cx,
42
41
  theme = _useStyles.theme;
43
42
  if (mobile) return /*#__PURE__*/_jsx(Drawer, {
44
- bodyStyle: bodyStyle || {
45
- padding: 0
46
- },
47
43
  closeIcon: /*#__PURE__*/_jsx(ActionIcon, {
48
44
  icon: X,
49
45
  size: {
@@ -55,14 +51,19 @@ var Modal = /*#__PURE__*/memo(function (_ref2) {
55
51
  drawerStyle: {
56
52
  background: "linear-gradient(to bottom, ".concat(theme.colorBgContainer, ", ").concat(theme.colorBgLayout, ")")
57
53
  },
58
- headerStyle: {
59
- padding: '8px 4px'
60
- },
61
54
  height: '75vh',
62
55
  maskClassName: cx(styles.wrap, wrapClassName),
63
56
  onClose: onCancel,
64
57
  open: open,
65
58
  placement: 'bottom',
59
+ styles: _objectSpread({
60
+ body: {
61
+ padding: 0
62
+ },
63
+ header: {
64
+ padding: '8px 4px'
65
+ }
66
+ }, props.styles),
66
67
  title: title,
67
68
  children: children
68
69
  });
@@ -73,7 +74,6 @@ var Modal = /*#__PURE__*/memo(function (_ref2) {
73
74
  }
74
75
  },
75
76
  children: /*#__PURE__*/_jsx(AntModal, _objectSpread(_objectSpread({
76
- bodyStyle: bodyStyle,
77
77
  className: cx(styles.content, className),
78
78
  closable: true,
79
79
  closeIcon: /*#__PURE__*/_jsx(Icon, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.104.0",
3
+ "version": "1.104.1",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",