@salesforcedevs/docs-components 1.17.0 → 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/package.json +2 -2
- 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/xmlContent/xmlContent.html +9 -1
- package/src/modules/doc/xmlContent/xmlContent.ts +18 -8
- package/LICENSE +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.2-accessfix-alpha",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"@types/lodash.orderby": "4.6.9",
|
|
26
26
|
"@types/lodash.uniqby": "4.7.9"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
|
|
29
29
|
}
|
|
@@ -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 &&
|
|
@@ -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 {
|
package/LICENSE
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
-
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
-
|
|
10
|
-
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
-
|
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|