Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@salesforcedevs/docs-components

Package Overview
Dependencies
Maintainers
28
Versions
647
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@salesforcedevs/docs-components - npm Package Compare versions

Comparing version 0.13.0 to 0.13.2

4

package.json
{
"name": "@salesforcedevs/docs-components",
"version": "0.13.0",
"version": "0.13.2",
"description": "Docs Lightning web components for DSC",

@@ -17,3 +17,3 @@ "license": "MIT",

},
"gitHead": "712b43fcdf2478ace9dd7b6b41b6850762c74314"
"gitHead": "dc3c93441a0f1cde3faaf1bfafbbf7bd5c4d29ff"
}

@@ -120,25 +120,2 @@ import { createRenderComponent } from "utils/tests";

});
it("highlights text that matches search criteria", () => {
const component = render({
docsData: mockContent.content,
pageReference: mockPageReference,
isStorybook: true
});
const contentEl = component.shadowRoot.querySelector(
'[data-name="content"]'
);
contentEl.dispatchEvent(
new CustomEvent("highlightedtermchange", {
detail: "apex",
composed: true,
bubbles: true
})
);
const highlightedSpanEls = contentEl.querySelectorAll(".highlight");
expect(highlightedSpanEls.length).toEqual(14);
});
});

@@ -38,4 +38,2 @@ /* eslint-disable @lwc/lwc/no-inner-html */

originalCodeBlockThemeValue: String = "";
_ogContent: string = "";
connectedCallback() {

@@ -46,15 +44,4 @@ this.template.addEventListener(

);
window.addEventListener("highlightedtermchange", (e: any) =>
this.updateHighlighted(e.detail)
);
}
disconnectedCallback(): void {
window.removeEventListener(
"highlightedtermchange",
this.updateHighlighted
);
}
updateTheme() {

@@ -69,28 +56,2 @@ this._codeBlockTheme =

updateHighlighted(searchTerm: string) {
const divEl = this.template.querySelector("div");
if (divEl) {
divEl.innerHTML = this._ogContent;
const divChildNodes = divEl.childNodes;
divChildNodes.forEach((node) => {
this.highlight(node, searchTerm);
});
}
}
highlight(element: any, searchTerm: string) {
const text = element.innerHTML;
if (text) {
const regexp = new RegExp(`${searchTerm}(?![^<>]*>)`, "gi");
const highlightedText = text.replace(
regexp,
`<span class="highlight">$&</span>`
);
element.innerHTML = highlightedText;
}
}
renderPaginationButton(anchorEl: HTMLElement) {

@@ -358,4 +319,3 @@ const isNext = anchorEl.textContent.includes("Next →");

this._docRendered = true;
this._ogContent = this.template.querySelector("div").innerHTML;
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc