@salesforcedevs/docs-components 0.19.4 → 0.25.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/__tests__/content.test.ts +1 -1
- package/src/modules/doc/content/content.ts +3 -1
- package/src/modules/doc/contentCallout/__tests__/contentCallout.test.ts +1 -1
- package/src/modules/doc/contentMedia/__tests__/contentMedia.test.ts +1 -5
- package/src/modules/doc/header/__tests__/coveoConfig.ts +1 -1
- package/src/modules/doc/header/__tests__/header.test.ts +3 -11
- package/src/modules/doc/header/header.css +5 -2
- package/src/modules/doc/header/header.ts +1 -1
- package/src/modules/doc/headingAnchor/__tests__/headingAnchor.test.ts +1 -2
- package/src/modules/doc/nav/__tests__/nav.test.ts +3 -4
- package/src/modules/doc/phase/__tests__/phase.test.ts +1 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.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": "1c4347edf0f58a599bf7eed216a1e381ebfd8d16"
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import CodeBlock from "dx/codeBlock";
|
|
2
|
-
import { createRenderComponent } from "utils/tests";
|
|
2
|
+
import { createRenderComponent } from "utils-internal/tests";
|
|
3
3
|
import Content from "../content";
|
|
4
4
|
import * as mockContent from "./mockDocContent";
|
|
5
5
|
import mockPageReference from "./mockPageReference";
|
|
@@ -183,7 +183,9 @@ export default class Content extends LightningElement {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
// ! This is a hack
|
|
187
|
+
// Normalize urls in case it doesn't come complete.
|
|
188
|
+
if (anchorEl.href.startsWith("atlas.")) {
|
|
187
189
|
anchorEl.href = "/docs/" + anchorEl.href;
|
|
188
190
|
}
|
|
189
191
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ContentMedia from "doc/contentMedia";
|
|
2
|
-
import { createRenderComponent } from "utils/tests";
|
|
2
|
+
import { createRenderComponent } from "utils-internal/tests";
|
|
3
3
|
|
|
4
4
|
const TAG = "doc-content-media";
|
|
5
5
|
const render = createRenderComponent(TAG, ContentMedia);
|
|
@@ -11,10 +11,6 @@ describe(TAG, () => {
|
|
|
11
11
|
global.console = { ...global.console, error: jest.fn() };
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
afterEach(() => {
|
|
15
|
-
jest.clearAllMocks();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
14
|
afterAll(() => {
|
|
19
15
|
global.console = originalConsole;
|
|
20
16
|
});
|
|
@@ -2,8 +2,8 @@ import Button from "dx/button";
|
|
|
2
2
|
import Header from "doc/header";
|
|
3
3
|
import HeaderNav from "dx/headerNav";
|
|
4
4
|
import Icon from "dx/icon";
|
|
5
|
-
import { createRenderComponent } from "utils/tests";
|
|
6
|
-
import { createMediaMock } from "utils/jest";
|
|
5
|
+
import { createRenderComponent } from "utils-internal/tests";
|
|
6
|
+
import { createMediaMock } from "utils-internal/jest";
|
|
7
7
|
import {
|
|
8
8
|
mockPropsDevelopers,
|
|
9
9
|
mockPropsEmployees,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import Dropdown from "dx/dropdown";
|
|
13
13
|
import { Option } from "typings/custom";
|
|
14
14
|
import { track } from "dx/instrumentation";
|
|
15
|
-
import { ANALYTICS_INFO } from "utils/headerBase";
|
|
15
|
+
import { ANALYTICS_INFO } from "utils-internal/headerBase";
|
|
16
16
|
|
|
17
17
|
const EXPECTED_QUERY_TABLET = "(max-width: 980px)";
|
|
18
18
|
const EXPECTED_QUERY_MOBILE = "(max-width: 880px)";
|
|
@@ -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("/");
|
|
@@ -57,12 +57,15 @@ header:not(.has-brand) > .header_l2 {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
@media (max-width: 740px) {
|
|
60
|
-
.
|
|
61
|
-
height: initial;
|
|
60
|
+
.header_l2 {
|
|
62
61
|
padding: 0;
|
|
63
62
|
flex-wrap: wrap;
|
|
64
63
|
}
|
|
65
64
|
|
|
65
|
+
.has-nav-items .header_l2 {
|
|
66
|
+
height: initial;
|
|
67
|
+
}
|
|
68
|
+
|
|
66
69
|
.header_l2_group {
|
|
67
70
|
width: 100%;
|
|
68
71
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import type { Option } from "typings/custom";
|
|
4
|
-
import { HeaderBase } from "utils/headerBase";
|
|
4
|
+
import { HeaderBase } from "utils-internal/headerBase";
|
|
5
5
|
import { toJson } from "utils/normalizers";
|
|
6
6
|
import get from "lodash.get";
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import HeadingAnchor from "doc/headingAnchor";
|
|
2
|
-
import { createRenderComponent } from "utils/tests";
|
|
2
|
+
import { createRenderComponent } from "utils-internal/tests";
|
|
3
3
|
|
|
4
4
|
const TAG = "doc-heading-anchor";
|
|
5
5
|
const render = createRenderComponent(TAG, HeadingAnchor);
|
|
@@ -14,7 +14,6 @@ describe(TAG, () => {
|
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
afterEach(() => {
|
|
17
|
-
jest.resetAllMocks();
|
|
18
17
|
Object.defineProperty(global.navigator, "clipboard", {
|
|
19
18
|
value: originalClipboard,
|
|
20
19
|
configurable: true
|
|
@@ -6,7 +6,7 @@ import mockSelectedVersion from "./mockSelectedVersion";
|
|
|
6
6
|
import mockPdfUrl from "./mockPdfUrl";
|
|
7
7
|
import mockToc from "./mockToc";
|
|
8
8
|
import mockPageReference from "./mockPageReference";
|
|
9
|
-
import { createRenderComponent } from "utils/tests";
|
|
9
|
+
import { createRenderComponent } from "utils-internal/tests";
|
|
10
10
|
|
|
11
11
|
const MOCK_PARAMETERS = {
|
|
12
12
|
selectedLanguage: mockSelectedLanguage,
|
|
@@ -32,9 +32,8 @@ describe("doc-nav", () => {
|
|
|
32
32
|
it("fires the event", () => {
|
|
33
33
|
const component = render(MOCK_PARAMETERS);
|
|
34
34
|
|
|
35
|
-
const tocEl: HTMLElement =
|
|
36
|
-
"dx-sidebar"
|
|
37
|
-
);
|
|
35
|
+
const tocEl: HTMLElement =
|
|
36
|
+
component.shadowRoot.querySelector("dx-sidebar");
|
|
38
37
|
const mockNavClick = jest.fn();
|
|
39
38
|
component.addEventListener("navclick", mockNavClick);
|
|
40
39
|
tocEl.dispatchEvent(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import DocPhase from "doc/phase";
|
|
2
|
-
import { createRenderComponent } from "utils/tests";
|
|
2
|
+
import { createRenderComponent } from "utils-internal/tests";
|
|
3
3
|
import mockProps from "./mockProps";
|
|
4
4
|
|
|
5
5
|
const TAG = "doc-phase";
|
|
@@ -28,7 +28,6 @@ describe(TAG, () => {
|
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
it("hides the body when clicking button on expand state", async () => {
|
|
31
|
-
|
|
32
31
|
const showOrHideButton = element.shadowRoot.querySelector("dx-button");
|
|
33
32
|
|
|
34
33
|
const docPhaseBody: HTMLSpanElement =
|
|
@@ -42,7 +41,6 @@ describe(TAG, () => {
|
|
|
42
41
|
});
|
|
43
42
|
|
|
44
43
|
it("shows the body when clicking button on collapse state", async () => {
|
|
45
|
-
|
|
46
44
|
const showOrHideButton = element.shadowRoot.querySelector("dx-button");
|
|
47
45
|
|
|
48
46
|
const docPhaseBody: HTMLSpanElement =
|