@salesforcedevs/docs-components 1.14.6-load-19 → 1.14.8-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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.14.6-load-19",
3
+ "version": "1.14.8-alpha1",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "engines": {
8
- "node": "18.x"
8
+ "node": "20.x"
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public"
@@ -33,4 +33,4 @@ table {
33
33
  .loader {
34
34
  pointer-events: none;
35
35
  bottom: 30%;
36
- }
36
+ }
@@ -3,8 +3,8 @@
3
3
  <dx-spinner
4
4
  size="large"
5
5
  variant="brand"
6
- if:true={isLoading}
7
6
  class="loader"
7
+ if:true={isLoading}
8
8
  ></dx-spinner>
9
9
  <dx-error-fallback lwc:if={showError}></dx-error-fallback>
10
10
  <template lwc:if={hasAttributes}>
@@ -29,12 +29,6 @@ export default class SpecificationContent extends LightningElement {
29
29
  this.fetchComponentMetadata();
30
30
  }
31
31
 
32
- // Function to delay execution by a specified time (in milliseconds)
33
- delay(ms: number): Promise<void> {
34
- return new Promise(resolve => setTimeout(resolve, ms));
35
- }
36
-
37
-
38
32
  async fetchComponentMetadata() {
39
33
  const componentQueryParams = {
40
34
  model: this.model,
@@ -45,25 +39,20 @@ export default class SpecificationContent extends LightningElement {
45
39
  const queryString = new URLSearchParams(
46
40
  componentQueryParams
47
41
  ).toString();
48
- // Wait for 3 seconds
49
- await this.delay(10000);
50
- const url = 'https://cx-mock-router-internal-07a18d7b3f61.herokuapp.com/lwc/lightning/inputRichText';
42
+ const url = `${CX_ROUTER_API}?${queryString}`;
51
43
 
52
44
  try {
53
45
  const response = await fetch(url);
54
46
 
55
- if(this.component === "error") {
56
- throw new Error('Failed');
57
- }
58
-
59
47
  if (!response.ok) {
60
48
  // TODO: Will add loader and show error as follow-up
61
49
  throw new Error(`Failed to fetch: ${response.statusText}`);
62
50
  }
63
51
 
64
52
  const result = await response.json();
53
+
65
54
  // Due to middleware the data is sent as part of response now.
66
- this.data = result;
55
+ this.data = result?.response;
67
56
  if (this.data) {
68
57
  ({
69
58
  attributes: this.attributes,
@@ -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:
@@ -71,8 +73,9 @@ export class FetchContent {
71
73
  contentId: string,
72
74
  options: ContentApiOptions
73
75
  ): Promise<ContentData> {
76
+ console.log(options + deliverable);
74
77
  return this.fetchResource<ContentData>(
75
- `${this.apiDomain}/docs/get_document_content/${deliverable}/${contentId}/${options.language}/${options.version}`
78
+ `/cx-router/dsc/topic?projectId=sfdocs-asl_dev_guide&projectVersion=254-7-dev&locale=en-us&topic=${contentId}`
76
79
  );
77
80
  }
78
81
 
@@ -87,9 +90,7 @@ export class FetchContent {
87
90
  return json;
88
91
  }
89
92
 
90
- private normalizeToc(
91
- apiToc: Array<ApiNavItem>
92
- ): {
93
+ private normalizeToc(apiToc: Array<ApiNavItem>): {
93
94
  tocMap: { [key: string]: TreeNode };
94
95
  normalizedToc: Array<TreeNode>;
95
96
  } {