@salesforcedevs/docs-components 1.3.179 → 1.3.186-4-cssalpha

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.3.179",
3
+ "version": "1.3.186-4-cssalpha",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -24,5 +24,5 @@
24
24
  "@types/lodash.orderby": "^4.6.7",
25
25
  "@types/lodash.uniqby": "^4.7.7"
26
26
  },
27
- "gitHead": "ef5efd7169e688009ba79bd74e69c42adb277e09"
27
+ "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
28
28
  }
@@ -27,7 +27,7 @@ import {
27
27
  } from "./constants";
28
28
  import { restoreScroll } from "dx/scrollManager";
29
29
  import { DocPhaseInfo } from "typings/custom";
30
- import { oldVersionDocInfo } from "docUtils/utils";
30
+ import { logCoveoPageView, oldVersionDocInfo } from "docUtils/utils";
31
31
 
32
32
  type NavigationItem = {
33
33
  label: string;
@@ -822,6 +822,7 @@ export default class AmfReference extends LightningElement {
822
822
  if (meta) {
823
823
  // update the encoded url meta param
824
824
  const encodedMeta = this.getUrlEncoded(meta);
825
+
825
826
  window.history.replaceState(
826
827
  window.history.state,
827
828
  "",
@@ -1155,6 +1156,7 @@ export default class AmfReference extends LightningElement {
1155
1156
  "",
1156
1157
  selectedItemMetaData.meta
1157
1158
  );
1159
+
1158
1160
  this.updateUrlWithSelected(
1159
1161
  selectedItemMetaData.parentReferencePath,
1160
1162
  selectedItemMetaData.meta
@@ -1198,6 +1200,9 @@ export default class AmfReference extends LightningElement {
1198
1200
  */
1199
1201
 
1200
1202
  private loadMarkdownBasedReference(referenceUrl?: string | null): void {
1203
+ // MILES TODO: figure out if we ever need to log a coveo page view in here
1204
+ // this would be the case if at some point we 'load' a new 'markdown based reference'
1205
+ // without actually triggering a page load
1201
1206
  let referenceId = "";
1202
1207
  const currentUrl = window.location.href;
1203
1208
  if (this.isProjectRootPath()) {
@@ -1278,6 +1283,7 @@ export default class AmfReference extends LightningElement {
1278
1283
  if (this.oldVersionInfo) {
1279
1284
  this.showVersionBanner = true;
1280
1285
  }
1286
+
1281
1287
  this.updateDocPhase();
1282
1288
  this.selectedSidebarValue = window.location.pathname;
1283
1289
  }
@@ -1341,6 +1347,11 @@ export default class AmfReference extends LightningElement {
1341
1347
  elementId,
1342
1348
  metaVal
1343
1349
  );
1350
+
1351
+ logCoveoPageView(
1352
+ this.coveoOrganizationId,
1353
+ this.coveoAnalyticsToken
1354
+ );
1344
1355
  this.updateUrlWithSelected(parentReferencePath, metaVal);
1345
1356
  this.updateNavTitleMetaTag(metadata.navTitle);
1346
1357
  } else {
@@ -35,10 +35,6 @@ export default class AmfTopic extends LightningElement {
35
35
  }
36
36
 
37
37
  this._model = value;
38
- if (this._model) {
39
- this.update();
40
- }
41
- // else { Remove child? No model, seems like no component should be shown. }
42
38
  }
43
39
 
44
40
  update(): void {
@@ -46,7 +42,7 @@ export default class AmfTopic extends LightningElement {
46
42
  throw new Error("Amf TopicModel undefined when trying to update");
47
43
  }
48
44
 
49
- const container = this.template.querySelector("div.topic-container")!;
45
+ const container = this.template.querySelector(".topic-container")!;
50
46
  const { id } = this.model;
51
47
  const type = this.type;
52
48
  const amf = this.amf;
@@ -86,6 +82,15 @@ export default class AmfTopic extends LightningElement {
86
82
  }
87
83
  container.appendChild(element as Node);
88
84
  }
85
+
86
+ renderedCallback(): void {
87
+ try {
88
+ this.update();
89
+ } catch (error) {
90
+ console.error(error);
91
+ }
92
+ // else { Remove child? No model, seems like no component should be shown. }
93
+ }
89
94
  }
90
95
 
91
96
  /**
@@ -4,7 +4,6 @@ import { closest } from "kagekiri";
4
4
  import { toJson } from "dxUtils/normalizers";
5
5
  import { highlightTerms } from "dxUtils/highlight";
6
6
  import { SearchSyncer } from "docUtils/searchSyncer";
7
- import { CoveoAnalyticsClient } from "coveo.analytics";
8
7
 
9
8
  type AnchorMap = { [key: string]: { intersect: boolean; id: string } };
10
9
 
@@ -37,7 +36,6 @@ export default class ContentLayout extends LightningElement {
37
36
  @api coveoSearchHub!: string;
38
37
  @api coveoAdvancedQueryConfig!: string;
39
38
  @api useOldSidebar?: boolean = false;
40
- @api logCoveoPageViewOnlyOnConnect: boolean = false;
41
39
 
42
40
  @api
43
41
  get breadcrumbs() {
@@ -130,19 +128,6 @@ export default class ContentLayout extends LightningElement {
130
128
  );
131
129
  }
132
130
 
133
- private logCoveoPageView() {
134
- if (this.coveoOrganizationId && this.coveoAnalyticsToken) {
135
- const ua = new CoveoAnalyticsClient({
136
- token: this.coveoAnalyticsToken,
137
- endpoint: `https://${this.coveoOrganizationId}.analytics.org.coveo.com`
138
- });
139
- ua.sendViewEvent({
140
- contentIdKey: "@clickableuri",
141
- contentIdValue: window.location.href
142
- });
143
- }
144
- }
145
-
146
131
  connectedCallback(): void {
147
132
  const hasParentHighlightListener = closest(
148
133
  "doc-xml-content",
@@ -155,9 +140,6 @@ export default class ContentLayout extends LightningElement {
155
140
  );
156
141
  this.searchSyncer.init();
157
142
  }
158
- if (this.logCoveoPageViewOnlyOnConnect) {
159
- this.logCoveoPageView();
160
- }
161
143
  }
162
144
 
163
145
  renderedCallback(): void {
@@ -178,8 +160,6 @@ export default class ContentLayout extends LightningElement {
178
160
  if (!this.hasRendered) {
179
161
  this.hasRendered = true;
180
162
  this.restoreScroll();
181
- } else if (!this.logCoveoPageViewOnlyOnConnect) {
182
- this.logCoveoPageView();
183
163
  }
184
164
  }
185
165
 
@@ -408,9 +388,9 @@ export default class ContentLayout extends LightningElement {
408
388
  ) as HTMLElement;
409
389
 
410
390
  const headerHeight =
411
- docHeaderEl.offsetHeight +
412
- globalNavEl.offsetHeight +
413
- contextNavEl.offsetHeight;
391
+ docHeaderEl?.offsetHeight +
392
+ globalNavEl?.offsetHeight +
393
+ contextNavEl?.offsetHeight;
414
394
 
415
395
  const docPhaseEl = (
416
396
  this.template.querySelector("[name=doc-phase]")! as any
@@ -8,6 +8,7 @@ dx-logo {
8
8
  .header_l2 {
9
9
  justify-content: space-between;
10
10
  height: var(--dx-g-doc-header-main-nav-height);
11
+ padding-bottom: var(--dx-g-spacing-xs);
11
12
  }
12
13
 
13
14
  .nav_menu-button {
@@ -17,6 +18,10 @@ dx-logo {
17
18
  );
18
19
  }
19
20
 
21
+ .has-brand.has-scoped-nav-items {
22
+ border-bottom: 1px solid var(--dx-g-gray-90);
23
+ }
24
+
20
25
  .nav_menu-ctas {
21
26
  margin-right: var(--dx-g-spacing-sm);
22
27
  }
@@ -14,9 +14,9 @@
14
14
  if:true={isValidBrand}
15
15
  sprite="salesforcebrand"
16
16
  symbol={brand}
17
- size="xlarge"
17
+ size="large"
18
18
  ></dx-icon>
19
- <span class="subtitle dx-text-display-6">
19
+ <span class="subtitle dx-text-display-7">
20
20
  {subtitle}
21
21
  </span>
22
22
  </a>
@@ -14,7 +14,7 @@ import {
14
14
  } from "./types";
15
15
  import { SearchSyncer } from "docUtils/searchSyncer";
16
16
  import { LightningElementWithState } from "dxBaseElements/lightningElementWithState";
17
- import { oldVersionDocInfo } from "docUtils/utils";
17
+ import { logCoveoPageView, oldVersionDocInfo } from "docUtils/utils";
18
18
  import { Breadcrumb, DocPhaseInfo, Language } from "typings/custom";
19
19
  import { track as trackGTM } from "dxUtils/analytics";
20
20
 
@@ -558,6 +558,7 @@ export default class DocXmlContent extends LightningElementWithState<{
558
558
  }
559
559
 
560
560
  updateUrl(method = HistoryState.PUSH_STATE): void {
561
+ logCoveoPageView(this.coveoOrganizationId, this.coveoAnalyticsToken);
561
562
  window.history[method](
562
563
  {},
563
564
  "docs",
@@ -1,3 +1,5 @@
1
+ import { CoveoAnalyticsClient } from "coveo.analytics";
2
+
1
3
  export const oldVersionDocInfo = (latestVersionLink: string) => {
2
4
  return {
3
5
  title: "Newer Version Available",
@@ -5,3 +7,26 @@ export const oldVersionDocInfo = (latestVersionLink: string) => {
5
7
  <a style="font-weight: bold;" href="${latestVersionLink}">View Latest</a>`
6
8
  };
7
9
  };
10
+
11
+ export function logCoveoPageView(
12
+ coveoOrganizationId: string | undefined,
13
+ coveoAnalyticsToken: string | undefined
14
+ ) {
15
+ if (coveoOrganizationId && coveoAnalyticsToken) {
16
+ const ua = new CoveoAnalyticsClient({
17
+ token: coveoAnalyticsToken,
18
+ endpoint: `https://${coveoOrganizationId}.analytics.org.coveo.com`
19
+ });
20
+ const pathParts = window.location.pathname.split("/");
21
+ let contentType;
22
+ if (pathParts.length >= 2) {
23
+ contentType = pathParts[1];
24
+ }
25
+
26
+ ua.sendViewEvent({
27
+ contentIdKey: "@clickableuri",
28
+ contentType: contentType,
29
+ contentIdValue: window.location.href
30
+ });
31
+ }
32
+ }
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.