bytic / media-library-module
A media module for bytic library
Requires
- bytic/assets: ^0.9 || ^1.0 || ^2.0
- bytic/medialibrary: ^0.8 || ^0.9 || ^1.0
- bytic/view: ^0.9 || ^1.0 || ^2.0
Requires (Dev)
- mockery/mockery: ^1.6
- phpunit/phpunit: ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A media module for bytic library
Uploads and cropping
The gallery upload dialog accepts images by drag and drop or file picker. Select
Crop & upload all to review each image in turn; canceling a crop leaves that
image in the queue. The original file and source-pixel crop coordinates are sent
using the existing file, media_type, and cropper fields. The crop editor
requires a browser with native <dialog> support; without it, uploads are not
silently sent without cropping.
Existing applications can continue to provide a media-library Webpack entry
using resources/assets/js/manager.js and resources/assets/scss/manager.scss.
Otherwise the module serves its prebuilt standalone assets automatically. The
gallery actions still use the host application's jQuery and Bootstrap modal.
The upload dialog uses Bootstrap 5's modal-fullscreen class for its layout.
Composer supports the existing MediaLibrary 0.8/0.9 ranges and 1.x. Each dependency version has its own PHP and extension requirements; MediaLibrary 1.x requires PHP 8.3 or later.
Development
Run npm ci and npm run build after changing frontend assets, and commit the
generated files in resources/assets/dist. The build requires Node.js 20 or
later. Run npm test for crop geometry tests and npm run test:browser for the
upload flow (install Chromium with npx playwright install chromium, or set
CHROME_PATH to an existing Chrome executable). The browser test also needs
Composer dependencies installed. Run PHP tests with vendor/bin/phpunit.