@reykjavik/hanna-react 0.10.88 → 0.10.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,9 +4,9 @@
4
4
 
5
5
  - ... <!-- Add new lines here. -->
6
6
 
7
- ## 0.10.88
7
+ ## 0.10.88 – 0.10.89
8
8
 
9
- _2023-05-24_
9
+ _2023-05-25_
10
10
 
11
11
  - feat(ts): Export utility type `HtmlProps` from `utils` module — for adding
12
12
  HTML attributes (including `data-*`) to React components.
package/FileInput.js CHANGED
@@ -7,7 +7,7 @@ const react_dropzone_1 = require("react-dropzone"); // https://react-dropzone.js
7
7
  const hooks_1 = require("@hugsmidjan/react/hooks");
8
8
  const getBemClass_1 = tslib_1.__importDefault(require("@hugsmidjan/react/utils/getBemClass"));
9
9
  const i18n_1 = require("@reykjavik/hanna-utils/i18n");
10
- const _FileInput_utils_1 = require("./FileInput/_FileInput.utils");
10
+ const _FileInput_utils_js_1 = require("./FileInput/_FileInput.utils.js");
11
11
  const _FileInputFileList_js_1 = require("./FileInput/_FileInputFileList.js");
12
12
  const FormField_js_1 = tslib_1.__importDefault(require("./FormField.js"));
13
13
  const defaultRemoveFileText = {
@@ -40,7 +40,7 @@ const FileInput = (props) => {
40
40
  const { getRootProps, getInputProps, isDragReject, inputRef } = (0, react_dropzone_1.useDropzone)({
41
41
  onDrop: (acceptedFiles) => {
42
42
  acceptedFiles = acceptedFiles.map((file) => {
43
- (0, _FileInput_utils_1.addPreview)(file);
43
+ (0, _FileInput_utils_js_1.addPreview)(file);
44
44
  return file;
45
45
  });
46
46
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
@@ -67,14 +67,14 @@ const FileInput = (props) => {
67
67
  });
68
68
  // Synchronoyusly add previews on incoming files
69
69
  // (NOTE: `addPreview` ignores files that already have preview.)
70
- files.forEach(_FileInput_utils_1.addPreview);
70
+ files.forEach(_FileInput_utils_js_1.addPreview);
71
71
  (0, react_1.useEffect)(() => {
72
72
  if (fileInput.current) {
73
73
  fileInput.current.files = arrayToFileList(files);
74
74
  }
75
75
  return () => {
76
76
  // Make sure to revoke the data uris on unmount to avoid memory leaks
77
- files.forEach(_FileInput_utils_1.releasePreview);
77
+ files.forEach(_FileInput_utils_js_1.releasePreview);
78
78
  };
79
79
  }, [files]);
80
80
  const removeFile = (removeTarget) => {
@@ -85,7 +85,7 @@ const FileInput = (props) => {
85
85
  return true;
86
86
  }
87
87
  deleted.push(file);
88
- (0, _FileInput_utils_1.releasePreview)(file);
88
+ (0, _FileInput_utils_js_1.releasePreview)(file);
89
89
  return false;
90
90
  });
91
91
  if (fileInput.current) {
@@ -94,7 +94,7 @@ const FileInput = (props) => {
94
94
  onFilesUpdated(fileList, { deleted });
95
95
  };
96
96
  const addFiles = (added) => {
97
- const { fileList, diff } = (0, _FileInput_utils_1.getFileListUpdate)(files, added, !multiple);
97
+ const { fileList, diff } = (0, _FileInput_utils_js_1.getFileListUpdate)(files, added, !multiple);
98
98
  if (fileInput.current) {
99
99
  fileInput.current.files = arrayToFileList(fileList);
100
100
  }
@@ -126,7 +126,7 @@ const FileInput = (props) => {
126
126
  showImagePreviews,
127
127
  removeFileText,
128
128
  removeFile,
129
- formatBytes: _FileInput_utils_1.formatBytes,
129
+ formatBytes: _FileInput_utils_js_1.formatBytes,
130
130
  })))));
131
131
  } }));
132
132
  };
package/esm/FileInput.js CHANGED
@@ -4,7 +4,7 @@ import { useDropzone } from 'react-dropzone'; // https://react-dropzone.js.org/#
4
4
  import { useDomid } from '@hugsmidjan/react/hooks';
5
5
  import getBemClass from '@hugsmidjan/react/utils/getBemClass';
6
6
  import { DEFAULT_LANG } from '@reykjavik/hanna-utils/i18n';
7
- import { addPreview, formatBytes, getFileListUpdate, releasePreview, } from './FileInput/_FileInput.utils';
7
+ import { addPreview, formatBytes, getFileListUpdate, releasePreview, } from './FileInput/_FileInput.utils.js';
8
8
  import { DefaultFileList } from './FileInput/_FileInputFileList.js';
9
9
  import FormField from './FormField.js';
10
10
  const defaultRemoveFileText = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reykjavik/hanna-react",
3
- "version": "0.10.88",
3
+ "version": "0.10.89",
4
4
  "author": "Reykjavík (http://www.reykjavik.is)",
5
5
  "contributors": [
6
6
  "Hugsmiðjan ehf (http://www.hugsmidjan.is)",