@gitlab/duo-ui 10.17.1 → 10.17.2

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
+ ## [10.17.2](https://gitlab.com/gitlab-org/duo-ui/compare/v10.17.1...v10.17.2) (2025-08-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Correct esc key behavior for context menu interactions ([5b71efe](https://gitlab.com/gitlab-org/duo-ui/commit/5b71efe70d3df7e0ecd752dfbae74414d32d0720))
7
+
1
8
  ## [10.17.1](https://gitlab.com/gitlab-org/duo-ui/compare/v10.17.0...v10.17.1) (2025-08-21)
2
9
 
3
10
 
@@ -233,7 +233,7 @@ var script = {
233
233
  const __vue_script__ = script;
234
234
 
235
235
  /* template */
236
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.selections.length)?_c('duo-chat-context-item-selections',{staticClass:"gl-mb-3",attrs:{"selections":_vm.selections,"removable":true,"title":_vm.$options.i18n.selectedContextItemsTitle,"default-collapsed":false,"data-testid":"primary-context-item-selections"},on:{"remove":_vm.removeItem,"get-content":_vm.onGetContextItemContent}}):_vm._e(),_vm._v(" "),(_vm.open)?_c('div',{attrs:{"tabindex":"0","data-testid":"context-item-menu-wrapper"},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }return _vm.handleEsc.apply(null, arguments)}}},[_c('gl-card',{staticClass:"slash-commands !gl-absolute gl-bottom-0 gl-w-full gl-pl-0 gl-shadow-md",attrs:{"body-class":"!gl-p-2","data-testid":"context-item-menu"}},[_c('div',{staticClass:"gl-mb-2 gl-flex"},[(_vm.selectedCategory)?_c('gl-button',{staticClass:"!gl-shadow-none",attrs:{"size":"small","icon":"chevron-lg-left","aria-label":"Go back","data-testid":"context-item-menu-back-button"},on:{"click":function($event){return _vm.handleEsc()}}}):_vm._e(),_vm._v(" "),_c('gl-button',{staticClass:"gl-ml-auto !gl-shadow-none",attrs:{"size":"small","icon":"close","aria-label":"Close menu","data-testid":"context-item-menu-close-button"},on:{"click":function($event){return _vm.closeMenu()}}})],1),_vm._v(" "),(_vm.showCategorySelection)?_c('duo-chat-context-item-menu-category-items',{attrs:{"active-index":_vm.activeIndex,"categories":_vm.categories},on:{"select":_vm.selectCategory,"active-index-change":function($event){_vm.activeIndex = $event;}}}):_c('duo-chat-context-item-menu-search-items',{attrs:{"active-index":_vm.activeIndex,"category":_vm.selectedCategory,"loading":_vm.loading,"error":_vm.error,"results":_vm.results},on:{"select":_vm.selectItem,"keyup":_vm.handleKeyUp,"active-index-change":function($event){_vm.activeIndex = $event;}},model:{value:(_vm.searchQuery),callback:function ($$v) {_vm.searchQuery=$$v;},expression:"searchQuery"}}),_vm._v(" "),(_vm.selections.length)?_c('duo-chat-context-item-selections',{staticClass:"!gl-mb-0 gl-mt-2 gl-max-h-13 gl-overflow-y-auto",attrs:{"selections":_vm.selections,"removable":true,"title":_vm.$options.i18n.selectedContextItemsTitle,"default-collapsed":false,"data-testid":"in-menu-context-item-selections"},on:{"remove":_vm.removeItem,"get-content":_vm.onGetContextItemContent}}):_vm._e()],1)],1):_vm._e()],1)};
236
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.selections.length)?_c('duo-chat-context-item-selections',{staticClass:"gl-mb-3",attrs:{"selections":_vm.selections,"removable":true,"title":_vm.$options.i18n.selectedContextItemsTitle,"default-collapsed":false,"data-testid":"primary-context-item-selections"},on:{"remove":_vm.removeItem,"get-content":_vm.onGetContextItemContent}}):_vm._e(),_vm._v(" "),(_vm.open)?_c('div',{attrs:{"tabindex":"0","data-testid":"context-item-menu-wrapper"},on:{"keyup":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }return _vm.handleEsc.apply(null, arguments)}}},[_c('gl-card',{staticClass:"slash-commands !gl-absolute gl-bottom-0 gl-w-full gl-pl-0 gl-shadow-md",attrs:{"body-class":"!gl-p-2","data-testid":"context-item-menu"}},[_c('div',{staticClass:"gl-mb-2 gl-flex"},[(_vm.selectedCategory)?_c('gl-button',{staticClass:"!gl-shadow-none",attrs:{"size":"small","icon":"chevron-lg-left","aria-label":"Go back","data-testid":"context-item-menu-back-button"},on:{"click":function($event){return _vm.handleEsc()}}}):_vm._e(),_vm._v(" "),_c('gl-button',{staticClass:"gl-ml-auto !gl-shadow-none",attrs:{"size":"small","icon":"close","aria-label":"Close menu","data-testid":"context-item-menu-close-button"},on:{"click":function($event){return _vm.closeMenu()}}})],1),_vm._v(" "),(_vm.showCategorySelection)?_c('duo-chat-context-item-menu-category-items',{attrs:{"active-index":_vm.activeIndex,"categories":_vm.categories},on:{"select":_vm.selectCategory,"active-index-change":function($event){_vm.activeIndex = $event;}}}):_c('duo-chat-context-item-menu-search-items',{attrs:{"active-index":_vm.activeIndex,"category":_vm.selectedCategory,"loading":_vm.loading,"error":_vm.error,"results":_vm.results},on:{"select":_vm.selectItem,"keyup":function($event){$event.stopPropagation();return _vm.handleKeyUp.apply(null, arguments)},"active-index-change":function($event){_vm.activeIndex = $event;}},model:{value:(_vm.searchQuery),callback:function ($$v) {_vm.searchQuery=$$v;},expression:"searchQuery"}}),_vm._v(" "),(_vm.selections.length)?_c('duo-chat-context-item-selections',{staticClass:"!gl-mb-0 gl-mt-2 gl-max-h-13 gl-overflow-y-auto",attrs:{"selections":_vm.selections,"removable":true,"title":_vm.$options.i18n.selectedContextItemsTitle,"default-collapsed":false,"data-testid":"in-menu-context-item-selections"},on:{"remove":_vm.removeItem,"get-content":_vm.onGetContextItemContent}}):_vm._e()],1)],1):_vm._e()],1)};
237
237
  var __vue_staticRenderFns__ = [];
238
238
 
239
239
  /* style */
@@ -98,11 +98,11 @@ var script = {
98
98
  const __vue_script__ = script;
99
99
 
100
100
  /* template */
101
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"gl-max-h-31 gl-overflow-y-scroll"},[(_vm.loading)?_c('duo-chat-context-item-menu-search-items-loading',{attrs:{"rows":_vm.numLoadingItems}}):(_vm.error)?_c('gl-alert',{staticClass:"gl-m-3",attrs:{"variant":"danger","dismissible":false,"data-testid":"search-results-error"}},[_vm._v("\n "+_vm._s(_vm.error)+"\n ")]):(_vm.showEmptyState)?_c('div',{staticClass:"gl-rounded-base gl-p-3 gl-text-center gl-text-secondary",attrs:{"data-testid":"search-results-empty-state"}},[_vm._v("\n "+_vm._s(_vm.$options.i18n.emptyStateMessage)+"\n ")]):_c('ul',{staticClass:"gl-mb-1 gl-list-none gl-flex-row gl-pl-0"},_vm._l((_vm.results),function(contextItem,index){return _c('gl-dropdown-item',{key:contextItem.id,staticClass:"duo-chat-context-search-result-item",class:{
101
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{on:{"keyup":_vm.handleKeyUp}},[_c('div',{staticClass:"gl-max-h-31 gl-overflow-y-scroll"},[(_vm.loading)?_c('duo-chat-context-item-menu-search-items-loading',{attrs:{"rows":_vm.numLoadingItems}}):(_vm.error)?_c('gl-alert',{staticClass:"gl-m-3",attrs:{"variant":"danger","dismissible":false,"data-testid":"search-results-error"}},[_vm._v("\n "+_vm._s(_vm.error)+"\n ")]):(_vm.showEmptyState)?_c('div',{staticClass:"gl-rounded-base gl-p-3 gl-text-center gl-text-secondary",attrs:{"data-testid":"search-results-empty-state"}},[_vm._v("\n "+_vm._s(_vm.$options.i18n.emptyStateMessage)+"\n ")]):_c('ul',{staticClass:"gl-mb-1 gl-list-none gl-flex-row gl-pl-0"},_vm._l((_vm.results),function(contextItem,index){return _c('gl-dropdown-item',{key:contextItem.id,staticClass:"duo-chat-context-search-result-item",class:{
102
102
  'active-command': _vm.isActiveItem(contextItem, index),
103
103
  'gl-cursor-not-allowed [&>button]:focus-within:!gl-shadow-none':
104
104
  !contextItem.metadata.enabled,
105
- },attrs:{"id":("dropdown-item-" + index),"tabindex":!contextItem.metadata.enabled ? -1 : undefined,"data-testid":"search-result-item"},on:{"click":function($event){return _vm.selectItem(contextItem)}}},[_c('div',{on:{"mouseenter":function($event){return _vm.setActiveIndex(index)}}},[_c('duo-chat-context-item-menu-search-item',{class:{ 'gl-text-secondary': !contextItem.metadata.enabled },attrs:{"context-item":contextItem,"category":_vm.category,"data-testid":"search-result-item-details"}})],1)])}),1)],1),_vm._v(" "),_c('gl-form-input',{ref:"contextMenuSearchInput",attrs:{"value":_vm.searchQuery,"placeholder":_vm.searchInputPlaceholder,"autofocus":"","data-testid":"context-menu-search-input"},on:{"input":function($event){return _vm.$emit('update:searchQuery', $event)},"keyup":_vm.handleKeyUp}})],1)};
105
+ },attrs:{"id":("dropdown-item-" + index),"tabindex":!contextItem.metadata.enabled ? -1 : undefined,"data-testid":"search-result-item"},on:{"click":function($event){return _vm.selectItem(contextItem)}}},[_c('div',{on:{"mouseenter":function($event){return _vm.setActiveIndex(index)}}},[_c('duo-chat-context-item-menu-search-item',{class:{ 'gl-text-secondary': !contextItem.metadata.enabled },attrs:{"context-item":contextItem,"category":_vm.category,"data-testid":"search-result-item-details"}})],1)])}),1)],1),_vm._v(" "),_c('gl-form-input',{ref:"contextMenuSearchInput",attrs:{"value":_vm.searchQuery,"placeholder":_vm.searchInputPlaceholder,"autofocus":"","data-testid":"context-menu-search-input"},on:{"input":function($event){return _vm.$emit('update:searchQuery', $event)}}})],1)};
106
106
  var __vue_staticRenderFns__ = [];
107
107
 
108
108
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/duo-ui",
3
- "version": "10.17.1",
3
+ "version": "10.17.2",
4
4
  "description": "Duo UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -251,7 +251,7 @@ export default {
251
251
  @remove="removeItem"
252
252
  @get-content="onGetContextItemContent"
253
253
  />
254
- <div v-if="open" tabindex="0" data-testid="context-item-menu-wrapper" @keydown.esc="handleEsc">
254
+ <div v-if="open" tabindex="0" data-testid="context-item-menu-wrapper" @keyup.esc="handleEsc">
255
255
  <gl-card
256
256
  class="slash-commands !gl-absolute gl-bottom-0 gl-w-full gl-pl-0 gl-shadow-md"
257
257
  body-class="!gl-p-2"
@@ -293,7 +293,7 @@ export default {
293
293
  :error="error"
294
294
  :results="results"
295
295
  @select="selectItem"
296
- @keyup="handleKeyUp"
296
+ @keyup.stop="handleKeyUp"
297
297
  @active-index-change="activeIndex = $event"
298
298
  />
299
299
  <duo-chat-context-item-selections
@@ -99,7 +99,7 @@ export default {
99
99
  };
100
100
  </script>
101
101
  <template>
102
- <div>
102
+ <div @keyup="handleKeyUp">
103
103
  <div class="gl-max-h-31 gl-overflow-y-scroll">
104
104
  <duo-chat-context-item-menu-search-items-loading v-if="loading" :rows="numLoadingItems" />
105
105
  <gl-alert
@@ -151,7 +151,6 @@ export default {
151
151
  autofocus
152
152
  data-testid="context-menu-search-input"
153
153
  @input="$emit('update:searchQuery', $event)"
154
- @keyup="handleKeyUp"
155
154
  />
156
155
  </div>
157
156
  </template>