@blaze-cms/plugin-media-ui 0.125.0-core-styles.0 → 0.125.0-f-admin-updates.3
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 +25 -2
- package/lib/components/CardMedia/CardMedia.js +29 -91
- package/lib/components/CardMedia/CardMedia.js.map +1 -1
- package/lib/components/CardMedia/index.js +0 -4
- package/lib/components/CardMedia/index.js.map +1 -1
- package/lib/components/EditMediaFile/EditMediaFile.js +29 -78
- package/lib/components/EditMediaFile/EditMediaFile.js.map +1 -1
- package/lib/components/EditMediaFile/EditMediaFilePage.js +8 -51
- package/lib/components/EditMediaFile/EditMediaFilePage.js.map +1 -1
- package/lib/components/EditMediaFile/index.js +0 -4
- package/lib/components/EditMediaFile/index.js.map +1 -1
- package/lib/components/EditorAdapter/EditorAdapter.js +6 -15
- package/lib/components/EditorAdapter/EditorAdapter.js.map +1 -1
- package/lib/components/EditorAdapter/index.js +0 -4
- package/lib/components/EditorAdapter/index.js.map +1 -1
- package/lib/components/FileList/FilesListContext/index.js +0 -5
- package/lib/components/FileList/FilesListContext/index.js.map +1 -1
- package/lib/components/FileList/FilesListProvider/index.js +11 -22
- package/lib/components/FileList/FilesListProvider/index.js.map +1 -1
- package/lib/components/FileList/useFileList/index.js +0 -6
- package/lib/components/FileList/useFileList/index.js.map +1 -1
- package/lib/components/FileList/useGetFiles/getFiles.js +3 -22
- package/lib/components/FileList/useGetFiles/getFiles.js.map +1 -1
- package/lib/components/FileList/useGetFiles/index.js +0 -4
- package/lib/components/FileList/useGetFiles/index.js.map +1 -1
- package/lib/components/FileList/useGetFiles/useGetFiles.js +40 -77
- package/lib/components/FileList/useGetFiles/useGetFiles.js.map +1 -1
- package/lib/components/FileList/useGetFilesList/getCounters.js +0 -11
- package/lib/components/FileList/useGetFilesList/getCounters.js.map +1 -1
- package/lib/components/FileList/useGetFilesList/index.js +0 -4
- package/lib/components/FileList/useGetFilesList/index.js.map +1 -1
- package/lib/components/FileList/useGetFilesList/useGetFilesList.js +45 -96
- package/lib/components/FileList/useGetFilesList/useGetFilesList.js.map +1 -1
- package/lib/components/FilePreview/Actions/index.js +4 -28
- package/lib/components/FilePreview/Actions/index.js.map +1 -1
- package/lib/components/FilePreview/Image/Image.js +2 -9
- package/lib/components/FilePreview/Image/Image.js.map +1 -1
- package/lib/components/FilePreview/Image/RawImage.js +2 -10
- package/lib/components/FilePreview/Image/RawImage.js.map +1 -1
- package/lib/components/FilePreview/Image/imageSchema.js +0 -1
- package/lib/components/FilePreview/Image/imageSchema.js.map +1 -1
- package/lib/components/FilePreview/Image/index.js +0 -5
- package/lib/components/FilePreview/Image/index.js.map +1 -1
- package/lib/components/FilePreview/PDF/PDF.js +3 -10
- package/lib/components/FilePreview/PDF/PDF.js.map +1 -1
- package/lib/components/FilePreview/PDF/RawPDF.js +3 -11
- package/lib/components/FilePreview/PDF/RawPDF.js.map +1 -1
- package/lib/components/FilePreview/PDF/index.js +0 -5
- package/lib/components/FilePreview/PDF/index.js.map +1 -1
- package/lib/components/FilePreview/PDF/schema.js +0 -1
- package/lib/components/FilePreview/PDF/schema.js.map +1 -1
- package/lib/components/FilePreview/get-preview.js +3 -13
- package/lib/components/FilePreview/get-preview.js.map +1 -1
- package/lib/components/FilePreview/index.js +17 -46
- package/lib/components/FilePreview/index.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileList.js +9 -32
- package/lib/components/FileUploadAdapter/FileList.js.map +1 -1
- package/lib/components/FileUploadAdapter/FilePreviewList.js +1 -9
- package/lib/components/FileUploadAdapter/FilePreviewList.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileReorderList.js +2 -12
- package/lib/components/FileUploadAdapter/FileReorderList.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileReorderListItem.js +1 -8
- package/lib/components/FileUploadAdapter/FileReorderListItem.js.map +1 -1
- package/lib/components/FileUploadAdapter/FileUploadAdapter.js +32 -122
- package/lib/components/FileUploadAdapter/FileUploadAdapter.js.map +1 -1
- package/lib/components/FileUploadAdapter/index.js +0 -4
- package/lib/components/FileUploadAdapter/index.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/format-initial-value.js +1 -6
- package/lib/components/FileUploadAdapter/mappers/format-initial-value.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/get-button-text.js +1 -4
- package/lib/components/FileUploadAdapter/mappers/get-button-text.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/get-format.js +5 -15
- package/lib/components/FileUploadAdapter/mappers/get-format.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js +0 -3
- package/lib/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/index.js +0 -7
- package/lib/components/FileUploadAdapter/mappers/index.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/is-unselecting.js +0 -7
- package/lib/components/FileUploadAdapter/mappers/is-unselecting.js.map +1 -1
- package/lib/components/FileUploadAdapter/mappers/transform-to-array.js +0 -4
- package/lib/components/FileUploadAdapter/mappers/transform-to-array.js.map +1 -1
- package/lib/components/FileUploadAdapter/useLimit.js +3 -11
- package/lib/components/FileUploadAdapter/useLimit.js.map +1 -1
- package/lib/components/FileUploadModal/FileUploadModal.js +16 -63
- package/lib/components/FileUploadModal/FileUploadModal.js.map +1 -1
- package/lib/components/FileUploadModal/index.js +0 -4
- package/lib/components/FileUploadModal/index.js.map +1 -1
- package/lib/components/FilterPanel/FilterPanel.js +14 -50
- package/lib/components/FilterPanel/FilterPanel.js.map +1 -1
- package/lib/components/FilterPanel/index.js +0 -4
- package/lib/components/FilterPanel/index.js.map +1 -1
- package/lib/components/ListingContainer/Listing/Listing.js +1 -13
- package/lib/components/ListingContainer/Listing/Listing.js.map +1 -1
- package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +31 -82
- package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js.map +1 -1
- package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js +0 -4
- package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js.map +1 -1
- package/lib/components/ListingContainer/Listing/MediaListing/MediaListing.js +3 -20
- package/lib/components/ListingContainer/Listing/MediaListing/MediaListing.js.map +1 -1
- package/lib/components/ListingContainer/Listing/MediaListing/index.js +0 -4
- package/lib/components/ListingContainer/Listing/MediaListing/index.js.map +1 -1
- package/lib/components/ListingContainer/Listing/index.js +0 -4
- package/lib/components/ListingContainer/Listing/index.js.map +1 -1
- package/lib/components/ListingContainer/ListingContainer.js +23 -69
- package/lib/components/ListingContainer/ListingContainer.js.map +1 -1
- package/lib/components/ListingContainer/index.js +0 -4
- package/lib/components/ListingContainer/index.js.map +1 -1
- package/lib/components/ListingContainer/mappers/exist-previous.js +0 -5
- package/lib/components/ListingContainer/mappers/exist-previous.js.map +1 -1
- package/lib/components/ListingContainer/mappers/index.js +0 -3
- package/lib/components/ListingContainer/mappers/index.js.map +1 -1
- package/lib/constants.js +0 -1
- package/lib/constants.js.map +1 -1
- package/lib/index.js +2 -27
- package/lib/index.js.map +1 -1
- package/lib/utils/available-filters/available-filters.js +0 -1
- package/lib/utils/available-filters/available-filters.js.map +1 -1
- package/lib/utils/media-context/index.js +0 -3
- package/lib/utils/media-context/index.js.map +1 -1
- package/lib/utils/media-context/media-context.js +0 -5
- package/lib/utils/media-context/media-context.js.map +1 -1
- package/lib/utils/media-context/useMediaContext.js +0 -4
- package/lib/utils/media-context/useMediaContext.js.map +1 -1
- package/lib-es/components/CardMedia/CardMedia.js +0 -14
- package/lib-es/components/CardMedia/CardMedia.js.map +1 -1
- package/lib-es/components/CardMedia/index.js.map +1 -1
- package/lib-es/components/EditMediaFile/EditMediaFile.js +0 -11
- package/lib-es/components/EditMediaFile/EditMediaFile.js.map +1 -1
- package/lib-es/components/EditMediaFile/EditMediaFilePage.js +0 -9
- package/lib-es/components/EditMediaFile/EditMediaFilePage.js.map +1 -1
- package/lib-es/components/EditMediaFile/index.js.map +1 -1
- package/lib-es/components/EditorAdapter/EditorAdapter.js +8 -11
- package/lib-es/components/EditorAdapter/EditorAdapter.js.map +1 -1
- package/lib-es/components/EditorAdapter/index.js.map +1 -1
- package/lib-es/components/FileList/FilesListContext/index.js.map +1 -1
- package/lib-es/components/FileList/FilesListProvider/index.js +0 -2
- package/lib-es/components/FileList/FilesListProvider/index.js.map +1 -1
- package/lib-es/components/FileList/useFileList/index.js +0 -2
- package/lib-es/components/FileList/useFileList/index.js.map +1 -1
- package/lib-es/components/FileList/useGetFiles/getFiles.js +0 -6
- package/lib-es/components/FileList/useGetFiles/getFiles.js.map +1 -1
- package/lib-es/components/FileList/useGetFiles/index.js.map +1 -1
- package/lib-es/components/FileList/useGetFiles/useGetFiles.js +1 -10
- package/lib-es/components/FileList/useGetFiles/useGetFiles.js.map +1 -1
- package/lib-es/components/FileList/useGetFilesList/getCounters.js +0 -2
- package/lib-es/components/FileList/useGetFilesList/getCounters.js.map +1 -1
- package/lib-es/components/FileList/useGetFilesList/index.js.map +1 -1
- package/lib-es/components/FileList/useGetFilesList/useGetFilesList.js +0 -23
- package/lib-es/components/FileList/useGetFilesList/useGetFilesList.js.map +1 -1
- package/lib-es/components/FilePreview/Actions/index.js +0 -2
- package/lib-es/components/FilePreview/Actions/index.js.map +1 -1
- package/lib-es/components/FilePreview/Image/Image.js +0 -2
- package/lib-es/components/FilePreview/Image/Image.js.map +1 -1
- package/lib-es/components/FilePreview/Image/RawImage.js +0 -2
- package/lib-es/components/FilePreview/Image/RawImage.js.map +1 -1
- package/lib-es/components/FilePreview/Image/imageSchema.js.map +1 -1
- package/lib-es/components/FilePreview/Image/index.js.map +1 -1
- package/lib-es/components/FilePreview/PDF/PDF.js +0 -2
- package/lib-es/components/FilePreview/PDF/PDF.js.map +1 -1
- package/lib-es/components/FilePreview/PDF/RawPDF.js +0 -2
- package/lib-es/components/FilePreview/PDF/RawPDF.js.map +1 -1
- package/lib-es/components/FilePreview/PDF/index.js.map +1 -1
- package/lib-es/components/FilePreview/PDF/schema.js.map +1 -1
- package/lib-es/components/FilePreview/get-preview.js +0 -2
- package/lib-es/components/FilePreview/get-preview.js.map +1 -1
- package/lib-es/components/FilePreview/index.js +0 -9
- package/lib-es/components/FilePreview/index.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FileList.js +1 -4
- package/lib-es/components/FileUploadAdapter/FileList.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FilePreviewList.js +0 -2
- package/lib-es/components/FileUploadAdapter/FilePreviewList.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FileReorderList.js +0 -3
- package/lib-es/components/FileUploadAdapter/FileReorderList.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FileReorderListItem.js +0 -2
- package/lib-es/components/FileUploadAdapter/FileReorderListItem.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/FileUploadAdapter.js +2 -25
- package/lib-es/components/FileUploadAdapter/FileUploadAdapter.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/index.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/format-initial-value.js +0 -1
- package/lib-es/components/FileUploadAdapter/mappers/format-initial-value.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/get-button-text.js +0 -1
- package/lib-es/components/FileUploadAdapter/mappers/get-button-text.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/get-format.js +0 -1
- package/lib-es/components/FileUploadAdapter/mappers/get-format.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/index.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/is-unselecting.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/mappers/transform-to-array.js.map +1 -1
- package/lib-es/components/FileUploadAdapter/useLimit.js +0 -2
- package/lib-es/components/FileUploadAdapter/useLimit.js.map +1 -1
- package/lib-es/components/FileUploadModal/FileUploadModal.js +1 -8
- package/lib-es/components/FileUploadModal/FileUploadModal.js.map +1 -1
- package/lib-es/components/FileUploadModal/index.js.map +1 -1
- package/lib-es/components/FilterPanel/FilterPanel.js +0 -9
- package/lib-es/components/FilterPanel/FilterPanel.js.map +1 -1
- package/lib-es/components/FilterPanel/index.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/Listing.js +0 -2
- package/lib-es/components/ListingContainer/Listing/Listing.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +2 -12
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaListing.js +0 -2
- package/lib-es/components/ListingContainer/Listing/MediaListing/MediaListing.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/MediaListing/index.js.map +1 -1
- package/lib-es/components/ListingContainer/Listing/index.js.map +1 -1
- package/lib-es/components/ListingContainer/ListingContainer.js +0 -9
- package/lib-es/components/ListingContainer/ListingContainer.js.map +1 -1
- package/lib-es/components/ListingContainer/index.js.map +1 -1
- package/lib-es/components/ListingContainer/mappers/exist-previous.js +0 -1
- package/lib-es/components/ListingContainer/mappers/exist-previous.js.map +1 -1
- package/lib-es/components/ListingContainer/mappers/index.js.map +1 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/index.js +2 -6
- package/lib-es/index.js.map +1 -1
- package/lib-es/utils/available-filters/available-filters.js.map +1 -1
- package/lib-es/utils/media-context/index.js.map +1 -1
- package/lib-es/utils/media-context/media-context.js.map +1 -1
- package/lib-es/utils/media-context/useMediaContext.js +0 -2
- package/lib-es/utils/media-context/useMediaContext.js.map +1 -1
- package/package.json +5 -5
- package/src/components/FileUploadAdapter/FileUploadAdapter.js +1 -2
- package/src/components/FileUploadModal/FileUploadModal.js +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-format.js","names":["getFormat","type","filesIds","length","Array","isArray","primaryType","join"],"sources":["../../../../src/components/FileUploadAdapter/mappers/get-format.js"],"sourcesContent":["const getFormat = (type, { filesIds } = { filesIds: [] }) => {\n if (!filesIds || !filesIds.length) return null;\n\n const [primaryType] = Array.isArray(type) ? type : [type];\n if (primaryType === 'array') return filesIds || [];\n if (primaryType === 'string') return filesIds.join() || '';\n};\n\nexport { getFormat };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-format.js","names":["getFormat","type","filesIds","length","Array","isArray","primaryType","join"],"sources":["../../../../src/components/FileUploadAdapter/mappers/get-format.js"],"sourcesContent":["const getFormat = (type, { filesIds } = { filesIds: [] }) => {\n if (!filesIds || !filesIds.length) return null;\n\n const [primaryType] = Array.isArray(type) ? type : [type];\n if (primaryType === 'array') return filesIds || [];\n if (primaryType === 'string') return filesIds.join() || '';\n};\n\nexport { getFormat };\n"],"mappings":";;;;;;;;;;;AAAA,IAAMA,SAAS,GAAG,SAAZA,SAAS,CAAIC,IAAI,EAAsC;EAAA,+EAArB;MAAEC,QAAQ,EAAE;IAAG,CAAC;IAA7BA,QAAQ,QAARA,QAAQ;EACjC,IAAI,CAACA,QAAQ,IAAI,CAACA,QAAQ,CAACC,MAAM,EAAE,OAAO,IAAI;EAE9C,YAAsBC,KAAK,CAACC,OAAO,CAACJ,IAAI,CAAC,GAAGA,IAAI,GAAG,CAACA,IAAI,CAAC;IAAA;IAAlDK,WAAW;EAClB,IAAIA,WAAW,KAAK,OAAO,EAAE,OAAOJ,QAAQ,IAAI,EAAE;EAClD,IAAII,WAAW,KAAK,QAAQ,EAAE,OAAOJ,QAAQ,CAACK,IAAI,EAAE,IAAI,EAAE;AAC5D,CAAC;AAAC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.getNumberFilesPendingToFetch = void 0;
|
|
9
|
-
|
|
10
8
|
var getNumberFilesPendingToFetch = function getNumberFilesPendingToFetch(currentOffset, currentValue) {
|
|
11
9
|
var offsetSet = currentOffset + 4;
|
|
12
10
|
var offset = currentValue.length < offsetSet ? currentValue.length : offsetSet;
|
|
13
11
|
return currentValue.length - offset;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
exports.getNumberFilesPendingToFetch = getNumberFilesPendingToFetch;
|
|
17
14
|
//# sourceMappingURL=get-number-files-pending-to-fetch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-number-files-pending-to-fetch.js","names":["getNumberFilesPendingToFetch","currentOffset","currentValue","offsetSet","offset","length"],"sources":["../../../../src/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js"],"sourcesContent":["export const getNumberFilesPendingToFetch = (currentOffset, currentValue) => {\n const offsetSet = currentOffset + 4;\n const offset = currentValue.length < offsetSet ? currentValue.length : offsetSet;\n return currentValue.length - offset;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-number-files-pending-to-fetch.js","names":["getNumberFilesPendingToFetch","currentOffset","currentValue","offsetSet","offset","length"],"sources":["../../../../src/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js"],"sourcesContent":["export const getNumberFilesPendingToFetch = (currentOffset, currentValue) => {\n const offsetSet = currentOffset + 4;\n const offset = currentValue.length < offsetSet ? currentValue.length : offsetSet;\n return currentValue.length - offset;\n};\n"],"mappings":";;;;;;;AAAO,IAAMA,4BAA4B,GAAG,SAA/BA,4BAA4B,CAAIC,aAAa,EAAEC,YAAY,EAAK;EAC3E,IAAMC,SAAS,GAAGF,aAAa,GAAG,CAAC;EACnC,IAAMG,MAAM,GAAGF,YAAY,CAACG,MAAM,GAAGF,SAAS,GAAGD,YAAY,CAACG,MAAM,GAAGF,SAAS;EAChF,OAAOD,YAAY,CAACG,MAAM,GAAGD,MAAM;AACrC,CAAC;AAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -41,16 +40,10 @@ Object.defineProperty(exports, "transformToArray", {
|
|
|
41
40
|
return _transformToArray.transformToArray;
|
|
42
41
|
}
|
|
43
42
|
});
|
|
44
|
-
|
|
45
43
|
var _isUnselecting = require("./is-unselecting");
|
|
46
|
-
|
|
47
44
|
var _transformToArray = require("./transform-to-array");
|
|
48
|
-
|
|
49
45
|
var _getFormat = require("./get-format");
|
|
50
|
-
|
|
51
46
|
var _getButtonText = require("./get-button-text");
|
|
52
|
-
|
|
53
47
|
var _formatInitialValue = require("./format-initial-value");
|
|
54
|
-
|
|
55
48
|
var _getNumberFilesPendingToFetch = require("./get-number-files-pending-to-fetch");
|
|
56
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/FileUploadAdapter/mappers/index.js"],"sourcesContent":["import { isUnselecting } from './is-unselecting';\nimport { transformToArray } from './transform-to-array';\nimport { getFormat } from './get-format';\nimport { getButtonText } from './get-button-text';\nimport { formatInitialValue } from './format-initial-value';\nimport { getNumberFilesPendingToFetch } from './get-number-files-pending-to-fetch';\n\nexport {\n isUnselecting,\n transformToArray,\n getFormat,\n getButtonText,\n formatInitialValue,\n getNumberFilesPendingToFetch\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/FileUploadAdapter/mappers/index.js"],"sourcesContent":["import { isUnselecting } from './is-unselecting';\nimport { transformToArray } from './transform-to-array';\nimport { getFormat } from './get-format';\nimport { getButtonText } from './get-button-text';\nimport { formatInitialValue } from './format-initial-value';\nimport { getNumberFilesPendingToFetch } from './get-number-files-pending-to-fetch';\n\nexport {\n isUnselecting,\n transformToArray,\n getFormat,\n getButtonText,\n formatInitialValue,\n getNumberFilesPendingToFetch\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.isUnselecting = void 0;
|
|
9
|
-
|
|
10
8
|
require("core-js/modules/es.array.some.js");
|
|
11
|
-
|
|
12
9
|
require("core-js/modules/es.object.to-string.js");
|
|
13
|
-
|
|
14
10
|
require("core-js/modules/es.array.includes.js");
|
|
15
|
-
|
|
16
11
|
require("core-js/modules/es.string.includes.js");
|
|
17
|
-
|
|
18
12
|
var isUnselecting = function isUnselecting(value, checkIsUnselecting, files) {
|
|
19
13
|
return value && checkIsUnselecting && files.some(function (fileId) {
|
|
20
14
|
return value.includes(fileId);
|
|
21
15
|
});
|
|
22
16
|
};
|
|
23
|
-
|
|
24
17
|
exports.isUnselecting = isUnselecting;
|
|
25
18
|
//# sourceMappingURL=is-unselecting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-unselecting.js","names":["isUnselecting","value","checkIsUnselecting","files","some","fileId","includes"],"sources":["../../../../src/components/FileUploadAdapter/mappers/is-unselecting.js"],"sourcesContent":["export const isUnselecting = (value, checkIsUnselecting, files) =>\n value && checkIsUnselecting && files.some(fileId => value.includes(fileId));\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-unselecting.js","names":["isUnselecting","value","checkIsUnselecting","files","some","fileId","includes"],"sources":["../../../../src/components/FileUploadAdapter/mappers/is-unselecting.js"],"sourcesContent":["export const isUnselecting = (value, checkIsUnselecting, files) =>\n value && checkIsUnselecting && files.some(fileId => value.includes(fileId));\n"],"mappings":";;;;;;;;;;;AAAO,IAAMA,aAAa,GAAG,SAAhBA,aAAa,CAAIC,KAAK,EAAEC,kBAAkB,EAAEC,KAAK;EAAA,OAC5DF,KAAK,IAAIC,kBAAkB,IAAIC,KAAK,CAACC,IAAI,CAAC,UAAAC,MAAM;IAAA,OAAIJ,KAAK,CAACK,QAAQ,CAACD,MAAM,CAAC;EAAA,EAAC;AAAA;AAAC"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.transformToArray = void 0;
|
|
9
|
-
|
|
10
8
|
require("core-js/modules/es.array.is-array.js");
|
|
11
|
-
|
|
12
9
|
var transformToArray = function transformToArray(value) {
|
|
13
10
|
return Array.isArray(value) ? value : [value];
|
|
14
11
|
};
|
|
15
|
-
|
|
16
12
|
exports.transformToArray = transformToArray;
|
|
17
13
|
//# sourceMappingURL=transform-to-array.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-to-array.js","names":["transformToArray","value","Array","isArray"],"sources":["../../../../src/components/FileUploadAdapter/mappers/transform-to-array.js"],"sourcesContent":["export const transformToArray = value => (Array.isArray(value) ? value : [value]);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"transform-to-array.js","names":["transformToArray","value","Array","isArray"],"sources":["../../../../src/components/FileUploadAdapter/mappers/transform-to-array.js"],"sourcesContent":["export const transformToArray = value => (Array.isArray(value) ? value : [value]);\n"],"mappings":";;;;;;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,CAAGC,KAAK;EAAA,OAAKC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,GAAGA,KAAK,GAAG,CAACA,KAAK,CAAC;AAAA,CAAC;AAAC"}
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
10
|
var _react = require("react");
|
|
15
|
-
|
|
16
11
|
var _constants = require("../../constants");
|
|
17
|
-
|
|
18
12
|
function useLimit(initialLimit) {
|
|
19
13
|
var _useState = (0, _react.useState)(initialLimit),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
15
|
+
currentLimit = _useState2[0],
|
|
16
|
+
setCurrentLimit = _useState2[1];
|
|
24
17
|
(0, _react.useEffect)(function () {
|
|
25
18
|
if (initialLimit && currentLimit !== _constants.ONE_FILE_AS_LIMIT) {
|
|
26
19
|
setCurrentLimit(_constants.ONE_FILE_AS_LIMIT);
|
|
@@ -28,7 +21,6 @@ function useLimit(initialLimit) {
|
|
|
28
21
|
}, [currentLimit, initialLimit]);
|
|
29
22
|
return [currentLimit, setCurrentLimit];
|
|
30
23
|
}
|
|
31
|
-
|
|
32
24
|
var _default = useLimit;
|
|
33
25
|
exports["default"] = _default;
|
|
34
26
|
//# sourceMappingURL=useLimit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLimit.js","names":["useLimit","initialLimit","useState","currentLimit","setCurrentLimit","useEffect","ONE_FILE_AS_LIMIT"],"sources":["../../../src/components/FileUploadAdapter/useLimit.js"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { ONE_FILE_AS_LIMIT } from '../../constants';\n\nfunction useLimit(initialLimit) {\n const [currentLimit, setCurrentLimit] = useState(initialLimit);\n useEffect(\n () => {\n if (initialLimit && currentLimit !== ONE_FILE_AS_LIMIT) {\n setCurrentLimit(ONE_FILE_AS_LIMIT);\n }\n },\n [currentLimit, initialLimit]\n );\n\n return [currentLimit, setCurrentLimit];\n}\n\nexport default useLimit;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLimit.js","names":["useLimit","initialLimit","useState","currentLimit","setCurrentLimit","useEffect","ONE_FILE_AS_LIMIT"],"sources":["../../../src/components/FileUploadAdapter/useLimit.js"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { ONE_FILE_AS_LIMIT } from '../../constants';\n\nfunction useLimit(initialLimit) {\n const [currentLimit, setCurrentLimit] = useState(initialLimit);\n useEffect(\n () => {\n if (initialLimit && currentLimit !== ONE_FILE_AS_LIMIT) {\n setCurrentLimit(ONE_FILE_AS_LIMIT);\n }\n },\n [currentLimit, initialLimit]\n );\n\n return [currentLimit, setCurrentLimit];\n}\n\nexport default useLimit;\n"],"mappings":";;;;;;;;;AAAA;AACA;AAEA,SAASA,QAAQ,CAACC,YAAY,EAAE;EAC9B,gBAAwC,IAAAC,eAAQ,EAACD,YAAY,CAAC;IAAA;IAAvDE,YAAY;IAAEC,eAAe;EACpC,IAAAC,gBAAS,EACP,YAAM;IACJ,IAAIJ,YAAY,IAAIE,YAAY,KAAKG,4BAAiB,EAAE;MACtDF,eAAe,CAACE,4BAAiB,CAAC;IACpC;EACF,CAAC,EACD,CAACH,YAAY,EAAEF,YAAY,CAAC,CAC7B;EAED,OAAO,CAACE,YAAY,EAAEC,eAAe,CAAC;AACxC;AAAC,eAEcJ,QAAQ;AAAA"}
|
|
@@ -1,95 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.weak-map.js");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.object.define-property.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
8
|
-
|
|
9
6
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
10
|
-
|
|
11
7
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
12
|
-
|
|
13
8
|
Object.defineProperty(exports, "__esModule", {
|
|
14
9
|
value: true
|
|
15
10
|
});
|
|
16
11
|
exports["default"] = void 0;
|
|
17
|
-
|
|
18
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
19
|
-
|
|
20
13
|
require("core-js/modules/es.array.iterator.js");
|
|
21
|
-
|
|
22
14
|
require("core-js/modules/es.object.to-string.js");
|
|
23
|
-
|
|
24
15
|
require("core-js/modules/es.promise.js");
|
|
25
|
-
|
|
26
16
|
require("core-js/modules/es.string.iterator.js");
|
|
27
|
-
|
|
28
17
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
29
|
-
|
|
30
18
|
require("core-js/modules/es.array.map.js");
|
|
31
|
-
|
|
32
19
|
require("core-js/modules/es.function.name.js");
|
|
33
|
-
|
|
34
20
|
require("core-js/modules/es.array.join.js");
|
|
35
|
-
|
|
36
21
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
37
|
-
|
|
38
22
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
39
|
-
|
|
40
23
|
var _react = _interopRequireWildcard(require("react"));
|
|
41
|
-
|
|
42
|
-
var _modal = _interopRequireDefault(require("@blaze-react/modal"));
|
|
43
|
-
|
|
24
|
+
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
44
25
|
var _fileUpload = _interopRequireDefault(require("@blaze-react/file-upload"));
|
|
45
|
-
|
|
46
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
47
|
-
|
|
48
|
-
var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
|
|
49
|
-
|
|
50
27
|
var _toaster = require("@blaze-react/toaster");
|
|
51
|
-
|
|
52
28
|
var _client = require("@apollo/client");
|
|
53
|
-
|
|
54
29
|
var _useFileList2 = _interopRequireDefault(require("../FileList/useFileList"));
|
|
55
|
-
|
|
56
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
57
|
-
|
|
58
31
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
59
|
-
|
|
60
32
|
var FileUploadModal = function FileUploadModal(_ref) {
|
|
61
33
|
var onClose = _ref.onClose;
|
|
62
|
-
|
|
63
34
|
var _useState = (0, _react.useState)([]),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
35
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
36
|
+
files = _useState2[0],
|
|
37
|
+
setFiles = _useState2[1];
|
|
68
38
|
var _useToasts = (0, _toaster.useToasts)(),
|
|
69
|
-
|
|
70
|
-
|
|
39
|
+
addToast = _useToasts.addToast;
|
|
71
40
|
var client = (0, _client.useApolloClient)();
|
|
72
|
-
|
|
73
41
|
var _useFileList = (0, _useFileList2["default"])(),
|
|
74
|
-
|
|
75
|
-
|
|
42
|
+
addNewFile = _useFileList.addNewFile;
|
|
76
43
|
var fileStoresType = (0, _adminUiUtils.getQuery)('GET_FILE_STORES');
|
|
77
|
-
|
|
78
44
|
var _useQuery = (0, _client.useQuery)(fileStoresType, {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
45
|
+
variables: {
|
|
46
|
+
visibleInAdmin: true
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
_useQuery$data = _useQuery.data;
|
|
85
50
|
_useQuery$data = _useQuery$data === void 0 ? {} : _useQuery$data;
|
|
86
51
|
var _useQuery$data$getFil = _useQuery$data.getFileStores,
|
|
87
|
-
|
|
88
|
-
|
|
52
|
+
storeType = _useQuery$data$getFil === void 0 ? [] : _useQuery$data$getFil;
|
|
89
53
|
var handleFiles = function handleFiles(filesToUpload) {
|
|
90
54
|
setFiles(filesToUpload);
|
|
91
55
|
};
|
|
92
|
-
|
|
93
56
|
var uploadFiles = /*#__PURE__*/function () {
|
|
94
57
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
95
58
|
var response, parsedResponse, fileNames;
|
|
@@ -100,9 +63,9 @@ var FileUploadModal = function FileUploadModal(_ref) {
|
|
|
100
63
|
_context.next = 2;
|
|
101
64
|
return Promise.all(files.map(function (_ref3) {
|
|
102
65
|
var file = _ref3.file,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
66
|
+
name = _ref3.name,
|
|
67
|
+
fileData = _ref3.data,
|
|
68
|
+
storeKey = _ref3.storeKey;
|
|
106
69
|
return client.mutate({
|
|
107
70
|
mutation: (0, _adminUiUtils.getMutation)('UPLOAD_FILE'),
|
|
108
71
|
variables: {
|
|
@@ -120,7 +83,6 @@ var FileUploadModal = function FileUploadModal(_ref) {
|
|
|
120
83
|
autoDismiss: true
|
|
121
84
|
});
|
|
122
85
|
});
|
|
123
|
-
|
|
124
86
|
case 2:
|
|
125
87
|
response = _context.sent;
|
|
126
88
|
parsedResponse = response.map(function (_ref4) {
|
|
@@ -136,7 +98,6 @@ var FileUploadModal = function FileUploadModal(_ref) {
|
|
|
136
98
|
appearance: 'success',
|
|
137
99
|
autoDismiss: true
|
|
138
100
|
});
|
|
139
|
-
|
|
140
101
|
case 7:
|
|
141
102
|
case "end":
|
|
142
103
|
return _context.stop();
|
|
@@ -144,12 +105,10 @@ var FileUploadModal = function FileUploadModal(_ref) {
|
|
|
144
105
|
}
|
|
145
106
|
}, _callee);
|
|
146
107
|
}));
|
|
147
|
-
|
|
148
108
|
return function uploadFiles() {
|
|
149
109
|
return _ref2.apply(this, arguments);
|
|
150
110
|
};
|
|
151
111
|
}();
|
|
152
|
-
|
|
153
112
|
var handleOnSave = /*#__PURE__*/function () {
|
|
154
113
|
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
155
114
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
@@ -157,15 +116,12 @@ var FileUploadModal = function FileUploadModal(_ref) {
|
|
|
157
116
|
switch (_context2.prev = _context2.next) {
|
|
158
117
|
case 0:
|
|
159
118
|
onClose();
|
|
160
|
-
|
|
161
119
|
if (!files.length) {
|
|
162
120
|
_context2.next = 4;
|
|
163
121
|
break;
|
|
164
122
|
}
|
|
165
|
-
|
|
166
123
|
_context2.next = 4;
|
|
167
124
|
return uploadFiles();
|
|
168
|
-
|
|
169
125
|
case 4:
|
|
170
126
|
case "end":
|
|
171
127
|
return _context2.stop();
|
|
@@ -173,16 +129,14 @@ var FileUploadModal = function FileUploadModal(_ref) {
|
|
|
173
129
|
}
|
|
174
130
|
}, _callee2);
|
|
175
131
|
}));
|
|
176
|
-
|
|
177
132
|
return function handleOnSave() {
|
|
178
133
|
return _ref6.apply(this, arguments);
|
|
179
134
|
};
|
|
180
135
|
}();
|
|
181
|
-
|
|
182
136
|
var storeOptions = storeType.map(function (type) {
|
|
183
137
|
return [type.key, type.name];
|
|
184
138
|
});
|
|
185
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(
|
|
139
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_adminUiUtils.ModalAdapter, {
|
|
186
140
|
onClose: onClose,
|
|
187
141
|
title: "Add media",
|
|
188
142
|
actions: [{
|
|
@@ -200,7 +154,6 @@ var FileUploadModal = function FileUploadModal(_ref) {
|
|
|
200
154
|
selectOptions: storeOptions
|
|
201
155
|
})));
|
|
202
156
|
};
|
|
203
|
-
|
|
204
157
|
FileUploadModal.propTypes = {
|
|
205
158
|
onClose: _propTypes["default"].func
|
|
206
159
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadModal.js","names":["FileUploadModal","onClose","useState","files","setFiles","useToasts","addToast","client","useApolloClient","useFileList","addNewFile","fileStoresType","getQuery","useQuery","variables","visibleInAdmin","data","getFileStores","storeType","handleFiles","filesToUpload","uploadFiles","Promise","all","map","file","name","fileData","storeKey","mutate","mutation","getMutation","input","filename","error","message","appearance","autoDismiss","response","parsedResponse","result","fileNames","join","handleOnSave","length","storeOptions","type","key","textButton","callback","modifiers","propTypes","PropTypes","func","defaultProps"],"sources":["../../../src/components/FileUploadModal/FileUploadModal.js"],"sourcesContent":["import React, { useState } from 'react';\nimport Modal from '@blaze-
|
|
1
|
+
{"version":3,"file":"FileUploadModal.js","names":["FileUploadModal","onClose","useState","files","setFiles","useToasts","addToast","client","useApolloClient","useFileList","addNewFile","fileStoresType","getQuery","useQuery","variables","visibleInAdmin","data","getFileStores","storeType","handleFiles","filesToUpload","uploadFiles","Promise","all","map","file","name","fileData","storeKey","mutate","mutation","getMutation","input","filename","error","message","appearance","autoDismiss","response","parsedResponse","result","fileNames","join","handleOnSave","length","storeOptions","type","key","textButton","callback","modifiers","propTypes","PropTypes","func","defaultProps"],"sources":["../../../src/components/FileUploadModal/FileUploadModal.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { ModalAdapter as Modal, getMutation, getQuery } from '@blaze-cms/admin-ui-utils';\nimport FileUpload from '@blaze-react/file-upload';\nimport PropTypes from 'prop-types';\nimport { useToasts } from '@blaze-react/toaster';\nimport { useApolloClient, useQuery } from '@apollo/client';\nimport useFileList from '../FileList/useFileList';\n\nconst FileUploadModal = ({ onClose }) => {\n const [files, setFiles] = useState([]);\n const { addToast } = useToasts();\n const client = useApolloClient();\n const { addNewFile } = useFileList();\n\n const fileStoresType = getQuery('GET_FILE_STORES');\n\n const { data: { getFileStores: storeType = [] } = {} } = useQuery(fileStoresType, {\n variables: { visibleInAdmin: true }\n });\n\n const handleFiles = filesToUpload => {\n setFiles(filesToUpload);\n };\n\n const uploadFiles = async () => {\n const response = await Promise.all(\n files.map(({ file, name, data: fileData, storeKey }) =>\n client.mutate({\n mutation: getMutation('UPLOAD_FILE'),\n variables: {\n input: {\n file,\n name: name || file.filename,\n storeKey,\n data: fileData\n }\n }\n })\n )\n ).catch(error => {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n });\n\n const parsedResponse = response.map(({ data: { file } }) => file.result);\n\n const fileNames = files.map(({ file }) => file.name);\n addNewFile(parsedResponse);\n addToast(`Uploaded: ${fileNames.join(', ')}`, {\n appearance: 'success',\n autoDismiss: true\n });\n };\n\n const handleOnSave = async () => {\n onClose();\n if (files.length) await uploadFiles();\n };\n\n const storeOptions = storeType.map(type => [type.key, type.name]);\n\n return (\n <>\n <Modal\n onClose={onClose}\n title=\"Add media\"\n actions={[\n {\n textButton: 'Cancel',\n callback: onClose,\n modifiers: ['cancel']\n },\n {\n textButton: 'Save',\n callback: handleOnSave,\n modifiers: []\n }\n ]}\n upload>\n <FileUpload onChange={handleFiles} selectOptions={storeOptions} />\n </Modal>\n </>\n );\n};\n\nFileUploadModal.propTypes = {\n onClose: PropTypes.func\n};\n\nFileUploadModal.defaultProps = {\n onClose: () => {}\n};\n\nexport default FileUploadModal;\n"],"mappings":"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"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
var _FileUploadModal = _interopRequireDefault(require("./FileUploadModal"));
|
|
13
|
-
|
|
14
10
|
var _default = _FileUploadModal["default"];
|
|
15
11
|
exports["default"] = _default;
|
|
16
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["FileUploadModal"],"sources":["../../../src/components/FileUploadModal/index.js"],"sourcesContent":["import FileUploadModal from './FileUploadModal';\n\nexport default FileUploadModal;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["FileUploadModal"],"sources":["../../../src/components/FileUploadModal/index.js"],"sourcesContent":["import FileUploadModal from './FileUploadModal';\n\nexport default FileUploadModal;\n"],"mappings":";;;;;;;;AAAA;AAAgD,eAEjCA,2BAAe;AAAA"}
|
|
@@ -1,93 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.array.iterator.js");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.string.iterator.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.weak-map.js");
|
|
8
|
-
|
|
9
6
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
-
|
|
11
7
|
require("core-js/modules/es.object.define-property.js");
|
|
12
|
-
|
|
13
8
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
14
|
-
|
|
15
9
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
16
|
-
|
|
17
10
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
18
|
-
|
|
19
11
|
Object.defineProperty(exports, "__esModule", {
|
|
20
12
|
value: true
|
|
21
13
|
});
|
|
22
14
|
exports["default"] = void 0;
|
|
23
|
-
|
|
24
15
|
require("core-js/modules/es.array.filter.js");
|
|
25
|
-
|
|
26
16
|
require("core-js/modules/es.object.to-string.js");
|
|
27
|
-
|
|
28
17
|
require("core-js/modules/es.string.trim.js");
|
|
29
|
-
|
|
30
18
|
require("core-js/modules/es.array.reduce.js");
|
|
31
|
-
|
|
32
19
|
require("core-js/modules/es.array.map.js");
|
|
33
|
-
|
|
34
20
|
require("core-js/modules/es.function.name.js");
|
|
35
|
-
|
|
36
21
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
37
|
-
|
|
38
22
|
var _react = _interopRequireWildcard(require("react"));
|
|
39
|
-
|
|
40
23
|
var _pluginSearchUi = require("@blaze-cms/plugin-search-ui");
|
|
41
|
-
|
|
42
24
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
43
|
-
|
|
44
25
|
var _select = _interopRequireDefault(require("@blaze-react/select"));
|
|
45
|
-
|
|
46
26
|
var _mediaContext = require("../../utils/media-context");
|
|
47
|
-
|
|
48
27
|
var _useFileList2 = _interopRequireDefault(require("../FileList/useFileList"));
|
|
49
|
-
|
|
50
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
|
-
|
|
52
29
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
53
|
-
|
|
54
30
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
55
|
-
|
|
56
31
|
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
32
|
+
|
|
57
33
|
var FilterPanel = function FilterPanel() {
|
|
58
34
|
var _useState = (0, _react.useState)(''),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
35
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
36
|
+
searchTerm = _useState2[0],
|
|
37
|
+
setSearchTerm = _useState2[1];
|
|
63
38
|
var _useMediaContext = (0, _mediaContext.useMediaContext)(_mediaContext.MediaContext),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
39
|
+
filters = _useMediaContext.filters,
|
|
40
|
+
selectedFilter = _useMediaContext.selectedFilter,
|
|
41
|
+
changeSelectedFilter = _useMediaContext.changeSelectedFilter,
|
|
42
|
+
fileStores = _useMediaContext.fileStores;
|
|
69
43
|
var _useFileList = (0, _useFileList2["default"])(),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
44
|
+
queryParams = _useFileList.queryParams,
|
|
45
|
+
data = _useFileList.data;
|
|
73
46
|
var _useState3 = (0, _react.useState)(filters[0].id),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
47
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
48
|
+
active = _useState4[0],
|
|
49
|
+
setActive = _useState4[1];
|
|
78
50
|
(0, _react.useEffect)(function () {
|
|
79
51
|
if (queryParams.searchTerm === null) {
|
|
80
52
|
setSearchTerm('');
|
|
81
53
|
}
|
|
82
54
|
}, [queryParams.searchTerm]);
|
|
83
|
-
|
|
84
55
|
var handleSearchTerm = function handleSearchTerm(_ref) {
|
|
85
56
|
var value = _ref.target.value;
|
|
86
57
|
setSearchTerm(value);
|
|
87
58
|
};
|
|
88
|
-
|
|
89
59
|
var storeKey = selectedFilter.storeKey || '';
|
|
90
|
-
|
|
91
60
|
var onChangeFilter = function onChangeFilter(id) {
|
|
92
61
|
setActive(id);
|
|
93
62
|
searchTerm ? changeSelectedFilter({
|
|
@@ -102,10 +71,8 @@ var FilterPanel = function FilterPanel() {
|
|
|
102
71
|
storeKey: storeKey
|
|
103
72
|
});
|
|
104
73
|
};
|
|
105
|
-
|
|
106
74
|
var handleKeyDown = function handleKeyDown(_ref2) {
|
|
107
75
|
var key = _ref2.key;
|
|
108
|
-
|
|
109
76
|
if (key === 'Enter') {
|
|
110
77
|
searchTerm ? changeSelectedFilter({
|
|
111
78
|
filter: selectedFilter.filter,
|
|
@@ -120,7 +87,6 @@ var FilterPanel = function FilterPanel() {
|
|
|
120
87
|
});
|
|
121
88
|
}
|
|
122
89
|
};
|
|
123
|
-
|
|
124
90
|
var onSelectFilter = function onSelectFilter(_ref3) {
|
|
125
91
|
var value = _ref3.value;
|
|
126
92
|
searchTerm ? changeSelectedFilter({
|
|
@@ -135,7 +101,6 @@ var FilterPanel = function FilterPanel() {
|
|
|
135
101
|
storeKey: value
|
|
136
102
|
});
|
|
137
103
|
};
|
|
138
|
-
|
|
139
104
|
var activeSegements = filters.reduce(function (acc, _ref4, index) {
|
|
140
105
|
var id = _ref4.id;
|
|
141
106
|
acc["active-".concat(index)] = active === id;
|
|
@@ -153,7 +118,7 @@ var FilterPanel = function FilterPanel() {
|
|
|
153
118
|
className: "filter-panel__list"
|
|
154
119
|
}, filters.map(function (_ref5) {
|
|
155
120
|
var label = _ref5.label,
|
|
156
|
-
|
|
121
|
+
id = _ref5.id;
|
|
157
122
|
return selectedFilter.filter !== id ? /*#__PURE__*/_react["default"].createElement("li", {
|
|
158
123
|
key: label,
|
|
159
124
|
className: "filter-panel__list-item"
|
|
@@ -192,7 +157,6 @@ var FilterPanel = function FilterPanel() {
|
|
|
192
157
|
close: false
|
|
193
158
|
})));
|
|
194
159
|
};
|
|
195
|
-
|
|
196
160
|
var _default = FilterPanel;
|
|
197
161
|
exports["default"] = _default;
|
|
198
162
|
//# sourceMappingURL=FilterPanel.js.map
|