@salesforcedevs/docs-components 0.75.0 → 0.79.2
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/amfReference/amfReference.ts +15 -8
- package/src/modules/doc/breadcrumbs/breadcrumbs.html +3 -1
- package/src/modules/doc/contentCallout/contentCallout.html +3 -1
- package/src/modules/doc/contentLayout/contentLayout.ts +14 -10
- package/src/modules/doc/phase/phase.html +3 -1
- package/src/modules/doc/toc/toc.html +3 -1
- package/src/modules/doc/toolbar/toolbar.ts +6 -6
- package/src/modules/doc/xmlContent/xmlContent.ts +1 -2
- package/LICENSE +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.2",
|
|
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": "
|
|
27
|
+
"gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
|
|
28
28
|
}
|
|
@@ -184,7 +184,7 @@ export default class AmfReference extends LightningElement {
|
|
|
184
184
|
);
|
|
185
185
|
this._scrollInterval = window.setInterval(() => {
|
|
186
186
|
this.saveScroll();
|
|
187
|
-
|
|
187
|
+
}, 1000);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
disconnectedCallback(): void {
|
|
@@ -200,11 +200,16 @@ export default class AmfReference extends LightningElement {
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
saveScroll() {
|
|
203
|
-
window.history.replaceState(
|
|
203
|
+
window.history.replaceState(
|
|
204
|
+
{ scrollValue: document.body.scrollTop },
|
|
205
|
+
"",
|
|
206
|
+
window.location.href
|
|
207
|
+
);
|
|
204
208
|
}
|
|
205
209
|
|
|
206
210
|
restoreScroll() {
|
|
207
|
-
document.body.scrollTop = document.documentElement.scrollTop =
|
|
211
|
+
document.body.scrollTop = document.documentElement.scrollTop =
|
|
212
|
+
window.history.state?.scrollValue;
|
|
208
213
|
}
|
|
209
214
|
|
|
210
215
|
renderedCallback(): void {
|
|
@@ -776,7 +781,7 @@ export default class AmfReference extends LightningElement {
|
|
|
776
781
|
const encodedMeta = this.getUrlEncoded(meta);
|
|
777
782
|
|
|
778
783
|
window.history.pushState(
|
|
779
|
-
{
|
|
784
|
+
{},
|
|
780
785
|
"",
|
|
781
786
|
`${parentReferencePath}?meta=${encodedMeta}`
|
|
782
787
|
);
|
|
@@ -885,7 +890,6 @@ export default class AmfReference extends LightningElement {
|
|
|
885
890
|
elementId: string,
|
|
886
891
|
meta: string
|
|
887
892
|
): void {
|
|
888
|
-
|
|
889
893
|
this.selectedTopic = {
|
|
890
894
|
referenceId,
|
|
891
895
|
parentReferencePath,
|
|
@@ -1227,8 +1231,11 @@ export default class AmfReference extends LightningElement {
|
|
|
1227
1231
|
window.location.href = redirectReferenceUrl;
|
|
1228
1232
|
} else {
|
|
1229
1233
|
// This is for CASE 1,3 and 4 mentioned above, Where we need to update the browser history
|
|
1230
|
-
window.history.replaceState(
|
|
1231
|
-
|
|
1234
|
+
window.history.replaceState(
|
|
1235
|
+
window.history.state,
|
|
1236
|
+
"",
|
|
1237
|
+
redirectReferenceUrl
|
|
1238
|
+
);
|
|
1232
1239
|
}
|
|
1233
1240
|
}
|
|
1234
1241
|
}
|
|
@@ -1274,7 +1281,7 @@ export default class AmfReference extends LightningElement {
|
|
|
1274
1281
|
|
|
1275
1282
|
onNavSelect(event: CustomEvent): void {
|
|
1276
1283
|
this.saveScroll();
|
|
1277
|
-
|
|
1284
|
+
|
|
1278
1285
|
const name = event.detail.name;
|
|
1279
1286
|
if (name) {
|
|
1280
1287
|
const urlReferenceId = this.getReferenceIdFromUrl(name);
|
|
@@ -42,7 +42,9 @@
|
|
|
42
42
|
/
|
|
43
43
|
</span>
|
|
44
44
|
</template>
|
|
45
|
-
<doc-breadcrumb-item
|
|
45
|
+
<doc-breadcrumb-item
|
|
46
|
+
label={lastCrumb.label}
|
|
47
|
+
></doc-breadcrumb-item>
|
|
46
48
|
</template>
|
|
47
49
|
<template if:true={renderSmallVariant}>
|
|
48
50
|
<doc-breadcrumb-item
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
<dx-icon symbol={iconName} size="large" color={iconColor}></dx-icon>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="dx-callout-content">
|
|
7
|
-
<p class="doc-status-title dx-callout-title dx-text-body-3">
|
|
7
|
+
<p class="doc-status-title dx-callout-title dx-text-body-3">
|
|
8
|
+
{title}
|
|
9
|
+
</p>
|
|
8
10
|
<span class="dx-callout-body dx-text-body-3">
|
|
9
11
|
<slot onslotchange={onSlotChange}></slot>
|
|
10
12
|
</span>
|
|
@@ -79,7 +79,7 @@ export default class ContentLayout extends LightningElement {
|
|
|
79
79
|
private lastScrollPosition: number;
|
|
80
80
|
private observer?: IntersectionObserver;
|
|
81
81
|
private hasRendered: boolean = false;
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
private searchSyncer = new SearchSyncer({
|
|
84
84
|
callbacks: {
|
|
85
85
|
onUrlChange: (nextSearchString: string): void => {
|
|
@@ -112,7 +112,9 @@ export default class ContentLayout extends LightningElement {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
get showBreadcrumbs(): boolean {
|
|
115
|
-
return
|
|
115
|
+
return (
|
|
116
|
+
this.breadcrumbs != null && (this.breadcrumbs as any[]).length > 1
|
|
117
|
+
);
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
get docContentStyle(): string {
|
|
@@ -134,9 +136,7 @@ export default class ContentLayout extends LightningElement {
|
|
|
134
136
|
|
|
135
137
|
this._scrollInterval = window.setInterval(() => {
|
|
136
138
|
this.saveScroll();
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
}, 1000);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
renderedCallback(): void {
|
|
@@ -149,7 +149,7 @@ export default class ContentLayout extends LightningElement {
|
|
|
149
149
|
this.attachInteractionObserver,
|
|
150
150
|
OBSERVER_ATTACH_WAIT_TIME
|
|
151
151
|
);
|
|
152
|
-
if(!this.hasRendered) {
|
|
152
|
+
if (!this.hasRendered) {
|
|
153
153
|
this.hasRendered = true;
|
|
154
154
|
this.restoreScroll();
|
|
155
155
|
}
|
|
@@ -168,11 +168,16 @@ export default class ContentLayout extends LightningElement {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
saveScroll() {
|
|
171
|
-
window.history.replaceState(
|
|
171
|
+
window.history.replaceState(
|
|
172
|
+
{ scrollValue: document.body.scrollTop },
|
|
173
|
+
"",
|
|
174
|
+
window.location.href
|
|
175
|
+
);
|
|
172
176
|
}
|
|
173
177
|
|
|
174
178
|
restoreScroll() {
|
|
175
|
-
document.body.scrollTop = document.documentElement.scrollTop =
|
|
179
|
+
document.body.scrollTop = document.documentElement.scrollTop =
|
|
180
|
+
window.history.state?.scrollValue;
|
|
176
181
|
}
|
|
177
182
|
|
|
178
183
|
clearRenderObserverTimer = () => {
|
|
@@ -232,8 +237,7 @@ export default class ContentLayout extends LightningElement {
|
|
|
232
237
|
);
|
|
233
238
|
for (const headingElement of headingElements) {
|
|
234
239
|
// Sometimes elements hash is not being set when slot content is wrapped with div
|
|
235
|
-
headingElement.hash =
|
|
236
|
-
headingElement.attributes.hash?.nodeValue;
|
|
240
|
+
headingElement.hash = headingElement.attributes.hash?.nodeValue;
|
|
237
241
|
}
|
|
238
242
|
const tocOptions = [];
|
|
239
243
|
for (const headingElement of headingElements) {
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
size="large"
|
|
8
8
|
color="status-icon-color"
|
|
9
9
|
></dx-icon>
|
|
10
|
-
<p class="doc-status-title doc-phase-title dx-text-body-3">
|
|
10
|
+
<p class="doc-status-title doc-phase-title dx-text-body-3">
|
|
11
|
+
{docPhaseTitle}
|
|
12
|
+
</p>
|
|
11
13
|
<dx-button
|
|
12
14
|
variant="inline"
|
|
13
15
|
onclick={onButtonClick}
|
|
@@ -40,9 +40,9 @@ export default class Toolbar extends LightningElement {
|
|
|
40
40
|
"select[name=languages]"
|
|
41
41
|
) as HTMLSelectElement;
|
|
42
42
|
if (languageEl) {
|
|
43
|
-
const languageValue = (
|
|
44
|
-
languageEl.selectedIndex
|
|
45
|
-
|
|
43
|
+
const languageValue = (
|
|
44
|
+
languageEl[languageEl.selectedIndex] as HTMLOptionElement
|
|
45
|
+
).value;
|
|
46
46
|
this.dispatchEvent(
|
|
47
47
|
new CustomEvent("languageselected", {
|
|
48
48
|
detail: {
|
|
@@ -61,9 +61,9 @@ export default class Toolbar extends LightningElement {
|
|
|
61
61
|
"select[name=versions]"
|
|
62
62
|
) as HTMLSelectElement;
|
|
63
63
|
if (versionEl) {
|
|
64
|
-
const versionValue = (
|
|
65
|
-
versionEl.selectedIndex
|
|
66
|
-
|
|
64
|
+
const versionValue = (
|
|
65
|
+
versionEl[versionEl.selectedIndex] as HTMLOptionElement
|
|
66
|
+
).value;
|
|
67
67
|
this.dispatchEvent(
|
|
68
68
|
new CustomEvent("versionselected", {
|
|
69
69
|
detail: {
|
|
@@ -592,8 +592,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
592
592
|
|
|
593
593
|
const currentNode = this.tocMap[contentDocumentId];
|
|
594
594
|
|
|
595
|
-
|
|
596
|
-
if(currentNode?.parent) {
|
|
595
|
+
if (currentNode?.parent) {
|
|
597
596
|
this.breadcrumbs = this.nodeToBreadcrumb(currentNode);
|
|
598
597
|
} else {
|
|
599
598
|
this.breadcrumbs = [];
|
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.
|