@salesforcedevs/docs-components 1.14.6-loader → 1.14.8-alpha2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.14.6-loader",
3
+ "version": "1.14.8-alpha2",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -29,3 +29,8 @@ table {
29
29
  .icon {
30
30
  display: inline-block;
31
31
  }
32
+
33
+ .loader {
34
+ pointer-events: none;
35
+ bottom: 30%;
36
+ }
@@ -3,6 +3,7 @@
3
3
  <dx-spinner
4
4
  size="large"
5
5
  variant="brand"
6
+ class="loader"
6
7
  if:true={isLoading}
7
8
  ></dx-spinner>
8
9
  <dx-error-fallback lwc:if={showError}></dx-error-fallback>
@@ -38,9 +38,11 @@ export class FetchContent {
38
38
  pdf_url,
39
39
  deliverable
40
40
  } = await this.fetchResource<ApiDocData>(
41
- `${this.apiDomain}/docs/get_document/${docId}`
41
+ `/cx-router/dsc/toc?projectId=sfdocs-asl_dev_guide&projectVersion=254-7-dev&locale=en-us`
42
42
  );
43
43
 
44
+ console.log(docId);
45
+
44
46
  const { normalizedToc, tocMap } = this.normalizeToc(toc);
45
47
  return {
46
48
  availableLanguages:
@@ -70,26 +72,24 @@ export class FetchContent {
70
72
  deliverable: string,
71
73
  contentId: string,
72
74
  options: ContentApiOptions
73
- ): Promise<ContentData> {
74
- return this.fetchResource<ContentData>(
75
- `${this.apiDomain}/docs/get_document_content/${deliverable}/${contentId}/${options.language}/${options.version}`
75
+ ): Promise<String> {
76
+ return await this.fetchResource<ContentData>(
77
+ `/cx-router/dsc/topic?projectId=sfdocs-asl_dev_guide&projectVersion=254-7-dev&locale=en-us&topic=${contentId}`
76
78
  );
77
79
  }
78
80
 
79
81
  private async fetchResource<T>(url: string): Promise<T> {
80
82
  const response = await fetch(url);
81
- if (!response.ok) {
83
+ /*if (!response.ok) {
82
84
  throw new Error(response.statusText);
83
- }
85
+ }*/
84
86
 
85
87
  const json = await response.json();
86
88
 
87
- return json;
89
+ return json.response;
88
90
  }
89
91
 
90
- private normalizeToc(
91
- apiToc: Array<ApiNavItem>
92
- ): {
92
+ private normalizeToc(apiToc: Array<ApiNavItem>): {
93
93
  tocMap: { [key: string]: TreeNode };
94
94
  normalizedToc: Array<TreeNode>;
95
95
  } {
@@ -543,7 +543,7 @@ export default class DocXmlContent extends LightningElementWithState<{
543
543
  );
544
544
 
545
545
  if (data) {
546
- this.docContent = data.content;
546
+ this.docContent = data;
547
547
  this.addMetatags();
548
548
 
549
549
  if (!this.pageReference.hash) {