feat: implemented focal point picker inside ImageVault

This commit is contained in:
Erik Tiekstra
2024-10-14 16:07:32 +02:00
parent 5f9bd57a7c
commit b1493bcd3d
8 changed files with 217 additions and 16 deletions

View File

@@ -138,9 +138,15 @@ export default function ImageVaultDAM({
(result?: InsertResponse) => {
if (field) {
flushSync(() => {
setMedia(result || null)
const data = result
? {
...result,
FocalPoint: result.FocalPoint || { x: 50, y: 50 },
}
: null
setMedia(data)
// Data inside the field is supposed to be an empty object if nothing is selected
field.setData(result || {})
field.setData(data || {})
document.body.style.overflow = "hidden"
})
}
@@ -168,6 +174,13 @@ export default function ImageVaultDAM({
),
modalProps: {
size: "max",
style: {
content: {
maxHeight: "90dvh",
width: "auto",
},
overlay: {},
},
},
})
}