@gitlab/ui 104.2.0 → 105.0.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/CHANGELOG.md +13 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +0 -5
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +1 -3
- package/src/index.js +0 -5
- package/src/scss/components.scss +0 -3
- package/translations.js +0 -57
- package/dist/components/experimental/duo/chat/components/duo_chat_context/constants.js +0 -21
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.js +0 -159
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.js +0 -273
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_category_items.js +0 -77
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_item.js +0 -89
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.js +0 -147
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items_loading.js +0 -61
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.js +0 -137
- package/dist/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.js +0 -163
- package/dist/components/experimental/duo/chat/components/duo_chat_context/mock_context_data.js +0 -308
- package/dist/components/experimental/duo/chat/components/duo_chat_context/utils.js +0 -140
- package/dist/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.js +0 -109
- package/dist/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.js +0 -111
- package/dist/components/experimental/duo/chat/components/duo_chat_message/buttons_utils.js +0 -33
- package/dist/components/experimental/duo/chat/components/duo_chat_message/constants.js +0 -14
- package/dist/components/experimental/duo/chat/components/duo_chat_message/copy_code_element.js +0 -24
- package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +0 -300
- package/dist/components/experimental/duo/chat/components/duo_chat_message/insert_code_snippet_element.js +0 -56
- package/dist/components/experimental/duo/chat/components/duo_chat_message/utils.js +0 -17
- package/dist/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.js +0 -115
- package/dist/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.js +0 -72
- package/dist/components/experimental/duo/chat/constants.js +0 -35
- package/dist/components/experimental/duo/chat/duo_chat.js +0 -553
- package/dist/components/experimental/duo/chat/markdown_renderer.js +0 -25
- package/dist/components/experimental/duo/chat/mock_data.js +0 -170
- package/dist/components/experimental/duo/user_feedback/user_feedback.js +0 -106
- package/dist/components/experimental/duo/user_feedback/user_feedback_modal.js +0 -154
- package/dist/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.js +0 -106
- package/dist/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.js +0 -246
- package/src/components/experimental/duo/chat/components/duo_chat_context/constants.js +0 -21
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.vue +0 -182
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.md +0 -44
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.vue +0 -288
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_category_items.vue +0 -54
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_item.vue +0 -86
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.vue +0 -168
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items_loading.vue +0 -43
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.vue +0 -170
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.vue +0 -196
- package/src/components/experimental/duo/chat/components/duo_chat_context/mock_context_data.js +0 -362
- package/src/components/experimental/duo/chat/components/duo_chat_context/utils.js +0 -169
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.md +0 -27
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.vue +0 -99
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.md +0 -10
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.scss +0 -44
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.vue +0 -112
- package/src/components/experimental/duo/chat/components/duo_chat_message/buttons_utils.js +0 -39
- package/src/components/experimental/duo/chat/components/duo_chat_message/constants.js +0 -12
- package/src/components/experimental/duo/chat/components/duo_chat_message/copy_code_element.js +0 -24
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.md +0 -69
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +0 -105
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +0 -363
- package/src/components/experimental/duo/chat/components/duo_chat_message/insert_code_snippet_element.js +0 -51
- package/src/components/experimental/duo/chat/components/duo_chat_message/utils.js +0 -18
- package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.md +0 -10
- package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.vue +0 -91
- package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.md +0 -10
- package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.vue +0 -45
- package/src/components/experimental/duo/chat/constants.js +0 -37
- package/src/components/experimental/duo/chat/duo_chat.md +0 -202
- package/src/components/experimental/duo/chat/duo_chat.scss +0 -413
- package/src/components/experimental/duo/chat/duo_chat.vue +0 -751
- package/src/components/experimental/duo/chat/markdown_renderer.js +0 -29
- package/src/components/experimental/duo/chat/mock_data.js +0 -187
- package/src/components/experimental/duo/chat/variables.scss +0 -9
- package/src/components/experimental/duo/user_feedback/user_feedback.md +0 -90
- package/src/components/experimental/duo/user_feedback/user_feedback.vue +0 -95
- package/src/components/experimental/duo/user_feedback/user_feedback_modal.vue +0 -167
- package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.md +0 -42
- package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.vue +0 -96
- package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.md +0 -46
- package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.vue +0 -270
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
This component has been migrated to the Duo-UI library (https://gitlab.com/gitlab-org/duo-ui).
|
|
3
|
-
|
|
4
|
-
Please use the corresponding component in Duo-UI going forward.
|
|
5
|
-
All future development and maintenance for Duo components should take place in Duo-UI.
|
|
6
|
-
|
|
7
|
-
For more details, see the migration epic: https://gitlab.com/groups/gitlab-org/-/epics/15344 or reach out to the Duo-Chat team in #g_duo_chat.
|
|
8
|
-
-->
|
|
9
|
-
The component represents the complete Duo Chat feature.
|
|
10
|
-
|
|
11
|
-
The component provides a configurable chat UI interface. The primary use is communication with
|
|
12
|
-
GitLab Duo, however, the component is BE-agnostic and can accept information from any source.
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
To use the component in its simplest form, import it and add it to the `template` part of your
|
|
17
|
-
consumer component.
|
|
18
|
-
|
|
19
|
-
```html
|
|
20
|
-
<gl-duo-chat
|
|
21
|
-
:title="title"
|
|
22
|
-
:messages="messages"
|
|
23
|
-
:error="error"
|
|
24
|
-
:is-loading="isLoading"
|
|
25
|
-
:is-chat-available="isChatAvailable"
|
|
26
|
-
:predefined-prompts="predefinedPrompts"
|
|
27
|
-
:badge-help-page-url="badgeHelpPageUrl"
|
|
28
|
-
:canceled-request-ids="cancelledRequestIds"
|
|
29
|
-
:tool-name="toolName"
|
|
30
|
-
:empty-state-title="emptyStateTitle"
|
|
31
|
-
:empty-state-description="emptyStateDescription"
|
|
32
|
-
:chat-prompt-placeholder="chatPromptPlaceholder"
|
|
33
|
-
:slash-commands="slashCommands"
|
|
34
|
-
@chat-hidden="onChatHidden"
|
|
35
|
-
@send-chat-prompt="onSendChatPrompt"
|
|
36
|
-
@track-feedback="onTrackFeedback"
|
|
37
|
-
/>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Integration
|
|
41
|
-
|
|
42
|
-
To demonstrate how to connect this component to a backend implementation, let's consider its use
|
|
43
|
-
for GitLab Duo. First, some general notes on the best practices and expectations when using this
|
|
44
|
-
component.
|
|
45
|
-
|
|
46
|
-
### Expected dependency injection
|
|
47
|
-
|
|
48
|
-
To be universal, the component delegates some of its responsibilities to the consumer component.
|
|
49
|
-
|
|
50
|
-
The component expects two function props:
|
|
51
|
-
|
|
52
|
-
- `renderMarkdown`
|
|
53
|
-
- `renderGFM`
|
|
54
|
-
|
|
55
|
-
#### `renderMarkdown`
|
|
56
|
-
|
|
57
|
-
This function prop converts plain Markdown text into HTML markup. To have a better understanding
|
|
58
|
-
of what is expected from this function, take a look at
|
|
59
|
-
[the existing GitLab example](https://gitlab.com/gitlab-org/gitlab/-/blob/774ecc1f2b15a581e8eab6441de33585c9691c82/app/assets/javascripts/notes/utils.js#L22-24).
|
|
60
|
-
|
|
61
|
-
#### `renderGFM`
|
|
62
|
-
|
|
63
|
-
This function prop extends the standard Markdown rendering with support for the
|
|
64
|
-
[GitLab Flavored Markdown (GLFM)](https://docs.gitlab.com/ee/user/markdown.html). To
|
|
65
|
-
have a better understanding of what is expected from this function, take a look at
|
|
66
|
-
[the existing GitLab example](https://gitlab.com/gitlab-org/gitlab/-/blob/774ecc1f2b15a581e8eab6441de33585c9691c82/app/assets/javascripts/behaviors/markdown/render_gfm.js#L18-40).
|
|
67
|
-
|
|
68
|
-
The reason to have two different functions for rendering Markdown is performance. `renderGFM`
|
|
69
|
-
operates on a DOM node and might come with many additional mutations for the node's content.
|
|
70
|
-
Such behavior suits a one-time update. However, Duo Chat also supports streaming of the AI
|
|
71
|
-
responses (check the [Interactive story for this component](?path=/story/experimental-duo-chat-duo-chat--interactive))
|
|
72
|
-
and, in this case, when the message is constantly updating, we rely on a more lightweight
|
|
73
|
-
`renderMarkdown` to render the updated message faster.
|
|
74
|
-
|
|
75
|
-
### Don't use reactivity where unnecessary
|
|
76
|
-
|
|
77
|
-
The `GlDuoChat` component exposes many properties, as seen below. But not all of those should
|
|
78
|
-
be necessarily reactive in the consumer component. The properties that might be static:
|
|
79
|
-
|
|
80
|
-
- `title`. The title is shown in the head of the component.
|
|
81
|
-
- `isChatAvailable`. The flag indicates whether the communication interface should allow follow-up
|
|
82
|
-
questions. Usually, this decision stays the same during the component's lifecycle.
|
|
83
|
-
- `predefinedPrompts`. The `Array` of strings that represents the possible questions to ask when
|
|
84
|
-
there are no messages in the chat.
|
|
85
|
-
- `badgeHelpPageUrl`. The link to an external page explaining the meaning of an "experiment".
|
|
86
|
-
The prop is passed down to the [`GlExperimentBadge` component](?path=/docs/experimental-experiment-badge--docs).
|
|
87
|
-
- `emptyStateTitle`. Title of the empty state component. Visible when there are no messages.
|
|
88
|
-
- `emptyStateDescription`. Description text of the empty state component. Visible when there are no messages.
|
|
89
|
-
- `chatPromptPlaceholder`. Placeholder text for the chat prompt input.
|
|
90
|
-
|
|
91
|
-
### Set up communication with consumer
|
|
92
|
-
|
|
93
|
-
```javascript
|
|
94
|
-
import { GlDuoChat } from '@gitlab/ui';
|
|
95
|
-
|
|
96
|
-
export default {
|
|
97
|
-
...
|
|
98
|
-
data() {
|
|
99
|
-
return {
|
|
100
|
-
messages: [],
|
|
101
|
-
error: null,
|
|
102
|
-
isLoading: false,
|
|
103
|
-
toolName: '',
|
|
104
|
-
cancelledRequestIds: []
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
provide: {
|
|
108
|
-
renderMarkdown: (content) => {
|
|
109
|
-
// implementation of the `renderMarkdown` functionality
|
|
110
|
-
},
|
|
111
|
-
renderGFM: (el) => {
|
|
112
|
-
// implementation of the `renderGFM` functionality
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
beforeCreate() {
|
|
116
|
-
// Here, we set up our non-reactive properties if we must change the default values
|
|
117
|
-
this.title = 'Foo Bar';
|
|
118
|
-
this.isChatAvailable = true; // this is just an example. `true` is the default value
|
|
119
|
-
this.predefinedPrompts = ['How to …?', 'Where do I …?'];
|
|
120
|
-
this.badgeHelpPageUrl = 'https://dev.null';
|
|
121
|
-
this.emptyStateTitle = 'Ask anything';
|
|
122
|
-
this.emptyStateDescription = 'You will see the answers below';
|
|
123
|
-
this.chatPromptPlaceholder = 'Type your question here';
|
|
124
|
-
}
|
|
125
|
-
methods: {
|
|
126
|
-
onChatCancel() {
|
|
127
|
-
// pushing last requestId of messages to canceled Request Ids
|
|
128
|
-
this.cancelledRequestIds.push(this.messages[this.messages.length - 1].requestId);
|
|
129
|
-
this.isLoading = false;
|
|
130
|
-
},
|
|
131
|
-
onChatHidden() {
|
|
132
|
-
...
|
|
133
|
-
},
|
|
134
|
-
onSendChatPrompt(prompt = '') {
|
|
135
|
-
this.isLoading = true;
|
|
136
|
-
this.messages.push(constructUserMessage(prompt));
|
|
137
|
-
...
|
|
138
|
-
},
|
|
139
|
-
onTrackFeedback(feedbackObj = {}) {
|
|
140
|
-
...
|
|
141
|
-
},
|
|
142
|
-
onAiResponse(data) {
|
|
143
|
-
// check if requestId was not cancelled
|
|
144
|
-
if (requestId && !this.cancelledRequestIds.includes(data.requestId)) {
|
|
145
|
-
this.messages = data
|
|
146
|
-
}
|
|
147
|
-
…
|
|
148
|
-
this.isLoading = false;
|
|
149
|
-
},
|
|
150
|
-
onAiResponseError(error) {
|
|
151
|
-
this.error = error;
|
|
152
|
-
this.isLoading = false;
|
|
153
|
-
},
|
|
154
|
-
onToolNameChange(toolMessage) {
|
|
155
|
-
this.toolName = toolMessage.content;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
With this template in place, consumer is left with the following things to implement:
|
|
162
|
-
|
|
163
|
-
- Fetch `messages`. For Duo Chat, we rely on GraphQL query to get the cached
|
|
164
|
-
messages and subscription to monitor new messages when:
|
|
165
|
-
|
|
166
|
-
- streaming response
|
|
167
|
-
- listening to chat messages in other tabs/environments
|
|
168
|
-
- listen to updates from different tools to update `toolName`
|
|
169
|
-
|
|
170
|
-
- Send the new user's prompt. For Duo Chat, we rely on GraphQL mutation for this purpose.
|
|
171
|
-
- Send user feedback to the telemetry of your choice when `track-feedback` event arrives.
|
|
172
|
-
|
|
173
|
-
## Slash commands
|
|
174
|
-
|
|
175
|
-
One of the props accepted by the component is the `slashCommands`. This is an `Array` of
|
|
176
|
-
the commands, shown to user when they start typing the prompt with a slash (`/`)
|
|
177
|
-
character.
|
|
178
|
-
|
|
179
|
-
```javascript
|
|
180
|
-
<script>
|
|
181
|
-
const slashCommands = [
|
|
182
|
-
{
|
|
183
|
-
name: '/mycommand', // This is the exact name of my command as it will be submitted
|
|
184
|
-
shouldSubmit: true, // If the command should be submitted right away without free text
|
|
185
|
-
description: 'The description of my super-duper command.',
|
|
186
|
-
},
|
|
187
|
-
...
|
|
188
|
-
];
|
|
189
|
-
export default {
|
|
190
|
-
...
|
|
191
|
-
options: {
|
|
192
|
-
slashCommands
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
<script>
|
|
196
|
-
<template>
|
|
197
|
-
<gl-duo-chat
|
|
198
|
-
...
|
|
199
|
-
:slash-commands="slashCommands"
|
|
200
|
-
/>
|
|
201
|
-
</template>
|
|
202
|
-
```
|
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component has been migrated to the Duo-UI library (https://gitlab.com/gitlab-org/duo-ui).
|
|
3
|
-
*
|
|
4
|
-
* Please use the corresponding component in Duo-UI going forward.
|
|
5
|
-
* All future development and maintenance for Duo components should take place in Duo-UI.
|
|
6
|
-
*
|
|
7
|
-
* For more details, see the migration epic: https://gitlab.com/groups/gitlab-org/-/epics/15344 or reach out to the Duo-Chat team in #g_duo_chat.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
@import 'variables';
|
|
11
|
-
|
|
12
|
-
.duo-chat {
|
|
13
|
-
z-index: 999;
|
|
14
|
-
|
|
15
|
-
.message-enter-active,
|
|
16
|
-
.message-leave-active {
|
|
17
|
-
transition: all 0.5s ease;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.message-enter,
|
|
21
|
-
.message-leave-to {
|
|
22
|
-
@apply gl-opacity-0;
|
|
23
|
-
transform: translateY(10px);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.duo-chat-loader.message-leave,
|
|
27
|
-
.duo-chat-loader.message-leave-to {
|
|
28
|
-
transition: none;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.duo-chat-drawer-body-scrim-on-footer {
|
|
32
|
-
&::before {
|
|
33
|
-
background: $duo-chat-scrim-gradient;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.duo-chat-drawer-body {
|
|
38
|
-
overflow-y: auto;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.duo-chat-drawer-header,
|
|
42
|
-
.duo-chat-drawer-body > * {
|
|
43
|
-
@apply gl-p-5;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.duo-chat-drawer {
|
|
48
|
-
right: 0;
|
|
49
|
-
@apply gl-transition-all;
|
|
50
|
-
position: fixed;
|
|
51
|
-
@apply gl-h-full;
|
|
52
|
-
@apply gl-w-full;
|
|
53
|
-
@apply gl-overflow-y-auto;
|
|
54
|
-
@apply gl-shadow-lg;
|
|
55
|
-
@apply gl-text-base;
|
|
56
|
-
@apply gl-leading-normal;
|
|
57
|
-
@apply gl-flex;
|
|
58
|
-
@apply gl-flex-col;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.duo-chat-drawer-header {
|
|
62
|
-
@apply gl-border-b;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.duo-chat-drawer-header-sticky {
|
|
66
|
-
top: 0;
|
|
67
|
-
position: sticky;
|
|
68
|
-
@apply gl-border-b;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.duo-chat-drawer-body {
|
|
72
|
-
@apply gl-grow;
|
|
73
|
-
// prevent safari bug where box shadow is visible
|
|
74
|
-
// above the drawer when hovering interactive elements
|
|
75
|
-
// see https://gitlab.com/gitlab-org/gitlab/-/issues/366558
|
|
76
|
-
background-color: inherit;
|
|
77
|
-
// prevent scroll behind the chat
|
|
78
|
-
overscroll-behavior: contain;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.duo-chat-drawer-footer {
|
|
82
|
-
@apply gl-border-t;
|
|
83
|
-
@apply gl-p-5;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.duo-chat-drawer-footer-sticky {
|
|
87
|
-
@apply gl-bg-white;
|
|
88
|
-
bottom: 0;
|
|
89
|
-
position: sticky;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.duo-chat-drawer-body-scrim-on-footer {
|
|
93
|
-
&::before {
|
|
94
|
-
background: $duo-chat-scrim-gradient;
|
|
95
|
-
top: 0;
|
|
96
|
-
@apply -gl-translate-y-full;
|
|
97
|
-
content: '';
|
|
98
|
-
left: 0;
|
|
99
|
-
position: absolute;
|
|
100
|
-
@apply gl-pointer-events-none;
|
|
101
|
-
@apply gl-w-full;
|
|
102
|
-
@apply gl-h-5;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.duo-chat-history {
|
|
107
|
-
scroll-behavior: smooth;
|
|
108
|
-
|
|
109
|
-
&.force-scroll-bar {
|
|
110
|
-
min-height: calc(100% + 1rem);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/*
|
|
114
|
-
Browsers a are pretty good at keeping the focus on an element while
|
|
115
|
-
the parent element grows in size. With this we mark all child elements
|
|
116
|
-
of the chat history as "non" anchors.
|
|
117
|
-
https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-anchor
|
|
118
|
-
*/
|
|
119
|
-
* {
|
|
120
|
-
overflow-anchor: none;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/*
|
|
124
|
-
Right at the bottom of the chat history we add a scroll-anchor element.
|
|
125
|
-
This scroll-anchor element is the only "possible" anchor. The beauty of it:
|
|
126
|
-
It only will be used as an anchor _if_ it is currently inside the view port.
|
|
127
|
-
So if the user manually scrolls up while a chunked message is coming in,
|
|
128
|
-
it won't stick to the bottom while the message still loads.
|
|
129
|
-
*/
|
|
130
|
-
.scroll-anchor {
|
|
131
|
-
overflow-anchor: auto;
|
|
132
|
-
height: 1px;
|
|
133
|
-
margin-top: -1px; // In order to not add 1px vertically, we add a negative margin
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.duo-chat-input {
|
|
138
|
-
@apply gl-flex;
|
|
139
|
-
@apply gl-flex-col;
|
|
140
|
-
max-height: 240px;
|
|
141
|
-
overflow: hidden;
|
|
142
|
-
background: var(--gl-control-background-color-default);
|
|
143
|
-
box-shadow: inset 0 0 0 $gl-border-size-1 var(--gl-control-border-color-default);
|
|
144
|
-
border-radius: px-to-rem(20px);
|
|
145
|
-
|
|
146
|
-
&:focus-within {
|
|
147
|
-
@include gl-focus($color: var(--gl-control-border-color-focus));
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.gl-form-textarea.form-control {
|
|
151
|
-
flex: 1;
|
|
152
|
-
resize: none;
|
|
153
|
-
max-height: 240px;
|
|
154
|
-
padding-right: 40px;
|
|
155
|
-
border-radius: px-to-rem(20px);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
&::after {
|
|
159
|
-
content: attr(data-value) ' ';
|
|
160
|
-
@apply gl-invisible;
|
|
161
|
-
@apply gl-p-4;
|
|
162
|
-
@apply gl-font-regular;
|
|
163
|
-
padding-right: 40px;
|
|
164
|
-
word-break: break-word;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.slash-commands {
|
|
169
|
-
@apply -gl-mt-2;
|
|
170
|
-
|
|
171
|
-
.active-command {
|
|
172
|
-
@apply gl-bg-gray-50;
|
|
173
|
-
@apply gl-rounded-base;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.gl-dropdown-item button.dropdown-item {
|
|
177
|
-
@apply gl-text-sm;
|
|
178
|
-
@apply gl-px-3;
|
|
179
|
-
@apply gl-bg-transparent;
|
|
180
|
-
|
|
181
|
-
&:hover {
|
|
182
|
-
@apply gl-bg-transparent;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
// TODO this is techdebt from: https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/3953#note_1762834219
|
|
187
|
-
// once this file is migrated to Duo-UI we need to remove these styles as a markdown fallback
|
|
188
|
-
// and make sure all host-system provide markdown renderer
|
|
189
|
-
.duo-chat-markdown {
|
|
190
|
-
@apply gl-text-lg;
|
|
191
|
-
@apply gl-leading-24;
|
|
192
|
-
color: $gl-text-color;
|
|
193
|
-
@apply gl-font-regular;
|
|
194
|
-
@apply gl-font-normal;
|
|
195
|
-
|
|
196
|
-
:first-child {
|
|
197
|
-
@apply gl-mt-0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
h1,
|
|
201
|
-
.gl-h1 {
|
|
202
|
-
@apply gl-heading-1;
|
|
203
|
-
@apply gl-mt-7;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
h2,
|
|
207
|
-
.gl-h2 {
|
|
208
|
-
@apply gl-heading-2;
|
|
209
|
-
@apply gl-mt-6;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
h3,
|
|
213
|
-
.gl-h3 {
|
|
214
|
-
@apply gl-heading-3;
|
|
215
|
-
@apply gl-mt-6;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
h4,
|
|
219
|
-
.gl-h4 {
|
|
220
|
-
@apply gl-heading-4;
|
|
221
|
-
@apply gl-mt-5;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
h5,
|
|
225
|
-
.gl-h5 {
|
|
226
|
-
@apply gl-heading-5;
|
|
227
|
-
@apply gl-mt-5;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
h6,
|
|
231
|
-
.gl-h6 {
|
|
232
|
-
@apply gl-heading-6;
|
|
233
|
-
@apply gl-mt-5;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
p,
|
|
237
|
-
.gl-paragraph {
|
|
238
|
-
@apply gl-mt-0;
|
|
239
|
-
@apply gl-mb-0;
|
|
240
|
-
|
|
241
|
-
+ p,
|
|
242
|
-
+ .gl-paragraph {
|
|
243
|
-
@apply gl-mt-5;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
&.sm {
|
|
247
|
-
font-size: $gl-font-size-markdown-sm;
|
|
248
|
-
@apply gl-leading-20;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.sm {
|
|
253
|
-
font-size: $gl-font-size-markdown-sm;
|
|
254
|
-
@apply gl-leading-20;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.monospace,
|
|
258
|
-
code {
|
|
259
|
-
@apply gl-font-monospace;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
blockquote {
|
|
263
|
-
@apply gl-text-gray-700;
|
|
264
|
-
@apply gl-py-3;
|
|
265
|
-
@apply gl-pl-6;
|
|
266
|
-
@apply gl-my-3;
|
|
267
|
-
@apply gl-mx-0;
|
|
268
|
-
box-shadow: inset $gl-border-size-4 0 0 0 $gray-100;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.idiff {
|
|
272
|
-
@apply gl-rounded-base;
|
|
273
|
-
@apply gl-inline-flex;
|
|
274
|
-
@apply gl-px-2;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.deletion {
|
|
278
|
-
@apply gl-bg-red-100;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.addition {
|
|
282
|
-
@apply gl-bg-green-100;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
code {
|
|
286
|
-
@apply gl-rounded-base;
|
|
287
|
-
@apply gl-bg-gray-50;
|
|
288
|
-
@apply gl-text-gray-950;
|
|
289
|
-
@apply gl-px-2;
|
|
290
|
-
@apply gl-py-1;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
pre {
|
|
294
|
-
@apply gl-rounded-base;
|
|
295
|
-
@apply gl-py-3;
|
|
296
|
-
@apply gl-px-4;
|
|
297
|
-
box-shadow: inset 0 0 0 $gl-border-size-1 $gray-100;
|
|
298
|
-
@apply gl-my-7;
|
|
299
|
-
@apply gl-overflow-auto;
|
|
300
|
-
|
|
301
|
-
code {
|
|
302
|
-
@apply gl-bg-white;
|
|
303
|
-
@apply gl-rounded-none;
|
|
304
|
-
@apply gl-text-gray-900;
|
|
305
|
-
@apply gl-p-0;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.audio-container {
|
|
310
|
-
@apply gl-inline-flex;
|
|
311
|
-
@apply gl-flex-col;
|
|
312
|
-
@apply gl-w-full;
|
|
313
|
-
|
|
314
|
-
audio {
|
|
315
|
-
@apply gl-w-full;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
a {
|
|
319
|
-
@apply gl-mt-3;
|
|
320
|
-
|
|
321
|
-
&::before {
|
|
322
|
-
@apply gl-mr-2;
|
|
323
|
-
text-rendering: auto;
|
|
324
|
-
-webkit-font-smoothing: antialiased;
|
|
325
|
-
content: '📎';
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
table {
|
|
331
|
-
@apply gl-my-7;
|
|
332
|
-
|
|
333
|
-
th,
|
|
334
|
-
td {
|
|
335
|
-
@apply gl-px-3;
|
|
336
|
-
@apply gl-py-4;
|
|
337
|
-
box-shadow: inset 0 -#{$gl-border-size-1} 0 0 $gray-100;
|
|
338
|
-
@apply gl-align-top;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
th {
|
|
342
|
-
box-shadow:
|
|
343
|
-
inset 0 #{$gl-border-size-1} 0 0 $gray-100,
|
|
344
|
-
inset 0 -#{$gl-border-size-1} 0 0 $gray-100;
|
|
345
|
-
@apply gl-font-bold;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
thead {
|
|
349
|
-
@apply gl-bg-gray-50;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
tr:nth-child(even) {
|
|
353
|
-
@apply gl-bg-gray-10;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.duo-chat-compact-markdown {
|
|
359
|
-
@apply gl-text-base;
|
|
360
|
-
@apply gl-leading-20;
|
|
361
|
-
|
|
362
|
-
h1,
|
|
363
|
-
.gl-h1 {
|
|
364
|
-
@apply gl-heading-1-fixed;
|
|
365
|
-
@apply gl-mt-7;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
h2,
|
|
369
|
-
.gl-h2 {
|
|
370
|
-
@apply gl-heading-2-fixed;
|
|
371
|
-
@apply gl-mt-6;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
h3,
|
|
375
|
-
.gl-h3 {
|
|
376
|
-
@apply gl-heading-3-fixed;
|
|
377
|
-
@apply gl-mt-6;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
h4,
|
|
381
|
-
.gl-h4 {
|
|
382
|
-
@apply gl-heading-4-fixed;
|
|
383
|
-
@apply gl-mt-5;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
h5,
|
|
387
|
-
.gl-h5 {
|
|
388
|
-
@apply gl-heading-5-fixed;
|
|
389
|
-
@apply gl-mt-5;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
h6,
|
|
393
|
-
.gl-h6 {
|
|
394
|
-
@apply gl-heading-6-fixed;
|
|
395
|
-
@apply gl-mt-5;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
.sm {
|
|
399
|
-
@apply gl-text-sm;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
.monospace,
|
|
403
|
-
code {
|
|
404
|
-
@apply gl-font-monospace;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
table {
|
|
408
|
-
th,
|
|
409
|
-
td {
|
|
410
|
-
@apply gl-py-3;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|