@fluid-topics/ft-wc-utils 1.2.17 → 1.2.19

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.
@@ -11,3 +11,4 @@ export declare function eventPathContainsMatchingElement(e: Event, matchers: str
11
11
  export declare function minmax(min: number, value: number, max: number): number;
12
12
  export declare function last<T = any>(arr: T[]): T | undefined;
13
13
  export declare function unslotText(node: any): string;
14
+ export declare function getComposedPathTo(element: EventTarget): EventTarget[];
package/build/helpers.js CHANGED
@@ -148,3 +148,14 @@ export function unslotText(node) {
148
148
  }
149
149
  return (node === null || node === void 0 ? void 0 : node.textContent) || "";
150
150
  }
151
+ export function getComposedPathTo(element) {
152
+ let path = [];
153
+ const findScrollableParent = (e) => {
154
+ e.stopPropagation();
155
+ path = e.composedPath();
156
+ };
157
+ element.addEventListener("get-composed-path", findScrollableParent);
158
+ element.dispatchEvent(new Event("get-composed-path", { composed: true }));
159
+ element.removeEventListener("get-composed-path", findScrollableParent);
160
+ return path;
161
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-wc-utils",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "description": "Internal web components tools",
5
5
  "author": "Fluid Topics <devtopics@antidot.net>",
6
6
  "license": "ISC",
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "@floating-ui/dom": "1.5.3",
17
17
  "@fluid-topics/design-system-variables": "0.1.8",
18
- "@fluid-topics/public-api": "1.0.80",
18
+ "@fluid-topics/public-api": "1.0.81",
19
19
  "@reduxjs/toolkit": "1.9.5",
20
20
  "@types/mark.js": "8.11.12",
21
21
  "@webcomponents/scoped-custom-element-registry": "0.0.9",
@@ -24,5 +24,5 @@
24
24
  "mark.js": "8.11.1",
25
25
  "moment": "2.29.4"
26
26
  },
27
- "gitHead": "fa3e6380c9989244a572de9d0067913ee624e09b"
27
+ "gitHead": "eaa2bf8601f59cc5eed082b9c118e81d21a4cf79"
28
28
  }