@gitlab/ui 74.9.2 → 75.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "74.9.2",
3
+ "version": "75.0.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -102,7 +102,7 @@
102
102
  "@gitlab/eslint-plugin": "19.4.0",
103
103
  "@gitlab/fonts": "^1.3.0",
104
104
  "@gitlab/stylelint-config": "6.1.0",
105
- "@gitlab/svgs": "3.83.0",
105
+ "@gitlab/svgs": "3.84.0",
106
106
  "@rollup/plugin-commonjs": "^11.1.0",
107
107
  "@rollup/plugin-node-resolve": "^7.1.3",
108
108
  "@rollup/plugin-replace": "^2.3.2",
@@ -1,9 +1,4 @@
1
1
  .duo-chat-loader {
2
- @include gl-py-3;
3
- @include gl-px-4;
4
- @include gl-mb-4;
5
- @include gl-rounded-lg;
6
- @include gl-rounded-bottom-left-none;
7
2
  @include gl-display-flex;
8
3
  @include gl-text-gray-500;
9
4
 
@@ -64,4 +59,4 @@
64
59
  40% {
65
60
  transform: scale(1);
66
61
  }
67
- }
62
+ }
@@ -12,18 +12,9 @@
12
12
  transform: translateY(10px);
13
13
  }
14
14
 
15
- .loader-enter-active,
16
- .loader-leave-active {
17
- transition: opacity 0.5s ease;
18
- }
19
-
20
- .loader-enter,
21
- .loader-leave-to {
22
- @include gl-opacity-0;
23
- }
24
-
25
- .loader-leave-active {
26
- @include gl-absolute;
15
+ .duo-chat-loader.message-leave,
16
+ .duo-chat-loader.message-leave-to {
17
+ transition: none;
27
18
  }
28
19
 
29
20
  .gl-drawer-body-scrim-on-footer {
@@ -31,11 +22,19 @@
31
22
  background: linear-gradient(to bottom, rgba($gray-10, 0), $gray-10);
32
23
  }
33
24
  }
25
+
26
+ .gl-drawer-body {
27
+ overflow-y: auto;
28
+ }
34
29
  }
35
30
 
36
31
  .duo-chat-history {
37
32
  scroll-behavior: smooth;
38
33
 
34
+ &.force-scroll-bar {
35
+ min-height: calc(100% + 1rem);
36
+ }
37
+
39
38
  /*
40
39
  Browsers a are pretty good at keeping the focus on an element while
41
40
  the parent element grows in size. With this we mark all child elements
@@ -72,6 +72,7 @@ describe('GlDuoChat', () => {
72
72
  };
73
73
 
74
74
  const findChatComponent = () => wrapper.find('[data-testid="chat-component"]');
75
+ const findChatHistoryComponent = () => wrapper.find('[data-testid="chat-history"]');
75
76
  const findCloseButton = () => wrapper.find('[data-testid="chat-close-button"]');
76
77
  const findChatConversations = () => wrapper.findAllComponents(DuoChatConversation);
77
78
  const findCustomLoader = () => wrapper.findComponent(DuoChatLoader);
@@ -462,7 +463,7 @@ describe('GlDuoChat', () => {
462
463
 
463
464
  beforeEach(() => {
464
465
  createComponent({ propsData: { messages, isChatAvailable: true } });
465
- element = findChatComponent().element;
466
+ element = findChatHistoryComponent().element;
466
467
  });
467
468
 
468
469
  it('when scrolling to the bottom it removes the scrim class', async () => {
@@ -470,7 +471,7 @@ describe('GlDuoChat', () => {
470
471
  jest.spyOn(element, 'offsetHeight', 'get').mockReturnValue(100);
471
472
  jest.spyOn(element, 'scrollHeight', 'get').mockReturnValue(200);
472
473
 
473
- findChatComponent().trigger('scroll');
474
+ findChatHistoryComponent().trigger('scroll');
474
475
 
475
476
  await nextTick();
476
477
 
@@ -482,7 +483,7 @@ describe('GlDuoChat', () => {
482
483
  jest.spyOn(element, 'offsetHeight', 'get').mockReturnValue(100);
483
484
  jest.spyOn(element, 'scrollHeight', 'get').mockReturnValue(200);
484
485
 
485
- findChatComponent().trigger('scroll');
486
+ findChatHistoryComponent().trigger('scroll');
486
487
 
487
488
  await nextTick();
488
489
 
@@ -285,8 +285,8 @@ export default {
285
285
  this.prompt = prompt;
286
286
  this.sendChatPrompt();
287
287
  },
288
- handleScrolling() {
289
- const { scrollTop, offsetHeight, scrollHeight } = this.$refs.drawer;
288
+ handleScrolling(event) {
289
+ const { scrollTop, offsetHeight, scrollHeight } = event.target;
290
290
  this.scrolledToBottom = scrollTop + offsetHeight >= scrollHeight;
291
291
  },
292
292
  async scrollToBottom() {
@@ -355,11 +355,9 @@ export default {
355
355
  <aside
356
356
  v-if="!isHidden"
357
357
  id="chat-component"
358
- ref="drawer"
359
358
  class="markdown-code-block gl-drawer gl-drawer-default gl-max-h-full gl-bottom-0 gl-shadow-none gl-border-l gl-border-t duo-chat"
360
359
  role="complementary"
361
360
  data-testid="chat-component"
362
- @scroll="handleScrollingTrottled"
363
361
  >
364
362
  <header
365
363
  v-if="showHeader"
@@ -416,50 +414,43 @@ export default {
416
414
  </gl-alert>
417
415
  </header>
418
416
 
419
- <div class="gl-drawer-body gl-display-flex gl-flex-direction-column">
420
- <section
421
- class="duo-chat-history gl-display-flex gl-flex-direction-column gl-justify-content-end gl-flex-grow-1 gl-border-b-0 gl-bg-gray-10"
417
+ <div class="gl-drawer-body" data-testid="chat-history" @scroll="handleScrollingTrottled">
418
+ <transition-group
419
+ tag="section"
420
+ name="message"
421
+ class="duo-chat-history gl-display-flex gl-flex-direction-column gl-justify-content-end gl-bg-gray-10"
422
+ :class="[
423
+ {
424
+ 'gl-h-full': !hasMessages,
425
+ 'force-scroll-bar': hasMessages,
426
+ },
427
+ ]"
422
428
  >
423
- <transition-group
424
- tag="div"
425
- name="message"
426
- class="gl-display-flex gl-flex-direction-column gl-justify-content-end"
427
- :class="[
428
- {
429
- 'gl-h-full': !hasMessages,
430
- 'gl-h-auto': hasMessages,
431
- },
432
- ]"
433
- >
434
- <gl-duo-chat-conversation
435
- v-for="(conversation, index) in conversations"
436
- :key="`conversation-${index}`"
437
- :messages="conversation"
438
- :show-delimiter="index > 0"
439
- @track-feedback="onTrackFeedback"
429
+ <gl-duo-chat-conversation
430
+ v-for="(conversation, index) in conversations"
431
+ :key="`conversation-${index}`"
432
+ :messages="conversation"
433
+ :show-delimiter="index > 0"
434
+ @track-feedback="onTrackFeedback"
435
+ />
436
+ <template v-if="!hasMessages && !isLoading">
437
+ <gl-empty-state
438
+ key="empty-state"
439
+ :svg-path="$options.emptySvg"
440
+ :svg-height="145"
441
+ :title="emptyStateTitle"
442
+ :description="emptyStateDescription"
443
+ class="gl-flex-grow gl-justify-content-center"
440
444
  />
441
- <template v-if="!hasMessages && !isLoading">
442
- <div key="empty-state" class="gl-display-flex gl-flex-grow-1 gl-mr-auto gl-ml-auto">
443
- <gl-empty-state
444
- :svg-path="$options.emptySvg"
445
- :svg-height="145"
446
- :title="emptyStateTitle"
447
- :description="emptyStateDescription"
448
- class="gl-align-self-center"
449
- />
450
- </div>
451
- <gl-duo-chat-predefined-prompts
452
- key="predefined-prompts"
453
- :prompts="predefinedPrompts"
454
- @click="sendPredefinedPrompt"
455
- />
456
- </template>
457
- </transition-group>
458
- <transition name="loader">
459
- <gl-duo-chat-loader v-if="isLoading" :tool-name="toolName" class="gl-px-0!" />
460
- </transition>
461
- <div ref="anchor" class="scroll-anchor"></div>
462
- </section>
445
+ <gl-duo-chat-predefined-prompts
446
+ key="predefined-prompts"
447
+ :prompts="predefinedPrompts"
448
+ @click="sendPredefinedPrompt"
449
+ />
450
+ </template>
451
+ <gl-duo-chat-loader v-if="isLoading" key="loader" :tool-name="toolName" />
452
+ <div key="anchor" ref="anchor" class="scroll-anchor"></div>
453
+ </transition-group>
463
454
  </div>
464
455
  <footer
465
456
  v-if="isChatAvailable"
@@ -4177,12 +4177,6 @@ $gl-animate-skeleton-loader-max-width: 64 * $grid-size;
4177
4177
  object-fit: contain !important
4178
4178
  }
4179
4179
 
4180
- .gl-isolation-isolate {
4181
- isolation: isolate
4182
- }
4183
- .gl-isolation-isolate\! {
4184
- isolation: isolate !important
4185
- }
4186
4180
  .gl-list-style-none {
4187
4181
  list-style-type: none
4188
4182
  }
@@ -9670,11 +9664,3 @@ $gl-animate-skeleton-loader-max-width: 64 * $grid-size;
9670
9664
  .gl-z-index-9999\! {
9671
9665
  z-index: 9999 !important
9672
9666
  }
9673
-
9674
- .gl-isolate {
9675
- isolation: isolate
9676
- }
9677
-
9678
- .gl-isolate\! {
9679
- isolation: isolate !important
9680
- }
@@ -29,7 +29,6 @@
29
29
  @import './flex';
30
30
  @import './grid';
31
31
  @import './image';
32
- @import './isolation';
33
32
  @import './list-style';
34
33
  @import './masks';
35
34
  @import './mix-blend-mode';
@@ -35,7 +35,3 @@
35
35
  @mixin gl-z-index-9999 {
36
36
  z-index: 9999;
37
37
  }
38
-
39
- @mixin gl-isolate {
40
- isolation: isolate;
41
- }
@@ -1,3 +0,0 @@
1
- @mixin gl-isolation-isolate {
2
- isolation: isolate;
3
- }