@opensumi/ide-ai-native 2.26.9-rc-1695091570.0
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/LICENSE +21 -0
- package/lib/browser/ai-chat.contribution.d.ts +26 -0
- package/lib/browser/ai-chat.contribution.d.ts.map +1 -0
- package/lib/browser/ai-chat.contribution.js +227 -0
- package/lib/browser/ai-chat.contribution.js.map +1 -0
- package/lib/browser/ai-chat.module.less +174 -0
- package/lib/browser/ai-chat.service.d.ts +30 -0
- package/lib/browser/ai-chat.service.d.ts.map +1 -0
- package/lib/browser/ai-chat.service.js +134 -0
- package/lib/browser/ai-chat.service.js.map +1 -0
- package/lib/browser/ai-chat.view.d.ts +4 -0
- package/lib/browser/ai-chat.view.d.ts.map +1 -0
- package/lib/browser/ai-chat.view.js +305 -0
- package/lib/browser/ai-chat.view.js.map +1 -0
- package/lib/browser/ai-editor.contribution.d.ts +24 -0
- package/lib/browser/ai-editor.contribution.d.ts.map +1 -0
- package/lib/browser/ai-editor.contribution.js +419 -0
- package/lib/browser/ai-editor.contribution.js.map +1 -0
- package/lib/browser/ai-project/generate.service.d.ts +31 -0
- package/lib/browser/ai-project/generate.service.d.ts.map +1 -0
- package/lib/browser/ai-project/generate.service.js +453 -0
- package/lib/browser/ai-project/generate.service.js.map +1 -0
- package/lib/browser/ai-sumi/sumi.service.d.ts +11 -0
- package/lib/browser/ai-sumi/sumi.service.d.ts.map +1 -0
- package/lib/browser/ai-sumi/sumi.service.js +64 -0
- package/lib/browser/ai-sumi/sumi.service.js.map +1 -0
- package/lib/browser/code-widget/ai-code-document.provider.d.ts +10 -0
- package/lib/browser/code-widget/ai-code-document.provider.d.ts.map +1 -0
- package/lib/browser/code-widget/ai-code-document.provider.js +26 -0
- package/lib/browser/code-widget/ai-code-document.provider.js.map +1 -0
- package/lib/browser/code-widget/ai-code-widget.d.ts +20 -0
- package/lib/browser/code-widget/ai-code-widget.d.ts.map +1 -0
- package/lib/browser/code-widget/ai-code-widget.js +164 -0
- package/lib/browser/code-widget/ai-code-widget.js.map +1 -0
- package/lib/browser/components/AIImprove.d.ts +9 -0
- package/lib/browser/components/AIImprove.d.ts.map +1 -0
- package/lib/browser/components/AIImprove.js +34 -0
- package/lib/browser/components/AIImprove.js.map +1 -0
- package/lib/browser/components/AIInput.d.ts +5 -0
- package/lib/browser/components/AIInput.d.ts.map +1 -0
- package/lib/browser/components/AIInput.js +21 -0
- package/lib/browser/components/AIInput.js.map +1 -0
- package/lib/browser/components/ChatEditor.d.ts +5 -0
- package/lib/browser/components/ChatEditor.d.ts.map +1 -0
- package/lib/browser/components/ChatEditor.js +85 -0
- package/lib/browser/components/ChatEditor.js.map +1 -0
- package/lib/browser/components/ChatInput.d.ts +6 -0
- package/lib/browser/components/ChatInput.d.ts.map +1 -0
- package/lib/browser/components/ChatInput.js +127 -0
- package/lib/browser/components/ChatInput.js.map +1 -0
- package/lib/browser/components/ChatMoreActions.d.ts +5 -0
- package/lib/browser/components/ChatMoreActions.d.ts.map +1 -0
- package/lib/browser/components/ChatMoreActions.js +26 -0
- package/lib/browser/components/ChatMoreActions.js.map +1 -0
- package/lib/browser/components/Thinking.d.ts +3 -0
- package/lib/browser/components/Thinking.d.ts.map +1 -0
- package/lib/browser/components/Thinking.js +19 -0
- package/lib/browser/components/Thinking.js.map +1 -0
- package/lib/browser/components/components.module.less +259 -0
- package/lib/browser/components/lineVertical.d.ts +4 -0
- package/lib/browser/components/lineVertical.d.ts.map +1 -0
- package/lib/browser/components/lineVertical.js +22 -0
- package/lib/browser/components/lineVertical.js.map +1 -0
- package/lib/browser/content-widget/ai-content-widget.d.ts +38 -0
- package/lib/browser/content-widget/ai-content-widget.d.ts.map +1 -0
- package/lib/browser/content-widget/ai-content-widget.js +97 -0
- package/lib/browser/content-widget/ai-content-widget.js.map +1 -0
- package/lib/browser/content-widget/ai-inline-chat-panel.d.ts +6 -0
- package/lib/browser/content-widget/ai-inline-chat-panel.d.ts.map +1 -0
- package/lib/browser/content-widget/ai-inline-chat-panel.js +108 -0
- package/lib/browser/content-widget/ai-inline-chat-panel.js.map +1 -0
- package/lib/browser/content-widget/ai-inline-chat.module.less +74 -0
- package/lib/browser/content-widget/ai-inline-chat.service.d.ts +23 -0
- package/lib/browser/content-widget/ai-inline-chat.service.d.ts.map +1 -0
- package/lib/browser/content-widget/ai-inline-chat.service.js +47 -0
- package/lib/browser/content-widget/ai-inline-chat.service.js.map +1 -0
- package/lib/browser/diff-widget/ai-diff-document.provider.d.ts +10 -0
- package/lib/browser/diff-widget/ai-diff-document.provider.d.ts.map +1 -0
- package/lib/browser/diff-widget/ai-diff-document.provider.js +26 -0
- package/lib/browser/diff-widget/ai-diff-document.provider.js.map +1 -0
- package/lib/browser/diff-widget/ai-diff-widget.d.ts +20 -0
- package/lib/browser/diff-widget/ai-diff-widget.d.ts.map +1 -0
- package/lib/browser/diff-widget/ai-diff-widget.js +158 -0
- package/lib/browser/diff-widget/ai-diff-widget.js.map +1 -0
- package/lib/browser/index.d.ts +12 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +84 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/inline-completions/constants.d.ts +62 -0
- package/lib/browser/inline-completions/constants.d.ts.map +1 -0
- package/lib/browser/inline-completions/constants.js +69 -0
- package/lib/browser/inline-completions/constants.js.map +1 -0
- package/lib/browser/inline-completions/provider.d.ts +27 -0
- package/lib/browser/inline-completions/provider.d.ts.map +1 -0
- package/lib/browser/inline-completions/provider.js +63 -0
- package/lib/browser/inline-completions/provider.js.map +1 -0
- package/lib/browser/override/ai-editor-tab.service.d.ts +6 -0
- package/lib/browser/override/ai-editor-tab.service.d.ts.map +1 -0
- package/lib/browser/override/ai-editor-tab.service.js +22 -0
- package/lib/browser/override/ai-editor-tab.service.js.map +1 -0
- package/lib/browser/override/ai-marker.service.d.ts +11 -0
- package/lib/browser/override/ai-marker.service.d.ts.map +1 -0
- package/lib/browser/override/ai-marker.service.js +55 -0
- package/lib/browser/override/ai-marker.service.js.map +1 -0
- package/lib/browser/override/global.styles.less +268 -0
- package/lib/browser/override/layout/layout-config.d.ts +6 -0
- package/lib/browser/override/layout/layout-config.d.ts.map +1 -0
- package/lib/browser/override/layout/layout-config.js +17 -0
- package/lib/browser/override/layout/layout-config.js.map +1 -0
- package/lib/browser/override/layout/layout.module.less +7 -0
- package/lib/browser/override/layout/main-slot-renderer.d.ts +4 -0
- package/lib/browser/override/layout/main-slot-renderer.d.ts.map +1 -0
- package/lib/browser/override/layout/main-slot-renderer.js +22 -0
- package/lib/browser/override/layout/main-slot-renderer.js.map +1 -0
- package/lib/browser/override/layout/menu-bar/menu-bar.contribution.d.ts +8 -0
- package/lib/browser/override/layout/menu-bar/menu-bar.contribution.d.ts.map +1 -0
- package/lib/browser/override/layout/menu-bar/menu-bar.contribution.js +32 -0
- package/lib/browser/override/layout/menu-bar/menu-bar.contribution.js.map +1 -0
- package/lib/browser/override/layout/menu-bar/menu-bar.module.less +41 -0
- package/lib/browser/override/layout/menu-bar/menu-bar.view.d.ts +3 -0
- package/lib/browser/override/layout/menu-bar/menu-bar.view.d.ts.map +1 -0
- package/lib/browser/override/layout/menu-bar/menu-bar.view.js +62 -0
- package/lib/browser/override/layout/menu-bar/menu-bar.view.js.map +1 -0
- package/lib/browser/override/layout/tabbar.view.d.ts +17 -0
- package/lib/browser/override/layout/tabbar.view.d.ts.map +1 -0
- package/lib/browser/override/layout/tabbar.view.js +38 -0
- package/lib/browser/override/layout/tabbar.view.js.map +1 -0
- package/lib/browser/override/override.module.less +32 -0
- package/lib/browser/override/theme/default-theme.d.ts +315 -0
- package/lib/browser/override/theme/default-theme.d.ts.map +1 -0
- package/lib/browser/override/theme/default-theme.js +821 -0
- package/lib/browser/override/theme/default-theme.js.map +1 -0
- package/lib/browser/run/run.service.d.ts +52 -0
- package/lib/browser/run/run.service.d.ts.map +1 -0
- package/lib/browser/run/run.service.js +176 -0
- package/lib/browser/run/run.service.js.map +1 -0
- package/lib/common/command.d.ts +17 -0
- package/lib/common/command.d.ts.map +1 -0
- package/lib/common/command.js +21 -0
- package/lib/common/command.js.map +1 -0
- package/lib/common/index.d.ts +37 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +22 -0
- package/lib/common/index.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/lib/node/index.d.ts +10 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +32 -0
- package/lib/node/index.js.map +1 -0
- package/package.json +38 -0
- package/src/browser/ai-chat.contribution.ts +294 -0
- package/src/browser/ai-chat.module.less +174 -0
- package/src/browser/ai-chat.service.ts +152 -0
- package/src/browser/ai-chat.view.tsx +421 -0
- package/src/browser/ai-editor.contribution.ts +521 -0
- package/src/browser/ai-project/generate.service.ts +505 -0
- package/src/browser/ai-sumi/sumi.service.ts +65 -0
- package/src/browser/code-widget/ai-code-document.provider.ts +22 -0
- package/src/browser/code-widget/ai-code-widget.tsx +202 -0
- package/src/browser/components/AIImprove.tsx +45 -0
- package/src/browser/components/AIInput.tsx +30 -0
- package/src/browser/components/ChatEditor.tsx +129 -0
- package/src/browser/components/ChatInput.tsx +197 -0
- package/src/browser/components/ChatMoreActions.tsx +33 -0
- package/src/browser/components/Thinking.tsx +23 -0
- package/src/browser/components/components.module.less +259 -0
- package/src/browser/components/lineVertical.tsx +19 -0
- package/src/browser/content-widget/ai-content-widget.tsx +132 -0
- package/src/browser/content-widget/ai-inline-chat-panel.tsx +154 -0
- package/src/browser/content-widget/ai-inline-chat.module.less +74 -0
- package/src/browser/content-widget/ai-inline-chat.service.ts +46 -0
- package/src/browser/diff-widget/ai-diff-document.provider.ts +22 -0
- package/src/browser/diff-widget/ai-diff-widget.tsx +196 -0
- package/src/browser/index.ts +91 -0
- package/src/browser/inline-completions/constants.ts +108 -0
- package/src/browser/inline-completions/provider.ts +55 -0
- package/src/browser/override/ai-editor-tab.service.tsx +22 -0
- package/src/browser/override/ai-marker.service.tsx +55 -0
- package/src/browser/override/global.styles.less +268 -0
- package/src/browser/override/layout/layout-config.ts +21 -0
- package/src/browser/override/layout/layout.module.less +7 -0
- package/src/browser/override/layout/main-slot-renderer.tsx +62 -0
- package/src/browser/override/layout/menu-bar/menu-bar.contribution.tsx +28 -0
- package/src/browser/override/layout/menu-bar/menu-bar.module.less +41 -0
- package/src/browser/override/layout/menu-bar/menu-bar.view.tsx +92 -0
- package/src/browser/override/layout/tabbar.view.tsx +99 -0
- package/src/browser/override/override.module.less +32 -0
- package/src/browser/override/theme/default-theme.ts +818 -0
- package/src/browser/run/run.service.ts +183 -0
- package/src/common/command.ts +21 -0
- package/src/common/index.ts +39 -0
- package/src/index.ts +1 -0
- package/src/node/index.ts +24 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
@import '@opensumi/ide-core-browser/lib/style/variable.less';
|
|
2
|
+
|
|
3
|
+
#ai_chat_panel {
|
|
4
|
+
height: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* ---------------- 覆盖 editor tab 样式 ---------------------
|
|
9
|
+
*/
|
|
10
|
+
div[class*='kt_editor_group___'] div[class*='kt_editor_tabs_content___'] {
|
|
11
|
+
div[class*='kt_editor_tab___'] {
|
|
12
|
+
border-right: none;
|
|
13
|
+
border-top: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
div[class*='kt_editor_tab_current___'] {
|
|
17
|
+
background-color: transparent !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* ---------------- 覆盖 editor navigation 导航条样式 ---------------------
|
|
23
|
+
*/
|
|
24
|
+
div[class*='navigation_container___'] {
|
|
25
|
+
height: 28px;
|
|
26
|
+
margin-bottom: 10px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
div[class*='file_tree_node___'] {
|
|
30
|
+
border-radius: 4px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* ---------------- 覆盖 左、右、底 tabbar 样式 ---------------------
|
|
35
|
+
*/
|
|
36
|
+
@bottomBarHeight: 32px;
|
|
37
|
+
|
|
38
|
+
div[class*='icon_tab___'] {
|
|
39
|
+
height: 32px;
|
|
40
|
+
width: 32px;
|
|
41
|
+
border-radius: 8px;
|
|
42
|
+
|
|
43
|
+
div.activity-icon {
|
|
44
|
+
font-size: 16px;
|
|
45
|
+
width: initial;
|
|
46
|
+
height: initial;
|
|
47
|
+
color: var(--activityBar-inactiveForeground);
|
|
48
|
+
|
|
49
|
+
&.mask-mode {
|
|
50
|
+
background-color: var(--activityBar-inactiveForeground);
|
|
51
|
+
-webkit-mask-size: 16px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
div[class*='tab_panel___'] {
|
|
57
|
+
&::before {
|
|
58
|
+
content: none;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
div[class*='tab_panel_hidden___'] {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.left-slot div[class*='tab_panel___'] {
|
|
67
|
+
border-right: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
li[class*='left_tab___'] {
|
|
71
|
+
width: 100%;
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
|
|
75
|
+
&.active {
|
|
76
|
+
div[class*='icon_tab___'] {
|
|
77
|
+
background-color: var(--activityBar-activeBorder);
|
|
78
|
+
&::before {
|
|
79
|
+
content: none;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
div[class*='left_tab_bar___'] {
|
|
86
|
+
border-right: none;
|
|
87
|
+
border-top: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
div[class*='bar_content___'] {
|
|
91
|
+
width: 100%;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.bottom-slot div[class*='tab_bar___'] {
|
|
95
|
+
height: 100%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
li[class*='bottom_tab___'] {
|
|
99
|
+
height: 100%;
|
|
100
|
+
line-height: @bottomBarHeight;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
div[class*='bottom_bar_container___'] {
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: @bottomBarHeight;
|
|
106
|
+
min-height: @bottomBarHeight;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* --------------------------------------*/
|
|
110
|
+
|
|
111
|
+
div[class*='box-panel___'] {
|
|
112
|
+
background-image: url('https://mdn.alipayobjects.com/huamei_htww6h/afts/img/A*hLI-SqEx-YkAAAAAAAAAAAAADhl8AQ/original');
|
|
113
|
+
background-repeat: no-repeat;
|
|
114
|
+
background-size: cover;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.rce-mbox-left-notch,
|
|
118
|
+
.rce-mbox-right-notch {
|
|
119
|
+
display: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.rce-mbox {
|
|
123
|
+
background-color: #ffffff0a;
|
|
124
|
+
border-radius: 2px 12px 12px 12px;
|
|
125
|
+
box-shadow: none;
|
|
126
|
+
padding: 8px 12px;
|
|
127
|
+
min-width: initial;
|
|
128
|
+
margin: 0;
|
|
129
|
+
|
|
130
|
+
::after {
|
|
131
|
+
content: '';
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.rce-mbox-text {
|
|
136
|
+
font-size: 12px;
|
|
137
|
+
line-height: 18px;
|
|
138
|
+
width: inherit;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.rce-smsg {
|
|
142
|
+
background-color: #ffffff0a;
|
|
143
|
+
box-shadow: none;
|
|
144
|
+
border-radius: 8px;
|
|
145
|
+
max-width: initial;
|
|
146
|
+
border-radius: 2px 12px 12px 12px;
|
|
147
|
+
width: 100%;
|
|
148
|
+
flex-direction: initial;
|
|
149
|
+
justify-content: left;
|
|
150
|
+
padding: 8px 12px 12px;
|
|
151
|
+
margin: 0;
|
|
152
|
+
|
|
153
|
+
.rce-smsg-text {
|
|
154
|
+
font-size: 12px;
|
|
155
|
+
width: 100%;
|
|
156
|
+
text-align: left;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.rce-container-smsg {
|
|
161
|
+
width: 100%;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.rce-mlist {
|
|
165
|
+
color: #ffffff;
|
|
166
|
+
font-size: 12px;
|
|
167
|
+
font-weight: 300;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.rce-ai-msg {
|
|
171
|
+
> .rce-mbox {
|
|
172
|
+
margin-bottom: 28px;
|
|
173
|
+
width: 100%;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.rce-mbox-body {
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: flex-start;
|
|
179
|
+
position: initial;
|
|
180
|
+
width: 100%;
|
|
181
|
+
|
|
182
|
+
.rce-mbox-title {
|
|
183
|
+
position: absolute;
|
|
184
|
+
left: -40px;
|
|
185
|
+
top: 0;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.rce-avatar-container {
|
|
189
|
+
&.default {
|
|
190
|
+
height: 32px;
|
|
191
|
+
width: 32px;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.rce-container-mbox {
|
|
198
|
+
overflow: hidden;
|
|
199
|
+
margin: 0 16px 16px 16px;
|
|
200
|
+
min-width: initial;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.rce-user-msg {
|
|
204
|
+
.rce-mbox-right {
|
|
205
|
+
border-radius: 12px 12px 2px 12px;
|
|
206
|
+
background-color: #3c8dff4d;
|
|
207
|
+
margin-right: 0;
|
|
208
|
+
margin-left: 0;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
blockquote {
|
|
213
|
+
background: var(--vscode-textBlockQuote-background);
|
|
214
|
+
border-color: var(--vscode-textBlockQuote-border);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.AI-Content-Widget {
|
|
218
|
+
box-shadow: 0 9px 28px 8px rgba(0, 0, 0, 0.15);
|
|
219
|
+
border-radius: 10px;
|
|
220
|
+
padding: 12px 16px;
|
|
221
|
+
background-color: rgba(23, 28, 37, 1);
|
|
222
|
+
border: 1px solid rgba(54, 57, 64, 1);
|
|
223
|
+
|
|
224
|
+
// 编辑区域的 content widget
|
|
225
|
+
.ant-select-selector {
|
|
226
|
+
background-color: #c0c7d008 !important;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.ai-shortcuts {
|
|
230
|
+
margin-bottom: 12px;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// ai native main
|
|
235
|
+
.ai_native_panel_container {
|
|
236
|
+
margin-right: 16px;
|
|
237
|
+
width: initial;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.ai_native_slot_main {
|
|
241
|
+
height: 100%;
|
|
242
|
+
width: 100%;
|
|
243
|
+
background-color: #151b21;
|
|
244
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
245
|
+
border-radius: 12px;
|
|
246
|
+
overflow: hidden;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.ai_native_slot_resize_horizontal {
|
|
250
|
+
height: 100%;
|
|
251
|
+
margin: 0 3px;
|
|
252
|
+
position: relative;
|
|
253
|
+
&::after {
|
|
254
|
+
content: '';
|
|
255
|
+
position: absolute;
|
|
256
|
+
height: 25px;
|
|
257
|
+
width: 2px;
|
|
258
|
+
background-color: #31363b;
|
|
259
|
+
border-radius: 1px;
|
|
260
|
+
top: 50%;
|
|
261
|
+
left: 50%;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// ai native input
|
|
266
|
+
.ai_native_input_container {
|
|
267
|
+
height: 32px;
|
|
268
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SlotLocation } from '@opensumi/ide-core-browser';
|
|
2
|
+
import { defaultConfig } from '@opensumi/ide-main-layout/lib/browser/default-config';
|
|
3
|
+
|
|
4
|
+
import { Ai_CHAT_CONTAINER_VIEW_ID } from '../../../common';
|
|
5
|
+
import { AiChatContribution } from '../../ai-chat.contribution';
|
|
6
|
+
|
|
7
|
+
import { AiMenuBarContribution } from './menu-bar/menu-bar.contribution';
|
|
8
|
+
|
|
9
|
+
export const AiLayoutConfig = {
|
|
10
|
+
...defaultConfig,
|
|
11
|
+
...{
|
|
12
|
+
[SlotLocation.top]: {
|
|
13
|
+
modules: [AiMenuBarContribution.AiMenuBarContainer],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
...{
|
|
17
|
+
[Ai_CHAT_CONTAINER_VIEW_ID]: {
|
|
18
|
+
modules: [Ai_CHAT_CONTAINER_VIEW_ID],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { SlotRenderer } from '@opensumi/ide-core-browser';
|
|
4
|
+
import { IChildComponentProps, SplitPanel, getStorageValue } from '@opensumi/ide-core-browser/lib/components';
|
|
5
|
+
|
|
6
|
+
import { Ai_CHAT_CONTAINER_VIEW_ID } from '../../../common';
|
|
7
|
+
|
|
8
|
+
export const AiMainSlotRenderer = (props?: IChildComponentProps) => {
|
|
9
|
+
const { colors, layout } = getStorageValue();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<SplitPanel
|
|
13
|
+
id='ai-native-main-horizontal-0'
|
|
14
|
+
flex={1}
|
|
15
|
+
className='ai_native_panel_container'
|
|
16
|
+
resizeHandleClassName='ai_native_slot_resize_horizontal'
|
|
17
|
+
>
|
|
18
|
+
<SplitPanel
|
|
19
|
+
id='ai-native-main-horizontal-1'
|
|
20
|
+
flex={1}
|
|
21
|
+
flexGrow={1}
|
|
22
|
+
resizeHandleClassName='ai_native_slot_resize_horizontal'
|
|
23
|
+
>
|
|
24
|
+
<SlotRenderer
|
|
25
|
+
backgroundColor={colors.sideBarBackground}
|
|
26
|
+
slot='left'
|
|
27
|
+
isTabbar={true}
|
|
28
|
+
defaultSize={layout.left?.currentId ? layout.left?.size || 310 : 49}
|
|
29
|
+
minResize={280}
|
|
30
|
+
maxResize={480}
|
|
31
|
+
/>
|
|
32
|
+
<SplitPanel
|
|
33
|
+
id='main-vertical'
|
|
34
|
+
minResize={300}
|
|
35
|
+
flexGrow={1}
|
|
36
|
+
direction='top-to-bottom'
|
|
37
|
+
className='ai_native_slot_main'
|
|
38
|
+
resizeHandleClassName='ai_native_slot_resize_horizontal'
|
|
39
|
+
>
|
|
40
|
+
<SlotRenderer backgroundColor={colors.editorBackground} flex={2} flexGrow={1} minResize={200} slot='main' />
|
|
41
|
+
<SlotRenderer
|
|
42
|
+
backgroundColor={colors.panelBackground}
|
|
43
|
+
flex={1}
|
|
44
|
+
defaultSize={layout.bottom?.size}
|
|
45
|
+
minResize={160}
|
|
46
|
+
slot='bottom'
|
|
47
|
+
isTabbar={true}
|
|
48
|
+
/>
|
|
49
|
+
</SplitPanel>
|
|
50
|
+
<SlotRenderer slot='right' isTabbar={true} defaultSize={0} maxResize={480} minResize={280} minSize={0} />
|
|
51
|
+
</SplitPanel>
|
|
52
|
+
<SlotRenderer
|
|
53
|
+
slot={Ai_CHAT_CONTAINER_VIEW_ID}
|
|
54
|
+
isTabbar={true}
|
|
55
|
+
defaultSize={420}
|
|
56
|
+
maxResize={480}
|
|
57
|
+
minResize={280}
|
|
58
|
+
minSize={0}
|
|
59
|
+
/>
|
|
60
|
+
</SplitPanel>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
import { Injectable } from '@opensumi/di';
|
|
3
|
+
import { ComponentContribution, ComponentRegistry, Domain, getExternalIcon } from '@opensumi/ide-core-browser';
|
|
4
|
+
import { IMenuRegistry, MenuContribution, MenuId } from '@opensumi/ide-core-browser/lib/menu/next';
|
|
5
|
+
|
|
6
|
+
import { AiMenuBarView } from './menu-bar.view';
|
|
7
|
+
|
|
8
|
+
@Injectable()
|
|
9
|
+
@Domain(ComponentContribution, MenuContribution)
|
|
10
|
+
export class AiMenuBarContribution implements ComponentContribution, MenuContribution {
|
|
11
|
+
static AiMenuBarContainer = 'ai-menubar';
|
|
12
|
+
|
|
13
|
+
registerComponent(registry: ComponentRegistry): void {
|
|
14
|
+
registry.register(AiMenuBarContribution.AiMenuBarContainer, {
|
|
15
|
+
component: AiMenuBarView,
|
|
16
|
+
id: AiMenuBarContribution.AiMenuBarContainer,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
registerMenus(menus: IMenuRegistry): void {
|
|
21
|
+
menus.registerMenuItems(MenuId.IconMenubarContext, [
|
|
22
|
+
{
|
|
23
|
+
command: 'main-layout.left-panel.toggle',
|
|
24
|
+
iconClass: getExternalIcon('layout-sidebar-left-off'),
|
|
25
|
+
},
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.menu_bar_view {
|
|
2
|
+
display: flex;
|
|
3
|
+
background-color: var(--kt-menubar-background);
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: 100%;
|
|
6
|
+
|
|
7
|
+
.container {
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
width: inherit;
|
|
11
|
+
align-items: center;
|
|
12
|
+
padding: 0 16px;
|
|
13
|
+
|
|
14
|
+
.center {
|
|
15
|
+
.run {
|
|
16
|
+
.btn {
|
|
17
|
+
background-color: rgba(4, 74, 16, 0.6);
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
color: rgba(215, 219, 222, 1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.right {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
|
|
28
|
+
.input {
|
|
29
|
+
margin-right: 16px;
|
|
30
|
+
width: 240px;
|
|
31
|
+
|
|
32
|
+
.input_wrapper {
|
|
33
|
+
height: 32px;
|
|
34
|
+
background-color: #ffffff1f;
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
border: 1px solid #ffffff1f;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Avatar } from 'react-chat-elements';
|
|
3
|
+
|
|
4
|
+
import { AppConfig, getIcon, useInjectable } from '@opensumi/ide-core-browser';
|
|
5
|
+
import { Button, Icon, Input } from '@opensumi/ide-core-browser/lib/components';
|
|
6
|
+
import { LAYOUT_VIEW_SIZE } from '@opensumi/ide-core-browser/lib/layout/constants';
|
|
7
|
+
import { VIEW_CONTAINERS } from '@opensumi/ide-core-browser/lib/layout/view-id';
|
|
8
|
+
import { CommandService } from '@opensumi/ide-core-common';
|
|
9
|
+
import { IconMenuBar } from '@opensumi/ide-menu-bar/lib/browser/menu-bar.view';
|
|
10
|
+
|
|
11
|
+
import { AI_RUN_DEBUG_COMMANDS } from '../../../../common/command';
|
|
12
|
+
|
|
13
|
+
import * as styles from './menu-bar.module.less';
|
|
14
|
+
|
|
15
|
+
export const AiMenuBarView = () => {
|
|
16
|
+
const commandService = useInjectable<CommandService>(CommandService);
|
|
17
|
+
const appConfig = useInjectable<AppConfig>(AppConfig);
|
|
18
|
+
|
|
19
|
+
const [latestWidth, setLatestWidth] = React.useState<number>(0);
|
|
20
|
+
|
|
21
|
+
const handleRun = () => {
|
|
22
|
+
commandService.executeCommand(AI_RUN_DEBUG_COMMANDS.id);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const handleRightPanel = () => {
|
|
26
|
+
/**
|
|
27
|
+
* 这里先这样处理,暂时没找到原因
|
|
28
|
+
*/
|
|
29
|
+
const domID = 'ai_chat_panel';
|
|
30
|
+
const chatPanel = document.querySelector(`#${domID}`)?.parentElement?.parentElement;
|
|
31
|
+
|
|
32
|
+
if (chatPanel) {
|
|
33
|
+
let preWidth: number | string = chatPanel.style.width;
|
|
34
|
+
preWidth = parseInt(preWidth, 10);
|
|
35
|
+
setLatestWidth(preWidth);
|
|
36
|
+
|
|
37
|
+
if (preWidth !== 0) {
|
|
38
|
+
chatPanel.style.width = '0px';
|
|
39
|
+
} else {
|
|
40
|
+
chatPanel.style.width = latestWidth + 'px';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const MENUBAR_HEIGHT = React.useMemo(
|
|
46
|
+
() => appConfig.layoutViewSize?.MENUBAR_HEIGHT || LAYOUT_VIEW_SIZE.MENUBAR_HEIGHT,
|
|
47
|
+
[appConfig],
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// quick-open-overlay
|
|
51
|
+
return (
|
|
52
|
+
<div id={VIEW_CONTAINERS.MENUBAR} className={styles.menu_bar_view} style={{ height: MENUBAR_HEIGHT }}>
|
|
53
|
+
{/* <span className={styles.menu_bar_logo} /> */}
|
|
54
|
+
<div className={styles.container}>
|
|
55
|
+
<div className={styles.left}>
|
|
56
|
+
<IconMenuBar />
|
|
57
|
+
</div>
|
|
58
|
+
<div className={styles.center}>
|
|
59
|
+
<div className={styles.run}>
|
|
60
|
+
<Button size={'large'} onClick={handleRun} className={styles.btn}>
|
|
61
|
+
<Icon className={getIcon('caret-right')} /> 运行
|
|
62
|
+
</Button>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div className={styles.right}>
|
|
66
|
+
<div className={styles.input}>
|
|
67
|
+
<Input
|
|
68
|
+
className={styles.input_wrapper}
|
|
69
|
+
width={'100%'}
|
|
70
|
+
addonBefore={<Icon style={{ color: '#ffffff1f' }} className={getIcon('search')} />}
|
|
71
|
+
placeholder='请搜索并选择指令'
|
|
72
|
+
// onFocus={handleSelectFocus}
|
|
73
|
+
></Input>
|
|
74
|
+
</div>
|
|
75
|
+
<div className={styles.ai_switch}>
|
|
76
|
+
{/* <Icon className={getIcon('search')} onClick={handleRightPanel}/> */}
|
|
77
|
+
<div
|
|
78
|
+
style={{
|
|
79
|
+
cursor: 'pointer',
|
|
80
|
+
}}
|
|
81
|
+
onClick={handleRightPanel}
|
|
82
|
+
>
|
|
83
|
+
<Avatar
|
|
84
|
+
src={'https://mdn.alipayobjects.com/huamei_htww6h/afts/img/A*6Y9PQp_rk7QAAAAAAAAAAAAADhl8AQ/original'}
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import clsx from 'classnames';
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
|
|
4
|
+
import { ComponentRegistryInfo, SlotLocation, useInjectable } from '@opensumi/ide-core-browser';
|
|
5
|
+
import { VIEW_CONTAINERS } from '@opensumi/ide-core-browser/lib/layout/view-id';
|
|
6
|
+
import { LeftTabbarRenderer, splitVisibleTabs } from '@opensumi/ide-main-layout/lib/browser/tabbar/bar.view';
|
|
7
|
+
import {
|
|
8
|
+
BaseTabPanelView,
|
|
9
|
+
ContainerView,
|
|
10
|
+
LeftTabPanelRenderer,
|
|
11
|
+
RightTabPanelRenderer,
|
|
12
|
+
} from '@opensumi/ide-main-layout/lib/browser/tabbar/panel.view';
|
|
13
|
+
import { TabRendererBase, TabbarConfig } from '@opensumi/ide-main-layout/lib/browser/tabbar/renderer.view';
|
|
14
|
+
import { TabbarService, TabbarServiceFactory } from '@opensumi/ide-main-layout/lib/browser/tabbar/tabbar.service';
|
|
15
|
+
|
|
16
|
+
import { Ai_CHAT_CONTAINER_VIEW_ID } from '../../../common';
|
|
17
|
+
import { HorizontalVertical } from '../../components/lineVertical';
|
|
18
|
+
|
|
19
|
+
// 将注册在 right bar 的组件渲染到 left bar
|
|
20
|
+
export const AiLeftTabbarRenderer: React.FC = () => {
|
|
21
|
+
const tabbarService: TabbarService = useInjectable(TabbarServiceFactory)(SlotLocation.right);
|
|
22
|
+
|
|
23
|
+
const renderOtherVisibleContainers = useCallback(
|
|
24
|
+
({ props, renderContainers }) => {
|
|
25
|
+
const { currentContainerId, handleTabClick } = tabbarService;
|
|
26
|
+
const visibleContainers = tabbarService.visibleContainers.filter((container) => !container.options?.hideTab);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<HorizontalVertical />
|
|
31
|
+
{visibleContainers.map((component) => renderContainers(component, handleTabClick, currentContainerId))}
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
[tabbarService],
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return <LeftTabbarRenderer renderOtherVisibleContainers={renderOtherVisibleContainers} />;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const AiLeftTabRenderer = ({
|
|
42
|
+
className,
|
|
43
|
+
components,
|
|
44
|
+
}: {
|
|
45
|
+
className: string;
|
|
46
|
+
components: ComponentRegistryInfo[];
|
|
47
|
+
}) => (
|
|
48
|
+
<TabRendererBase
|
|
49
|
+
side='left'
|
|
50
|
+
direction='left-to-right'
|
|
51
|
+
id={VIEW_CONTAINERS.LEFT_TABBAR_PANEL}
|
|
52
|
+
className={clsx(className, 'left-slot')}
|
|
53
|
+
components={components}
|
|
54
|
+
TabbarView={AiLeftTabbarRenderer}
|
|
55
|
+
TabpanelView={LeftTabPanelRenderer}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// right 面板只保留 panel
|
|
60
|
+
export const AiRightTabRenderer = ({
|
|
61
|
+
className,
|
|
62
|
+
components,
|
|
63
|
+
}: {
|
|
64
|
+
className: string;
|
|
65
|
+
components: ComponentRegistryInfo[];
|
|
66
|
+
}) => (
|
|
67
|
+
<TabRendererBase
|
|
68
|
+
side='right'
|
|
69
|
+
direction='right-to-left'
|
|
70
|
+
id={VIEW_CONTAINERS.RIGHT_TABBAR_PANEL}
|
|
71
|
+
className={clsx(className, 'right-slot')}
|
|
72
|
+
components={components}
|
|
73
|
+
TabbarView={() => null}
|
|
74
|
+
TabpanelView={RightTabPanelRenderer}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
export const ChatTabPanelRenderer: React.FC = () => (
|
|
79
|
+
<BaseTabPanelView PanelView={ContainerView} currentContainerId={Ai_CHAT_CONTAINER_VIEW_ID} />
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
// ai_chat 面板
|
|
83
|
+
export const AiChatTabRenderer = ({
|
|
84
|
+
className,
|
|
85
|
+
components,
|
|
86
|
+
}: {
|
|
87
|
+
className: string;
|
|
88
|
+
components: ComponentRegistryInfo[];
|
|
89
|
+
}) => (
|
|
90
|
+
<TabRendererBase
|
|
91
|
+
side={Ai_CHAT_CONTAINER_VIEW_ID}
|
|
92
|
+
direction='right-to-left'
|
|
93
|
+
id={'ai_chat_panel'}
|
|
94
|
+
className={clsx(className, 'ai_chat-slot')}
|
|
95
|
+
components={components}
|
|
96
|
+
TabbarView={() => null}
|
|
97
|
+
TabpanelView={ChatTabPanelRenderer}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.ai_marker_node_icon_container {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
.ai_icon {
|
|
6
|
+
color: #ffcc00;
|
|
7
|
+
display: none !important;
|
|
8
|
+
margin-right: 4px;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ai_editor_tab_block_container {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
height: 28px;
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
padding: 0 8px;
|
|
18
|
+
|
|
19
|
+
&.active {
|
|
20
|
+
background-color: var(--tab-activeBackground);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
div:first-child {
|
|
24
|
+
margin-right: 5px;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
flex-grow: 0;
|
|
27
|
+
&::before {
|
|
28
|
+
background-size: 14px;
|
|
29
|
+
background-position: 2px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|