@lobehub/lobehub 2.0.0-next.217 → 2.0.0-next.218
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/CHANGELOG.md +33 -0
- package/changelog/v1.json +12 -0
- package/package.json +1 -1
- package/packages/builtin-tool-cloud-sandbox/src/ExecutionRuntime/index.ts +18 -31
- package/packages/builtin-tool-cloud-sandbox/src/types.ts +3 -3
- package/src/app/[variants]/(main)/chat/profile/features/EditorCanvas/TypoBar.tsx +1 -11
- package/src/app/[variants]/(main)/group/profile/features/EditorCanvas/TypoBar.tsx +1 -11
- package/src/app/[variants]/(main)/memory/features/EditableModal/index.tsx +8 -101
- package/src/features/ChatInput/InputEditor/index.tsx +1 -0
- package/src/features/ChatInput/TypoBar/index.tsx +0 -11
- package/src/features/Conversation/ChatItem/components/MessageContent/index.tsx +11 -12
- package/src/features/EditorModal/EditorCanvas.tsx +81 -0
- package/src/features/EditorModal/TextareCanvas.tsx +28 -0
- package/src/{app/[variants]/(main)/memory/features/EditableModal → features/EditorModal}/Typobar.tsx +0 -11
- package/src/features/EditorModal/index.tsx +51 -0
- package/src/features/PageEditor/EditorCanvas/InlineToolbar.tsx +1 -17
- package/src/server/routers/tools/market.ts +118 -102
- package/src/server/services/discover/index.ts +10 -5
- package/src/services/codeInterpreter.ts +12 -20
- package/src/store/chat/slices/plugin/actions/pluginTypes.ts +13 -86
- package/src/features/Conversation/ChatItem/components/MessageContent/EditableModal.tsx +0 -119
- package/src/features/Conversation/ChatItem/components/MessageContent/Typobar.tsx +0 -150
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { HotkeyEnum, type IEditor, getHotkeyById } from '@lobehub/editor';
|
|
2
|
-
import { useEditorState } from '@lobehub/editor/react';
|
|
3
|
-
import {
|
|
4
|
-
ChatInputActionBar,
|
|
5
|
-
ChatInputActions,
|
|
6
|
-
type ChatInputActionsProps,
|
|
7
|
-
CodeLanguageSelect,
|
|
8
|
-
} from '@lobehub/editor/react';
|
|
9
|
-
import { cssVar } from 'antd-style';
|
|
10
|
-
import {
|
|
11
|
-
BoldIcon,
|
|
12
|
-
CodeXmlIcon,
|
|
13
|
-
ItalicIcon,
|
|
14
|
-
ListIcon,
|
|
15
|
-
ListOrderedIcon,
|
|
16
|
-
ListTodoIcon,
|
|
17
|
-
MessageSquareQuote,
|
|
18
|
-
SigmaIcon,
|
|
19
|
-
SquareDashedBottomCodeIcon,
|
|
20
|
-
StrikethroughIcon,
|
|
21
|
-
UnderlineIcon,
|
|
22
|
-
} from 'lucide-react';
|
|
23
|
-
import { memo, useMemo } from 'react';
|
|
24
|
-
import { useTranslation } from 'react-i18next';
|
|
25
|
-
|
|
26
|
-
const TypoBar = memo<{ editor?: IEditor }>(({ editor }) => {
|
|
27
|
-
const { t } = useTranslation('editor');
|
|
28
|
-
const editorState = useEditorState(editor);
|
|
29
|
-
|
|
30
|
-
const items: ChatInputActionsProps['items'] = useMemo(
|
|
31
|
-
() =>
|
|
32
|
-
[
|
|
33
|
-
{
|
|
34
|
-
active: editorState.isBold,
|
|
35
|
-
icon: BoldIcon,
|
|
36
|
-
key: 'bold',
|
|
37
|
-
label: t('typobar.bold'),
|
|
38
|
-
onClick: editorState.bold,
|
|
39
|
-
tooltipProps: { hotkey: getHotkeyById(HotkeyEnum.Bold).keys },
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
active: editorState.isItalic,
|
|
43
|
-
icon: ItalicIcon,
|
|
44
|
-
key: 'italic',
|
|
45
|
-
label: t('typobar.italic'),
|
|
46
|
-
onClick: editorState.italic,
|
|
47
|
-
tooltipProps: { hotkey: getHotkeyById(HotkeyEnum.Italic).keys },
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
active: editorState.isUnderline,
|
|
51
|
-
icon: UnderlineIcon,
|
|
52
|
-
key: 'underline',
|
|
53
|
-
label: t('typobar.underline'),
|
|
54
|
-
onClick: editorState.underline,
|
|
55
|
-
tooltipProps: { hotkey: getHotkeyById(HotkeyEnum.Underline).keys },
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
active: editorState.isStrikethrough,
|
|
59
|
-
icon: StrikethroughIcon,
|
|
60
|
-
key: 'strikethrough',
|
|
61
|
-
label: t('typobar.strikethrough'),
|
|
62
|
-
onClick: editorState.strikethrough,
|
|
63
|
-
tooltipProps: { hotkey: getHotkeyById(HotkeyEnum.Strikethrough).keys },
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: 'divider',
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
icon: ListIcon,
|
|
71
|
-
key: 'bulletList',
|
|
72
|
-
label: t('typobar.bulletList'),
|
|
73
|
-
onClick: editorState.bulletList,
|
|
74
|
-
tooltipProps: { hotkey: getHotkeyById(HotkeyEnum.BulletList).keys },
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
icon: ListOrderedIcon,
|
|
78
|
-
key: 'numberlist',
|
|
79
|
-
label: t('typobar.numberList'),
|
|
80
|
-
onClick: editorState.numberList,
|
|
81
|
-
tooltipProps: { hotkey: getHotkeyById(HotkeyEnum.NumberList).keys },
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
icon: ListTodoIcon,
|
|
85
|
-
key: 'tasklist',
|
|
86
|
-
label: t('typobar.taskList'),
|
|
87
|
-
onClick: editorState.checkList,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
type: 'divider',
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
active: editorState.isBlockquote,
|
|
94
|
-
icon: MessageSquareQuote,
|
|
95
|
-
key: 'blockquote',
|
|
96
|
-
label: t('typobar.blockquote'),
|
|
97
|
-
onClick: editorState.blockquote,
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
type: 'divider',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
icon: SigmaIcon,
|
|
104
|
-
key: 'math',
|
|
105
|
-
label: t('typobar.tex'),
|
|
106
|
-
onClick: editorState.insertMath,
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
active: editorState.isCode,
|
|
110
|
-
icon: CodeXmlIcon,
|
|
111
|
-
key: 'code',
|
|
112
|
-
label: t('typobar.code'),
|
|
113
|
-
onClick: editorState.code,
|
|
114
|
-
tooltipProps: { hotkey: getHotkeyById(HotkeyEnum.CodeInline).keys },
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
icon: SquareDashedBottomCodeIcon,
|
|
118
|
-
key: 'codeblock',
|
|
119
|
-
label: t('typobar.codeblock'),
|
|
120
|
-
onClick: editorState.codeblock,
|
|
121
|
-
},
|
|
122
|
-
editorState.isCodeblock && {
|
|
123
|
-
children: (
|
|
124
|
-
<CodeLanguageSelect
|
|
125
|
-
onSelect={(value) => editorState.updateCodeblockLang(value)}
|
|
126
|
-
value={editorState.codeblockLang}
|
|
127
|
-
/>
|
|
128
|
-
),
|
|
129
|
-
disabled: !editorState.isCodeblock,
|
|
130
|
-
key: 'codeblockLang',
|
|
131
|
-
},
|
|
132
|
-
].filter(Boolean) as ChatInputActionsProps['items'],
|
|
133
|
-
[editorState],
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
return (
|
|
137
|
-
<ChatInputActionBar
|
|
138
|
-
left={<ChatInputActions items={items} />}
|
|
139
|
-
style={{
|
|
140
|
-
background: cssVar.colorFillQuaternary,
|
|
141
|
-
borderTopLeftRadius: 8,
|
|
142
|
-
borderTopRightRadius: 8,
|
|
143
|
-
}}
|
|
144
|
-
/>
|
|
145
|
-
);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
TypoBar.displayName = 'TypoBar';
|
|
149
|
-
|
|
150
|
-
export default TypoBar;
|