@salesforcedevs/docs-components 1.3.126 → 1.3.127-alpha.0
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/content/content.css +7 -0
- package/src/modules/doc/contentLayout/contentLayout.css +7 -0
- package/src/modules/doc/contentLayout/contentLayout.ts +16 -1
- package/src/modules/doc/phase/phase.css +3 -2
- package/src/modules/doc/xmlContent/xmlContent.ts +1 -22
- package/LICENSE +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.127-alpha.0",
|
|
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
|
}
|
|
@@ -402,3 +402,10 @@ samp,
|
|
|
402
402
|
mark {
|
|
403
403
|
background-color: var(--dx-g-yellow-vibrant-90);
|
|
404
404
|
}
|
|
405
|
+
|
|
406
|
+
/* offset page jump link due to fixed header */
|
|
407
|
+
[id] {
|
|
408
|
+
scroll-margin-top: calc(
|
|
409
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
410
|
+
);
|
|
411
|
+
}
|
|
@@ -40,6 +40,13 @@ dx-toc {
|
|
|
40
40
|
display: block;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/* offset page jump link due to fixed header */
|
|
44
|
+
::slotted(doc-heading) {
|
|
45
|
+
scroll-margin-top: calc(
|
|
46
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
43
50
|
.content {
|
|
44
51
|
display: flex;
|
|
45
52
|
position: relative;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @lwc/lwc/no-document-query */
|
|
1
2
|
import { LightningElement, api, track } from "lwc";
|
|
2
3
|
import { closest } from "kagekiri";
|
|
3
4
|
import { toJson } from "dxUtils/normalizers";
|
|
@@ -204,7 +205,10 @@ export default class ContentLayout extends LightningElement {
|
|
|
204
205
|
const docHeaderEl = document.querySelector(
|
|
205
206
|
".sticky-doc-header"
|
|
206
207
|
) as HTMLElement;
|
|
207
|
-
|
|
208
|
+
|
|
209
|
+
const docPhaseEl = this.template
|
|
210
|
+
.querySelector("[name=doc-phase]")!
|
|
211
|
+
.assignedElements()[0] as HTMLSlotElement;
|
|
208
212
|
|
|
209
213
|
if (!sidebarEl || !globalNavEl || !contextNavEl || !docHeaderEl) {
|
|
210
214
|
console.warn("One or more required elements are missing.");
|
|
@@ -237,6 +241,17 @@ export default class ContentLayout extends LightningElement {
|
|
|
237
241
|
: globalNavHeight + docHeaderHeight
|
|
238
242
|
}px`
|
|
239
243
|
);
|
|
244
|
+
|
|
245
|
+
const rightNavBarEl =
|
|
246
|
+
this.template.querySelector(".right-nav-bar");
|
|
247
|
+
|
|
248
|
+
if (rightNavBarEl) {
|
|
249
|
+
rightNavBarEl.style.top = `${
|
|
250
|
+
globalNavHeight +
|
|
251
|
+
docHeaderHeight +
|
|
252
|
+
docPhaseEl.offsetHeight
|
|
253
|
+
}px`;
|
|
254
|
+
}
|
|
240
255
|
}
|
|
241
256
|
});
|
|
242
257
|
};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
:host {
|
|
6
6
|
--doc-c-phase-top: 0;
|
|
7
|
+
--doc-c-phase-container-align-items: flex-start;
|
|
7
8
|
|
|
8
9
|
position: sticky;
|
|
9
10
|
top: var(--doc-c-phase-top);
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
.doc-phase-container {
|
|
16
17
|
display: flex;
|
|
17
18
|
flex-direction: column;
|
|
18
|
-
align-items:
|
|
19
|
+
align-items: var(--doc-c-phase-container-align-items);
|
|
19
20
|
padding-left: var(--dx-g-global-header-padding-horizontal);
|
|
20
21
|
padding-right: var(--dx-g-global-header-padding-horizontal);
|
|
21
22
|
width: 100%;
|
|
@@ -40,7 +41,7 @@ dx-button {
|
|
|
40
41
|
margin-left: auto;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
/*
|
|
44
|
+
/*
|
|
44
45
|
NOTE: Here we are assuming that indicator height won't go beyond 1000px.
|
|
45
46
|
|
|
46
47
|
It's one of the suggested way to achieve the expand/collapse animation
|
|
@@ -156,28 +156,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
156
156
|
));
|
|
157
157
|
|
|
158
158
|
if (anchorEl) {
|
|
159
|
-
|
|
160
|
-
".global-nav-container"
|
|
161
|
-
) as HTMLElement;
|
|
162
|
-
const docHeader = document.querySelector(
|
|
163
|
-
"doc-header"
|
|
164
|
-
) as HTMLElement;
|
|
165
|
-
const headerHeight = globalNavHeader.offsetHeight;
|
|
166
|
-
const docHeaderHeight = docHeader.offsetHeight;
|
|
167
|
-
const rect = anchorEl.getBoundingClientRect();
|
|
168
|
-
|
|
169
|
-
// Calculate the scroll position required to bring the element into view
|
|
170
|
-
const scrollTop =
|
|
171
|
-
window.pageYOffset || document.documentElement.scrollTop;
|
|
172
|
-
const scrollX = rect.left + window.pageXOffset;
|
|
173
|
-
const scrollY =
|
|
174
|
-
rect.top + scrollTop - (headerHeight + docHeaderHeight); // subtract the header height from the top position
|
|
175
|
-
|
|
176
|
-
// Scroll to the calculated position
|
|
177
|
-
window.scrollTo({
|
|
178
|
-
top: scrollY,
|
|
179
|
-
left: scrollX
|
|
180
|
-
});
|
|
159
|
+
anchorEl.scrollIntoView();
|
|
181
160
|
|
|
182
161
|
this.setState({ internalLinkClicked: false });
|
|
183
162
|
}
|
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.
|