@gitlab/ui 102.1.6 → 102.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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [102.2.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v102.1.6...v102.2.0) (2024-11-14)
2
+
3
+
4
+ ### Features
5
+
6
+ * **DuoChat:** Emit chat-slash event on slash commands opened ([07d8ed6](https://gitlab.com/gitlab-org/gitlab-ui/commit/07d8ed6062ca498bfcf7a2b156dcae6deaf7b08f))
7
+
1
8
  ## [102.1.6](https://gitlab.com/gitlab-org/gitlab-ui/compare/v102.1.5...v102.1.6) (2024-11-14)
2
9
 
3
10
 
@@ -310,6 +310,11 @@ var script = {
310
310
  // or if the user has just submitted a new message
311
311
  this.scrollToBottom();
312
312
  }
313
+ },
314
+ shouldShowSlashCommands(shouldShow) {
315
+ if (shouldShow) {
316
+ this.onShowSlashCommands();
317
+ }
313
318
  }
314
319
  },
315
320
  created() {
@@ -394,6 +399,12 @@ var script = {
394
399
  */
395
400
  this.$emit('track-feedback', event);
396
401
  },
402
+ onShowSlashCommands() {
403
+ /**
404
+ * Emitted when user opens the slash commands menu
405
+ */
406
+ this.$emit('chat-slash');
407
+ },
397
408
  sendChatPromptOnEnter(e) {
398
409
  const {
399
410
  metaKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "102.1.6",
3
+ "version": "102.2.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -357,6 +357,11 @@ export default {
357
357
  this.scrollToBottom();
358
358
  }
359
359
  },
360
+ shouldShowSlashCommands(shouldShow) {
361
+ if (shouldShow) {
362
+ this.onShowSlashCommands();
363
+ }
364
+ },
360
365
  },
361
366
  created() {
362
367
  this.handleScrollingTrottled = throttle(this.handleScrolling, 200); // Assume a 200ms throttle for example
@@ -441,6 +446,12 @@ export default {
441
446
  */
442
447
  this.$emit('track-feedback', event);
443
448
  },
449
+ onShowSlashCommands() {
450
+ /**
451
+ * Emitted when user opens the slash commands menu
452
+ */
453
+ this.$emit('chat-slash');
454
+ },
444
455
  sendChatPromptOnEnter(e) {
445
456
  const { metaKey, ctrlKey, altKey, shiftKey, isComposing } = e;
446
457
  const isModifierKey = metaKey || ctrlKey || altKey || shiftKey;