Media: Add HEIC upload support via canonical plugin installer#76702
Media: Add HEIC upload support via canonical plugin installer#76702adamsilverstein wants to merge 7 commits into
Conversation
When users attempt to upload HEIC/HEIF images (common from iPhones), prompt them to install the client-side-heic plugin with a single click. The plugin converts HEIC to JPEG in the browser before upload. - Add isHeicFile() utility for HEIC/HEIF detection - Add onHeicPluginRequired callback to upload-media store Settings - Intercept HEIC MIME validation failures to show install prompt - Add HeicUploadPrompt modal component in the editor package - Wire callback through block-editor settings to upload-media store - Support "Don't ask again" preference via @wordpress/preferences - Handle both modern (upload-media store) and legacy upload paths - Check user capabilities before showing install button Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +1.22 kB (+0.02%) Total Size: 7.66 MB
ℹ️ View Unchanged
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused createErrorNotice import - Fix prettier formatting for createInfoNotice call - Add __next40pxDefaultSize and accessibleWhenDisabled to Buttons - Fix JSDoc: single @return, add missing @param declarations Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add missing onHeicPluginRequired parameter to the uploadMedia docs to fix the check-local-changes CI check. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Flaky tests detected in 3c4366b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23353056536
|
|
Closing in favor of adding direct HEIC support via platform APIs. |
Summary
When users attempt to upload HEIC/HEIF images (the default format from iPhones), WordPress rejects them because HEIC is not in the allowed MIME types. This PR adds an installer flow that prompts users to install the client-side-heic plugin with a single click.
How it works
.heicfile for upload in the block editorPOST /wp/v2/plugins, then the upload is retriedChanges
packages/upload-media/src/is-heic-file.ts- New HEIC/HEIF detection utilitypackages/upload-media/src/store/types.ts- AddedonHeicPluginRequiredcallback toSettingsinterfacepackages/upload-media/src/store/actions.ts- Intercepts HEIC MIME validation failures, invokes callback instead ofonErrorpackages/media-utils/src/utils/upload-media.ts- Same interception for the legacy upload pathpackages/editor/src/components/heic-upload-prompt/index.js- New modal component for the install promptpackages/editor/src/components/provider/use-heic-upload-prompt.js- Hook managing prompt statepackages/editor/src/components/provider/use-block-editor-settings.js- Wires callback into block editor settingspackages/editor/src/components/provider/index.js- Mounts the HeicUploadPrompt modalpackages/block-editor/src/components/provider/use-media-upload-settings.js- Passes callback through to upload-media storeArchitecture
Follows existing package layering:
Uses the same plugin install pattern as
packages/block-directory/src/store/actions.js.Test plan