@salesforcedevs/docs-components 1.27.22-banner6 → 1.27.22-banner7
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": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.27.22-
|
|
3
|
+
"version": "1.27.22-banner7",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"@types/lodash.orderby": "4.6.9",
|
|
26
26
|
"@types/lodash.uniqby": "4.7.9"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "c6a070901f664e9ecfbb267d1fe15f0ad436524e"
|
|
29
29
|
}
|
|
@@ -2,7 +2,6 @@ import { LightningElement, api, track } from "lwc";
|
|
|
2
2
|
import { normalizeBoolean } from "dxUtils/normalizers";
|
|
3
3
|
|
|
4
4
|
const LOCALE_BANNER_STORAGE_PREFIX = "dsc-doc-locale-banner-dismissed-";
|
|
5
|
-
const BANNER_DEBUG_PREFIX = "[doc-banner]";
|
|
6
5
|
|
|
7
6
|
export default class Banner extends LightningElement {
|
|
8
7
|
@api messageText = "";
|
|
@@ -32,33 +31,15 @@ export default class Banner extends LightningElement {
|
|
|
32
31
|
@track private _dismissed = false;
|
|
33
32
|
|
|
34
33
|
connectedCallback() {
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
console.debug(BANNER_DEBUG_PREFIX, "visibility check", {
|
|
45
|
-
dismissStorageKey: this.dismissStorageKey,
|
|
46
|
-
storageKey,
|
|
47
|
-
sessionStorageValue: stored,
|
|
48
|
-
dismissed: this._dismissed,
|
|
49
|
-
bannerWillShow: !this._dismissed,
|
|
50
|
-
reason: this._dismissed
|
|
51
|
-
? "User dismissed in this session (Not Now / close)"
|
|
52
|
-
: "Not dismissed; banner will show"
|
|
53
|
-
});
|
|
54
|
-
} else {
|
|
55
|
-
console.debug(BANNER_DEBUG_PREFIX, "visibility check", {
|
|
56
|
-
dismissStorageKey: this.dismissStorageKey || "(empty)",
|
|
57
|
-
bannerWillShow: true,
|
|
58
|
-
reason: !this.dismissStorageKey
|
|
59
|
-
? "No dismiss key: banner always shown by component (if theme rendered it)"
|
|
60
|
-
: "sessionStorage not available"
|
|
61
|
-
});
|
|
34
|
+
if (
|
|
35
|
+
this.dismissStorageKey &&
|
|
36
|
+
typeof window !== "undefined" &&
|
|
37
|
+
window.sessionStorage
|
|
38
|
+
) {
|
|
39
|
+
this._dismissed =
|
|
40
|
+
window.sessionStorage.getItem(
|
|
41
|
+
`${LOCALE_BANNER_STORAGE_PREFIX}${this.dismissStorageKey}`
|
|
42
|
+
) === "true";
|
|
62
43
|
}
|
|
63
44
|
}
|
|
64
45
|
|