Socket
Socket
Sign inDemoInstall

@salesforcedevs/docs-components

Package Overview
Dependencies
16
Maintainers
13
Versions
571
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.242 to 1.3.243-newdocux-alpha6

src/modules/doc/versionPicker/versionPicker.css

1

lwc.config.json

@@ -20,2 +20,3 @@ {

"doc/phase",
"doc/versionPicker",
"doc/xmlContent",

@@ -22,0 +23,0 @@ "docUtils/utils"

4

package.json
{
"name": "@salesforcedevs/docs-components",
"version": "1.3.242",
"version": "1.3.243-newdocux-alpha6",
"description": "Docs Lightning web components for DSC",

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

},
"gitHead": "f53c5d4c4cf5fe27cc7c9cb520d2a93f8bc82973"
"gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
}

@@ -7,2 +7,3 @@ import { LightningElement, api, track } from "lwc";

import { normalizeBoolean, toJson } from "dxUtils/normalizers";
import type { OptionWithLink } from "typings/custom";
import type {

@@ -51,2 +52,4 @@ AmfConfig,

@api tocOptions?: string;
@api languages!: OptionWithLink[];
@api language!: string;
@track navigation = [] as NavigationItem[];

@@ -123,2 +126,4 @@ @track versions: Array<ReferenceVersion> = [];

this.showVersionBanner = true;
} else {
this.latestVersion = true;
}

@@ -206,2 +211,3 @@ }

private isVersionFetched = false;
private latestVersion = false;

@@ -1317,2 +1323,4 @@ /**

this.showVersionBanner = true;
} else {
this.latestVersion = true;
}

@@ -1319,0 +1327,0 @@

@@ -7,2 +7,3 @@ /* eslint-disable @lwc/lwc/no-document-query */

import { SearchSyncer } from "docUtils/searchSyncer";
import type { OptionWithLink } from "typings/custom";

@@ -40,2 +41,6 @@ type AnchorMap = { [key: string]: { intersect: boolean; id: string } };

@api useOldSidebar?: boolean = false;
@api languages!: OptionWithLink[];
@api language!: string;
@api bailHref!: string;
@api bailLabel!: string;

@@ -42,0 +47,0 @@ @api

import { api } from "lwc";
import cx from "classnames";
import type { OptionWithNested, OptionWithLink } from "typings/custom";
import type { OptionWithNested } from "typings/custom";
import { HeaderBase } from "dxBaseElements/headerBase";
import { toJson } from "dxUtils/normalizers";
import get from "lodash.get";
import { track } from "dxUtils/analytics";
const TABLET_MATCH = "980px";
const MOBILE_MATCH = "880px";
const SMALL_MOBILE_MATCH = "768px";
const MOBILE_MATCH = "768px";

@@ -26,30 +23,7 @@ export default class Header extends HeaderBase {

@api
get languages() {
return this._languages;
}
set languages(value) {
this._languages = toJson(value);
}
@api
get language() {
return this._language;
}
set language(value) {
if (this._language !== value) {
this._language = value;
}
}
private _language: string | null = null;
private _languages!: OptionWithLink[];
private _scopedNavItems!: OptionWithNested[];
private smallMobile = false;
private smallMobileMatchMedia!: MediaQueryList;
private tablet = false;
private tabletMatchMedia!: MediaQueryList;
private shouldRender = false;
private shouldRender: boolean = false;
private showDocDivider: boolean = false;

@@ -64,20 +38,2 @@ protected mobileBreakpoint(): string {

private get hasLanguages(): boolean {
return !!(this.languages && this.languages.length);
}
private get showMobileLanguages(): boolean {
return this.smallMobile && this.hasLanguages;
}
private get languageLabel(): string {
return (
(this.language &&
this.languages.find(
(lang) => get(lang, this.langValuePath) === this.language
)?.label) ||
this.languages[0].label
);
}
connectedCallback(): void {

@@ -91,10 +47,2 @@ super.connectedCallback();

this.smallMobileMatchMedia = window.matchMedia(
`(max-width: ${SMALL_MOBILE_MATCH})`
);
this.onSmallMobileChange(this.smallMobileMatchMedia);
this.smallMobileMatchMedia.addEventListener(
"change",
this.onSmallMobileChange
);
if (

@@ -110,2 +58,9 @@ (window.location.pathname.includes("/docs/") &&

}
if (this.shouldRender && window.location.pathname.includes("/docs/")) {
if (!this.brand && !this.mobile) {
this.shouldRender = false;
this.showDocDivider = true;
}
}
}

@@ -119,7 +74,2 @@

);
this.smallMobileMatchMedia.removeEventListener(
"change",
this.onSmallMobileChange
);
}

@@ -130,5 +80,2 @@

private onSmallMobileChange = (e: MediaQueryListEvent | MediaQueryList) =>
(this.smallMobile = e.matches);
protected additionalClasses(): string {

@@ -140,32 +87,2 @@ return cx(

}
private onLangChange(event: CustomEvent<string>): void {
const { detail } = event;
this._language = detail;
this.dispatchEvent(new CustomEvent("langchange", { detail }));
}
private handleBailClick(event: Event) {
const payload = {
click_text: "pdf",
click_url: this.bailHref,
element_title: "pdf",
element_type: "link",
content_category: "download"
};
track(event.target!, "custEv_pdfDownload", {
...payload,
file_name: this.getFilename(this.bailHref!),
file_extension: "pdf"
});
track(event.target!, "custEv_linkClick", {
...payload
});
}
private getFilename = function (path: string) {
return path.substring(path.lastIndexOf("/") + 1);
};
}

@@ -64,2 +64,6 @@ export type CoveoAdvancedQueryXMLConfig = {

subtitle: string;
headerHref: string;
}
export type SiderbarFooter = {
bailHref: string;

@@ -69,4 +73,3 @@ bailLabel: string;

language?: string;
headerHref: string;
}
};

@@ -73,0 +76,0 @@ export type ApiNavItem = {

@@ -11,2 +11,3 @@ /* eslint-disable @lwc/lwc/no-document-query */

Header,
SiderbarFooter,
HistoryState,

@@ -30,2 +31,8 @@ PageReference,

const defaultSidebarFooter: SiderbarFooter = {
bailHref: "",
bailLabel: "",
languages: [],
language: ""
};
export default class DocXmlContent extends LightningElementWithState<{

@@ -64,3 +71,3 @@ isFetchingDocument: boolean;

private availableLanguages: Array<DocLanguage> = [];
private availableVersions: Array<DocVersion> = [];
@track private availableVersions: Array<DocVersion> = [];
private contentProvider?: FetchContent;

@@ -70,2 +77,3 @@ private docContent = "";

private loaded = false;
private _pageHeader?: Header;
private pdfUrl = "";

@@ -77,5 +85,7 @@ private tocMap: TocMap = {};

private _pathName = "";
private _pageHeader?: Header;
private listenerAttached = false;
private _enableCoveo?: boolean = false;
private sidebarFooterContent: SiderbarFooter = { ...defaultSidebarFooter };
private latestVersion = false;
private previewVersion = false;

@@ -135,2 +145,6 @@ private searchSyncer = new SearchSyncer({

info = oldVersionDocInfo(currentGAVersion.link.href);
} else if (
parseFloat(this.version.id) > parseFloat(versionNo)
) {
this.previewVersion = true;
}

@@ -223,9 +237,2 @@ } catch (exception) {

this.searchSyncer.dispose();
if (this.listenerAttached) {
this.pageHeader.removeEventListener(
"langchange",
this.handleLanguageChange
);
this.listenerAttached = false;
}
}

@@ -424,8 +431,4 @@

getReferenceFromUrl(): PageReference {
const [
page,
docId,
deliverable,
contentDocumentId
] = window.location.pathname.substr(1).split("/");
const [page, docId, deliverable, contentDocumentId] =
window.location.pathname.substr(1).split("/");

@@ -480,3 +483,3 @@ const { origin: domain, hash, search } = window.location;

this.updateHeader();
this.updateHeaderAndSidebarFooter();

@@ -492,2 +495,4 @@ this.buildBreadcrumbs();

this.showVersionBanner = true;
} else {
this.latestVersion = true;
}

@@ -546,3 +551,3 @@

updateHeader(): void {
updateHeaderAndSidebarFooter(): void {
if (!this.pageHeader) {

@@ -557,17 +562,9 @@ return;

if (this.pdfUrl) {
this.pageHeader.bailHref = this.pdfUrl;
this.pageHeader.bailLabel = "PDF";
this.sidebarFooterContent.bailHref = this.pdfUrl;
this.sidebarFooterContent.bailLabel = "PDF";
}
if (!this.listenerAttached) {
this.pageHeader.addEventListener(
"langchange",
this.handleLanguageChange
);
this.listenerAttached = true;
}
this.sidebarFooterContent.languages = this.availableLanguages;
this.sidebarFooterContent.language = this.language?.id;
this.pageHeader.languages = this.availableLanguages;
this.pageHeader.language = this.language?.id;
if (this.pageReference) {

@@ -596,16 +593,8 @@ const { docId, deliverable, page } = this.pageReference;

private updateSearchInput(searchParam: string): void {
(this.template.querySelector(
"doc-content-layout"
) as any)?.setSidebarInputValue(searchParam);
(this.refs.docContentLayout as any)?.setSidebarInputValue(searchParam);
}
private pageReferenceToString(reference: PageReference): string {
const {
page,
docId,
deliverable,
contentDocumentId,
hash,
search
} = reference;
const { page, docId, deliverable, contentDocumentId, hash, search } =
reference;
return `/${page}/${docId}/${deliverable}/${contentDocumentId}${this.normalizeSearch(

@@ -795,2 +784,6 @@ search!

}
private get showVersionPicker(): boolean {
return !this.disableVersion;
}
}

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

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

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc