diff --git a/package.json b/package.json index a12e1d29486..ab6490ef625 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "filepond-plugin-image-preview": "^4.6.7", "filepond-plugin-image-resize": "^2.0.10", "filepond-plugin-image-transform": "^3.8.6", + "filepond-plugin-media-preview": "^1.0.9", "imask": "^6.1.0", "laravel-mix": "^6.0.37", "marked": "^4.0.10", diff --git a/packages/forms/resources/js/components/file-upload.js b/packages/forms/resources/js/components/file-upload.js index 145e1186294..323b8cf3f45 100644 --- a/packages/forms/resources/js/components/file-upload.js +++ b/packages/forms/resources/js/components/file-upload.js @@ -6,9 +6,11 @@ import FilePondPluginImageExifOrientation from 'filepond-plugin-image-exif-orien import FilePondPluginImagePreview from 'filepond-plugin-image-preview' import FilePondPluginImageResize from 'filepond-plugin-image-resize' import FilePondPluginImageTransform from 'filepond-plugin-image-transform' +import FilePondPluginMediaPreview from 'filepond-plugin-media-preview' import 'filepond/dist/filepond.min.css' import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css' +import 'filepond-plugin-media-preview/dist/filepond-plugin-media-preview.css'; import '../../css/components/file-upload.css' FilePond.registerPlugin(FilePondPluginFileValidateSize) @@ -18,6 +20,7 @@ FilePond.registerPlugin(FilePondPluginImageExifOrientation) FilePond.registerPlugin(FilePondPluginImagePreview) FilePond.registerPlugin(FilePondPluginImageResize) FilePond.registerPlugin(FilePondPluginImageTransform) +FilePond.registerPlugin(FilePondPluginMediaPreview) export default (Alpine) => { Alpine.data('fileUploadFormComponent', ({ @@ -164,7 +167,7 @@ export default (Alpine) => { this.pond.files = shouldAppendFiles ? files : files.reverse() }) - + this.pond.on('reorderfiles', async (files) => { const orderedFileKeys = files .map(file => file.source instanceof File ? file.serverId : this.uploadedFileUrlIndex[file.source] ?? null) // file.serverId is null for a file that is not yet uploaded