@salesforcedevs/docs-components 0.65.0 → 0.66.1-miles2
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 +21 -4
- package/src/modules/doc/contentCallout/contentCallout.css +5 -0
- package/src/modules/doc/contentCallout/contentCallout.ts +1 -1
- package/src/modules/doc/headingContent/headingContent.css +5 -7
- package/src/modules/doc/headingContent/headingContent.html +8 -14
- package/src/modules/doc/headingContent/headingContent.ts +0 -12
- 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.66.1-miles2",
|
|
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
|
}
|
|
@@ -165,6 +165,7 @@ export default class AmfReference extends LightningElement {
|
|
|
165
165
|
|
|
166
166
|
constructor() {
|
|
167
167
|
super();
|
|
168
|
+
|
|
168
169
|
this._boundOnApiNavigationChanged =
|
|
169
170
|
this.onApiNavigationChanged.bind(this);
|
|
170
171
|
this._boundUpdateSelectedItemFromUrlQuery =
|
|
@@ -193,6 +194,16 @@ export default class AmfReference extends LightningElement {
|
|
|
193
194
|
);
|
|
194
195
|
}
|
|
195
196
|
|
|
197
|
+
saveScroll() {
|
|
198
|
+
console.log('saving scroll ' + document.body.scrollTop + ' to url ' + window.location.href);
|
|
199
|
+
window.history.replaceState({ scrollValue: document.body.scrollTop }, "", window.location.href);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
restoreScroll() {
|
|
203
|
+
console.log('restoring scroll ' + window.history.state.scrollValue + ' from url ' + window.location.href);
|
|
204
|
+
document.body.scrollTop = document.documentElement.scrollTop = window.history.state.scrollValue;
|
|
205
|
+
}
|
|
206
|
+
|
|
196
207
|
renderedCallback(): void {
|
|
197
208
|
if (!this.hasRendered) {
|
|
198
209
|
this.hasRendered = true;
|
|
@@ -760,8 +771,9 @@ export default class AmfReference extends LightningElement {
|
|
|
760
771
|
if (meta) {
|
|
761
772
|
// update the encoded url meta param
|
|
762
773
|
const encodedMeta = this.getUrlEncoded(meta);
|
|
774
|
+
|
|
763
775
|
window.history.pushState(
|
|
764
|
-
{},
|
|
776
|
+
{ },
|
|
765
777
|
"",
|
|
766
778
|
`${parentReferencePath}?meta=${encodedMeta}`
|
|
767
779
|
);
|
|
@@ -779,7 +791,7 @@ export default class AmfReference extends LightningElement {
|
|
|
779
791
|
// update the encoded url meta param
|
|
780
792
|
const encodedMeta = this.getUrlEncoded(meta);
|
|
781
793
|
window.history.replaceState(
|
|
782
|
-
|
|
794
|
+
window.history.state,
|
|
783
795
|
"",
|
|
784
796
|
`${parentReferencePath}?meta=${encodedMeta}`
|
|
785
797
|
);
|
|
@@ -827,6 +839,8 @@ export default class AmfReference extends LightningElement {
|
|
|
827
839
|
* @param event
|
|
828
840
|
*/
|
|
829
841
|
protected onApiNavigationChanged(): void {
|
|
842
|
+
this.saveScroll();
|
|
843
|
+
|
|
830
844
|
const specBasedReference = this.isSpecBasedReference(
|
|
831
845
|
this._currentReferenceId
|
|
832
846
|
);
|
|
@@ -853,6 +867,8 @@ export default class AmfReference extends LightningElement {
|
|
|
853
867
|
} else {
|
|
854
868
|
this.loadMarkdownBasedReference();
|
|
855
869
|
}
|
|
870
|
+
|
|
871
|
+
this.restoreScroll();
|
|
856
872
|
}
|
|
857
873
|
|
|
858
874
|
/**
|
|
@@ -1207,7 +1223,7 @@ export default class AmfReference extends LightningElement {
|
|
|
1207
1223
|
window.location.href = redirectReferenceUrl;
|
|
1208
1224
|
} else {
|
|
1209
1225
|
// This is for CASE 1,3 and 4 mentioned above, Where we need to update the browser history
|
|
1210
|
-
window.history.replaceState(
|
|
1226
|
+
window.history.replaceState(window.history.state, "", redirectReferenceUrl);
|
|
1211
1227
|
}
|
|
1212
1228
|
}
|
|
1213
1229
|
}
|
|
@@ -1317,6 +1333,7 @@ export default class AmfReference extends LightningElement {
|
|
|
1317
1333
|
}
|
|
1318
1334
|
|
|
1319
1335
|
handleSelectedItem(): void {
|
|
1336
|
+
|
|
1320
1337
|
// update topic view
|
|
1321
1338
|
const { referenceId, amfId, type } = this.selectedTopic;
|
|
1322
1339
|
|
|
@@ -1328,6 +1345,6 @@ export default class AmfReference extends LightningElement {
|
|
|
1328
1345
|
id: amfId
|
|
1329
1346
|
};
|
|
1330
1347
|
|
|
1331
|
-
|
|
1348
|
+
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
1332
1349
|
}
|
|
1333
1350
|
}
|
|
@@ -18,7 +18,7 @@ export default class ContentCallout extends LightningElement {
|
|
|
18
18
|
break;
|
|
19
19
|
case "warning":
|
|
20
20
|
this.cardVariant = "doc-status-container dx-callout-warning";
|
|
21
|
-
this.iconColor = "
|
|
21
|
+
this.iconColor = "red-vibrant-50";
|
|
22
22
|
this.iconName = "warning";
|
|
23
23
|
break;
|
|
24
24
|
case "caution":
|
|
@@ -8,12 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
dx-tooltip {
|
|
10
10
|
line-height: var(--button-size);
|
|
11
|
+
padding-right: var(--dx-g-spacing-xs);
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
.button-container {
|
|
14
15
|
height: 100%;
|
|
15
16
|
margin-right: calc(var(--dx-g-spacing-xl) - 4px);
|
|
16
17
|
position: relative;
|
|
18
|
+
padding-right: var(--dx-g-spacing-xs);
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
button {
|
|
@@ -34,12 +36,8 @@ dx-icon {
|
|
|
34
36
|
--dx-c-icon-size: var(--doc-c-heading-anchor-icon-size);
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.nowrap {
|
|
42
|
-
white-space: nowrap;
|
|
39
|
+
.title {
|
|
40
|
+
word-break: break-word;
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
button:focus {
|
|
@@ -49,7 +47,7 @@ button:focus {
|
|
|
49
47
|
button:focus,
|
|
50
48
|
button:hover,
|
|
51
49
|
span:hover dx-tooltip button,
|
|
52
|
-
span:hover ~
|
|
50
|
+
span:hover ~ dx-tooltip button {
|
|
53
51
|
opacity: 1;
|
|
54
52
|
outline: none;
|
|
55
53
|
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<template if:false={hash}>{title}</template>
|
|
3
3
|
<template if:true={hash}>
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
<span
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<button onclick={copy} aria-label="copy">
|
|
13
|
-
<dx-icon size="override" symbol="link"></dx-icon>
|
|
14
|
-
</button>
|
|
15
|
-
</span>
|
|
16
|
-
</dx-tooltip>
|
|
17
|
-
</span>
|
|
4
|
+
<span class="title">{title} </span>
|
|
5
|
+
<dx-tooltip placement="top" label={label}>
|
|
6
|
+
<span class="button-container">
|
|
7
|
+
<button onclick={copy} aria-label="copy">
|
|
8
|
+
<dx-icon size="override" symbol="link"></dx-icon>
|
|
9
|
+
</button>
|
|
10
|
+
</span>
|
|
11
|
+
</dx-tooltip>
|
|
18
12
|
</template>
|
|
19
13
|
</template>
|
|
@@ -7,18 +7,6 @@ export default class HeadingContent extends LightningElement {
|
|
|
7
7
|
label: string = "Copy link to clipboard";
|
|
8
8
|
timeout: number | null = null;
|
|
9
9
|
|
|
10
|
-
private get titleToWrap(): string {
|
|
11
|
-
return this.title.substring(0, this.title.lastIndexOf(" "));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
private get needsSpace(): boolean {
|
|
15
|
-
return this.titleToWrap.length > 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
private get titleNoWrap(): string {
|
|
19
|
-
return this.title.substring(this.title.lastIndexOf(" ") + 1);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
10
|
private async copy() {
|
|
23
11
|
if (this.timeout) {
|
|
24
12
|
window.clearTimeout(this.timeout);
|
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.
|