@salesforcedevs/docs-components 0.18.0 → 0.19.4-alpha.1

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": "0.18.0",
3
+ "version": "0.19.4-alpha.01",
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": "d211c35163de06a1f77f0450391639278661a481"
17
+ "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
18
18
  }
@@ -5,23 +5,6 @@ import ContentCallout from "doc/contentCallout";
5
5
  import CodeBlock from "dx/codeBlock";
6
6
  import ContentMedia from "doc/contentMedia";
7
7
  import Button from "dx/button";
8
- import { highlightTerms } from "utils/highlight";
9
-
10
- const HIGHLIGHTABLE_SELECTOR = [
11
- "p",
12
- ".p",
13
- ".shortdesc",
14
- "h1",
15
- "h2",
16
- "h3",
17
- "h4",
18
- "h5",
19
- "h6",
20
- "li",
21
- "dl",
22
- "th",
23
- "td"
24
- ].join(",");
25
8
 
26
9
  const LANGUAGE_MAP: { [key: string]: string } = {
27
10
  js: "javascript"
@@ -62,18 +45,6 @@ export default class Content extends LightningElement {
62
45
  "themechange",
63
46
  this.updateTheme.bind(this) // eslint-disableline no-use-before-define
64
47
  );
65
-
66
- window.addEventListener(
67
- "highlightedtermchange",
68
- this.updateHighlighted
69
- );
70
- }
71
-
72
- disconnectedCallback(): void {
73
- window.removeEventListener(
74
- "highlightedtermchange",
75
- this.updateHighlighted
76
- );
77
48
  }
78
49
 
79
50
  updateTheme() {
@@ -170,6 +141,7 @@ export default class Content extends LightningElement {
170
141
  // Modify links to work with any domain, links that start with "#" are excluded
171
142
  const anchorEls =
172
143
  templateEl.content.querySelectorAll("a:not([href^='#'])");
144
+
173
145
  anchorEls.forEach((anchorEl) => {
174
146
  if (
175
147
  anchorEl.textContent.includes("Next →") ||
@@ -182,6 +154,10 @@ export default class Content extends LightningElement {
182
154
  }
183
155
  }
184
156
 
157
+ if (!anchorEl.href.includes("/docs/")) {
158
+ anchorEl.href = "/docs/" + anchorEl.href;
159
+ }
160
+
185
161
  const href = anchorEl.href.split("/");
186
162
  if (
187
163
  (href[3] === this.pageReference.docId && this.isStorybook) ||
@@ -332,12 +308,6 @@ export default class Content extends LightningElement {
332
308
  }
333
309
  }
334
310
 
335
- updateHighlighted = (event: any) =>
336
- highlightTerms(
337
- this.template.querySelectorAll(HIGHLIGHTABLE_SELECTOR),
338
- event.detail
339
- );
340
-
341
311
  @api
342
312
  public navigateToHash(hash: String) {
343
313
  const splitHash = hash.split("#");
@@ -1,12 +1,6 @@
1
- // TODO: Move coveoConfig to a specific module to share it.
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
- ...coveoConfig
5
+ ...coveoHeaderConfig
12
6
  };
@@ -12,7 +12,7 @@ import {
12
12
  mockNavService,
13
13
  mockNavAnalytics
14
14
  } from "./mockNavs";
15
- import { coveoConfig } from "./coveoConfig";
15
+ import coveoConfig from "./coveoConfig";
16
16
  import mockNavDevelopers from "./mockNavDevelopers";
17
17
  import { Option } from "typings/custom";
18
18
 
@@ -57,7 +57,8 @@ header:not(.has-brand) > .header_l2 {
57
57
  }
58
58
 
59
59
  @media (max-width: 740px) {
60
- .header_l2 {
60
+ .has-nav-items .header_l2 {
61
+ height: initial;
61
62
  padding: 0;
62
63
  flex-wrap: wrap;
63
64
  }
@@ -5,16 +5,16 @@ import { DocPhaseInfo } from "typings/custom";
5
5
  import { toJson } from "utils/normalizers";
6
6
 
7
7
  export default class Phase extends LightningElement {
8
- _docPhaseInfo!: DocPhaseInfo;
8
+ _docPhaseInfo: DocPhaseInfo | null = null;
9
9
 
10
10
  isBodyHidden = false;
11
11
 
12
12
  get docPhaseTitle() {
13
- return this.docPhaseInfo.title;
13
+ return this.docPhaseInfo?.title;
14
14
  }
15
15
 
16
16
  @api
17
- get docPhaseInfo(): DocPhaseInfo {
17
+ get docPhaseInfo(): DocPhaseInfo | null {
18
18
  return this._docPhaseInfo;
19
19
  }
20
20
 
@@ -23,7 +23,7 @@ export default class Phase extends LightningElement {
23
23
  }
24
24
 
25
25
  get hideBodyText() {
26
- return this.isBodyHidden ? "Show" : "Hide"
26
+ return this.isBodyHidden ? "Show" : "Hide";
27
27
  }
28
28
 
29
29
  get className() {
@@ -45,7 +45,7 @@ export default class Phase extends LightningElement {
45
45
  renderedCallback() {
46
46
  const phaseBodyContainer =
47
47
  this.template.querySelector(".doc-phase-body");
48
- if (phaseBodyContainer) {
48
+ if (phaseBodyContainer && this.docPhaseInfo) {
49
49
  // eslint-disable-next-line @lwc/lwc/no-inner-html
50
50
  phaseBodyContainer.innerHTML = this.docPhaseInfo.body;
51
51
  }
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.