@chayns-components/core 5.0.0-beta.919 → 5.0.0-beta.921
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/lib/cjs/components/page-provider/PageProvider.js +4 -1
- package/lib/cjs/components/page-provider/PageProvider.js.map +1 -1
- package/lib/cjs/utils/file.js +20 -378
- package/lib/cjs/utils/file.js.map +1 -1
- package/lib/esm/components/page-provider/PageProvider.js +4 -1
- package/lib/esm/components/page-provider/PageProvider.js.map +1 -1
- package/lib/esm/utils/file.js +18 -376
- package/lib/esm/utils/file.js.map +1 -1
- package/lib/types/utils/file.d.ts +4 -357
- package/package.json +2 -2
|
@@ -53,7 +53,10 @@ const PageProvider = ({
|
|
|
53
53
|
color: color,
|
|
54
54
|
secondaryColor: secondaryColor,
|
|
55
55
|
colorMode: colorMode,
|
|
56
|
-
style:
|
|
56
|
+
style: shouldUseUsableHeight ? {
|
|
57
|
+
...style,
|
|
58
|
+
height: '100%'
|
|
59
|
+
} : style,
|
|
57
60
|
siteId: siteId,
|
|
58
61
|
designSettings: designSettings,
|
|
59
62
|
cssVariables: cssVariables
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageProvider.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_pageProvider","_ColorSchemeProvider","_interopRequireDefault","_PageProvider","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","GlobalStyle","createGlobalStyle","PageProvider","children","color","colorMode","cssVariables","secondaryColor","siteId","style","designSettings","shouldRemovePadding","shouldUseUsableHeight","usableHeight","setUsableHeight","useState","padding","setPadding","getPagePadding","useEffect","getUsableHeight","then","height","handleResize","window","addEventListener","removeEventListener","createElement","StyledPageProvider","className","$padding","$usableHeight","undefined","displayName","_default","exports"],"sources":["../../../../src/components/page-provider/PageProvider.tsx"],"sourcesContent":["import React, { FC, useEffect, useState, type CSSProperties } from 'react';\nimport { createGlobalStyle } from 'styled-components';\nimport { getPagePadding, getUsableHeight } from '../../utils/pageProvider';\nimport ColorSchemeProvider, {\n type ColorSchemeProviderProps,\n} from '../color-scheme-provider/ColorSchemeProvider';\nimport { StyledPageProvider } from './PageProvider.styles';\n\ninterface PageProviderProps extends ColorSchemeProviderProps {\n /**\n * Whether the padding should be removed.\n */\n shouldRemovePadding?: boolean;\n /**\n * Whether the usable height should be used.\n */\n shouldUseUsableHeight?: boolean;\n}\n\nconst GlobalStyle = createGlobalStyle`\n *, *::before, *::after {\n box-sizing: border-box;\n }\n`;\n\nconst PageProvider: FC<PageProviderProps> = ({\n children,\n color,\n colorMode,\n cssVariables = {},\n secondaryColor,\n siteId,\n style = {},\n designSettings,\n shouldRemovePadding,\n shouldUseUsableHeight,\n}) => {\n const [usableHeight, setUsableHeight] = useState(0);\n const [padding, setPadding] = useState<CSSProperties['padding']>(\n shouldRemovePadding ? 0 : getPagePadding(),\n );\n\n useEffect(() => {\n void getUsableHeight(shouldRemovePadding).then((height) => {\n setUsableHeight(height);\n });\n }, [shouldRemovePadding]);\n\n useEffect(() => {\n const handleResize = () => {\n setPadding(shouldRemovePadding ? 0 : getPagePadding());\n };\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [shouldRemovePadding]);\n\n return (\n <StyledPageProvider\n className=\"page-provider\"\n $padding={padding}\n $usableHeight={shouldUseUsableHeight ? usableHeight : undefined}\n >\n <ColorSchemeProvider\n color={color}\n secondaryColor={secondaryColor}\n colorMode={colorMode}\n style={style}\n siteId={siteId}\n designSettings={designSettings}\n cssVariables={cssVariables}\n >\n {children}\n </ColorSchemeProvider>\n <GlobalStyle />\n </StyledPageProvider>\n );\n};\nPageProvider.displayName = 'PageProvider';\n\nexport default PageProvider;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA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,OAAQ;IAClBe,aAAa,EAAEnB,qBAAqB,GAAGC,YAAY,GAAGmB;EAAU,gBAEhE5D,MAAA,CAAAU,OAAA,CAAA6C,aAAA,CAAClD,oBAAA,CAAAK,OAAmB;IAChBsB,KAAK,EAAEA,KAAM;IACbG,cAAc,EAAEA,cAAe;IAC/BF,SAAS,EAAEA,SAAU;IACrBI,KAAK,
|
|
1
|
+
{"version":3,"file":"PageProvider.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_pageProvider","_ColorSchemeProvider","_interopRequireDefault","_PageProvider","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","GlobalStyle","createGlobalStyle","PageProvider","children","color","colorMode","cssVariables","secondaryColor","siteId","style","designSettings","shouldRemovePadding","shouldUseUsableHeight","usableHeight","setUsableHeight","useState","padding","setPadding","getPagePadding","useEffect","getUsableHeight","then","height","handleResize","window","addEventListener","removeEventListener","createElement","StyledPageProvider","className","$padding","$usableHeight","undefined","displayName","_default","exports"],"sources":["../../../../src/components/page-provider/PageProvider.tsx"],"sourcesContent":["import React, { FC, useEffect, useState, type CSSProperties } from 'react';\nimport { createGlobalStyle } from 'styled-components';\nimport { getPagePadding, getUsableHeight } from '../../utils/pageProvider';\nimport ColorSchemeProvider, {\n type ColorSchemeProviderProps,\n} from '../color-scheme-provider/ColorSchemeProvider';\nimport { StyledPageProvider } from './PageProvider.styles';\n\ninterface PageProviderProps extends ColorSchemeProviderProps {\n /**\n * Whether the padding should be removed.\n */\n shouldRemovePadding?: boolean;\n /**\n * Whether the usable height should be used.\n */\n shouldUseUsableHeight?: boolean;\n}\n\nconst GlobalStyle = createGlobalStyle`\n *, *::before, *::after {\n box-sizing: border-box;\n }\n`;\n\nconst PageProvider: FC<PageProviderProps> = ({\n children,\n color,\n colorMode,\n cssVariables = {},\n secondaryColor,\n siteId,\n style = {},\n designSettings,\n shouldRemovePadding,\n shouldUseUsableHeight,\n}) => {\n const [usableHeight, setUsableHeight] = useState(0);\n const [padding, setPadding] = useState<CSSProperties['padding']>(\n shouldRemovePadding ? 0 : getPagePadding(),\n );\n\n useEffect(() => {\n void getUsableHeight(shouldRemovePadding).then((height) => {\n setUsableHeight(height);\n });\n }, [shouldRemovePadding]);\n\n useEffect(() => {\n const handleResize = () => {\n setPadding(shouldRemovePadding ? 0 : getPagePadding());\n };\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [shouldRemovePadding]);\n\n return (\n <StyledPageProvider\n className=\"page-provider\"\n $padding={padding}\n $usableHeight={shouldUseUsableHeight ? usableHeight : undefined}\n >\n <ColorSchemeProvider\n color={color}\n secondaryColor={secondaryColor}\n colorMode={colorMode}\n style={shouldUseUsableHeight ? { ...style, height: '100%' } : style}\n siteId={siteId}\n designSettings={designSettings}\n cssVariables={cssVariables}\n >\n {children}\n </ColorSchemeProvider>\n <GlobalStyle />\n </StyledPageProvider>\n );\n};\nPageProvider.displayName = 'PageProvider';\n\nexport default PageProvider;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAGA,IAAAK,aAAA,GAAAL,OAAA;AAA2D,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,C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AC3B,WAAW,MAAE,CACE,CAAC;AAE7B,CAAC;AACDE,YAAY,CAAC+B,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAE3BoB,YAAY","ignoreList":[]}
|
package/lib/cjs/utils/file.js
CHANGED
|
@@ -3,25 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isValidFileType = exports.getIconByMimeType = exports.getHumanSize = exports.filterDuplicateFileUrls = exports.filterDuplicateFile = exports.MIME_TYPE_MAPPING = void 0;
|
|
6
|
+
exports.isValidFileType = exports.hasDuplicate = exports.getIconByMimeType = exports.getHumanSize = exports.filterDuplicateFileUrls = exports.filterDuplicateFile = exports.MIME_TYPE_MAPPING = void 0;
|
|
7
|
+
const hasDuplicate = (items, newItem, comparator) => items.some(item => comparator(item, newItem));
|
|
8
|
+
exports.hasDuplicate = hasDuplicate;
|
|
7
9
|
const filterDuplicateFile = ({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}) =>
|
|
11
|
-
const duplicates = files.filter(fileItem => fileItem && fileItem.name === newFile.name && fileItem.size === newFile.size);
|
|
12
|
-
return duplicates.length > 0;
|
|
13
|
-
};
|
|
10
|
+
files,
|
|
11
|
+
newFile
|
|
12
|
+
}) => hasDuplicate(files, newFile, (a, b) => a.name === b.name && a.size === b.size);
|
|
14
13
|
exports.filterDuplicateFile = filterDuplicateFile;
|
|
15
14
|
const filterDuplicateFileUrls = ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}) =>
|
|
19
|
-
const duplicates = files.filter(fileItem => fileItem === newFile);
|
|
20
|
-
return duplicates.length > 0;
|
|
21
|
-
};
|
|
15
|
+
files,
|
|
16
|
+
newFile
|
|
17
|
+
}) => hasDuplicate(files, newFile, (a, b) => a === b);
|
|
22
18
|
exports.filterDuplicateFileUrls = filterDuplicateFileUrls;
|
|
23
|
-
const FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
24
19
|
const getHumanSize = bytes => {
|
|
20
|
+
const FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
25
21
|
let size = bytes || 0;
|
|
26
22
|
let unitIndex = 0;
|
|
27
23
|
while (size >= 1024) {
|
|
@@ -48,374 +44,20 @@ const isValidFileType = ({
|
|
|
48
44
|
};
|
|
49
45
|
exports.isValidFileType = isValidFileType;
|
|
50
46
|
const MIME_TYPE_MAPPING = exports.MIME_TYPE_MAPPING = {
|
|
51
|
-
//
|
|
52
|
-
'application/vnd.ms-excel': 'fa fa-file-excel',
|
|
53
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'fa fa-file-excel',
|
|
54
|
-
'application/vnd.ms-excel.sheet.macroEnabled.12': 'fa fa-file-excel',
|
|
55
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml.template': 'fa fa-file-excel',
|
|
56
|
-
'application/vnd.ms-excel.template.macroEnabled.12': 'fa fa-file-excel',
|
|
57
|
-
'application/vnd.ms-excel.addin.macroEnabled.12': 'fa fa-file-excel',
|
|
58
|
-
'application/vnd.ms-excel.sheet.binary.macroEnabled.12': 'fa fa-file-excel',
|
|
59
|
-
'application/msexcel': 'fa fa-file-excel',
|
|
60
|
-
'application/x-msexcel': 'fa fa-file-excel',
|
|
61
|
-
'application/x-ms-excel': 'fa fa-file-excel',
|
|
62
|
-
'application/x-excel': 'fa fa-file-excel',
|
|
63
|
-
'application/x-dos_ms_excel': 'fa fa-file-excel',
|
|
64
|
-
'application/xls': 'fa fa-file-excel',
|
|
65
|
-
'application/x-xls': 'fa fa-file-excel',
|
|
66
|
-
'application/vnd.ms-excel.sheet': 'fa fa-file-excel',
|
|
67
|
-
'appliaction/msexcel': 'fa fa-file-excel',
|
|
68
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml': 'fa fa-file-excel',
|
|
69
|
-
'application/vnd.oasis.opendocument.spreadsheet': 'fa fa-file-excel',
|
|
70
|
-
// Word
|
|
71
|
-
'application/msword': 'fa fa-file-word',
|
|
72
|
-
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'fa fa-file-word',
|
|
73
|
-
'application/vnd.ms-word.document.macroEnabled.12': 'fa fa-file-word',
|
|
74
|
-
'application/vnd.openxmlformats-officedocument.wordprocessingml.template': 'fa fa-file-word',
|
|
75
|
-
'application/vnd.ms-word.template.macroEnabled.12': 'fa fa-file-word',
|
|
76
|
-
'application/doc': 'fa fa-file-word',
|
|
77
|
-
'application/vnd.ms-word': 'fa fa-file-word',
|
|
78
|
-
'application/vnd.ms-word.document.macroEnabled': 'fa fa-file-word',
|
|
79
|
-
'application/vnd.ms-word.template.macroEnabled': 'fa fa-file-word',
|
|
80
|
-
'application/word': 'fa fa-file-word',
|
|
81
|
-
'application/x-msword': 'fa fa-file-word',
|
|
82
|
-
'application/x-msword-template': 'fa fa-file-word',
|
|
83
|
-
'application/vnd.ms-word.document': 'fa fa-file-word',
|
|
84
|
-
'application/rtf': 'fa fa-file-word',
|
|
85
|
-
'application/vnd.oasis.opendocument.text': 'fa fa-file-word',
|
|
86
|
-
'application/vnd.openxmlformats-officedocument.wordprocessingml': 'fa fa-file-word',
|
|
87
|
-
// PDF
|
|
47
|
+
// Haupttypen
|
|
88
48
|
'application/pdf': 'fa fa-file-pdf',
|
|
89
|
-
'application/x-pdf': 'fa fa-file-pdf',
|
|
90
|
-
'application/vnd.pdf': 'fa fa-file-pdf',
|
|
91
|
-
'text/pdf': 'fa fa-file-pdf',
|
|
92
|
-
'application/x-bzpdf': 'fa fa-file-pdf',
|
|
93
|
-
'application/x-gzpdf': 'fa fa-file-pdf',
|
|
94
|
-
'application/x-xzpdf': 'fa fa-file-pdf',
|
|
95
|
-
'application/vnd.adobe.pdf': 'fa fa-file-pdf',
|
|
96
|
-
'application/vnd.adobe.x-mars': 'fa fa-file-pdf',
|
|
97
|
-
'application/vnd.fdf': 'fa fa-file-pdf',
|
|
98
|
-
'application/vnd.adobe.xfdf': 'fa fa-file-pdf',
|
|
99
|
-
'application/vnd.adobe.xdp+xml': 'fa fa-file-pdf',
|
|
100
|
-
'application/vnd.adobe.xfd+xml': 'fa fa-file-pdf',
|
|
101
|
-
'application/vnd.adobe.xslfo+xml': 'fa fa-file-pdf',
|
|
102
|
-
'application/vnd.adobe.pdx': 'fa fa-file-pdf',
|
|
103
|
-
'application/vnd.adobe.xsp+xml': 'fa fa-file-pdf',
|
|
104
|
-
'application/vnd.adobe.xp+xml': 'fa fa-file-pdf',
|
|
105
|
-
'application/vnd.adobe.xpp+xml': 'fa fa-file-pdf',
|
|
106
|
-
'application/vnd.adobe.xdp+zip': 'fa fa-file-pdf',
|
|
107
|
-
'application/vnd.adobe.xfd+zip': 'fa fa-file-pdf',
|
|
108
|
-
'application/vnd.adobe.xfdf+zip': 'fa fa-file-pdf',
|
|
109
|
-
'application/vnd.adobe.xslt+xml': 'fa fa-file-pdf',
|
|
110
|
-
'application/vnd.adobe.xfm+xml': 'fa fa-file-pdf',
|
|
111
|
-
'application/vnd.adobe.xsf+xml': 'fa fa-file-pdf',
|
|
112
|
-
'application/vnd.adobe.xdpxml': 'fa fa-file-pdf',
|
|
113
|
-
'application/vnd.adobe.xfa': 'fa fa-file-pdf',
|
|
114
|
-
'application/vnd.adobe.xpinstall': 'fa fa-file-pdf',
|
|
115
|
-
'application/vnd.adobe.xquery': 'fa fa-file-pdf',
|
|
116
|
-
'application/vnd.adobe.xrd+xml': 'fa fa-file-pdf',
|
|
117
|
-
'application/vnd.adobe.xspf+xml': 'fa fa-file-pdf',
|
|
118
|
-
'application/vnd.adobe.xliff+xml': 'fa fa-file-pdf',
|
|
119
|
-
'application/vnd.adobe.xfdf+xml': 'fa fa-file-pdf',
|
|
120
|
-
'application/vnd.adobe.xmp+xml': 'fa fa-file-pdf',
|
|
121
|
-
'application/vnd.adobe.xmp+zip': 'fa fa-file-pdf',
|
|
122
|
-
'application/vnd.adobe.xna+xml': 'fa fa-file-pdf',
|
|
123
|
-
'application/vnd.adobe.cif+xml': 'fa fa-file-pdf',
|
|
124
|
-
'application/vnd.adobe.edn+xml': 'fa fa-file-pdf',
|
|
125
|
-
'application/vnd.adobe.eps': 'fa fa-file-pdf',
|
|
126
|
-
'application/vnd.adobe.encase.package+xml': 'fa fa-file-pdf',
|
|
127
|
-
'application/vnd.adobe.flash.movie': 'fa fa-file-pdf',
|
|
128
|
-
'application/vnd.adobe.formscentral.fcdt': 'fa fa-file-pdf',
|
|
129
|
-
'application/vnd.adobe.illustrator': 'fa fa-file-pdf',
|
|
130
|
-
'application/vnd.adobe.flash-movie': 'fa fa-file-pdf',
|
|
131
|
-
'application/vnd.adobe.air-application-installer-package+zip': 'fa fa-file-pdf',
|
|
132
|
-
// Zip
|
|
133
49
|
'application/zip': 'fa fa-file-archive',
|
|
134
|
-
'application/
|
|
135
|
-
'application/
|
|
136
|
-
|
|
137
|
-
'application/
|
|
138
|
-
'application/x-
|
|
139
|
-
|
|
140
|
-
'
|
|
141
|
-
'application/java-archive': 'fa fa-file-archive',
|
|
142
|
-
'application/vnd.ms-cab-compressed': 'fa fa-file-archive',
|
|
143
|
-
'application/x-ace-compressed': 'fa fa-file-archive',
|
|
144
|
-
'application/x-apple-diskimage': 'fa fa-file-archive',
|
|
145
|
-
'application/x-stuffit': 'fa fa-file-archive',
|
|
146
|
-
'application/x-deb': 'fa fa-file-archive',
|
|
147
|
-
'application/x-lzip': 'fa fa-file-archive',
|
|
148
|
-
'application/x-lzma': 'fa fa-file-archive',
|
|
149
|
-
'application/x-lz4': 'fa fa-file-archive',
|
|
150
|
-
'application/x-arj': 'fa fa-file-archive',
|
|
151
|
-
'application/x-gtar': 'fa fa-file-archive',
|
|
152
|
-
'application/x-gtar-compressed': 'fa fa-file-archive',
|
|
153
|
-
'application/x-compress': 'fa fa-file-archive',
|
|
154
|
-
'application/x-bzip': 'fa fa-file-archive',
|
|
155
|
-
'application/x-bzip2-compressed-tar': 'fa fa-file-archive',
|
|
156
|
-
'application/x-iso9660-image': 'fa fa-file-archive',
|
|
157
|
-
'application/x-nrg': 'fa fa-file-archive',
|
|
158
|
-
'application/x-cpio': 'fa fa-file-archive',
|
|
159
|
-
'application/x-rpm': 'fa fa-file-archive',
|
|
160
|
-
'application/x-msdownload': 'fa fa-file-archive',
|
|
161
|
-
'application/x-ace': 'fa fa-file-archive',
|
|
162
|
-
'application/x-gca-compressed': 'fa fa-file-archive',
|
|
163
|
-
'application/x-java-pack200': 'fa fa-file-archive',
|
|
164
|
-
'application/x-tarz': 'fa fa-file-archive',
|
|
165
|
-
'application/x-vhd': 'fa fa-file-archive',
|
|
166
|
-
'application/x-virtualbox-hdd': 'fa fa-file-archive',
|
|
167
|
-
'application/x-lha': 'fa fa-file-archive',
|
|
168
|
-
'application/x-lzx': 'fa fa-file-archive',
|
|
169
|
-
'application/x-nsis': 'fa fa-file-archive',
|
|
170
|
-
'application/x-sit': 'fa fa-file-archive',
|
|
171
|
-
'application/x-squashfs': 'fa fa-file-archive',
|
|
172
|
-
'application/x-tzo': 'fa fa-file-archive',
|
|
173
|
-
'application/x-lzh-compressed': 'fa fa-file-archive',
|
|
174
|
-
'application/x-xar': 'fa fa-file-archive',
|
|
175
|
-
'application/x-war': 'fa fa-file-archive',
|
|
176
|
-
'application/x-cfs-compressed': 'fa fa-file-archive',
|
|
177
|
-
'application/x-zoo': 'fa fa-file-archive',
|
|
178
|
-
'application/x-ice': 'fa fa-file-archive',
|
|
179
|
-
'application/x-b1': 'fa fa-file-archive',
|
|
180
|
-
'application/x-arc': 'fa fa-file-archive',
|
|
181
|
-
'application/x-uc2': 'fa fa-file-archive',
|
|
182
|
-
'application/x-gzcompressed': 'fa fa-file-archive',
|
|
183
|
-
'application/x-cab-compressed': 'fa fa-file-archive',
|
|
184
|
-
'application/x-egg': 'fa fa-file-archive',
|
|
185
|
-
'application/x-ipynb+zip': 'fa fa-file-archive',
|
|
186
|
-
'application/x-iso9660-appimage': 'fa fa-file-archive',
|
|
187
|
-
'application/x-java-archive-diff': 'fa fa-file-archive',
|
|
188
|
-
'application/x-lhz': 'fa fa-file-archive',
|
|
189
|
-
'application/x-ms-wim': 'fa fa-file-archive',
|
|
190
|
-
'application/x-rar': 'fa fa-file-archive',
|
|
191
|
-
'application/x-sfx': 'fa fa-file-archive',
|
|
192
|
-
'application/x-shar': 'fa fa-file-archive',
|
|
193
|
-
'application/x-tar-gz': 'fa fa-file-archive',
|
|
194
|
-
'application/x-tar-bz2': 'fa fa-file-archive',
|
|
195
|
-
'application/x-tar-xz': 'fa fa-file-archive',
|
|
196
|
-
'application/x-tar-z': 'fa fa-file-archive',
|
|
197
|
-
'application/x-tar-zstd': 'fa fa-file-archive',
|
|
198
|
-
'application/x-tar.lz': 'fa fa-file-archive',
|
|
199
|
-
'application/x-tar.lzo': 'fa fa-file-archive',
|
|
200
|
-
'application/x-ustar': 'fa fa-file-archive',
|
|
201
|
-
'application/x-wim': 'fa fa-file-archive',
|
|
202
|
-
'application/x-xpinstall': 'fa fa-file-archive',
|
|
203
|
-
'application/x-xz-compressed-tar': 'fa fa-file-archive',
|
|
204
|
-
'application/xz-compressed-tar': 'fa fa-file-archive',
|
|
205
|
-
'application/x-zip': 'fa fa-file-archive',
|
|
206
|
-
'application/x-zip-sfx': 'fa fa-file-archive',
|
|
207
|
-
'application/x-zipx': 'fa fa-file-archive',
|
|
208
|
-
'application/xz': 'fa fa-file-archive',
|
|
209
|
-
'application/zlib': 'fa fa-file-archive',
|
|
210
|
-
'application/vnd.apple.installer+xml': 'fa fa-file-archive',
|
|
211
|
-
'application/vnd.debian.binary-package': 'fa fa-file-archive',
|
|
212
|
-
'application/vnd.ms-office.addin.macroEnabled.12': 'fa fa-file-archive',
|
|
213
|
-
'application/vnd.ms-office.activex+xml': 'fa fa-file-archive',
|
|
214
|
-
'application/vnd.ms-pki.seccat': 'fa fa-file-archive',
|
|
215
|
-
'application/vnd.ms-pki.stl': 'fa fa-file-archive',
|
|
216
|
-
'application/vnd.ms-powerpoint.addin.macroEnabled.12': 'fa fa-file-archive',
|
|
217
|
-
'application/vnd.ms-powerpoint.presentation.macroEnabled.12': 'fa fa-file-archive',
|
|
218
|
-
'application/vnd.ms-powerpoint.slide.macroEnabled.12': 'fa fa-file-archive',
|
|
219
|
-
'application/vnd.ms-powerpoint.slideshow.macroEnabled.12': 'fa fa-file-archive',
|
|
220
|
-
'application/vnd.ms-powerpoint.template.macroEnabled.12': 'fa fa-file-archive',
|
|
221
|
-
'application/vnd.ms-visio.drawing': 'fa fa-file-archive',
|
|
222
|
-
'application/vnd.ms-visio.drawing.macroEnabled.12': 'fa fa-file-archive',
|
|
223
|
-
'application/vnd.ms-visio.stencil': 'fa fa-file-archive',
|
|
224
|
-
'application/vnd.ms-visio.stencil.macroEnabled.12': 'fa fa-file-archive',
|
|
225
|
-
'application/vnd.ms-visio.template': 'fa fa-file-archive',
|
|
226
|
-
'application/vnd.ms-visio.template.macroEnabled.12': 'fa fa-file-archive',
|
|
227
|
-
'application/vnd.ms-xpsdocument': 'fa fa-file-archive',
|
|
228
|
-
'application/octet-stream': 'fa fa-file-archive',
|
|
229
|
-
'application/gzip': 'fa fa-file-archive',
|
|
230
|
-
// PowerPoint
|
|
231
|
-
'application/vnd.ms-powerpoint': 'fa fa-file-powerpoint',
|
|
232
|
-
'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'fa fa-file-powerpoint',
|
|
233
|
-
'application/vnd.openxmlformats-officedocument.presentationml.slideshow': 'fa fa-file-powerpoint',
|
|
234
|
-
'application/vnd.openxmlformats-officedocument.presentationml.template': 'fa fa-file-powerpoint',
|
|
235
|
-
'application/vnd.ms-powerpoint.slide+xml': 'fa fa-file-powerpoint',
|
|
236
|
-
'application/vnd.ms-powerpoint.slide.show+xml': 'fa fa-file-powerpoint',
|
|
237
|
-
'application/vnd.ms-powerpoint.slide.show.macroEnabled.12': 'fa fa-file-powerpoint',
|
|
238
|
-
'application/vnd.ms-powerpoint.slideLayout+xml': 'fa fa-file-powerpoint',
|
|
239
|
-
'application/vnd.ms-powerpoint.slideMaster+xml': 'fa fa-file-powerpoint',
|
|
240
|
-
'application/vnd.ms-powerpoint.slideshow+xml': 'fa fa-file-powerpoint',
|
|
241
|
-
'application/vnd.ms-powerpoint.template+xml': 'fa fa-file-powerpoint',
|
|
242
|
-
'application/vnd.ms-powerpoint.presentation+xml': 'fa fa-file-powerpoint',
|
|
243
|
-
'application/vnd.ms-powerpoint.addin+xml': 'fa fa-file-powerpoint',
|
|
244
|
-
'application/vnd.ms-powerpoint.presentation.macroEnabled+xml': 'fa fa-file-powerpoint',
|
|
245
|
-
'application/vnd.ms-powerpoint.presentation.main+xml': 'fa fa-file-powerpoint',
|
|
246
|
-
'application/vnd.ms-powerpoint.slide.show.macroEnabled+xml': 'fa fa-file-powerpoint',
|
|
247
|
-
'application/vnd.ms-powerpoint.template.macroEnabled+xml': 'fa fa-file-powerpoint',
|
|
248
|
-
'application/x-mspowerpoint': 'fa fa-file-powerpoint',
|
|
249
|
-
'application/x-ms-powerpoint': 'fa fa-file-powerpoint',
|
|
250
|
-
'application/mspowerpoint': 'fa fa-file-powerpoint',
|
|
251
|
-
'application/ppt': 'fa fa-file-powerpoint',
|
|
252
|
-
'application/vnd.ms-ppt': 'fa fa-file-powerpoint',
|
|
253
|
-
'application/powerpoint': 'fa fa-file-powerpoint',
|
|
254
|
-
'application/x-ppt': 'fa fa-file-powerpoint',
|
|
255
|
-
'application/pptx': 'fa fa-file-powerpoint',
|
|
256
|
-
'application/vnd.openxmlformats-officedocument.presentationml.slide': 'fa fa-file-powerpoint',
|
|
257
|
-
'application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml': 'fa fa-file-powerpoint',
|
|
258
|
-
'application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml': 'fa fa-file-powerpoint',
|
|
259
|
-
'application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml': 'fa fa-file-powerpoint',
|
|
260
|
-
'application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml': 'fa fa-file-powerpoint',
|
|
261
|
-
'application/vnd.openxmlformats-officedocument.presentationml': 'fa fa-file-powerpoint',
|
|
262
|
-
'application/vnd.oasis.opendocument.presentation': 'fa fa-file-powerpoint',
|
|
263
|
-
// Text
|
|
264
|
-
'text/plain': 'fa fa-file-alt',
|
|
265
|
-
// CSV
|
|
266
|
-
'text/csv': 'fa fa-file-csv',
|
|
267
|
-
'application/csv': 'fa fa-file-csv',
|
|
268
|
-
'application/x-csv': 'fa fa-file-csv',
|
|
269
|
-
'text/comma-separated-values': 'fa fa-file-csv',
|
|
270
|
-
'text/x-comma-separated-values': 'fa fa-file-csv',
|
|
271
|
-
'text/tab-separated-values': 'fa fa-file-csv',
|
|
272
|
-
'application/x-sqlite3': 'fa fa-file-csv',
|
|
273
|
-
'application/vnd.oasis.opendocument.graphics': 'fa fa-file-csv',
|
|
274
|
-
'application/vnd.oasis.opendocument.chart': 'fa fa-file-csv',
|
|
275
|
-
'application/vnd.oasis.opendocument.database': 'fa fa-file-csv',
|
|
276
|
-
'application/vnd.oasis.opendocument.formula': 'fa fa-file-csv',
|
|
277
|
-
'application/vnd.oasis.opendocument.image': 'fa fa-file-csv',
|
|
278
|
-
'application/vnd.oasis.opendocument.text-master': 'fa fa-file-csv',
|
|
279
|
-
'application/vnd.oasis.opendocument.presentation-master': 'fa fa-file-csv',
|
|
280
|
-
'application/vnd.oasis.opendocument.spreadsheet-template': 'fa fa-file-csv',
|
|
281
|
-
'application/vnd.oasis.opendocument.text-template': 'fa fa-file-csv',
|
|
282
|
-
'application/vnd.oasis.opendocument.presentation-template': 'fa fa-file-csv',
|
|
283
|
-
'application/vnd.oasis.opendocument.graphics-template': 'fa fa-file-csv',
|
|
284
|
-
'application/vnd.oasis.opendocument.chart-template': 'fa fa-file-csv',
|
|
285
|
-
'application/vnd.oasis.opendocument.database-template': 'fa fa-file-csv',
|
|
286
|
-
'application/vnd.oasis.opendocument.formula-template': 'fa fa-file-csv',
|
|
287
|
-
'application/vnd.oasis.opendocument.image-template': 'fa fa-file-csv',
|
|
288
|
-
'application/vnd.sun.xml.writer': 'fa fa-file-csv',
|
|
289
|
-
'application/vnd.sun.xml.writer.template': 'fa fa-file-csv',
|
|
290
|
-
'application/vnd.sun.xml.calc': 'fa fa-file-csv',
|
|
291
|
-
'application/vnd.sun.xml.calc.template': 'fa fa-file-csv',
|
|
292
|
-
'application/vnd.sun.xml.impress': 'fa fa-file-csv',
|
|
293
|
-
'application/vnd.sun.xml.impress.template': 'fa fa-file-csv',
|
|
294
|
-
'application/vnd.sun.xml.draw': 'fa fa-file-csv',
|
|
295
|
-
'application/vnd.sun.xml.draw.template': 'fa fa-file-csv',
|
|
296
|
-
'application/vnd.sun.xml.math': 'fa fa-file-csv',
|
|
297
|
-
// Code
|
|
298
|
-
'text/x-sass': 'fa fa-file-code',
|
|
299
|
-
'text/x-scheme': 'fa fa-file-code',
|
|
300
|
-
'text/x-scons': 'fa fa-file-code',
|
|
301
|
-
'text/x-stsrc': 'fa fa-file-code',
|
|
302
|
-
'text/x-tcl': 'fa fa-file-code',
|
|
303
|
-
'text/x-tex': 'fa fa-file-code',
|
|
304
|
-
'text/x-texinfo': 'fa fa-file-code',
|
|
305
|
-
'text/x-toml': 'fa fa-file-code',
|
|
306
|
-
'text/x-uuencode': 'fa fa-file-code',
|
|
307
|
-
'text/x-vala': 'fa fa-file-code',
|
|
308
|
-
'text/x-vbdotnet': 'fa fa-file-code',
|
|
309
|
-
'text/x-vbnet': 'fa fa-file-code',
|
|
310
|
-
'text/x-verilog': 'fa fa-file-code',
|
|
311
|
-
'text/x-vhdl': 'fa fa-file-code',
|
|
312
|
-
'text/x-yaml': 'fa fa-file-code',
|
|
313
|
-
'application/x-gnuplot': 'fa fa-file-code',
|
|
314
|
-
'application/x-haml': 'fa fa-file-code',
|
|
315
|
-
'application/x-ini': 'fa fa-file-code',
|
|
316
|
-
'application/x-mumps': 'fa fa-file-code',
|
|
317
|
-
'application/x-ocaml': 'fa fa-file-code',
|
|
318
|
-
'application/x-ooc': 'fa fa-file-code',
|
|
319
|
-
'application/x-patch': 'fa fa-file-code',
|
|
320
|
-
'application/x-prolog': 'fa fa-file-code',
|
|
321
|
-
'application/x-properties': 'fa fa-file-code',
|
|
322
|
-
'application/x-rsrc': 'fa fa-file-code',
|
|
323
|
-
'application/x-sass': 'fa fa-file-code',
|
|
324
|
-
'application/x-scheme': 'fa fa-file-code',
|
|
325
|
-
'application/x-scons': 'fa fa-file-code',
|
|
326
|
-
'application/x-stsrc': 'fa fa-file-code',
|
|
327
|
-
'application/x-tcl': 'fa fa-file-code',
|
|
328
|
-
'application/x-tex': 'fa fa-file-code',
|
|
329
|
-
'application/x-texinfo': 'fa fa-file-code',
|
|
330
|
-
'application/x-toml': 'fa fa-file-code',
|
|
331
|
-
'application/x-uuencode': 'fa fa-file-code',
|
|
332
|
-
'application/x-vala': 'fa fa-file-code',
|
|
333
|
-
'application/x-vbdotnet': 'fa fa-file-code',
|
|
334
|
-
'application/x-vbnet': 'fa fa-file-code',
|
|
335
|
-
'application/x-vhdl': 'fa fa-file-code',
|
|
336
|
-
'application/x-verilog': 'fa fa-file-code',
|
|
337
|
-
'application/x-yaml': 'fa fa-file-code',
|
|
338
|
-
'text/x-arduino': 'fa fa-file-code',
|
|
339
|
-
'text/x-bibtex': 'fa fa-file-code',
|
|
340
|
-
'text/x-coffeescript': 'fa fa-file-code',
|
|
341
|
-
'text/x-dtd': 'fa fa-file-code',
|
|
342
|
-
'text/x-erlang': 'fa fa-file-code',
|
|
343
|
-
'text/x-gnuplot': 'fa fa-file-code',
|
|
344
|
-
'text/x-go': 'fa fa-file-code',
|
|
345
|
-
'text/x-gwt-rpc': 'fa fa-file-code',
|
|
346
|
-
'text/x-handlebars': 'fa fa-file-code',
|
|
347
|
-
'text/x-haml': 'fa fa-file-code',
|
|
348
|
-
'text/x-ini': 'fa fa-file-code',
|
|
349
|
-
'text/x-json': 'fa fa-file-code',
|
|
350
|
-
'text/x-kotlin': 'fa fa-file-code',
|
|
351
|
-
'text/x-liquid': 'fa fa-file-code',
|
|
352
|
-
'text/x-literate-haskell': 'fa fa-file-code',
|
|
353
|
-
'text/x-lua': 'fa fa-file-code',
|
|
354
|
-
'text/x-makefile': 'fa fa-file-code',
|
|
355
|
-
'text/x-nfo': 'fa fa-file-code',
|
|
356
|
-
'text/x-ocaml': 'fa fa-file-code',
|
|
357
|
-
'text/x-ooc': 'fa fa-file-code',
|
|
358
|
-
'text/x-patch': 'fa fa-file-code',
|
|
359
|
-
'text/x-prolog': 'fa fa-file-code',
|
|
360
|
-
'text/x-properties': 'fa fa-file-code',
|
|
361
|
-
'text/x-rsrc': 'fa fa-file-code',
|
|
362
|
-
'text/x-rust': 'fa fa-file-code',
|
|
363
|
-
'text/html': 'fa fa-file-code',
|
|
364
|
-
'text/css': 'fa fa-file-code',
|
|
365
|
-
'text/javascript': 'fa fa-file-code',
|
|
366
|
-
'application/javascript': 'fa fa-file-code',
|
|
367
|
-
'application/json': 'fa fa-file-code',
|
|
368
|
-
'application/xml': 'fa fa-file-code',
|
|
369
|
-
'application/xhtml+xml': 'fa fa-file-code',
|
|
370
|
-
'application/atom+xml': 'fa fa-file-code',
|
|
371
|
-
'application/rss+xml': 'fa fa-file-code',
|
|
372
|
-
'application/x-latex': 'fa fa-file-code',
|
|
373
|
-
'application/x-sh': 'fa fa-file-code',
|
|
374
|
-
'application/x-python': 'fa fa-file-code',
|
|
375
|
-
'application/x-perl': 'fa fa-file-code',
|
|
376
|
-
'application/x-ruby': 'fa fa-file-code',
|
|
377
|
-
'application/x-php': 'fa fa-file-code',
|
|
378
|
-
'application/x-java': 'fa fa-file-code',
|
|
379
|
-
'application/x-c++': 'fa fa-file-code',
|
|
380
|
-
'application/x-c': 'fa fa-file-code',
|
|
381
|
-
'application/x-shellscript': 'fa fa-file-code',
|
|
382
|
-
'application/x-diff': 'fa fa-file-code',
|
|
383
|
-
'application/x-go': 'fa fa-file-code',
|
|
384
|
-
'application/x-swift': 'fa fa-file-code',
|
|
385
|
-
'application/x-objective-c': 'fa fa-file-code',
|
|
386
|
-
'application/x-scala': 'fa fa-file-code',
|
|
387
|
-
'application/x-rust': 'fa fa-file-code',
|
|
388
|
-
'application/x-haskell': 'fa fa-file-code',
|
|
389
|
-
'application/x-lua': 'fa fa-file-code',
|
|
390
|
-
'application/x-matlab': 'fa fa-file-code',
|
|
391
|
-
'application/x-fortran': 'fa fa-file-code',
|
|
392
|
-
'application/x-csharp': 'fa fa-file-code',
|
|
393
|
-
'application/x-vb': 'fa fa-file-code',
|
|
394
|
-
'application/x-pascal': 'fa fa-file-code',
|
|
395
|
-
'application/x-cobol': 'fa fa-file-code',
|
|
396
|
-
'application/x-groovy': 'fa fa-file-code',
|
|
397
|
-
'application/x-sql': 'fa fa-file-code',
|
|
398
|
-
'application/x-typescript': 'fa fa-file-code',
|
|
399
|
-
'application/x-kotlin': 'fa fa-file-code',
|
|
400
|
-
'application/x-erlang': 'fa fa-file-code',
|
|
401
|
-
'application/x-clojure': 'fa fa-file-code',
|
|
402
|
-
'application/x-less': 'fa fa-file-code',
|
|
403
|
-
'application/x-stylus': 'fa fa-file-code',
|
|
404
|
-
'application/x-markdown': 'fa fa-file-code',
|
|
405
|
-
'application/x-coffeescript': 'fa fa-file-code',
|
|
406
|
-
'application/x-dart': 'fa fa-file-code',
|
|
407
|
-
'application/x-lisp': 'fa fa-file-code',
|
|
408
|
-
'application/x-powershell': 'fa fa-file-code',
|
|
409
|
-
// Images
|
|
410
|
-
image: 'fa fa-file-image',
|
|
411
|
-
// Audio
|
|
412
|
-
audio: 'fa fa-file-audio',
|
|
413
|
-
// Video
|
|
414
|
-
video: 'fa fa-file-video'
|
|
50
|
+
'application/msword': 'fa fa-file-word',
|
|
51
|
+
'application/vnd.ms-excel': 'fa fa-file-excel',
|
|
52
|
+
// Typen mit Wildcards
|
|
53
|
+
'application/vnd.openxmlformats-officedocument.': 'fa fa-file-word',
|
|
54
|
+
'application/x-': 'fa fa-file-archive',
|
|
55
|
+
// Addiere nur spezifische Fälle
|
|
56
|
+
'text/pdf': 'fa fa-file-pdf'
|
|
415
57
|
};
|
|
416
58
|
const getIconByMimeType = mimeType => {
|
|
417
|
-
const
|
|
418
|
-
return
|
|
59
|
+
const matchedType = Object.keys(MIME_TYPE_MAPPING).find(type => mimeType === null || mimeType === void 0 ? void 0 : mimeType.startsWith(type));
|
|
60
|
+
return MIME_TYPE_MAPPING[matchedType] || 'fa fa-file';
|
|
419
61
|
};
|
|
420
62
|
exports.getIconByMimeType = getIconByMimeType;
|
|
421
63
|
//# sourceMappingURL=file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","names":["filterDuplicateFile","newFile","files","duplicates","filter","fileItem","name","size","length","exports","filterDuplicateFileUrls","FILE_SIZE_UNITS","getHumanSize","bytes","unitIndex","Math","round","toString","replace","isValidFileType","types","file","allowedTypesArray","split","map","type","trim","fileType","some","endsWith","baseType","slice","startsWith","MIME_TYPE_MAPPING","image","audio","video","getIconByMimeType","mimeType","icon","Object","entries","find","key"],"sources":["../../../src/utils/file.ts"],"sourcesContent":["interface FilerDuplicateFileOptions {\n files: File[];\n newFile: File;\n}\n\nexport const filterDuplicateFile = ({ newFile, files }: FilerDuplicateFileOptions) => {\n const duplicates = files.filter(\n (fileItem) => fileItem && fileItem.name === newFile.name && fileItem.size === newFile.size,\n );\n\n return duplicates.length > 0;\n};\n\ninterface FilterDuplicateFileUrlsOptions {\n files: string[];\n newFile: string;\n}\n\nexport const filterDuplicateFileUrls = ({ newFile, files }: FilterDuplicateFileUrlsOptions) => {\n const duplicates = files.filter((fileItem) => fileItem === newFile);\n\n return duplicates.length > 0;\n};\n\nconst FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n\nexport const getHumanSize = (bytes: number): string => {\n let size = bytes || 0;\n let unitIndex = 0;\n\n while (size >= 1024) {\n size /= 1024;\n unitIndex += 1;\n }\n\n size = Math.round(size * 10) / 10;\n\n return `${size.toString().replace('.', ',')} ${FILE_SIZE_UNITS[unitIndex] ?? ''}`;\n};\n\ninterface IsValidFileTypeOptions {\n file: File;\n types: string;\n}\n\nexport const isValidFileType = ({ types, file }: IsValidFileTypeOptions) => {\n const allowedTypesArray = types.split(',').map((type) => type.trim());\n const fileType = file.type;\n\n return allowedTypesArray.some((type) => {\n if (type.endsWith('/*')) {\n const baseType = type.slice(0, -2); // remove '/*'\n return fileType.startsWith(baseType);\n }\n return fileType === type;\n });\n};\n\nexport const MIME_TYPE_MAPPING = {\n // Excel\n 'application/vnd.ms-excel': 'fa fa-file-excel',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'fa fa-file-excel',\n 'application/vnd.ms-excel.sheet.macroEnabled.12': 'fa fa-file-excel',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.template': 'fa fa-file-excel',\n 'application/vnd.ms-excel.template.macroEnabled.12': 'fa fa-file-excel',\n 'application/vnd.ms-excel.addin.macroEnabled.12': 'fa fa-file-excel',\n 'application/vnd.ms-excel.sheet.binary.macroEnabled.12': 'fa fa-file-excel',\n 'application/msexcel': 'fa fa-file-excel',\n 'application/x-msexcel': 'fa fa-file-excel',\n 'application/x-ms-excel': 'fa fa-file-excel',\n 'application/x-excel': 'fa fa-file-excel',\n 'application/x-dos_ms_excel': 'fa fa-file-excel',\n 'application/xls': 'fa fa-file-excel',\n 'application/x-xls': 'fa fa-file-excel',\n 'application/vnd.ms-excel.sheet': 'fa fa-file-excel',\n 'appliaction/msexcel': 'fa fa-file-excel',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml': 'fa fa-file-excel',\n 'application/vnd.oasis.opendocument.spreadsheet': 'fa fa-file-excel',\n\n // Word\n 'application/msword': 'fa fa-file-word',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'fa fa-file-word',\n 'application/vnd.ms-word.document.macroEnabled.12': 'fa fa-file-word',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.template': 'fa fa-file-word',\n 'application/vnd.ms-word.template.macroEnabled.12': 'fa fa-file-word',\n 'application/doc': 'fa fa-file-word',\n 'application/vnd.ms-word': 'fa fa-file-word',\n 'application/vnd.ms-word.document.macroEnabled': 'fa fa-file-word',\n 'application/vnd.ms-word.template.macroEnabled': 'fa fa-file-word',\n 'application/word': 'fa fa-file-word',\n 'application/x-msword': 'fa fa-file-word',\n 'application/x-msword-template': 'fa fa-file-word',\n 'application/vnd.ms-word.document': 'fa fa-file-word',\n 'application/rtf': 'fa fa-file-word',\n 'application/vnd.oasis.opendocument.text': 'fa fa-file-word',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml': 'fa fa-file-word',\n\n // PDF\n 'application/pdf': 'fa fa-file-pdf',\n 'application/x-pdf': 'fa fa-file-pdf',\n 'application/vnd.pdf': 'fa fa-file-pdf',\n 'text/pdf': 'fa fa-file-pdf',\n 'application/x-bzpdf': 'fa fa-file-pdf',\n 'application/x-gzpdf': 'fa fa-file-pdf',\n 'application/x-xzpdf': 'fa fa-file-pdf',\n 'application/vnd.adobe.pdf': 'fa fa-file-pdf',\n 'application/vnd.adobe.x-mars': 'fa fa-file-pdf',\n 'application/vnd.fdf': 'fa fa-file-pdf',\n 'application/vnd.adobe.xfdf': 'fa fa-file-pdf',\n 'application/vnd.adobe.xdp+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xfd+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xslfo+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.pdx': 'fa fa-file-pdf',\n 'application/vnd.adobe.xsp+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xp+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xpp+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xdp+zip': 'fa fa-file-pdf',\n 'application/vnd.adobe.xfd+zip': 'fa fa-file-pdf',\n 'application/vnd.adobe.xfdf+zip': 'fa fa-file-pdf',\n 'application/vnd.adobe.xslt+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xfm+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xsf+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xdpxml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xfa': 'fa fa-file-pdf',\n 'application/vnd.adobe.xpinstall': 'fa fa-file-pdf',\n 'application/vnd.adobe.xquery': 'fa fa-file-pdf',\n 'application/vnd.adobe.xrd+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xspf+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xliff+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xfdf+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xmp+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.xmp+zip': 'fa fa-file-pdf',\n 'application/vnd.adobe.xna+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.cif+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.edn+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.eps': 'fa fa-file-pdf',\n 'application/vnd.adobe.encase.package+xml': 'fa fa-file-pdf',\n 'application/vnd.adobe.flash.movie': 'fa fa-file-pdf',\n 'application/vnd.adobe.formscentral.fcdt': 'fa fa-file-pdf',\n 'application/vnd.adobe.illustrator': 'fa fa-file-pdf',\n 'application/vnd.adobe.flash-movie': 'fa fa-file-pdf',\n 'application/vnd.adobe.air-application-installer-package+zip': 'fa fa-file-pdf',\n\n // Zip\n 'application/zip': 'fa fa-file-archive',\n 'application/x-rar-compressed': 'fa fa-file-archive',\n 'application/x-tar': 'fa fa-file-archive',\n 'application/x-7z-compressed': 'fa fa-file-archive',\n 'application/x-gzip': 'fa fa-file-archive',\n 'application/x-bzip2': 'fa fa-file-archive',\n 'application/x-xz': 'fa fa-file-archive',\n 'application/x-zip-compressed': 'fa fa-file-archive',\n 'application/java-archive': 'fa fa-file-archive',\n 'application/vnd.ms-cab-compressed': 'fa fa-file-archive',\n 'application/x-ace-compressed': 'fa fa-file-archive',\n 'application/x-apple-diskimage': 'fa fa-file-archive',\n 'application/x-stuffit': 'fa fa-file-archive',\n 'application/x-deb': 'fa fa-file-archive',\n 'application/x-lzip': 'fa fa-file-archive',\n 'application/x-lzma': 'fa fa-file-archive',\n 'application/x-lz4': 'fa fa-file-archive',\n 'application/x-arj': 'fa fa-file-archive',\n 'application/x-gtar': 'fa fa-file-archive',\n 'application/x-gtar-compressed': 'fa fa-file-archive',\n 'application/x-compress': 'fa fa-file-archive',\n 'application/x-bzip': 'fa fa-file-archive',\n 'application/x-bzip2-compressed-tar': 'fa fa-file-archive',\n 'application/x-iso9660-image': 'fa fa-file-archive',\n 'application/x-nrg': 'fa fa-file-archive',\n 'application/x-cpio': 'fa fa-file-archive',\n 'application/x-rpm': 'fa fa-file-archive',\n 'application/x-msdownload': 'fa fa-file-archive',\n 'application/x-ace': 'fa fa-file-archive',\n 'application/x-gca-compressed': 'fa fa-file-archive',\n 'application/x-java-pack200': 'fa fa-file-archive',\n 'application/x-tarz': 'fa fa-file-archive',\n 'application/x-vhd': 'fa fa-file-archive',\n 'application/x-virtualbox-hdd': 'fa fa-file-archive',\n 'application/x-lha': 'fa fa-file-archive',\n 'application/x-lzx': 'fa fa-file-archive',\n 'application/x-nsis': 'fa fa-file-archive',\n 'application/x-sit': 'fa fa-file-archive',\n 'application/x-squashfs': 'fa fa-file-archive',\n 'application/x-tzo': 'fa fa-file-archive',\n 'application/x-lzh-compressed': 'fa fa-file-archive',\n 'application/x-xar': 'fa fa-file-archive',\n 'application/x-war': 'fa fa-file-archive',\n 'application/x-cfs-compressed': 'fa fa-file-archive',\n 'application/x-zoo': 'fa fa-file-archive',\n 'application/x-ice': 'fa fa-file-archive',\n 'application/x-b1': 'fa fa-file-archive',\n 'application/x-arc': 'fa fa-file-archive',\n 'application/x-uc2': 'fa fa-file-archive',\n 'application/x-gzcompressed': 'fa fa-file-archive',\n 'application/x-cab-compressed': 'fa fa-file-archive',\n 'application/x-egg': 'fa fa-file-archive',\n 'application/x-ipynb+zip': 'fa fa-file-archive',\n 'application/x-iso9660-appimage': 'fa fa-file-archive',\n 'application/x-java-archive-diff': 'fa fa-file-archive',\n 'application/x-lhz': 'fa fa-file-archive',\n 'application/x-ms-wim': 'fa fa-file-archive',\n 'application/x-rar': 'fa fa-file-archive',\n 'application/x-sfx': 'fa fa-file-archive',\n 'application/x-shar': 'fa fa-file-archive',\n 'application/x-tar-gz': 'fa fa-file-archive',\n 'application/x-tar-bz2': 'fa fa-file-archive',\n 'application/x-tar-xz': 'fa fa-file-archive',\n 'application/x-tar-z': 'fa fa-file-archive',\n 'application/x-tar-zstd': 'fa fa-file-archive',\n 'application/x-tar.lz': 'fa fa-file-archive',\n 'application/x-tar.lzo': 'fa fa-file-archive',\n 'application/x-ustar': 'fa fa-file-archive',\n 'application/x-wim': 'fa fa-file-archive',\n 'application/x-xpinstall': 'fa fa-file-archive',\n 'application/x-xz-compressed-tar': 'fa fa-file-archive',\n 'application/xz-compressed-tar': 'fa fa-file-archive',\n 'application/x-zip': 'fa fa-file-archive',\n 'application/x-zip-sfx': 'fa fa-file-archive',\n 'application/x-zipx': 'fa fa-file-archive',\n 'application/xz': 'fa fa-file-archive',\n 'application/zlib': 'fa fa-file-archive',\n 'application/vnd.apple.installer+xml': 'fa fa-file-archive',\n 'application/vnd.debian.binary-package': 'fa fa-file-archive',\n 'application/vnd.ms-office.addin.macroEnabled.12': 'fa fa-file-archive',\n 'application/vnd.ms-office.activex+xml': 'fa fa-file-archive',\n 'application/vnd.ms-pki.seccat': 'fa fa-file-archive',\n 'application/vnd.ms-pki.stl': 'fa fa-file-archive',\n 'application/vnd.ms-powerpoint.addin.macroEnabled.12': 'fa fa-file-archive',\n 'application/vnd.ms-powerpoint.presentation.macroEnabled.12': 'fa fa-file-archive',\n 'application/vnd.ms-powerpoint.slide.macroEnabled.12': 'fa fa-file-archive',\n 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12': 'fa fa-file-archive',\n 'application/vnd.ms-powerpoint.template.macroEnabled.12': 'fa fa-file-archive',\n 'application/vnd.ms-visio.drawing': 'fa fa-file-archive',\n 'application/vnd.ms-visio.drawing.macroEnabled.12': 'fa fa-file-archive',\n 'application/vnd.ms-visio.stencil': 'fa fa-file-archive',\n 'application/vnd.ms-visio.stencil.macroEnabled.12': 'fa fa-file-archive',\n 'application/vnd.ms-visio.template': 'fa fa-file-archive',\n 'application/vnd.ms-visio.template.macroEnabled.12': 'fa fa-file-archive',\n 'application/vnd.ms-xpsdocument': 'fa fa-file-archive',\n 'application/octet-stream': 'fa fa-file-archive',\n 'application/gzip': 'fa fa-file-archive',\n\n // PowerPoint\n 'application/vnd.ms-powerpoint': 'fa fa-file-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation':\n 'fa fa-file-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.slideshow':\n 'fa fa-file-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.template':\n 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.slide+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.slide.show+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.slide.show.macroEnabled.12': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.slideLayout+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.slideMaster+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.slideshow+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.template+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.presentation+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.addin+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.presentation.macroEnabled+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.presentation.main+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.slide.show.macroEnabled+xml': 'fa fa-file-powerpoint',\n 'application/vnd.ms-powerpoint.template.macroEnabled+xml': 'fa fa-file-powerpoint',\n 'application/x-mspowerpoint': 'fa fa-file-powerpoint',\n 'application/x-ms-powerpoint': 'fa fa-file-powerpoint',\n 'application/mspowerpoint': 'fa fa-file-powerpoint',\n 'application/ppt': 'fa fa-file-powerpoint',\n 'application/vnd.ms-ppt': 'fa fa-file-powerpoint',\n 'application/powerpoint': 'fa fa-file-powerpoint',\n 'application/x-ppt': 'fa fa-file-powerpoint',\n 'application/pptx': 'fa fa-file-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.slide': 'fa fa-file-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml':\n 'fa fa-file-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml':\n 'fa fa-file-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml':\n 'fa fa-file-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml':\n 'fa fa-file-powerpoint',\n 'application/vnd.openxmlformats-officedocument.presentationml': 'fa fa-file-powerpoint',\n 'application/vnd.oasis.opendocument.presentation': 'fa fa-file-powerpoint',\n\n // Text\n 'text/plain': 'fa fa-file-alt',\n\n // CSV\n 'text/csv': 'fa fa-file-csv',\n 'application/csv': 'fa fa-file-csv',\n 'application/x-csv': 'fa fa-file-csv',\n 'text/comma-separated-values': 'fa fa-file-csv',\n 'text/x-comma-separated-values': 'fa fa-file-csv',\n 'text/tab-separated-values': 'fa fa-file-csv',\n 'application/x-sqlite3': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.graphics': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.chart': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.database': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.formula': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.image': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.text-master': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.presentation-master': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.spreadsheet-template': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.text-template': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.presentation-template': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.graphics-template': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.chart-template': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.database-template': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.formula-template': 'fa fa-file-csv',\n 'application/vnd.oasis.opendocument.image-template': 'fa fa-file-csv',\n 'application/vnd.sun.xml.writer': 'fa fa-file-csv',\n 'application/vnd.sun.xml.writer.template': 'fa fa-file-csv',\n 'application/vnd.sun.xml.calc': 'fa fa-file-csv',\n 'application/vnd.sun.xml.calc.template': 'fa fa-file-csv',\n 'application/vnd.sun.xml.impress': 'fa fa-file-csv',\n 'application/vnd.sun.xml.impress.template': 'fa fa-file-csv',\n 'application/vnd.sun.xml.draw': 'fa fa-file-csv',\n 'application/vnd.sun.xml.draw.template': 'fa fa-file-csv',\n 'application/vnd.sun.xml.math': 'fa fa-file-csv',\n\n // Code\n 'text/x-sass': 'fa fa-file-code',\n 'text/x-scheme': 'fa fa-file-code',\n 'text/x-scons': 'fa fa-file-code',\n 'text/x-stsrc': 'fa fa-file-code',\n 'text/x-tcl': 'fa fa-file-code',\n 'text/x-tex': 'fa fa-file-code',\n 'text/x-texinfo': 'fa fa-file-code',\n 'text/x-toml': 'fa fa-file-code',\n 'text/x-uuencode': 'fa fa-file-code',\n 'text/x-vala': 'fa fa-file-code',\n 'text/x-vbdotnet': 'fa fa-file-code',\n 'text/x-vbnet': 'fa fa-file-code',\n 'text/x-verilog': 'fa fa-file-code',\n 'text/x-vhdl': 'fa fa-file-code',\n 'text/x-yaml': 'fa fa-file-code',\n 'application/x-gnuplot': 'fa fa-file-code',\n 'application/x-haml': 'fa fa-file-code',\n 'application/x-ini': 'fa fa-file-code',\n 'application/x-mumps': 'fa fa-file-code',\n 'application/x-ocaml': 'fa fa-file-code',\n 'application/x-ooc': 'fa fa-file-code',\n 'application/x-patch': 'fa fa-file-code',\n 'application/x-prolog': 'fa fa-file-code',\n 'application/x-properties': 'fa fa-file-code',\n 'application/x-rsrc': 'fa fa-file-code',\n 'application/x-sass': 'fa fa-file-code',\n 'application/x-scheme': 'fa fa-file-code',\n 'application/x-scons': 'fa fa-file-code',\n 'application/x-stsrc': 'fa fa-file-code',\n 'application/x-tcl': 'fa fa-file-code',\n 'application/x-tex': 'fa fa-file-code',\n 'application/x-texinfo': 'fa fa-file-code',\n 'application/x-toml': 'fa fa-file-code',\n 'application/x-uuencode': 'fa fa-file-code',\n 'application/x-vala': 'fa fa-file-code',\n 'application/x-vbdotnet': 'fa fa-file-code',\n 'application/x-vbnet': 'fa fa-file-code',\n 'application/x-vhdl': 'fa fa-file-code',\n 'application/x-verilog': 'fa fa-file-code',\n 'application/x-yaml': 'fa fa-file-code',\n 'text/x-arduino': 'fa fa-file-code',\n 'text/x-bibtex': 'fa fa-file-code',\n 'text/x-coffeescript': 'fa fa-file-code',\n 'text/x-dtd': 'fa fa-file-code',\n 'text/x-erlang': 'fa fa-file-code',\n 'text/x-gnuplot': 'fa fa-file-code',\n 'text/x-go': 'fa fa-file-code',\n 'text/x-gwt-rpc': 'fa fa-file-code',\n 'text/x-handlebars': 'fa fa-file-code',\n 'text/x-haml': 'fa fa-file-code',\n 'text/x-ini': 'fa fa-file-code',\n 'text/x-json': 'fa fa-file-code',\n 'text/x-kotlin': 'fa fa-file-code',\n 'text/x-liquid': 'fa fa-file-code',\n 'text/x-literate-haskell': 'fa fa-file-code',\n 'text/x-lua': 'fa fa-file-code',\n 'text/x-makefile': 'fa fa-file-code',\n 'text/x-nfo': 'fa fa-file-code',\n 'text/x-ocaml': 'fa fa-file-code',\n 'text/x-ooc': 'fa fa-file-code',\n 'text/x-patch': 'fa fa-file-code',\n 'text/x-prolog': 'fa fa-file-code',\n 'text/x-properties': 'fa fa-file-code',\n 'text/x-rsrc': 'fa fa-file-code',\n 'text/x-rust': 'fa fa-file-code',\n 'text/html': 'fa fa-file-code',\n 'text/css': 'fa fa-file-code',\n 'text/javascript': 'fa fa-file-code',\n 'application/javascript': 'fa fa-file-code',\n 'application/json': 'fa fa-file-code',\n 'application/xml': 'fa fa-file-code',\n 'application/xhtml+xml': 'fa fa-file-code',\n 'application/atom+xml': 'fa fa-file-code',\n 'application/rss+xml': 'fa fa-file-code',\n 'application/x-latex': 'fa fa-file-code',\n 'application/x-sh': 'fa fa-file-code',\n 'application/x-python': 'fa fa-file-code',\n 'application/x-perl': 'fa fa-file-code',\n 'application/x-ruby': 'fa fa-file-code',\n 'application/x-php': 'fa fa-file-code',\n 'application/x-java': 'fa fa-file-code',\n 'application/x-c++': 'fa fa-file-code',\n 'application/x-c': 'fa fa-file-code',\n 'application/x-shellscript': 'fa fa-file-code',\n 'application/x-diff': 'fa fa-file-code',\n 'application/x-go': 'fa fa-file-code',\n 'application/x-swift': 'fa fa-file-code',\n 'application/x-objective-c': 'fa fa-file-code',\n 'application/x-scala': 'fa fa-file-code',\n 'application/x-rust': 'fa fa-file-code',\n 'application/x-haskell': 'fa fa-file-code',\n 'application/x-lua': 'fa fa-file-code',\n 'application/x-matlab': 'fa fa-file-code',\n 'application/x-fortran': 'fa fa-file-code',\n 'application/x-csharp': 'fa fa-file-code',\n 'application/x-vb': 'fa fa-file-code',\n 'application/x-pascal': 'fa fa-file-code',\n 'application/x-cobol': 'fa fa-file-code',\n 'application/x-groovy': 'fa fa-file-code',\n 'application/x-sql': 'fa fa-file-code',\n 'application/x-typescript': 'fa fa-file-code',\n 'application/x-kotlin': 'fa fa-file-code',\n 'application/x-erlang': 'fa fa-file-code',\n 'application/x-clojure': 'fa fa-file-code',\n 'application/x-less': 'fa fa-file-code',\n 'application/x-stylus': 'fa fa-file-code',\n 'application/x-markdown': 'fa fa-file-code',\n 'application/x-coffeescript': 'fa fa-file-code',\n 'application/x-dart': 'fa fa-file-code',\n 'application/x-lisp': 'fa fa-file-code',\n 'application/x-powershell': 'fa fa-file-code',\n\n // Images\n image: 'fa fa-file-image',\n // Audio\n audio: 'fa fa-file-audio',\n // Video\n video: 'fa fa-file-video',\n};\n\nexport const getIconByMimeType = (mimeType?: string): string => {\n const icon = Object.entries(MIME_TYPE_MAPPING).find(([key]) => mimeType?.startsWith(key));\n\n return icon?.[1] ?? 'fa fa-file';\n};\n"],"mappings":";;;;;;AAKO,MAAMA,mBAAmB,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAAiC,CAAC,KAAK;EAClF,MAAMC,UAAU,GAAGD,KAAK,CAACE,MAAM,CAC1BC,QAAQ,IAAKA,QAAQ,IAAIA,QAAQ,CAACC,IAAI,KAAKL,OAAO,CAACK,IAAI,IAAID,QAAQ,CAACE,IAAI,KAAKN,OAAO,CAACM,IAC1F,CAAC;EAED,OAAOJ,UAAU,CAACK,MAAM,GAAG,CAAC;AAChC,CAAC;AAACC,OAAA,CAAAT,mBAAA,GAAAA,mBAAA;AAOK,MAAMU,uBAAuB,GAAGA,CAAC;EAAET,OAAO;EAAEC;AAAsC,CAAC,KAAK;EAC3F,MAAMC,UAAU,GAAGD,KAAK,CAACE,MAAM,CAAEC,QAAQ,IAAKA,QAAQ,KAAKJ,OAAO,CAAC;EAEnE,OAAOE,UAAU,CAACK,MAAM,GAAG,CAAC;AAChC,CAAC;AAACC,OAAA,CAAAC,uBAAA,GAAAA,uBAAA;AAEF,MAAMC,eAAe,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAEpD,MAAMC,YAAY,GAAIC,KAAa,IAAa;EACnD,IAAIN,IAAI,GAAGM,KAAK,IAAI,CAAC;EACrB,IAAIC,SAAS,GAAG,CAAC;EAEjB,OAAOP,IAAI,IAAI,IAAI,EAAE;IACjBA,IAAI,IAAI,IAAI;IACZO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;EAC/C,oBAAoB,EAAE,iBAAiB;EACvC,oBAAoB,EAAE,iBAAiB;EACvC,0BAA0B,EAAE,iBAAiB;EAE7C;EACAC,KAAK,EAAE,kBAAkB;EACzB;EACAC,KAAK,EAAE,kBAAkB;EACzB;EACAC,KAAK,EAAE;AACX,CAAC;AAEM,MAAMC,iBAAiB,GAAIC,QAAiB,IAAa;EAC5D,MAAMC,IAAI,GAAGC,MAAM,CAACC,OAAO,CAACR,iBAAiB,CAAC,CAACS,IAAI,CAAC,CAAC,CAACC,GAAG,CAAC,KAAKL,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEN,UAAU,CAACW,GAAG,CAAC,CAAC;EAEzF,OAAO,CAAAJ,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAG,CAAC,CAAC,KAAI,YAAY;AACpC,CAAC;AAAC9B,OAAA,CAAA4B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"file.js","names":["hasDuplicate","items","newItem","comparator","some","item","exports","filterDuplicateFile","files","newFile","a","b","name","size","filterDuplicateFileUrls","getHumanSize","bytes","FILE_SIZE_UNITS","unitIndex","Math","round","toString","replace","isValidFileType","types","file","allowedTypesArray","split","map","type","trim","fileType","endsWith","baseType","slice","startsWith","MIME_TYPE_MAPPING","getIconByMimeType","mimeType","matchedType","Object","keys","find"],"sources":["../../../src/utils/file.ts"],"sourcesContent":["export const hasDuplicate = <T>(\n items: T[],\n newItem: T,\n comparator: (a: T, b: T) => boolean,\n): boolean => items.some((item) => comparator(item, newItem));\n\ninterface FilerDuplicateFileOptions {\n files: File[];\n newFile: File;\n}\n\nexport const filterDuplicateFile = ({ files, newFile }: FilerDuplicateFileOptions) =>\n hasDuplicate(files, newFile, (a, b) => a.name === b.name && a.size === b.size);\n\ninterface FilterDuplicateFileUrlsOptions {\n files: string[];\n newFile: string;\n}\n\nexport const filterDuplicateFileUrls = ({ files, newFile }: FilterDuplicateFileUrlsOptions) =>\n hasDuplicate(files, newFile, (a, b) => a === b);\n\nexport const getHumanSize = (bytes: number): string => {\n const FILE_SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n let size = bytes || 0;\n let unitIndex = 0;\n\n while (size >= 1024) {\n size /= 1024;\n unitIndex += 1;\n }\n\n size = Math.round(size * 10) / 10;\n\n return `${size.toString().replace('.', ',')} ${FILE_SIZE_UNITS[unitIndex] ?? ''}`;\n};\n\ninterface IsValidFileTypeOptions {\n file: File;\n types: string;\n}\n\nexport const isValidFileType = ({ types, file }: IsValidFileTypeOptions) => {\n const allowedTypesArray = types.split(',').map((type) => type.trim());\n const fileType = file.type;\n\n return allowedTypesArray.some((type) => {\n if (type.endsWith('/*')) {\n const baseType = type.slice(0, -2); // remove '/*'\n return fileType.startsWith(baseType);\n }\n return fileType === type;\n });\n};\n\nexport const MIME_TYPE_MAPPING: Record<string, string> = {\n // Haupttypen\n 'application/pdf': 'fa fa-file-pdf',\n 'application/zip': 'fa fa-file-archive',\n 'application/msword': 'fa fa-file-word',\n 'application/vnd.ms-excel': 'fa fa-file-excel',\n // Typen mit Wildcards\n 'application/vnd.openxmlformats-officedocument.': 'fa fa-file-word',\n 'application/x-': 'fa fa-file-archive',\n // Addiere nur spezifische Fälle\n 'text/pdf': 'fa fa-file-pdf',\n};\n\nexport const getIconByMimeType = (mimeType?: string): string => {\n const matchedType = Object.keys(MIME_TYPE_MAPPING).find((type) => mimeType?.startsWith(type));\n return MIME_TYPE_MAPPING[matchedType!] || 'fa fa-file';\n};\n"],"mappings":";;;;;;AAAO,MAAMA,YAAY,GAAGA,CACxBC,KAAU,EACVC,OAAU,EACVC,UAAmC,KACzBF,KAAK,CAACG,IAAI,CAAEC,IAAI,IAAKF,UAAU,CAACE,IAAI,EAAEH,OAAO,CAAC,CAAC;AAACI,OAAA,CAAAN,YAAA,GAAAA,YAAA;AAOvD,MAAMO,mBAAmB,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAmC,CAAC,KAC7ET,Y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AAMC,QAAQ,GAAGN,IAAI,CAACI,IAAI;EAE1B,OAAOH,iBAAiB,CAACtB,IAAI,CAAEyB,IAAI,IAAK;IACpC,IAAIA,IAAI,CAACG,QAAQ,CAAC,IAAI,CAAC,EAAE;MACrB,MAAMC,QAAQ,GAAGJ,IAAI,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;MACpC,OAAOH,QAAQ,CAACI,UAAU,CAACF,QAAQ,CAAC;IACxC;IACA,OAAOF,QAAQ,KAAKF,IAAI;EAC5B,CAAC,CAAC;AACN,CAAC;AAACvB,OAAA,CAAAiB,eAAA,GAAAA,eAAA;AAEK,MAAMa,iBAAyC,GAAA9B,OAAA,CAAA8B,iBAAA,GAAG;EACrD;EACA,iBAAiB,EAAE,gBAAgB;EACnC,iBAAiB,EAAE,oBAAoB;EACvC,oBAAoB,EAAE,iBAAiB;EACvC,0BAA0B,EAAE,kBAAkB;EAC9C;EACA,gDAAgD,EAAE,iBAAiB;EACnE,gBAAgB,EAAE,oBAAoB;EACtC;EACA,UAAU,EAAE;AAChB,CAAC;AAEM,MAAMC,iBAAiB,GAAIC,QAAiB,IAAa;EAC5D,MAAMC,WAAW,GAAGC,MAAM,CAACC,IAAI,CAACL,iBAAiB,CAAC,CAACM,IAAI,CAAEb,IAAI,IAAKS,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEH,UAAU,CAACN,IAAI,CAAC,CAAC;EAC7F,OAAOO,iBAAiB,CAACG,WAAW,CAAE,IAAI,YAAY;AAC1D,CAAC;AAACjC,OAAA,CAAA+B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -45,7 +45,10 @@ const PageProvider = _ref => {
|
|
|
45
45
|
color: color,
|
|
46
46
|
secondaryColor: secondaryColor,
|
|
47
47
|
colorMode: colorMode,
|
|
48
|
-
style:
|
|
48
|
+
style: shouldUseUsableHeight ? {
|
|
49
|
+
...style,
|
|
50
|
+
height: '100%'
|
|
51
|
+
} : style,
|
|
49
52
|
siteId: siteId,
|
|
50
53
|
designSettings: designSettings,
|
|
51
54
|
cssVariables: cssVariables
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageProvider.js","names":["React","useEffect","useState","createGlobalStyle","getPagePadding","getUsableHeight","ColorSchemeProvider","StyledPageProvider","GlobalStyle","PageProvider","_ref","children","color","colorMode","cssVariables","secondaryColor","siteId","style","designSettings","shouldRemovePadding","shouldUseUsableHeight","usableHeight","setUsableHeight","padding","setPadding","then","height","handleResize","window","addEventListener","removeEventListener","createElement","className","$padding","$usableHeight","undefined","displayName"],"sources":["../../../../src/components/page-provider/PageProvider.tsx"],"sourcesContent":["import React, { FC, useEffect, useState, type CSSProperties } from 'react';\nimport { createGlobalStyle } from 'styled-components';\nimport { getPagePadding, getUsableHeight } from '../../utils/pageProvider';\nimport ColorSchemeProvider, {\n type ColorSchemeProviderProps,\n} from '../color-scheme-provider/ColorSchemeProvider';\nimport { StyledPageProvider } from './PageProvider.styles';\n\ninterface PageProviderProps extends ColorSchemeProviderProps {\n /**\n * Whether the padding should be removed.\n */\n shouldRemovePadding?: boolean;\n /**\n * Whether the usable height should be used.\n */\n shouldUseUsableHeight?: boolean;\n}\n\nconst GlobalStyle = createGlobalStyle`\n *, *::before, *::after {\n box-sizing: border-box;\n }\n`;\n\nconst PageProvider: FC<PageProviderProps> = ({\n children,\n color,\n colorMode,\n cssVariables = {},\n secondaryColor,\n siteId,\n style = {},\n designSettings,\n shouldRemovePadding,\n shouldUseUsableHeight,\n}) => {\n const [usableHeight, setUsableHeight] = useState(0);\n const [padding, setPadding] = useState<CSSProperties['padding']>(\n shouldRemovePadding ? 0 : getPagePadding(),\n );\n\n useEffect(() => {\n void getUsableHeight(shouldRemovePadding).then((height) => {\n setUsableHeight(height);\n });\n }, [shouldRemovePadding]);\n\n useEffect(() => {\n const handleResize = () => {\n setPadding(shouldRemovePadding ? 0 : getPagePadding());\n };\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [shouldRemovePadding]);\n\n return (\n <StyledPageProvider\n className=\"page-provider\"\n $padding={padding}\n $usableHeight={shouldUseUsableHeight ? usableHeight : undefined}\n >\n <ColorSchemeProvider\n color={color}\n secondaryColor={secondaryColor}\n colorMode={colorMode}\n style={style}\n siteId={siteId}\n designSettings={designSettings}\n cssVariables={cssVariables}\n >\n {children}\n </ColorSchemeProvider>\n <GlobalStyle />\n </StyledPageProvider>\n );\n};\nPageProvider.displayName = 'PageProvider';\n\nexport default PageProvider;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,SAAS,EAAEC,QAAQ,QAA4B,OAAO;AAC1E,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,cAAc,EAAEC,eAAe,QAAQ,0BAA0B;AAC1E,OAAOC,mBAAmB,MAEnB,8CAA8C;AACrD,SAASC,kBAAkB,QAAQ,uBAAuB;AAa1D,MAAMC,WAAW,GAAGL,iBAAiB;AACrC;AACA;AACA;AACA,CAAC;AAED,MAAMM,YAAmC,GAAGC,IAAA,IAWtC;EAAA,IAXuC;IACzCC,QAAQ;IACRC,KAAK;IACLC,SAAS;IACTC,YAAY,GAAG,CAAC,CAAC;IACjBC,cAAc;IACdC,MAAM;IACNC,KAAK,GAAG,CAAC,CAAC;IACVC,cAAc;IACdC,mBAAmB;IACnBC;EACJ,CAAC,GAAAV,IAAA;EACG,MAAM,CAACW,YAAY,EAAEC,eAAe,CAAC,GAAGpB,QAAQ,CAAC,CAAC,CAAC;EACnD,MAAM,CAACqB,OAAO,EAAEC,UAAU,CAAC,GAAGtB,QAAQ,CAClCiB,mBAAmB,GAAG,CAAC,GAAGf,cAAc,CAAC,CAC7C,CAAC;EAEDH,SAAS,CAAC,MAAM;IACZ,KAAKI,eAAe,CAACc,mBAAmB,CAAC,CAACM,IAAI,CAAEC,MAAM,IAAK;MACvDJ,eAAe,CAACI,MAAM,CAAC;IAC3B,CAAC,CAAC;EACN,CAAC,EAAE,CAACP,mBAAmB,CAAC,CAAC;EAEzBlB,SAAS,CAAC,MAAM;IACZ,MAAM0B,YAAY,GAAGA,CAAA,KAAM;MACvBH,UAAU,CAACL,mBAAmB,GAAG,CAAC,GAAGf,cAAc,CAAC,CAAC,CAAC;IAC1D,CAAC;IAEDwB,MAAM,CAACC,gBAAgB,CAAC,QAAQ,EAAEF,YAAY,CAAC;IAE/C,OAAO,MAAM;MACTC,MAAM,CAACE,mBAAmB,CAAC,QAAQ,EAAEH,YAAY,CAAC;IACtD,CAAC;EACL,CAAC,EAAE,CAACR,mBAAmB,CAAC,CAAC;EAEzB,oBACInB,KAAA,CAAA+B,aAAA,CAACxB,kBAAkB;IACfyB,SAAS,EAAC,eAAe;IACzBC,QAAQ,EAAEV,OAAQ;IAClBW,aAAa,EAAEd,qBAAqB,GAAGC,YAAY,GAAGc;EAAU,gBAEhEnC,KAAA,CAAA+B,aAAA,CAACzB,mBAAmB;IAChBM,KAAK,EAAEA,KAAM;IACbG,cAAc,EAAEA,cAAe;IAC/BF,SAAS,EAAEA,SAAU;IACrBI,KAAK,
|
|
1
|
+
{"version":3,"file":"PageProvider.js","names":["React","useEffect","useState","createGlobalStyle","getPagePadding","getUsableHeight","ColorSchemeProvider","StyledPageProvider","GlobalStyle","PageProvider","_ref","children","color","colorMode","cssVariables","secondaryColor","siteId","style","designSettings","shouldRemovePadding","shouldUseUsableHeight","usableHeight","setUsableHeight","padding","setPadding","then","height","handleResize","window","addEventListener","removeEventListener","createElement","className","$padding","$usableHeight","undefined","displayName"],"sources":["../../../../src/components/page-provider/PageProvider.tsx"],"sourcesContent":["import React, { FC, useEffect, useState, type CSSProperties } from 'react';\nimport { createGlobalStyle } from 'styled-components';\nimport { getPagePadding, getUsableHeight } from '../../utils/pageProvider';\nimport ColorSchemeProvider, {\n type ColorSchemeProviderProps,\n} from '../color-scheme-provider/ColorSchemeProvider';\nimport { StyledPageProvider } from './PageProvider.styles';\n\ninterface PageProviderProps extends ColorSchemeProviderProps {\n /**\n * Whether the padding should be removed.\n */\n shouldRemovePadding?: boolean;\n /**\n * Whether the usable height should be used.\n */\n shouldUseUsableHeight?: boolean;\n}\n\nconst GlobalStyle = createGlobalStyle`\n *, *::before, *::after {\n box-sizing: border-box;\n }\n`;\n\nconst PageProvider: FC<PageProviderProps> = ({\n children,\n color,\n colorMode,\n cssVariables = {},\n secondaryColor,\n siteId,\n style = {},\n designSettings,\n shouldRemovePadding,\n shouldUseUsableHeight,\n}) => {\n const [usableHeight, setUsableHeight] = useState(0);\n const [padding, setPadding] = useState<CSSProperties['padding']>(\n shouldRemovePadding ? 0 : getPagePadding(),\n );\n\n useEffect(() => {\n void getUsableHeight(shouldRemovePadding).then((height) => {\n setUsableHeight(height);\n });\n }, [shouldRemovePadding]);\n\n useEffect(() => {\n const handleResize = () => {\n setPadding(shouldRemovePadding ? 0 : getPagePadding());\n };\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [shouldRemovePadding]);\n\n return (\n <StyledPageProvider\n className=\"page-provider\"\n $padding={padding}\n $usableHeight={shouldUseUsableHeight ? usableHeight : undefined}\n >\n <ColorSchemeProvider\n color={color}\n secondaryColor={secondaryColor}\n colorMode={colorMode}\n style={shouldUseUsableHeight ? { ...style, height: '100%' } : style}\n siteId={siteId}\n designSettings={designSettings}\n cssVariables={cssVariables}\n >\n {children}\n </ColorSchemeProvider>\n <GlobalStyle />\n </StyledPageProvider>\n );\n};\nPageProvider.displayName = 'PageProvider';\n\nexport default PageProvider;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,SAAS,EAAEC,QAAQ,QAA4B,OAAO;AAC1E,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,cAAc,EAAEC,eAAe,QAAQ,0BAA0B;AAC1E,OAAOC,mBAAmB,MAEnB,8CAA8C;AACrD,SAASC,kBAAkB,QAAQ,uBAAuB;AAa1D,MAAMC,WAAW,GAAGL,iBAAiB;AACrC;AACA;A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