@synerise/ds-file-uploader 1.0.17 → 1.0.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/AvatarUploader/AvatarUploader.d.ts.map +1 -1
  3. package/dist/AvatarUploader/AvatarUploader.styles.d.ts +3 -4
  4. package/dist/AvatarUploader/AvatarUploader.styles.d.ts.map +1 -1
  5. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.const.d.ts +4 -0
  6. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.const.d.ts.map +1 -0
  7. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.const.js +10 -0
  8. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.d.ts.map +1 -1
  9. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.js +5 -11
  10. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.styles.d.ts +10 -10
  11. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.styles.d.ts.map +1 -1
  12. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.types.d.ts +1 -0
  13. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.types.d.ts.map +1 -1
  14. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.util.d.ts +3 -0
  15. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.util.d.ts.map +1 -0
  16. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.util.js +4 -0
  17. package/dist/FileUploader.d.ts.map +1 -1
  18. package/dist/FileUploader.styles.d.ts +19 -20
  19. package/dist/FileUploader.styles.d.ts.map +1 -1
  20. package/dist/FileView/FileView.const.d.ts +7 -0
  21. package/dist/FileView/FileView.const.d.ts.map +1 -0
  22. package/dist/FileView/FileView.const.js +21 -0
  23. package/dist/FileView/FileView.d.ts.map +1 -1
  24. package/dist/FileView/FileView.js +4 -19
  25. package/dist/FileView/FileView.styles.d.ts +7 -8
  26. package/dist/FileView/FileView.styles.d.ts.map +1 -1
  27. package/dist/ItemUploader/ItemUploader.styles.d.ts +3 -4
  28. package/dist/ItemUploader/ItemUploader.styles.d.ts.map +1 -1
  29. package/dist/ItemUploader/UploaderButton/FileViewItem.const.d.ts +6 -0
  30. package/dist/ItemUploader/UploaderButton/FileViewItem.const.d.ts.map +1 -0
  31. package/dist/ItemUploader/UploaderButton/FileViewItem.const.js +13 -0
  32. package/dist/ItemUploader/UploaderButton/FileViewItem.d.ts.map +1 -1
  33. package/dist/ItemUploader/UploaderButton/FileViewItem.js +4 -11
  34. package/dist/ItemUploader/UploaderButton/FileViewItem.styles.d.ts +6 -6
  35. package/dist/ItemUploader/UploaderButton/FileViewItem.styles.d.ts.map +1 -1
  36. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.19](https://github.com/Synerise/synerise-design/compare/@synerise/ds-file-uploader@1.0.18...@synerise/ds-file-uploader@1.0.19) (2025-07-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-file-uploader
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.0.18](https://github.com/Synerise/synerise-design/compare/@synerise/ds-file-uploader@1.0.17...@synerise/ds-file-uploader@1.0.18) (2025-07-17)
15
+
16
+ **Note:** Version bump only for package @synerise/ds-file-uploader
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.0.17](https://github.com/Synerise/synerise-design/compare/@synerise/ds-file-uploader@1.0.16...@synerise/ds-file-uploader@1.0.17) (2025-07-15)
7
23
 
8
24
  **Note:** Version bump only for package @synerise/ds-file-uploader
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarUploader.d.ts","sourceRoot":"","sources":["../../src/AvatarUploader/AvatarUploader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAgB/B,QAAA,MAAM,cAAc,yIAejB,iBAAiB,sBAoInB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"AvatarUploader.d.ts","sourceRoot":"","sources":["../../src/AvatarUploader/AvatarUploader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAgB/B,QAAA,MAAM,cAAc,GAAI,sIAerB,iBAAiB,sBAoInB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
3
2
  export declare const UploaderContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
4
3
  export declare const Description: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/lib/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {
5
- hasError?: boolean | undefined;
4
+ hasError?: boolean;
6
5
  }, never>;
7
6
  export declare const DropAreaContainer: import("styled-components").StyledComponent<"div", any, {
8
7
  canUploadMore: boolean;
@@ -11,8 +10,8 @@ export declare const DropAreaLabel: import("styled-components").StyledComponent<
11
10
  export declare const LargeDropAreaLabel: import("styled-components").StyledComponent<"label", any, {}, never>;
12
11
  export declare const LargeDropAreaDescription: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/lib/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
13
12
  export declare const DropAreaButton: import("styled-components").StyledComponent<"button", any, {
14
- isDropping?: boolean | undefined;
15
- hasError?: boolean | undefined;
13
+ isDropping?: boolean;
14
+ hasError?: boolean;
16
15
  mode: string;
17
16
  pressed: boolean;
18
17
  filesLength: number;
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarUploader.styles.d.ts","sourceRoot":"","sources":["../../src/AvatarUploader/AvatarUploader.styles.ts"],"names":[],"mappings":";AAMA,eAAO,MAAM,SAAS,oEAGrB,CAAC;AACF,eAAO,MAAM,iBAAiB,oEAG7B,CAAC;AACF,eAAO,MAAM,WAAW;;SAMvB,CAAC;AAEF,eAAO,MAAM,iBAAiB;mBAA+B,OAAO;SAGnE,CAAC;AAEF,eAAO,MAAM,aAAa,uMAGzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,sEAO9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,uMAMpC,CAAC;AAEF,eAAO,MAAM,cAAc;;;UAGnB,MAAM;aACH,OAAO;iBACH,MAAM;SAuGpB,CAAC;AAEF,eAAO,MAAM,YAAY,uMAMxB,CAAC;AAEF,eAAO,MAAM,KAAK,sEAOjB,CAAC"}
1
+ {"version":3,"file":"AvatarUploader.styles.d.ts","sourceRoot":"","sources":["../../src/AvatarUploader/AvatarUploader.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS,oEAGrB,CAAC;AACF,eAAO,MAAM,iBAAiB,oEAG7B,CAAC;AACF,eAAO,MAAM,WAAW;eAAwC,OAAO;SAMtE,CAAC;AAEF,eAAO,MAAM,iBAAiB;mBAA+B,OAAO;SAGnE,CAAC;AAEF,eAAO,MAAM,aAAa,uMAGzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,sEAO9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,uMAMpC,CAAC;AAEF,eAAO,MAAM,cAAc;iBACZ,OAAO;eACT,OAAO;UACZ,MAAM;aACH,OAAO;iBACH,MAAM;SAuGpB,CAAC;AAEF,eAAO,MAAM,YAAY,uMAMxB,CAAC;AAEF,eAAO,MAAM,KAAK,sEAOjB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type PreviewableMimeType } from './FileViewAvatar.types';
2
+ export declare const previewableMimeTypes: PreviewableMimeType[];
3
+ export declare const ICON_MAP: Record<PreviewableMimeType, JSX.Element>;
4
+ //# sourceMappingURL=FileViewAvatar.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileViewAvatar.const.d.ts","sourceRoot":"","sources":["../../../src/AvatarUploader/FileViewAvatar/FileViewAvatar.const.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,eAAO,MAAM,oBAAoB,EAAE,mBAAmB,EAMrD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,mBAAmB,EAAE,GAAG,CAAC,OAAO,CAM7D,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { FileTypeImageM } from '@synerise/ds-icon';
3
+ export var previewableMimeTypes = ['image/png', 'image/gif', 'image/jpeg', 'image/svg+xml', 'text/csv'];
4
+ export var ICON_MAP = {
5
+ 'image/png': /*#__PURE__*/React.createElement(FileTypeImageM, null),
6
+ 'image/gif': /*#__PURE__*/React.createElement(FileTypeImageM, null),
7
+ 'image/jpeg': /*#__PURE__*/React.createElement(FileTypeImageM, null),
8
+ 'image/svg+xml': /*#__PURE__*/React.createElement(FileTypeImageM, null),
9
+ 'text/csv': /*#__PURE__*/React.createElement(FileTypeImageM, null)
10
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"FileViewAvatar.d.ts","sourceRoot":"","sources":["../../../src/AvatarUploader/FileViewAvatar/FileViewAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAYxC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAiBlE,QAAA,MAAM,cAAc,uDAMjB,mBAAmB,sBA2GrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"FileViewAvatar.d.ts","sourceRoot":"","sources":["../../../src/AvatarUploader/FileViewAvatar/FileViewAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAQxC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,QAAA,MAAM,cAAc,GAAI,oDAMrB,mBAAmB,sBA2GrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,17 +1,11 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useState } from 'react';
3
3
  import { FormattedMessage } from 'react-intl';
4
- import Icon, { Close3M, FileM, FileTypeImageM, RepeatM } from '@synerise/ds-icon';
4
+ import Icon, { Close3M, FileM, RepeatM } from '@synerise/ds-icon';
5
5
  import Tooltip from '@synerise/ds-tooltip';
6
+ import { ICON_MAP } from './FileViewAvatar.const';
6
7
  import * as S from './FileViewAvatar.styles';
7
- var previewableMimeTypes = ['image/png', 'image/gif', 'image/jpeg', 'image/svg+xml', 'text/csv'];
8
- var mapperOfIcons = {
9
- 'image/png': /*#__PURE__*/React.createElement(FileTypeImageM, null),
10
- 'image/gif': /*#__PURE__*/React.createElement(FileTypeImageM, null),
11
- 'image/jpeg': /*#__PURE__*/React.createElement(FileTypeImageM, null),
12
- 'image/svg+xml': /*#__PURE__*/React.createElement(FileTypeImageM, null),
13
- 'text/csv': /*#__PURE__*/React.createElement(FileTypeImageM, null)
14
- };
8
+ import { isPreviewableMimeType } from './FileViewAvatar.util';
15
9
  var FileViewAvatar = function FileViewAvatar(_ref) {
16
10
  var data = _ref.data,
17
11
  texts = _ref.texts,
@@ -79,8 +73,8 @@ var FileViewAvatar = function FileViewAvatar(_ref) {
79
73
  error: hasError,
80
74
  removable: removable,
81
75
  type: "button"
82
- }, previewableMimeTypes.indexOf(file.type) > -1 ? /*#__PURE__*/React.createElement(S.PreviewImage, null, /*#__PURE__*/React.createElement(Icon, {
83
- component: mapperOfIcons[file.type],
76
+ }, isPreviewableMimeType(file.type) ? /*#__PURE__*/React.createElement(S.PreviewImage, null, /*#__PURE__*/React.createElement(Icon, {
77
+ component: ICON_MAP[file.type],
84
78
  size: 24
85
79
  })) : /*#__PURE__*/React.createElement(S.PlaceholderImage, null, /*#__PURE__*/React.createElement(Icon, {
86
80
  component: /*#__PURE__*/React.createElement(FileM, null),
@@ -3,7 +3,7 @@ export declare const RepeatIcon: import("styled-components").StyledComponent<"di
3
3
  export declare const LoaderIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
4
4
  export declare const spinnerAnimation: import("styled-components").Keyframes;
5
5
  export declare const SmallLoader: import("styled-components").StyledComponent<"div", any, {
6
- size?: "S" | "M" | "L" | undefined;
6
+ size?: keyof typeof import("@synerise/ds-loader/dist/Loader.types").LoaderSize;
7
7
  color: string;
8
8
  }, never>;
9
9
  export declare const PlaceholderImage: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -11,24 +11,24 @@ export declare const FileAvatarContainer: import("styled-components").StyledComp
11
11
  export declare const FileViewContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
12
12
  export declare const Info: import("styled-components").StyledComponent<"div", any, {}, never>;
13
13
  export declare const DescriptionUploader: import("styled-components").StyledComponent<"div", any, {
14
- disabled?: boolean | undefined;
14
+ disabled?: boolean;
15
15
  }, never>;
16
16
  export declare const Name: import("styled-components").StyledComponent<"label", any, {}, never>;
17
17
  export declare const RemoveButtonWrapper: import("styled-components").StyledComponent<"div", any, {
18
- pressed?: boolean | undefined;
18
+ pressed?: boolean;
19
19
  }, never>;
20
20
  export declare const RemoveWrapper: import("styled-components").StyledComponent<"div", any, {
21
- pressed?: boolean | undefined;
21
+ pressed?: boolean;
22
22
  }, never>;
23
23
  export declare const AvatarContainer: import("styled-components").StyledComponent<"div", any, {
24
24
  source: string;
25
- disabled?: boolean | undefined;
26
- removable?: boolean | undefined;
25
+ disabled?: boolean;
26
+ removable?: boolean;
27
27
  }, never>;
28
28
  export declare const FileView: import("styled-components").StyledComponent<"button", any, {
29
- disabled?: boolean | undefined;
30
- error?: boolean | undefined;
31
- removable?: boolean | undefined;
32
- progress?: boolean | undefined;
29
+ disabled?: boolean;
30
+ error?: boolean;
31
+ removable?: boolean;
32
+ progress?: boolean;
33
33
  }, never>;
34
34
  //# sourceMappingURL=FileViewAvatar.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileViewAvatar.styles.d.ts","sourceRoot":"","sources":["../../../src/AvatarUploader/FileViewAvatar/FileViewAvatar.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,oEAIxB,CAAC;AACF,eAAO,MAAM,UAAU,oEAOtB,CAAC;AACF,eAAO,MAAM,UAAU,oEAEtB,CAAC;AACF,eAAO,MAAM,gBAAgB,uCAQ5B,CAAC;AACF,eAAO,MAAM,WAAW;;;SAKvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,oEAU5B,CAAC;AAEF,eAAO,MAAM,mBAAmB,oEAE/B,CAAC;AACF,eAAO,MAAM,iBAAiB,oEAAe,CAAC;AAE9C,eAAO,MAAM,IAAI,oEAIhB,CAAC;AACF,eAAO,MAAM,mBAAmB;;SAG/B,CAAC;AAEF,eAAO,MAAM,IAAI,sEAShB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;SA0B/B,CAAC;AACF,eAAO,MAAM,aAAa;;SAiBzB,CAAC;AACF,eAAO,MAAM,eAAe;YAClB,MAAM;;;SA0Bf,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;SA2FpB,CAAC"}
1
+ {"version":3,"file":"FileViewAvatar.styles.d.ts","sourceRoot":"","sources":["../../../src/AvatarUploader/FileViewAvatar/FileViewAvatar.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,oEAIxB,CAAC;AACF,eAAO,MAAM,UAAU,oEAOtB,CAAC;AACF,eAAO,MAAM,UAAU,oEAEtB,CAAC;AACF,eAAO,MAAM,gBAAgB,uCAQ5B,CAAC;AACF,eAAO,MAAM,WAAW;;;SAKvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,oEAU5B,CAAC;AAEF,eAAO,MAAM,mBAAmB,oEAE/B,CAAC;AACF,eAAO,MAAM,iBAAiB,oEAAe,CAAC;AAE9C,eAAO,MAAM,IAAI,oEAIhB,CAAC;AACF,eAAO,MAAM,mBAAmB;;SAG/B,CAAC;AAEF,eAAO,MAAM,IAAI,sEAShB,CAAC;AAEF,eAAO,MAAM,mBAAmB;cAA0B,OAAO;SA0BhE,CAAC;AACF,eAAO,MAAM,aAAa;cAA0B,OAAO;SAiB1D,CAAC;AACF,eAAO,MAAM,eAAe;YAClB,MAAM;eACH,OAAO;gBACN,OAAO;SAwBpB,CAAC;AAEF,eAAO,MAAM,QAAQ;eACR,OAAO;YACV,OAAO;gBACH,OAAO;eACR,OAAO;SAuFnB,CAAC"}
@@ -13,4 +13,5 @@ export interface FileViewAvatarProps {
13
13
  onRemove?: () => void;
14
14
  description?: ReactNode;
15
15
  }
16
+ export type PreviewableMimeType = 'image/png' | 'image/gif' | 'image/jpeg' | 'image/svg+xml' | 'text/csv';
16
17
  //# sourceMappingURL=FileViewAvatar.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileViewAvatar.types.d.ts","sourceRoot":"","sources":["../../../src/AvatarUploader/FileViewAvatar/FileViewAvatar.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,iBAAiB,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB"}
1
+ {"version":3,"file":"FileViewAvatar.types.d.ts","sourceRoot":"","sources":["../../../src/AvatarUploader/FileViewAvatar/FileViewAvatar.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,iBAAiB,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AAED,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,WAAW,GACX,YAAY,GACZ,eAAe,GACf,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type PreviewableMimeType } from './FileViewAvatar.types';
2
+ export declare const isPreviewableMimeType: (mimeType: string) => mimeType is PreviewableMimeType;
3
+ //# sourceMappingURL=FileViewAvatar.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileViewAvatar.util.d.ts","sourceRoot":"","sources":["../../../src/AvatarUploader/FileViewAvatar/FileViewAvatar.util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,KACf,QAAQ,IAAI,mBAEd,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { previewableMimeTypes } from './FileViewAvatar.const';
2
+ export var isPreviewableMimeType = function isPreviewableMimeType(mimeType) {
3
+ return previewableMimeTypes.includes(mimeType);
4
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../src/FileUploader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AASrD,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAehF,QAAA,MAAM,YAAY,gJAgBf,iBAAiB,sBAqKnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../src/FileUploader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AASrD,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAehF,QAAA,MAAM,YAAY,GAAI,6IAgBnB,iBAAiB,sBAqKnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,44 +1,43 @@
1
- /// <reference types="react" />
2
1
  import Button from '@synerise/ds-button';
3
2
  export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
4
3
  export declare const Description: import("styled-components").StyledComponent<({ size, className, children, ellipsis, }: {
5
- size?: import("@synerise/ds-typography").TextSize | undefined;
6
- ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
4
+ size?: import("@synerise/ds-typography").TextSize;
5
+ ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps;
7
6
  children?: import("react").ReactNode;
8
- className?: string | undefined;
9
- }) => import("react").JSX.Element, any, {
10
- hasError?: boolean | undefined;
7
+ className?: string;
8
+ }) => React.JSX.Element, any, {
9
+ hasError?: boolean;
11
10
  }, never>;
12
11
  export declare const DropAreaContainer: import("styled-components").StyledComponent<"div", any, {
13
12
  canUploadMore: boolean;
14
13
  }, never>;
15
14
  export declare const DropAreaLabel: import("styled-components").StyledComponent<({ size, className, children, ellipsis, }: {
16
- size?: import("@synerise/ds-typography").TextSize | undefined;
17
- ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
15
+ size?: import("@synerise/ds-typography").TextSize;
16
+ ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps;
18
17
  children?: import("react").ReactNode;
19
- className?: string | undefined;
20
- }) => import("react").JSX.Element, any, {}, never>;
18
+ className?: string;
19
+ }) => React.JSX.Element, any, {}, never>;
21
20
  export declare const LargeDropAreaLabel: import("styled-components").StyledComponent<"label", any, {}, never>;
22
21
  export declare const LargeDropAreaDescription: import("styled-components").StyledComponent<({ size, className, children, ellipsis, }: {
23
- size?: import("@synerise/ds-typography").TextSize | undefined;
24
- ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
22
+ size?: import("@synerise/ds-typography").TextSize;
23
+ ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps;
25
24
  children?: import("react").ReactNode;
26
- className?: string | undefined;
27
- }) => import("react").JSX.Element, any, {}, never>;
25
+ className?: string;
26
+ }) => React.JSX.Element, any, {}, never>;
28
27
  export declare const DropAreaButton: import("styled-components").StyledComponent<"button", any, {
29
- isDropping?: boolean | undefined;
30
- hasError?: boolean | undefined;
28
+ isDropping?: boolean;
29
+ hasError?: boolean;
31
30
  mode: string;
32
31
  pressed: boolean;
33
32
  filesLength: number;
34
33
  hidden: boolean;
35
34
  }, never>;
36
35
  export declare const ErrorMessage: import("styled-components").StyledComponent<({ size, className, children, ellipsis, }: {
37
- size?: import("@synerise/ds-typography").TextSize | undefined;
38
- ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
36
+ size?: import("@synerise/ds-typography").TextSize;
37
+ ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps;
39
38
  children?: import("react").ReactNode;
40
- className?: string | undefined;
41
- }) => import("react").JSX.Element, any, {}, never>;
39
+ className?: string;
40
+ }) => React.JSX.Element, any, {}, never>;
42
41
  export declare const Label: import("styled-components").StyledComponent<"label", any, {}, never>;
43
42
  export declare const UploadButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
44
43
  //# sourceMappingURL=FileUploader.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploader.styles.d.ts","sourceRoot":"","sources":["../src/FileUploader.styles.ts"],"names":[],"mappings":";AAEA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAKzC,eAAO,MAAM,SAAS,oEAErB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;SAMvB,CAAC;AAEF,eAAO,MAAM,iBAAiB;mBAA+B,OAAO;SAGnE,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;kDAKzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,sEAO9B,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;kDAMpC,CAAC;AAEF,eAAO,MAAM,cAAc;;;UAGnB,MAAM;aACH,OAAO;iBACH,MAAM;YACX,OAAO;SAyGhB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;kDAMxB,CAAC;AAEF,eAAO,MAAM,KAAK,sEAWjB,CAAC;AAEF,eAAO,MAAM,YAAY,4EAAmB,CAAC"}
1
+ {"version":3,"file":"FileUploader.styles.d.ts","sourceRoot":"","sources":["../src/FileUploader.styles.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAKzC,eAAO,MAAM,SAAS,oEAErB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;eAA6B,OAAO;SAM3D,CAAC;AAEF,eAAO,MAAM,iBAAiB;mBAA+B,OAAO;SAGnE,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;wCAKzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,sEAO9B,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;wCAMpC,CAAC;AAEF,eAAO,MAAM,cAAc;iBACZ,OAAO;eACT,OAAO;UACZ,MAAM;aACH,OAAO;iBACH,MAAM;YACX,OAAO;SAyGhB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;wCAMxB,CAAC;AAEF,eAAO,MAAM,KAAK,sEAWjB,CAAC;AAEF,eAAO,MAAM,YAAY,4EAAmB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export declare const isPreviewableMimeType: (type: string) => type is FileType;
3
+ type FileType = 'image/png' | 'image/gif' | 'image/jpeg' | 'image/svg+xml' | 'text/plain' | 'text/html' | 'video/quicktime' | 'application/pdf' | 'application/zip' | 'audio/mpeg' | 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.presentationml.presentation' | 'text/csv';
4
+ export declare const previewableMimeTypes: FileType[];
5
+ export declare const ICON_MAP: Record<FileType, React.ReactNode>;
6
+ export {};
7
+ //# sourceMappingURL=FileView.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileView.const.d.ts","sourceRoot":"","sources":["../../src/FileView/FileView.const.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,IAAI,IAAI,QAE5D,CAAC;AAEF,KAAK,QAAQ,GACT,WAAW,GACX,WAAW,GACX,YAAY,GACZ,eAAe,GACf,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,YAAY,GACZ,0BAA0B,GAC1B,2EAA2E,GAC3E,UAAU,CAAC;AAEf,eAAO,MAAM,oBAAoB,EAAE,QAAQ,EAc1C,CAAC;AACF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAgBtD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { FileTypeHtml, FileTypeImage, FileTypeMp3, FileTypePdf, FileTypePptx, FileTypeSvg, FileTypeTxt, FileTypeVideo, FileTypeXls, FileTypeZip } from '@synerise/ds-icon';
3
+ export var isPreviewableMimeType = function isPreviewableMimeType(type) {
4
+ return previewableMimeTypes.includes(type);
5
+ };
6
+ export var previewableMimeTypes = ['image/png', 'image/gif', 'image/jpeg', 'image/svg+xml', 'text/plain', 'text/html', 'video/quicktime', 'application/pdf', 'application/zip', 'audio/mpeg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'text/csv'];
7
+ export var ICON_MAP = {
8
+ 'image/png': /*#__PURE__*/React.createElement(FileTypeImage, null),
9
+ 'image/gif': /*#__PURE__*/React.createElement(FileTypePdf, null),
10
+ 'image/jpeg': /*#__PURE__*/React.createElement(FileTypeImage, null),
11
+ 'image/svg+xml': /*#__PURE__*/React.createElement(FileTypeSvg, null),
12
+ 'application/pdf': /*#__PURE__*/React.createElement(FileTypePdf, null),
13
+ 'application/zip': /*#__PURE__*/React.createElement(FileTypeZip, null),
14
+ 'text/plain': /*#__PURE__*/React.createElement(FileTypeTxt, null),
15
+ 'text/html': /*#__PURE__*/React.createElement(FileTypeHtml, null),
16
+ 'video/quicktime': /*#__PURE__*/React.createElement(FileTypeVideo, null),
17
+ 'audio/mpeg': /*#__PURE__*/React.createElement(FileTypeMp3, null),
18
+ 'application/vnd.ms-excel': /*#__PURE__*/React.createElement(FileTypeXls, null),
19
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation': /*#__PURE__*/React.createElement(FileTypePptx, null),
20
+ 'text/csv': /*#__PURE__*/React.createElement(FileTypeTxt, null)
21
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"FileView.d.ts","sourceRoot":"","sources":["../../src/FileView/FileView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AA0BxC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAmCtD,QAAA,MAAM,QAAQ,mEAOX,aAAa,sBAsKf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"FileView.d.ts","sourceRoot":"","sources":["../../src/FileView/FileView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,QAAA,MAAM,QAAQ,GAAI,gEAOf,aAAa,sBAsKf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -4,26 +4,11 @@ import React, { useState } from 'react';
4
4
  import { FormattedMessage } from 'react-intl';
5
5
  import Button from '@synerise/ds-button';
6
6
  import { theme } from '@synerise/ds-core';
7
- import Icon, { Check3M, Close3M, FileM, FileTypeHtml, FileTypeImage, FileTypeMp3, FileTypePdf, FileTypePptx, FileTypeSvg, FileTypeTxt, FileTypeVideo, FileTypeXls, FileTypeZip, RepeatM, WarningFillM } from '@synerise/ds-icon';
7
+ import Icon, { Check3M, Close3M, FileM, RepeatM, WarningFillM } from '@synerise/ds-icon';
8
8
  import ProgressBar from '@synerise/ds-progress-bar';
9
9
  import Tooltip from '@synerise/ds-tooltip';
10
+ import { ICON_MAP, isPreviewableMimeType } from './FileView.const';
10
11
  import * as S from './FileView.styles';
11
- var previewableMimeTypes = ['image/png', 'image/gif', 'image/jpeg', 'image/svg+xml', 'text/plain', 'text/html', 'video/quicktime', 'application/pdf', 'application/zip', 'audio/mpeg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'text/csv'];
12
- var mapperOfIcons = {
13
- 'image/png': /*#__PURE__*/React.createElement(FileTypeImage, null),
14
- 'image/gif': /*#__PURE__*/React.createElement(FileTypePdf, null),
15
- 'image/jpeg': /*#__PURE__*/React.createElement(FileTypeImage, null),
16
- 'image/svg+xml': /*#__PURE__*/React.createElement(FileTypeSvg, null),
17
- 'application/pdf': /*#__PURE__*/React.createElement(FileTypePdf, null),
18
- 'application/zip': /*#__PURE__*/React.createElement(FileTypeZip, null),
19
- 'text/plain': /*#__PURE__*/React.createElement(FileTypeTxt, null),
20
- 'text/html': /*#__PURE__*/React.createElement(FileTypeHtml, null),
21
- 'video/quicktime': /*#__PURE__*/React.createElement(FileTypeVideo, null),
22
- 'audio/mpeg': /*#__PURE__*/React.createElement(FileTypeMp3, null),
23
- 'application/vnd.ms-excel': /*#__PURE__*/React.createElement(FileTypeXls, null),
24
- 'application/vnd.openxmlformats-officedocument.presentationml.presentation': /*#__PURE__*/React.createElement(FileTypePptx, null),
25
- 'text/csv': /*#__PURE__*/React.createElement(FileTypeTxt, null)
26
- };
27
12
  var FileView = function FileView(_ref) {
28
13
  var data = _ref.data,
29
14
  texts = _ref.texts,
@@ -94,8 +79,8 @@ var FileView = function FileView(_ref) {
94
79
  error: hasError,
95
80
  removable: removable,
96
81
  type: "button"
97
- }, previewableMimeTypes.indexOf(file.type) > -1 ? /*#__PURE__*/React.createElement(S.PreviewImage, null, /*#__PURE__*/React.createElement(Icon, {
98
- component: mapperOfIcons[file.type],
82
+ }, isPreviewableMimeType(file.type) ? /*#__PURE__*/React.createElement(S.PreviewImage, null, /*#__PURE__*/React.createElement(Icon, {
83
+ component: ICON_MAP[file.type],
99
84
  size: 40
100
85
  })) : /*#__PURE__*/React.createElement(S.PlaceholderImage, null, /*#__PURE__*/React.createElement(Icon, {
101
86
  component: /*#__PURE__*/React.createElement(FileM, null),
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const PreviewImage: import("styled-components").StyledComponent<"div", any, {}, never>;
3
2
  export declare const PlaceholderImage: import("styled-components").StyledComponent<"div", any, {}, never>;
4
3
  export declare const Info: import("styled-components").StyledComponent<"div", any, {
@@ -11,14 +10,14 @@ export declare const SizeOrError: import("styled-components").StyledComponent<im
11
10
  export declare const RemoveWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
12
11
  export declare const CheckButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
13
12
  export declare const RemoveButtonWrapper: import("styled-components").StyledComponent<"div", any, {
14
- pressed?: boolean | undefined;
13
+ pressed?: boolean;
15
14
  }, never>;
16
15
  export declare const FileViewContainer: import("styled-components").StyledComponent<"button", any, {
17
- disabled?: boolean | undefined;
18
- error?: boolean | undefined;
19
- removable?: boolean | undefined;
20
- success?: boolean | undefined;
21
- progress?: boolean | undefined;
22
- pressed?: boolean | undefined;
16
+ disabled?: boolean;
17
+ error?: boolean;
18
+ removable?: boolean;
19
+ success?: boolean;
20
+ progress?: boolean;
21
+ pressed?: boolean;
23
22
  }, never>;
24
23
  //# sourceMappingURL=FileView.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileView.styles.d.ts","sourceRoot":"","sources":["../../src/FileView/FileView.styles.ts"],"names":[],"mappings":";AAMA,eAAO,MAAM,YAAY,oEAKxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,oEAU5B,CAAC;AAEF,eAAO,MAAM,IAAI;cAA0B,OAAO;SAIjD,CAAC;AAEF,eAAO,MAAM,kBAAkB,qIAQ9B,CAAC;AACF,eAAO,MAAM,UAAU,oEAKtB,CAAC;AAEF,eAAO,MAAM,IAAI,sEAWhB,CAAC;AAEF,eAAO,MAAM,WAAW,uMAIvB,CAAC;AACF,eAAO,MAAM,aAAa,oEAyBzB,CAAC;AACF,eAAO,MAAM,kBAAkB,oEAsB9B,CAAC;AACF,eAAO,MAAM,mBAAmB;;SA0B/B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;SA2F7B,CAAC"}
1
+ {"version":3,"file":"FileView.styles.d.ts","sourceRoot":"","sources":["../../src/FileView/FileView.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,oEAKxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,oEAU5B,CAAC;AAEF,eAAO,MAAM,IAAI;cAA0B,OAAO;SAIjD,CAAC;AAEF,eAAO,MAAM,kBAAkB,qIAQ9B,CAAC;AACF,eAAO,MAAM,UAAU,oEAKtB,CAAC;AAEF,eAAO,MAAM,IAAI,sEAWhB,CAAC;AAEF,eAAO,MAAM,WAAW,uMAIvB,CAAC;AACF,eAAO,MAAM,aAAa,oEAyBzB,CAAC;AACF,eAAO,MAAM,kBAAkB,oEAsB9B,CAAC;AACF,eAAO,MAAM,mBAAmB;cAA0B,OAAO;SA0BhE,CAAC;AAEF,eAAO,MAAM,iBAAiB;eACjB,OAAO;YACV,OAAO;gBACH,OAAO;cACT,OAAO;eACN,OAAO;cACR,OAAO;SAqFlB,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
3
2
  export declare const UploaderContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
4
3
  export declare const DropAreaContainer: import("styled-components").StyledComponent<"div", any, {
@@ -8,15 +7,15 @@ export declare const DropAreaLabel: import("styled-components").StyledComponent<
8
7
  export declare const LargeDropAreaLabel: import("styled-components").StyledComponent<"label", any, {}, never>;
9
8
  export declare const LargeDropAreaDescription: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/lib/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
10
9
  export declare const DropAreaButton: import("styled-components").StyledComponent<"button", any, {
11
- isDropping?: boolean | undefined;
12
- hasError?: boolean | undefined;
10
+ isDropping?: boolean;
11
+ hasError?: boolean;
13
12
  mode: string;
14
13
  pressed: boolean;
15
14
  filesLength: number;
16
15
  }, never>;
17
16
  export declare const ErrorMessage: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/lib/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
18
17
  export declare const Description: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/lib/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {
19
- hasError?: boolean | undefined;
18
+ hasError?: boolean;
20
19
  }, never>;
21
20
  export declare const Label: import("styled-components").StyledComponent<"label", any, {}, never>;
22
21
  //# sourceMappingURL=ItemUploader.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ItemUploader.styles.d.ts","sourceRoot":"","sources":["../../src/ItemUploader/ItemUploader.styles.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,SAAS,oEAErB,CAAC;AACF,eAAO,MAAM,iBAAiB,oEAE7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;mBAA+B,OAAO;SAGnE,CAAC;AAEF,eAAO,MAAM,aAAa,uMAGzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,sEAO9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,uMAMpC,CAAC;AAEF,eAAO,MAAM,cAAc;;;UAGnB,MAAM;aACH,OAAO;iBACH,MAAM;SAsGpB,CAAC;AAEF,eAAO,MAAM,YAAY,uMAMxB,CAAC;AACF,eAAO,MAAM,WAAW;;SAMvB,CAAC;AAEF,eAAO,MAAM,KAAK,sEAWjB,CAAC"}
1
+ {"version":3,"file":"ItemUploader.styles.d.ts","sourceRoot":"","sources":["../../src/ItemUploader/ItemUploader.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,oEAErB,CAAC;AACF,eAAO,MAAM,iBAAiB,oEAE7B,CAAC;AAEF,eAAO,MAAM,iBAAiB;mBAA+B,OAAO;SAGnE,CAAC;AAEF,eAAO,MAAM,aAAa,uMAGzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,sEAO9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,uMAMpC,CAAC;AAEF,eAAO,MAAM,cAAc;iBACZ,OAAO;eACT,OAAO;UACZ,MAAM;aACH,OAAO;iBACH,MAAM;SAsGpB,CAAC;AAEF,eAAO,MAAM,YAAY,uMAMxB,CAAC;AACF,eAAO,MAAM,WAAW;eAAwC,OAAO;SAMtE,CAAC;AAEF,eAAO,MAAM,KAAK,sEAWjB,CAAC"}
@@ -0,0 +1,6 @@
1
+ type PreviewableMimeType = 'image/png' | 'image/gif' | 'image/jpeg' | 'image/svg+xml' | 'text/csv';
2
+ export declare const isPreviewableMimeType: (mimeType: string) => mimeType is PreviewableMimeType;
3
+ export declare const previewableMimeTypes: PreviewableMimeType[];
4
+ export declare const ICON_MAP: Record<PreviewableMimeType, JSX.Element>;
5
+ export {};
6
+ //# sourceMappingURL=FileViewItem.const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileViewItem.const.d.ts","sourceRoot":"","sources":["../../../src/ItemUploader/UploaderButton/FileViewItem.const.tsx"],"names":[],"mappings":"AAIA,KAAK,mBAAmB,GACpB,WAAW,GACX,WAAW,GACX,YAAY,GACZ,eAAe,GACf,UAAU,CAAC;AAEf,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,KACf,QAAQ,IAAI,mBAEd,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,mBAAmB,EAMrD,CAAC;AACF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,mBAAmB,EAAE,GAAG,CAAC,OAAO,CAM7D,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { FileTypeTextM } from '@synerise/ds-icon';
3
+ export var isPreviewableMimeType = function isPreviewableMimeType(mimeType) {
4
+ return previewableMimeTypes.includes(mimeType);
5
+ };
6
+ export var previewableMimeTypes = ['image/png', 'image/gif', 'image/jpeg', 'image/svg+xml', 'text/csv'];
7
+ export var ICON_MAP = {
8
+ 'image/png': /*#__PURE__*/React.createElement(FileTypeTextM, null),
9
+ 'image/gif': /*#__PURE__*/React.createElement(FileTypeTextM, null),
10
+ 'image/jpeg': /*#__PURE__*/React.createElement(FileTypeTextM, null),
11
+ 'image/svg+xml': /*#__PURE__*/React.createElement(FileTypeTextM, null),
12
+ 'text/csv': /*#__PURE__*/React.createElement(FileTypeTextM, null)
13
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"FileViewItem.d.ts","sourceRoot":"","sources":["../../../src/ItemUploader/UploaderButton/FileViewItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAWxC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAkBpG,QAAA,MAAM,YAAY,0CAKf,mBAAmB,sBA+ErB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"FileViewItem.d.ts","sourceRoot":"","sources":["../../../src/ItemUploader/UploaderButton/FileViewItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAIpG,QAAA,MAAM,YAAY,GAAI,uCAKnB,mBAAmB,sBA+ErB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,17 +1,10 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useState } from 'react';
3
3
  import { FormattedMessage } from 'react-intl';
4
- import Icon, { Close3M, FileM, FileTypeTextM, RepeatM } from '@synerise/ds-icon';
4
+ import Icon, { Close3M, FileM, RepeatM } from '@synerise/ds-icon';
5
5
  import Tooltip from '@synerise/ds-tooltip';
6
+ import { ICON_MAP, isPreviewableMimeType } from './FileViewItem.const';
6
7
  import * as S from './FileViewItem.styles';
7
- var previewableMimeTypes = ['image/png', 'image/gif', 'image/jpeg', 'image/svg+xml', 'text/csv'];
8
- var mapperOfIcons = {
9
- 'image/png': /*#__PURE__*/React.createElement(FileTypeTextM, null),
10
- 'image/gif': /*#__PURE__*/React.createElement(FileTypeTextM, null),
11
- 'image/jpeg': /*#__PURE__*/React.createElement(FileTypeTextM, null),
12
- 'image/svg+xml': /*#__PURE__*/React.createElement(FileTypeTextM, null),
13
- 'text/csv': /*#__PURE__*/React.createElement(FileTypeTextM, null)
14
- };
15
8
  var FileViewItem = function FileViewItem(_ref) {
16
9
  var data = _ref.data,
17
10
  texts = _ref.texts,
@@ -51,8 +44,8 @@ var FileViewItem = function FileViewItem(_ref) {
51
44
  error: hasError,
52
45
  removable: removable,
53
46
  type: "button"
54
- }, previewableMimeTypes.indexOf(file.type) > -1 ? /*#__PURE__*/React.createElement(S.PreviewImage, null, /*#__PURE__*/React.createElement(Icon, {
55
- component: mapperOfIcons[file.type],
47
+ }, isPreviewableMimeType(file.type) ? /*#__PURE__*/React.createElement(S.PreviewImage, null, /*#__PURE__*/React.createElement(Icon, {
48
+ component: ICON_MAP[file.type],
56
49
  size: 20
57
50
  })) : /*#__PURE__*/React.createElement(S.PlaceholderImage, null, /*#__PURE__*/React.createElement(Icon, {
58
51
  component: /*#__PURE__*/React.createElement(FileM, null),
@@ -3,7 +3,7 @@ export declare const RepeatIcon: import("styled-components").StyledComponent<"di
3
3
  export declare const LoaderIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
4
4
  export declare const spinnerAnimation: import("styled-components").Keyframes;
5
5
  export declare const SmallLoader: import("styled-components").StyledComponent<"div", any, {
6
- size?: "S" | "M" | "L" | undefined;
6
+ size?: keyof typeof import("@synerise/ds-loader/dist/Loader.types").LoaderSize;
7
7
  color: string;
8
8
  }, never>;
9
9
  export declare const PlaceholderImage: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -11,12 +11,12 @@ export declare const FileViewContainer: import("styled-components").StyledCompon
11
11
  export declare const Info: import("styled-components").StyledComponent<"div", any, {}, never>;
12
12
  export declare const Name: import("styled-components").StyledComponent<"label", any, {}, never>;
13
13
  export declare const RemoveButtonWrapper: import("styled-components").StyledComponent<"div", any, {
14
- pressed?: boolean | undefined;
14
+ pressed?: boolean;
15
15
  }, never>;
16
16
  export declare const FileView: import("styled-components").StyledComponent<"button", any, {
17
- disabled?: boolean | undefined;
18
- error?: boolean | undefined;
19
- removable?: boolean | undefined;
20
- progress?: boolean | undefined;
17
+ disabled?: boolean;
18
+ error?: boolean;
19
+ removable?: boolean;
20
+ progress?: boolean;
21
21
  }, never>;
22
22
  //# sourceMappingURL=FileViewItem.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileViewItem.styles.d.ts","sourceRoot":"","sources":["../../../src/ItemUploader/UploaderButton/FileViewItem.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,oEAKxB,CAAC;AACF,eAAO,MAAM,UAAU,oEAOtB,CAAC;AACF,eAAO,MAAM,UAAU,oEAEtB,CAAC;AACF,eAAO,MAAM,gBAAgB,uCAQ5B,CAAC;AACF,eAAO,MAAM,WAAW;;;SAKvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,oEAU5B,CAAC;AACF,eAAO,MAAM,iBAAiB,oEAE7B,CAAC;AAEF,eAAO,MAAM,IAAI,oEAIhB,CAAC;AAEF,eAAO,MAAM,IAAI,sEAShB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;SA0B/B,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;SA2FpB,CAAC"}
1
+ {"version":3,"file":"FileViewItem.styles.d.ts","sourceRoot":"","sources":["../../../src/ItemUploader/UploaderButton/FileViewItem.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,oEAKxB,CAAC;AACF,eAAO,MAAM,UAAU,oEAOtB,CAAC;AACF,eAAO,MAAM,UAAU,oEAEtB,CAAC;AACF,eAAO,MAAM,gBAAgB,uCAQ5B,CAAC;AACF,eAAO,MAAM,WAAW;;;SAKvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,oEAU5B,CAAC;AACF,eAAO,MAAM,iBAAiB,oEAE7B,CAAC;AAEF,eAAO,MAAM,IAAI,oEAIhB,CAAC;AAEF,eAAO,MAAM,IAAI,sEAShB,CAAC;AAEF,eAAO,MAAM,mBAAmB;cAA0B,OAAO;SA0BhE,CAAC;AAEF,eAAO,MAAM,QAAQ;eACR,OAAO;YACV,OAAO;gBACH,OAAO;eACR,OAAO;SAuFnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-file-uploader",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "FileUploader UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,14 +34,14 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-button": "^1.4.4",
38
- "@synerise/ds-icon": "^1.6.0",
39
- "@synerise/ds-loader": "^1.0.6",
40
- "@synerise/ds-popconfirm": "^1.0.16",
41
- "@synerise/ds-progress-bar": "^1.1.10",
42
- "@synerise/ds-tooltip": "^1.1.13",
43
- "@synerise/ds-typography": "^1.0.15",
44
- "@synerise/ds-utils": "^1.3.1",
37
+ "@synerise/ds-button": "^1.4.6",
38
+ "@synerise/ds-icon": "^1.6.2",
39
+ "@synerise/ds-loader": "^1.0.7",
40
+ "@synerise/ds-popconfirm": "^1.0.18",
41
+ "@synerise/ds-progress-bar": "^1.1.12",
42
+ "@synerise/ds-tooltip": "^1.1.15",
43
+ "@synerise/ds-typography": "^1.0.17",
44
+ "@synerise/ds-utils": "^1.4.0",
45
45
  "filesize.js": "^2.0.0",
46
46
  "react-dropzone": "^10.2.1"
47
47
  },
@@ -51,5 +51,5 @@
51
51
  "react-intl": ">=3.12.0 <= 6.8",
52
52
  "styled-components": "^5.3.3"
53
53
  },
54
- "gitHead": "f7c362a4f370d86b51df9aba9e91ac8f7fe4ed8f"
54
+ "gitHead": "b35b1875727156fe9f5b3bad55aed5ca447c8c8d"
55
55
  }