@salesforcedevs/docs-components 1.17.0-hack-alpha8 → 1.17.2-accessfix-alpha
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 +0 -1
- package/package.json +1 -1
- package/src/modules/doc/componentPlayground/componentPlayground.css +1 -1
- package/src/modules/doc/componentPlayground/componentPlayground.html +2 -2
- package/src/modules/doc/componentPlayground/componentPlayground.ts +4 -0
- package/src/modules/doc/content/content.css +6 -17
- package/src/modules/doc/heading/heading.css +0 -56
- package/src/modules/doc/heading/heading.html +0 -40
- package/src/modules/doc/heading/heading.ts +0 -24
- package/src/modules/doc/xmlContent/xmlContent.html +9 -1
- package/src/modules/doc/xmlContent/xmlContent.ts +18 -8
- package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +0 -1
- package/src/modules/doc/commentPopup/README.md +0 -322
- package/src/modules/doc/commentPopup/commentDevHelper.ts +0 -380
- package/src/modules/doc/commentPopup/commentPopup.css +0 -440
- package/src/modules/doc/commentPopup/commentPopup.html +0 -138
- package/src/modules/doc/commentPopup/commentPopup.ts +0 -565
- package/src/modules/doc/commentPopup/commentUtils.ts +0 -382
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="container" lwc:if={playgroundAvailable}>
|
|
2
|
+
<div class="playground-container" lwc:if={playgroundAvailable}>
|
|
3
3
|
<dx-spinner
|
|
4
4
|
size="large"
|
|
5
5
|
variant="brand"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<iframe
|
|
9
9
|
src={playgroundSrc}
|
|
10
10
|
onload={handleIframeLoad}
|
|
11
|
-
title=
|
|
11
|
+
title={playgroundTitle}
|
|
12
12
|
allow="clipboard-write"
|
|
13
13
|
></iframe>
|
|
14
14
|
</div>
|
|
@@ -8,6 +8,10 @@ export default class ComponentPlayground extends LightningElement {
|
|
|
8
8
|
|
|
9
9
|
isLoading = true;
|
|
10
10
|
|
|
11
|
+
get playgroundTitle() {
|
|
12
|
+
return `Preview of ${this.component} Component Playground`;
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
get playgroundAvailable() {
|
|
12
16
|
return (
|
|
13
17
|
this.playgroundAppUrl &&
|
|
@@ -67,53 +67,42 @@ h1 {
|
|
|
67
67
|
font-size: var(--dx-g-text-3xl);
|
|
68
68
|
letter-spacing: -0.8px;
|
|
69
69
|
line-height: var(--dx-g-spacing-3xl);
|
|
70
|
-
margin: var(--
|
|
71
|
-
var(--dx-g-spacing-md) 0;
|
|
70
|
+
margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
h2 {
|
|
75
74
|
font-size: var(--dx-g-text-2xl);
|
|
76
75
|
letter-spacing: -0.4px;
|
|
77
76
|
line-height: var(--dx-g-spacing-2xl);
|
|
78
|
-
margin: var(--
|
|
79
|
-
var(--dx-g-spacing-md) 0;
|
|
77
|
+
margin: var(--dx-g-spacing-2xl) 0 var(--dx-g-spacing-md) 0;
|
|
80
78
|
}
|
|
81
79
|
|
|
82
80
|
h3 {
|
|
83
81
|
font-size: var(--dx-g-text-xl);
|
|
84
82
|
letter-spacing: -0.4px;
|
|
85
83
|
line-height: var(--dx-g-spacing-xl);
|
|
86
|
-
margin: var(--
|
|
87
|
-
var(--dx-g-spacing-md) 0;
|
|
84
|
+
margin: var(--dx-g-spacing-xl) 0 var(--dx-g-spacing-md) 0;
|
|
88
85
|
}
|
|
89
86
|
|
|
90
87
|
h4 {
|
|
91
88
|
font-size: var(--dx-g-text-base);
|
|
92
89
|
letter-spacing: -0.5px;
|
|
93
90
|
line-height: var(--dx-g-spacing-lg);
|
|
94
|
-
margin: var(--
|
|
95
|
-
var(--dx-g-spacing-sm) 0;
|
|
91
|
+
margin: var(--dx-g-spacing-lg) 0 var(--dx-g-spacing-sm) 0;
|
|
96
92
|
}
|
|
97
93
|
|
|
98
94
|
h5 {
|
|
99
95
|
font-size: var(--dx-g-text-sm);
|
|
100
96
|
letter-spacing: -0.3px;
|
|
101
97
|
line-height: var(--dx-g-spacing-mlg);
|
|
102
|
-
margin: var(--
|
|
103
|
-
var(--dx-g-spacing-sm) 0;
|
|
98
|
+
margin: var(--dx-g-spacing-md) 0 var(--dx-g-spacing-sm) 0;
|
|
104
99
|
}
|
|
105
100
|
|
|
106
101
|
h6 {
|
|
107
102
|
font-size: var(--dx-g-text-xs);
|
|
108
103
|
letter-spacing: -0.3px;
|
|
109
104
|
line-height: var(--dx-g-spacing-md);
|
|
110
|
-
margin: var(--
|
|
111
|
-
var(--dx-g-spacing-sm) 0;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/* Override top margin for doc-heading preceded by doc-comment-popup */
|
|
115
|
-
doc-comment-popup + doc-heading {
|
|
116
|
-
--heading-top-margin: 10px;
|
|
105
|
+
margin: var(--dx-g-spacing-sm) 0 var(--dx-g-spacing-sm) 0;
|
|
117
106
|
}
|
|
118
107
|
|
|
119
108
|
img {
|
|
@@ -31,59 +31,3 @@ h4 {
|
|
|
31
31
|
h4 doc-heading-content {
|
|
32
32
|
--doc-c-heading-anchor-button-bottom: -6px;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
/* Heading alignment when comment popup is present */
|
|
36
|
-
h1:has(doc-comment-popup),
|
|
37
|
-
h2:has(doc-comment-popup),
|
|
38
|
-
h3:has(doc-comment-popup),
|
|
39
|
-
h4:has(doc-comment-popup) {
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
gap: var(--dx-g-spacing-xs, 4px);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* Ensure heading content takes up remaining space */
|
|
46
|
-
doc-heading-content {
|
|
47
|
-
flex: 1;
|
|
48
|
-
display: inline-block;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/* When no comment popup is present, reset flex to normal display */
|
|
52
|
-
h1:not(:has(doc-comment-popup)),
|
|
53
|
-
h2:not(:has(doc-comment-popup)),
|
|
54
|
-
h3:not(:has(doc-comment-popup)),
|
|
55
|
-
h4:not(:has(doc-comment-popup)) {
|
|
56
|
-
display: block;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Fallback for browsers that don't support :has() -
|
|
60
|
-
rely on JavaScript or assume all headings might have popups */
|
|
61
|
-
@supports not (selector(:has(*))) {
|
|
62
|
-
h1,
|
|
63
|
-
h2,
|
|
64
|
-
h3,
|
|
65
|
-
h4 {
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
gap: var(--dx-g-spacing-xs, 4px);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/* Responsive Design */
|
|
73
|
-
@media (max-width: 768px) {
|
|
74
|
-
h1:has(doc-comment-popup),
|
|
75
|
-
h2:has(doc-comment-popup),
|
|
76
|
-
h3:has(doc-comment-popup),
|
|
77
|
-
h4:has(doc-comment-popup) {
|
|
78
|
-
gap: var(--dx-g-spacing-2xs, 2px);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@supports not (selector(:has(*))) {
|
|
82
|
-
h1,
|
|
83
|
-
h2,
|
|
84
|
-
h3,
|
|
85
|
-
h4 {
|
|
86
|
-
gap: var(--dx-g-spacing-2xs, 2px);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
@@ -1,54 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<h1 class={className} if:true={isAriaLevelOne}>
|
|
3
|
-
<!-- Comment Popup -->
|
|
4
|
-
<template if:true={hasCommentPopup}>
|
|
5
|
-
<doc-comment-popup
|
|
6
|
-
heading-title={headingTitle}
|
|
7
|
-
file-path={filePath}
|
|
8
|
-
start-line={startLine}
|
|
9
|
-
end-line={endLine}
|
|
10
|
-
current-branch={currentBranch}
|
|
11
|
-
></doc-comment-popup>
|
|
12
|
-
</template>
|
|
13
3
|
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
14
4
|
</h1>
|
|
15
5
|
<h2 class={className} if:true={isAriaLevelTwo}>
|
|
16
|
-
<!-- Comment Popup -->
|
|
17
|
-
<template if:true={hasCommentPopup}>
|
|
18
|
-
<doc-comment-popup
|
|
19
|
-
heading-title={headingTitle}
|
|
20
|
-
file-path={filePath}
|
|
21
|
-
start-line={startLine}
|
|
22
|
-
end-line={endLine}
|
|
23
|
-
current-branch={currentBranch}
|
|
24
|
-
></doc-comment-popup>
|
|
25
|
-
</template>
|
|
26
6
|
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
27
7
|
</h2>
|
|
28
8
|
<h3 class={className} if:true={isAriaLevelThree}>
|
|
29
|
-
<!-- Comment Popup -->
|
|
30
|
-
<template if:true={hasCommentPopup}>
|
|
31
|
-
<doc-comment-popup
|
|
32
|
-
heading-title={headingTitle}
|
|
33
|
-
file-path={filePath}
|
|
34
|
-
start-line={startLine}
|
|
35
|
-
end-line={endLine}
|
|
36
|
-
current-branch={currentBranch}
|
|
37
|
-
></doc-comment-popup>
|
|
38
|
-
</template>
|
|
39
9
|
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
40
10
|
</h3>
|
|
41
11
|
<h4 class={className} if:true={isAriaLevelFour}>
|
|
42
|
-
<!-- Comment Popup -->
|
|
43
|
-
<template if:true={hasCommentPopup}>
|
|
44
|
-
<doc-comment-popup
|
|
45
|
-
heading-title={headingTitle}
|
|
46
|
-
file-path={filePath}
|
|
47
|
-
start-line={startLine}
|
|
48
|
-
end-line={endLine}
|
|
49
|
-
current-branch={currentBranch}
|
|
50
|
-
></doc-comment-popup>
|
|
51
|
-
</template>
|
|
52
12
|
<doc-heading-content header={header} hash={hash}></doc-heading-content>
|
|
53
13
|
</h4>
|
|
54
14
|
</template>
|
|
@@ -16,21 +16,6 @@ export default class Heading extends LightningElement {
|
|
|
16
16
|
@api header: string = "";
|
|
17
17
|
@api hash: string | null = null;
|
|
18
18
|
|
|
19
|
-
// Comment popup attributes
|
|
20
|
-
@api index?: string;
|
|
21
|
-
@api filePath?: string;
|
|
22
|
-
@api startLine?: string;
|
|
23
|
-
@api endLine?: string;
|
|
24
|
-
@api currentBranch?: string;
|
|
25
|
-
|
|
26
|
-
// Comment popup properties
|
|
27
|
-
@api iconSymbol = "chat";
|
|
28
|
-
@api iconSize = "medium";
|
|
29
|
-
@api popupTitle = "Leave a Comment";
|
|
30
|
-
@api submitButtonLabel = "Post Comment";
|
|
31
|
-
@api emailPlaceholder = "Enter your email";
|
|
32
|
-
@api commentPlaceholder = "Enter your comment";
|
|
33
|
-
|
|
34
19
|
@api
|
|
35
20
|
private get ariaLevel(): string {
|
|
36
21
|
// Really Dark Magic (TM)
|
|
@@ -79,13 +64,4 @@ export default class Heading extends LightningElement {
|
|
|
79
64
|
private get className(): string {
|
|
80
65
|
return `dx-text-display-${this.displayLevel}`;
|
|
81
66
|
}
|
|
82
|
-
|
|
83
|
-
// Comment popup computed properties
|
|
84
|
-
get hasCommentPopup() {
|
|
85
|
-
return this.currentBranch !== undefined;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
get headingTitle() {
|
|
89
|
-
return this.header;
|
|
90
|
-
}
|
|
91
67
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<doc-content-layout
|
|
3
|
-
lwc:if={
|
|
3
|
+
lwc:if={displayContent}
|
|
4
4
|
lwc:ref="docContentLayout"
|
|
5
5
|
coveo-organization-id={coveoOrganizationId}
|
|
6
6
|
coveo-public-access-token={coveoPublicAccessToken}
|
|
@@ -49,4 +49,12 @@
|
|
|
49
49
|
onnavclick={handleNavClick}
|
|
50
50
|
></doc-content>
|
|
51
51
|
</doc-content-layout>
|
|
52
|
+
<div lwc:if={display404}>
|
|
53
|
+
<dx-error
|
|
54
|
+
image="https://a.sfdcstatic.com/developer-website/images/404.svg"
|
|
55
|
+
code="404"
|
|
56
|
+
header="Beep boop. That did not compute."
|
|
57
|
+
subtitle="The document you're looking for doesn't seem to exist."
|
|
58
|
+
></dx-error>
|
|
59
|
+
</div>
|
|
52
60
|
</template>
|
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
SiderbarFooter,
|
|
12
12
|
HistoryState,
|
|
13
13
|
PageReference,
|
|
14
|
-
TocMap
|
|
14
|
+
TocMap,
|
|
15
|
+
ContentData
|
|
15
16
|
} from "./types";
|
|
16
17
|
import { SearchSyncer } from "docUtils/searchSyncer";
|
|
17
18
|
import { LightningElementWithState } from "dxBaseElements/lightningElementWithState";
|
|
@@ -72,7 +73,8 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
72
73
|
private contentProvider?: FetchContent;
|
|
73
74
|
private docContent = "";
|
|
74
75
|
private language?: DocLanguage | null = null;
|
|
75
|
-
private
|
|
76
|
+
private displayContent = false;
|
|
77
|
+
private display404 = false;
|
|
76
78
|
private _pageHeader?: Header;
|
|
77
79
|
private pdfUrl = "";
|
|
78
80
|
private tocMap: TocMap = {};
|
|
@@ -185,7 +187,13 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
185
187
|
this.apiDomain,
|
|
186
188
|
this.allLanguages
|
|
187
189
|
);
|
|
188
|
-
this.fetchDocument().then(() =>
|
|
190
|
+
this.fetchDocument().then((content: any) => {
|
|
191
|
+
if (content) {
|
|
192
|
+
this.displayContent = true;
|
|
193
|
+
} else {
|
|
194
|
+
this.display404 = true;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
189
197
|
window.addEventListener("popstate", this.handlePopState);
|
|
190
198
|
|
|
191
199
|
this.searchSyncer.init();
|
|
@@ -463,7 +471,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
463
471
|
);
|
|
464
472
|
}
|
|
465
473
|
|
|
466
|
-
async fetchDocument(): Promise<
|
|
474
|
+
async fetchDocument(): Promise<string> {
|
|
467
475
|
this.setState({
|
|
468
476
|
isFetchingDocument: true
|
|
469
477
|
});
|
|
@@ -477,7 +485,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
477
485
|
this.setState({
|
|
478
486
|
isFetchingDocument: false
|
|
479
487
|
});
|
|
480
|
-
return;
|
|
488
|
+
return "";
|
|
481
489
|
}
|
|
482
490
|
|
|
483
491
|
this.docTitle = data.docTitle;
|
|
@@ -509,11 +517,11 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
509
517
|
data.id
|
|
510
518
|
) {
|
|
511
519
|
try {
|
|
512
|
-
await this.fetchContent();
|
|
520
|
+
const moreData = await this.fetchContent();
|
|
513
521
|
this.setState({
|
|
514
522
|
isFetchingDocument: false
|
|
515
523
|
});
|
|
516
|
-
return;
|
|
524
|
+
return moreData.content;
|
|
517
525
|
} catch (error) {
|
|
518
526
|
this.pageReference.contentDocumentId = `${data.id}.htm`;
|
|
519
527
|
this.pageReference.hash = "";
|
|
@@ -527,9 +535,10 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
527
535
|
this.setState({
|
|
528
536
|
isFetchingDocument: false
|
|
529
537
|
});
|
|
538
|
+
return data.content;
|
|
530
539
|
}
|
|
531
540
|
|
|
532
|
-
async fetchContent(): Promise<
|
|
541
|
+
async fetchContent(): Promise<ContentData> {
|
|
533
542
|
this.setState({
|
|
534
543
|
isFetchingContent: true
|
|
535
544
|
});
|
|
@@ -553,6 +562,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
553
562
|
this.setState({
|
|
554
563
|
isFetchingContent: false
|
|
555
564
|
});
|
|
565
|
+
return data;
|
|
556
566
|
}
|
|
557
567
|
|
|
558
568
|
updateHeaderAndSidebarFooter(): void {
|