Upgrade to Cropper v2, add configurable aspect ratios#692
Conversation
Merge in updates to 4.x
Updated badge links and added GitHub stars badge.
Merge in 4.x changes
This makes the decoding work for s3 hosted images as well.
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.5.0 to 3.0.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](dependabot/fetch-metadata@v2.5.0...v3.0.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-version: 3.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…/dependabot/fetch-metadata-3.0.0 Chore(deps): Bump dependabot/fetch-metadata from 2.5.0 to 3.0.0
Agent-Logs-Url: https://github.com/egg2-code-labs/filament-curator/sessions/186c836d-47fc-4078-816e-9a7b529e4697 Co-authored-by: derhofbauer <22151619+derhofbauer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/egg2-code-labs/filament-curator/sessions/186c836d-47fc-4078-816e-9a7b529e4697 Co-authored-by: derhofbauer <22151619+derhofbauer@users.noreply.github.com>
…ion-2 Upgrade Cropper.js to v2 with web component API
+ use temporaryUrl for private images + get size & mimeType for uploaded file after it was moved to the final storage location using disk and not TemporaryUploaded File
+ Abort button now uses livewire close() method instead of triggering an event.
|
Can you target the PR to the 4.x branch please? Also revert any linting rules so that code styling isn't affected. Hard for me to focus on the changes with noise around things like single quotes changing to double quotes. Can you please not use pnpm? I'd prefer to keep it on npm. |
|
@awcodes I switched the target branch, removed the pnpm-lock file, ran the linter for PHP and fixed the prettier config, because that was not working either with prettier complaining about |
|
@derhofbauer havent forgotten about this, just haven't had time to do a full review and test. Hope to get to it soon. Thanks again. |
|
There appears to be some bugs in this:
|
@awcodes 1 and 2 are fixed. Regarding 3, what is the expected behaviour here? When clicking a reset button I expect that things jump around a bit and return to the initial state. I agree, that this is not whats happening right now, because the selection is not reset, but I wanted to confirm the expected behaviour before starting to work on this. For 1 I had to work with alpine |
|
Just drop the 'x-if' stuff completely. No need to duplicate the buttons, just bind to the style attribute instead of using a class: <x-filament::button
type="button"
color="gray"
x-on:click="setAspectRatio({{ $ratio }})"
x-bind:style="aspectRatio === {{ $ratio }} ? 'background-color: color-mix(in oklab, var(--gray-700)10%, transparent);' : ''"
>
{{ $label }}
</x-filament::button>For 3, yea, I think it should reset everything to the initial state when the modal was opened. Thanks again on all your work on this. |
|
@awcodes I implemented the suggested piece of code. For 3: The reset button now destroys and re-inits the whole canvas. Please review :) |
This PR contains multiple changes:
close()method now.The changes to loading thumbnails mentioned in point 1 are required for private S3-hosted files to be accessible, solving #687. This partially aligns with the
Media.php::url()method.I also had to set the
cross-originattribute of the<img>tag itself to 'anonymous' to be able to export the canvas to a data URL. Otherwise I'd get an error "Tainted canvases may not be exported". This was the easiest solution, not the cleanest, admittedly.