@linagora/twake-icons 2.4.0 → 2.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 +7 -0
- package/dist/utils/getFileTypeIcon.js +2 -2
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## @linagora/twake-icons [2.4.1](https://github.com/linagora/twake-ui/compare/@linagora/twake-icons@2.4.0...@linagora/twake-icons@2.4.1) (2026-06-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **twake-icons:** Changed mime library to one that works in browsers (mime/lite) ([00ce94f](https://github.com/linagora/twake-ui/commit/00ce94fd1b9d95f52e0dc480dfe2ab181420e97e))
|
|
7
|
+
|
|
1
8
|
# @linagora/twake-icons [2.4.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-icons@2.3.0...@linagora/twake-icons@2.4.0) (2026-06-18)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import mime from 'mime';
|
|
2
2
|
import { mimeToIcon, defaultIcon } from './fileTypeIcons';
|
|
3
3
|
/**
|
|
4
4
|
* Returns the appropriate icon component for a given attachment
|
|
@@ -8,7 +8,7 @@ import { mimeToIcon, defaultIcon } from './fileTypeIcons';
|
|
|
8
8
|
* @returns React node representing the file type icon
|
|
9
9
|
*/
|
|
10
10
|
export function getFileTypeIcon(filename, mimeType) {
|
|
11
|
-
const resolvedMimeType = mimeType?.split(';')[0].trim().toLowerCase() ||
|
|
11
|
+
const resolvedMimeType = mimeType?.split(';')[0].trim().toLowerCase() || mime.getType(filename);
|
|
12
12
|
if (resolvedMimeType && mimeToIcon[resolvedMimeType]) {
|
|
13
13
|
return mimeToIcon[resolvedMimeType];
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linagora/twake-icons",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"description": "Icon library for Twake applications — SVG icons and illustrations",
|
|
6
6
|
"author": "Twake",
|
|
7
7
|
"license": "MIT",
|
|
@@ -75,7 +75,6 @@
|
|
|
75
75
|
"vitest": "4.1.5"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"
|
|
79
|
-
"mime-types": "^3.0.2"
|
|
78
|
+
"mime": "4.1.0"
|
|
80
79
|
}
|
|
81
80
|
}
|