feat(post-form): client-side HEIC->JPEG photo picker (U4)
Replace /post's managed filepond field with a controlled 'photos' field
(theme forms/fields/photos) + picker logic in post-form.js: magic-byte
sniff (ISO-BMFF ftyp brands, not filename/MIME), lazy import('heic-to')
only for real HEIC (deferred 3MB chunk via ESM splitting), per-thumbnail
converting/uploading/done/error states, in-flight counter gating Submit,
and fail-closed skip on conversion failure. Converted JPEGs POST to Grav's
AJAX file-upload route into the form flash (the only path copyFiles reads),
so add-page-by-form attaches them on submit. Web-format photos pass through.
Refs R8, R9, R16, R17, AE1, AE4, KTD4.
This commit is contained in:
@@ -47,7 +47,11 @@ form:
|
||||
-
|
||||
name: photos
|
||||
label: Photos (max 4)
|
||||
type: filepond
|
||||
# Custom controlled picker (theme: forms/fields/photos) — replaces
|
||||
# filepond so post-form.js can convert HEIC before upload (U4). The
|
||||
# destination/accept/limit below are still read server-side by the
|
||||
# form's AJAX uploadFiles() handler.
|
||||
type: photos
|
||||
multiple: true
|
||||
destination: '@self'
|
||||
limit: 4
|
||||
|
||||
Reference in New Issue
Block a user