@salesforcedevs/dx-components 1.3.38 → 1.3.41

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.38",
3
+ "version": "1.3.41",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -13,6 +13,7 @@
13
13
  "@coveo/headless": "^1.32.0",
14
14
  "@floating-ui/dom": "^1.0.4",
15
15
  "@sfdocs-internal/wires": "^0.6.3",
16
+ "@types/throttle-debounce": "^5.0.0",
16
17
  "@vimeo/player": "^2.16.4",
17
18
  "classnames": "^2.2.6",
18
19
  "coveo-search-ui": "^2.10082.5",
@@ -23,6 +24,7 @@
23
24
  "lodash.kebabcase": "^4.1.1",
24
25
  "microtip": "0.2.2",
25
26
  "salesforce-oauth2": "^0.2.0",
27
+ "throttle-debounce": "^5.0.0",
26
28
  "uuid": "^9.0.0"
27
29
  },
28
30
  "devDependencies": {
@@ -38,5 +40,5 @@
38
40
  "eventsourcemock": "^2.0.0",
39
41
  "luxon": "^3.1.0"
40
42
  },
41
- "gitHead": "9cc8fbc4b276d28eb128f5f7fd1eec7844e831b2"
43
+ "gitHead": "46a0b7fd6aa2964c2cc9301c402b8ab8cf98e4bf"
42
44
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div class="container">
3
- <div class="text-container" style={style}>
2
+ <div class="container" style={style}>
3
+ <div class="text-container">
4
4
  <h1 class="heading dx-text-heading-2">{title}</h1>
5
5
  <span class="body dx-text-body-1">{body}</span>
6
6
  <span if:true={subtitle} class="subtitle dx-text-heading-4b">
@@ -1,4 +1,5 @@
1
1
  import { LightningElement, api } from "lwc";
2
+ import cx from "classnames";
2
3
  import { track } from "dxUtils/analytics";
3
4
 
4
5
  export default class MainContentHeader extends LightningElement {
@@ -10,6 +11,14 @@ export default class MainContentHeader extends LightningElement {
10
11
  @api imgSrc!: string;
11
12
  @api imgSrcMobile!: string;
12
13
  @api ctaTarget?: string | null = null;
14
+ @api backgroundGradientColor?: string;
15
+
16
+ private get style() {
17
+ return cx(
18
+ this.backgroundGradientColor &&
19
+ `background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffff 100%), var(--dx-g-${this.backgroundGradientColor});`
20
+ );
21
+ }
13
22
 
14
23
  private onCtaClick(e: Event) {
15
24
  if (e.currentTarget) {
@@ -1,4 +1,5 @@
1
1
  import { LightningElement } from "lwc";
2
+ import { throttle } from "throttle-debounce";
2
3
 
3
4
  const RESTORE_SCROLL_EVENT_NAME = "restore-scroll";
4
5
  const LOAD_TIME_SCROLL_RESTORE_DELAY = 750;
@@ -38,7 +39,7 @@ export default class ScrollManager extends LightningElement {
38
39
  if (!globalThis.singletonScrollManagerRendered) {
39
40
  globalThis.singletonScrollManagerRendered = true;
40
41
  if (
41
- window.history.state?.scroll.docSize ===
42
+ window.history.state?.scroll?.docSize ===
42
43
  document.body.scrollHeight
43
44
  ) {
44
45
  // only do this if loading is complete and the scrollHeight matches expectations
@@ -75,7 +76,7 @@ export default class ScrollManager extends LightningElement {
75
76
  }
76
77
  }
77
78
 
78
- saveScroll = () => {
79
+ saveScroll = throttle(100, () => {
79
80
  window.history.replaceState(
80
81
  {
81
82
  scroll: {
@@ -86,7 +87,7 @@ export default class ScrollManager extends LightningElement {
86
87
  "",
87
88
  window.location.href
88
89
  );
89
- };
90
+ });
90
91
 
91
92
  manualScrollListener = () => {
92
93
  if (this.scrollCount < 5) {