Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-capture-element
Advanced tools
Readme
react-capture-element allows you to capture all React Element, including images, pdf.
$ yarn add react-capture-element
$ git clone https://github.com/jinsunee/react-capture-element.git
$ cd react-capture-element
$ yarn
$ yarn storybook
import React, { useState } from "react";
import { CaptureElement } from "../src";
export default function Example() {
const [dataUrl, setDataUrl] = useState<string>();
return (
<div
style={{
width: "100%",
height: "100vh",
display: "flex",
justifyContent: "center",
}}
>
<div
style={{
position: "relative",
overflow: "hidden",
width: 400,
height: 400,
}}
>
<CaptureElement onCapture={({ dataUrl, blob }) => setDataUrl(dataUrl)}>
{({
captureMode,
captureStatus,
onStartCapture,
onStopCapture,
onResetCapture,
cropPositionLeft,
cropPositionTop,
cropWidth,
cropHeight,
}) => (
<>
<button onClick={onStartCapture}>start Capture</button>
<div
style={{
backgroundColor: 'purple',
height: 300,
width: 300,
display: "flex",
justifyContent: "center",
alignItems: "center",
fontWeight: "bold",
fontSize: 20,
}}
>
Capture me!
</div>
{captureStatus === "DONE" && captureMode === "ON" && (
<div
style={{
position: "absolute",
left: cropPositionLeft + cropWidth - 20,
top: cropPositionTop + cropHeight,
zIndex: 999,
}}
>
<button onClick={onResetCapture}>Reset Capture</button>
<button onClick={onStopCapture}>Stop Capture</button>
</div>
)}
</>
)}
</CaptureElement>
</div>
<div style={{ flex: 1 }}>
{dataUrl != null && (
<img alt="data-url-image" src={dataUrl} style={{ width: 300 }} />
)}
</div>
</div>
);
}
FAQs
react-capture-element allows you to capture all React Element, including images, pdf.
The npm package react-capture-element receives a total of 13 weekly downloads. As such, react-capture-element popularity was classified as not popular.
We found that react-capture-element demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.