plasmicapp / plasmic

Visual builder for React. Build apps, websites, and content. Integrate with your codebase.
https://www.plasmic.app
MIT License
4.72k stars 382 forks source link

Add support for Next.js image loader #41

Closed ArtemSBulgakov closed 2 years ago

ArtemSBulgakov commented 2 years ago

When importing image using import Img from "./xxx.jpeg", Next.js image loader returns the following structure:

{
  src: {
    src: '/_next/static/media/xxx.jpeg',
    height: 2686,
    width: 4096,
    blurDataURL: 'data:image/jpeg;base64,xxx'
  },
  fullWidth: 4096,
  fullHeight: 2686,
  aspectRatio: undefined
}

or for svg:

{
  src: {
    src: '/_next/static/media/xxx.svg',
    height: 109,
    width: 102
  },
  fullWidth: 140,
  fullHeight: 150,
  aspectRatio: 0.933974
}
vercel[bot] commented 2 years ago

@ArtemSBulgakov is attempting to deploy a commit to the Plasmic Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
contenful-example ✅ Ready (Inspect) Visit Preview Jun 9, 2022 at 9:24AM (UTC)
plasmic ✅ Ready (Inspect) Visit Preview Jun 9, 2022 at 9:24AM (UTC)
vercel-workflow ✅ Ready (Inspect) Visit Preview Jun 9, 2022 at 9:24AM (UTC)
victoragnez commented 2 years ago

Thank you!! I've merged it internally in 85f2dfcec831d64eedc380e83949bfbf1cf6c460