@salesforcedevs/docs-components 0.56.2 → 0.56.3-example
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/lwc.config.json +10 -2
- package/package.json +19 -13
- package/src/modules/doc/{amfReference/utils.ts → amfModelParser/amfModelParser.ts} +10 -5
- package/src/modules/doc/amfReference/amfReference.css +23 -3
- package/src/modules/doc/amfReference/amfReference.html +42 -21
- package/src/modules/doc/amfReference/amfReference.ts +1022 -341
- package/src/modules/doc/amfReference/constants.ts +76 -0
- package/src/modules/doc/amfReference/types.ts +45 -13
- package/src/modules/doc/amfTopic/amfTopic.css +20 -0
- package/src/modules/doc/amfTopic/amfTopic.ts +35 -18
- package/src/modules/doc/amfTopic/types.ts +15 -13
- package/src/modules/doc/amfTopic/utils.ts +12 -6
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +2 -1
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +1 -1
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +22 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.css +9 -1
- package/src/modules/doc/breadcrumbs/breadcrumbs.html +44 -34
- package/src/modules/doc/breadcrumbs/breadcrumbs.ts +62 -23
- package/src/modules/doc/componentPlayground/componentPlayground.css +22 -0
- package/src/modules/doc/componentPlayground/componentPlayground.html +20 -0
- package/src/modules/doc/componentPlayground/componentPlayground.ts +42 -0
- package/src/modules/doc/content/content.css +70 -76
- package/src/modules/doc/content/content.html +1 -0
- package/src/modules/doc/content/content.ts +26 -47
- package/src/modules/doc/contentCallout/contentCallout.css +15 -7
- package/src/modules/doc/contentCallout/contentCallout.html +13 -4
- package/src/modules/doc/contentCallout/contentCallout.ts +14 -2
- package/src/modules/doc/contentLayout/contentLayout.css +1 -100
- package/src/modules/doc/contentLayout/contentLayout.html +30 -17
- package/src/modules/doc/contentLayout/contentLayout.ts +354 -65
- package/src/modules/doc/doDont/doDont.css +47 -0
- package/src/modules/doc/doDont/doDont.html +27 -0
- package/src/modules/doc/doDont/doDont.ts +17 -0
- package/src/modules/doc/header/header.css +65 -36
- package/src/modules/doc/header/header.html +41 -139
- package/src/modules/doc/header/header.ts +54 -76
- package/src/modules/doc/heading/heading.css +16 -37
- package/src/modules/doc/heading/heading.html +4 -4
- package/src/modules/doc/heading/heading.ts +12 -10
- package/src/modules/doc/headingAnchor/headingAnchor.css +2 -2
- package/src/modules/doc/headingAnchor/headingAnchor.ts +2 -2
- package/src/modules/doc/headingContent/headingContent.css +6 -8
- package/src/modules/doc/headingContent/headingContent.html +9 -15
- package/src/modules/doc/headingContent/headingContent.ts +2 -14
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.css +1 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +68 -0
- package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +256 -0
- package/src/modules/doc/overview/overview.css +40 -0
- package/src/modules/doc/overview/overview.html +34 -0
- package/src/modules/doc/overview/overview.ts +12 -0
- package/src/modules/doc/phase/phase.css +18 -3
- package/src/modules/doc/phase/phase.html +15 -3
- package/src/modules/doc/phase/phase.ts +44 -8
- package/src/modules/doc/specificationContent/specificationContent.css +36 -0
- package/src/modules/doc/specificationContent/specificationContent.html +167 -0
- package/src/modules/doc/specificationContent/specificationContent.ts +127 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
- package/src/modules/doc/toc/toc.ts +1 -1
- package/src/modules/doc/versionPicker/versionPicker.css +64 -0
- package/src/modules/doc/versionPicker/versionPicker.html +38 -0
- package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
- package/src/modules/doc/xmlContent/types.ts +12 -3
- package/src/modules/doc/xmlContent/utils.ts +17 -12
- package/src/modules/doc/xmlContent/xmlContent.css +32 -3
- package/src/modules/doc/xmlContent/xmlContent.html +41 -15
- package/src/modules/doc/xmlContent/xmlContent.ts +295 -95
- package/src/modules/docHelpers/amfStyle/amfStyle.css +10 -45
- package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +131 -0
- package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
- package/src/modules/docHelpers/status/status.css +1 -1
- package/src/modules/docUtils/{SearchSyncer/SearchSyncer.ts → searchSyncer/searchSyncer.ts} +1 -0
- package/src/modules/docUtils/utils/__mocks__/coveo.analytics.ts +16 -0
- package/src/modules/docUtils/utils/coveo.analytics.d.ts +10 -0
- package/src/modules/docUtils/utils/utils.ts +32 -0
- package/LICENSE +0 -12
- package/src/modules/doc/amfReference/route-meta.ts +0 -22
- package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +0 -93
- package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +0 -39
|
@@ -78,8 +78,8 @@ api-security-documentation {
|
|
|
78
78
|
--arc-font-h3-margin: var(--amf-h8-margin);
|
|
79
79
|
|
|
80
80
|
/* p */
|
|
81
|
-
--arc-font-body1-font-size: var(--dx-g-text-
|
|
82
|
-
--arc-font-body1-line-height: var(--dx-g-spacing-
|
|
81
|
+
--arc-font-body1-font-size: var(--dx-g-text-sm);
|
|
82
|
+
--arc-font-body1-line-height: var(--dx-g-spacing-mlg);
|
|
83
83
|
|
|
84
84
|
/* code */
|
|
85
85
|
--arc-font-code-family: var(--dx-g-font-mono);
|
|
@@ -133,33 +133,14 @@ api-security-documentation {
|
|
|
133
133
|
/* api */
|
|
134
134
|
--api-parameters-document-title-border: 0;
|
|
135
135
|
--api-body-document-title-border: 0;
|
|
136
|
-
--api-type-document-
|
|
137
|
-
--api-type-document-property-title-font-family: var(--dx-g-font-sans);
|
|
138
|
-
--api-type-document-property-title-font-size: var(--dx-g-text-base);
|
|
139
|
-
--api-type-document-property-title-font-weight: var(--dx-g-font-bold);
|
|
140
|
-
--api-type-document-property-title-color: var(--dx-g-blue-vibrant-20);
|
|
141
|
-
--api-type-document-type-font-family: var(--dx-g-font-mono);
|
|
142
|
-
--api-type-document-type-background-color: var(--dx-g-gray-95);
|
|
143
|
-
--api-type-document-type-color: rgb(24, 24, 24);
|
|
144
|
-
--api-type-document-type-attribute-color: rgb(24, 24, 24);
|
|
145
|
-
--api-type-document-trait-font-family: var(--dx-g-font-mono);
|
|
146
|
-
--api-type-document-trait-color: rgb(24, 24, 24);
|
|
147
|
-
--api-type-document-trait-padding: 0 var(--dx-g-spacing-xs);
|
|
148
|
-
--api-type-document-trait-data-type-padding: 0 var(--dx-g-spacing-xs);
|
|
149
|
-
--api-type-document-trait-font-size: var(--dx-g-text-sm);
|
|
150
|
-
--api-type-document-trait-border-radius: var(--dx-g-spacing-xs);
|
|
151
|
-
--api-type-document-trait-background-color: var(--dx-g-gray-95);
|
|
136
|
+
--api-type-document-trait-font-family: var(--dx-g-font-sans);
|
|
152
137
|
--api-type-document-union-button-active-background-color: transparent;
|
|
153
138
|
--api-type-document-union-button-active-color: var(--dx-g-blue-vibrant-20);
|
|
154
139
|
--api-type-document-union-button-background-color: transparent;
|
|
155
140
|
--api-type-document-union-button-color: var(--dx-g-blue-vibrant-50);
|
|
156
141
|
--api-type-document-media-button-border-color: transparent;
|
|
157
142
|
--property-shape-document-padding: 24px 0;
|
|
158
|
-
--property-shape-document-title-font-family: var(--dx-g-font-
|
|
159
|
-
--property-shape-document-title-font-size: var(--dx-g-text-base);
|
|
160
|
-
--property-shape-document-title-font-weight: var(--dx-g-font-bold);
|
|
161
|
-
--property-shape-document-title-line-height: 20px;
|
|
162
|
-
--property-shape-document-title-margin: 8px 0 8px 0;
|
|
143
|
+
--property-shape-document-title-font-family: var(--dx-g-font-mono);
|
|
163
144
|
--property-shape-document-object-color: var(--dx-g-blue-vibrant-90);
|
|
164
145
|
--property-shape-document-array-color: var(--dx-g-blue-vibrant-90);
|
|
165
146
|
--property-shape-document-union-color: var(--dx-g-blue-vibrant-90);
|
|
@@ -185,31 +166,15 @@ api-security-documentation {
|
|
|
185
166
|
--anypoint-button-emphasis-high-active-background-color: transparent;
|
|
186
167
|
|
|
187
168
|
/* api example */
|
|
188
|
-
--api-example-accent-color: rgb(250
|
|
189
|
-
--api-example-background-color: rgb(250
|
|
169
|
+
--api-example-accent-color: rgb(250 250 250);
|
|
170
|
+
--api-example-background-color: rgb(250 250 250);
|
|
190
171
|
--api-example-title-background-color: transparent;
|
|
191
172
|
|
|
192
173
|
/* code snippets */
|
|
193
|
-
--http-code-snippet-container-background-color: rgb(250
|
|
194
|
-
--http-code-snippet-code-function-color: rgb(24, 24, 24);
|
|
195
|
-
--http-code-snippet-code-keyword-color: rgb(24, 24, 24);
|
|
196
|
-
--http-code-snippet-code-cdata-color: rgb(24, 24, 24);
|
|
197
|
-
--http-code-snippet-variable-color: rgb(24, 24, 24);
|
|
174
|
+
--http-code-snippet-container-background-color: rgb(250 250 250);
|
|
198
175
|
--http-code-snippet-container-padding: var(--dx-g-spacing-md);
|
|
199
176
|
|
|
200
177
|
/* prism */
|
|
201
|
-
--code-background-color: rgb(250, 250, 250);
|
|
202
|
-
--code-color: rgb(24, 24, 24);
|
|
203
|
-
--code-token-comment-value-color: rgb(24, 24, 24);
|
|
204
|
-
--code-punctuation-value-color: rgb(24, 24, 24);
|
|
205
|
-
--code-property-value-color: rgb(24, 24, 24);
|
|
206
|
-
--code-type-number-value-color: rgb(24, 24, 24);
|
|
207
|
-
--code-type-boolean-value-color: rgb(24, 24, 24);
|
|
208
|
-
--code-type-text-value-color: rgb(24, 24, 24);
|
|
209
|
-
--code-operator-value-color: rgb(24, 24, 24);
|
|
210
|
-
--code-keyword-value-color: rgb(24, 24, 24);
|
|
211
|
-
--code-function-value-color: rgb(24, 24, 24);
|
|
212
|
-
--code-variable-value-color: rgb(24, 24, 24);
|
|
213
178
|
|
|
214
179
|
/* --code-operator-value-background-color */
|
|
215
180
|
}
|
|
@@ -243,7 +208,7 @@ api-endpoint-documentation {
|
|
|
243
208
|
);
|
|
244
209
|
|
|
245
210
|
/* description */
|
|
246
|
-
--api-endpoint-documentation-description-color: rgb(24
|
|
211
|
+
--api-endpoint-documentation-description-color: rgb(24 24 24);
|
|
247
212
|
}
|
|
248
213
|
|
|
249
214
|
api-endpoint-documentation,
|
|
@@ -306,11 +271,11 @@ api-method-documentation {
|
|
|
306
271
|
--api-method-documentation-http-method-label-font-weight: var(
|
|
307
272
|
--dx-g-font-bold
|
|
308
273
|
);
|
|
309
|
-
--api-method-documentation-description-color: rgb(24
|
|
274
|
+
--api-method-documentation-description-color: rgb(24 24 24);
|
|
310
275
|
--api-method-documentation-operation-id-color: var(--dx-g-gray-50);
|
|
311
276
|
|
|
312
277
|
/* body */
|
|
313
|
-
--api-body-document-description-color: rgb(24
|
|
278
|
+
--api-body-document-description-color: rgb(24 24 24);
|
|
314
279
|
--api-body-document-media-type-selector-color: var(--dx-g-blue-vibrant-20);
|
|
315
280
|
--api-body-document-media-type-selector-font-size: var(
|
|
316
281
|
--amf-h8-mod-font-size
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--dx-c-content-vertical-spacing: var(--dx-g-spacing-lg);
|
|
3
|
+
--dx-c-content-sidebar-sticky-top: calc(
|
|
4
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
5
|
+
);
|
|
6
|
+
--dx-c-sidebar-height: calc(
|
|
7
|
+
100vh -
|
|
8
|
+
calc(
|
|
9
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
10
|
+
)
|
|
11
|
+
);
|
|
12
|
+
--dx-c-content-scroll-margin-top: calc(
|
|
13
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height) +
|
|
14
|
+
var(--dx-g-spacing-2xl)
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
doc-breadcrumbs {
|
|
21
|
+
--dx-c-popover-z-index: 5;
|
|
22
|
+
|
|
23
|
+
display: block;
|
|
24
|
+
margin-bottom: var(--dx-g-spacing-2xl);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
dx-sidebar,
|
|
28
|
+
dx-sidebar-old {
|
|
29
|
+
--dx-c-sidebar-vertical-padding: var(--dx-g-spacing-md);
|
|
30
|
+
|
|
31
|
+
z-index: calc(var(--dx-g-z-index-100) + 5);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
dx-toc {
|
|
35
|
+
--dx-c-toc-width: unset;
|
|
36
|
+
|
|
37
|
+
height: calc(100% - var(--dx-c-content-vertical-spacing) * 2);
|
|
38
|
+
margin: var(--dx-c-content-vertical-spacing) 0;
|
|
39
|
+
overflow-y: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
dx-sidebar,
|
|
43
|
+
dx-toc {
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* offset page jump link due to fixed header */
|
|
48
|
+
::slotted(doc-heading) {
|
|
49
|
+
scroll-margin-top: var(--dx-c-content-scroll-margin-top);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.content {
|
|
53
|
+
display: flex;
|
|
54
|
+
position: relative;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.content-body-doc-phase-container {
|
|
58
|
+
flex: 1;
|
|
59
|
+
border-left: 1px solid var(--dx-g-gray-90);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.content-body-container {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
max-width: var(--dx-g-doc-content-max-width);
|
|
67
|
+
|
|
68
|
+
/* Derived this manually by substracting (topHeader, doc header, banner and the content). */
|
|
69
|
+
min-height: 62vh;
|
|
70
|
+
margin: auto;
|
|
71
|
+
padding: 0 var(--dx-g-global-header-padding-horizontal);
|
|
72
|
+
margin-bottom: calc(2 * (var(--dx-g-spacing-5xl) + 4px));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.content-body {
|
|
76
|
+
margin: var(--dx-g-spacing-md) 0 0;
|
|
77
|
+
max-width: 900px;
|
|
78
|
+
flex: 1;
|
|
79
|
+
width: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.is-sticky {
|
|
83
|
+
align-self: flex-start;
|
|
84
|
+
position: sticky;
|
|
85
|
+
top: var(--dx-c-content-sidebar-sticky-top);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.right-nav-bar {
|
|
89
|
+
margin-left: var(--dx-g-spacing-2xl);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@media screen and (max-width: 1024px) {
|
|
93
|
+
.right-nav-bar {
|
|
94
|
+
display: none;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media screen and (max-width: 800px) {
|
|
99
|
+
.content-body {
|
|
100
|
+
margin-top: var(--dx-c-content-vertical-spacing);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.content-body-doc-phase-container {
|
|
104
|
+
border-left: 0;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media screen and (max-width: 768px) {
|
|
109
|
+
.is-sticky {
|
|
110
|
+
width: 100%;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.content {
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.content-body-container {
|
|
118
|
+
padding-right: 0;
|
|
119
|
+
overflow-x: auto;
|
|
120
|
+
margin-bottom: calc(var(--dx-g-spacing-5xl) + 4px);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.left-nav-bar {
|
|
124
|
+
height: unset;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.content-body {
|
|
128
|
+
margin-left: var(--dx-g-spacing-mlg, 20px);
|
|
129
|
+
margin-right: var(--dx-g-spacing-mlg, 20px);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
img.content-image {
|
|
2
|
+
height: auto;
|
|
3
|
+
display: unset;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.image-framed {
|
|
7
|
+
border: 1px solid black;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.image-xxl,
|
|
11
|
+
.image-full {
|
|
12
|
+
max-width: 1000px;
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.image-xl {
|
|
17
|
+
max-width: 750px;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.image-lg {
|
|
22
|
+
max-width: 660px;
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.image-md {
|
|
27
|
+
max-width: 500px;
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.image-sm {
|
|
32
|
+
max-width: 330px;
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.image-xs {
|
|
37
|
+
max-width: 250px;
|
|
38
|
+
width: 100%;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.image-xxs {
|
|
42
|
+
max-width: 125px;
|
|
43
|
+
width: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.image-icon-lg {
|
|
47
|
+
max-width: 32px;
|
|
48
|
+
width: 100%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.image-icon-md {
|
|
52
|
+
max-width: 20px;
|
|
53
|
+
width: 100%;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.image-icon-sm {
|
|
57
|
+
max-width: 16px;
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
@@ -47,6 +47,7 @@ export class SearchSyncer {
|
|
|
47
47
|
this.handleSearchChange
|
|
48
48
|
);
|
|
49
49
|
this.target.removeEventListener("popstate", this.handlePopState);
|
|
50
|
+
// @ts-ignore
|
|
50
51
|
this.target = undefined;
|
|
51
52
|
this.callbacks.onSearchChange = undefined;
|
|
52
53
|
this.callbacks.onUrlChange = undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class CoveoAnalyticsClient {
|
|
2
|
+
private config: { token: string; endpoint: string };
|
|
3
|
+
|
|
4
|
+
constructor(config: { token: string; endpoint: string }) {
|
|
5
|
+
this.config = config;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
sendViewEvent(event: {
|
|
9
|
+
contentIdKey: string;
|
|
10
|
+
contentType?: string;
|
|
11
|
+
contentIdValue: string;
|
|
12
|
+
}): void {
|
|
13
|
+
// Mock implementation
|
|
14
|
+
console.log("Mock Coveo Analytics event:", event);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare module "coveo.analytics/dist/browser.mjs" {
|
|
2
|
+
export class CoveoAnalyticsClient {
|
|
3
|
+
constructor(config: { token: string; endpoint: string });
|
|
4
|
+
sendViewEvent(event: {
|
|
5
|
+
contentIdKey: string;
|
|
6
|
+
contentType?: string;
|
|
7
|
+
contentIdValue: string;
|
|
8
|
+
}): void;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CoveoAnalyticsClient } from "coveo.analytics/dist/browser.mjs"; // This fix is required for Node 20 upgrade, so that Coveo analytics is loaded properly by LWR.
|
|
2
|
+
|
|
3
|
+
export const oldVersionDocInfo = (latestVersionLink: string) => {
|
|
4
|
+
return {
|
|
5
|
+
title: "Newer Version Available",
|
|
6
|
+
body: `This content describes an older version of this product.
|
|
7
|
+
<a style="font-weight: bold;" href="${latestVersionLink}">View Latest</a>`
|
|
8
|
+
};
|
|
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.
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents the URL reference meta on Reference page.
|
|
3
|
-
* Contains information on selected Reference ID, Topic ID, and Topic Type
|
|
4
|
-
* separated by ":"
|
|
5
|
-
*/
|
|
6
|
-
export class RouteMeta {
|
|
7
|
-
meta: string;
|
|
8
|
-
referenceId = "";
|
|
9
|
-
topicId = "";
|
|
10
|
-
type = "";
|
|
11
|
-
|
|
12
|
-
constructor(meta: string) {
|
|
13
|
-
this.meta = meta;
|
|
14
|
-
|
|
15
|
-
if (meta && meta.includes(":")) {
|
|
16
|
-
const [referenceId, type, topicId] = meta.split(":");
|
|
17
|
-
this.referenceId = referenceId;
|
|
18
|
-
this.topicId = topicId || type;
|
|
19
|
-
this.type = type;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { LightningElement, track } from "lwc";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This is a helper class for when you want your LWC component to have state
|
|
5
|
-
* that is automatically tracked _along with_ its previous state, in a React-
|
|
6
|
-
* like fashion, so that you can compare current state with previous state
|
|
7
|
-
* after a render (like React's `commponentDidUpdate`). One benefit of doing
|
|
8
|
-
* things this way is that you can put all of your reactions to state changes
|
|
9
|
-
* in one place, in `renderedCallback`, rather than having them in various
|
|
10
|
-
* places throughout the component.
|
|
11
|
-
*
|
|
12
|
-
* The API consists in `this.prevState`, `this.state`, and `this.setState`.
|
|
13
|
-
*
|
|
14
|
-
* Usage:
|
|
15
|
-
*
|
|
16
|
-
* ```
|
|
17
|
-
* type MyState = {
|
|
18
|
-
* isFetchingContent: boolean;
|
|
19
|
-
* };
|
|
20
|
-
*
|
|
21
|
-
* class MyFetchingComponent extends LightningElementWithState<MyState> {
|
|
22
|
-
* constructor() {
|
|
23
|
-
* // `this.state` can only be initialized once
|
|
24
|
-
* this.state = {
|
|
25
|
-
* isFetchingContent: false
|
|
26
|
-
* };
|
|
27
|
-
* }
|
|
28
|
-
*
|
|
29
|
-
* // Queued for execution whenever a `setState` call completes
|
|
30
|
-
* renderedCallback() {
|
|
31
|
-
* if (this.prevState.isFetchingContent && !this.state.isFetchingContent) {
|
|
32
|
-
* // Do something knowing that we just finished fetching.
|
|
33
|
-
* notifyFetchSuccessful();
|
|
34
|
-
* }
|
|
35
|
-
* }
|
|
36
|
-
*
|
|
37
|
-
* fetchSomething() {
|
|
38
|
-
* this.setState({
|
|
39
|
-
* isFetchingContent: true
|
|
40
|
-
* });
|
|
41
|
-
*
|
|
42
|
-
* fetch(whatever).then(() => {
|
|
43
|
-
* this.setState({
|
|
44
|
-
* isFetching: false
|
|
45
|
-
* }
|
|
46
|
-
* });
|
|
47
|
-
* }
|
|
48
|
-
* }
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export abstract class LightningElementWithState<
|
|
52
|
-
T extends { [key: string]: unknown }
|
|
53
|
-
> extends LightningElement {
|
|
54
|
-
private _prevState = {} as T;
|
|
55
|
-
@track private _state = {} as T;
|
|
56
|
-
|
|
57
|
-
private _didInitializeState = false;
|
|
58
|
-
|
|
59
|
-
protected get prevState(): T {
|
|
60
|
-
return Object.freeze({
|
|
61
|
-
...this._prevState
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
protected get state(): T {
|
|
66
|
-
return Object.freeze({
|
|
67
|
-
...this._state
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
protected set state(initialState: T) {
|
|
72
|
-
if (!this._didInitializeState) {
|
|
73
|
-
this._state = {
|
|
74
|
-
...initialState
|
|
75
|
-
};
|
|
76
|
-
this._didInitializeState = true;
|
|
77
|
-
} else {
|
|
78
|
-
throw new Error(
|
|
79
|
-
"To mutate state after initialization, use `this.setState`."
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
protected setState = (state: Partial<T>): void => {
|
|
85
|
-
this._prevState = {
|
|
86
|
-
...this._state
|
|
87
|
-
};
|
|
88
|
-
this._state = {
|
|
89
|
-
...this._state,
|
|
90
|
-
...state
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
doc-phase::part(container) {
|
|
2
|
-
margin-bottom: var(--dx-g-spacing-sm);
|
|
3
|
-
padding-left: var(--dx-g-spacing-mlg);
|
|
4
|
-
padding-right: var(--dx-g-spacing-lg);
|
|
5
|
-
width: auto;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.doc-phase-wrapper {
|
|
9
|
-
position: sticky;
|
|
10
|
-
top: 0;
|
|
11
|
-
z-index: 4;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@media screen and (max-width: 800px) {
|
|
15
|
-
doc-phase::part(container) {
|
|
16
|
-
margin-bottom: 0;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@media screen and (min-width: 1024px) and (max-width: 1496px) {
|
|
21
|
-
doc-phase::part(container) {
|
|
22
|
-
padding-right: var(--dx-g-spacing-3xl);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@media screen and (min-width: 1496px) {
|
|
27
|
-
doc-phase::part(container) {
|
|
28
|
-
margin-right: calc(
|
|
29
|
-
var(--dx-g-page-padding-horizontal) - var(--dx-g-spacing-lg)
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@media screen and (max-width: 768px) {
|
|
35
|
-
/* We are giving top value because there is one more sticky item(lnb) with height 40px */
|
|
36
|
-
.doc-phase-wrapper {
|
|
37
|
-
top: 40px;
|
|
38
|
-
}
|
|
39
|
-
}
|