@gitlab/ui 114.2.0 → 114.4.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.
@@ -307,7 +307,11 @@ var script = {
307
307
  if (this.tokens.length === 1) {
308
308
  return;
309
309
  }
310
- this.tokens.splice(idx, 1);
310
+ const [destroyedToken] = this.tokens.splice(idx, 1);
311
+ /**
312
+ * Emitted when a token is destroyed, with the token as the payload.
313
+ */
314
+ this.$emit('token-destroy', destroyedToken);
311
315
 
312
316
  // First, attempt to honor the user's activation intent behind the
313
317
  // destruction of the token, if any. Otherwise, try to maintain the
@@ -348,6 +352,10 @@ var script = {
348
352
  this.activeTokenIdx = idx + newStrings.length;
349
353
  },
350
354
  completeToken() {
355
+ /**
356
+ * Emitted when a token is completed, with the token as the payload.
357
+ */
358
+ this.$emit('token-complete', this.activeToken);
351
359
  if (this.activeTokenIdx === this.lastTokenIdx - 1) {
352
360
  this.activeTokenIdx = this.lastTokenIdx;
353
361
  } else {
@@ -90,7 +90,6 @@ var script = {
90
90
  },
91
91
  computed: {
92
92
  shouldRenderDescription() {
93
- // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
94
93
  return Boolean(this.$scopedSlots.description || this.description) && this.isVerticalLayout;
95
94
  },
96
95
  shouldRenderHelp() {
package/dist/config.js CHANGED
@@ -28,7 +28,7 @@ try {
28
28
  if (glTooltipDelay) {
29
29
  tooltipGlobalConfig.delay = JSON.parse(glTooltipDelay);
30
30
  }
31
- } catch (e) {
31
+ } catch {
32
32
  // localStorage doesn't exist (or the value is not properly formatted)
33
33
  }
34
34
  const i18n = translationKeys;
@@ -2,7 +2,7 @@ const absoluteUrls = ['http://example.org', 'http://example.org:8080', 'https://
2
2
 
3
3
  /* eslint-disable no-script-url */
4
4
  const javascriptUrls = ['javascript:', 'javascript:alert("XSS")', 'jav\tascript:alert("XSS");'];
5
- /* eslint-disable no-script-url */
5
+ /* eslint-enable no-script-url */
6
6
 
7
7
  const encodedJavaScriptUrls = ['&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041', 'javascript:alert('XSS')', '&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29', '  javascript:alert("XSS");'];
8
8
  const relativeUrls = ['./relative/link', '../relative/link', '/relative/link', '/users/sign_in', '#docs/link', '#'];
@@ -27,7 +27,7 @@ const isSafeURL = url => {
27
27
  try {
28
28
  const parsedURL = new URL(url, getBaseURL());
29
29
  return ['http:', 'https:', 'mailto:', 'ftp:'].includes(parsedURL.protocol);
30
- } catch (e) {
30
+ } catch {
31
31
  return false;
32
32
  }
33
33
  };