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

@salesforcedevs/docs-components

Package Overview
Dependencies
Maintainers
29
Versions
651
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.26.3 to 0.28.0

src/modules/doc/heading/heading.css

2

lwc.config.json

@@ -11,5 +11,5 @@ {

"doc/header",
"doc/headingAnchor",
"doc/heading",
"doc/phase"
]
}
{
"name": "@salesforcedevs/docs-components",
"version": "0.26.3",
"version": "0.28.0",
"description": "Docs Lightning web components for DSC",

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

},
"gitHead": "9c94c66a063751c3ada92ae0dbbded0b999feb98"
"gitHead": "e7bf549e93170dd173ff7419b302674d0faa0b7a"
}
import { LightningElement, api } from "lwc";
import { IconSprite, IconSize, IconSymbol } from "typings/custom";
export default class HeadingAnchor extends LightningElement {
@api ariaLabel: string = "copy";
@api iconSize?: IconSize = "override";
@api iconSprite?: IconSprite = "utility";
@api iconSymbol?: IconSymbol;
@api title: string = "";
@api urlText: string = "";
@api hash: string | null = null;
label: string = "Copy link to clipboard";
timeout: number | null = null;
private async onIconClick() {
await this.iconClickHandler();
private get titleToWrap() {
return this.title.substring(0, this.title.lastIndexOf(" "));
}
private async iconClickHandler() {
private get needsSpace() {
return this.titleToWrap.length > 0;
}
private get titleNoWrap() {
return this.title.substring(this.title.lastIndexOf(" ") + 1);
}
private async copy() {
if (this.timeout) {
window.clearTimeout(this.timeout);
}
this.label = "Copied";
setTimeout(() => {
this.timeout = window.setTimeout(() => {
this.label = "Copy link to clipboard";

@@ -25,5 +33,5 @@ }, 2000);

try {
if (this.title && this.urlText) {
if (this.title && this.hash) {
const [hostUrl] = window.location.href.split("#");
const url = `${hostUrl}#${this.urlText}`;
const url = `${hostUrl}#${this.hash}`;
await navigator.clipboard.writeText(url);

@@ -35,11 +43,2 @@ }

}
private async onKeyDown(e: KeyboardEvent) {
switch (e.key) {
case "Enter":
await this.iconClickHandler();
break;
default:
}
}
}

Sorry, the diff of this file is not supported yet

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