@salesforcedevs/docs-components
Advanced tools
Comparing version
@@ -21,2 +21,3 @@ { | ||
"doc/headingAnchor", | ||
"doc/markdownEditor", | ||
"doc/overview", | ||
@@ -23,0 +24,0 @@ "doc/phase", |
{ | ||
"name": "@salesforcedevs/docs-components", | ||
"version": "1.16.0", | ||
"version": "1.17.0-edit", | ||
"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() { |
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
288815
2.14%93
2.2%0
-100%7225
3.21%2
100%