@salesforcedevs/docs-components 1.3.205 → 1.3.209-alpha1
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 +2 -0
- package/package.json +4 -2
- package/src/modules/doc/atlasContent/atlasContent.css +52 -0
- package/src/modules/doc/atlasContent/atlasContent.html +48 -0
- package/src/modules/doc/atlasContent/atlasContent.ts +116 -0
- package/src/modules/doc/contentCallout/contentCallout.css +5 -0
- package/src/modules/doc/xmlContent/baseContentElement.ts +787 -0
- package/src/modules/doc/xmlContent/types.ts +110 -0
- package/src/modules/doc/xmlContent/utils.ts +1 -1
- package/src/modules/doc/zoominContent/mockResponses.ts +5223 -0
- package/src/modules/doc/zoominContent/zoominContent.css +52 -0
- package/src/modules/doc/zoominContent/zoominContent.html +48 -0
- package/src/modules/doc/zoominContent/zoominContent.ts +476 -0
- package/src/modules/doc/zoominContent/zoominUtils.ts +88 -0
- package/LICENSE +0 -12
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.209-alpha1",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@api-components/amf-helper-mixin": "^4.5.17",
|
|
15
15
|
"classnames": "^2.2.6",
|
|
16
|
+
"jsonwebtoken": "^9.0.2",
|
|
16
17
|
"kagekiri": "^1.4.1",
|
|
17
18
|
"lodash.orderby": "^4.6.0",
|
|
18
19
|
"lodash.uniqby": "^4.7.0",
|
|
@@ -21,8 +22,9 @@
|
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@types/classnames": "^2.2.10",
|
|
25
|
+
"@types/jsonwebtoken": "^9.0.5",
|
|
24
26
|
"@types/lodash.orderby": "^4.6.7",
|
|
25
27
|
"@types/lodash.uniqby": "^4.7.7"
|
|
26
28
|
},
|
|
27
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
|
|
28
30
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--button-primary-color: var(--dx-g-blue-vibrant-50);
|
|
3
|
+
--button-primary-color-hover: var(--dx-g-blue-vibrant-40);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
doc-content-layout {
|
|
7
|
+
--dx-c-content-sidebar-sticky-top: calc(
|
|
8
|
+
var(--dx-g-global-header-height) +
|
|
9
|
+
var(--dx-g-doc-header-main-nav-height)
|
|
10
|
+
);
|
|
11
|
+
--dx-c-sidebar-height: calc(
|
|
12
|
+
100vh -
|
|
13
|
+
calc(
|
|
14
|
+
var(--dx-g-global-header-height) +
|
|
15
|
+
var(--dx-g-doc-header-main-nav-height)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
doc-breadcrumbs {
|
|
21
|
+
--dx-c-popover-z-index: 5;
|
|
22
|
+
|
|
23
|
+
display: block;
|
|
24
|
+
margin-bottom: var(--dx-g-spacing-md);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
dx-dropdown {
|
|
28
|
+
--dx-c-dropdown-option-font-size: var(--dx-g-text-sm);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
dx-dropdown > dx-button {
|
|
32
|
+
--dx-c-button-primary-color: var(--button-primary-color);
|
|
33
|
+
--dx-c-button-primary-color-hover: var(--button-primary-color-hover);
|
|
34
|
+
--border-color: var(--button-primary-color);
|
|
35
|
+
|
|
36
|
+
border-bottom: 1px dashed var(--border-color);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
dx-dropdown > dx-button:hover {
|
|
40
|
+
--border-color: var(--button-primary-color-hover);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.document-pickers {
|
|
44
|
+
margin-left: auto;
|
|
45
|
+
margin-right: var(--dx-g-spacing-sm);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
doc-phase {
|
|
49
|
+
--doc-c-phase-top: calc(
|
|
50
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<doc-content-layout
|
|
3
|
+
if:true={loaded}
|
|
4
|
+
coveo-organization-id={coveoOrganizationId}
|
|
5
|
+
coveo-public-access-token={coveoPublicAccessToken}
|
|
6
|
+
coveo-analytics-token={coveoAnalyticsToken}
|
|
7
|
+
coveo-search-hub={coveoSearchHub}
|
|
8
|
+
coveo-advanced-query-config={coveoAdvancedQueryConfig}
|
|
9
|
+
sidebar-header="Pages"
|
|
10
|
+
sidebar-content={sidebarContent}
|
|
11
|
+
sidebar-value={sidebarValue}
|
|
12
|
+
onselect={handleSelect}
|
|
13
|
+
use-old-sidebar={useOldSidebar}
|
|
14
|
+
>
|
|
15
|
+
<doc-phase
|
|
16
|
+
slot="version-banner"
|
|
17
|
+
if:true={showVersionBanner}
|
|
18
|
+
doc-phase-info={oldVersionInfo}
|
|
19
|
+
icon-name="warning"
|
|
20
|
+
dismissible="true"
|
|
21
|
+
ondismissphase={handleDismissVersionBanner}
|
|
22
|
+
></doc-phase>
|
|
23
|
+
<div slot="sidebar-header" class="document-pickers">
|
|
24
|
+
<dx-dropdown
|
|
25
|
+
data-type="version"
|
|
26
|
+
analytics-event="custEv_ctaLinkClick"
|
|
27
|
+
analytics-payload={ANALYTICS_PAYLOAD}
|
|
28
|
+
options={versionOptions}
|
|
29
|
+
value={version.id}
|
|
30
|
+
width="290px"
|
|
31
|
+
>
|
|
32
|
+
<dx-button variant="inline" disabled={disableVersion}>
|
|
33
|
+
{version.releaseVersion}
|
|
34
|
+
</dx-button>
|
|
35
|
+
</dx-dropdown>
|
|
36
|
+
</div>
|
|
37
|
+
<doc-breadcrumbs
|
|
38
|
+
if:true={showBreadcrumbs}
|
|
39
|
+
breadcrumbs={breadcrumbs}
|
|
40
|
+
pixel-per-character={breadcrumbPixelPerCharacter}
|
|
41
|
+
></doc-breadcrumbs>
|
|
42
|
+
<doc-content
|
|
43
|
+
docs-data={docContent}
|
|
44
|
+
page-reference={pageReference}
|
|
45
|
+
onnavclick={handleNavClick}
|
|
46
|
+
></doc-content>
|
|
47
|
+
</doc-content-layout>
|
|
48
|
+
</template>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import {BaseContentElement} from "../xmlContent/baseContentElement";
|
|
2
|
+
import { HistoryState, PageReference } from "../xmlContent/types";
|
|
3
|
+
|
|
4
|
+
export default class xmlContentElement extends BaseContentElement{
|
|
5
|
+
|
|
6
|
+
getReferenceFromUrl(): PageReference {
|
|
7
|
+
const [
|
|
8
|
+
page,
|
|
9
|
+
docId,
|
|
10
|
+
deliverable,
|
|
11
|
+
contentDocumentId
|
|
12
|
+
] = window.location.pathname.substr(1).split("/");
|
|
13
|
+
|
|
14
|
+
const { origin: domain, hash, search } = window.location;
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
contentDocumentId,
|
|
18
|
+
deliverable,
|
|
19
|
+
docId,
|
|
20
|
+
domain,
|
|
21
|
+
hash,
|
|
22
|
+
page,
|
|
23
|
+
search
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async fetchDocument(): Promise<void> {
|
|
28
|
+
this.setState({
|
|
29
|
+
isFetchingDocument: true
|
|
30
|
+
});
|
|
31
|
+
const data = await this.contentProvider!.fetchDocumentData(
|
|
32
|
+
this.pageReference.docId!
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
// This could be a 404 scenario.
|
|
36
|
+
if (!data) {
|
|
37
|
+
this.setState({
|
|
38
|
+
isFetchingDocument: false
|
|
39
|
+
});
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
this.docTitle = data.docTitle;
|
|
44
|
+
this.tocMap = data.tocMap;
|
|
45
|
+
this.sidebarContent = data.toc;
|
|
46
|
+
this.version = data.version;
|
|
47
|
+
this.language = data.language;
|
|
48
|
+
this.availableLanguages = data.availableLanguages;
|
|
49
|
+
this.availableVersions = data.availableVersions;
|
|
50
|
+
this.pdfUrl = data.pdfUrl;
|
|
51
|
+
|
|
52
|
+
this.updateHeader();
|
|
53
|
+
|
|
54
|
+
this.buildBreadcrumbs();
|
|
55
|
+
|
|
56
|
+
if (this.pageReference.deliverable !== data.deliverable) {
|
|
57
|
+
this.pageReference.deliverable = data.deliverable;
|
|
58
|
+
this.updateUrl(HistoryState.REPLACE_STATE);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (this.oldVersionInfo) {
|
|
62
|
+
this.showVersionBanner = true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (
|
|
66
|
+
this.pageReference?.contentDocumentId?.replace(/\.htm$/, "") !==
|
|
67
|
+
data.id
|
|
68
|
+
) {
|
|
69
|
+
try {
|
|
70
|
+
await this.fetchContent();
|
|
71
|
+
this.setState({
|
|
72
|
+
isFetchingDocument: false
|
|
73
|
+
});
|
|
74
|
+
return;
|
|
75
|
+
} catch (error) {
|
|
76
|
+
this.pageReference.contentDocumentId = `${data.id}.htm`;
|
|
77
|
+
this.pageReference.hash = "";
|
|
78
|
+
this.pageReference.search = "";
|
|
79
|
+
this.updateUrl(HistoryState.REPLACE_STATE);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
this.docContent = data.content;
|
|
84
|
+
this.addMetatags();
|
|
85
|
+
this.setState({
|
|
86
|
+
isFetchingDocument: false
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async fetchContent(): Promise<void> {
|
|
91
|
+
this.setState({
|
|
92
|
+
isFetchingContent: true
|
|
93
|
+
});
|
|
94
|
+
const data = await this.contentProvider!.fetchContent(
|
|
95
|
+
this.pageReference.deliverable!,
|
|
96
|
+
this.pageReference.contentDocumentId!,
|
|
97
|
+
{
|
|
98
|
+
language: this.language!.id,
|
|
99
|
+
version: this.version!.id
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
if (data) {
|
|
104
|
+
this.docContent = data.content;
|
|
105
|
+
this.addMetatags();
|
|
106
|
+
|
|
107
|
+
if (!this.pageReference.hash) {
|
|
108
|
+
document.body.scrollIntoView();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
this.setState({
|
|
112
|
+
isFetchingContent: false
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
}
|