@salesforcedevs/docs-components
Advanced tools
Comparing version
@@ -10,2 +10,3 @@ { | ||
"doc/breadcrumbs", | ||
"doc/commentPopup", | ||
"doc/componentPlayground", | ||
@@ -12,0 +13,0 @@ "doc/content", |
{ | ||
"name": "@salesforcedevs/docs-components", | ||
"version": "1.16.0", | ||
"version": "1.17.0-hack-alpha", | ||
"description": "Docs Lightning web components for DSC", | ||
@@ -28,3 +28,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "977c82c3a242a1476eee4eee5c70b03472a7492e" | ||
"gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad" | ||
} |
@@ -46,22 +46,6 @@ /* eslint-disable @lwc/lwc/no-inner-html */ | ||
@api | ||
set codeBlockTheme(value) { | ||
this._codeBlockTheme = value; | ||
} | ||
get codeBlockTheme() { | ||
return this._codeBlockTheme; | ||
} | ||
@track docContent: DocContent = ""; | ||
_codeBlockTheme: string = "dark"; | ||
_docRendered: boolean = false; | ||
originalCodeBlockThemeValue: String = ""; | ||
connectedCallback() { | ||
this.template.addEventListener( | ||
"themechange", | ||
this.updateTheme.bind(this) // eslint-disableline no-use-before-define | ||
); | ||
window.addEventListener( | ||
@@ -80,11 +64,2 @@ "highlightedtermchange", | ||
updateTheme() { | ||
this._codeBlockTheme = | ||
this._codeBlockTheme === "dark" ? "light" : "dark"; | ||
const codeBlockEls = this.template.querySelectorAll("dx-code-block"); | ||
codeBlockEls.forEach((codeBlockEl) => { | ||
codeBlockEl.setAttribute("theme", this._codeBlockTheme); | ||
}); | ||
} | ||
renderPaginationButton(anchorEl: HTMLElement) { | ||
@@ -121,7 +96,7 @@ const isNext = anchorEl.textContent!.includes("Next →"); | ||
codeBlockEl.setAttribute("lwc:dom", "manual"); | ||
const classList = (codeBlockEl.firstChild as any).classList; | ||
const classList = codeBlockEl.firstElementChild?.classList; | ||
let language = ""; | ||
for (const key in classList) { | ||
if (typeof classList[key] === "string") { | ||
const className = classList[key]; | ||
if (classList) { | ||
for (let i = 0; i < classList.length; i++) { | ||
const className = classList[i]; | ||
if (className.startsWith("brush:")) { | ||
@@ -139,3 +114,2 @@ language = className.split(":")[1]; | ||
language: LANGUAGE_MAP[language] || language, | ||
theme: this.codeBlockTheme, | ||
header: "", // Default no title. | ||
@@ -165,2 +139,3 @@ variant: this.codeBlockType, | ||
// Set a flag to 1 (true) if and only if all detailEls have no content. | ||
let flag = 1; | ||
@@ -367,3 +342,3 @@ for (let i: number = 0; i < detailEls.length; i++) { | ||
@api | ||
public navigateToHash(hash: String) { | ||
public navigateToHash = (hash: String) => { | ||
const splitHash = hash.split("#"); | ||
@@ -379,3 +354,3 @@ if (splitHash.length === 2) { | ||
} | ||
} | ||
}; | ||
@@ -382,0 +357,0 @@ renderedCallback() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
296798
4.96%93
2.2%0
-100%7440
6.29%2
100%