@gitlab/ui 87.6.1 → 87.8.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 +14 -0
- package/bin/migrate_custom_utils_to_tw.bundled.mjs +51 -46
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +4 -1
- package/dist/components/base/new_dropdowns/listbox/listbox.js +4 -1
- package/dist/config.js +22 -3
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/tokens/build/js/tokens.dark.js +96 -78
- package/dist/tokens/build/js/tokens.js +96 -78
- package/dist/tokens/css/tokens.css +95 -77
- package/dist/tokens/css/tokens.dark.css +95 -77
- package/dist/tokens/js/tokens.dark.js +95 -77
- package/dist/tokens/js/tokens.js +95 -77
- package/dist/tokens/json/tokens.dark.json +6046 -5624
- package/dist/tokens/json/tokens.json +6046 -5624
- package/dist/tokens/scss/_tokens.dark.scss +95 -77
- package/dist/tokens/scss/_tokens.scss +95 -77
- package/dist/tokens/scss/_tokens_custom_properties.scss +95 -77
- package/package.json +4 -4
- package/src/components/base/avatars_inline/avatars_inline.scss +2 -2
- package/src/components/base/badge/badge.scss +63 -63
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +4 -1
- package/src/components/base/new_dropdowns/listbox/listbox.vue +4 -1
- package/src/config.js +21 -2
- package/src/tokens/build/css/tokens.css +95 -77
- package/src/tokens/build/css/tokens.dark.css +95 -77
- package/src/tokens/build/js/tokens.dark.js +95 -77
- package/src/tokens/build/js/tokens.js +95 -77
- package/src/tokens/build/json/tokens.dark.json +6046 -5624
- package/src/tokens/build/json/tokens.json +6046 -5624
- package/src/tokens/build/scss/_tokens.dark.scss +95 -77
- package/src/tokens/build/scss/_tokens.scss +95 -77
- package/src/tokens/build/scss/_tokens_custom_properties.scss +95 -77
- package/src/tokens/contextual/badge.tokens.json +704 -0
- package/src/tokens/status.tokens.json +90 -640
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [87.8.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v87.7.0...v87.8.0) (2024-08-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **DesignTokens:** separate badge from status design tokens ([280f390](https://gitlab.com/gitlab-org/gitlab-ui/commit/280f390f9a978362c71871beea8b7400832828e8))
|
|
7
|
+
|
|
8
|
+
# [87.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v87.6.1...v87.7.0) (2024-08-01)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* Add boolean flag for improvedHideHeuristics in Config ([1fa7037](https://gitlab.com/gitlab-org/gitlab-ui/commit/1fa703735f10a3cfa3539c3c7d5d7950a6c6257e))
|
|
14
|
+
|
|
1
15
|
## [87.6.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v87.6.0...v87.6.1) (2024-08-01)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -91778,7 +91778,7 @@ var require_utils5 = __commonJS({
|
|
|
91778
91778
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
91779
91779
|
};
|
|
91780
91780
|
exports.escapeNode = (block, n = 0, type2) => {
|
|
91781
|
-
|
|
91781
|
+
const node = block.nodes[n];
|
|
91782
91782
|
if (!node)
|
|
91783
91783
|
return;
|
|
91784
91784
|
if (type2 && node.type === type2 || node.type === "open" || node.type === "close") {
|
|
@@ -91829,8 +91829,14 @@ var require_utils5 = __commonJS({
|
|
|
91829
91829
|
const result = [];
|
|
91830
91830
|
const flat = (arr) => {
|
|
91831
91831
|
for (let i3 = 0; i3 < arr.length; i3++) {
|
|
91832
|
-
|
|
91833
|
-
Array.isArray(ele)
|
|
91832
|
+
const ele = arr[i3];
|
|
91833
|
+
if (Array.isArray(ele)) {
|
|
91834
|
+
flat(ele);
|
|
91835
|
+
continue;
|
|
91836
|
+
}
|
|
91837
|
+
if (ele !== void 0) {
|
|
91838
|
+
result.push(ele);
|
|
91839
|
+
}
|
|
91834
91840
|
}
|
|
91835
91841
|
return result;
|
|
91836
91842
|
};
|
|
@@ -91846,9 +91852,9 @@ var require_stringify2 = __commonJS({
|
|
|
91846
91852
|
"use strict";
|
|
91847
91853
|
var utils2 = require_utils5();
|
|
91848
91854
|
module.exports = (ast, options8 = {}) => {
|
|
91849
|
-
|
|
91850
|
-
|
|
91851
|
-
|
|
91855
|
+
const stringify = (node, parent = {}) => {
|
|
91856
|
+
const invalidBlock = options8.escapeInvalid && utils2.isInvalidBrace(parent);
|
|
91857
|
+
const invalidNode = node.invalid === true && options8.escapeInvalid === true;
|
|
91852
91858
|
let output = "";
|
|
91853
91859
|
if (node.value) {
|
|
91854
91860
|
if ((invalidBlock || invalidNode) && utils2.isOpenOrClose(node)) {
|
|
@@ -91860,7 +91866,7 @@ var require_stringify2 = __commonJS({
|
|
|
91860
91866
|
return node.value;
|
|
91861
91867
|
}
|
|
91862
91868
|
if (node.nodes) {
|
|
91863
|
-
for (
|
|
91869
|
+
for (const child of node.nodes) {
|
|
91864
91870
|
output += stringify(child);
|
|
91865
91871
|
}
|
|
91866
91872
|
}
|
|
@@ -92152,7 +92158,7 @@ var require_fill_range2 = __commonJS({
|
|
|
92152
92158
|
input = "0" + input;
|
|
92153
92159
|
return negative ? "-" + input : input;
|
|
92154
92160
|
};
|
|
92155
|
-
var toSequence = (parts, options8) => {
|
|
92161
|
+
var toSequence = (parts, options8, maxLen) => {
|
|
92156
92162
|
parts.negatives.sort((a3, b6) => a3 < b6 ? -1 : a3 > b6 ? 1 : 0);
|
|
92157
92163
|
parts.positives.sort((a3, b6) => a3 < b6 ? -1 : a3 > b6 ? 1 : 0);
|
|
92158
92164
|
let prefix = options8.capture ? "" : "?:";
|
|
@@ -92160,10 +92166,10 @@ var require_fill_range2 = __commonJS({
|
|
|
92160
92166
|
let negatives = "";
|
|
92161
92167
|
let result;
|
|
92162
92168
|
if (parts.positives.length) {
|
|
92163
|
-
positives = parts.positives.join("|");
|
|
92169
|
+
positives = parts.positives.map((v5) => toMaxLen(String(v5), maxLen)).join("|");
|
|
92164
92170
|
}
|
|
92165
92171
|
if (parts.negatives.length) {
|
|
92166
|
-
negatives = `-(${prefix}${parts.negatives.join("|")})`;
|
|
92172
|
+
negatives = `-(${prefix}${parts.negatives.map((v5) => toMaxLen(String(v5), maxLen)).join("|")})`;
|
|
92167
92173
|
}
|
|
92168
92174
|
if (positives && negatives) {
|
|
92169
92175
|
result = `${positives}|${negatives}`;
|
|
@@ -92245,7 +92251,7 @@ var require_fill_range2 = __commonJS({
|
|
|
92245
92251
|
index++;
|
|
92246
92252
|
}
|
|
92247
92253
|
if (options8.toRegex === true) {
|
|
92248
|
-
return step > 1 ? toSequence(parts, options8) : toRegex(range, null, { wrap: false, ...options8 });
|
|
92254
|
+
return step > 1 ? toSequence(parts, options8, maxLen) : toRegex(range, null, { wrap: false, ...options8 });
|
|
92249
92255
|
}
|
|
92250
92256
|
return range;
|
|
92251
92257
|
};
|
|
@@ -92312,16 +92318,17 @@ var require_compile2 = __commonJS({
|
|
|
92312
92318
|
var fill3 = require_fill_range2();
|
|
92313
92319
|
var utils2 = require_utils5();
|
|
92314
92320
|
var compile = (ast, options8 = {}) => {
|
|
92315
|
-
|
|
92316
|
-
|
|
92317
|
-
|
|
92318
|
-
|
|
92319
|
-
|
|
92321
|
+
const walk = (node, parent = {}) => {
|
|
92322
|
+
const invalidBlock = utils2.isInvalidBrace(parent);
|
|
92323
|
+
const invalidNode = node.invalid === true && options8.escapeInvalid === true;
|
|
92324
|
+
const invalid = invalidBlock === true || invalidNode === true;
|
|
92325
|
+
const prefix = options8.escapeInvalid === true ? "\\" : "";
|
|
92320
92326
|
let output = "";
|
|
92321
92327
|
if (node.isOpen === true) {
|
|
92322
92328
|
return prefix + node.value;
|
|
92323
92329
|
}
|
|
92324
92330
|
if (node.isClose === true) {
|
|
92331
|
+
console.log("node.isClose", prefix, node.value);
|
|
92325
92332
|
return prefix + node.value;
|
|
92326
92333
|
}
|
|
92327
92334
|
if (node.type === "open") {
|
|
@@ -92337,14 +92344,14 @@ var require_compile2 = __commonJS({
|
|
|
92337
92344
|
return node.value;
|
|
92338
92345
|
}
|
|
92339
92346
|
if (node.nodes && node.ranges > 0) {
|
|
92340
|
-
|
|
92341
|
-
|
|
92347
|
+
const args = utils2.reduce(node.nodes);
|
|
92348
|
+
const range = fill3(...args, { ...options8, wrap: false, toRegex: true, strictZeros: true });
|
|
92342
92349
|
if (range.length !== 0) {
|
|
92343
92350
|
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
92344
92351
|
}
|
|
92345
92352
|
}
|
|
92346
92353
|
if (node.nodes) {
|
|
92347
|
-
for (
|
|
92354
|
+
for (const child of node.nodes) {
|
|
92348
92355
|
output += walk(child, node);
|
|
92349
92356
|
}
|
|
92350
92357
|
}
|
|
@@ -92364,7 +92371,7 @@ var require_expand2 = __commonJS({
|
|
|
92364
92371
|
var stringify = require_stringify2();
|
|
92365
92372
|
var utils2 = require_utils5();
|
|
92366
92373
|
var append = (queue = "", stash = "", enclose = false) => {
|
|
92367
|
-
|
|
92374
|
+
const result = [];
|
|
92368
92375
|
queue = [].concat(queue);
|
|
92369
92376
|
stash = [].concat(stash);
|
|
92370
92377
|
if (!stash.length)
|
|
@@ -92372,9 +92379,9 @@ var require_expand2 = __commonJS({
|
|
|
92372
92379
|
if (!queue.length) {
|
|
92373
92380
|
return enclose ? utils2.flatten(stash).map((ele) => `{${ele}}`) : stash;
|
|
92374
92381
|
}
|
|
92375
|
-
for (
|
|
92382
|
+
for (const item of queue) {
|
|
92376
92383
|
if (Array.isArray(item)) {
|
|
92377
|
-
for (
|
|
92384
|
+
for (const value2 of item) {
|
|
92378
92385
|
result.push(append(value2, stash, enclose));
|
|
92379
92386
|
}
|
|
92380
92387
|
} else {
|
|
@@ -92388,8 +92395,8 @@ var require_expand2 = __commonJS({
|
|
|
92388
92395
|
return utils2.flatten(result);
|
|
92389
92396
|
};
|
|
92390
92397
|
var expand = (ast, options8 = {}) => {
|
|
92391
|
-
|
|
92392
|
-
|
|
92398
|
+
const rangeLimit = options8.rangeLimit === void 0 ? 1e3 : options8.rangeLimit;
|
|
92399
|
+
const walk = (node, parent = {}) => {
|
|
92393
92400
|
node.queue = [];
|
|
92394
92401
|
let p4 = parent;
|
|
92395
92402
|
let q11 = parent.queue;
|
|
@@ -92406,7 +92413,7 @@ var require_expand2 = __commonJS({
|
|
|
92406
92413
|
return;
|
|
92407
92414
|
}
|
|
92408
92415
|
if (node.nodes && node.ranges > 0) {
|
|
92409
|
-
|
|
92416
|
+
const args = utils2.reduce(node.nodes);
|
|
92410
92417
|
if (utils2.exceedsLimit(...args, options8.step, rangeLimit)) {
|
|
92411
92418
|
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
92412
92419
|
}
|
|
@@ -92418,7 +92425,7 @@ var require_expand2 = __commonJS({
|
|
|
92418
92425
|
node.nodes = [];
|
|
92419
92426
|
return;
|
|
92420
92427
|
}
|
|
92421
|
-
|
|
92428
|
+
const enclose = utils2.encloseBrace(node);
|
|
92422
92429
|
let queue = node.queue;
|
|
92423
92430
|
let block = node;
|
|
92424
92431
|
while (block.type !== "brace" && block.type !== "root" && block.parent) {
|
|
@@ -92426,7 +92433,7 @@ var require_expand2 = __commonJS({
|
|
|
92426
92433
|
queue = block.queue;
|
|
92427
92434
|
}
|
|
92428
92435
|
for (let i3 = 0; i3 < node.nodes.length; i3++) {
|
|
92429
|
-
|
|
92436
|
+
const child = node.nodes[i3];
|
|
92430
92437
|
if (child.type === "comma" && node.type === "brace") {
|
|
92431
92438
|
if (i3 === 1)
|
|
92432
92439
|
queue.push("");
|
|
@@ -92458,7 +92465,7 @@ var require_constants5 = __commonJS({
|
|
|
92458
92465
|
"node_modules/braces/lib/constants.js"(exports, module) {
|
|
92459
92466
|
"use strict";
|
|
92460
92467
|
module.exports = {
|
|
92461
|
-
MAX_LENGTH:
|
|
92468
|
+
MAX_LENGTH: 1e4,
|
|
92462
92469
|
// Digits
|
|
92463
92470
|
CHAR_0: "0",
|
|
92464
92471
|
/* 0 */
|
|
@@ -92592,21 +92599,20 @@ var require_parse3 = __commonJS({
|
|
|
92592
92599
|
if (typeof input !== "string") {
|
|
92593
92600
|
throw new TypeError("Expected a string");
|
|
92594
92601
|
}
|
|
92595
|
-
|
|
92596
|
-
|
|
92602
|
+
const opts = options8 || {};
|
|
92603
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
92597
92604
|
if (input.length > max) {
|
|
92598
92605
|
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
92599
92606
|
}
|
|
92600
|
-
|
|
92601
|
-
|
|
92607
|
+
const ast = { type: "root", input, nodes: [] };
|
|
92608
|
+
const stack2 = [ast];
|
|
92602
92609
|
let block = ast;
|
|
92603
92610
|
let prev = ast;
|
|
92604
92611
|
let brackets = 0;
|
|
92605
|
-
|
|
92612
|
+
const length = input.length;
|
|
92606
92613
|
let index = 0;
|
|
92607
92614
|
let depth = 0;
|
|
92608
92615
|
let value2;
|
|
92609
|
-
let memo = {};
|
|
92610
92616
|
const advance = () => input[index++];
|
|
92611
92617
|
const push2 = (node) => {
|
|
92612
92618
|
if (node.type === "text" && prev.type === "dot") {
|
|
@@ -92639,7 +92645,6 @@ var require_parse3 = __commonJS({
|
|
|
92639
92645
|
}
|
|
92640
92646
|
if (value2 === CHAR_LEFT_SQUARE_BRACKET) {
|
|
92641
92647
|
brackets++;
|
|
92642
|
-
let closed = true;
|
|
92643
92648
|
let next;
|
|
92644
92649
|
while (index < length && (next = advance())) {
|
|
92645
92650
|
value2 += next;
|
|
@@ -92678,7 +92683,7 @@ var require_parse3 = __commonJS({
|
|
|
92678
92683
|
continue;
|
|
92679
92684
|
}
|
|
92680
92685
|
if (value2 === CHAR_DOUBLE_QUOTE || value2 === CHAR_SINGLE_QUOTE || value2 === CHAR_BACKTICK) {
|
|
92681
|
-
|
|
92686
|
+
const open = value2;
|
|
92682
92687
|
let next;
|
|
92683
92688
|
if (options8.keepQuotes !== true) {
|
|
92684
92689
|
value2 = "";
|
|
@@ -92700,8 +92705,8 @@ var require_parse3 = __commonJS({
|
|
|
92700
92705
|
}
|
|
92701
92706
|
if (value2 === CHAR_LEFT_CURLY_BRACE) {
|
|
92702
92707
|
depth++;
|
|
92703
|
-
|
|
92704
|
-
|
|
92708
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
|
|
92709
|
+
const brace = {
|
|
92705
92710
|
type: "brace",
|
|
92706
92711
|
open: true,
|
|
92707
92712
|
close: false,
|
|
@@ -92721,7 +92726,7 @@ var require_parse3 = __commonJS({
|
|
|
92721
92726
|
push2({ type: "text", value: value2 });
|
|
92722
92727
|
continue;
|
|
92723
92728
|
}
|
|
92724
|
-
|
|
92729
|
+
const type2 = "close";
|
|
92725
92730
|
block = stack2.pop();
|
|
92726
92731
|
block.close = true;
|
|
92727
92732
|
push2({ type: type2, value: value2 });
|
|
@@ -92732,7 +92737,7 @@ var require_parse3 = __commonJS({
|
|
|
92732
92737
|
if (value2 === CHAR_COMMA && depth > 0) {
|
|
92733
92738
|
if (block.ranges > 0) {
|
|
92734
92739
|
block.ranges = 0;
|
|
92735
|
-
|
|
92740
|
+
const open = block.nodes.shift();
|
|
92736
92741
|
block.nodes = [open, { type: "text", value: stringify(block) }];
|
|
92737
92742
|
}
|
|
92738
92743
|
push2({ type: "comma", value: value2 });
|
|
@@ -92740,7 +92745,7 @@ var require_parse3 = __commonJS({
|
|
|
92740
92745
|
continue;
|
|
92741
92746
|
}
|
|
92742
92747
|
if (value2 === CHAR_DOT && depth > 0 && block.commas === 0) {
|
|
92743
|
-
|
|
92748
|
+
const siblings = block.nodes;
|
|
92744
92749
|
if (depth === 0 || siblings.length === 0) {
|
|
92745
92750
|
push2({ type: "text", value: value2 });
|
|
92746
92751
|
continue;
|
|
@@ -92761,7 +92766,7 @@ var require_parse3 = __commonJS({
|
|
|
92761
92766
|
}
|
|
92762
92767
|
if (prev.type === "range") {
|
|
92763
92768
|
siblings.pop();
|
|
92764
|
-
|
|
92769
|
+
const before = siblings[siblings.length - 1];
|
|
92765
92770
|
before.value += prev.value + value2;
|
|
92766
92771
|
prev = before;
|
|
92767
92772
|
block.ranges--;
|
|
@@ -92786,8 +92791,8 @@ var require_parse3 = __commonJS({
|
|
|
92786
92791
|
node.invalid = true;
|
|
92787
92792
|
}
|
|
92788
92793
|
});
|
|
92789
|
-
|
|
92790
|
-
|
|
92794
|
+
const parent = stack2[stack2.length - 1];
|
|
92795
|
+
const index2 = parent.nodes.indexOf(block);
|
|
92791
92796
|
parent.nodes.splice(index2, 1, ...block.nodes);
|
|
92792
92797
|
}
|
|
92793
92798
|
} while (stack2.length > 0);
|
|
@@ -92809,8 +92814,8 @@ var require_braces2 = __commonJS({
|
|
|
92809
92814
|
var braces = (input, options8 = {}) => {
|
|
92810
92815
|
let output = [];
|
|
92811
92816
|
if (Array.isArray(input)) {
|
|
92812
|
-
for (
|
|
92813
|
-
|
|
92817
|
+
for (const pattern of input) {
|
|
92818
|
+
const result = braces.create(pattern, options8);
|
|
92814
92819
|
if (Array.isArray(result)) {
|
|
92815
92820
|
output.push(...result);
|
|
92816
92821
|
} else {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import clamp from 'lodash/clamp';
|
|
2
2
|
import uniqueId from 'lodash/uniqueId';
|
|
3
3
|
import { stopEvent, filterVisible } from '../../../../utils/utils';
|
|
4
|
+
import { glDropdownConfig } from '../../../../config';
|
|
4
5
|
import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_BEFORE_CLOSE, GL_DROPDOWN_FOCUS_CONTENT, POSITION_ABSOLUTE, POSITION_FIXED, HOME, END, ARROW_UP, ARROW_DOWN, ENTER, SPACE, GL_DROPDOWN_CONTENTS_CLASS } from '../constants';
|
|
5
6
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
|
|
6
7
|
import GlBaseDropdown, { BASE_DROPDOWN_CLASS } from '../base_dropdown/base_dropdown';
|
|
@@ -215,7 +216,9 @@ var script = {
|
|
|
215
216
|
improvedHideHeuristics: {
|
|
216
217
|
type: Boolean,
|
|
217
218
|
required: false,
|
|
218
|
-
default
|
|
219
|
+
default() {
|
|
220
|
+
return Boolean(glDropdownConfig.useImprovedHideHeuristics);
|
|
221
|
+
}
|
|
219
222
|
}
|
|
220
223
|
},
|
|
221
224
|
data() {
|
|
@@ -2,6 +2,7 @@ import clamp from 'lodash/clamp';
|
|
|
2
2
|
import uniqueId from 'lodash/uniqueId';
|
|
3
3
|
import isNil from 'lodash/isNil';
|
|
4
4
|
import { stopEvent } from '../../../../utils/utils';
|
|
5
|
+
import { glDropdownConfig } from '../../../../config';
|
|
5
6
|
import { GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN, POSITION_ABSOLUTE, POSITION_FIXED, GL_DROPDOWN_CONTENTS_CLASS, HOME, END, ARROW_UP, ARROW_DOWN } from '../constants';
|
|
6
7
|
import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions, dropdownPlacements } from '../../../../utils/constants';
|
|
7
8
|
import GlButton from '../../button/button';
|
|
@@ -336,7 +337,9 @@ var script = {
|
|
|
336
337
|
improvedHideHeuristics: {
|
|
337
338
|
type: Boolean,
|
|
338
339
|
required: false,
|
|
339
|
-
default
|
|
340
|
+
default() {
|
|
341
|
+
return Boolean(glDropdownConfig.useImprovedHideHeuristics);
|
|
342
|
+
}
|
|
340
343
|
}
|
|
341
344
|
},
|
|
342
345
|
data() {
|
package/dist/config.js
CHANGED
|
@@ -35,6 +35,7 @@ try {
|
|
|
35
35
|
// localStorage doesn't exist (or the value is not properly formatted)
|
|
36
36
|
}
|
|
37
37
|
const i18n = translationKeys;
|
|
38
|
+
const glDropdownConfig = {};
|
|
38
39
|
let configured = false;
|
|
39
40
|
|
|
40
41
|
/**
|
|
@@ -43,11 +44,12 @@ let configured = false;
|
|
|
43
44
|
* @typedef {object} GitLabUIConfiguration
|
|
44
45
|
* @template TValue=string
|
|
45
46
|
* @property {undefined | Object} translations Generic translations for component labels to fall back to.
|
|
46
|
-
* @property {boolean}
|
|
47
|
+
* @property {boolean} [useImprovedHideHeuristics] Temporary flag to enable improved hide heuristics for dropdowns.
|
|
47
48
|
*/
|
|
48
49
|
const setConfigs = function () {
|
|
49
50
|
let {
|
|
50
|
-
translations
|
|
51
|
+
translations,
|
|
52
|
+
useImprovedHideHeuristics
|
|
51
53
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
52
54
|
if (configured) {
|
|
53
55
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -80,7 +82,24 @@ const setConfigs = function () {
|
|
|
80
82
|
}
|
|
81
83
|
Object.assign(i18n, translations);
|
|
82
84
|
}
|
|
85
|
+
|
|
86
|
+
// Temporary flag to enable the improved hide heuristics feature.
|
|
87
|
+
// This flag allows the feature to be opt-in during the rollout phase,
|
|
88
|
+
// giving us the flexibility to test and validate its impact on user experience.
|
|
89
|
+
|
|
90
|
+
// The global variable `useImprovedHideHeuristics` is set to a boolean value
|
|
91
|
+
// to indicate whether the improved hide heuristics should be used.
|
|
92
|
+
|
|
93
|
+
// Future Plan:
|
|
94
|
+
// Once the improved hide heuristics feature is validated and stable,
|
|
95
|
+
// we will remove this temporary flag and make the feature the default behavior.
|
|
96
|
+
// At that point, there will be no need for opt-in or opt-out mechanisms for this feature.
|
|
97
|
+
if (typeof useImprovedHideHeuristics === 'boolean') {
|
|
98
|
+
Object.assign(glDropdownConfig, {
|
|
99
|
+
useImprovedHideHeuristics
|
|
100
|
+
});
|
|
101
|
+
}
|
|
83
102
|
};
|
|
84
103
|
|
|
85
104
|
export default setConfigs;
|
|
86
|
-
export { i18n };
|
|
105
|
+
export { glDropdownConfig, i18n };
|