@gitlab/ui 78.3.0 → 78.4.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 +7 -0
- package/dist/components/experimental/duo/chat/duo_chat.js +1 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/package.json +4 -4
- package/src/components/base/drawer/drawer.stories.js +9 -4
- package/src/components/experimental/duo/chat/duo_chat.spec.js +11 -0
- package/src/components/experimental/duo/chat/duo_chat.vue +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [78.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.3.0...v78.4.0) (2024-03-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlDuoChat:** trim the prompt ([89b1253](https://gitlab.com/gitlab-org/gitlab-ui/commit/89b125332b9674d97848cdb8586338147fa10b20))
|
|
7
|
+
|
|
1
8
|
# [78.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v78.2.3...v78.3.0) (2024-03-22)
|
|
2
9
|
|
|
3
10
|
|
package/dist/tokens/js/tokens.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "78.
|
|
3
|
+
"version": "78.4.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@arkweid/lefthook": "0.7.7",
|
|
96
|
-
"@babel/core": "^7.24.
|
|
96
|
+
"@babel/core": "^7.24.3",
|
|
97
97
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
98
98
|
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
|
|
99
|
-
"@babel/preset-env": "^7.24.
|
|
100
|
-
"@babel/preset-react": "^7.
|
|
99
|
+
"@babel/preset-env": "^7.24.3",
|
|
100
|
+
"@babel/preset-react": "^7.24.1",
|
|
101
101
|
"@cypress/grep": "^4.0.1",
|
|
102
102
|
"@gitlab/eslint-plugin": "19.4.0",
|
|
103
103
|
"@gitlab/fonts": "^1.3.0",
|
|
@@ -62,14 +62,16 @@ const drawerContent = generateDrawerContent([
|
|
|
62
62
|
|
|
63
63
|
const drawerContentShortList = generateDrawerContent(['One', 'Two', 'Three']);
|
|
64
64
|
|
|
65
|
-
const createSidebarTemplate = (content) => `
|
|
65
|
+
const createSidebarTemplate = (content, { extraBindings = {} } = {}) => `
|
|
66
66
|
<gl-drawer
|
|
67
67
|
:open="open"
|
|
68
68
|
:header-height="headerHeight"
|
|
69
69
|
:header-sticky="headerSticky"
|
|
70
70
|
:z-index="zIndex"
|
|
71
71
|
:variant="variant"
|
|
72
|
-
|
|
72
|
+
${Object.entries(extraBindings)
|
|
73
|
+
.map(([key, value]) => `${key}="${value}"`)
|
|
74
|
+
.join('\n')}
|
|
73
75
|
@close="close">${content}</gl-drawer>
|
|
74
76
|
`;
|
|
75
77
|
|
|
@@ -124,10 +126,13 @@ export const Default = (_args, { viewMode }) => ({
|
|
|
124
126
|
template: `
|
|
125
127
|
<div :data-opened-count="timesOpened">
|
|
126
128
|
<gl-button @click="toggle">Toggle Drawer</gl-button>
|
|
127
|
-
${createSidebarTemplate(
|
|
129
|
+
${createSidebarTemplate(
|
|
130
|
+
`
|
|
128
131
|
<template #title>List Settings</template>
|
|
129
132
|
${drawerContent}
|
|
130
|
-
|
|
133
|
+
`,
|
|
134
|
+
{ extraBindings: { '@opened': 'opened' } }
|
|
135
|
+
)}
|
|
131
136
|
</div>`,
|
|
132
137
|
});
|
|
133
138
|
Default.args = generateProps();
|
|
@@ -307,6 +307,17 @@ describe('GlDuoChat', () => {
|
|
|
307
307
|
describe('submit', () => {
|
|
308
308
|
const ENTER = 'Enter';
|
|
309
309
|
|
|
310
|
+
it('trims the prompt', () => {
|
|
311
|
+
const question = ' foo bar ';
|
|
312
|
+
const expectedPrompt = 'foo bar';
|
|
313
|
+
createComponent({
|
|
314
|
+
propsData: { isChatAvailable: true, messages: [] },
|
|
315
|
+
});
|
|
316
|
+
setPromptInput(question);
|
|
317
|
+
clickSubmit();
|
|
318
|
+
expect(wrapper.emitted('send-chat-prompt')).toEqual([[expectedPrompt]]);
|
|
319
|
+
});
|
|
320
|
+
|
|
310
321
|
it.each`
|
|
311
322
|
trigger | event | action | expectEmitted
|
|
312
323
|
${() => clickSubmit()} | ${'Submit button click'} | ${'submit'} | ${[[promptStr]]}
|