feat(SW-365): Added focal point to imagevault typings and to image component

This commit is contained in:
Erik Tiekstra
2024-10-15 15:54:39 +02:00
parent b33381d1b4
commit 59ffbef8fb
6 changed files with 56 additions and 9 deletions

View File

@@ -11,6 +11,11 @@ const metaData = z.object({
Value: z.string().nullable(),
})
export const focalPointSchema = z.object({
x: z.number(),
y: z.number(),
})
/**
* Defines a media asset, original or conversion
*/
@@ -94,6 +99,7 @@ export const imageVaultAssetSchema = z.object({
* Name of the user that added the asset to ImageVault
*/
AddedBy: z.string(),
FocalPoint: focalPointSchema.optional(),
})
export const imageVaultAssetTransformedSchema = imageVaultAssetSchema.transform(
@@ -124,6 +130,7 @@ export const imageVaultAssetTransformedSchema = imageVaultAssetSchema.transform(
height: mediaConversion.Height,
aspectRatio,
},
focalPoint: rawData.FocalPoint || { x: 50, y: 50 },
}
}
)