react-ronin
Advanced tools
Comparing version 2.2.7-add-fit-aspect-experimental.0 to 2.2.7-add-fit-aspect-experimental.1
/// <reference types="web" /> | ||
import { type CSSProperties } from "react"; | ||
import React, { type CSSProperties } from "react"; | ||
import type { StoredObject } from "ronin/types"; | ||
@@ -64,3 +64,3 @@ export interface ImageProps { | ||
} | ||
declare const Image: import("react").ForwardRefExoticComponent<ImageProps & import("react").RefAttributes<HTMLDivElement>>; | ||
declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLDivElement>>; | ||
export default Image; |
"use client"; | ||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; | ||
import { useCallback, useRef, forwardRef } from "react"; | ||
import React, { useCallback, useRef, forwardRef, } from "react"; | ||
const supportedFitValues = ["fill", "contain", "cover"]; | ||
@@ -48,3 +47,3 @@ const Image = forwardRef(({ src: input, alt, size: defaultSize, width: defaultWidth, height: defaultHeight, fit = "cover", aspect, quality, loading, style, className, }, ref) => { | ||
const placeholder = input && typeof input !== "string" ? input.placeholder?.base64 : null; | ||
return (_jsxs("div", { ref: ref, className: className, style: { | ||
return (React.createElement("div", { ref: ref, className: className, style: { | ||
position: "relative", | ||
@@ -57,14 +56,16 @@ overflow: "hidden", | ||
...style, | ||
}, children: [placeholder && (_jsx("img", { style: { | ||
position: "absolute", | ||
width: "100%", | ||
height: "100%", | ||
objectFit: fit, | ||
}, src: placeholder, alt: alt })), _jsx("img", { alt: alt, style: { | ||
position: "absolute", | ||
width: "100%", | ||
height: "100%", | ||
objectFit: fit, | ||
}, decoding: "async", onLoad: onLoad, loading: loading, ref: imageElement, src: source, srcSet: responsiveSource })] })); | ||
} }, | ||
placeholder && (React.createElement("img", { style: { | ||
position: "absolute", | ||
width: "100%", | ||
height: "100%", | ||
objectFit: fit, | ||
}, src: placeholder, alt: alt })), | ||
React.createElement("img", { alt: alt, style: { | ||
position: "absolute", | ||
width: "100%", | ||
height: "100%", | ||
objectFit: fit, | ||
}, decoding: "async", onLoad: onLoad, loading: loading, ref: imageElement, src: source, srcSet: responsiveSource }))); | ||
}); | ||
export default Image; |
@@ -1,2 +0,2 @@ | ||
import type { ReactHTML, ReactNode } from "react"; | ||
import React, { type ReactHTML } from "react"; | ||
export type RichTextContent = { | ||
@@ -41,3 +41,3 @@ type: "doc" | "paragraph" | "blockquote" | "codeBlock" | "bulletList" | "listItem"; | ||
components?: ReactHTML; | ||
}) => (string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined)[]; | ||
}) => (string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined)[]; | ||
export default RichText; |
@@ -1,2 +0,2 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import React, {} from "react"; | ||
const RichText = ({ data, components, }) => { | ||
@@ -34,7 +34,7 @@ const items = Array.isArray(data) ? data : [data]; | ||
const RenderingElement = Element; | ||
return RenderingElement ? (_jsx(RenderingElement, { ...attributes, children: final })) : (final); | ||
return RenderingElement ? (React.createElement(RenderingElement, { ...attributes }, final)) : (final); | ||
}, item.text); | ||
} | ||
let Element = null; | ||
let children = item.content ? (_jsx(RichText, { data: item.content, components: components })) : null; | ||
let children = item.content ? (React.createElement(RichText, { data: item.content, components: components })) : null; | ||
let language = "plaintext"; | ||
@@ -86,7 +86,7 @@ switch (item.type) { | ||
const RenderingElement = Element; | ||
return RenderingElement ? (_jsx(RenderingElement, { language: language, children: children }, (typeof RenderingElement === "string" | ||
? RenderingElement | ||
: RenderingElement.name) + String(position))) : (children); | ||
return RenderingElement ? (React.createElement(RenderingElement, { key: (typeof RenderingElement === "string" | ||
? RenderingElement | ||
: RenderingElement.name) + String(position), language: language }, children)) : (children); | ||
}); | ||
}; | ||
export default RichText; |
{ | ||
"name": "react-ronin", | ||
"version": "2.2.7-add-fit-aspect-experimental.0", | ||
"version": "2.2.7-add-fit-aspect-experimental.1", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
277
27666