@gitlab/ui 93.0.0 → 93.2.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 +19 -0
- package/dist/components/base/alert/alert.js +1 -0
- package/dist/components/base/avatar/avatar.js +7 -1
- package/dist/components/base/datepicker/datepicker.js +3 -1
- package/dist/components/base/drawer/drawer.js +1 -0
- package/dist/components/base/form/form_fields/form_fields.js +3 -2
- package/dist/components/base/form/form_input/form_input.js +7 -1
- package/dist/components/base/form/form_select/form_select.js +7 -1
- package/dist/components/base/toast/toast.js +1 -0
- package/dist/components/base/token/token.js +1 -0
- package/dist/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.js +2 -1
- package/dist/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.js +4 -3
- package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +8 -8
- package/dist/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.js +7 -4
- package/dist/components/experimental/duo/chat/duo_chat.js +13 -12
- package/dist/index.css +3 -3
- package/dist/index.css.map +1 -1
- package/dist/tokens/build/js/tokens.dark.js +2 -1
- package/dist/tokens/build/js/tokens.js +2 -1
- package/dist/tokens/css/tokens.css +1 -0
- package/dist/tokens/css/tokens.dark.css +1 -0
- package/dist/tokens/js/tokens.dark.js +1 -0
- package/dist/tokens/js/tokens.js +1 -0
- package/dist/tokens/json/tokens.dark.json +22 -0
- package/dist/tokens/json/tokens.json +22 -0
- package/dist/tokens/scss/_tokens.dark.scss +1 -0
- package/dist/tokens/scss/_tokens.scss +1 -0
- package/dist/tokens/scss/_tokens_custom_properties.scss +1 -0
- package/dist/tokens/tailwind/tokens.cjs +1 -0
- package/dist/utils/set_utils.js +25 -0
- package/package.json +1 -1
- package/src/components/base/accordion/accordion_item.scss +1 -1
- package/src/components/base/alert/alert.scss +8 -8
- package/src/components/base/alert/alert.vue +1 -0
- package/src/components/base/avatar/avatar.scss +6 -6
- package/src/components/base/avatar/avatar.vue +4 -0
- package/src/components/base/avatar_labeled/avatar_labeled.scss +9 -9
- package/src/components/base/avatar_link/avatar_link.scss +6 -6
- package/src/components/base/avatars_inline/avatars_inline.scss +9 -9
- package/src/components/base/badge/badge.scss +6 -6
- package/src/components/base/banner/banner.scss +1 -1
- package/src/components/base/breadcrumb/breadcrumb.scss +8 -8
- package/src/components/base/broadcast_message/broadcast_message.scss +9 -9
- package/src/components/base/button/button.scss +18 -18
- package/src/components/base/card/card.scss +4 -4
- package/src/components/base/datepicker/datepicker.scss +14 -14
- package/src/components/base/datepicker/datepicker.vue +1 -0
- package/src/components/base/daterange_picker/daterange_picker.scss +7 -7
- package/src/components/base/drawer/drawer.scss +14 -14
- package/src/components/base/drawer/drawer.vue +1 -0
- package/src/components/base/dropdown/dropdown.scss +15 -15
- package/src/components/base/dropdown/dropdown_item.scss +15 -15
- package/src/components/base/dropdown/dropdown_section_header.scss +4 -4
- package/src/components/base/filtered_search/filtered_search.scss +9 -9
- package/src/components/base/filtered_search/filtered_search_suggestion.scss +2 -2
- package/src/components/base/filtered_search/filtered_search_suggestion_list.scss +2 -2
- package/src/components/base/filtered_search/filtered_search_token.scss +9 -9
- package/src/components/base/filtered_search/filtered_search_token_segment.scss +3 -3
- package/src/components/base/form/form_checkbox/form_checkbox.scss +10 -10
- package/src/components/base/form/form_fields/form_fields.vue +3 -2
- package/src/components/base/form/form_group/form_group.scss +6 -6
- package/src/components/base/form/form_input/form_input.scss +2 -2
- package/src/components/base/form/form_input/form_input.vue +3 -0
- package/src/components/base/form/form_radio_group/form_radio_group.scss +2 -2
- package/src/components/base/form/form_select/form_select.scss +3 -3
- package/src/components/base/form/form_select/form_select.vue +3 -0
- package/src/components/base/infinite_scroll/infinite_scroll.scss +2 -2
- package/src/components/base/label/label.scss +12 -12
- package/src/components/base/link/link.scss +1 -1
- package/src/components/base/loading_icon/loading_icon.scss +4 -4
- package/src/components/base/markdown/markdown.scss +14 -14
- package/src/components/base/modal/modal.scss +12 -12
- package/src/components/base/new_dropdowns/dropdown.scss +21 -17
- package/src/components/base/new_dropdowns/dropdown_item.scss +10 -10
- package/src/components/base/new_dropdowns/listbox/listbox.scss +4 -4
- package/src/components/base/pagination/pagination.scss +5 -5
- package/src/components/base/path/path.scss +11 -11
- package/src/components/base/popover/popover.scss +1 -1
- package/src/components/base/search_box_by_click/search_box_by_click.scss +5 -5
- package/src/components/base/search_box_by_type/search_box_by_type.scss +9 -9
- package/src/components/base/segmented_control/segmented_control.scss +4 -4
- package/src/components/base/table/table.scss +6 -6
- package/src/components/base/tabs/tabs/tabs.scss +18 -18
- package/src/components/base/toast/toast.js +1 -0
- package/src/components/base/toast/toast.scss +10 -10
- package/src/components/base/toggle/toggle.scss +17 -17
- package/src/components/base/token/token.scss +13 -13
- package/src/components/base/token/token.vue +1 -0
- package/src/components/base/tooltip/tooltip.scss +3 -3
- package/src/components/charts/legend/legend.scss +17 -17
- package/src/components/charts/series_label/series_label.scss +6 -6
- package/src/components/charts/single_stat/single_stat.scss +1 -1
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.md +10 -0
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.vue +2 -1
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.scss +1 -1
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.vue +12 -3
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +4 -4
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +20 -9
- package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.vue +5 -4
- package/src/components/experimental/duo/chat/duo_chat.scss +15 -15
- package/src/components/experimental/duo/chat/duo_chat.vue +43 -16
- package/src/components/shared_components/charts/tooltip_default_format.scss +5 -5
- package/src/scss/typescale/_index.scss +15 -15
- package/src/tokens/build/css/tokens.css +1 -0
- package/src/tokens/build/css/tokens.dark.css +1 -0
- package/src/tokens/build/js/tokens.dark.js +1 -0
- package/src/tokens/build/js/tokens.js +1 -0
- package/src/tokens/build/json/tokens.dark.json +22 -0
- package/src/tokens/build/json/tokens.json +22 -0
- package/src/tokens/build/scss/_tokens.dark.scss +1 -0
- package/src/tokens/build/scss/_tokens.scss +1 -0
- package/src/tokens/build/scss/_tokens_custom_properties.scss +1 -0
- package/src/tokens/build/tailwind/tokens.cjs +1 -0
- package/src/tokens/text.tokens.json +8 -0
- package/src/utils/set_utils.js +24 -0
- package/translations.js +33 -0
|
@@ -23,9 +23,9 @@ $toggle-translate-width: 2 * $grid-size;
|
|
|
23
23
|
$toggle-height: 2.5 * $grid-size;
|
|
24
24
|
|
|
25
25
|
.gl-toggle-wrapper {
|
|
26
|
-
@
|
|
27
|
-
@
|
|
28
|
-
@
|
|
26
|
+
@apply gl-leading-normal;
|
|
27
|
+
@apply gl-font-normal;
|
|
28
|
+
@apply gl-inline-flex;
|
|
29
29
|
|
|
30
30
|
&.is-disabled {
|
|
31
31
|
@include gl-cursor-not-allowed;
|
|
@@ -57,15 +57,15 @@ $toggle-height: 2.5 * $grid-size;
|
|
|
57
57
|
.gl-help-label {
|
|
58
58
|
@apply gl-mt-3;
|
|
59
59
|
@include gl-text-gray-500;
|
|
60
|
-
@
|
|
60
|
+
@apply gl-font-normal;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.gl-toggle-label-inline {
|
|
64
|
-
@
|
|
65
|
-
@
|
|
64
|
+
@apply gl-flex-row;
|
|
65
|
+
@apply gl-items-center;
|
|
66
66
|
|
|
67
67
|
.gl-toggle-label {
|
|
68
|
-
@
|
|
68
|
+
@apply gl-whitespace-nowrap;
|
|
69
69
|
@apply gl-mb-0;
|
|
70
70
|
@apply gl-mr-3;
|
|
71
71
|
}
|
|
@@ -77,13 +77,13 @@ $toggle-height: 2.5 * $grid-size;
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.gl-toggle-label {
|
|
80
|
-
@
|
|
80
|
+
@apply gl-font-bold;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.gl-toggle {
|
|
84
|
-
@
|
|
85
|
-
@
|
|
86
|
-
@
|
|
84
|
+
@apply gl-inline-flex;
|
|
85
|
+
@apply gl-items-center;
|
|
86
|
+
@apply gl-justify-center;
|
|
87
87
|
@apply gl-border-0;
|
|
88
88
|
@include gl-cursor-pointer;
|
|
89
89
|
@include gl-bg-gray-600;
|
|
@@ -94,12 +94,12 @@ $toggle-height: 2.5 * $grid-size;
|
|
|
94
94
|
user-select: none;
|
|
95
95
|
@include gl-rounded-pill;
|
|
96
96
|
@include gl-transition-slow;
|
|
97
|
-
@
|
|
97
|
+
@apply gl-leading-normal;
|
|
98
98
|
|
|
99
99
|
&::selection,
|
|
100
100
|
&::before::selection,
|
|
101
101
|
&::after::selection {
|
|
102
|
-
@
|
|
102
|
+
@apply gl-bg-transparent;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
&:hover,
|
|
@@ -123,12 +123,12 @@ $toggle-height: 2.5 * $grid-size;
|
|
|
123
123
|
@include gl-rounded-full;
|
|
124
124
|
@include gl-bg-white;
|
|
125
125
|
position: absolute;
|
|
126
|
-
@
|
|
127
|
-
@
|
|
126
|
+
@apply gl-inline-flex;
|
|
127
|
+
@apply gl-items-center;
|
|
128
128
|
left: $gl-spacing-scale-1;
|
|
129
129
|
top: $gl-spacing-scale-1;
|
|
130
|
-
@
|
|
131
|
-
@
|
|
130
|
+
@apply gl-transition-all;
|
|
131
|
+
@apply gl-justify-center;
|
|
132
132
|
@apply gl-p-1;
|
|
133
133
|
|
|
134
134
|
> svg {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
@include gl-bg-gray-100;
|
|
4
4
|
@include gl-rounded-small;
|
|
5
5
|
@apply gl-pl-3;
|
|
6
|
-
@
|
|
7
|
-
@
|
|
8
|
-
@
|
|
6
|
+
@apply gl-inline-flex;
|
|
7
|
+
@apply gl-flex-col;
|
|
8
|
+
@apply gl-justify-center;
|
|
9
9
|
|
|
10
10
|
&.gl-token-view-only {
|
|
11
11
|
@apply gl-py-2;
|
|
@@ -15,21 +15,21 @@
|
|
|
15
15
|
|
|
16
16
|
.gl-token-search-type-variant {
|
|
17
17
|
@include gl-bg-gray-100;
|
|
18
|
-
@
|
|
19
|
-
@
|
|
18
|
+
@apply gl-rounded-tr-none;
|
|
19
|
+
@apply gl-rounded-br-none;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.gl-token-search-value-variant {
|
|
23
|
-
@
|
|
24
|
-
@
|
|
23
|
+
@apply gl-rounded-tl-none;
|
|
24
|
+
@apply gl-rounded-bl-none;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.gl-token-content {
|
|
28
|
-
@
|
|
29
|
-
@
|
|
30
|
-
@
|
|
31
|
-
@
|
|
32
|
-
@
|
|
28
|
+
@apply gl-text-sm;
|
|
29
|
+
@apply gl-leading-normal;
|
|
30
|
+
@apply gl-flex;
|
|
31
|
+
@apply gl-items-center;
|
|
32
|
+
@apply gl-text-inherit;
|
|
33
33
|
|
|
34
34
|
> .gl-avatar:first-child,
|
|
35
35
|
> .gl-spinner-container:first-child {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
.gl-token-close {
|
|
41
41
|
@apply gl-ml-2;
|
|
42
|
-
@
|
|
42
|
+
@apply gl-text-inherit;
|
|
43
43
|
@include gl-cursor-pointer;
|
|
44
44
|
|
|
45
45
|
opacity: 0.8;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
.gl-tooltip {
|
|
2
|
-
@
|
|
2
|
+
@apply gl-text-sm;
|
|
3
3
|
@apply gl-p-2;
|
|
4
4
|
|
|
5
5
|
.tooltip-inner {
|
|
6
6
|
@apply gl-rounded-base;
|
|
7
|
-
@
|
|
8
|
-
@
|
|
7
|
+
@apply gl-leading-normal;
|
|
8
|
+
@apply gl-font-normal;
|
|
9
9
|
@apply gl-py-3;
|
|
10
10
|
@apply gl-px-4;
|
|
11
11
|
background: var(--gl-feedback-strong-background-color);
|
|
@@ -20,7 +20,7 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
|
|
|
20
20
|
background-image: linear-gradient(to bottom, $transparent-rgba, var(--white, #{$white}));
|
|
21
21
|
bottom: 0;
|
|
22
22
|
content: '';
|
|
23
|
-
@
|
|
23
|
+
@apply gl-block;
|
|
24
24
|
@include gl-h-4;
|
|
25
25
|
position: absolute;
|
|
26
26
|
@include gl-w-full;
|
|
@@ -28,20 +28,20 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.gl-legend-inline {
|
|
31
|
-
@
|
|
31
|
+
@apply gl-flex;
|
|
32
32
|
@include gl-flex-wrap;
|
|
33
|
-
@
|
|
33
|
+
@apply gl-shrink-0;
|
|
34
34
|
|
|
35
35
|
.gl-legend-inline-series {
|
|
36
|
-
@
|
|
37
|
-
@
|
|
38
|
-
@
|
|
39
|
-
@
|
|
36
|
+
@apply gl-flex;
|
|
37
|
+
@apply gl-shrink-0;
|
|
38
|
+
@apply gl-justify-between;
|
|
39
|
+
@apply gl-items-center;
|
|
40
40
|
@apply gl-pr-5;
|
|
41
41
|
|
|
42
42
|
&:hover {
|
|
43
43
|
@include gl-cursor-pointer;
|
|
44
|
-
@
|
|
44
|
+
@apply gl-underline;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.gl-legend-inline-series-label {
|
|
@@ -52,22 +52,22 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
|
|
|
52
52
|
|
|
53
53
|
.gl-legend-tabular {
|
|
54
54
|
.gl-legend-tabular-header {
|
|
55
|
-
@
|
|
56
|
-
@
|
|
55
|
+
@apply gl-flex;
|
|
56
|
+
@apply gl-justify-end;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.gl-legend-tabular-header-cell,
|
|
60
60
|
.gl-legend-tabular-details-cell {
|
|
61
|
-
@
|
|
61
|
+
@apply gl-whitespace-nowrap;
|
|
62
62
|
@include gl-overflow-hidden;
|
|
63
|
-
@
|
|
63
|
+
@apply gl-text-ellipsis;
|
|
64
64
|
@include gl-text-right;
|
|
65
65
|
@include gl-w-eighth;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.gl-legend-tabular-header-cell {
|
|
69
|
-
@
|
|
70
|
-
@
|
|
69
|
+
@apply gl-font-bold;
|
|
70
|
+
@apply gl-leading-24;
|
|
71
71
|
@apply gl-px-3;
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -77,7 +77,7 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.gl-legend-tabular-row {
|
|
80
|
-
@
|
|
80
|
+
@apply gl-flex;
|
|
81
81
|
|
|
82
82
|
&:nth-child(odd) {
|
|
83
83
|
background-color: var(--gray-50, #{$gray-50});
|
|
@@ -86,12 +86,12 @@ $legend-body-h: $gl-spacing-scale-13 - $gl-spacing-scale-4;
|
|
|
86
86
|
|
|
87
87
|
.gl-legend-tabular-title-cell,
|
|
88
88
|
.gl-legend-tabular-details-cell {
|
|
89
|
-
@
|
|
89
|
+
@apply gl-leading-24;
|
|
90
90
|
@apply gl-px-3;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.gl-legend-tabular-title-cell {
|
|
94
94
|
@include gl-overflow-hidden;
|
|
95
|
-
@
|
|
95
|
+
@apply gl-w-1/2;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
.gl-series-label-container {
|
|
2
|
-
@
|
|
3
|
-
@
|
|
2
|
+
@apply gl-flex;
|
|
3
|
+
@apply gl-text-base;
|
|
4
4
|
@include gl-overflow-hidden;
|
|
5
|
-
@
|
|
5
|
+
@apply gl-break-words;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.gl-series-label-color {
|
|
9
|
-
@
|
|
9
|
+
@apply gl-shrink-0;
|
|
10
10
|
@apply gl-mr-3;
|
|
11
11
|
|
|
12
12
|
svg {
|
|
13
|
-
@
|
|
13
|
+
@apply gl-block;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
// as there are quite a few possible cases where
|
|
20
20
|
// Prometheus queries return long labels with no spaces.
|
|
21
21
|
@include gl-overflow-hidden;
|
|
22
|
-
@
|
|
22
|
+
@apply gl-break-words;
|
|
23
23
|
}
|
|
@@ -6,3 +6,13 @@ mark the beginning of the conversation.
|
|
|
6
6
|
```html
|
|
7
7
|
<gl-duo-chat-conversation :messages="messages" :show-delimeter="showDelimiter" />
|
|
8
8
|
```
|
|
9
|
+
|
|
10
|
+
Translations for newChatLabel can be set via the props as documented or via translation configuration:
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
setConfigs({
|
|
14
|
+
translations: {
|
|
15
|
+
'GlDuoWorkflowPrompt.newChat': __('New chat'),
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
```
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import GlDuoChatMessage from '../duo_chat_message/duo_chat_message.vue';
|
|
3
|
+
import { translate } from '../../../../../../utils/i18n';
|
|
3
4
|
|
|
4
5
|
const i18n = {
|
|
5
|
-
CONVERSATION_NEW_CHAT: 'New chat',
|
|
6
|
+
CONVERSATION_NEW_CHAT: translate('GlDuoChatConversation.newChat', 'New chat'),
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
const isMessage = (item) => Boolean(item) && item?.role;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { translate } from '../../../../../../utils/i18n';
|
|
2
3
|
import GlSprintf from '../../../../../utilities/sprintf/sprintf.vue';
|
|
3
4
|
import { LOADING_TRANSITION_DURATION } from '../../constants';
|
|
4
5
|
|
|
5
6
|
export const i18n = {
|
|
6
|
-
LOADER_LOADING_MESSAGE:
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
LOADER_LOADING_MESSAGE: translate(
|
|
8
|
+
'GlDuoChatLoader.loaderLoadingMessage',
|
|
9
|
+
'%{tool} is %{transition} an answer'
|
|
10
|
+
),
|
|
11
|
+
LOADER_LOADING_TRANSITIONS: [
|
|
12
|
+
translate('GlDuoChatLoader.loaderLoadingTransitionsFinding', 'finding'),
|
|
13
|
+
translate('GlDuoChatLoader.loaderLoadingTransitionsWorkingOn', 'working on'),
|
|
14
|
+
translate('GlDuoChatLoader.loaderLoadingTransitionsGenerating', 'generating'),
|
|
15
|
+
translate('GlDuoChatLoader.loaderLoadingTransitionsProducing', 'producing'),
|
|
16
|
+
],
|
|
17
|
+
GITLAB_DUO: translate('GlDuoChatLoader.gitlabDuo', 'GitLab Duo'),
|
|
9
18
|
};
|
|
10
19
|
|
|
11
20
|
export default {
|
package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
pre {
|
|
10
|
-
@
|
|
10
|
+
@apply gl-text-inherit;
|
|
11
11
|
padding: $gl-spacing-scale-3 $gl-spacing-scale-4;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
pre code {
|
|
15
|
-
@
|
|
16
|
-
@
|
|
15
|
+
@apply gl-text-sm;
|
|
16
|
+
@apply gl-leading-1;
|
|
17
17
|
@include gl-bg-transparent;
|
|
18
18
|
white-space: inherit;
|
|
19
19
|
}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
copy-code,
|
|
26
26
|
insert-code-snippet {
|
|
27
27
|
position: absolute;
|
|
28
|
-
@
|
|
28
|
+
@apply gl-transition-all;
|
|
29
29
|
@include gl-opacity-0;
|
|
30
30
|
right: $gl-spacing-scale-3;
|
|
31
31
|
top: $gl-spacing-scale-3;
|
package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue
CHANGED
|
@@ -7,8 +7,8 @@ import GlDuoUserFeedback from '../../../user_feedback/user_feedback.vue';
|
|
|
7
7
|
import GlFormGroup from '../../../../../base/form/form_group/form_group.vue';
|
|
8
8
|
import GlFormTextarea from '../../../../../base/form/form_textarea/form_textarea.vue';
|
|
9
9
|
import { SafeHtmlDirective as SafeHtml } from '../../../../../../directives/safe_html/safe_html';
|
|
10
|
-
import { sprintf, translatePlural } from '../../../../../../utils/i18n';
|
|
11
10
|
import { MESSAGE_MODEL_ROLES, SELECTED_CONTEXT_ITEMS_DEFAULT_COLLAPSED } from '../../constants';
|
|
11
|
+
import { sprintf, translate, translatePlural } from '../../../../../../utils/i18n';
|
|
12
12
|
import DocumentationSources from '../duo_chat_message_sources/duo_chat_message_sources.vue';
|
|
13
13
|
// eslint-disable-next-line no-restricted-imports
|
|
14
14
|
import { renderDuoChatMarkdownPreview } from '../../markdown_renderer';
|
|
@@ -18,14 +18,25 @@ import { concatUntilEmpty } from './utils';
|
|
|
18
18
|
|
|
19
19
|
export const i18n = {
|
|
20
20
|
MODAL: {
|
|
21
|
-
TITLE: 'Give feedback on GitLab Duo Chat',
|
|
22
|
-
ALERT_TEXT:
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
TITLE: translate('GlDuoChatMessage.modalTitle', 'Give feedback on GitLab Duo Chat'),
|
|
22
|
+
ALERT_TEXT: translate(
|
|
23
|
+
'GlDuoChatMessage.modalAlertText',
|
|
24
|
+
'GitLab team members cannot view your conversation. Please be as descriptive as possible.'
|
|
25
|
+
),
|
|
26
|
+
DID_WHAT: translate('GlDuoChatMessage.modalDidWhat', 'What were you doing?'),
|
|
27
|
+
INTERACTION: translate(
|
|
28
|
+
'GlDuoChatMessage.modalInteraction',
|
|
29
|
+
'The situation in which you interacted with GitLab Duo Chat.'
|
|
30
|
+
),
|
|
31
|
+
IMPROVE_WHAT: translate(
|
|
32
|
+
'GlDuoChatMessage.modalImproveWhat',
|
|
33
|
+
'How could the response be improved?'
|
|
34
|
+
),
|
|
35
|
+
BETTER_RESPONSE: translate(
|
|
36
|
+
'GlDuoChatMessage.modalBetterResponse',
|
|
37
|
+
'How the response might better meet your needs.'
|
|
38
|
+
),
|
|
39
|
+
MESSAGE_ERROR: translate('GlDuoChatMessage.modalMessageError', 'Error sending the message'),
|
|
29
40
|
},
|
|
30
41
|
};
|
|
31
42
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { translatePlural } from '../../../../../../utils/i18n';
|
|
2
3
|
import GlIcon from '../../../../../base/icon/icon.vue';
|
|
3
4
|
import GlLink from '../../../../../base/link/link.vue';
|
|
4
5
|
import { DOCUMENTATION_SOURCE_TYPES } from '../../constants';
|
|
5
6
|
|
|
6
7
|
export const i18n = {
|
|
7
|
-
MESSAGE_SOURCE:
|
|
8
|
-
|
|
8
|
+
MESSAGE_SOURCE: (count = 1) =>
|
|
9
|
+
translatePlural('GlDuoChatMessageSources.messageSources', 'Source', 'Sources')(count),
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
export default {
|
|
@@ -25,7 +26,7 @@ export default {
|
|
|
25
26
|
},
|
|
26
27
|
computed: {
|
|
27
28
|
sourceLabel() {
|
|
28
|
-
return this.sources.length
|
|
29
|
+
return i18n.MESSAGE_SOURCE(this.sources.length);
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
32
|
methods: {
|
|
@@ -53,7 +54,7 @@ export default {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
return
|
|
57
|
+
return this.sourceLabel;
|
|
57
58
|
},
|
|
58
59
|
},
|
|
59
60
|
};
|
|
@@ -37,16 +37,16 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
|
|
|
37
37
|
|
|
38
38
|
.duo-chat-drawer {
|
|
39
39
|
right: 0;
|
|
40
|
-
@
|
|
40
|
+
@apply gl-transition-all;
|
|
41
41
|
position: fixed;
|
|
42
42
|
@include gl-h-full;
|
|
43
43
|
@include gl-w-full;
|
|
44
44
|
@include gl-overflow-y-auto;
|
|
45
45
|
@include gl-shadow-lg;
|
|
46
|
-
@
|
|
47
|
-
@
|
|
48
|
-
@
|
|
49
|
-
@
|
|
46
|
+
@apply gl-text-base;
|
|
47
|
+
@apply gl-leading-normal;
|
|
48
|
+
@apply gl-flex;
|
|
49
|
+
@apply gl-flex-col;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.duo-chat-drawer-header {
|
|
@@ -60,7 +60,7 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.duo-chat-drawer-body {
|
|
63
|
-
@
|
|
63
|
+
@apply gl-grow;
|
|
64
64
|
// prevent safari bug where box shadow is visible
|
|
65
65
|
// above the drawer when hovering interactive elements
|
|
66
66
|
// see https://gitlab.com/gitlab-org/gitlab/-/issues/366558
|
|
@@ -82,7 +82,7 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
|
|
|
82
82
|
&::before {
|
|
83
83
|
background: $duo-chat-scrim-gradient;
|
|
84
84
|
top: -$gl-border-size-1;
|
|
85
|
-
@
|
|
85
|
+
@apply -gl-translate-y-full;
|
|
86
86
|
content: '';
|
|
87
87
|
left: 0;
|
|
88
88
|
position: absolute;
|
|
@@ -124,8 +124,8 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
.duo-chat-input {
|
|
127
|
-
@
|
|
128
|
-
@
|
|
127
|
+
@apply gl-flex;
|
|
128
|
+
@apply gl-flex-col;
|
|
129
129
|
max-height: 240px;
|
|
130
130
|
overflow: hidden;
|
|
131
131
|
|
|
@@ -142,14 +142,14 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
|
|
|
142
142
|
|
|
143
143
|
&::after {
|
|
144
144
|
content: attr(data-value) ' ';
|
|
145
|
-
@
|
|
146
|
-
@
|
|
145
|
+
@apply gl-invisible;
|
|
146
|
+
@apply gl-whitespace-pre-wrap;
|
|
147
147
|
@apply gl-py-4;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
.slash-commands {
|
|
152
|
-
@
|
|
152
|
+
@apply -gl-mt-2;
|
|
153
153
|
|
|
154
154
|
.active-command {
|
|
155
155
|
@include gl-bg-gray-50;
|
|
@@ -157,12 +157,12 @@ $duo-chat-scrim-gradient: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
.gl-dropdown-item button.dropdown-item {
|
|
160
|
-
@
|
|
160
|
+
@apply gl-text-sm;
|
|
161
161
|
@apply gl-px-3;
|
|
162
|
-
@
|
|
162
|
+
@apply gl-bg-transparent;
|
|
163
163
|
|
|
164
164
|
&:hover {
|
|
165
|
-
@
|
|
165
|
+
@apply gl-bg-transparent;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
}
|
|
@@ -12,6 +12,7 @@ import GlForm from '../../../base/form/form.vue';
|
|
|
12
12
|
import GlExperimentBadge from '../../experiment_badge/experiment_badge.vue';
|
|
13
13
|
import { badgeTypes, badgeTypeValidator } from '../../experiment_badge/constants';
|
|
14
14
|
import { SafeHtmlDirective as SafeHtml } from '../../../../directives/safe_html/safe_html';
|
|
15
|
+
import { translate } from '../../../../utils/i18n';
|
|
15
16
|
import GlDuoChatLoader from './components/duo_chat_loader/duo_chat_loader.vue';
|
|
16
17
|
import GlDuoChatPredefinedPrompts from './components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.vue';
|
|
17
18
|
import GlDuoChatConversation from './components/duo_chat_conversation/duo_chat_conversation.vue';
|
|
@@ -25,23 +26,49 @@ import {
|
|
|
25
26
|
import { INCLUDE_SLASH_COMMAND } from './mock_data';
|
|
26
27
|
|
|
27
28
|
export const i18n = {
|
|
28
|
-
CHAT_DEFAULT_TITLE: 'GitLab Duo Chat',
|
|
29
|
-
CHAT_CLOSE_LABEL: 'Close the Code Explanation',
|
|
30
|
-
CHAT_LEGAL_GENERATED_BY_AI:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
CHAT_DEFAULT_TITLE: translate('GlDuoChat.chatDefaultTitle', 'GitLab Duo Chat'),
|
|
30
|
+
CHAT_CLOSE_LABEL: translate('GlDuoChat.chatCloseLabel', 'Close the Code Explanation'),
|
|
31
|
+
CHAT_LEGAL_GENERATED_BY_AI: translate(
|
|
32
|
+
'GlDuoChat.chatLegalGeneratedByAI',
|
|
33
|
+
'Responses generated by AI'
|
|
34
|
+
),
|
|
35
|
+
CHAT_EMPTY_STATE_TITLE: translate('GlDuoChat.chatEmptyStateTitle', 'Ask a question'),
|
|
36
|
+
CHAT_EMPTY_STATE_DESC: translate(
|
|
37
|
+
'GlDuoChat.chatEmptyStateDesc',
|
|
38
|
+
'GitLab Duo Chat is your AI-powered assistant.'
|
|
39
|
+
),
|
|
40
|
+
CHAT_EMPTY_STATE_SECONDARY_DESC: translate(
|
|
41
|
+
'GlDuoChat.chatEmptyStateSecondaryDesc',
|
|
42
|
+
'Responses may be inaccurate. Verify before use.'
|
|
43
|
+
),
|
|
44
|
+
CHAT_PROMPT_PLACEHOLDER_DEFAULT: translate(
|
|
45
|
+
'GlDuoChat.chatPromptPlaceholderDefault',
|
|
46
|
+
'GitLab Duo Chat'
|
|
47
|
+
),
|
|
48
|
+
CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS: translate(
|
|
49
|
+
'GlDuoChat.chatPromptPlaceholderWithCommands',
|
|
50
|
+
'Type "/" for slash commands'
|
|
51
|
+
),
|
|
52
|
+
CHAT_SUBMIT_LABEL: translate('GlDuoChat.chatSubmitLabel', 'Send chat message.'),
|
|
53
|
+
CHAT_CANCEL_LABEL: translate('GlDuoChat.chatCancelLabel', 'Cancel'),
|
|
54
|
+
CHAT_LEGAL_DISCLAIMER: translate(
|
|
55
|
+
'GlDuoChat.chatLegalDisclaimer',
|
|
56
|
+
"May provide inappropriate responses not representative of GitLab's views. Do not input personal data."
|
|
57
|
+
),
|
|
40
58
|
CHAT_DEFAULT_PREDEFINED_PROMPTS: [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
59
|
+
translate(
|
|
60
|
+
'GlDuoChat.chatDefaultPredefinedPromptsChangePassword',
|
|
61
|
+
'How do I change my password in GitLab?'
|
|
62
|
+
),
|
|
63
|
+
translate('GlDuoChat.chatDefaultPredefinedPromptsForkProject', 'How do I fork a project?'),
|
|
64
|
+
translate(
|
|
65
|
+
'GlDuoChat.chatDefaultPredefinedPromptsCloneRepository',
|
|
66
|
+
'How do I clone a repository?'
|
|
67
|
+
),
|
|
68
|
+
translate(
|
|
69
|
+
'GlDuoChat.chatDefaultPredefinedPromptsCreateTemplate',
|
|
70
|
+
'How do I create a template?'
|
|
71
|
+
),
|
|
45
72
|
],
|
|
46
73
|
};
|
|
47
74
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
.gl-charts-tooltip-default-format-series {
|
|
2
|
-
@
|
|
3
|
-
@
|
|
2
|
+
@apply gl-flex;
|
|
3
|
+
@apply gl-justify-between;
|
|
4
4
|
|
|
5
5
|
&-label,
|
|
6
6
|
&-value {
|
|
7
|
-
@
|
|
7
|
+
@apply gl-text-sm;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
&-label {
|
|
11
|
-
@
|
|
11
|
+
@apply gl-leading-normal;
|
|
12
12
|
@apply gl-mr-7;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
&-value {
|
|
16
|
-
@
|
|
16
|
+
@apply gl-font-bold;
|
|
17
17
|
}
|
|
18
18
|
}
|