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

react-blurhash

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-blurhash - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

docs/demo.f335462148ad584661d8.js

2

es/Blurhash.d.ts

@@ -1,2 +0,2 @@

import React from 'react';
import * as React from 'react';
declare type Props = React.HTMLAttributes<HTMLDivElement> & {

@@ -3,0 +3,0 @@ hash: string;

@@ -5,3 +5,3 @@ var __extends = (this && this.__extends) || (function () {

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -37,3 +37,3 @@ };

};
import React from 'react';
import * as React from 'react';
import BlurhashCanvas from './BlurhashCanvas';

@@ -64,3 +64,3 @@ var canvasStyle = {

var _a = this.props, hash = _a.hash, height = _a.height, width = _a.width, punch = _a.punch, resolutionX = _a.resolutionX, resolutionY = _a.resolutionY, style = _a.style, rest = __rest(_a, ["hash", "height", "width", "punch", "resolutionX", "resolutionY", "style"]);
return (React.createElement("div", __assign({}, rest, { style: __assign({ display: 'inline-block', height: height, width: width }, style, { position: 'relative' }) }),
return (React.createElement("div", __assign({}, rest, { style: __assign(__assign({ display: 'inline-block', height: height, width: width }, style), { position: 'relative' }) }),
React.createElement(BlurhashCanvas, { hash: hash, height: resolutionY, width: resolutionX, punch: punch, style: canvasStyle })));

@@ -67,0 +67,0 @@ };

@@ -1,2 +0,2 @@

import React from 'react';
import * as React from 'react';
export declare type Props = React.CanvasHTMLAttributes<HTMLCanvasElement> & {

@@ -3,0 +3,0 @@ hash: string;

@@ -5,3 +5,3 @@ var __extends = (this && this.__extends) || (function () {

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -37,3 +37,3 @@ };

};
import React from 'react';
import * as React from 'react';
import { decode } from 'blurhash';

@@ -40,0 +40,0 @@ var BlurhashCanvas = /** @class */ (function (_super) {

@@ -1,2 +0,2 @@

import React from 'react';
import * as React from 'react';
declare type Props = React.HTMLAttributes<HTMLDivElement> & {

@@ -3,0 +3,0 @@ hash: string;

@@ -6,3 +6,3 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -27,2 +27,21 @@ };

};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __rest = (this && this.__rest) || function (s, e) {

@@ -39,5 +58,8 @@ var t = {};

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = require("react");
var BlurhashCanvas_1 = require("./BlurhashCanvas");
var React = __importStar(require("react"));
var BlurhashCanvas_1 = __importDefault(require("./BlurhashCanvas"));
var canvasStyle = {

@@ -67,4 +89,4 @@ position: 'absolute',

var _a = this.props, hash = _a.hash, height = _a.height, width = _a.width, punch = _a.punch, resolutionX = _a.resolutionX, resolutionY = _a.resolutionY, style = _a.style, rest = __rest(_a, ["hash", "height", "width", "punch", "resolutionX", "resolutionY", "style"]);
return (react_1.default.createElement("div", __assign({}, rest, { style: __assign({ display: 'inline-block', height: height, width: width }, style, { position: 'relative' }) }),
react_1.default.createElement(BlurhashCanvas_1.default, { hash: hash, height: resolutionY, width: resolutionX, punch: punch, style: canvasStyle })));
return (React.createElement("div", __assign({}, rest, { style: __assign(__assign({ display: 'inline-block', height: height, width: width }, style), { position: 'relative' }) }),
React.createElement(BlurhashCanvas_1.default, { hash: hash, height: resolutionY, width: resolutionX, punch: punch, style: canvasStyle })));
};

@@ -78,4 +100,4 @@ Blurhash.defaultProps = {

return Blurhash;
}(react_1.default.PureComponent));
}(React.PureComponent));
exports.default = Blurhash;
//# sourceMappingURL=Blurhash.js.map

@@ -1,2 +0,2 @@

import React from 'react';
import * as React from 'react';
export declare type Props = React.CanvasHTMLAttributes<HTMLCanvasElement> & {

@@ -3,0 +3,0 @@ hash: string;

@@ -6,3 +6,3 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -27,2 +27,21 @@ };

};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __rest = (this && this.__rest) || function (s, e) {

@@ -40,3 +59,3 @@ var t = {};

Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = require("react");
var React = __importStar(require("react"));
var blurhash_1 = require("blurhash");

@@ -69,3 +88,3 @@ var BlurhashCanvas = /** @class */ (function (_super) {

var _a = this.props, hash = _a.hash, height = _a.height, width = _a.width, rest = __rest(_a, ["hash", "height", "width"]);
return react_1.default.createElement("canvas", __assign({}, rest, { height: height, width: width, ref: this.handleRef }));
return React.createElement("canvas", __assign({}, rest, { height: height, width: width, ref: this.handleRef }));
};

@@ -77,4 +96,4 @@ BlurhashCanvas.defaultProps = {

return BlurhashCanvas;
}(react_1.default.PureComponent));
}(React.PureComponent));
exports.default = BlurhashCanvas;
//# sourceMappingURL=BlurhashCanvas.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BlurhashCanvas = exports.Blurhash = void 0;
var Blurhash_1 = require("./Blurhash");
exports.Blurhash = Blurhash_1.default;
Object.defineProperty(exports, "Blurhash", { enumerable: true, get: function () { return __importDefault(Blurhash_1).default; } });
var BlurhashCanvas_1 = require("./BlurhashCanvas");
exports.BlurhashCanvas = BlurhashCanvas_1.default;
Object.defineProperty(exports, "BlurhashCanvas", { enumerable: true, get: function () { return __importDefault(BlurhashCanvas_1).default; } });
//# sourceMappingURL=index.js.map
{
"name": "react-blurhash",
"version": "0.1.2",
"version": "0.1.3",
"description": "Blurhash implementation for React",
"keywords": ["blurhash", "blur", "hash", "image", "react", "component"],
"keywords": [
"blurhash",
"blur",
"hash",
"image",
"react",
"component"
],
"license": "MIT",

@@ -21,3 +28,3 @@ "author": "nygardk",

"build:es": "rm -rf ./es && npm run ts -- --module es2015 --outDir ./es",
"build:lib": "rm -rf ./lib && npm run ts -- --module commonjs --outDir ./lib",
"build:lib": "rm -rf ./lib && npm run ts -- --module commonjs --outDir ./lib --esModuleInterop true",
"demo": "webpack-dev-server --config webpack.demo.config.js --hot --progress",

@@ -30,22 +37,23 @@ "prettier": "prettier src/**/*.ts",

"peerDependencies": {
"blurhash": "^1.1.1"
"blurhash": "^1.1.1",
"react": ">=15"
},
"devDependencies": {
"@types/prop-types": "^15.7.1",
"@types/react": "^16.8.22",
"@types/react-dom": "^16.8.4",
"@types/styled-components": "^4.1.16",
"@types/prop-types": "^15.7.3",
"@types/react": "^16.9.53",
"@types/react-dom": "^16.9.8",
"@types/styled-components": "^5.1.4",
"blurhash": "^1.1.2",
"html-webpack-plugin": "^3.2.0",
"prettier": "1.18.2",
"html-webpack-plugin": "^4.5.0",
"prettier": "2.1.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-hot-loader": "^4.11.1",
"styled-components": "^4.3.2",
"ts-loader": "6.0.4",
"typescript": "3.5.2",
"webpack": "4.35.0",
"webpack-cli": "^3.3.5",
"webpack-dev-server": "3.7.2"
"react-hot-loader": "^4.13.0",
"styled-components": "^5.2.0",
"ts-loader": "8.0.6",
"typescript": "4.0.3",
"webpack": "4.44.2",
"webpack-cli": "3.3.12",
"webpack-dev-server": "3.11.0"
}
}

@@ -26,3 +26,3 @@ # react-blurhash

`Blurhash` component is the recommended way to render blurashes in your React projects.
`Blurhash` component is the recommended way to render blurhashes in your React projects.
It uses `BlurhashCanvas` and a wrapping `div` to scale the decoded image to your desired size. You may control the quality of the decoded image with `resolutionX` and `resolutionY` props.

@@ -29,0 +29,0 @@

@@ -35,2 +35,3 @@ const path = require('path');

hash: false,
minify: false,
filename: 'index.html',

@@ -37,0 +38,0 @@ title: 'react-blurhash demo',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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