@knime/utils 1.3.3 → 1.4.1
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 +14 -1
- package/package.json +2 -2
- package/src/hotkeys.ts +2 -2
- package/src/intervalUtils.ts +3 -1
- package/src/navigator.ts +0 -14
- package/src/uploadManager/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
# @knime/utils
|
|
2
2
|
|
|
3
|
+
## 1.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [8e0a90a]
|
|
8
|
+
- @knime/styles@1.5.0
|
|
9
|
+
|
|
10
|
+
## 1.4.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- dea510f: Moved getMetaOrCtrlKey from navigator util to hotkeys util
|
|
15
|
+
|
|
3
16
|
## 1.3.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
6
19
|
|
|
7
|
-
- Updated dependencies [
|
|
20
|
+
- Updated dependencies [6e1501f]
|
|
8
21
|
- @knime/styles@1.4.0
|
|
9
22
|
|
|
10
23
|
## 1.3.2
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knime/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
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.
|
|
12
|
+
"@knime/styles": "1.5.0"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"consola": "3.x"
|
package/src/hotkeys.ts
CHANGED
|
@@ -27,6 +27,6 @@ export const isKeyWithoutModifiers = (
|
|
|
27
27
|
*
|
|
28
28
|
* @returns name of the primary modifier key for the current platform
|
|
29
29
|
*/
|
|
30
|
-
export const getMetaOrCtrlKey = ():
|
|
31
|
-
return navigatorUtils.
|
|
30
|
+
export const getMetaOrCtrlKey = (): "ctrlKey" | "metaKey" => {
|
|
31
|
+
return navigatorUtils.isMac() ? "metaKey" : "ctrlKey";
|
|
32
32
|
};
|
package/src/intervalUtils.ts
CHANGED
|
@@ -52,6 +52,7 @@ const extractDurationFromRegexMatch = (
|
|
|
52
52
|
negative: boolean,
|
|
53
53
|
match: RegExpExecArray,
|
|
54
54
|
): Duration => {
|
|
55
|
+
// eslint-disable-next-line no-magic-numbers
|
|
55
56
|
const milliseconds = parseInt(match[4]?.padEnd(3, "0") ?? "0", 10);
|
|
56
57
|
|
|
57
58
|
return {
|
|
@@ -103,6 +104,7 @@ export const formatIntervalToISOIntervalString = (
|
|
|
103
104
|
} else {
|
|
104
105
|
output += `T${toFormat.interval.hours}H${toFormat.interval.minutes}M${toFormat.interval.seconds}.${toFormat.interval.milliseconds
|
|
105
106
|
.toString()
|
|
107
|
+
// eslint-disable-next-line no-magic-numbers
|
|
106
108
|
.padStart(3, "0")}S`;
|
|
107
109
|
}
|
|
108
110
|
|
|
@@ -158,7 +160,7 @@ export const formatIntervalToHumanReadableIntervalString = (
|
|
|
158
160
|
if (milliSecondsZero) {
|
|
159
161
|
output += formatPart(toFormat.interval.seconds, "second");
|
|
160
162
|
} else {
|
|
161
|
-
output += `${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, "0")} seconds `;
|
|
163
|
+
output += `${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, "0")} seconds `; // eslint-disable-line no-magic-numbers
|
|
162
164
|
}
|
|
163
165
|
}
|
|
164
166
|
}
|
package/src/navigator.ts
CHANGED
|
@@ -11,17 +11,3 @@ export const isMac = (): boolean =>
|
|
|
11
11
|
*/
|
|
12
12
|
export const isWindows = (): boolean =>
|
|
13
13
|
navigator?.userAgent?.toLowerCase()?.includes("windows");
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Since version 1.3.6. Use `hotkeys.ts` instead.
|
|
17
|
-
*
|
|
18
|
-
* @returns name of the primary modifier key for the current platform.
|
|
19
|
-
*/
|
|
20
|
-
export const getMetaOrCtrlKey = () => {
|
|
21
|
-
if (import.meta.env.DEV) {
|
|
22
|
-
consola.warn(
|
|
23
|
-
"getMetaOrCtrlKey is deprecated on navigatorUtils. Please use hotkeys.ts instead.",
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
return isMac() ? "metaKey" : "ctrlKey";
|
|
27
|
-
};
|