@salesforcedevs/docs-components 1.3.39-mulesoft-lwc-2 → 1.3.46

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/LICENSE ADDED
@@ -0,0 +1,12 @@
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.
package/lwc.config.json CHANGED
@@ -2,8 +2,7 @@
2
2
  "modules": [
3
3
  { "dir": "src/modules" },
4
4
  { "npm": "@salesforcedevs/dx-components" },
5
- { "npm": "@salesforcedevs/dw-components" },
6
- { "npm": "@mulesoft/api-console-lwc" }
5
+ { "npm": "@salesforcedevs/dw-components" }
7
6
  ],
8
7
  "expose": [
9
8
  "doc/amfReference",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.39-mulesoft-lwc-2",
3
+ "version": "1.3.46",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -12,7 +12,6 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@api-components/amf-helper-mixin": "^4.5.17",
15
- "@mulesoft/api-console-lwc": "^0.2.20",
16
15
  "classnames": "^2.2.6",
17
16
  "kagekiri": "^1.4.1",
18
17
  "lodash.orderby": "^4.6.0",
@@ -25,5 +24,5 @@
25
24
  "@types/lodash.orderby": "^4.6.7",
26
25
  "@types/lodash.uniqby": "^4.7.7"
27
26
  },
28
- "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
27
+ "gitHead": "decc9a3791a30eb8d16fb7cffb3adf7092ab863b"
29
28
  }
@@ -22,7 +22,6 @@
22
22
  <div slot="sidebar-header" class="version-picker">
23
23
  <template if:true={isVersionEnabled}>
24
24
  <dx-dropdown
25
- suppress-gtm-nav-headings
26
25
  onchange={handleVersionChange}
27
26
  data-type="version"
28
27
  options={versions}
@@ -37,14 +36,9 @@
37
36
  <slot></slot>
38
37
  </template>
39
38
  <template if:true={showSpecBasedReference}>
40
- <div class="container" if:true={topicModel}>
39
+ <div class="container">
41
40
  <div class="api-documentation">
42
- <arc-api-documentation
43
- amf={topicModel.amf}
44
- selected={topicModel.id}
45
- selected-type={topicModel.type}
46
- no-try-it
47
- ></arc-api-documentation>
41
+ <doc-amf-topic model={topicModel}></doc-amf-topic>
48
42
  </div>
49
43
  </div>
50
44
  </template>
@@ -175,7 +175,7 @@ export default class AmfReference extends LightningElement {
175
175
 
176
176
  connectedCallback(): void {
177
177
  this.addEventListener(
178
- "api_navigation_selection_changed",
178
+ "api-navigation-selection-changed",
179
179
  this._boundOnApiNavigationChanged
180
180
  );
181
181
  window.addEventListener(
@@ -1,6 +1,6 @@
1
1
  import { track } from "dxUtils/analytics";
2
2
  import { LightningElement, api } from "lwc";
3
- import { AnalyticsPayload, BreadcrumbItemVariant } from "typings/custom";
3
+ import { BreadcrumbItemVariant } from "typings/custom";
4
4
 
5
5
  const BREADCRUMB_LONG = "breadcrumb_long";
6
6
  const BREADCRUMB_BACK_ARROW = "breadcrumb_back-arrow";
@@ -8,8 +8,7 @@ const BREADCRUMB_BACK_ARROW = "breadcrumb_back-arrow";
8
8
  const LONG_LABEL_NUMBER = 30;
9
9
  export default class BreadcrumbItem extends LightningElement {
10
10
  @api href?: string;
11
- @api analyticsEvent!: string;
12
- @api analyticsBasePayload!: AnalyticsPayload;
11
+ @api level?: string;
13
12
 
14
13
  @api
15
14
  get label() {
@@ -51,14 +50,13 @@ export default class BreadcrumbItem extends LightningElement {
51
50
  }
52
51
 
53
52
  private onLinkClick(event: Event): void {
54
- if (!this.analyticsEvent) {
55
- return;
56
- }
57
-
58
- track(event.target!, this.analyticsEvent, {
59
- ...this.analyticsBasePayload,
53
+ track(event.target!, "custEv_breadcrumbClick", {
60
54
  clickText: this.label,
61
- clickUrl: this.href
55
+ clickUrl: this.href,
56
+ elementType: "link",
57
+ navType: "breadcrumb",
58
+ navLevel: this.level ? this.level + 1 : 1,
59
+ navItem: this.label
62
60
  });
63
61
  }
64
62
  }
@@ -3,21 +3,18 @@
3
3
  <template if:true={displayCrumbs}>
4
4
  <template if:false={renderSmallVariant}>
5
5
  <doc-breadcrumb-item
6
- analytics-event={analyticsEventName}
7
- analytics-base-payload={analyticsBasePayload}
8
6
  href={firstCrumb.href}
9
7
  label={firstCrumb.label}
10
8
  ></doc-breadcrumb-item>
11
9
  <span class="breadcrumb-item_slash">/</span>
12
10
  <template if:true={renderDropdown}>
13
11
  <dx-dropdown
12
+ analytics-event="custEv_breadcrumbClick"
13
+ analytics-payload={ANALYTICS_PAYLOAD}
14
14
  if:true={renderDropdown}
15
- analytics-event={analyticsEventName}
16
- analytics-base-payload={analyticsBasePayload}
17
15
  options={dropdownOptions}
18
16
  open-on-hover
19
17
  placement="bottom"
20
- suppress-gtm-nav-headings
21
18
  variant="indented"
22
19
  width="fit-content"
23
20
  >
@@ -32,11 +29,10 @@
32
29
  </template>
33
30
  <template for:each={breadcrumbItems} for:item="breadcrumb">
34
31
  <doc-breadcrumb-item
35
- analytics-event={analyticsEventName}
36
- analytics-base-payload={analyticsBasePayload}
37
32
  href={breadcrumb.href}
38
33
  key={breadcrumb.id}
39
34
  label={breadcrumb.label}
35
+ level={breadcrumb.level}
40
36
  ></doc-breadcrumb-item>
41
37
  <span class="breadcrumb-item_slash" key={breadcrumb.label}>
42
38
  /
@@ -48,8 +44,6 @@
48
44
  </template>
49
45
  <template if:true={renderSmallVariant}>
50
46
  <doc-breadcrumb-item
51
- analytics-event={analyticsEventName}
52
- analytics-base-payload={analyticsBasePayload}
53
47
  href={lastLinkCrump.href}
54
48
  label={lastLinkCrump.label}
55
49
  variant="back-arrow"
@@ -17,11 +17,6 @@ const CONSTANTS = {
17
17
  dropdownWidth: 32
18
18
  };
19
19
 
20
- export const ANALYTICS_EVENT_NAME = "custEv_breadcrumbNavClick";
21
- export const ANALYTICS_BASE_PAYLOAD = {
22
- navType: "breadcrumb"
23
- };
24
-
25
20
  export default class Breadcrumbs extends LightningElement {
26
21
  @api ariaLabel: string = "Documentation Breadcrumbs";
27
22
 
@@ -102,14 +97,12 @@ export default class Breadcrumbs extends LightningElement {
102
97
  return this.breadcrumbs[this.breadcrumbs.length - 1];
103
98
  }
104
99
 
105
- private get analyticsEventName() {
106
- return ANALYTICS_EVENT_NAME;
107
- }
108
-
109
- private get analyticsBasePayload() {
100
+ // this payload is only used for breadcrumb dropdown
101
+ private get ANALYTICS_PAYLOAD() {
110
102
  return {
111
- ...ANALYTICS_BASE_PAYLOAD,
112
- navItem: this.breadcrumbs.map((crumb) => crumb.label).join("/")
103
+ elementType: "link",
104
+ navType: "breadcrumb",
105
+ navLevel: 1
113
106
  };
114
107
  }
115
108
 
@@ -137,10 +130,13 @@ export default class Breadcrumbs extends LightningElement {
137
130
  return;
138
131
  }
139
132
 
140
- this._breadcrumbs = toJson(breadcrumbs).map((crumb: Breadcrumb) => ({
141
- ...crumb,
142
- id: crumb.id || crumb.href
143
- }));
133
+ this._breadcrumbs = toJson(breadcrumbs).map(
134
+ (crumb: Breadcrumb, index: number) => ({
135
+ ...crumb,
136
+ id: crumb.id || crumb.href,
137
+ level: index
138
+ })
139
+ );
144
140
  }
145
141
 
146
142
  private updateDropdownOptionAmount(): void {
@@ -14,8 +14,8 @@
14
14
  <div slot="sidebar-header" class="document-pickers">
15
15
  <dx-dropdown
16
16
  data-type="version"
17
- suppress-gtm-nav-headings
18
- analytics-event={analyticsEvent}
17
+ analytics-event="custEv_ctaLinkClick"
18
+ analytics-payload={ANALYTICS_PAYLOAD}
19
19
  options={versionOptions}
20
20
  value={version.id}
21
21
  width="290px"
@@ -63,7 +63,6 @@ export default class DocXmlContent extends LightningElementWithState<{
63
63
  private sidebarContent: Array<TreeNode> = null;
64
64
  private version: DocVersion = null;
65
65
  private docTitle = "";
66
- private analyticsEvent = "custEv_ctaLinkClick";
67
66
  private _pathName = "";
68
67
  private _pageHeader?: Header;
69
68
  private listenerAttached = false;
@@ -281,6 +280,13 @@ export default class DocXmlContent extends LightningElementWithState<{
281
280
  );
282
281
  }
283
282
 
283
+ private get ANALYTICS_PAYLOAD() {
284
+ return {
285
+ elementTitle: "version picker",
286
+ contentCategory: "cta"
287
+ };
288
+ }
289
+
284
290
  private handlePopState = (): void =>
285
291
  this.updatePageReference(this.getReferenceFromUrl());
286
292