It could be either. In most cases it is likely both (shrinking margins, higher prices).
The price is determined by the market. But there’s a demand curve. There are many prices that an item could sell at, with varying numbers of buyers at each price.
In a highly competitive market, the price should be driven down close to the cost of production. This allows the most people to buy at the lowest possible price, at the expense of retailer margins.
Amazon probably has the best cost structure of online retailers. Which means in many cases they are setting the floor on the price. If their labor costs go up enough to wipe out their margins, their prices must go up, or they must exit the market for highly competitive items. With less competition, other retailers have more leeway to increase prices.
As a society we may decide it is worth paying more for goods to ensure a fair living wage and safe working conditions. That doesn’t sound unreasonable. But to assume you can get that without increasing prices is naive.