Can I use figma plugin API to do the same thing as "resize to fit" button in panel

image

Did you ever find a solution?

The easiest way is to turn off the clipsContent, get the absoluteRenderBounds, and then use the resizeWithoutConstraints method and change the coordinates of the children if required.