@pixzle/react 0.0.29 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/PixzleImage.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ImageInfo } from "@pixzle/core";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
export interface PixzleImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src" | "onError"> {
|
|
4
4
|
blockSize: number;
|
|
5
|
-
seed: number
|
|
5
|
+
seed: number;
|
|
6
6
|
imageInfo: ImageInfo;
|
|
7
7
|
image: string | Blob;
|
|
8
8
|
/**
|
package/dist/usePixzleImage.d.ts
CHANGED
package/dist/usePixzleImage.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.usePixzleImage = void 0;
|
|
4
|
-
const browser_1 = require("@pixzle/browser");
|
|
7
|
+
const browser_1 = __importDefault(require("@pixzle/browser"));
|
|
5
8
|
const react_1 = require("react");
|
|
6
9
|
const usePixzleImage = ({ blockSize, seed, imageInfo, image, }) => {
|
|
7
10
|
const [src, setSrc] = (0, react_1.useState)(undefined);
|
|
@@ -11,10 +14,14 @@ const usePixzleImage = ({ blockSize, seed, imageInfo, image, }) => {
|
|
|
11
14
|
let active = true;
|
|
12
15
|
setIsLoading(true);
|
|
13
16
|
setError(null);
|
|
14
|
-
const restorer = new browser_1.BrowserImageRestorer();
|
|
15
17
|
const restore = async () => {
|
|
16
18
|
try {
|
|
17
|
-
const restoredBitmap = await
|
|
19
|
+
const restoredBitmap = await browser_1.default.restoreImage({
|
|
20
|
+
image,
|
|
21
|
+
blockSize,
|
|
22
|
+
seed,
|
|
23
|
+
imageInfo,
|
|
24
|
+
});
|
|
18
25
|
if (!active)
|
|
19
26
|
return;
|
|
20
27
|
// Convert ImageBitmap to Blob URL to display in <img>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePixzleImage.js","sourceRoot":"","sources":["../src/usePixzleImage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePixzleImage.js","sourceRoot":"","sources":["../src/usePixzleImage.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAqC;AAErC,iCAA4C;AAerC,MAAM,cAAc,GAAG,CAAC,EAC7B,SAAS,EACT,IAAI,EACJ,SAAS,EACT,KAAK,GACe,EAAwB,EAAE;IAC9C,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,IAAA,gBAAQ,EAAqB,SAAS,CAAC,CAAC;IAC9D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAe,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAU,IAAI,CAAC,CAAC;IAE1D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE;YACzB,IAAI,CAAC;gBACH,MAAM,cAAc,GAAG,MAAM,iBAAM,CAAC,YAAY,CAAC;oBAC/C,KAAK;oBACL,SAAS;oBACT,IAAI;oBACJ,SAAS;iBACV,CAAC,CAAC;gBAEH,IAAI,CAAC,MAAM;oBAAE,OAAO;gBAEpB,sDAAsD;gBACtD,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;gBAChD,MAAM,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC;gBACpC,MAAM,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAA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CAAC,CAAC;IAExC,yBAAyB;IACzB,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,IAAI,GAAG,EAAE,CAAC;gBACR,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC,CAAC;AA1EW,QAAA,cAAc,kBA0EzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixzle/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"description": "React components for pixzle",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@pixzle/browser": "0.0.
|
|
38
|
-
"@pixzle/core": "0.0.
|
|
37
|
+
"@pixzle/browser": "0.0.30",
|
|
38
|
+
"@pixzle/core": "0.0.30"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": ">=16.8.0",
|