@gitlab/ui 87.1.1 → 87.1.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
|
+
## [87.1.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v87.1.1...v87.1.2) (2024-07-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add cancel case to isStreaming state ([86e84bd](https://gitlab.com/gitlab-org/gitlab-ui/commit/86e84bd5db5782f603d0ca252420db792477bcd1))
|
|
7
|
+
|
|
1
8
|
## [87.1.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v87.1.0...v87.1.1) (2024-07-24)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -232,8 +232,11 @@ var script = {
|
|
|
232
232
|
return ((_this$lastMessage = this.lastMessage) === null || _this$lastMessage === void 0 ? void 0 : _this$lastMessage.content) === CHAT_RESET_MESSAGE;
|
|
233
233
|
},
|
|
234
234
|
isStreaming() {
|
|
235
|
-
var _this$lastMessage2, _this$
|
|
236
|
-
|
|
235
|
+
var _this$lastMessage2, _this$lastMessage3, _this$lastMessage3$ch, _this$lastMessage4, _this$lastMessage5;
|
|
236
|
+
if (this.canceledRequestIds.includes((_this$lastMessage2 = this.lastMessage) === null || _this$lastMessage2 === void 0 ? void 0 : _this$lastMessage2.requestId)) {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
return Boolean(((_this$lastMessage3 = this.lastMessage) === null || _this$lastMessage3 === void 0 ? void 0 : (_this$lastMessage3$ch = _this$lastMessage3.chunks) === null || _this$lastMessage3$ch === void 0 ? void 0 : _this$lastMessage3$ch.length) > 0 && !((_this$lastMessage4 = this.lastMessage) !== null && _this$lastMessage4 !== void 0 && _this$lastMessage4.content) || typeof ((_this$lastMessage5 = this.lastMessage) === null || _this$lastMessage5 === void 0 ? void 0 : _this$lastMessage5.chunkId) === 'number');
|
|
237
240
|
},
|
|
238
241
|
filteredSlashCommands() {
|
|
239
242
|
const caseInsensitivePrompt = this.prompt.toLowerCase();
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import GlBadge from '../components/base/badge/badge';
|
|
2
|
+
import GlButton from '../components/base/button/button';
|
|
2
3
|
import GlCollapsibleListbox from '../components/base/new_dropdowns/listbox/listbox';
|
|
3
4
|
import GlFormInput from '../components/base/form/form_input/form_input';
|
|
5
|
+
import GlLink from '../components/base/link/link';
|
|
4
6
|
import GlTable from '../components/base/table/table';
|
|
7
|
+
import { GlTooltipDirective } from '../directives/tooltip';
|
|
5
8
|
import TOKENS_DEFAULT from './build/json/tokens.json';
|
|
6
9
|
import TOKENS_DARK from './build/json/tokens.dark.json';
|
|
7
10
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
@@ -12,10 +15,15 @@ var script = {
|
|
|
12
15
|
TOKENS_DARK,
|
|
13
16
|
components: {
|
|
14
17
|
GlBadge,
|
|
18
|
+
GlButton,
|
|
15
19
|
GlCollapsibleListbox,
|
|
16
20
|
GlFormInput,
|
|
21
|
+
GlLink,
|
|
17
22
|
GlTable
|
|
18
23
|
},
|
|
24
|
+
directives: {
|
|
25
|
+
GlTooltip: GlTooltipDirective
|
|
26
|
+
},
|
|
19
27
|
fields: [{
|
|
20
28
|
key: 'description',
|
|
21
29
|
label: 'Description'
|
|
@@ -26,6 +34,19 @@ var script = {
|
|
|
26
34
|
data() {
|
|
27
35
|
return {
|
|
28
36
|
filter: null,
|
|
37
|
+
platforms: [{
|
|
38
|
+
value: 'name',
|
|
39
|
+
text: 'Name'
|
|
40
|
+
}, {
|
|
41
|
+
value: 'figma',
|
|
42
|
+
text: 'Figma'
|
|
43
|
+
}, {
|
|
44
|
+
value: 'css',
|
|
45
|
+
text: 'CSS'
|
|
46
|
+
}, {
|
|
47
|
+
value: 'scss',
|
|
48
|
+
text: 'SCSS'
|
|
49
|
+
}],
|
|
29
50
|
modes: [{
|
|
30
51
|
value: 'default',
|
|
31
52
|
text: 'Default'
|
|
@@ -33,6 +54,7 @@ var script = {
|
|
|
33
54
|
value: 'dark',
|
|
34
55
|
text: 'Dark'
|
|
35
56
|
}],
|
|
57
|
+
selectedPlatform: 'name',
|
|
36
58
|
selectedMode: 'default',
|
|
37
59
|
tokens: {
|
|
38
60
|
default: this.$options.TOKENS_DEFAULT,
|
|
@@ -75,7 +97,8 @@ var script = {
|
|
|
75
97
|
},
|
|
76
98
|
transformTokenToTableColumns(token) {
|
|
77
99
|
return {
|
|
78
|
-
|
|
100
|
+
id: token.path.filter(Boolean).join('-'),
|
|
101
|
+
name: this.formatTokenName(this.selectedPlatform, token),
|
|
79
102
|
type: token.$type,
|
|
80
103
|
value: token.value,
|
|
81
104
|
valueLabel: this.getValueLabel(token),
|
|
@@ -93,9 +116,19 @@ var script = {
|
|
|
93
116
|
tokensArray.push(...this.transformTokensToTableRows(token));
|
|
94
117
|
}
|
|
95
118
|
});
|
|
96
|
-
|
|
119
|
+
tokensArray
|
|
120
|
+
// Sort tokensArray by id
|
|
121
|
+
.sort((a, b) => {
|
|
122
|
+
if (a.id < b.id) {
|
|
123
|
+
return -1;
|
|
124
|
+
}
|
|
125
|
+
if (a.id > b.id) {
|
|
126
|
+
return 1;
|
|
127
|
+
}
|
|
128
|
+
return 0;
|
|
129
|
+
})
|
|
97
130
|
// Sort tokensArray so deprecated items are last
|
|
98
|
-
|
|
131
|
+
.sort((a, b) => {
|
|
99
132
|
if (a.deprecated && !b.deprecated) {
|
|
100
133
|
return 1;
|
|
101
134
|
}
|
|
@@ -105,6 +138,32 @@ var script = {
|
|
|
105
138
|
return 0;
|
|
106
139
|
});
|
|
107
140
|
return tokensArray;
|
|
141
|
+
},
|
|
142
|
+
formatTokenName(format, token) {
|
|
143
|
+
let figmaPrefix = '';
|
|
144
|
+
const prefix = token.prefix === false ? '' : 'gl';
|
|
145
|
+
switch (format) {
|
|
146
|
+
case 'figma':
|
|
147
|
+
if (token.filePath.match('contextual')) {
|
|
148
|
+
figmaPrefix = '🔒/';
|
|
149
|
+
}
|
|
150
|
+
if (token.deprecated) {
|
|
151
|
+
figmaPrefix = '⚠️ DEPRECATED/';
|
|
152
|
+
}
|
|
153
|
+
return `${figmaPrefix}${token.path.filter(Boolean).join('-')}`;
|
|
154
|
+
case 'css':
|
|
155
|
+
return `var(--${[prefix, ...token.path].filter(Boolean).join('-')})`;
|
|
156
|
+
case 'scss':
|
|
157
|
+
return `$${[prefix, ...token.path].filter(Boolean).join('-')}`;
|
|
158
|
+
default:
|
|
159
|
+
return token.path.filter(Boolean).join('.');
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
getTokenName(token) {
|
|
163
|
+
return `$${token.prefix === false ? '' : 'gl-'}${token.path.filter(Boolean).join('-')}`;
|
|
164
|
+
},
|
|
165
|
+
copyToClipboard(value) {
|
|
166
|
+
navigator.clipboard.writeText(value);
|
|
108
167
|
}
|
|
109
168
|
}
|
|
110
169
|
};
|
|
@@ -113,12 +172,12 @@ var script = {
|
|
|
113
172
|
const __vue_script__ = script;
|
|
114
173
|
|
|
115
174
|
/* template */
|
|
116
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"gl-mb-5 gl-flex gl-items-center gl-gap-3"},[_c('gl-form-input',{attrs:{"placeholder":"Type to search"},model:{value:(_vm.filter),callback:function ($$v) {_vm.filter=$$v;},expression:"filter"}}),_vm._v(" "),_c('gl-collapsible-listbox',{attrs:{"
|
|
175
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('p',{staticClass:"gl-text-sm gl-text-subtle"},[_vm._v("\n For full token details, see\n "),_c('gl-link',{attrs:{"href":"https://gitlab.com/gitlab-org/gitlab-ui/-/tree/main/src/tokens/build/json","target":"_blank"}},[_vm._v("https://gitlab.com/gitlab-org/gitlab-ui/-/tree/main/src/tokens/build/json")])],1),_vm._v(" "),_c('div',{staticClass:"gl-mb-5 gl-flex gl-items-center gl-gap-3"},[_c('gl-form-input',{attrs:{"placeholder":"Type to search"},model:{value:(_vm.filter),callback:function ($$v) {_vm.filter=$$v;},expression:"filter"}}),_vm._v(" "),_c('gl-collapsible-listbox',{attrs:{"selected":_vm.selectedPlatform,"items":_vm.platforms},on:{"search":function($event){_vm.query = $event;}},model:{value:(_vm.selectedPlatform),callback:function ($$v) {_vm.selectedPlatform=$$v;},expression:"selectedPlatform"}}),_vm._v(" "),_c('gl-collapsible-listbox',{attrs:{"selected":_vm.selectedMode,"items":_vm.modes},on:{"search":function($event){_vm.query = $event;}},model:{value:(_vm.selectedMode),callback:function ($$v) {_vm.selectedMode=$$v;},expression:"selectedMode"}})],1),_vm._v(" "),_c('gl-table',{attrs:{"filter":_vm.filter,"items":_vm.items,"fields":_vm.$options.fields,"tbody-tr-attr":function (item) { return ({ id: item.id }); },"hover":"","stacked":"sm"},scopedSlots:_vm._u([{key:"cell(description)",fn:function(ref){
|
|
117
176
|
var ref_item = ref.item;
|
|
118
177
|
var name = ref_item.name;
|
|
119
178
|
var deprecated = ref_item.deprecated;
|
|
120
179
|
var description = ref_item.description;
|
|
121
|
-
return [_c('code',{staticClass:"gl-text-base gl-text-strong"},[_vm._v("\n "+_vm._s(name)+"\n
|
|
180
|
+
return [_c('code',{staticClass:"gl-text-base gl-text-strong"},[_vm._v("\n "+_vm._s(name)+"\n "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],attrs:{"title":("Copy " + _vm.selectedPlatform + " value to clipboard"),"icon":"copy-to-clipboard","aria-label":("Copy " + _vm.selectedPlatform + " value to clipboard"),"size":"small"},on:{"click":function($event){return _vm.copyToClipboard(name)}}})],1),_vm._v(" "),(deprecated)?_c('gl-badge',{attrs:{"variant":"danger"}},[_vm._v("Deprecated")]):_vm._e(),_vm._v(" "),(description)?_c('div',{staticClass:"gl-mt-3 gl-text-subtle"},[_vm._v("\n "+_vm._s(description)+"\n ")]):_vm._e()]}},{key:"cell(value)",fn:function(ref){
|
|
122
181
|
var ref_item = ref.item;
|
|
123
182
|
var type = ref_item.type;
|
|
124
183
|
var value = ref_item.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "87.1.
|
|
3
|
+
"version": "87.1.2",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"@gitlab/eslint-plugin": "19.6.0",
|
|
115
115
|
"@gitlab/fonts": "^1.3.0",
|
|
116
116
|
"@gitlab/stylelint-config": "6.1.0",
|
|
117
|
-
"@gitlab/svgs": "3.
|
|
117
|
+
"@gitlab/svgs": "3.109.0",
|
|
118
118
|
"@jest/test-sequencer": "^29.7.0",
|
|
119
119
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
120
120
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
@@ -172,8 +172,8 @@
|
|
|
172
172
|
"module-alias": "^2.2.2",
|
|
173
173
|
"npm-run-all": "^4.1.5",
|
|
174
174
|
"pikaday": "^1.8.0",
|
|
175
|
-
"playwright": "^1.45.
|
|
176
|
-
"playwright-core": "^1.45.
|
|
175
|
+
"playwright": "^1.45.3",
|
|
176
|
+
"playwright-core": "^1.45.3",
|
|
177
177
|
"plop": "^2.5.4",
|
|
178
178
|
"postcss": "8.4.28",
|
|
179
179
|
"postcss-loader": "^7.0.2",
|
|
@@ -241,6 +241,9 @@ export default {
|
|
|
241
241
|
return this.lastMessage?.content === CHAT_RESET_MESSAGE;
|
|
242
242
|
},
|
|
243
243
|
isStreaming() {
|
|
244
|
+
if (this.canceledRequestIds.includes(this.lastMessage?.requestId)) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
244
247
|
return Boolean(
|
|
245
248
|
(this.lastMessage?.chunks?.length > 0 && !this.lastMessage?.content) ||
|
|
246
249
|
typeof this.lastMessage?.chunkId === 'number'
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import GlBadge from '../components/base/badge/badge.vue';
|
|
3
|
+
import GlButton from '../components/base/button/button.vue';
|
|
3
4
|
import GlCollapsibleListbox from '../components/base/new_dropdowns/listbox/listbox.vue';
|
|
4
5
|
import GlFormInput from '../components/base/form/form_input/form_input.vue';
|
|
6
|
+
import GlLink from '../components/base/link/link.vue';
|
|
5
7
|
import GlTable from '../components/base/table/table.vue';
|
|
8
|
+
import { GlTooltipDirective } from '../directives/tooltip';
|
|
6
9
|
import TOKENS_DEFAULT from './build/json/tokens.json';
|
|
7
10
|
import TOKENS_DARK from './build/json/tokens.dark.json';
|
|
8
11
|
|
|
@@ -12,10 +15,15 @@ export default {
|
|
|
12
15
|
TOKENS_DARK,
|
|
13
16
|
components: {
|
|
14
17
|
GlBadge,
|
|
18
|
+
GlButton,
|
|
15
19
|
GlCollapsibleListbox,
|
|
16
20
|
GlFormInput,
|
|
21
|
+
GlLink,
|
|
17
22
|
GlTable,
|
|
18
23
|
},
|
|
24
|
+
directives: {
|
|
25
|
+
GlTooltip: GlTooltipDirective,
|
|
26
|
+
},
|
|
19
27
|
fields: [
|
|
20
28
|
{
|
|
21
29
|
key: 'description',
|
|
@@ -29,6 +37,24 @@ export default {
|
|
|
29
37
|
data() {
|
|
30
38
|
return {
|
|
31
39
|
filter: null,
|
|
40
|
+
platforms: [
|
|
41
|
+
{
|
|
42
|
+
value: 'name',
|
|
43
|
+
text: 'Name',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: 'figma',
|
|
47
|
+
text: 'Figma',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: 'css',
|
|
51
|
+
text: 'CSS',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: 'scss',
|
|
55
|
+
text: 'SCSS',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
32
58
|
modes: [
|
|
33
59
|
{
|
|
34
60
|
value: 'default',
|
|
@@ -39,6 +65,7 @@ export default {
|
|
|
39
65
|
text: 'Dark',
|
|
40
66
|
},
|
|
41
67
|
],
|
|
68
|
+
selectedPlatform: 'name',
|
|
42
69
|
selectedMode: 'default',
|
|
43
70
|
tokens: {
|
|
44
71
|
default: this.$options.TOKENS_DEFAULT,
|
|
@@ -81,7 +108,8 @@ export default {
|
|
|
81
108
|
},
|
|
82
109
|
transformTokenToTableColumns(token) {
|
|
83
110
|
return {
|
|
84
|
-
|
|
111
|
+
id: token.path.filter(Boolean).join('-'),
|
|
112
|
+
name: this.formatTokenName(this.selectedPlatform, token),
|
|
85
113
|
type: token.$type,
|
|
86
114
|
value: token.value,
|
|
87
115
|
valueLabel: this.getValueLabel(token),
|
|
@@ -101,29 +129,79 @@ export default {
|
|
|
101
129
|
}
|
|
102
130
|
});
|
|
103
131
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
132
|
+
tokensArray
|
|
133
|
+
// Sort tokensArray by id
|
|
134
|
+
.sort((a, b) => {
|
|
135
|
+
if (a.id < b.id) {
|
|
136
|
+
return -1;
|
|
137
|
+
}
|
|
138
|
+
if (a.id > b.id) {
|
|
139
|
+
return 1;
|
|
140
|
+
}
|
|
141
|
+
return 0;
|
|
142
|
+
})
|
|
143
|
+
// Sort tokensArray so deprecated items are last
|
|
144
|
+
.sort((a, b) => {
|
|
145
|
+
if (a.deprecated && !b.deprecated) {
|
|
146
|
+
return 1;
|
|
147
|
+
}
|
|
148
|
+
if (!a.deprecated && b.deprecated) {
|
|
149
|
+
return -1;
|
|
150
|
+
}
|
|
151
|
+
return 0;
|
|
152
|
+
});
|
|
114
153
|
|
|
115
154
|
return tokensArray;
|
|
116
155
|
},
|
|
156
|
+
formatTokenName(format, token) {
|
|
157
|
+
let figmaPrefix = '';
|
|
158
|
+
const prefix = token.prefix === false ? '' : 'gl';
|
|
159
|
+
switch (format) {
|
|
160
|
+
case 'figma':
|
|
161
|
+
if (token.filePath.match('contextual')) {
|
|
162
|
+
figmaPrefix = '🔒/';
|
|
163
|
+
}
|
|
164
|
+
if (token.deprecated) {
|
|
165
|
+
figmaPrefix = '⚠️ DEPRECATED/';
|
|
166
|
+
}
|
|
167
|
+
return `${figmaPrefix}${token.path.filter(Boolean).join('-')}`;
|
|
168
|
+
case 'css':
|
|
169
|
+
return `var(--${[prefix, ...token.path].filter(Boolean).join('-')})`;
|
|
170
|
+
case 'scss':
|
|
171
|
+
return `$${[prefix, ...token.path].filter(Boolean).join('-')}`;
|
|
172
|
+
default:
|
|
173
|
+
return token.path.filter(Boolean).join('.');
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
getTokenName(token) {
|
|
177
|
+
return `$${token.prefix === false ? '' : 'gl-'}${token.path.filter(Boolean).join('-')}`;
|
|
178
|
+
},
|
|
179
|
+
copyToClipboard(value) {
|
|
180
|
+
navigator.clipboard.writeText(value);
|
|
181
|
+
},
|
|
117
182
|
},
|
|
118
183
|
};
|
|
119
184
|
</script>
|
|
120
185
|
|
|
121
186
|
<template>
|
|
122
187
|
<div>
|
|
188
|
+
<p class="gl-text-sm gl-text-subtle">
|
|
189
|
+
For full token details, see
|
|
190
|
+
<gl-link
|
|
191
|
+
href="https://gitlab.com/gitlab-org/gitlab-ui/-/tree/main/src/tokens/build/json"
|
|
192
|
+
target="_blank"
|
|
193
|
+
>https://gitlab.com/gitlab-org/gitlab-ui/-/tree/main/src/tokens/build/json</gl-link
|
|
194
|
+
>
|
|
195
|
+
</p>
|
|
123
196
|
<div class="gl-mb-5 gl-flex gl-items-center gl-gap-3">
|
|
124
197
|
<gl-form-input v-model="filter" placeholder="Type to search" />
|
|
125
198
|
<gl-collapsible-listbox
|
|
126
|
-
|
|
199
|
+
v-model="selectedPlatform"
|
|
200
|
+
:selected="selectedPlatform"
|
|
201
|
+
:items="platforms"
|
|
202
|
+
@search="query = $event"
|
|
203
|
+
/>
|
|
204
|
+
<gl-collapsible-listbox
|
|
127
205
|
v-model="selectedMode"
|
|
128
206
|
:selected="selectedMode"
|
|
129
207
|
:items="modes"
|
|
@@ -134,13 +212,21 @@ export default {
|
|
|
134
212
|
:filter="filter"
|
|
135
213
|
:items="items"
|
|
136
214
|
:fields="$options.fields"
|
|
137
|
-
:tbody-tr-attr="(item) => ({ id: item.
|
|
215
|
+
:tbody-tr-attr="(item) => ({ id: item.id })"
|
|
138
216
|
hover
|
|
139
217
|
stacked="sm"
|
|
140
218
|
>
|
|
141
219
|
<template #cell(description)="{ item: { name, deprecated, description } }">
|
|
142
220
|
<code class="gl-text-base gl-text-strong">
|
|
143
221
|
{{ name }}
|
|
222
|
+
<gl-button
|
|
223
|
+
v-gl-tooltip
|
|
224
|
+
:title="`Copy ${selectedPlatform} value to clipboard`"
|
|
225
|
+
icon="copy-to-clipboard"
|
|
226
|
+
:aria-label="`Copy ${selectedPlatform} value to clipboard`"
|
|
227
|
+
size="small"
|
|
228
|
+
@click="copyToClipboard(name)"
|
|
229
|
+
/>
|
|
144
230
|
</code>
|
|
145
231
|
<gl-badge v-if="deprecated" variant="danger">Deprecated</gl-badge>
|
|
146
232
|
<div v-if="description" class="gl-mt-3 gl-text-subtle">
|