@salesforcedevs/docs-components 0.19.1 → 0.22.0
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/content/content.ts +7 -0
- package/src/modules/doc/contentMedia/__tests__/contentMedia.test.ts +0 -4
- package/src/modules/doc/header/__tests__/coveoConfig.ts +2 -8
- package/src/modules/doc/header/__tests__/header.test.ts +0 -8
- package/src/modules/doc/header/__tests__/mockProps.ts +1 -1
- package/src/modules/doc/headingAnchor/__tests__/headingAnchor.test.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "4a6bdaf5c490103e5620c3199b24528b4d3d26f0"
|
|
18
18
|
}
|
|
@@ -170,6 +170,7 @@ export default class Content extends LightningElement {
|
|
|
170
170
|
// Modify links to work with any domain, links that start with "#" are excluded
|
|
171
171
|
const anchorEls =
|
|
172
172
|
templateEl.content.querySelectorAll("a:not([href^='#'])");
|
|
173
|
+
|
|
173
174
|
anchorEls.forEach((anchorEl) => {
|
|
174
175
|
if (
|
|
175
176
|
anchorEl.textContent.includes("Next →") ||
|
|
@@ -182,6 +183,12 @@ export default class Content extends LightningElement {
|
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
|
|
186
|
+
// ! This is a hack
|
|
187
|
+
// Normalize urls in case it doesn't come complete.
|
|
188
|
+
if (anchorEl.href.startsWith("atlas.")) {
|
|
189
|
+
anchorEl.href = "/docs/" + anchorEl.href;
|
|
190
|
+
}
|
|
191
|
+
|
|
185
192
|
const href = anchorEl.href.split("/");
|
|
186
193
|
if (
|
|
187
194
|
(href[3] === this.pageReference.docId && this.isStorybook) ||
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export const coveoConfig = {
|
|
3
|
-
coveoOrganizationId: "coveosalesforcetestakshatha",
|
|
4
|
-
coveoPublicAccessToken: "xx8d9c92ef-1018-4d92-a3c7-647dff01c21c",
|
|
5
|
-
coveoSearchPipeline: "salesforcedevdoc",
|
|
6
|
-
coveoSearchHub: "salesforcedevdoc"
|
|
7
|
-
};
|
|
1
|
+
import { coveoHeaderConfig } from "../../../../../../dx-components/src/modules/utils/coveo/coveo";
|
|
8
2
|
|
|
9
3
|
export default {
|
|
10
4
|
mobile: false,
|
|
11
|
-
...
|
|
5
|
+
...coveoHeaderConfig
|
|
12
6
|
};
|
|
@@ -83,15 +83,7 @@ const testLangEvent = () => {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
describe(TAG, () => {
|
|
86
|
-
afterAll(() => {
|
|
87
|
-
jest.resetAllMocks();
|
|
88
|
-
});
|
|
89
|
-
|
|
90
86
|
describe("desktop", () => {
|
|
91
|
-
afterEach(() => {
|
|
92
|
-
jest.clearAllMocks();
|
|
93
|
-
});
|
|
94
|
-
|
|
95
87
|
it("renders", () => {
|
|
96
88
|
const element = render();
|
|
97
89
|
expect(element.headerHref).toBe("/");
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
mockNavService,
|
|
13
13
|
mockNavAnalytics
|
|
14
14
|
} from "./mockNavs";
|
|
15
|
-
import
|
|
15
|
+
import coveoConfig from "./coveoConfig";
|
|
16
16
|
import mockNavDevelopers from "./mockNavDevelopers";
|
|
17
17
|
import { Option } from "typings/custom";
|
|
18
18
|
|