@salesforcedevs/docs-components 0.0.2 → 0.0.3-edit
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lwc.config.json +27 -2
- package/package.json +19 -8
- package/src/modules/README.md +41 -0
- package/src/modules/doc/amfModelParser/amfModelParser.ts +674 -0
- package/src/modules/doc/amfReference/amfReference.css +25 -0
- package/src/modules/doc/amfReference/amfReference.html +60 -0
- package/src/modules/doc/amfReference/amfReference.ts +1494 -0
- package/src/modules/doc/amfReference/constants.ts +76 -0
- package/src/modules/doc/amfReference/types.ts +125 -0
- package/src/modules/doc/amfTopic/amfTopic.css +21 -0
- package/src/modules/doc/amfTopic/amfTopic.html +3 -0
- package/src/modules/doc/amfTopic/amfTopic.ts +111 -0
- package/src/modules/doc/amfTopic/types.ts +56 -0
- package/src/modules/doc/amfTopic/utils.ts +136 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +51 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +5 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +71 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.css +27 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.html +58 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.ts +183 -0
- package/src/modules/doc/chat/README.md +179 -0
- package/src/modules/doc/chat/chat.css +818 -0
- package/src/modules/doc/chat/chat.html +241 -0
- package/src/modules/doc/chat/chat.ts +586 -0
- package/src/modules/doc/componentPlayground/componentPlayground.css +22 -0
- package/src/modules/doc/componentPlayground/componentPlayground.html +20 -0
- package/src/modules/doc/componentPlayground/componentPlayground.ts +29 -0
- package/src/modules/doc/content/content.css +388 -4
- package/src/modules/doc/content/content.html +3 -2
- package/src/modules/doc/content/content.ts +319 -45
- package/src/modules/doc/contentCallout/contentCallout.css +59 -0
- package/src/modules/doc/contentCallout/contentCallout.html +22 -0
- package/src/modules/doc/contentCallout/contentCallout.ts +65 -0
- package/src/modules/doc/contentLayout/contentLayout.css +1 -0
- package/src/modules/doc/contentLayout/contentLayout.html +72 -0
- package/src/modules/doc/contentLayout/contentLayout.ts +531 -0
- package/src/modules/doc/contentMedia/contentMedia.css +49 -0
- package/src/modules/doc/contentMedia/contentMedia.html +23 -0
- package/src/modules/doc/contentMedia/contentMedia.ts +34 -0
- package/src/modules/doc/doDont/doDont.css +47 -0
- package/src/modules/doc/doDont/doDont.html +27 -0
- package/src/modules/doc/doDont/doDont.ts +17 -0
- package/src/modules/doc/editFile/editFile.css +505 -0
- package/src/modules/doc/editFile/editFile.html +164 -0
- package/src/modules/doc/editFile/editFile.ts +213 -0
- package/src/modules/doc/header/header.css +132 -0
- package/src/modules/doc/header/header.html +55 -0
- package/src/modules/doc/header/header.ts +120 -0
- package/src/modules/doc/heading/heading.css +33 -0
- package/src/modules/doc/heading/heading.html +14 -0
- package/src/modules/doc/heading/heading.ts +67 -0
- package/src/modules/doc/headingAnchor/headingAnchor.css +33 -0
- package/src/modules/doc/headingAnchor/headingAnchor.html +19 -0
- package/src/modules/doc/headingAnchor/headingAnchor.ts +43 -0
- package/src/modules/doc/headingContent/headingContent.css +53 -0
- package/src/modules/doc/headingContent/headingContent.html +13 -0
- package/src/modules/doc/headingContent/headingContent.ts +30 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.css +1 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +68 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +168 -0
- package/src/modules/doc/nav/nav.css +8 -2
- package/src/modules/doc/nav/nav.html +10 -7
- package/src/modules/doc/nav/nav.ts +33 -29
- package/src/modules/doc/overview/overview.css +40 -0
- package/src/modules/doc/overview/overview.html +34 -0
- package/src/modules/doc/overview/overview.ts +12 -0
- package/src/modules/doc/phase/phase.css +70 -0
- package/src/modules/doc/phase/phase.html +38 -0
- package/src/modules/doc/phase/phase.ts +93 -0
- package/src/modules/doc/specificationContent/specificationContent.css +36 -0
- package/src/modules/doc/specificationContent/specificationContent.html +171 -0
- package/src/modules/doc/specificationContent/specificationContent.ts +127 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
- package/src/modules/doc/toc/toc.css +14 -0
- package/src/modules/doc/toc/toc.html +99 -22
- package/src/modules/doc/toc/toc.ts +11 -6
- package/src/modules/doc/toolbar/toolbar.css +8 -0
- package/src/modules/doc/toolbar/toolbar.html +32 -15
- package/src/modules/doc/toolbar/toolbar.ts +69 -30
- package/src/modules/doc/versionPicker/versionPicker.css +64 -0
- package/src/modules/doc/versionPicker/versionPicker.html +38 -0
- package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
- package/src/modules/doc/xmlContent/types.ts +120 -0
- package/src/modules/doc/xmlContent/utils.ts +163 -0
- package/src/modules/doc/xmlContent/xmlContent.css +54 -0
- package/src/modules/doc/xmlContent/xmlContent.html +52 -0
- package/src/modules/doc/xmlContent/xmlContent.ts +792 -0
- package/src/modules/docHelpers/amfStyle/amfStyle.css +355 -0
- package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +131 -0
- package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
- package/src/modules/docHelpers/status/status.css +22 -0
- package/src/modules/docUtils/searchSyncer/searchSyncer.ts +86 -0
- package/src/modules/docUtils/utils/__mocks__/coveo.analytics.ts +16 -0
- package/src/modules/docUtils/utils/coveo.analytics.d.ts +10 -0
- package/src/modules/docUtils/utils/utils.ts +32 -0
- package/src/modules/doc/container/__benchmarks__/container.benchmarkrenamed.js +0 -18
- package/src/modules/doc/container/container.css +0 -8
- package/src/modules/doc/container/container.html +0 -11
- package/src/modules/doc/container/container.stories.ts +0 -15
- package/src/modules/doc/container/container.ts +0 -164
- package/src/modules/doc/content/prismjs.css +0 -184
- package/src/modules/doc/content/prismjs.html +0 -3
- package/src/modules/doc/content/prismjs.ts +0 -853
- package/src/modules/doc/prismcss/prismcss.css +0 -184
- package/src/modules/doc/search/search.html +0 -1
- package/src/modules/doc/search/search.ts +0 -6
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { IconSprite, IconSize, IconSymbol } from "typings/custom";
|
|
3
|
+
|
|
4
|
+
export default class HeadingAnchor extends LightningElement {
|
|
5
|
+
@api ariaLabel: string = "copy";
|
|
6
|
+
@api iconSize?: IconSize = "override";
|
|
7
|
+
@api iconSprite?: IconSprite = "utility";
|
|
8
|
+
@api iconSymbol?: IconSymbol;
|
|
9
|
+
@api header: string = "";
|
|
10
|
+
@api urlText: string = "";
|
|
11
|
+
|
|
12
|
+
label: string = "Copy link to clipboard";
|
|
13
|
+
|
|
14
|
+
private async onIconClick() {
|
|
15
|
+
await this.iconClickHandler();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private async iconClickHandler() {
|
|
19
|
+
this.label = "Copied";
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
this.label = "Copy link to clipboard";
|
|
22
|
+
}, 2000);
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
if (this.header && this.urlText) {
|
|
26
|
+
const [hostUrl] = window.location.href.split("#");
|
|
27
|
+
const url = `${hostUrl}#${this.urlText}`;
|
|
28
|
+
await navigator.clipboard.writeText(url);
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error(error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private async onKeyDown(e: KeyboardEvent) {
|
|
36
|
+
switch (e.key) {
|
|
37
|
+
case "Enter":
|
|
38
|
+
await this.iconClickHandler();
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
--doc-c-heading-anchor-button-bottom: 0;
|
|
5
|
+
--doc-c-heading-anchor-icon-size: 18px;
|
|
6
|
+
--button-size: var(--dx-g-spacing-xl);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
dx-tooltip {
|
|
10
|
+
line-height: var(--button-size);
|
|
11
|
+
padding-right: var(--dx-g-spacing-xs);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.button-container {
|
|
15
|
+
height: 100%;
|
|
16
|
+
margin-right: calc(var(--dx-g-spacing-xl) - 4px);
|
|
17
|
+
position: relative;
|
|
18
|
+
padding-right: var(--dx-g-spacing-xs);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
button {
|
|
22
|
+
position: absolute;
|
|
23
|
+
bottom: var(--doc-c-heading-anchor-button-bottom);
|
|
24
|
+
left: 0;
|
|
25
|
+
opacity: 0;
|
|
26
|
+
color: rgb(11 92 171);
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
height: var(--button-size);
|
|
31
|
+
width: var(--button-size);
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
dx-icon {
|
|
36
|
+
--dx-c-icon-size: var(--doc-c-heading-anchor-icon-size);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.title {
|
|
40
|
+
word-break: break-word;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
button:focus {
|
|
44
|
+
box-shadow: 0 0 0 2px rgb(11 92 171);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
button:focus,
|
|
48
|
+
button:hover,
|
|
49
|
+
span:hover dx-tooltip button,
|
|
50
|
+
span:hover ~ dx-tooltip button {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
outline: none;
|
|
53
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template if:false={hash}>{header}</template>
|
|
3
|
+
<template if:true={hash}>
|
|
4
|
+
<span class="title">{header} </span>
|
|
5
|
+
<dx-tooltip placement="top" label={label}>
|
|
6
|
+
<span class="button-container">
|
|
7
|
+
<button onclick={copy} aria-label="copy">
|
|
8
|
+
<dx-icon size="override" symbol="link"></dx-icon>
|
|
9
|
+
</button>
|
|
10
|
+
</span>
|
|
11
|
+
</dx-tooltip>
|
|
12
|
+
</template>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
|
|
3
|
+
export default class HeadingContent extends LightningElement {
|
|
4
|
+
@api header: string = "";
|
|
5
|
+
@api hash: string | null = null;
|
|
6
|
+
|
|
7
|
+
label: string = "Copy link to clipboard";
|
|
8
|
+
timeout: number | null = null;
|
|
9
|
+
|
|
10
|
+
private async copy() {
|
|
11
|
+
if (this.timeout) {
|
|
12
|
+
window.clearTimeout(this.timeout);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
this.label = "Copied";
|
|
16
|
+
this.timeout = window.setTimeout(() => {
|
|
17
|
+
this.label = "Copy link to clipboard";
|
|
18
|
+
}, 2000);
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
if (this.header && this.hash) {
|
|
22
|
+
const [hostUrl] = window.location.href.split("#");
|
|
23
|
+
const url = `${hostUrl}#${this.hash}`;
|
|
24
|
+
await navigator.clipboard.writeText(url);
|
|
25
|
+
}
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error(error);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "docHelpers/contentLayoutStyle";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="content">
|
|
3
|
+
<template lwc:if={useOldSidebar}>
|
|
4
|
+
<dx-sidebar-old
|
|
5
|
+
class="is-sticky left-nav-bar"
|
|
6
|
+
trees={sidebarContent}
|
|
7
|
+
value={sidebarValue}
|
|
8
|
+
header={sidebarHeader}
|
|
9
|
+
ontogglesidebar={onToggleSidebar}
|
|
10
|
+
languages={languages}
|
|
11
|
+
language={language}
|
|
12
|
+
bail-href={bailHref}
|
|
13
|
+
bail-label={bailLabel}
|
|
14
|
+
dev-center={devCenter}
|
|
15
|
+
brand={brand}
|
|
16
|
+
>
|
|
17
|
+
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
18
|
+
</dx-sidebar-old>
|
|
19
|
+
</template>
|
|
20
|
+
<template lwc:else>
|
|
21
|
+
<dx-sidebar
|
|
22
|
+
class="is-sticky left-nav-bar"
|
|
23
|
+
trees={sidebarContent}
|
|
24
|
+
value={sidebarValue}
|
|
25
|
+
header={sidebarHeader}
|
|
26
|
+
coveo-organization-id={coveoOrganizationId}
|
|
27
|
+
coveo-public-access-token={coveoPublicAccessToken}
|
|
28
|
+
coveo-search-hub={coveoSearchHub}
|
|
29
|
+
coveo-advanced-query-config={coveoAdvancedQueryConfig}
|
|
30
|
+
ontogglesidebar={onToggleSidebar}
|
|
31
|
+
languages={languages}
|
|
32
|
+
language={language}
|
|
33
|
+
bail-href={bailHref}
|
|
34
|
+
bail-label={bailLabel}
|
|
35
|
+
dev-center={devCenter}
|
|
36
|
+
brand={brand}
|
|
37
|
+
>
|
|
38
|
+
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
39
|
+
</dx-sidebar>
|
|
40
|
+
</template>
|
|
41
|
+
<div class="content-body-doc-phase-container">
|
|
42
|
+
<slot name="doc-phase"></slot>
|
|
43
|
+
<slot name="version-banner"></slot>
|
|
44
|
+
<div class="content-body-container">
|
|
45
|
+
<div class="content-body">
|
|
46
|
+
<doc-breadcrumbs
|
|
47
|
+
lwc:if={showBreadcrumbs}
|
|
48
|
+
breadcrumbs={breadcrumbs}
|
|
49
|
+
></doc-breadcrumbs>
|
|
50
|
+
<slot onslotchange={onSlotChange}></slot>
|
|
51
|
+
<doc-sprig-survey
|
|
52
|
+
lwc:if={shouldDisplayFeedback}
|
|
53
|
+
></doc-sprig-survey>
|
|
54
|
+
</div>
|
|
55
|
+
<div lwc:if={showToc} class="right-nav-bar is-sticky">
|
|
56
|
+
<dx-toc
|
|
57
|
+
header={tocTitle}
|
|
58
|
+
options={tocOptions}
|
|
59
|
+
value={tocValue}
|
|
60
|
+
></dx-toc>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<div lwc:if={showFooter} class="footer-container">
|
|
64
|
+
<dx-footer variant="no-signup"></dx-footer>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import ContentLayout from "doc/contentLayout";
|
|
2
|
+
|
|
3
|
+
const TOC_HEADER_TAG = "doc-heading";
|
|
4
|
+
const RNB_BY_TAB = "docs-tab";
|
|
5
|
+
const SPECIFICATION_TAB_TITLE = "Specification";
|
|
6
|
+
export const OBSERVER_ATTACH_WAIT_TIME = 500;
|
|
7
|
+
|
|
8
|
+
export default class LwcContentLayout extends ContentLayout {
|
|
9
|
+
private rnbByTab: boolean = false;
|
|
10
|
+
|
|
11
|
+
private setRNBByTab() {
|
|
12
|
+
const tabPanelListItem: any = this.getTabPanelList();
|
|
13
|
+
this.rnbByTab = tabPanelListItem?.id === RNB_BY_TAB ? true : false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
get showTabBasedRNB() {
|
|
17
|
+
return this.rnbByTab;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
onRNBClick = (event: CustomEvent) => {
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
const currentTab = this.getSelectedTabId();
|
|
23
|
+
if (currentTab === SPECIFICATION_TAB_TITLE) {
|
|
24
|
+
this.didScrollToSelectedHash = false;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
onTabChanged = () => {
|
|
29
|
+
this.updateRNB();
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
private getTabPanelList() {
|
|
33
|
+
// eslint-disable-next-line @lwc/lwc/no-document-query
|
|
34
|
+
return document.querySelector("dx-tab-panel-list");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
protected getHeadingElements() {
|
|
38
|
+
let headingElements = super.getHeadingElements();
|
|
39
|
+
if (this.showTabBasedRNB) {
|
|
40
|
+
const tabPanelListItem: any = this.getTabPanelList();
|
|
41
|
+
const tabPanels =
|
|
42
|
+
tabPanelListItem?.querySelectorAll("dx-tab-panel");
|
|
43
|
+
for (const tabPanelItem of tabPanels) {
|
|
44
|
+
if (tabPanelItem.active) {
|
|
45
|
+
// This is needed for Specification tab content
|
|
46
|
+
const specificationElement = tabPanelItem.querySelector(
|
|
47
|
+
"doc-specification-content"
|
|
48
|
+
);
|
|
49
|
+
if (specificationElement) {
|
|
50
|
+
headingElements =
|
|
51
|
+
specificationElement.shadowRoot.querySelectorAll(
|
|
52
|
+
TOC_HEADER_TAG
|
|
53
|
+
);
|
|
54
|
+
} else {
|
|
55
|
+
headingElements =
|
|
56
|
+
tabPanelItem.querySelectorAll(TOC_HEADER_TAG);
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return headingElements;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
private updateURL() {
|
|
66
|
+
const tabs = this.getAllTabs();
|
|
67
|
+
const selectedTabId = this.getSelectedTabId();
|
|
68
|
+
tabs.forEach((tab: any) => {
|
|
69
|
+
if (tab.getAttribute("aria-selected") === "true") {
|
|
70
|
+
const tabID = tab.getAttribute("aria-label");
|
|
71
|
+
const url = new URL(window.location.href);
|
|
72
|
+
if (selectedTabId !== tabID) {
|
|
73
|
+
url.searchParams.set("type", tabID);
|
|
74
|
+
url.hash = "";
|
|
75
|
+
window.history.pushState({}, "", url.toString());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// This event gets triggered when navigating back/forward
|
|
82
|
+
handlePopState = (): void => {
|
|
83
|
+
if (this.showTabBasedRNB) {
|
|
84
|
+
this.restoreTabSelection();
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
connectedCallback(): void {
|
|
89
|
+
super.connectedCallback();
|
|
90
|
+
window.addEventListener("popstate", this.handlePopState);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private getSelectedTabId() {
|
|
94
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
95
|
+
const selectedTabId = urlParams.get("type");
|
|
96
|
+
return selectedTabId;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private restoreTabSelection() {
|
|
100
|
+
requestAnimationFrame(() => {
|
|
101
|
+
const selectedTabId = this.getSelectedTabId();
|
|
102
|
+
if (selectedTabId) {
|
|
103
|
+
this.selectTabById(selectedTabId);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
private getAllTabs(): any[] {
|
|
109
|
+
const tabPanelListItem: any = this.getTabPanelList();
|
|
110
|
+
if (tabPanelListItem?.shadowRoot) {
|
|
111
|
+
return Array.from(
|
|
112
|
+
tabPanelListItem.shadowRoot.querySelectorAll(
|
|
113
|
+
"dx-tab-panel-item"
|
|
114
|
+
)
|
|
115
|
+
).map((tabPanelItem: any) =>
|
|
116
|
+
tabPanelItem.shadowRoot.querySelector("button")
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
return [];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private selectTabById(tabId: string) {
|
|
123
|
+
const tabs = this.getAllTabs();
|
|
124
|
+
tabs.forEach((tab: any) => {
|
|
125
|
+
if (tab.getAttribute("aria-label") === tabId) {
|
|
126
|
+
tab.click();
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
postRenderedCallback(): void {
|
|
132
|
+
this.setRNBByTab();
|
|
133
|
+
if (this.showTabBasedRNB) {
|
|
134
|
+
window.addEventListener("tabchanged", this.onTabChanged);
|
|
135
|
+
window.addEventListener(
|
|
136
|
+
"specificationdatarendered",
|
|
137
|
+
this.onTabChanged
|
|
138
|
+
);
|
|
139
|
+
window.addEventListener("selectedcontent", (event) =>
|
|
140
|
+
this.onRNBClick(event as CustomEvent)
|
|
141
|
+
);
|
|
142
|
+
this.restoreTabSelection();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
disconnectedCallback(): void {
|
|
147
|
+
super.disconnectedCallback();
|
|
148
|
+
if (this.showTabBasedRNB) {
|
|
149
|
+
window.removeEventListener("tabchanged", this.onTabChanged);
|
|
150
|
+
window.removeEventListener(
|
|
151
|
+
"specificationdatarendered",
|
|
152
|
+
this.onTabChanged
|
|
153
|
+
);
|
|
154
|
+
window.removeEventListener("selectedcontent", (event) =>
|
|
155
|
+
this.onRNBClick(event as CustomEvent)
|
|
156
|
+
);
|
|
157
|
+
window.removeEventListener("popstate", this.handlePopState);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
updateHeadingForRNB(): void {
|
|
162
|
+
// We only need to update URL in case of /docs and ignore if tabs are used anywhere else in DSC
|
|
163
|
+
if (this.showTabBasedRNB) {
|
|
164
|
+
this.updateURL();
|
|
165
|
+
}
|
|
166
|
+
super.updateHeadingForRNB();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<doc-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<div class="doc-navigation">
|
|
3
|
+
<template if:true={toc}>
|
|
4
|
+
<dx-sidebar
|
|
5
|
+
header="Pages"
|
|
6
|
+
trees={toc}
|
|
7
|
+
onselect={handleSelected}
|
|
8
|
+
value={selectedNavigationItem}
|
|
9
|
+
></dx-sidebar>
|
|
10
|
+
</template>
|
|
11
|
+
</div>
|
|
9
12
|
</template>
|
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
|
+
import {
|
|
3
|
+
AvailableLanguages,
|
|
4
|
+
AvailableVersions,
|
|
5
|
+
DocToc,
|
|
6
|
+
PageReference,
|
|
7
|
+
PdfUrl,
|
|
8
|
+
SelectedNavigationItem,
|
|
9
|
+
SelectedLanguage,
|
|
10
|
+
SelectedVersion
|
|
11
|
+
} from "typings/custom";
|
|
2
12
|
|
|
3
|
-
/**
|
|
4
|
-
* @element doc-nav
|
|
5
|
-
*/
|
|
6
13
|
export default class Nav extends LightningElement {
|
|
7
|
-
|
|
14
|
+
@api availableLanguages!: AvailableLanguages;
|
|
15
|
+
@api selectedLanguage!: SelectedLanguage;
|
|
16
|
+
@api availableVersions!: AvailableVersions;
|
|
17
|
+
@api selectedVersion!: SelectedVersion;
|
|
18
|
+
@api selectedNavigationItem!: SelectedNavigationItem;
|
|
19
|
+
@api pdfUrl!: PdfUrl;
|
|
20
|
+
@api toc!: DocToc;
|
|
21
|
+
@api pageReference!: PageReference;
|
|
8
22
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
23
|
+
handleSelected(event: CustomEvent) {
|
|
24
|
+
event.stopPropagation();
|
|
25
|
+
const newPageReference = { ...this.pageReference };
|
|
26
|
+
const target = event.detail.name.split("-");
|
|
27
|
+
newPageReference.contentDocumentId = target[0] + ".htm";
|
|
28
|
+
newPageReference.hash = target[1];
|
|
29
|
+
this.dispatchEvent(
|
|
30
|
+
new CustomEvent("navclick", {
|
|
31
|
+
detail: {
|
|
32
|
+
pageReference: newPageReference
|
|
33
|
+
},
|
|
34
|
+
bubbles: true,
|
|
35
|
+
composed: true
|
|
36
|
+
})
|
|
37
|
+
);
|
|
25
38
|
}
|
|
26
|
-
get docsData() {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
@api availableLanguages = [];
|
|
32
|
-
@api availableVersions = [];
|
|
33
|
-
@api pdfUrl: string | undefined;
|
|
34
|
-
@api toc = [];
|
|
35
39
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
doc-phase {
|
|
2
|
+
--doc-c-phase-top: calc(
|
|
3
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
4
|
+
);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
dx-section {
|
|
8
|
+
--dx-c-section-padding-top: 0;
|
|
9
|
+
--dx-c-section-padding-bottom: var(--dx-g-spacing-2xl);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
dx-section::part(content) {
|
|
13
|
+
max-width: 1280px;
|
|
14
|
+
margin: auto;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
dx-group-text:first-of-type {
|
|
18
|
+
margin-top: var(--dx-g-spacing-2xl);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
dx-group-text.features {
|
|
22
|
+
margin-top: var(--dx-g-spacing-xl);
|
|
23
|
+
margin-bottom: var(--dx-g-spacing-xl);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.content {
|
|
27
|
+
padding-right: var(--dx-g-spacing-xl);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (max-width: 1024px) {
|
|
31
|
+
.content {
|
|
32
|
+
padding-right: 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (max-width: 800px) {
|
|
37
|
+
dx-group-text.description {
|
|
38
|
+
margin-top: var(--dx-g-spacing-lg);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container">
|
|
3
|
+
<doc-phase
|
|
4
|
+
if:true={docPhaseInfo}
|
|
5
|
+
doc-phase-info={docPhaseInfo}
|
|
6
|
+
></doc-phase>
|
|
7
|
+
|
|
8
|
+
<dx-section>
|
|
9
|
+
<dx-grid columns="two-slim-right">
|
|
10
|
+
<div class="content">
|
|
11
|
+
<dx-group-text
|
|
12
|
+
class="description"
|
|
13
|
+
header={header}
|
|
14
|
+
body={description}
|
|
15
|
+
size="large"
|
|
16
|
+
title-aria-level="1"
|
|
17
|
+
primary-link={primaryLink}
|
|
18
|
+
secondary-link={secondaryLink}
|
|
19
|
+
></dx-group-text>
|
|
20
|
+
</div>
|
|
21
|
+
<div>
|
|
22
|
+
<dx-group-text
|
|
23
|
+
header={featuresListTitle}
|
|
24
|
+
size="medium"
|
|
25
|
+
class="features"
|
|
26
|
+
></dx-group-text>
|
|
27
|
+
<dx-features-list
|
|
28
|
+
options={featuresListOptions}
|
|
29
|
+
></dx-features-list>
|
|
30
|
+
</div>
|
|
31
|
+
</dx-grid>
|
|
32
|
+
</dx-section>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { DocPhaseInfo, FeatureItem, Link } from "typings/custom";
|
|
3
|
+
|
|
4
|
+
export default class Overview extends LightningElement {
|
|
5
|
+
@api docPhaseInfo!: DocPhaseInfo;
|
|
6
|
+
@api header!: string;
|
|
7
|
+
@api description!: string;
|
|
8
|
+
@api primaryLink!: Link;
|
|
9
|
+
@api secondaryLink!: Link;
|
|
10
|
+
@api featuresListTitle!: string;
|
|
11
|
+
@api featuresListOptions!: FeatureItem[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
@import "docHelpers/status";
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
--doc-c-phase-top: 0;
|
|
7
|
+
--doc-c-phase-container-align-items: flex-start;
|
|
8
|
+
|
|
9
|
+
position: sticky;
|
|
10
|
+
top: var(--doc-c-phase-top);
|
|
11
|
+
|
|
12
|
+
/* NOTE: If you are changing z-index value here, ensure it's less than z-index of dx-sidebar in contentLayout.css */
|
|
13
|
+
z-index: var(--dx-g-z-index-100);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.doc-phase-container {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: var(--doc-c-phase-container-align-items);
|
|
20
|
+
padding-left: var(--dx-g-global-header-padding-horizontal);
|
|
21
|
+
padding-right: var(--dx-g-global-header-padding-horizontal);
|
|
22
|
+
width: 100%;
|
|
23
|
+
border: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.doc-phase-title-container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
align-items: center;
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
dx-button {
|
|
34
|
+
margin-left: auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
NOTE: Here we are assuming that indicator height won't go beyond 1000px.
|
|
39
|
+
|
|
40
|
+
It's one of the suggested way to achieve the expand/collapse animation
|
|
41
|
+
Ref: https://stackoverflow.com/a/41164095
|
|
42
|
+
|
|
43
|
+
Otherwise we need to change the height when user clicks on button
|
|
44
|
+
Ref: https://stackoverflow.com/a/11837673
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
.doc-phase-body {
|
|
48
|
+
display: block;
|
|
49
|
+
max-height: 1000px;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
padding-top: var(--dx-g-spacing-smd);
|
|
52
|
+
transition: max-height 0.25s ease, padding 0.25s ease;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.doc-phase-body-hidden {
|
|
56
|
+
max-height: 0;
|
|
57
|
+
padding-top: 0;
|
|
58
|
+
transition: max-height 0.1s ease-out, padding 0.25s ease-out;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.doc-phase-body a {
|
|
62
|
+
color: var(--dx-g-blue-vibrant-50);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Small Devices */
|
|
66
|
+
@media screen and (max-width: 480px) {
|
|
67
|
+
.doc-phase-container {
|
|
68
|
+
padding: var(--doc-status-vertical-padding);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class={className} part="container">
|
|
3
|
+
<div class="doc-phase-title-container">
|
|
4
|
+
<dx-icon
|
|
5
|
+
class="doc-status-icon doc-phase-icon"
|
|
6
|
+
symbol={iconName}
|
|
7
|
+
size="large"
|
|
8
|
+
color="status-icon-color"
|
|
9
|
+
></dx-icon>
|
|
10
|
+
<p class="doc-status-title doc-phase-title dx-text-body-3">
|
|
11
|
+
{docPhaseTitle}
|
|
12
|
+
</p>
|
|
13
|
+
<dx-button
|
|
14
|
+
lwc:if={dismissible}
|
|
15
|
+
aria-label="Dismiss"
|
|
16
|
+
icon-color="status-icon-color"
|
|
17
|
+
icon-size="large"
|
|
18
|
+
icon-symbol="close"
|
|
19
|
+
variant="icon-only"
|
|
20
|
+
onclick={onDismiss}
|
|
21
|
+
></dx-button>
|
|
22
|
+
<dx-button
|
|
23
|
+
lwc:else
|
|
24
|
+
variant="inline"
|
|
25
|
+
onclick={onShowHide}
|
|
26
|
+
aria-label={hideBodyText}
|
|
27
|
+
>
|
|
28
|
+
{hideBodyText}
|
|
29
|
+
</dx-button>
|
|
30
|
+
</div>
|
|
31
|
+
<!--
|
|
32
|
+
NOTE: Here we are rendering mark up using lwc:dom & innerHTML
|
|
33
|
+
option instead of slots because the html markup will come as a
|
|
34
|
+
property to the component from a configuration
|
|
35
|
+
-->
|
|
36
|
+
<span lwc:dom="manual" class={bodyClassName}></span>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|