@bonniernews/dn-design-system-web 2.1.0-alpha.19 → 2.1.0-alpha.20
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
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.1.0-alpha.20](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@2.1.0-alpha.19...@bonniernews/dn-design-system-web@2.1.0-alpha.20) (2023-03-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **web:** update readme and js param for blocked content ([#707](https://github.com/BonnierNews/dn-design-system/issues/707)) ([e043945](https://github.com/BonnierNews/dn-design-system/commit/e043945592be4ea031fd029b9b9eb04fd4f799aa))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## 2.1.0-alpha.19 (2023-03-01)
|
|
7
16
|
|
|
8
17
|
|
|
@@ -43,8 +43,7 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
43
43
|
### Javascript
|
|
44
44
|
|
|
45
45
|
```javascript
|
|
46
|
-
import dsBlockedContent from '@bonniernews/dn-design-system-web/components/blocked-content/blocked-content.js'
|
|
47
|
-
const blockedContentElement = Array.from(document.getElementsByClassName("ds-blocked-content"))[0];
|
|
46
|
+
import { dsBlockedContent } from '@bonniernews/dn-design-system-web/components/blocked-content/blocked-content.js'
|
|
48
47
|
|
|
49
48
|
// avalaible javascript parameters, matches njk paramaters + vendor:
|
|
50
49
|
const parameters = {
|
|
@@ -57,5 +56,5 @@ const parameters = {
|
|
|
57
56
|
elementAttributes: { "onclick": "javascript:Didomi.notice.show()" }
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
dsBlockedContent(
|
|
59
|
+
const blockedContentHtml = dsBlockedContent(parameters);
|
|
61
60
|
```
|
|
@@ -3,8 +3,7 @@ export {
|
|
|
3
3
|
dsBlockedContentStory
|
|
4
4
|
};
|
|
5
5
|
|
|
6
|
-
function dsBlockedContent(
|
|
7
|
-
if (!blockedContentEl) return;
|
|
6
|
+
function dsBlockedContent(params) {
|
|
8
7
|
params = params || {};
|
|
9
8
|
|
|
10
9
|
const blockedContentTmpl = document.createElement("div");
|
|
@@ -78,7 +77,7 @@ function dsBlockedContentStory() {
|
|
|
78
77
|
blockedContentElements.forEach((blockedContentEl) => {
|
|
79
78
|
const params = JSON.parse(blockedContentEl.getAttribute("data-params"));
|
|
80
79
|
|
|
81
|
-
const newBlockedContent = dsBlockedContent(
|
|
80
|
+
const newBlockedContent = dsBlockedContent(params);
|
|
82
81
|
blockedContentEl.replaceWith(newBlockedContent);
|
|
83
82
|
});
|
|
84
83
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonniernews/dn-design-system-web",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.20",
|
|
4
4
|
"description": "DN design system for web.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",
|