@lobehub/editor 3.1.1 → 3.2.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/plugins/auto-complete/react/ReactAutoCompletePlugin.js +2 -4
- package/es/plugins/auto-complete/react/style.d.ts +4 -4
- package/es/plugins/auto-complete/react/style.js +2 -2
- package/es/plugins/code/react/CodeReactPlugin.js +2 -4
- package/es/plugins/code/react/style.d.ts +3 -3
- package/es/plugins/code/react/style.js +4 -4
- package/es/plugins/codeblock/command/index.d.ts +2 -11
- package/es/plugins/codeblock/command/index.js +1 -37
- package/es/plugins/codeblock/plugin/CodeHighlighterShiki.d.ts +0 -6
- package/es/plugins/codeblock/plugin/CodeHighlighterShiki.js +4 -5
- package/es/plugins/codeblock/plugin/FacadeShiki.d.ts +2 -7
- package/es/plugins/codeblock/plugin/FacadeShiki.js +46 -103
- package/es/plugins/codeblock/plugin/index.d.ts +0 -5
- package/es/plugins/codeblock/plugin/index.js +3 -7
- package/es/plugins/codeblock/react/ReactCodeblockPlugin.js +9 -26
- package/es/plugins/codeblock/react/style.d.ts +4 -6
- package/es/plugins/codeblock/react/style.js +5 -32
- package/es/plugins/common/plugin/index.js +13 -8
- package/es/plugins/common/react/Placeholder/index.js +1 -3
- package/es/plugins/common/react/Placeholder/style.d.ts +4 -4
- package/es/plugins/common/react/Placeholder/style.js +4 -4
- package/es/plugins/common/react/ReactPlainText.js +33 -21
- package/es/plugins/common/react/style.d.ts +22 -32
- package/es/plugins/common/react/style.js +27 -30
- package/es/plugins/common/utils/index.d.ts +1 -0
- package/es/plugins/common/utils/index.js +9 -0
- package/es/plugins/file/react/ReactFilePlugin.js +1 -3
- package/es/plugins/file/react/style.d.ts +3 -3
- package/es/plugins/file/react/style.js +4 -4
- package/es/plugins/hr/react/components/HRNode.d.ts +2 -2
- package/es/plugins/hr/react/components/HRNode.js +5 -7
- package/es/plugins/hr/react/style.d.ts +1 -1
- package/es/plugins/hr/react/style.js +4 -4
- package/es/plugins/image/react/ReactImagePlugin.js +1 -3
- package/es/plugins/image/react/components/BrokenImage.js +3 -5
- package/es/plugins/image/react/components/Image.js +2 -4
- package/es/plugins/image/react/components/LazyImage.d.ts +9 -8
- package/es/plugins/image/react/components/LazyImage.js +6 -7
- package/es/plugins/image/react/components/ResizeHandle.d.ts +2 -2
- package/es/plugins/image/react/components/ResizeHandle.js +5 -7
- package/es/plugins/image/react/components/style.d.ts +9 -7
- package/es/plugins/image/react/components/style.js +11 -10
- package/es/plugins/image/react/style.d.ts +4 -4
- package/es/plugins/image/react/style.js +5 -5
- package/es/plugins/link/react/ReactLinkPlugin.js +1 -3
- package/es/plugins/link/react/components/LinkEdit.d.ts +2 -2
- package/es/plugins/link/react/components/LinkEdit.js +7 -9
- package/es/plugins/link/react/components/LinkToolbar.js +1 -3
- package/es/plugins/link/react/style.d.ts +4 -4
- package/es/plugins/link/react/style.js +7 -8
- package/es/plugins/link-highlight/react/ReactLinkHighlightPlugin.js +2 -4
- package/es/plugins/link-highlight/react/style.d.ts +3 -3
- package/es/plugins/link-highlight/react/style.js +2 -2
- package/es/plugins/list/react/ReactListPlugin.js +1 -3
- package/es/plugins/list/react/style.d.ts +1 -1
- package/es/plugins/list/react/style.js +4 -5
- package/es/plugins/litexml/data-source/litexml-data-source.js +6 -2
- package/es/plugins/litexml/react/DiffNodeToolbar/index.js +5 -4
- package/es/plugins/litexml/react/DiffNodeToolbar/style.d.ts +6 -5
- package/es/plugins/litexml/react/DiffNodeToolbar/style.js +7 -7
- package/es/plugins/litexml/react/index.js +1 -3
- package/es/plugins/litexml/react/style.d.ts +1 -1
- package/es/plugins/litexml/react/style.js +4 -4
- package/es/plugins/math/react/components/MathEditorContainer.js +1 -3
- package/es/plugins/math/react/components/MathEditorContent.js +3 -7
- package/es/plugins/math/react/components/MathInline.d.ts +2 -2
- package/es/plugins/math/react/components/MathInline.js +3 -3
- package/es/plugins/math/react/components/Placeholder.js +4 -6
- package/es/plugins/math/react/index.js +1 -3
- package/es/plugins/math/react/style.d.ts +6 -4
- package/es/plugins/math/react/style.js +10 -9
- package/es/plugins/mention/react/ReactMentionPlugin.js +1 -3
- package/es/plugins/mention/react/style.d.ts +3 -3
- package/es/plugins/mention/react/style.js +4 -4
- package/es/plugins/slash/react/components/DefaultSlashMenu.d.ts +2 -2
- package/es/plugins/slash/react/components/DefaultSlashMenu.js +24 -17
- package/es/plugins/slash/react/components/SlashMenu.d.ts +2 -2
- package/es/plugins/slash/react/components/SlashMenu.js +3 -4
- package/es/plugins/slash/react/style.d.ts +1 -1
- package/es/plugins/slash/react/style.js +4 -4
- package/es/plugins/table/react/TableActionMenu/index.js +3 -7
- package/es/plugins/table/react/TableActionMenu/style.d.ts +4 -1
- package/es/plugins/table/react/TableActionMenu/style.js +7 -4
- package/es/plugins/table/react/TableHoverActions/index.js +2 -4
- package/es/plugins/table/react/TableHoverActions/style.d.ts +4 -4
- package/es/plugins/table/react/TableHoverActions/style.js +2 -2
- package/es/plugins/table/react/TableResize/index.js +4 -7
- package/es/plugins/table/react/TableResize/style.d.ts +1 -1
- package/es/plugins/table/react/TableResize/style.js +4 -4
- package/es/plugins/table/react/index.js +2 -4
- package/es/plugins/table/react/style.d.ts +1 -1
- package/es/plugins/table/react/style.js +4 -4
- package/es/plugins/toolbar/react/index.js +6 -8
- package/es/plugins/toolbar/react/style.d.ts +5 -1
- package/es/plugins/toolbar/react/style.js +9 -6
- package/es/react/ChatInput/ChatInput.d.ts +2 -2
- package/es/react/ChatInput/ChatInput.js +16 -27
- package/es/react/ChatInput/style.d.ts +11 -6
- package/es/react/ChatInput/style.js +13 -9
- package/es/react/ChatInputActionBar/ChatInputActionBar.js +2 -4
- package/es/react/ChatInputActionBar/style.d.ts +3 -3
- package/es/react/ChatInputActionBar/style.js +2 -2
- package/es/react/ChatInputActions/ChatInputActions.js +25 -25
- package/es/react/ChatInputActions/components/ActionItem.d.ts +2 -2
- package/es/react/ChatInputActions/components/ActionItem.js +2 -4
- package/es/react/ChatInputActions/components/ActionRender.d.ts +2 -2
- package/es/react/ChatInputActions/components/ActionRender.js +5 -11
- package/es/react/ChatInputActions/components/CollapsedActions.d.ts +2 -2
- package/es/react/ChatInputActions/components/CollapsedActions.js +5 -8
- package/es/react/ChatInputActions/style.d.ts +5 -4
- package/es/react/ChatInputActions/style.js +6 -5
- package/es/react/CodeLanguageSelect/CodeLanguageSelect.d.ts +2 -2
- package/es/react/CodeLanguageSelect/CodeLanguageSelect.js +6 -9
- package/es/react/CodeLanguageSelect/style.d.ts +3 -3
- package/es/react/CodeLanguageSelect/style.js +2 -2
- package/es/react/FloatActions/FloatActions.d.ts +2 -2
- package/es/react/FloatActions/FloatActions.js +4 -8
- package/es/react/FloatActions/components/ActionItem.d.ts +2 -2
- package/es/react/FloatActions/components/ActionItem.js +2 -4
- package/es/react/FloatActions/components/ActionRender.d.ts +2 -2
- package/es/react/FloatActions/components/ActionRender.js +5 -11
- package/es/react/FloatActions/components/CollapsedActions.d.ts +2 -2
- package/es/react/FloatActions/components/CollapsedActions.js +5 -8
- package/es/react/FloatActions/style.d.ts +5 -4
- package/es/react/FloatActions/style.js +6 -5
- package/es/react/FloatMenu/FloatMenu.js +2 -4
- package/es/react/FloatMenu/style.d.ts +5 -4
- package/es/react/FloatMenu/style.js +7 -6
- package/es/react/SendButton/SendButton.d.ts +2 -2
- package/es/react/SendButton/SendButton.js +17 -15
- package/es/react/SendButton/components/SendIcon.js +15 -15
- package/es/react/SendButton/components/StopIcon.js +16 -18
- package/es/react/SendButton/style.d.ts +7 -7
- package/es/react/SendButton/style.js +9 -10
- package/package.json +3 -3
|
@@ -6,6 +6,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { mergeRegister } from '@lexical/utils';
|
|
8
8
|
import { Block } from '@lobehub/ui';
|
|
9
|
+
import { cx, useThemeMode } from 'antd-style';
|
|
9
10
|
import { $getSelection, COMMAND_PRIORITY_LOW, SELECTION_CHANGE_COMMAND, getDOMSelection } from 'lexical';
|
|
10
11
|
import { useCallback, useRef } from 'react';
|
|
11
12
|
import { useLexicalComposerContext, useLexicalEditor } from "../../../editor-kernel/react";
|
|
@@ -14,7 +15,7 @@ import { createDebugLogger } from "../../../utils/debug";
|
|
|
14
15
|
import { HIDE_TOOLBAR_COMMAND, registerToolbarCommand } from "../command";
|
|
15
16
|
import { getDOMRangeRect } from "../utils/getDOMRangeRect";
|
|
16
17
|
import { setFloatingElemPosition } from "../utils/setFloatingElemPosition";
|
|
17
|
-
import {
|
|
18
|
+
import { styles } from "./style";
|
|
18
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
20
|
export var ReactToolbarPlugin = function ReactToolbarPlugin(_ref) {
|
|
20
21
|
var className = _ref.className,
|
|
@@ -24,9 +25,8 @@ export var ReactToolbarPlugin = function ReactToolbarPlugin(_ref) {
|
|
|
24
25
|
var _useLexicalComposerCo = useLexicalComposerContext(),
|
|
25
26
|
_useLexicalComposerCo2 = _slicedToArray(_useLexicalComposerCo, 1),
|
|
26
27
|
kernelEditor = _useLexicalComposerCo2[0];
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
styles = _useStyles.styles;
|
|
28
|
+
var _useThemeMode = useThemeMode(),
|
|
29
|
+
isDarkMode = _useThemeMode.isDarkMode;
|
|
30
30
|
var isMouseDownRef = useRef(false);
|
|
31
31
|
var logger = createDebugLogger('plugin', 'toolbar');
|
|
32
32
|
var $updateTextFormatFloatingToolbar = useCallback(function (editor) {
|
|
@@ -127,12 +127,10 @@ export var ReactToolbarPlugin = function ReactToolbarPlugin(_ref) {
|
|
|
127
127
|
});
|
|
128
128
|
});
|
|
129
129
|
return /*#__PURE__*/_jsx("div", {
|
|
130
|
+
className: styles.anchor,
|
|
130
131
|
ref: anchorElemRef,
|
|
131
|
-
style: {
|
|
132
|
-
position: 'relative'
|
|
133
|
-
},
|
|
134
132
|
children: /*#__PURE__*/_jsx(Block, {
|
|
135
|
-
className: cx(styles, className),
|
|
133
|
+
className: cx(isDarkMode ? styles.toolbarDark : styles.toolbarLight, className),
|
|
136
134
|
padding: 4,
|
|
137
135
|
ref: popupCharStylesEditorRef,
|
|
138
136
|
variant: 'outlined',
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
var _templateObject;
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
-
import {
|
|
4
|
-
export var
|
|
3
|
+
import { createStaticStyles } from 'antd-style';
|
|
4
|
+
export var styles = createStaticStyles(function (_ref) {
|
|
5
5
|
var css = _ref.css,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
cssVar = _ref.cssVar;
|
|
7
|
+
return {
|
|
8
|
+
anchor: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n "]))),
|
|
9
|
+
toolbarDark: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n will-change: transform;\n\n position: absolute;\n z-index: 10;\n inset-block-start: 0;\n inset-inline-start: 0;\n transform: translate(-10000px, -10000px);\n\n display: flex;\n\n border-color: ", ";\n\n vertical-align: middle;\n\n opacity: 0;\n background: ", ";\n box-shadow:\n 0 14px 28px -6px color-mix(in srgb, #000 18.75%, transparent),\n 0 2px 4px -1px color-mix(in srgb, #000 12.19%, transparent);\n\n transition: opacity 0.12s ", ";\n "])), cssVar.colorFillSecondary, cssVar.colorBgElevated, cssVar.motionEaseOut),
|
|
10
|
+
toolbarLight: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n will-change: transform;\n\n position: absolute;\n z-index: 10;\n inset-block-start: 0;\n inset-inline-start: 0;\n transform: translate(-10000px, -10000px);\n\n display: flex;\n\n border-color: ", ";\n\n vertical-align: middle;\n\n opacity: 0;\n background: ", ";\n box-shadow:\n 0 14px 28px -6px color-mix(in srgb, #000 10.2%, transparent),\n 0 2px 4px -1px color-mix(in srgb, #000 5.88%, transparent);\n\n transition: opacity 0.12s ", ";\n "])), cssVar.colorFillSecondary, cssVar.colorBgElevated, cssVar.motionEaseOut)
|
|
11
|
+
};
|
|
9
12
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import type { ChatInputProps } from './type';
|
|
3
|
-
declare const ChatInput:
|
|
3
|
+
declare const ChatInput: FC<ChatInputProps>;
|
|
4
4
|
export default ChatInput;
|
|
@@ -16,15 +16,15 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
16
16
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
17
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
18
|
import { Flexbox } from '@lobehub/ui';
|
|
19
|
+
import { cx, useThemeMode } from 'antd-style';
|
|
19
20
|
import { Resizable } from 're-resizable';
|
|
20
|
-
import {
|
|
21
|
+
import { useCallback } from 'react';
|
|
21
22
|
import useMergeState from 'use-merge-value';
|
|
22
23
|
import { useHeight } from "../hooks/useSize";
|
|
23
|
-
import {
|
|
24
|
+
import { styles } from "./style";
|
|
24
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
26
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
-
|
|
27
|
-
var ChatInput = /*#__PURE__*/memo(function (props) {
|
|
27
|
+
var ChatInput = function ChatInput(props) {
|
|
28
28
|
var _props$defaultHeight = props.defaultHeight,
|
|
29
29
|
defaultHeight = _props$defaultHeight === void 0 ? props.defaultHeight || props.minHeight || 64 : _props$defaultHeight,
|
|
30
30
|
height = props.height,
|
|
@@ -50,9 +50,8 @@ var ChatInput = /*#__PURE__*/memo(function (props) {
|
|
|
50
50
|
onBodyClick = props.onBodyClick,
|
|
51
51
|
customStyles = props.styles,
|
|
52
52
|
rest = _objectWithoutProperties(props, _excluded);
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
styles = _useStyles.styles;
|
|
53
|
+
var _useThemeMode = useThemeMode(),
|
|
54
|
+
isDarkMode = _useThemeMode.isDarkMode;
|
|
56
55
|
var _useHeight = useHeight(),
|
|
57
56
|
headerRef = _useHeight.ref,
|
|
58
57
|
_useHeight$height = _useHeight.height,
|
|
@@ -80,34 +79,27 @@ var ChatInput = /*#__PURE__*/memo(function (props) {
|
|
|
80
79
|
onSizeDragging === null || onSizeDragging === void 0 || onSizeDragging(newHeight);
|
|
81
80
|
}, [onSizeDragging, defaultHeight]);
|
|
82
81
|
var bodyNode = /*#__PURE__*/_jsx("div", {
|
|
83
|
-
className: cx(styles.editor, classNames === null || classNames === void 0 ? void 0 : classNames.body),
|
|
82
|
+
className: cx(styles.editor, styles.bodyEditor, classNames === null || classNames === void 0 ? void 0 : classNames.body),
|
|
84
83
|
draggable: false,
|
|
85
84
|
onClick: onBodyClick,
|
|
86
85
|
style: _objectSpread(_objectSpread({}, customStyles === null || customStyles === void 0 ? void 0 : customStyles.body), {}, {
|
|
87
|
-
flex: 1,
|
|
88
86
|
maxHeight: fullscreen ? '100%' : maxHeight,
|
|
89
|
-
minHeight: resize ? currentHeight : minHeight
|
|
90
|
-
zIndex: 0
|
|
87
|
+
minHeight: resize ? currentHeight : minHeight
|
|
91
88
|
}),
|
|
92
89
|
children: children
|
|
93
90
|
});
|
|
94
91
|
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
95
|
-
className: cx(styles.
|
|
92
|
+
className: cx(isDarkMode ? styles.containerDark : styles.containerLight, styles.root, className),
|
|
96
93
|
height: fullscreen ? '100%' : undefined,
|
|
97
|
-
style:
|
|
98
|
-
position: 'relative'
|
|
99
|
-
}, style),
|
|
94
|
+
style: style,
|
|
100
95
|
width: "100%"
|
|
101
96
|
}, rest), {}, {
|
|
102
97
|
children: [slashMenuRef && /*#__PURE__*/_jsx("div", {
|
|
103
98
|
ref: slashMenuRef
|
|
104
99
|
}), /*#__PURE__*/_jsx("div", {
|
|
105
|
-
className: classNames === null || classNames === void 0 ? void 0 : classNames.header,
|
|
100
|
+
className: cx(styles.header, classNames === null || classNames === void 0 ? void 0 : classNames.header),
|
|
106
101
|
ref: headerRef,
|
|
107
|
-
style:
|
|
108
|
-
width: '100%',
|
|
109
|
-
zIndex: 1
|
|
110
|
-
}, customStyles === null || customStyles === void 0 ? void 0 : customStyles.header),
|
|
102
|
+
style: customStyles === null || customStyles === void 0 ? void 0 : customStyles.header,
|
|
111
103
|
children: header
|
|
112
104
|
}), resize ? /*#__PURE__*/_jsx(Resizable, {
|
|
113
105
|
className: styles.resizableContainer,
|
|
@@ -141,17 +133,14 @@ var ChatInput = /*#__PURE__*/memo(function (props) {
|
|
|
141
133
|
flex: 1,
|
|
142
134
|
overflow: 'hidden',
|
|
143
135
|
position: 'relative'
|
|
144
|
-
} :
|
|
136
|
+
} : undefined,
|
|
145
137
|
children: bodyNode
|
|
146
138
|
}) : bodyNode, /*#__PURE__*/_jsx("div", {
|
|
147
|
-
className: classNames === null || classNames === void 0 ? void 0 : classNames.footer,
|
|
148
|
-
style:
|
|
149
|
-
width: '100%',
|
|
150
|
-
zIndex: 1
|
|
151
|
-
}, customStyles === null || customStyles === void 0 ? void 0 : customStyles.footer),
|
|
139
|
+
className: cx(styles.footer, classNames === null || classNames === void 0 ? void 0 : classNames.footer),
|
|
140
|
+
style: customStyles === null || customStyles === void 0 ? void 0 : customStyles.footer,
|
|
152
141
|
children: footer
|
|
153
142
|
})]
|
|
154
143
|
}));
|
|
155
|
-
}
|
|
144
|
+
};
|
|
156
145
|
ChatInput.displayName = 'ChatInput';
|
|
157
146
|
export default ChatInput;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
bodyEditor: string;
|
|
3
|
+
containerDark: string;
|
|
4
|
+
containerLight: string;
|
|
5
|
+
editor: string;
|
|
6
|
+
footer: string;
|
|
7
|
+
header: string;
|
|
8
|
+
resizableContainer: string;
|
|
9
|
+
resizeHandle: string;
|
|
10
|
+
root: string;
|
|
11
|
+
};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
-
import {
|
|
4
|
-
export var
|
|
3
|
+
import { createStaticStyles } from 'antd-style';
|
|
4
|
+
export var styles = createStaticStyles(function (_ref) {
|
|
5
5
|
var css = _ref.css,
|
|
6
|
-
|
|
7
|
-
isDarkMode = _ref.isDarkMode;
|
|
6
|
+
cssVar = _ref.cssVar;
|
|
8
7
|
return {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
bodyEditor: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n z-index: 0;\n flex: 1;\n "]))),
|
|
9
|
+
containerDark: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: column;\n\n height: 100%;\n border: 1px solid ", ";\n border-radius: ", ";\n\n background-color: ", ";\n box-shadow: 0 4px 4px color-mix(in srgb, #000 40%, transparent);\n "])), cssVar.colorFillSecondary, cssVar.borderRadiusLG, cssVar.colorBgElevated),
|
|
10
|
+
containerLight: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: column;\n\n height: 100%;\n border: 1px solid ", ";\n border-radius: ", ";\n\n background-color: ", ";\n box-shadow: 0 4px 4px color-mix(in srgb, #000 4%, transparent);\n "])), cssVar.colorFill, cssVar.borderRadiusLG, cssVar.colorBgElevated),
|
|
11
|
+
editor: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n cursor: text;\n\n overflow: hidden auto;\n flex: 1;\n\n width: 100%;\n padding-block: 8px 0;\n padding-inline: 12px;\n "]))),
|
|
12
|
+
footer: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n z-index: 1;\n width: 100%;\n "]))),
|
|
13
|
+
header: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n z-index: 1;\n width: 100%;\n "]))),
|
|
14
|
+
resizableContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n align-self: flex-end;\n\n width: 100%;\n\n &:hover .resize-handle {\n opacity: 1;\n }\n "]))),
|
|
15
|
+
resizeHandle: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: absolute;\n inset-block-start: -4px;\n inset-inline-start: 50%;\n transform: translateX(-50%);\n\n width: 100%;\n height: 8px;\n\n opacity: 0;\n\n transition: opacity 0.2s ease-in-out;\n\n &::before {\n content: '';\n\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 50%;\n transform: translateX(-50%);\n\n width: 32px;\n height: 4px;\n border-radius: 4px;\n\n background-color: ", ";\n box-shadow: 0 1px 2px color-mix(in srgb, ", " 12.5%, transparent);\n }\n\n &:hover {\n opacity: 1 !important;\n\n &::before {\n background-color: ", ";\n box-shadow: 0 2px 4px color-mix(in srgb, ", " 25%, transparent);\n }\n }\n\n &:active {\n &::before {\n background-color: ", ";\n }\n }\n "])), cssVar.colorPrimary, cssVar.colorTextSecondary, cssVar.colorPrimaryHover, cssVar.colorTextSecondary, cssVar.colorPrimaryActive),
|
|
16
|
+
root: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: relative;\n "])))
|
|
13
17
|
};
|
|
14
18
|
});
|
|
@@ -10,7 +10,8 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
10
10
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
12
|
import { Flexbox } from '@lobehub/ui';
|
|
13
|
-
import {
|
|
13
|
+
import { cx } from 'antd-style';
|
|
14
|
+
import { styles } from "./style";
|
|
14
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
16
|
var ChatInputActionBar = function ChatInputActionBar(_ref) {
|
|
16
17
|
var className = _ref.className,
|
|
@@ -18,9 +19,6 @@ var ChatInputActionBar = function ChatInputActionBar(_ref) {
|
|
|
18
19
|
left = _ref.left,
|
|
19
20
|
right = _ref.right,
|
|
20
21
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
var _useStyles = useStyles(),
|
|
22
|
-
cx = _useStyles.cx,
|
|
23
|
-
styles = _useStyles.styles;
|
|
24
22
|
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
25
23
|
align: 'center',
|
|
26
24
|
className: cx(styles.container, className),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
container:
|
|
3
|
-
}
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
container: string;
|
|
3
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _templateObject;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
-
import {
|
|
4
|
-
export var
|
|
3
|
+
import { createStaticStyles } from 'antd-style';
|
|
4
|
+
export var styles = createStaticStyles(function (_ref) {
|
|
5
5
|
var css = _ref.css;
|
|
6
6
|
return {
|
|
7
7
|
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n "])))
|
|
@@ -19,12 +19,13 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
21
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
|
-
import { Flexbox } from '@lobehub/ui';
|
|
22
|
+
import { Flexbox, TooltipGroup } from '@lobehub/ui';
|
|
23
|
+
import { cx } from 'antd-style';
|
|
23
24
|
import { memo, useMemo } from 'react';
|
|
24
25
|
import useMergeState from 'use-merge-value';
|
|
25
26
|
import ActionItem from "./components/ActionItem";
|
|
26
27
|
import { useDisplayActionCount } from "./components/useDisplayActionCount";
|
|
27
|
-
import {
|
|
28
|
+
import { styles } from "./style";
|
|
28
29
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
30
|
// Keep memo: Complex calcItem computation and list rendering with state management
|
|
30
31
|
var ChatInputActions = /*#__PURE__*/memo(function (_ref) {
|
|
@@ -44,9 +45,6 @@ var ChatInputActions = /*#__PURE__*/memo(function (_ref) {
|
|
|
44
45
|
onGroupCollapseChange = _ref.onGroupCollapseChange,
|
|
45
46
|
groupCollapse = _ref.groupCollapse,
|
|
46
47
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
47
|
-
var _useStyles = useStyles(),
|
|
48
|
-
cx = _useStyles.cx,
|
|
49
|
-
styles = _useStyles.styles;
|
|
50
48
|
var _useMergeState = useMergeState(defaultGroupCollapse, {
|
|
51
49
|
defaultValue: defaultGroupCollapse,
|
|
52
50
|
onChange: onGroupCollapseChange,
|
|
@@ -84,26 +82,28 @@ var ChatInputActions = /*#__PURE__*/memo(function (_ref) {
|
|
|
84
82
|
}).slice(sliceCount)), _toConsumableArray(collapseItems.children))
|
|
85
83
|
})], _toConsumableArray(alwaysDisplayItems)).filter(Boolean);
|
|
86
84
|
}, [collapsed, items, maxCount]);
|
|
87
|
-
return /*#__PURE__*/_jsx(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
85
|
+
return /*#__PURE__*/_jsx(TooltipGroup, {
|
|
86
|
+
children: /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
|
|
87
|
+
align: 'center',
|
|
88
|
+
className: cx(styles.container, className),
|
|
89
|
+
flex: 1,
|
|
90
|
+
gap: gap,
|
|
91
|
+
horizontal: true,
|
|
92
|
+
ref: ref
|
|
93
|
+
}, rest), {}, {
|
|
94
|
+
children: calcItem.map(function (item, index) {
|
|
95
|
+
return /*#__PURE__*/_jsx(ActionItem, {
|
|
96
|
+
collapsed: collapsed,
|
|
97
|
+
disabled: disabled,
|
|
98
|
+
gap: gap,
|
|
99
|
+
groupCollapsed: groupCollapsed,
|
|
100
|
+
item: item,
|
|
101
|
+
onActionClick: onActionClick,
|
|
102
|
+
setGroupCollapsed: setGroupCollapsed
|
|
103
|
+
}, item.key || index);
|
|
104
|
+
})
|
|
105
|
+
}))
|
|
106
|
+
});
|
|
107
107
|
});
|
|
108
108
|
ChatInputActions.displayName = 'ChatInputActions';
|
|
109
109
|
export default ChatInputActions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import type { ChatInputActionItem, ChatInputActionsProps } from '../type';
|
|
3
3
|
interface ChatInputActionItemProps {
|
|
4
4
|
collapsed?: boolean;
|
|
@@ -9,5 +9,5 @@ interface ChatInputActionItemProps {
|
|
|
9
9
|
onActionClick: ChatInputActionsProps['onActionClick'];
|
|
10
10
|
setGroupCollapsed?: (collapse: boolean) => void;
|
|
11
11
|
}
|
|
12
|
-
declare const ActionItem:
|
|
12
|
+
declare const ActionItem: FC<ChatInputActionItemProps>;
|
|
13
13
|
export default ActionItem;
|
|
@@ -7,12 +7,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
7
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
8
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
9
|
import { ActionIcon, Dropdown } from '@lobehub/ui';
|
|
10
|
-
import { memo } from 'react';
|
|
11
10
|
import ActionRender from "./ActionRender";
|
|
12
11
|
import CollapsedActions from "./CollapsedActions";
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
|
|
15
|
-
var ActionItem = /*#__PURE__*/memo(function (_ref) {
|
|
13
|
+
var ActionItem = function ActionItem(_ref) {
|
|
16
14
|
var item = _ref.item,
|
|
17
15
|
disabled = _ref.disabled,
|
|
18
16
|
onActionClick = _ref.onActionClick,
|
|
@@ -62,6 +60,6 @@ var ActionItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
62
60
|
item: item,
|
|
63
61
|
onActionClick: onActionClick
|
|
64
62
|
});
|
|
65
|
-
}
|
|
63
|
+
};
|
|
66
64
|
ActionItem.displayName = 'ChatInputActionItem';
|
|
67
65
|
export default ActionItem;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import type { ChatInputActionItem, ChatInputActionsProps } from '../type';
|
|
3
3
|
interface ActionRenderProps {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
item: ChatInputActionItem;
|
|
6
6
|
onActionClick: ChatInputActionsProps['onActionClick'];
|
|
7
7
|
}
|
|
8
|
-
declare const ActionRender:
|
|
8
|
+
declare const ActionRender: FC<ActionRenderProps>;
|
|
9
9
|
export default ActionRender;
|
|
@@ -9,23 +9,17 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
10
|
import { ActionIcon } from '@lobehub/ui';
|
|
11
11
|
import { Divider } from 'antd';
|
|
12
|
-
import { isValidElement
|
|
13
|
-
import {
|
|
12
|
+
import { isValidElement } from 'react';
|
|
13
|
+
import { styles } from "../style";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
|
|
16
|
-
var ActionRender = /*#__PURE__*/memo(function (_ref) {
|
|
15
|
+
var ActionRender = function ActionRender(_ref) {
|
|
17
16
|
var item = _ref.item,
|
|
18
17
|
onActionClick = _ref.onActionClick,
|
|
19
18
|
disabled = _ref.disabled;
|
|
20
|
-
var _useStyles = useStyles(),
|
|
21
|
-
styles = _useStyles.styles;
|
|
22
19
|
if (item.type === 'divider') {
|
|
23
20
|
return /*#__PURE__*/_jsx(Divider, {
|
|
24
21
|
className: styles.divider,
|
|
25
|
-
orientation: 'vertical'
|
|
26
|
-
style: {
|
|
27
|
-
height: 20
|
|
28
|
-
}
|
|
22
|
+
orientation: 'vertical'
|
|
29
23
|
});
|
|
30
24
|
}
|
|
31
25
|
var _ref2 = item,
|
|
@@ -68,5 +62,5 @@ var ActionRender = /*#__PURE__*/memo(function (_ref) {
|
|
|
68
62
|
});
|
|
69
63
|
if (!wrapper) return action;
|
|
70
64
|
return wrapper(action);
|
|
71
|
-
}
|
|
65
|
+
};
|
|
72
66
|
export default ActionRender;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import type { ChatInputActionsCollapseProps } from '../type';
|
|
3
|
-
declare const CollapsedActions:
|
|
3
|
+
declare const CollapsedActions: FC<ChatInputActionsCollapseProps>;
|
|
4
4
|
export default CollapsedActions;
|
|
@@ -4,11 +4,10 @@ import { ActionIcon, Flexbox } from '@lobehub/ui';
|
|
|
4
4
|
import { Popover } from 'antd';
|
|
5
5
|
import { CircleChevronLeftIcon, CircleChevronRightIcon, CircleChevronUpIcon } from 'lucide-react';
|
|
6
6
|
import { motion } from 'motion/react';
|
|
7
|
-
import {
|
|
7
|
+
import { styles } from "../style";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
|
|
11
|
-
var CollapsedActions = /*#__PURE__*/memo(function (_ref) {
|
|
10
|
+
var CollapsedActions = function CollapsedActions(_ref) {
|
|
12
11
|
var children = _ref.children,
|
|
13
12
|
_ref$groupCollapse = _ref.groupCollapse,
|
|
14
13
|
groupCollapse = _ref$groupCollapse === void 0 ? false : _ref$groupCollapse,
|
|
@@ -45,12 +44,10 @@ var CollapsedActions = /*#__PURE__*/memo(function (_ref) {
|
|
|
45
44
|
horizontal: true,
|
|
46
45
|
children: [/*#__PURE__*/_jsx(motion.div, {
|
|
47
46
|
animate: groupCollapse ? 'closed' : 'open',
|
|
47
|
+
className: styles.collapsedContainer,
|
|
48
48
|
initial: groupCollapse ? 'closed' : 'open',
|
|
49
49
|
style: {
|
|
50
|
-
|
|
51
|
-
display: 'flex',
|
|
52
|
-
gap: gap,
|
|
53
|
-
overflow: 'hidden'
|
|
50
|
+
gap: gap
|
|
54
51
|
},
|
|
55
52
|
transition: {
|
|
56
53
|
duration: 0.2
|
|
@@ -77,6 +74,6 @@ var CollapsedActions = /*#__PURE__*/memo(function (_ref) {
|
|
|
77
74
|
}
|
|
78
75
|
})]
|
|
79
76
|
});
|
|
80
|
-
}
|
|
77
|
+
};
|
|
81
78
|
CollapsedActions.displayName = 'ChatInputActionsCollapse';
|
|
82
79
|
export default CollapsedActions;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
collapsedContainer: string;
|
|
3
|
+
container: string;
|
|
4
|
+
divider: string;
|
|
5
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
var _templateObject, _templateObject2;
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
-
import {
|
|
4
|
-
export var
|
|
3
|
+
import { createStaticStyles } from 'antd-style';
|
|
4
|
+
export var styles = createStaticStyles(function (_ref) {
|
|
5
5
|
var css = _ref.css;
|
|
6
6
|
return {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
collapsedContainer: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n display: flex;\n align-items: center;\n "]))),
|
|
8
|
+
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n width: 100%;\n "]))),
|
|
9
|
+
divider: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 20px;\n margin-inline: 4px;\n "])))
|
|
9
10
|
};
|
|
10
11
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import type { CodeLanguageSelectProps } from './type';
|
|
3
|
-
declare const CodeLanguageSelect:
|
|
3
|
+
declare const CodeLanguageSelect: FC<CodeLanguageSelectProps>;
|
|
4
4
|
export default CodeLanguageSelect;
|
|
@@ -15,19 +15,16 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
15
15
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
16
16
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
17
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
|
-
import { MaterialFileTypeIcon, Select, Text
|
|
19
|
-
import {
|
|
18
|
+
import { Flexbox, MaterialFileTypeIcon, Select, Text } from '@lobehub/ui';
|
|
19
|
+
import { cx } from 'antd-style';
|
|
20
|
+
import { useMemo } from 'react';
|
|
20
21
|
import { bundledLanguagesInfo } from 'shiki';
|
|
21
|
-
import {
|
|
22
|
+
import { styles } from "./style";
|
|
22
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
24
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
|
|
25
|
-
var CodeLanguageSelect = /*#__PURE__*/memo(function (_ref) {
|
|
25
|
+
var CodeLanguageSelect = function CodeLanguageSelect(_ref) {
|
|
26
26
|
var className = _ref.className,
|
|
27
27
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
-
var _useStyles = useStyles(),
|
|
29
|
-
cx = _useStyles.cx,
|
|
30
|
-
styles = _useStyles.styles;
|
|
31
28
|
var options = useMemo(function () {
|
|
32
29
|
return [{
|
|
33
30
|
aliases: ['text', 'txt'],
|
|
@@ -91,6 +88,6 @@ var CodeLanguageSelect = /*#__PURE__*/memo(function (_ref) {
|
|
|
91
88
|
showSearch: true,
|
|
92
89
|
variant: 'filled'
|
|
93
90
|
}, rest));
|
|
94
|
-
}
|
|
91
|
+
};
|
|
95
92
|
CodeLanguageSelect.displayName = 'CodeLanguageSelect';
|
|
96
93
|
export default CodeLanguageSelect;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
container:
|
|
3
|
-
}
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
container: string;
|
|
3
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _templateObject;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
-
import {
|
|
4
|
-
export var
|
|
3
|
+
import { createStaticStyles } from 'antd-style';
|
|
4
|
+
export var styles = createStaticStyles(function (_ref) {
|
|
5
5
|
var css = _ref.css;
|
|
6
6
|
return {
|
|
7
7
|
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 160px;\n "])))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import type { FloatActionsProps } from './type';
|
|
3
|
-
declare const FloatActions:
|
|
3
|
+
declare const FloatActions: FC<FloatActionsProps>;
|
|
4
4
|
export default FloatActions;
|
|
@@ -16,13 +16,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
16
16
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
17
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
18
|
import { Flexbox } from '@lobehub/ui';
|
|
19
|
-
import {
|
|
19
|
+
import { cx } from 'antd-style';
|
|
20
20
|
import useMergeState from 'use-merge-value';
|
|
21
21
|
import ActionItem from "./components/ActionItem";
|
|
22
|
-
import {
|
|
22
|
+
import { styles } from "./style";
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
|
|
25
|
-
var FloatActions = /*#__PURE__*/memo(function (_ref) {
|
|
24
|
+
var FloatActions = function FloatActions(_ref) {
|
|
26
25
|
var _ref$gap = _ref.gap,
|
|
27
26
|
gap = _ref$gap === void 0 ? 2 : _ref$gap,
|
|
28
27
|
disabled = _ref.disabled,
|
|
@@ -35,9 +34,6 @@ var FloatActions = /*#__PURE__*/memo(function (_ref) {
|
|
|
35
34
|
onGroupCollapseChange = _ref.onGroupCollapseChange,
|
|
36
35
|
groupCollapse = _ref.groupCollapse,
|
|
37
36
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
-
var _useStyles = useStyles(),
|
|
39
|
-
cx = _useStyles.cx,
|
|
40
|
-
styles = _useStyles.styles;
|
|
41
37
|
var _useMergeState = useMergeState(defaultGroupCollapse, {
|
|
42
38
|
defaultValue: defaultGroupCollapse,
|
|
43
39
|
onChange: onGroupCollapseChange,
|
|
@@ -64,6 +60,6 @@ var FloatActions = /*#__PURE__*/memo(function (_ref) {
|
|
|
64
60
|
}, item.key || index);
|
|
65
61
|
})
|
|
66
62
|
}));
|
|
67
|
-
}
|
|
63
|
+
};
|
|
68
64
|
FloatActions.displayName = 'FloatActions';
|
|
69
65
|
export default FloatActions;
|