@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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [93.2.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v93.1.0...v93.2.0) (2024-09-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **DesignTokens:** add text warning design tokens ([e00b998](https://gitlab.com/gitlab-org/gitlab-ui/commit/e00b998524c1b974f49994059256dd340748ab20))
|
|
7
|
+
|
|
8
|
+
# [93.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v93.0.0...v93.1.0) (2024-09-18)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **GlDisclosureDropdown:** Add spacing after loading icon ([82eef91](https://gitlab.com/gitlab-org/gitlab-ui/commit/82eef91560f54092dfbc4fcd67e22324c59603fa))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **i18n:** Setup translation for Duo Chat component and all sub-components ([0b766ef](https://gitlab.com/gitlab-org/gitlab-ui/commit/0b766ef6ec405ca2c13f9d3ead8d546a16e99f5d))
|
|
19
|
+
|
|
1
20
|
# [93.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v92.5.0...v93.0.0) (2024-09-18)
|
|
2
21
|
|
|
3
22
|
|
|
@@ -67,13 +67,18 @@ var script = {
|
|
|
67
67
|
computed: {
|
|
68
68
|
sizeClasses() {
|
|
69
69
|
if (isNumber(this.size)) {
|
|
70
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
70
71
|
return `gl-avatar-s${this.size}`;
|
|
71
72
|
}
|
|
72
73
|
const {
|
|
73
74
|
default: defaultSize,
|
|
74
75
|
...nonDefaultSizes
|
|
75
76
|
} = this.size;
|
|
76
|
-
return [
|
|
77
|
+
return [
|
|
78
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
79
|
+
`gl-avatar-s${defaultSize || avatarSizeOptions[1]}`, ...Object.entries(nonDefaultSizes).map(
|
|
80
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
81
|
+
_ref => {
|
|
77
82
|
let [breakpoint, size] = _ref;
|
|
78
83
|
return `gl-${breakpoint}-avatar-s${size}`;
|
|
79
84
|
})];
|
|
@@ -87,6 +92,7 @@ var script = {
|
|
|
87
92
|
* Gets the remainder after dividing the 'entityId' by the number of available backgrounds.
|
|
88
93
|
*/
|
|
89
94
|
const type = this.entityId % IDENTICON_BG_COUNT + 1;
|
|
95
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
90
96
|
return `gl-avatar-identicon-bg${type}`;
|
|
91
97
|
},
|
|
92
98
|
identiconText() {
|
|
@@ -219,7 +219,9 @@ var script = {
|
|
|
219
219
|
return null;
|
|
220
220
|
},
|
|
221
221
|
datepickerClasses() {
|
|
222
|
-
return ['gl-datepicker', 'd-inline-block', 'gl-w-full',
|
|
222
|
+
return ['gl-datepicker', 'd-inline-block', 'gl-w-full',
|
|
223
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
224
|
+
`gl-form-input-${this.computedWidth}`];
|
|
223
225
|
},
|
|
224
226
|
computedWidth() {
|
|
225
227
|
if (this.width) {
|
|
@@ -3,6 +3,7 @@ import mapValues from 'lodash/mapValues';
|
|
|
3
3
|
import uniqueId from 'lodash/uniqueId';
|
|
4
4
|
import GlFormGroup from '../form_group/form_group';
|
|
5
5
|
import GlFormInput from '../form_input/form_input';
|
|
6
|
+
import { setObjectProperty } from '../../../../utils/set_utils';
|
|
6
7
|
import GlFormFieldValidator from './form_field_validator';
|
|
7
8
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
8
9
|
|
|
@@ -138,7 +139,7 @@ var script = {
|
|
|
138
139
|
},
|
|
139
140
|
methods: {
|
|
140
141
|
setFieldDirty(fieldName) {
|
|
141
|
-
this
|
|
142
|
+
this.fieldDirtyStatuses = setObjectProperty(this.fieldDirtyStatuses, fieldName, true);
|
|
142
143
|
},
|
|
143
144
|
setAllFieldsDirty() {
|
|
144
145
|
this.fieldNames.forEach(fieldName => this.setFieldDirty(fieldName));
|
|
@@ -160,7 +161,7 @@ var script = {
|
|
|
160
161
|
return val;
|
|
161
162
|
},
|
|
162
163
|
onFieldValidationUpdate(fieldName, invalidFeedback) {
|
|
163
|
-
this
|
|
164
|
+
this.fieldValidations = setObjectProperty(this.fieldValidations, fieldName, invalidFeedback);
|
|
164
165
|
},
|
|
165
166
|
onFieldBlur(fieldName) {
|
|
166
167
|
this.setFieldDirty(fieldName);
|
|
@@ -39,11 +39,17 @@ var script = {
|
|
|
39
39
|
default: defaultWidth,
|
|
40
40
|
...nonDefaultWidths
|
|
41
41
|
} = this.width;
|
|
42
|
-
return [
|
|
42
|
+
return [
|
|
43
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
44
|
+
...(defaultWidth ? [`gl-form-input-${defaultWidth}`] : []), ...Object.entries(nonDefaultWidths).map(
|
|
45
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
46
|
+
_ref => {
|
|
43
47
|
let [breakpoint, width] = _ref;
|
|
44
48
|
return `gl-${breakpoint}-form-input-${width}`;
|
|
45
49
|
})];
|
|
46
50
|
}
|
|
51
|
+
|
|
52
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
47
53
|
return [`gl-form-input-${this.width}`];
|
|
48
54
|
},
|
|
49
55
|
listeners() {
|
|
@@ -33,11 +33,17 @@ var script = {
|
|
|
33
33
|
default: defaultWidth,
|
|
34
34
|
...nonDefaultWidths
|
|
35
35
|
} = this.width;
|
|
36
|
-
return [
|
|
36
|
+
return [
|
|
37
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
38
|
+
...(defaultWidth ? [`gl-form-select-${defaultWidth}`] : []), ...Object.entries(nonDefaultWidths).map(
|
|
39
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
40
|
+
_ref => {
|
|
37
41
|
let [breakpoint, width] = _ref;
|
|
38
42
|
return `gl-${breakpoint}-form-select-${width}`;
|
|
39
43
|
})];
|
|
40
44
|
}
|
|
45
|
+
|
|
46
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
41
47
|
return [`gl-form-select-${this.width}`];
|
|
42
48
|
}
|
|
43
49
|
}
|
|
@@ -31,6 +31,7 @@ function renderTitle(h, toast, options) {
|
|
|
31
31
|
}
|
|
32
32
|
function showToast(message) {
|
|
33
33
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
34
|
+
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
34
35
|
const id = `gl-toast-${toastsCount}`;
|
|
35
36
|
toastsCount += 1;
|
|
36
37
|
const hide = () => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import GlDuoChatMessage from '../duo_chat_message/duo_chat_message';
|
|
2
|
+
import { translate } from '../../../../../../utils/i18n';
|
|
2
3
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
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
|
const isMessage = item => Boolean(item) && (item === null || item === void 0 ? void 0 : item.role);
|
|
8
9
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { translate } from '../../../../../../utils/i18n';
|
|
1
2
|
import GlSprintf from '../../../../../utilities/sprintf/sprintf';
|
|
2
3
|
import { LOADING_TRANSITION_DURATION } from '../../constants';
|
|
3
4
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
5
|
|
|
5
6
|
const i18n = {
|
|
6
|
-
LOADER_LOADING_MESSAGE: '%{tool} is %{transition} an answer',
|
|
7
|
-
LOADER_LOADING_TRANSITIONS: ['finding', 'working on', 'generating', 'producing'],
|
|
8
|
-
GITLAB_DUO: 'GitLab Duo'
|
|
7
|
+
LOADER_LOADING_MESSAGE: translate('GlDuoChatLoader.loaderLoadingMessage', '%{tool} is %{transition} an answer'),
|
|
8
|
+
LOADER_LOADING_TRANSITIONS: [translate('GlDuoChatLoader.loaderLoadingTransitionsFinding', 'finding'), translate('GlDuoChatLoader.loaderLoadingTransitionsWorkingOn', 'working on'), translate('GlDuoChatLoader.loaderLoadingTransitionsGenerating', 'generating'), translate('GlDuoChatLoader.loaderLoadingTransitionsProducing', 'producing')],
|
|
9
|
+
GITLAB_DUO: translate('GlDuoChatLoader.gitlabDuo', 'GitLab Duo')
|
|
9
10
|
};
|
|
10
11
|
var script = {
|
|
11
12
|
name: 'GlDuoChatLoader',
|
package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js
CHANGED
|
@@ -6,8 +6,8 @@ import GlDuoUserFeedback from '../../../user_feedback/user_feedback';
|
|
|
6
6
|
import GlFormGroup from '../../../../../base/form/form_group/form_group';
|
|
7
7
|
import GlFormTextarea from '../../../../../base/form/form_textarea/form_textarea';
|
|
8
8
|
import { SafeHtmlDirective } from '../../../../../../directives/safe_html/safe_html';
|
|
9
|
-
import { translatePlural, sprintf } from '../../../../../../utils/i18n';
|
|
10
9
|
import { SELECTED_CONTEXT_ITEMS_DEFAULT_COLLAPSED, MESSAGE_MODEL_ROLES } from '../../constants';
|
|
10
|
+
import { translate, translatePlural, sprintf } from '../../../../../../utils/i18n';
|
|
11
11
|
import DocumentationSources from '../duo_chat_message_sources/duo_chat_message_sources';
|
|
12
12
|
import { renderDuoChatMarkdownPreview } from '../../markdown_renderer';
|
|
13
13
|
import { CopyCodeElement } from './copy_code_element';
|
|
@@ -17,13 +17,13 @@ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
|
17
17
|
|
|
18
18
|
const i18n = {
|
|
19
19
|
MODAL: {
|
|
20
|
-
TITLE: 'Give feedback on GitLab Duo Chat',
|
|
21
|
-
ALERT_TEXT: 'GitLab team members cannot view your conversation. Please be as descriptive as possible.',
|
|
22
|
-
DID_WHAT: 'What were you doing?',
|
|
23
|
-
INTERACTION: 'The situation in which you interacted with GitLab Duo Chat.',
|
|
24
|
-
IMPROVE_WHAT: 'How could the response be improved?',
|
|
25
|
-
BETTER_RESPONSE: 'How the response might better meet your needs.',
|
|
26
|
-
MESSAGE_ERROR: 'Error sending the message'
|
|
20
|
+
TITLE: translate('GlDuoChatMessage.modalTitle', 'Give feedback on GitLab Duo Chat'),
|
|
21
|
+
ALERT_TEXT: translate('GlDuoChatMessage.modalAlertText', 'GitLab team members cannot view your conversation. Please be as descriptive as possible.'),
|
|
22
|
+
DID_WHAT: translate('GlDuoChatMessage.modalDidWhat', 'What were you doing?'),
|
|
23
|
+
INTERACTION: translate('GlDuoChatMessage.modalInteraction', 'The situation in which you interacted with GitLab Duo Chat.'),
|
|
24
|
+
IMPROVE_WHAT: translate('GlDuoChatMessage.modalImproveWhat', 'How could the response be improved?'),
|
|
25
|
+
BETTER_RESPONSE: translate('GlDuoChatMessage.modalBetterResponse', 'How the response might better meet your needs.'),
|
|
26
|
+
MESSAGE_ERROR: translate('GlDuoChatMessage.modalMessageError', 'Error sending the message')
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
var script = {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { translatePlural } from '../../../../../../utils/i18n';
|
|
1
2
|
import GlIcon from '../../../../../base/icon/icon';
|
|
2
3
|
import GlLink from '../../../../../base/link/link';
|
|
3
4
|
import { DOCUMENTATION_SOURCE_TYPES } from '../../constants';
|
|
4
5
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
5
6
|
|
|
6
7
|
const i18n = {
|
|
7
|
-
MESSAGE_SOURCE:
|
|
8
|
-
|
|
8
|
+
MESSAGE_SOURCE: function () {
|
|
9
|
+
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
10
|
+
return translatePlural('GlDuoChatMessageSources.messageSources', 'Source', 'Sources')(count);
|
|
11
|
+
}
|
|
9
12
|
};
|
|
10
13
|
var script = {
|
|
11
14
|
name: 'GlDuoChatMessageSources',
|
|
@@ -24,7 +27,7 @@ var script = {
|
|
|
24
27
|
},
|
|
25
28
|
computed: {
|
|
26
29
|
sourceLabel() {
|
|
27
|
-
return this.sources.length
|
|
30
|
+
return i18n.MESSAGE_SOURCE(this.sources.length);
|
|
28
31
|
}
|
|
29
32
|
},
|
|
30
33
|
methods: {
|
|
@@ -59,7 +62,7 @@ var script = {
|
|
|
59
62
|
return `${date} / ${author}`;
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
|
-
return
|
|
65
|
+
return this.sourceLabel;
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
68
|
};
|
|
@@ -11,6 +11,7 @@ import GlForm from '../../../base/form/form';
|
|
|
11
11
|
import GlExperimentBadge from '../../experiment_badge/experiment_badge';
|
|
12
12
|
import { badgeTypes, badgeTypeValidator } from '../../experiment_badge/constants';
|
|
13
13
|
import { SafeHtmlDirective } from '../../../../directives/safe_html/safe_html';
|
|
14
|
+
import { translate } from '../../../../utils/i18n';
|
|
14
15
|
import GlDuoChatLoader from './components/duo_chat_loader/duo_chat_loader';
|
|
15
16
|
import GlDuoChatPredefinedPrompts from './components/duo_chat_predefined_prompts/duo_chat_predefined_prompts';
|
|
16
17
|
import GlDuoChatConversation from './components/duo_chat_conversation/duo_chat_conversation';
|
|
@@ -19,18 +20,18 @@ import { INCLUDE_SLASH_COMMAND } from './mock_data';
|
|
|
19
20
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
20
21
|
|
|
21
22
|
const i18n = {
|
|
22
|
-
CHAT_DEFAULT_TITLE: 'GitLab Duo Chat',
|
|
23
|
-
CHAT_CLOSE_LABEL: 'Close the Code Explanation',
|
|
24
|
-
CHAT_LEGAL_GENERATED_BY_AI: 'Responses generated by AI',
|
|
25
|
-
CHAT_EMPTY_STATE_TITLE: 'Ask a question',
|
|
26
|
-
CHAT_EMPTY_STATE_DESC: 'GitLab Duo Chat is your AI-powered assistant.',
|
|
27
|
-
CHAT_EMPTY_STATE_SECONDARY_DESC: 'Responses may be inaccurate. Verify before use.',
|
|
28
|
-
CHAT_PROMPT_PLACEHOLDER_DEFAULT: 'GitLab Duo Chat',
|
|
29
|
-
CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS: 'Type "/" for slash commands',
|
|
30
|
-
CHAT_SUBMIT_LABEL: 'Send chat message.',
|
|
31
|
-
CHAT_CANCEL_LABEL: 'Cancel',
|
|
32
|
-
CHAT_LEGAL_DISCLAIMER: "May provide inappropriate responses not representative of GitLab's views. Do not input personal data.",
|
|
33
|
-
CHAT_DEFAULT_PREDEFINED_PROMPTS: ['How do I change my password in GitLab?', 'How do I fork a project?', 'How do I clone a repository?', 'How do I create a template?']
|
|
23
|
+
CHAT_DEFAULT_TITLE: translate('GlDuoChat.chatDefaultTitle', 'GitLab Duo Chat'),
|
|
24
|
+
CHAT_CLOSE_LABEL: translate('GlDuoChat.chatCloseLabel', 'Close the Code Explanation'),
|
|
25
|
+
CHAT_LEGAL_GENERATED_BY_AI: translate('GlDuoChat.chatLegalGeneratedByAI', 'Responses generated by AI'),
|
|
26
|
+
CHAT_EMPTY_STATE_TITLE: translate('GlDuoChat.chatEmptyStateTitle', 'Ask a question'),
|
|
27
|
+
CHAT_EMPTY_STATE_DESC: translate('GlDuoChat.chatEmptyStateDesc', 'GitLab Duo Chat is your AI-powered assistant.'),
|
|
28
|
+
CHAT_EMPTY_STATE_SECONDARY_DESC: translate('GlDuoChat.chatEmptyStateSecondaryDesc', 'Responses may be inaccurate. Verify before use.'),
|
|
29
|
+
CHAT_PROMPT_PLACEHOLDER_DEFAULT: translate('GlDuoChat.chatPromptPlaceholderDefault', 'GitLab Duo Chat'),
|
|
30
|
+
CHAT_PROMPT_PLACEHOLDER_WITH_COMMANDS: translate('GlDuoChat.chatPromptPlaceholderWithCommands', 'Type "/" for slash commands'),
|
|
31
|
+
CHAT_SUBMIT_LABEL: translate('GlDuoChat.chatSubmitLabel', 'Send chat message.'),
|
|
32
|
+
CHAT_CANCEL_LABEL: translate('GlDuoChat.chatCancelLabel', 'Cancel'),
|
|
33
|
+
CHAT_LEGAL_DISCLAIMER: translate('GlDuoChat.chatLegalDisclaimer', "May provide inappropriate responses not representative of GitLab's views. Do not input personal data."),
|
|
34
|
+
CHAT_DEFAULT_PREDEFINED_PROMPTS: [translate('GlDuoChat.chatDefaultPredefinedPromptsChangePassword', 'How do I change my password in GitLab?'), translate('GlDuoChat.chatDefaultPredefinedPromptsForkProject', 'How do I fork a project?'), translate('GlDuoChat.chatDefaultPredefinedPromptsCloneRepository', 'How do I clone a repository?'), translate('GlDuoChat.chatDefaultPredefinedPromptsCreateTemplate', 'How do I create a template?')]
|
|
34
35
|
};
|
|
35
36
|
const isMessage = item => Boolean(item) && (item === null || item === void 0 ? void 0 : item.role);
|
|
36
37
|
const isSlashCommand = command => Boolean(command) && (command === null || command === void 0 ? void 0 : command.name) && command.description;
|