@salesforcedevs/docs-components 1.3.319-scroll-alpha → 1.3.320-dc1

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 CHANGED
@@ -7,6 +7,7 @@
7
7
  "expose": [
8
8
  "doc/amfReference",
9
9
  "doc/breadcrumbs",
10
+ "doc/component",
10
11
  "doc/content",
11
12
  "doc/contentCallout",
12
13
  "doc/contentLayout",
@@ -17,6 +18,7 @@
17
18
  "doc/headingAnchor",
18
19
  "doc/overview",
19
20
  "doc/phase",
21
+ "doc/styledOrderedList",
20
22
  "doc/versionPicker",
21
23
  "doc/xmlContent",
22
24
  "docUtils/utils"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.319-scroll-alpha",
3
+ "version": "1.3.320-dc1",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -0,0 +1,32 @@
1
+ @import "dxHelpers/reset";
2
+
3
+ h2 {
4
+ font-weight: bold;
5
+ font-size: 24px;
6
+ margin-top: 10px;
7
+ margin-bottom: 10px;
8
+ }
9
+
10
+ .component-image {
11
+ padding: 48px 40px;
12
+ display: flex;
13
+ justify-content: center;
14
+ align-items: center;
15
+ border: 1px solid var(--foundation-gray-neutral-95, #f3f3f3);
16
+ min-height: 140px;
17
+ max-height: 480px;
18
+ flex: 1;
19
+ margin-top: 16px;
20
+ margin-bottom: 16px;
21
+ }
22
+
23
+ .small {
24
+ font-size: 12px;
25
+ }
26
+
27
+ .item {
28
+ display: flex;
29
+ flex: 1;
30
+ flex-direction: column;
31
+ justify-content: center;
32
+ }
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <div class="item">
3
+ <h2 if:true={title}>{title}</h2>
4
+ <p if:true={description}>{description}</p>
5
+ <p if:true={doDontLabel}>{doDontLabel}</p>
6
+ <div if:true={imageSrc} class="component-image">
7
+ <img src={imageSrc} />
8
+ </div>
9
+ <p if:true={note} class="small">{note}</p>
10
+ </div>
11
+ </template>
@@ -0,0 +1,22 @@
1
+ import { LightningElement, api } from "lwc";
2
+
3
+ class Component extends LightningElement {
4
+ @api title;
5
+ @api description;
6
+ @api imageSrc;
7
+ @api isDo;
8
+ @api note;
9
+
10
+ @api
11
+ get doDontLabel(): string {
12
+ //TODO: store a boolean value and refactor logic
13
+ if (this.isDo === "true") {
14
+ return "DO";
15
+ } else if (this.isDo === "false") {
16
+ return "DON'T";
17
+ }
18
+ return "";
19
+ }
20
+ }
21
+
22
+ export default Component;
@@ -385,7 +385,6 @@ mark {
385
385
  /* offset page jump link due to fixed header */
386
386
  [id] {
387
387
  scroll-margin-top: calc(
388
- var(--dx-g-global-header-height) + var(--dx-g-doc-header-height) +
389
- var(--dx-g-spacing-2xl)
388
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
390
389
  );
391
390
  }
@@ -43,8 +43,7 @@ dx-toc {
43
43
  /* offset page jump link due to fixed header */
44
44
  ::slotted(doc-heading) {
45
45
  scroll-margin-top: calc(
46
- var(--dx-g-global-header-height) + var(--dx-g-doc-header-height) +
47
- var(--dx-g-spacing-2xl)
46
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
48
47
  );
49
48
  }
50
49
 
@@ -215,16 +215,10 @@ export default class ContentLayout extends LightningElement {
215
215
  ".sticky-doc-header"
216
216
  ) as HTMLElement;
217
217
 
218
- let docPhaseEl = (
218
+ const docPhaseEl = (
219
219
  this.template.querySelector("[name=doc-phase]")! as any
220
220
  ).assignedElements()[0] as HTMLSlotElement;
221
221
 
222
- if (!docPhaseEl) {
223
- docPhaseEl = (
224
- this.template.querySelector("[name=version-banner]")! as any
225
- ).assignedElements()[0] as HTMLSlotElement;
226
- }
227
-
228
222
  if (!sidebarEl || !globalNavEl || !contextNavEl || !docHeaderEl) {
229
223
  console.warn("One or more required elements are missing.");
230
224
  return;
@@ -237,14 +231,6 @@ export default class ContentLayout extends LightningElement {
237
231
  (globalNavEl.getBoundingClientRect().height !== 72 ? 0 : 72) +
238
232
  contextNavEl.getBoundingClientRect().height;
239
233
  const docHeaderHeight = docHeaderEl.getBoundingClientRect().height;
240
- const totalHeaderHeight = globalNavHeight + docHeaderHeight;
241
-
242
- // Selecting the doc section heading and RNB here.
243
- const docHeadingEls = Array.from(
244
- document.querySelectorAll("doc-heading")
245
- );
246
- const rightNavBarEl = this.template.querySelector(".right-nav-bar");
247
-
248
234
  sidebarEl.style.setProperty(
249
235
  "--dx-c-content-sidebar-sticky-top",
250
236
  `${globalNavHeight + docHeaderHeight}px`
@@ -255,27 +241,6 @@ export default class ContentLayout extends LightningElement {
255
241
  `${globalNavHeight}px`
256
242
  );
257
243
 
258
- // Adjusting the doc section heading on scroll.
259
- docHeadingEls.forEach((docHeadingEl) => {
260
- (docHeadingEl as any).style.scrollMarginTop = docPhaseEl
261
- ? `${
262
- totalHeaderHeight +
263
- docPhaseEl.getBoundingClientRect().height +
264
- 40
265
- }px`
266
- : `${totalHeaderHeight + 40}px`;
267
- });
268
-
269
- // Adjusting the right nav bar on scroll.
270
- if (rightNavBarEl) {
271
- rightNavBarEl.style.top = docPhaseEl
272
- ? `${
273
- totalHeaderHeight +
274
- docPhaseEl.getBoundingClientRect().height
275
- }px`
276
- : `${totalHeaderHeight}px`;
277
- }
278
-
279
244
  // If doc phase element exists, we need to account for its sticky position. Mobile should include the sidebar height (since it becomes sticky aswell).
280
245
  if (docPhaseEl) {
281
246
  docPhaseEl.style.setProperty(
@@ -288,6 +253,30 @@ export default class ContentLayout extends LightningElement {
288
253
  : globalNavHeight + docHeaderHeight
289
254
  }px`
290
255
  );
256
+
257
+ // Adjust scroll margin for doc headings when doc phase is present
258
+ const docHeadingEls = Array.from(
259
+ document.querySelectorAll("doc-heading")
260
+ );
261
+ docHeadingEls.forEach((docHeadingEl) => {
262
+ (docHeadingEl as any).style.scrollMarginTop = `${
263
+ globalNavHeight +
264
+ docHeaderHeight +
265
+ docPhaseEl.getBoundingClientRect().height
266
+ }px`;
267
+ });
268
+
269
+ // Adjust right nav bar position when doc phase is present
270
+ const rightNavBarEl =
271
+ this.template.querySelector(".right-nav-bar");
272
+
273
+ if (rightNavBarEl) {
274
+ rightNavBarEl.style.top = `${
275
+ globalNavHeight +
276
+ docHeaderHeight +
277
+ docPhaseEl.getBoundingClientRect().height
278
+ }px`;
279
+ }
291
280
  }
292
281
  });
293
282
  };
@@ -0,0 +1,33 @@
1
+ @import "dxHelpers/reset";
2
+
3
+ .list {
4
+ display: flex;
5
+ flex: 1;
6
+ flex-direction: column;
7
+ justify-content: center;
8
+ }
9
+
10
+ .list-item {
11
+ display: flex;
12
+ flex-direction: row;
13
+ justify-content: center;
14
+ margin-bottom: 2px;
15
+ }
16
+
17
+ .circle {
18
+ background: var(--foundation-blue-blue-40, #0b5cab);
19
+ height: 24px;
20
+ width: 24px;
21
+ border-radius: 50%;
22
+ justify-content: center;
23
+ align-items: center;
24
+ display: flex;
25
+ color: white;
26
+ font-size: 10px;
27
+ }
28
+
29
+ .list-item-content {
30
+ color: var(--text-default, #181818);
31
+ font-size: 16px;
32
+ margin-left: 16px;
33
+ }
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <div class="list">
3
+ <template for:each={list} for:item="item" for:index="index">
4
+ <div class="list-item" key={item}>
5
+ <div class="circle">{index}</div>
6
+ <p class="list-item-content">{item}</p>
7
+ </div>
8
+ </template>
9
+ </div>
10
+ </template>
@@ -0,0 +1,18 @@
1
+ import { LightningElement, api } from "lwc";
2
+
3
+ class StyledOrderedList extends LightningElement {
4
+ private _list: Array<string> = [];
5
+
6
+ set list(value: string) {
7
+ if (value) {
8
+ this._list = JSON.parse(value);
9
+ }
10
+ }
11
+
12
+ @api
13
+ get list(): Array<string> {
14
+ return this._list;
15
+ }
16
+ }
17
+
18
+ export default StyledOrderedList;