@gitlab/ui 72.11.0 → 72.11.1
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 +7 -0
- package/dist/directives/safe_html/safe_html.js +5 -1
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/package.json +1 -1
- package/src/directives/safe_html/safe_html.js +5 -0
- package/src/directives/safe_html/safe_html.spec.js +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [72.11.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v72.11.0...v72.11.1) (2024-01-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Performance Improvements
|
|
5
|
+
|
|
6
|
+
* **SafeHtml:** Add unbind hook to the directive ([2b428b1](https://gitlab.com/gitlab-org/gitlab-ui/commit/2b428b1d19c57a8ebd4d92d318a3abb2461745f7))
|
|
7
|
+
|
|
1
8
|
# [72.11.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v72.10.0...v72.11.0) (2024-01-23)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -27,9 +27,13 @@ const transform = (el, binding) => {
|
|
|
27
27
|
el.appendChild(sanitize(binding.value, config));
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
+
const clear = el => {
|
|
31
|
+
el.textContent = '';
|
|
32
|
+
};
|
|
30
33
|
const SafeHtmlDirective = {
|
|
31
34
|
bind: transform,
|
|
32
|
-
update: transform
|
|
35
|
+
update: transform,
|
|
36
|
+
unbind: clear
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
export { SafeHtmlDirective };
|
package/dist/tokens/js/tokens.js
CHANGED
package/package.json
CHANGED
|
@@ -129,4 +129,21 @@ describe('safe html directive', () => {
|
|
|
129
129
|
expect(wrapper.html()).toEqual('<div>click here</div>');
|
|
130
130
|
});
|
|
131
131
|
});
|
|
132
|
+
|
|
133
|
+
describe('unbind', () => {
|
|
134
|
+
it('should clear the text content during unbind', () => {
|
|
135
|
+
createComponent();
|
|
136
|
+
wrapper.destroy();
|
|
137
|
+
|
|
138
|
+
expect(wrapper.element.textContent).toEqual('');
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('should clear the text content with custom HTML during unbind', () => {
|
|
142
|
+
const customHtml = '<div>custom html</div>';
|
|
143
|
+
createComponent({ html: customHtml });
|
|
144
|
+
wrapper.destroy();
|
|
145
|
+
|
|
146
|
+
expect(wrapper.element.textContent).toEqual('');
|
|
147
|
+
});
|
|
148
|
+
});
|
|
132
149
|
});
|