@gitlab/ui 66.37.0 → 67.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "66.37.0",
3
+ "version": "67.1.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -10,3 +10,5 @@ export const forbiddenDataAttrs = [
10
10
  'data-disable',
11
11
  'data-turbo',
12
12
  ];
13
+
14
+ export const forbiddenTags = ['style', 'mstyle', 'form'];
@@ -1,5 +1,5 @@
1
1
  import DOMPurify from 'dompurify';
2
- import { forbiddenDataAttrs } from './constants';
2
+ import { forbiddenDataAttrs, forbiddenTags } from './constants';
3
3
 
4
4
  const { sanitize } = DOMPurify;
5
5
 
@@ -11,7 +11,8 @@ const { sanitize } = DOMPurify;
11
11
  const DEFAULT_CONFIG = {
12
12
  RETURN_DOM_FRAGMENT: true,
13
13
  ALLOW_UNKNOWN_PROTOCOLS: true,
14
- FORBID_ATTR: [...forbiddenDataAttrs],
14
+ FORBID_ATTR: forbiddenDataAttrs,
15
+ FORBID_TAGS: forbiddenTags,
15
16
  };
16
17
 
17
18
  const transform = (el, binding) => {
@@ -49,6 +49,21 @@ describe('safe html directive', () => {
49
49
  expect(wrapper.html()).toEqual('<div><a>click here</a></div>');
50
50
  });
51
51
 
52
+ it('should remove style tags', () => {
53
+ createComponent({ html: '<style>p {width:50%;}</style>' });
54
+ expect(wrapper.html()).toEqual('<div></div>');
55
+ });
56
+
57
+ it('should remove mstyle tags', () => {
58
+ createComponent({ html: '<math><mstyle displaystyle="true"></mstyle></math>' });
59
+ expect(wrapper.html()).toEqual('<div><math></math></div>');
60
+ });
61
+
62
+ it('should remove form tags', () => {
63
+ createComponent({ html: '<form method="post" action="path"></form>' });
64
+ expect(wrapper.html()).toEqual('<div></div>');
65
+ });
66
+
52
67
  it('should remove any existing children', () => {
53
68
  createComponent({
54
69
  template: `<div v-safe-html="rawHtml">foo <i>bar</i></div>`,
@@ -2448,6 +2448,14 @@ $gl-animate-skeleton-loader-max-width: 64 * $grid-size;
2448
2448
  color: $black-normal !important;
2449
2449
  }
2450
2450
 
2451
+ .gl-text-gray-100 {
2452
+ color: $gray-100;
2453
+ }
2454
+
2455
+ .gl-text-gray-100\! {
2456
+ color: $gray-100 !important;
2457
+ }
2458
+
2451
2459
  .gl-text-gray-200 {
2452
2460
  color: $gray-200;
2453
2461
  }
@@ -41,6 +41,10 @@
41
41
  color: $black-normal;
42
42
  }
43
43
 
44
+ @mixin gl-text-gray-100 {
45
+ color: $gray-100;
46
+ }
47
+
44
48
  @mixin gl-text-gray-200 {
45
49
  color: $gray-200;
46
50
  }