@knime/utils 1.4.0 → 1.4.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @knime/utils
2
2
 
3
+ ## 1.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 2a0a9fd: Add method to determine deep active element in shadow dom
8
+
9
+ ## 1.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [8e0a90a]
14
+ - @knime/styles@1.5.0
15
+
3
16
  ## 1.4.0
4
17
 
5
18
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knime/utils",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Internal utility functions and constants shared across @knime packages.",
5
5
  "homepage": "https://knime.github.io/webapps-common/",
6
6
  "license": "GPL 3 and Additional Permissions according to Sec. 7 (SEE the file LICENSE)",
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "date-fns": "2.30.0",
11
11
  "date-fns-tz": "2.0.0",
12
- "@knime/styles": "1.4.0"
12
+ "@knime/styles": "1.5.0"
13
13
  },
14
14
  "peerDependencies": {
15
15
  "consola": "3.x"
@@ -0,0 +1,9 @@
1
+ const getDeepActiveElement = () => {
2
+ let element = document?.activeElement;
3
+ while (element?.shadowRoot) {
4
+ element = element?.shadowRoot?.activeElement;
5
+ }
6
+ return element;
7
+ };
8
+
9
+ export default getDeepActiveElement;
package/src/index.ts CHANGED
@@ -18,6 +18,7 @@ import type {
18
18
  Hotkey as _Hotkey,
19
19
  KnownHotkey as _KnownHotkey,
20
20
  } from "./formatHotkeys";
21
+ import getDeepActiveElement from "./getDeepActiveElement";
21
22
  import getWrappedAroundIndex from "./getWrappedAroundIndex";
22
23
  import * as intervalUtils from "./intervalUtils";
23
24
  import getLocalTimeZone from "./localTimezone";
@@ -58,6 +59,7 @@ export {
58
59
  filters,
59
60
  formatDateString,
60
61
  formatDateTimeString,
62
+ getDeepActiveElement,
61
63
  formatLocalDateTimeString,
62
64
  formatTimeString,
63
65
  getLocalTimeZone,