Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-ronin

Package Overview
Dependencies
Maintainers
5
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-ronin - npm Package Compare versions

Comparing version 2.2.7 to 2.2.8-add-format-experimental.0

10

dist/components/image.client.d.ts

@@ -15,5 +15,13 @@ /// <reference types="web" />

* Must be an integer between 0 and 100.
*
* @default 80
*/
quality?: number;
/**
* The format of the image.
*
* @default "webp"
*/
format?: "webp" | "jpeg" | "png" | "original";
/**
* The value of a RONIN Blob field.

@@ -39,2 +47,4 @@ */

* Specifies how the image should be resized to fit its container.
*
* @default "cover"
*/

@@ -41,0 +51,0 @@ fit?: CSSProperties["objectFit"];

8

dist/components/image.client.js
"use client";
import React, { useCallback, useRef, forwardRef, } from "react";
const supportedFitValues = ["fill", "contain", "cover"];
const Image = forwardRef(({ src: input, alt, size: defaultSize, width: defaultWidth, height: defaultHeight, fit = "cover", aspect, quality, loading, style, className, }, ref) => {
const Image = forwardRef(({ src: input, alt, size: defaultSize, width: defaultWidth, height: defaultHeight, fit = "cover", format = "webp", quality = 80, aspect, loading, style, className, }, ref) => {
const imageElement = useRef(null);

@@ -32,4 +32,5 @@ const renderTime = useRef(Date.now());

...(height ? { h: height.toString() } : {}),
...(format !== "original" ? { fm: format } : {}),
fit: supportedFitValues.includes(fit) ? fit : "cover",
q: quality ? quality.toString() : "100",
q: quality.toString(),
});

@@ -39,4 +40,5 @@ const responsiveOptimizationParams = new URLSearchParams({

...(height ? { h: (height * 2).toString() } : {}),
...(format !== "original" ? { fm: format } : {}),
fit: supportedFitValues.includes(fit) ? fit : "cover",
q: quality ? quality.toString() : "100",
q: quality.toString(),
});

@@ -43,0 +45,0 @@ const source = isMediaObject ? `${input.src}?${optimizationParams}` : input;

{
"name": "react-ronin",
"version": "2.2.7",
"version": "2.2.8-add-format-experimental.0",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc