@salesforcedevs/docs-components
Advanced tools
Comparing version 0.0.7 to 0.1.15
{ | ||
"name": "@salesforcedevs/docs-components", | ||
"version": "0.0.7", | ||
"version": "0.1.15", | ||
"description": "Docs Lightning web components for DSC", | ||
@@ -17,3 +17,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad" | ||
"gitHead": "6859180766893de51743401c19d1b80273244cc6" | ||
} |
@@ -145,2 +145,4 @@ import { LightningElement, api } from "lwc"; | ||
showLandingPage: boolean = false; | ||
constructor() { | ||
@@ -332,3 +334,5 @@ super(); | ||
}) | ||
.catch((error) => console.log(error)); | ||
.catch(() => { | ||
this.showLandingPage = true; | ||
}); | ||
} | ||
@@ -335,0 +339,0 @@ |
/* eslint-disable @lwc/lwc/no-inner-html */ | ||
import { LightningElement, api, track } from "lwc"; | ||
import { createElement, LightningElement, api, track } from "lwc"; | ||
import { DocContent, PageReference } from "../../../../../../../typings/custom"; | ||
import ContentCallout from "doc/contentCallout"; | ||
import CodeBlock from "dx/codeBlock"; | ||
import Button from "dx/button"; | ||
@@ -62,3 +65,3 @@ export default class Content extends LightningElement { | ||
codeBlockEls.forEach((codeBlockEl) => { | ||
const blockEl = document.createElement("dx-code-block"); | ||
codeBlockEl.setAttribute("lwc:dom", "manual"); | ||
const classList = codeBlockEl.firstChild.classList; | ||
@@ -74,11 +77,13 @@ let language = ""; | ||
} | ||
blockEl.setAttribute("title", "Code Block Title"); | ||
blockEl.setAttribute("theme", this.codeBlockTheme); | ||
blockEl.setAttribute("variant", this.codeBlockType); | ||
blockEl.setAttribute("language", language); | ||
const blockCmp = createElement("dx-code-block", { is: CodeBlock }); | ||
Object.assign(blockCmp, { | ||
codeBlock: codeBlockEl.innerHTML, | ||
language: language, | ||
theme: this.codeBlockTheme, | ||
title: "Code Block Title", | ||
variant: this.codeBlockType | ||
}); | ||
// eslint-disable-next-line no-use-before-define | ||
blockEl.setAttribute("code-block", codeBlockEl.innerHTML); | ||
// eslint-disable-next-line no-use-before-define | ||
codeBlockEl.innerHTML = ""; | ||
codeBlockEl.appendChild(blockEl); | ||
codeBlockEl.appendChild(blockCmp); | ||
}); | ||
@@ -89,3 +94,5 @@ | ||
calloutEls.forEach((calloutEl) => { | ||
const calloutCompEl = document.createElement("doc-content-callout"); | ||
const calloutCompEl = createElement("doc-content-callout", { | ||
is: ContentCallout | ||
}); | ||
const detailEls = calloutEl.querySelectorAll("p"); | ||
@@ -97,4 +104,7 @@ detailEls.forEach((detailEl) => { | ||
const typeLower = type.toLowerCase(); | ||
calloutCompEl.setAttribute("title", type); | ||
calloutCompEl.setAttribute("variant", typeLower); | ||
Object.assign(calloutCompEl, { | ||
title: type, | ||
variant: typeLower | ||
}); | ||
// eslint-disable-next-line no-use-before-define | ||
calloutEl.innerHTML = ""; | ||
@@ -108,15 +118,23 @@ calloutEl.appendChild(calloutCompEl); | ||
if (anchorEl.textContent.includes("Next →")) { | ||
anchorEl.textContent = ""; | ||
const buttonEl = document.createElement("dx-button"); | ||
buttonEl.setAttribute("icon-symbol", "chevronright"); | ||
buttonEl.textContent = "Next"; | ||
anchorEl.innerHTML = ""; | ||
const buttonEl = createElement("dx-button", { is: Button }); | ||
Object.assign(buttonEl, { | ||
iconSymbol: "chevronright" | ||
}); | ||
const textEl = document.createDocumentFragment(); | ||
textEl.textContent = "Next"; | ||
buttonEl.appendChild(textEl); | ||
anchorEl.appendChild(buttonEl); | ||
} | ||
if (anchorEl.textContent.includes("← Previous")) { | ||
anchorEl.textContent = ""; | ||
const buttonEl = document.createElement("dx-button"); | ||
buttonEl.setAttribute("icon-symbol", "chevronleft"); | ||
buttonEl.setAttribute("icon-position", "left"); | ||
buttonEl.setAttribute("variant", "secondary"); | ||
buttonEl.textContent = "Previous"; | ||
anchorEl.innerHTML = ""; | ||
const buttonEl = createElement("dx-button", { is: Button }); | ||
Object.assign(buttonEl, { | ||
iconPosition: "left", | ||
iconSymbol: "chevronleft", | ||
variant: "secondary" | ||
}); | ||
const textEl = document.createDocumentFragment(); | ||
textEl.textContent = "Previous"; | ||
buttonEl.appendChild(textEl); | ||
anchorEl.appendChild(buttonEl); | ||
@@ -123,0 +141,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
381397
66
7203
1