@salesforcedevs/dx-components 0.63.0 → 0.64.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "0.63.0",
3
+ "version": "0.64.0",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@coveo/headless": "^1.32.0",
14
- "@popperjs/core": "2.9.1",
14
+ "@floating-ui/dom": "^0.5.3",
15
15
  "@sfdocs-internal/wires": "^0.6.3",
16
16
  "@vimeo/player": "^2.16.4",
17
17
  "classnames": "^2.2.6",
@@ -25,5 +25,5 @@
25
25
  "@types/lodash.get": "^4.4.6",
26
26
  "@types/vimeo__player": "^2.16.2"
27
27
  },
28
- "gitHead": "7c284ec7eaa387a82e1ce20d74d0aefc7346a8d7"
28
+ "gitHead": "369ff728fbf7ea16a249785a16dbc73331456a9b"
29
29
  }
@@ -47,7 +47,6 @@ export default class DropdownOption extends LightningElement {
47
47
  ...this.analyticsBasePayload,
48
48
  clickText: this.keyValue || undefined,
49
49
  itemTitle: this.option.label || undefined,
50
- pageLocation: window.location.pathname,
51
50
  clickUrl: this.option.link?.href || undefined
52
51
  };
53
52
 
@@ -58,6 +57,7 @@ export default class DropdownOption extends LightningElement {
58
57
  if (!this.suppressGtmNavHeadings) {
59
58
  payload.navHeading = navHeading;
60
59
  payload.navSubHeading = navSubHeading;
60
+ payload.pageLocation = window.location.pathname;
61
61
  }
62
62
 
63
63
  if (this.analyticsEvent && e.currentTarget) {
@@ -273,7 +273,7 @@ footer.signup-variant-no-signup {
273
273
  @media screen and (min-width: 1400px) {
274
274
  .content-container_top_large {
275
275
  /* takes into account the background assets' h:w ratio */
276
- height: 32vw;
276
+ height: 38vw;
277
277
  }
278
278
  }
279
279
 
@@ -9,7 +9,9 @@
9
9
  }
10
10
 
11
11
  .popover-container {
12
- position: fixed;
12
+ position: absolute;
13
+ top: 0;
14
+ left: 0;
13
15
  z-index: var(--dx-c-popover-z-index, var(--dx-g-z-index-max));
14
16
  visibility: hidden;
15
17
  pointer-events: none;
@@ -50,14 +52,6 @@
50
52
  max-width: unset;
51
53
  }
52
54
 
53
- .popover-offset-small {
54
- margin-top: var(--dx-g-spacing-sm);
55
- }
56
-
57
- .popover-offset-medium {
58
- margin-top: var(--dx-g-spacing-md);
59
- }
60
-
61
55
  .popover-small {
62
56
  width: 136px;
63
57
  }
@@ -5,7 +5,7 @@ import {
5
5
  PopperPlacement
6
6
  } from "typings/custom";
7
7
 
8
- import { createPopper } from "@popperjs/core";
8
+ import { computePosition, flip, offset, shift } from "@floating-ui/dom";
9
9
  import cx from "classnames";
10
10
  import debounce from "debounce";
11
11
  import { isPrerender } from "dxUtils/seo";
@@ -69,14 +69,8 @@ export default class Popover extends LightningElement {
69
69
  this.control.setAttribute("aria-expanded", "true");
70
70
 
71
71
  this.dispatchEvent(new CustomEvent("open"));
72
-
73
- // awaiting .popover-container to receive 'visibility: visible;' in order to execute functions on it;
74
- // another approach would be to use IntersectionObserver to determine exactly when the visiblity
75
- // is applied before running
76
- setTimeout(() => {
77
- this.setPosition();
78
- this.attachListenersTopopover();
79
- });
72
+ this.setPosition();
73
+ this.attachListenersTopopover();
80
74
  }
81
75
  }
82
76
 
@@ -130,7 +124,6 @@ export default class Popover extends LightningElement {
130
124
  private get className() {
131
125
  return cx(
132
126
  "popover",
133
- this.offset && `popover-offset-${this.offset}`,
134
127
  this.small && "popover-small",
135
128
  this.width && "popover-overridewidth",
136
129
  this.fullWidth && "popover-fullwidth"
@@ -278,35 +271,24 @@ export default class Popover extends LightningElement {
278
271
 
279
272
  private setPosition = async () => {
280
273
  if (this.popover && this.control) {
281
- await Promise.resolve();
282
- createPopper(this.control, this.popover, {
274
+ computePosition(this.control, this.popover, {
283
275
  placement: this.placement,
284
- modifiers: [
285
- {
286
- name: "preventOverflow",
287
- options: {
288
- boundary: document.documentElement,
289
- padding: this.pagePadding
290
- }
291
- },
292
- {
293
- name: "flip",
294
- options: {
295
- fallbackPlacements: []
296
- }
297
- },
298
- this.fullWidth
299
- ? {
300
- name: "fullWidth",
301
- enabled: true,
302
- fn: ({ state }) => {
303
- state.styles.popper.width = `${state.rects.reference.width}px`;
304
- },
305
- phase: "beforeWrite",
306
- requires: ["computeStyles"]
307
- }
308
- : {}
276
+ middleware: [
277
+ flip(),
278
+ shift({ padding: this.pagePadding }),
279
+ ...(this.offset === "medium"
280
+ ? [offset(16)]
281
+ : this.offset === "small"
282
+ ? [offset(8)]
283
+ : [])
309
284
  ]
285
+ }).then(({ x, y }) => {
286
+ if (this.popover) {
287
+ Object.assign(this.popover.style, {
288
+ left: `${x}px`,
289
+ top: `${y}px`
290
+ });
291
+ }
310
292
  });
311
293
  }
312
294
  };
@@ -310,7 +310,11 @@ export default class SidebarSearch extends LightningElement {
310
310
  let isSelected = false;
311
311
  const isReferenceUrl = clickUri.includes("/references/");
312
312
  if (isReferenceUrl) {
313
- href = `${pathname}${queryParam}&q=${this.value}`;
313
+ if (queryParam) {
314
+ href = `${pathname}${queryParam}&q=${this.value}`;
315
+ } else {
316
+ href = `${pathname}?q=${this.value}`;
317
+ }
314
318
 
315
319
  //NOTE: This is specific to references related comparison
316
320
  const resultHrefWithMetaQuery = `${pathname}${queryParam}`;