diff --git a/CHANGELOG.md b/CHANGELOG.md index 045fddb..299088e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.4.0 + +- Switch to Vite for bundling +- Remove `tsup` +- Update dependencies +- Drop support for React v15 & v16 + ## 0.3.0 - Use `tsup` for bundling diff --git a/README.md b/README.md index bc6aefb..5ca905e 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,17 @@ import { BlurhashCanvas } from "react-blurhash"; ## Browser support Blurhash depends on `Uint8ClampedArray`, which is supported on all mainstream browsers and >=IE11. + +## Development + +### Build + +```sh +npm run build +``` + +### Start Development Server + +```sh +npm run dev +``` diff --git a/demo/BlurhashImageEncoder.tsx b/demo/BlurhashImageEncoder.tsx index c0ec981..f893b80 100644 --- a/demo/BlurhashImageEncoder.tsx +++ b/demo/BlurhashImageEncoder.tsx @@ -101,6 +101,9 @@ const getImageData = (image: HTMLImageElement, resolutionX: number, resolutionY: canvas.width = resolutionX; canvas.height = resolutionY; const context = canvas.getContext('2d'); + if (!context) { + throw new Error('Failed to get 2D context'); + } context.drawImage(image, 0, 0, resolutionX, resolutionY); return context.getImageData(0, 0, resolutionX, resolutionY); }; @@ -127,7 +130,11 @@ const BlurhashImageEncoder: React.FunctionComponent = ({ onChange }) => { [data, componentX, componentY], ); - useEffect(() => onChange(blurhash), [blurhash]); + useEffect(() => { + if (blurhash) { + onChange(blurhash); + } + }, [blurhash]); const handleFileChange = useCallback((file: File) => { const imageUrl = URL.createObjectURL(file); @@ -162,7 +169,7 @@ const BlurhashImageEncoder: React.FunctionComponent = ({ onChange }) => { min="1" max="9" value={componentX} - onChange={e => setComponentX(Number(e.target.value))} + onChange={(e) => setComponentX(Number(e.target.value))} /> @@ -171,7 +178,7 @@ const BlurhashImageEncoder: React.FunctionComponent = ({ onChange }) => { min="1" max="9" value={componentY} - onChange={e => setComponentY(Number(e.target.value))} + onChange={(e) => setComponentY(Number(e.target.value))} /> diff --git a/demo/Demo.tsx b/demo/Demo.tsx index 04105e5..ec86cbb 100644 --- a/demo/Demo.tsx +++ b/demo/Demo.tsx @@ -1,5 +1,4 @@ import React, { useState, useMemo } from 'react'; -import { hot } from 'react-hot-loader/root'; import styled from 'styled-components'; import { isBlurhashValid } from 'blurhash'; @@ -152,7 +151,7 @@ const BlurhashDemo = ({ hash }: { hash: string }) => { max="1024" step="8" value={size} - onChange={e => setSize(Number(e.target.value))} + onChange={(e) => setSize(Number(e.target.value))} /> @@ -162,7 +161,7 @@ const BlurhashDemo = ({ hash }: { hash: string }) => { max="128" step="1" value={resolution} - onChange={e => setResolution(Number(e.target.value))} + onChange={(e) => setResolution(Number(e.target.value))} /> @@ -172,7 +171,7 @@ const BlurhashDemo = ({ hash }: { hash: string }) => { max="20" step="1" value={punch} - onChange={e => setPunch(Number(e.target.value))} + onChange={(e) => setPunch(Number(e.target.value))} /> @@ -204,7 +203,7 @@ const BlurhashCanvasDemo = ({ hash }: { hash: string }) => { max="1024" step="8" value={size} - onChange={e => setSize(Number(e.target.value))} + onChange={(e) => setSize(Number(e.target.value))} /> @@ -214,7 +213,7 @@ const BlurhashCanvasDemo = ({ hash }: { hash: string }) => { max="20" step="1" value={punch} - onChange={e => setPunch(Number(e.target.value))} + onChange={(e) => setPunch(Number(e.target.value))} /> @@ -242,7 +241,7 @@ const Demo = () => { setMode(e.target.value as 'hash'), + onChange: (e) => setMode(e.target.value as 'hash'), value: 'hash', checked: mode === 'hash', }} @@ -250,7 +249,7 @@ const Demo = () => { setMode(e.target.value as 'image'), + onChange: (e) => setMode(e.target.value as 'image'), value: 'image', checked: mode === 'image', }} @@ -258,13 +257,13 @@ const Demo = () => { {mode === 'hash' && ( - setHashInput(e.target.value.trim())} /> + setHashInput(e.target.value.trim())} /> )} {mode === 'image' && ( <> Note: encoding is done in the browser only (no server involved)! - setEncodedHash(hash)} value={encodedHash} /> + setEncodedHash(hash)} value={encodedHash} /> )} @@ -312,4 +311,4 @@ const Demo = () => { ); }; -export default hot(Demo); +export default Demo; diff --git a/demo/FileInput.tsx b/demo/FileInput.tsx index 982641a..56ef6bd 100644 --- a/demo/FileInput.tsx +++ b/demo/FileInput.tsx @@ -58,9 +58,9 @@ const FileInput: React.FunctionComponent = ({ const handleChange = useCallback( (event: React.ChangeEvent) => { const { files } = event.currentTarget; - const newFile = files[0]; + const newFile = files ? files[0] : undefined; - if (newFile !== file) { + if (newFile && newFile !== file) { setFile(newFile); onChange(newFile); } diff --git a/demo/dist/react-blurhash.es.js b/demo/dist/react-blurhash.es.js new file mode 100644 index 0000000..4e64e16 --- /dev/null +++ b/demo/dist/react-blurhash.es.js @@ -0,0 +1,528 @@ +import * as he from "react"; +import Oe from "react"; +import { decode as Ae } from "blurhash"; +var S = { exports: {} }, j = {}; +/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var Ee; +function Ne() { + if (Ee) return j; + Ee = 1; + var E = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment"); + function f(g, s, c) { + var l = null; + if (c !== void 0 && (l = "" + c), s.key !== void 0 && (l = "" + s.key), "key" in s) { + c = {}; + for (var v in s) + v !== "key" && (c[v] = s[v]); + } else c = s; + return s = c.ref, { + $$typeof: E, + type: g, + key: l, + ref: s !== void 0 ? s : null, + props: c + }; + } + return j.Fragment = d, j.jsx = f, j.jsxs = f, j; +} +var C = {}; +/** + * @license React + * react-jsx-runtime.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var ge; +function Pe() { + return ge || (ge = 1, process.env.NODE_ENV !== "production" && function() { + function E(e) { + if (e == null) return null; + if (typeof e == "function") + return e.$$typeof === Ce ? null : e.displayName || e.name || null; + if (typeof e == "string") return e; + switch (e) { + case P: + return "Fragment"; + case ye: + return "Portal"; + case Q: + return "Profiler"; + case B: + return "StrictMode"; + case M: + return "Suspense"; + case W: + return "SuspenseList"; + } + if (typeof e == "object") + switch (typeof e.tag == "number" && console.error( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." + ), e.$$typeof) { + case D: + return (e.displayName || "Context") + ".Provider"; + case K: + return (e._context.displayName || "Context") + ".Consumer"; + case Y: + var r = e.render; + return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e; + case $: + return r = e.displayName || null, r !== null ? r : E(e.type) || "Memo"; + case U: + r = e._payload, e = e._init; + try { + return E(e(r)); + } catch { + } + } + return null; + } + function d(e) { + return "" + e; + } + function f(e) { + try { + d(e); + var r = !1; + } catch { + r = !0; + } + if (r) { + r = console; + var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object"; + return t.call( + r, + "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", + n + ), d(e); + } + } + function g() { + } + function s() { + if (T === 0) { + te = console.log, oe = console.info, ne = console.warn, ae = console.error, se = console.group, ue = console.groupCollapsed, ie = console.groupEnd; + var e = { + configurable: !0, + enumerable: !0, + value: g, + writable: !0 + }; + Object.defineProperties(console, { + info: e, + log: e, + warn: e, + error: e, + group: e, + groupCollapsed: e, + groupEnd: e + }); + } + T++; + } + function c() { + if (T--, T === 0) { + var e = { configurable: !0, enumerable: !0, writable: !0 }; + Object.defineProperties(console, { + log: w({}, e, { value: te }), + info: w({}, e, { value: oe }), + warn: w({}, e, { value: ne }), + error: w({}, e, { value: ae }), + group: w({}, e, { value: se }), + groupCollapsed: w({}, e, { value: ue }), + groupEnd: w({}, e, { value: ie }) + }); + } + 0 > T && console.error( + "disabledDepth fell below zero. This is a bug in React. Please file an issue." + ); + } + function l(e) { + if (X === void 0) + try { + throw Error(); + } catch (t) { + var r = t.stack.trim().match(/\n( *(at )?)/); + X = r && r[1] || "", le = -1 < t.stack.indexOf(` + at`) ? " ()" : -1 < t.stack.indexOf("@") ? "@unknown:0:0" : ""; + } + return ` +` + X + e + le; + } + function v(e, r) { + if (!e || J) return ""; + var t = q.get(e); + if (t !== void 0) return t; + J = !0, t = Error.prepareStackTrace, Error.prepareStackTrace = void 0; + var n = null; + n = p.H, p.H = null, s(); + try { + var u = { + DetermineComponentFrameRoot: function() { + try { + if (r) { + var h = function() { + throw Error(); + }; + if (Object.defineProperty(h.prototype, "props", { + set: function() { + throw Error(); + } + }), typeof Reflect == "object" && Reflect.construct) { + try { + Reflect.construct(h, []); + } catch (b) { + var k = b; + } + Reflect.construct(e, [], h); + } else { + try { + h.call(); + } catch (b) { + k = b; + } + e.call(h.prototype); + } + } else { + try { + throw Error(); + } catch (b) { + k = b; + } + (h = e()) && typeof h.catch == "function" && h.catch(function() { + }); + } + } catch (b) { + if (b && k && typeof b.stack == "string") + return [b.stack, k.stack]; + } + return [null, null]; + } + }; + u.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot"; + var a = Object.getOwnPropertyDescriptor( + u.DetermineComponentFrameRoot, + "name" + ); + a && a.configurable && Object.defineProperty( + u.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); + var o = u.DetermineComponentFrameRoot(), m = o[0], _ = o[1]; + if (m && _) { + var i = m.split(` +`), x = _.split(` +`); + for (o = a = 0; a < i.length && !i[a].includes( + "DetermineComponentFrameRoot" + ); ) + a++; + for (; o < x.length && !x[o].includes( + "DetermineComponentFrameRoot" + ); ) + o++; + if (a === i.length || o === x.length) + for (a = i.length - 1, o = x.length - 1; 1 <= a && 0 <= o && i[a] !== x[o]; ) + o--; + for (; 1 <= a && 0 <= o; a--, o--) + if (i[a] !== x[o]) { + if (a !== 1 || o !== 1) + do + if (a--, o--, 0 > o || i[a] !== x[o]) { + var y = ` +` + i[a].replace( + " at new ", + " at " + ); + return e.displayName && y.includes("") && (y = y.replace("", e.displayName)), typeof e == "function" && q.set(e, y), y; + } + while (1 <= a && 0 <= o); + break; + } + } + } finally { + J = !1, p.H = n, c(), Error.prepareStackTrace = t; + } + return i = (i = e ? e.displayName || e.name : "") ? l(i) : "", typeof e == "function" && q.set(e, i), i; + } + function R(e) { + if (e == null) return ""; + if (typeof e == "function") { + var r = e.prototype; + return v( + e, + !(!r || !r.isReactComponent) + ); + } + if (typeof e == "string") return l(e); + switch (e) { + case M: + return l("Suspense"); + case W: + return l("SuspenseList"); + } + if (typeof e == "object") + switch (e.$$typeof) { + case Y: + return e = v(e.render, !1), e; + case $: + return R(e.type); + case U: + r = e._payload, e = e._init; + try { + return R(e(r)); + } catch { + } + } + return ""; + } + function O() { + var e = p.A; + return e === null ? null : e.getOwner(); + } + function pe(e) { + if (re.call(e, "key")) { + var r = Object.getOwnPropertyDescriptor(e, "key").get; + if (r && r.isReactWarning) return !1; + } + return e.key !== void 0; + } + function we(e, r) { + function t() { + ce || (ce = !0, console.error( + "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", + r + )); + } + t.isReactWarning = !0, Object.defineProperty(e, "key", { + get: t, + configurable: !0 + }); + } + function xe() { + var e = E(this.type); + return fe[e] || (fe[e] = !0, console.error( + "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." + )), e = this.props.ref, e !== void 0 ? e : null; + } + function _e(e, r, t, n, u, a) { + return t = a.ref, e = { + $$typeof: N, + type: e, + key: r, + props: a, + _owner: u + }, (t !== void 0 ? t : null) !== null ? Object.defineProperty(e, "ref", { + enumerable: !1, + get: xe + }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: 0 + }), Object.defineProperty(e, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e; + } + function I(e, r, t, n, u, a) { + if (typeof e == "string" || typeof e == "function" || e === P || e === Q || e === B || e === M || e === W || e === je || typeof e == "object" && e !== null && (e.$$typeof === U || e.$$typeof === $ || e.$$typeof === D || e.$$typeof === K || e.$$typeof === Y || e.$$typeof === ke || e.getModuleId !== void 0)) { + var o = r.children; + if (o !== void 0) + if (n) + if (z(o)) { + for (n = 0; n < o.length; n++) + L(o[n], e); + Object.freeze && Object.freeze(o); + } else + console.error( + "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." + ); + else L(o, e); + } else + o = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? n = "null" : z(e) ? n = "array" : e !== void 0 && e.$$typeof === N ? (n = "<" + (E(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : n = typeof e, console.error( + "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", + n, + o + ); + if (re.call(r, "key")) { + o = E(e); + var m = Object.keys(r).filter(function(i) { + return i !== "key"; + }); + n = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", de[o + n] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error( + `A props object containing a "key" prop is being spread into JSX: + let props = %s; + <%s {...props} /> +React keys must be passed directly to JSX without using spread: + let props = %s; + <%s key={someKey} {...props} />`, + n, + o, + m, + o + ), de[o + n] = !0); + } + if (o = null, t !== void 0 && (f(t), o = "" + t), pe(r) && (f(r.key), o = "" + r.key), "key" in r) { + t = {}; + for (var _ in r) + _ !== "key" && (t[_] = r[_]); + } else t = r; + return o && we( + t, + typeof e == "function" ? e.displayName || e.name || "Unknown" : e + ), _e(e, o, a, u, O(), t); + } + function L(e, r) { + if (typeof e == "object" && e && e.$$typeof !== Se) { + if (z(e)) + for (var t = 0; t < e.length; t++) { + var n = e[t]; + A(n) && Z(n, r); + } + else if (A(e)) + e._store && (e._store.validated = 1); + else if (e === null || typeof e != "object" ? t = null : (t = ee && e[ee] || e["@@iterator"], t = typeof t == "function" ? t : null), typeof t == "function" && t !== e.entries && (t = t.call(e), t !== e)) + for (; !(e = t.next()).done; ) + A(e.value) && Z(e.value, r); + } + } + function A(e) { + return typeof e == "object" && e !== null && e.$$typeof === N; + } + function Z(e, r) { + if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, r = Re(r), !ve[r])) { + ve[r] = !0; + var t = ""; + e && e._owner != null && e._owner !== O() && (t = null, typeof e._owner.tag == "number" ? t = E(e._owner.type) : typeof e._owner.name == "string" && (t = e._owner.name), t = " It was passed a child from " + t + "."); + var n = p.getCurrentStack; + p.getCurrentStack = function() { + var u = R(e.type); + return n && (u += n() || ""), u; + }, console.error( + 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', + r, + t + ), p.getCurrentStack = n; + } + } + function Re(e) { + var r = "", t = O(); + return t && (t = E(t.type)) && (r = ` + +Check the render method of \`` + t + "`."), r || (e = E(e)) && (r = ` + +Check the top-level render call using <` + e + ">."), r; + } + var Te = Oe, N = Symbol.for("react.transitional.element"), ye = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), B = Symbol.for("react.strict_mode"), Q = Symbol.for("react.profiler"), K = Symbol.for("react.consumer"), D = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), $ = Symbol.for("react.memo"), U = Symbol.for("react.lazy"), je = Symbol.for("react.offscreen"), ee = Symbol.iterator, Ce = Symbol.for("react.client.reference"), p = Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, re = Object.prototype.hasOwnProperty, w = Object.assign, ke = Symbol.for("react.client.reference"), z = Array.isArray, T = 0, te, oe, ne, ae, se, ue, ie; + g.__reactDisabledLog = !0; + var X, le, J = !1, q = new (typeof WeakMap == "function" ? WeakMap : Map)(), Se = Symbol.for("react.client.reference"), ce, fe = {}, de = {}, ve = {}; + C.Fragment = P, C.jsx = function(e, r, t, n, u) { + return I(e, r, t, !1, n, u); + }, C.jsxs = function(e, r, t, n, u) { + return I(e, r, t, !0, n, u); + }; + }()), C; +} +var me; +function Ye() { + return me || (me = 1, process.env.NODE_ENV === "production" ? S.exports = Ne() : S.exports = Pe()), S.exports; +} +var V = Ye(); +const H = class H extends he.PureComponent { + constructor() { + super(...arguments), this.canvas = null, this.handleRef = (d) => { + this.canvas = d, this.draw(); + }, this.draw = () => { + const { hash: d, height: f, punch: g, width: s } = this.props; + if (this.canvas) { + const c = Ae(d, s ?? 128, f ?? 128, g ?? 1), l = this.canvas.getContext("2d"); + if (l) { + const v = l.createImageData(s ?? 128, f ?? 128); + v.data.set(c), l.putImageData(v, 0, 0); + } + } + }; + } + componentDidUpdate() { + this.draw(); + } + render() { + const { hash: d, height: f, width: g, ...s } = this.props; + return /* @__PURE__ */ V.jsx("canvas", { ...s, height: f, width: g, ref: this.handleRef }); + } +}; +H.defaultProps = { + height: 128, + width: 128 +}; +let G = H; +const Me = { + position: "absolute", + top: 0, + bottom: 0, + left: 0, + right: 0, + width: "100%", + height: "100%" +}, F = class F extends he.PureComponent { + componentDidUpdate() { + if ((this.props.resolutionX ?? 32) <= 0) + throw new Error("resolutionX must be larger than zero"); + if ((this.props.resolutionY ?? 32) <= 0) + throw new Error("resolutionY must be larger than zero"); + } + render() { + const { + hash: d, + height: f, + width: g, + punch: s, + resolutionX: c = 32, + resolutionY: l = 32, + style: v, + ...R + } = this.props; + return /* @__PURE__ */ V.jsx( + "div", + { + ...R, + style: { display: "inline-block", height: f, width: g, ...v, position: "relative" }, + children: /* @__PURE__ */ V.jsx( + G, + { + hash: d, + height: l, + width: c, + punch: s, + style: Me + } + ) + } + ); + } +}; +F.defaultProps = { + height: 128, + width: 128, + resolutionX: 32, + resolutionY: 32 +}; +let be = F; +export { + be as Blurhash, + G as BlurhashCanvas +}; diff --git a/demo/dist/react-blurhash.umd.js b/demo/dist/react-blurhash.umd.js new file mode 100644 index 0000000..25ac3e6 --- /dev/null +++ b/demo/dist/react-blurhash.umd.js @@ -0,0 +1,31 @@ +(function(b,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react"),require("blurhash")):typeof define=="function"&&define.amd?define(["exports","react","blurhash"],T):(b=typeof globalThis<"u"?globalThis:b||self,T(b.ReactBlurhash={},b.React,b.blurhash))})(this,function(b,T,ye){"use strict";function xe(i){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const u in i)if(u!=="default"){const v=Object.getOwnPropertyDescriptor(i,u);Object.defineProperty(c,u,v.get?v:{enumerable:!0,get:()=>i[u]})}}return c.default=i,Object.freeze(c)}const Z=xe(T);var k={exports:{}},R={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Q;function Te(){if(Q)return R;Q=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(v,s,E){var d=null;if(E!==void 0&&(d=""+E),s.key!==void 0&&(d=""+s.key),"key"in s){E={};for(var h in s)h!=="key"&&(E[h]=s[h])}else E=s;return s=E.ref,{$$typeof:i,type:v,key:d,ref:s!==void 0?s:null,props:E}}return R.Fragment=c,R.jsx=u,R.jsxs=u,R}var j={};/** + * @license React + * react-jsx-runtime.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var K;function _e(){return K||(K=1,process.env.NODE_ENV!=="production"&&function(){function i(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case Pe:return"Portal";case ne:return"Profiler";case oe:return"StrictMode";case J:return"Suspense";case V:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case se:return(e.displayName||"Context")+".Provider";case ae:return(e._context.displayName||"Context")+".Consumer";case X:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return r=e.displayName||null,r!==null?r:i(e.type)||"Memo";case H:r=e._payload,e=e._init;try{return i(e(r))}catch{}}return null}function c(e){return""+e}function u(e){try{c(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),c(e)}}function v(){}function s(){if(C===0){le=console.log,ce=console.info,fe=console.warn,de=console.error,ve=console.group,Ee=console.groupCollapsed,he=console.groupEnd;var e={configurable:!0,enumerable:!0,value:v,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}C++}function E(){if(C--,C===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:y({},e,{value:le}),info:y({},e,{value:ce}),warn:y({},e,{value:fe}),error:y({},e,{value:de}),group:y({},e,{value:ve}),groupCollapsed:y({},e,{value:Ee}),groupEnd:y({},e,{value:he})})}0>C&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function d(e){if(F===void 0)try{throw Error()}catch(t){var r=t.stack.trim().match(/\n( *(at )?)/);F=r&&r[1]||"",be=-1)":-1o||f[a]!==x[o]){var S=` +`+f[a].replace(" at new "," at ");return e.displayName&&S.includes("")&&(S=S.replace("",e.displayName)),typeof e=="function"&&L.set(e,S),S}while(1<=a&&0<=o);break}}}finally{I=!1,w.H=n,E(),Error.prepareStackTrace=t}return f=(f=e?e.displayName||e.name:"")?d(f):"",typeof e=="function"&&L.set(e,f),f}function O(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return h(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return d(e);switch(e){case J:return d("Suspense");case V:return d("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case X:return e=h(e.render,!1),e;case G:return O(e.type);case H:r=e._payload,e=e._init;try{return O(e(r))}catch{}}return""}function W(){var e=w.A;return e===null?null:e.getOwner()}function Oe(e){if(ie.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ce(e,r){function t(){ge||(ge=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function Se(){var e=i(this.type);return me[e]||(me[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function ke(e,r,t,n,l,a){return t=a.ref,e={$$typeof:z,type:e,key:r,props:a,_owner:l},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:Se}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function ee(e,r,t,n,l,a){if(typeof e=="string"||typeof e=="function"||e===q||e===ne||e===oe||e===J||e===V||e===Ye||typeof e=="object"&&e!==null&&(e.$$typeof===H||e.$$typeof===G||e.$$typeof===se||e.$$typeof===ae||e.$$typeof===X||e.$$typeof===$e||e.getModuleId!==void 0)){var o=r.children;if(o!==void 0)if(n)if(B(o)){for(n=0;n",o=" Did you accidentally export a JSX literal instead of a component?"):n=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n,o);if(ie.call(r,"key")){o=i(e);var g=Object.keys(r).filter(function(f){return f!=="key"});n=0 +React keys must be passed directly to JSX without using spread: + let props = %s; + <%s key={someKey} {...props} />`,n,o,g,o),pe[o+n]=!0)}if(o=null,t!==void 0&&(u(t),o=""+t),Oe(r)&&(u(r.key),o=""+r.key),"key"in r){t={};for(var _ in r)_!=="key"&&(t[_]=r[_])}else t=r;return o&&Ce(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),ke(e,o,a,l,W(),t)}function re(e,r){if(typeof e=="object"&&e&&e.$$typeof!==We){if(B(e))for(var t=0;t."),r}var Ne=T,z=Symbol.for("react.transitional.element"),Pe=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),oe=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),ae=Symbol.for("react.consumer"),se=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),Ye=Symbol.for("react.offscreen"),ue=Symbol.iterator,Me=Symbol.for("react.client.reference"),w=Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=Object.prototype.hasOwnProperty,y=Object.assign,$e=Symbol.for("react.client.reference"),B=Array.isArray,C=0,le,ce,fe,de,ve,Ee,he;v.__reactDisabledLog=!0;var F,be,I=!1,L=new(typeof WeakMap=="function"?WeakMap:Map),We=Symbol.for("react.client.reference"),ge,me={},pe={},we={};j.Fragment=q,j.jsx=function(e,r,t,n,l){return ee(e,r,t,!1,n,l)},j.jsxs=function(e,r,t,n,l){return ee(e,r,t,!0,n,l)}}()),j}var D;function Re(){return D||(D=1,process.env.NODE_ENV==="production"?k.exports=Te():k.exports=_e()),k.exports}var P=Re();const M=class M extends Z.PureComponent{constructor(){super(...arguments),this.canvas=null,this.handleRef=c=>{this.canvas=c,this.draw()},this.draw=()=>{const{hash:c,height:u,punch:v,width:s}=this.props;if(this.canvas){const E=ye.decode(c,s??128,u??128,v??1),d=this.canvas.getContext("2d");if(d){const h=d.createImageData(s??128,u??128);h.data.set(E),d.putImageData(h,0,0)}}}}componentDidUpdate(){this.draw()}render(){const{hash:c,height:u,width:v,...s}=this.props;return P.jsx("canvas",{...s,height:u,width:v,ref:this.handleRef})}};M.defaultProps={height:128,width:128};let A=M;const je={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"},$=class $ extends Z.PureComponent{componentDidUpdate(){if((this.props.resolutionX??32)<=0)throw new Error("resolutionX must be larger than zero");if((this.props.resolutionY??32)<=0)throw new Error("resolutionY must be larger than zero")}render(){const{hash:c,height:u,width:v,punch:s,resolutionX:E=32,resolutionY:d=32,style:h,...O}=this.props;return P.jsx("div",{...O,style:{display:"inline-block",height:u,width:v,...h,position:"relative"},children:P.jsx(A,{hash:c,height:d,width:E,punch:s,style:je})})}};$.defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};let Y=$;b.Blurhash=Y,b.BlurhashCanvas=A,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}); diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..a9578f2 --- /dev/null +++ b/demo/index.html @@ -0,0 +1,12 @@ + + + + + + React Blurhash Demo + + +
+ + + diff --git a/demo/index.tsx b/demo/index.tsx index 172b7ec..353f602 100644 --- a/demo/index.tsx +++ b/demo/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import ReactDOM from 'react-dom'; +import ReactDOM from 'react-dom/client'; import Demo from './Demo'; const rootElement = document.createElement('div'); @@ -8,4 +8,5 @@ if (!document.querySelector('div')) { document.body.appendChild(rootElement); } -ReactDOM.render(, rootElement); +const root = ReactDOM.createRoot(rootElement); +root.render(); diff --git a/demo/main.tsx b/demo/main.tsx new file mode 100644 index 0000000..775829f --- /dev/null +++ b/demo/main.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +import { createRoot } from 'react-dom/client'; +import Demo from './Demo'; + +const container = document.getElementById('root'); +const root = createRoot(container!); +root.render(); diff --git a/dist/react-blurhash.es.js b/dist/react-blurhash.es.js new file mode 100644 index 0000000..fde48f6 --- /dev/null +++ b/dist/react-blurhash.es.js @@ -0,0 +1,516 @@ +import * as he from "react"; +import Oe from "react"; +import { decode as Ae } from "blurhash"; +var S = { exports: {} }, j = {}; +/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var Ee; +function Ne() { + if (Ee) return j; + Ee = 1; + var E = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment"); + function f(g, s, l) { + var c = null; + if (l !== void 0 && (c = "" + l), s.key !== void 0 && (c = "" + s.key), "key" in s) { + l = {}; + for (var v in s) + v !== "key" && (l[v] = s[v]); + } else l = s; + return s = l.ref, { + $$typeof: E, + type: g, + key: c, + ref: s !== void 0 ? s : null, + props: l + }; + } + return j.Fragment = d, j.jsx = f, j.jsxs = f, j; +} +var C = {}; +/** + * @license React + * react-jsx-runtime.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var ge; +function Pe() { + return ge || (ge = 1, process.env.NODE_ENV !== "production" && function() { + function E(e) { + if (e == null) return null; + if (typeof e == "function") + return e.$$typeof === Ce ? null : e.displayName || e.name || null; + if (typeof e == "string") return e; + switch (e) { + case P: + return "Fragment"; + case ye: + return "Portal"; + case Q: + return "Profiler"; + case B: + return "StrictMode"; + case M: + return "Suspense"; + case W: + return "SuspenseList"; + } + if (typeof e == "object") + switch (typeof e.tag == "number" && console.error( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." + ), e.$$typeof) { + case D: + return (e.displayName || "Context") + ".Provider"; + case K: + return (e._context.displayName || "Context") + ".Consumer"; + case Y: + var r = e.render; + return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e; + case $: + return r = e.displayName || null, r !== null ? r : E(e.type) || "Memo"; + case U: + r = e._payload, e = e._init; + try { + return E(e(r)); + } catch { + } + } + return null; + } + function d(e) { + return "" + e; + } + function f(e) { + try { + d(e); + var r = !1; + } catch { + r = !0; + } + if (r) { + r = console; + var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object"; + return t.call( + r, + "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", + n + ), d(e); + } + } + function g() { + } + function s() { + if (T === 0) { + te = console.log, oe = console.info, ne = console.warn, ae = console.error, se = console.group, ue = console.groupCollapsed, ie = console.groupEnd; + var e = { + configurable: !0, + enumerable: !0, + value: g, + writable: !0 + }; + Object.defineProperties(console, { + info: e, + log: e, + warn: e, + error: e, + group: e, + groupCollapsed: e, + groupEnd: e + }); + } + T++; + } + function l() { + if (T--, T === 0) { + var e = { configurable: !0, enumerable: !0, writable: !0 }; + Object.defineProperties(console, { + log: w({}, e, { value: te }), + info: w({}, e, { value: oe }), + warn: w({}, e, { value: ne }), + error: w({}, e, { value: ae }), + group: w({}, e, { value: se }), + groupCollapsed: w({}, e, { value: ue }), + groupEnd: w({}, e, { value: ie }) + }); + } + 0 > T && console.error( + "disabledDepth fell below zero. This is a bug in React. Please file an issue." + ); + } + function c(e) { + if (X === void 0) + try { + throw Error(); + } catch (t) { + var r = t.stack.trim().match(/\n( *(at )?)/); + X = r && r[1] || "", le = -1 < t.stack.indexOf(` + at`) ? " ()" : -1 < t.stack.indexOf("@") ? "@unknown:0:0" : ""; + } + return ` +` + X + e + le; + } + function v(e, r) { + if (!e || J) return ""; + var t = q.get(e); + if (t !== void 0) return t; + J = !0, t = Error.prepareStackTrace, Error.prepareStackTrace = void 0; + var n = null; + n = p.H, p.H = null, s(); + try { + var u = { + DetermineComponentFrameRoot: function() { + try { + if (r) { + var h = function() { + throw Error(); + }; + if (Object.defineProperty(h.prototype, "props", { + set: function() { + throw Error(); + } + }), typeof Reflect == "object" && Reflect.construct) { + try { + Reflect.construct(h, []); + } catch (b) { + var k = b; + } + Reflect.construct(e, [], h); + } else { + try { + h.call(); + } catch (b) { + k = b; + } + e.call(h.prototype); + } + } else { + try { + throw Error(); + } catch (b) { + k = b; + } + (h = e()) && typeof h.catch == "function" && h.catch(function() { + }); + } + } catch (b) { + if (b && k && typeof b.stack == "string") + return [b.stack, k.stack]; + } + return [null, null]; + } + }; + u.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot"; + var a = Object.getOwnPropertyDescriptor( + u.DetermineComponentFrameRoot, + "name" + ); + a && a.configurable && Object.defineProperty( + u.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); + var o = u.DetermineComponentFrameRoot(), m = o[0], _ = o[1]; + if (m && _) { + var i = m.split(` +`), x = _.split(` +`); + for (o = a = 0; a < i.length && !i[a].includes( + "DetermineComponentFrameRoot" + ); ) + a++; + for (; o < x.length && !x[o].includes( + "DetermineComponentFrameRoot" + ); ) + o++; + if (a === i.length || o === x.length) + for (a = i.length - 1, o = x.length - 1; 1 <= a && 0 <= o && i[a] !== x[o]; ) + o--; + for (; 1 <= a && 0 <= o; a--, o--) + if (i[a] !== x[o]) { + if (a !== 1 || o !== 1) + do + if (a--, o--, 0 > o || i[a] !== x[o]) { + var y = ` +` + i[a].replace( + " at new ", + " at " + ); + return e.displayName && y.includes("") && (y = y.replace("", e.displayName)), typeof e == "function" && q.set(e, y), y; + } + while (1 <= a && 0 <= o); + break; + } + } + } finally { + J = !1, p.H = n, l(), Error.prepareStackTrace = t; + } + return i = (i = e ? e.displayName || e.name : "") ? c(i) : "", typeof e == "function" && q.set(e, i), i; + } + function R(e) { + if (e == null) return ""; + if (typeof e == "function") { + var r = e.prototype; + return v( + e, + !(!r || !r.isReactComponent) + ); + } + if (typeof e == "string") return c(e); + switch (e) { + case M: + return c("Suspense"); + case W: + return c("SuspenseList"); + } + if (typeof e == "object") + switch (e.$$typeof) { + case Y: + return e = v(e.render, !1), e; + case $: + return R(e.type); + case U: + r = e._payload, e = e._init; + try { + return R(e(r)); + } catch { + } + } + return ""; + } + function O() { + var e = p.A; + return e === null ? null : e.getOwner(); + } + function pe(e) { + if (re.call(e, "key")) { + var r = Object.getOwnPropertyDescriptor(e, "key").get; + if (r && r.isReactWarning) return !1; + } + return e.key !== void 0; + } + function we(e, r) { + function t() { + ce || (ce = !0, console.error( + "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", + r + )); + } + t.isReactWarning = !0, Object.defineProperty(e, "key", { + get: t, + configurable: !0 + }); + } + function xe() { + var e = E(this.type); + return fe[e] || (fe[e] = !0, console.error( + "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." + )), e = this.props.ref, e !== void 0 ? e : null; + } + function _e(e, r, t, n, u, a) { + return t = a.ref, e = { + $$typeof: N, + type: e, + key: r, + props: a, + _owner: u + }, (t !== void 0 ? t : null) !== null ? Object.defineProperty(e, "ref", { + enumerable: !1, + get: xe + }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: 0 + }), Object.defineProperty(e, "_debugInfo", { + configurable: !1, + enumerable: !1, + writable: !0, + value: null + }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e; + } + function I(e, r, t, n, u, a) { + if (typeof e == "string" || typeof e == "function" || e === P || e === Q || e === B || e === M || e === W || e === je || typeof e == "object" && e !== null && (e.$$typeof === U || e.$$typeof === $ || e.$$typeof === D || e.$$typeof === K || e.$$typeof === Y || e.$$typeof === ke || e.getModuleId !== void 0)) { + var o = r.children; + if (o !== void 0) + if (n) + if (z(o)) { + for (n = 0; n < o.length; n++) + L(o[n], e); + Object.freeze && Object.freeze(o); + } else + console.error( + "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." + ); + else L(o, e); + } else + o = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? n = "null" : z(e) ? n = "array" : e !== void 0 && e.$$typeof === N ? (n = "<" + (E(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : n = typeof e, console.error( + "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", + n, + o + ); + if (re.call(r, "key")) { + o = E(e); + var m = Object.keys(r).filter(function(i) { + return i !== "key"; + }); + n = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", de[o + n] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error( + `A props object containing a "key" prop is being spread into JSX: + let props = %s; + <%s {...props} /> +React keys must be passed directly to JSX without using spread: + let props = %s; + <%s key={someKey} {...props} />`, + n, + o, + m, + o + ), de[o + n] = !0); + } + if (o = null, t !== void 0 && (f(t), o = "" + t), pe(r) && (f(r.key), o = "" + r.key), "key" in r) { + t = {}; + for (var _ in r) + _ !== "key" && (t[_] = r[_]); + } else t = r; + return o && we( + t, + typeof e == "function" ? e.displayName || e.name || "Unknown" : e + ), _e(e, o, a, u, O(), t); + } + function L(e, r) { + if (typeof e == "object" && e && e.$$typeof !== Se) { + if (z(e)) + for (var t = 0; t < e.length; t++) { + var n = e[t]; + A(n) && Z(n, r); + } + else if (A(e)) + e._store && (e._store.validated = 1); + else if (e === null || typeof e != "object" ? t = null : (t = ee && e[ee] || e["@@iterator"], t = typeof t == "function" ? t : null), typeof t == "function" && t !== e.entries && (t = t.call(e), t !== e)) + for (; !(e = t.next()).done; ) + A(e.value) && Z(e.value, r); + } + } + function A(e) { + return typeof e == "object" && e !== null && e.$$typeof === N; + } + function Z(e, r) { + if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, r = Re(r), !ve[r])) { + ve[r] = !0; + var t = ""; + e && e._owner != null && e._owner !== O() && (t = null, typeof e._owner.tag == "number" ? t = E(e._owner.type) : typeof e._owner.name == "string" && (t = e._owner.name), t = " It was passed a child from " + t + "."); + var n = p.getCurrentStack; + p.getCurrentStack = function() { + var u = R(e.type); + return n && (u += n() || ""), u; + }, console.error( + 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', + r, + t + ), p.getCurrentStack = n; + } + } + function Re(e) { + var r = "", t = O(); + return t && (t = E(t.type)) && (r = ` + +Check the render method of \`` + t + "`."), r || (e = E(e)) && (r = ` + +Check the top-level render call using <` + e + ">."), r; + } + var Te = Oe, N = Symbol.for("react.transitional.element"), ye = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), B = Symbol.for("react.strict_mode"), Q = Symbol.for("react.profiler"), K = Symbol.for("react.consumer"), D = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), $ = Symbol.for("react.memo"), U = Symbol.for("react.lazy"), je = Symbol.for("react.offscreen"), ee = Symbol.iterator, Ce = Symbol.for("react.client.reference"), p = Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, re = Object.prototype.hasOwnProperty, w = Object.assign, ke = Symbol.for("react.client.reference"), z = Array.isArray, T = 0, te, oe, ne, ae, se, ue, ie; + g.__reactDisabledLog = !0; + var X, le, J = !1, q = new (typeof WeakMap == "function" ? WeakMap : Map)(), Se = Symbol.for("react.client.reference"), ce, fe = {}, de = {}, ve = {}; + C.Fragment = P, C.jsx = function(e, r, t, n, u) { + return I(e, r, t, !1, n, u); + }, C.jsxs = function(e, r, t, n, u) { + return I(e, r, t, !0, n, u); + }; + }()), C; +} +var me; +function Ye() { + return me || (me = 1, process.env.NODE_ENV === "production" ? S.exports = Ne() : S.exports = Pe()), S.exports; +} +var V = Ye(); +const H = class H extends he.PureComponent { + constructor() { + super(...arguments), this.canvas = null, this.handleRef = (d) => { + this.canvas = d, this.draw(); + }, this.draw = () => { + const { hash: d, height: f, punch: g, width: s } = this.props; + if (this.canvas) { + const l = Ae(d, s, f, g), c = this.canvas.getContext("2d"), v = c.createImageData(s, f); + v.data.set(l), c.putImageData(v, 0, 0); + } + }; + } + componentDidUpdate() { + this.draw(); + } + render() { + const { hash: d, height: f, width: g, ...s } = this.props; + return /* @__PURE__ */ V.jsx("canvas", { ...s, height: f, width: g, ref: this.handleRef }); + } +}; +H.defaultProps = { + height: 128, + width: 128 +}; +let G = H; +const Me = { + position: "absolute", + top: 0, + bottom: 0, + left: 0, + right: 0, + width: "100%", + height: "100%" +}, F = class F extends he.PureComponent { + componentDidUpdate() { + if (this.props.resolutionX <= 0) + throw new Error("resolutionX must be larger than zero"); + if (this.props.resolutionY <= 0) + throw new Error("resolutionY must be larger than zero"); + } + render() { + const { hash: d, height: f, width: g, punch: s, resolutionX: l, resolutionY: c, style: v, ...R } = this.props; + return /* @__PURE__ */ V.jsx( + "div", + { + ...R, + style: { display: "inline-block", height: f, width: g, ...v, position: "relative" }, + children: /* @__PURE__ */ V.jsx( + G, + { + hash: d, + height: c, + width: l, + punch: s, + style: Me + } + ) + } + ); + } +}; +F.defaultProps = { + height: 128, + width: 128, + resolutionX: 32, + resolutionY: 32 +}; +let be = F; +export { + be as Blurhash, + G as BlurhashCanvas +}; diff --git a/dist/react-blurhash.umd.js b/dist/react-blurhash.umd.js new file mode 100644 index 0000000..415d3f2 --- /dev/null +++ b/dist/react-blurhash.umd.js @@ -0,0 +1,31 @@ +(function(b,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react"),require("blurhash")):typeof define=="function"&&define.amd?define(["exports","react","blurhash"],T):(b=typeof globalThis<"u"?globalThis:b||self,T(b.ReactBlurhash={},b.React,b.blurhash))})(this,function(b,T,ye){"use strict";function xe(i){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const u in i)if(u!=="default"){const d=Object.getOwnPropertyDescriptor(i,u);Object.defineProperty(c,u,d.get?d:{enumerable:!0,get:()=>i[u]})}}return c.default=i,Object.freeze(c)}const Z=xe(T);var k={exports:{}},R={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Q;function Te(){if(Q)return R;Q=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(d,s,v){var E=null;if(v!==void 0&&(E=""+v),s.key!==void 0&&(E=""+s.key),"key"in s){v={};for(var h in s)h!=="key"&&(v[h]=s[h])}else v=s;return s=v.ref,{$$typeof:i,type:d,key:E,ref:s!==void 0?s:null,props:v}}return R.Fragment=c,R.jsx=u,R.jsxs=u,R}var j={};/** + * @license React + * react-jsx-runtime.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var K;function _e(){return K||(K=1,process.env.NODE_ENV!=="production"&&function(){function i(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case Pe:return"Portal";case ne:return"Profiler";case oe:return"StrictMode";case J:return"Suspense";case V:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case se:return(e.displayName||"Context")+".Provider";case ae:return(e._context.displayName||"Context")+".Consumer";case X:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return r=e.displayName||null,r!==null?r:i(e.type)||"Memo";case H:r=e._payload,e=e._init;try{return i(e(r))}catch{}}return null}function c(e){return""+e}function u(e){try{c(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),c(e)}}function d(){}function s(){if(C===0){le=console.log,ce=console.info,fe=console.warn,de=console.error,ve=console.group,Ee=console.groupCollapsed,he=console.groupEnd;var e={configurable:!0,enumerable:!0,value:d,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}C++}function v(){if(C--,C===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:y({},e,{value:le}),info:y({},e,{value:ce}),warn:y({},e,{value:fe}),error:y({},e,{value:de}),group:y({},e,{value:ve}),groupCollapsed:y({},e,{value:Ee}),groupEnd:y({},e,{value:he})})}0>C&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function E(e){if(F===void 0)try{throw Error()}catch(t){var r=t.stack.trim().match(/\n( *(at )?)/);F=r&&r[1]||"",be=-1)":-1o||f[a]!==x[o]){var S=` +`+f[a].replace(" at new "," at ");return e.displayName&&S.includes("")&&(S=S.replace("",e.displayName)),typeof e=="function"&&L.set(e,S),S}while(1<=a&&0<=o);break}}}finally{I=!1,w.H=n,v(),Error.prepareStackTrace=t}return f=(f=e?e.displayName||e.name:"")?E(f):"",typeof e=="function"&&L.set(e,f),f}function O(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return h(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return E(e);switch(e){case J:return E("Suspense");case V:return E("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case X:return e=h(e.render,!1),e;case G:return O(e.type);case H:r=e._payload,e=e._init;try{return O(e(r))}catch{}}return""}function W(){var e=w.A;return e===null?null:e.getOwner()}function Oe(e){if(ie.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ce(e,r){function t(){ge||(ge=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function Se(){var e=i(this.type);return me[e]||(me[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function ke(e,r,t,n,l,a){return t=a.ref,e={$$typeof:z,type:e,key:r,props:a,_owner:l},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:Se}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function ee(e,r,t,n,l,a){if(typeof e=="string"||typeof e=="function"||e===q||e===ne||e===oe||e===J||e===V||e===Ye||typeof e=="object"&&e!==null&&(e.$$typeof===H||e.$$typeof===G||e.$$typeof===se||e.$$typeof===ae||e.$$typeof===X||e.$$typeof===$e||e.getModuleId!==void 0)){var o=r.children;if(o!==void 0)if(n)if(B(o)){for(n=0;n",o=" Did you accidentally export a JSX literal instead of a component?"):n=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n,o);if(ie.call(r,"key")){o=i(e);var g=Object.keys(r).filter(function(f){return f!=="key"});n=0 +React keys must be passed directly to JSX without using spread: + let props = %s; + <%s key={someKey} {...props} />`,n,o,g,o),pe[o+n]=!0)}if(o=null,t!==void 0&&(u(t),o=""+t),Oe(r)&&(u(r.key),o=""+r.key),"key"in r){t={};for(var _ in r)_!=="key"&&(t[_]=r[_])}else t=r;return o&&Ce(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),ke(e,o,a,l,W(),t)}function re(e,r){if(typeof e=="object"&&e&&e.$$typeof!==We){if(B(e))for(var t=0;t."),r}var Ne=T,z=Symbol.for("react.transitional.element"),Pe=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),oe=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),ae=Symbol.for("react.consumer"),se=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),Ye=Symbol.for("react.offscreen"),ue=Symbol.iterator,Me=Symbol.for("react.client.reference"),w=Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=Object.prototype.hasOwnProperty,y=Object.assign,$e=Symbol.for("react.client.reference"),B=Array.isArray,C=0,le,ce,fe,de,ve,Ee,he;d.__reactDisabledLog=!0;var F,be,I=!1,L=new(typeof WeakMap=="function"?WeakMap:Map),We=Symbol.for("react.client.reference"),ge,me={},pe={},we={};j.Fragment=q,j.jsx=function(e,r,t,n,l){return ee(e,r,t,!1,n,l)},j.jsxs=function(e,r,t,n,l){return ee(e,r,t,!0,n,l)}}()),j}var D;function Re(){return D||(D=1,process.env.NODE_ENV==="production"?k.exports=Te():k.exports=_e()),k.exports}var P=Re();const M=class M extends Z.PureComponent{constructor(){super(...arguments),this.canvas=null,this.handleRef=c=>{this.canvas=c,this.draw()},this.draw=()=>{const{hash:c,height:u,punch:d,width:s}=this.props;if(this.canvas){const v=ye.decode(c,s,u,d),E=this.canvas.getContext("2d"),h=E.createImageData(s,u);h.data.set(v),E.putImageData(h,0,0)}}}componentDidUpdate(){this.draw()}render(){const{hash:c,height:u,width:d,...s}=this.props;return P.jsx("canvas",{...s,height:u,width:d,ref:this.handleRef})}};M.defaultProps={height:128,width:128};let A=M;const je={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"},$=class $ extends Z.PureComponent{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){const{hash:c,height:u,width:d,punch:s,resolutionX:v,resolutionY:E,style:h,...O}=this.props;return P.jsx("div",{...O,style:{display:"inline-block",height:u,width:d,...h,position:"relative"},children:P.jsx(A,{hash:c,height:E,width:v,punch:s,style:je})})}};$.defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};let Y=$;b.Blurhash=Y,b.BlurhashCanvas=A,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}); diff --git a/lib/Blurhash.d.ts b/lib/Blurhash.d.ts new file mode 100644 index 0000000..991635c --- /dev/null +++ b/lib/Blurhash.d.ts @@ -0,0 +1,23 @@ +import * as React from 'react'; +type Props = React.HTMLAttributes & { + hash: string; + /** CSS height, default: 128 */ + height?: number | string | 'auto'; + punch?: number; + resolutionX?: number; + resolutionY?: number; + style?: React.CSSProperties; + /** CSS width, default: 128 */ + width?: number | string | 'auto'; +}; +export default class Blurhash extends React.PureComponent { + static defaultProps: { + height: number; + width: number; + resolutionX: number; + resolutionY: number; + }; + componentDidUpdate(): void; + render(): React.JSX.Element; +} +export {}; diff --git a/lib/Blurhash.js b/lib/Blurhash.js new file mode 100644 index 0000000..742081a --- /dev/null +++ b/lib/Blurhash.js @@ -0,0 +1,45 @@ +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +import * as React from 'react'; +import BlurhashCanvas from './BlurhashCanvas'; +const canvasStyle = { + position: 'absolute', + top: 0, + bottom: 0, + left: 0, + right: 0, + width: '100%', + height: '100%', +}; +class Blurhash extends React.PureComponent { + componentDidUpdate() { + if (this.props.resolutionX <= 0) { + throw new Error('resolutionX must be larger than zero'); + } + if (this.props.resolutionY <= 0) { + throw new Error('resolutionY must be larger than zero'); + } + } + render() { + const _a = this.props, { hash, height, width, punch, resolutionX, resolutionY, style } = _a, rest = __rest(_a, ["hash", "height", "width", "punch", "resolutionX", "resolutionY", "style"]); + return (React.createElement("div", Object.assign({}, rest, { style: Object.assign(Object.assign({ display: 'inline-block', height, width }, style), { position: 'relative' }) }), + React.createElement(BlurhashCanvas, { hash: hash, height: resolutionY, width: resolutionX, punch: punch, style: canvasStyle }))); + } +} +Blurhash.defaultProps = { + height: 128, + width: 128, + resolutionX: 32, + resolutionY: 32, +}; +export default Blurhash; +//# sourceMappingURL=Blurhash.js.map \ No newline at end of file diff --git a/lib/Blurhash.js.map b/lib/Blurhash.js.map new file mode 100644 index 0000000..1a6347e --- /dev/null +++ b/lib/Blurhash.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Blurhash.js","sourceRoot":"","sources":["../src/Blurhash.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAc9C,MAAM,WAAW,GAAwB;IACvC,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,CAAC;IACN,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;CACf,CAAC;AAEF,MAAqB,QAAS,SAAQ,KAAK,CAAC,aAAoB;IAQ9D,kBAAkB;QAChB,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,KAA2E,IAAI,CAAC,KAAK,EAArF,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,OAAwB,EAAnB,IAAI,cAAtE,2EAAwE,CAAa,CAAC;QAE5F,OAAO,CACL,6CACM,IAAI,IACR,KAAK,gCAAI,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,IAAK,KAAK,KAAE,QAAQ,EAAE,UAAU;YAE/E,oBAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,WAAW,GAClB,CACE,CACP,CAAC;IACJ,CAAC;;AAlCM,qBAAY,GAAG;IACpB,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,EAAE;CAChB,CAAC;eANiB,QAAQ"} \ No newline at end of file diff --git a/lib/BlurhashCanvas.d.ts b/lib/BlurhashCanvas.d.ts new file mode 100644 index 0000000..d5e0dbf --- /dev/null +++ b/lib/BlurhashCanvas.d.ts @@ -0,0 +1,18 @@ +import * as React from 'react'; +export type Props = React.CanvasHTMLAttributes & { + hash: string; + height?: number; + punch?: number; + width?: number; +}; +export default class BlurhashCanvas extends React.PureComponent { + static defaultProps: { + height: number; + width: number; + }; + canvas: HTMLCanvasElement; + componentDidUpdate(): void; + handleRef: (canvas: HTMLCanvasElement) => void; + draw: () => void; + render(): React.JSX.Element; +} diff --git a/lib/BlurhashCanvas.js b/lib/BlurhashCanvas.js new file mode 100644 index 0000000..01ff698 --- /dev/null +++ b/lib/BlurhashCanvas.js @@ -0,0 +1,46 @@ +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +import * as React from 'react'; +import { decode } from 'blurhash'; +class BlurhashCanvas extends React.PureComponent { + constructor() { + super(...arguments); + this.canvas = null; + this.handleRef = (canvas) => { + this.canvas = canvas; + this.draw(); + }; + this.draw = () => { + const { hash, height, punch, width } = this.props; + if (this.canvas) { + const pixels = decode(hash, width, height, punch); + const ctx = this.canvas.getContext('2d'); + const imageData = ctx.createImageData(width, height); + imageData.data.set(pixels); + ctx.putImageData(imageData, 0, 0); + } + }; + } + componentDidUpdate() { + this.draw(); + } + render() { + const _a = this.props, { hash, height, width } = _a, rest = __rest(_a, ["hash", "height", "width"]); + return React.createElement("canvas", Object.assign({}, rest, { height: height, width: width, ref: this.handleRef })); + } +} +BlurhashCanvas.defaultProps = { + height: 128, + width: 128, +}; +export default BlurhashCanvas; +//# sourceMappingURL=BlurhashCanvas.js.map \ No newline at end of file diff --git a/lib/BlurhashCanvas.js.map b/lib/BlurhashCanvas.js.map new file mode 100644 index 0000000..e67c6cb --- /dev/null +++ b/lib/BlurhashCanvas.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BlurhashCanvas.js","sourceRoot":"","sources":["../src/BlurhashCanvas.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AASlC,MAAqB,cAAe,SAAQ,KAAK,CAAC,aAAoB;IAAtE;;QAME,WAAM,GAAsB,IAAI,CAAC;QAMjC,cAAS,GAAG,CAAC,MAAyB,EAAE,EAAE;YACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YACrB,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC;QAEF,SAAI,GAAG,GAAG,EAAE;YACV,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YAElD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;gBAElD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACzC,MAAM,SAAS,GAAG,GAAG,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBACrD,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBAC3B,GAAG,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACpC,CAAC;QACH,CAAC,CAAC;IAOJ,CAAC;IA3BC,kBAAkB;QAChB,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAoBD,MAAM;QACJ,MAAM,KAAmC,IAAI,CAAC,KAAK,EAA7C,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAwB,EAAnB,IAAI,cAA9B,2BAAgC,CAAa,CAAC;QAEpD,OAAO,gDAAY,IAAI,IAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,IAAI,CAAC;IACjF,CAAC;;AAjCM,2BAAY,GAAG;IACpB,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;CACX,AAHkB,CAGjB;eAJiB,cAAc"} \ No newline at end of file diff --git a/lib/index.d.ts b/lib/index.d.ts new file mode 100644 index 0000000..e20443e --- /dev/null +++ b/lib/index.d.ts @@ -0,0 +1,2 @@ +export { default as Blurhash } from './Blurhash'; +export { default as BlurhashCanvas } from './BlurhashCanvas'; diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..e4cb320 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,3 @@ +export { default as Blurhash } from './Blurhash'; +export { default as BlurhashCanvas } from './BlurhashCanvas'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map new file mode 100644 index 0000000..f6c5f72 --- /dev/null +++ b/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a845801 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1912 @@ +{ + "name": "react-blurhash", + "version": "0.4.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "react-blurhash", + "version": "0.4.0", + "license": "MIT", + "devDependencies": { + "@types/node": "^22.13.1", + "@types/prop-types": "^15.7.14", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@types/styled-components": "^5.1.34", + "@vitejs/plugin-react": "^4.3.4", + "blurhash": "^2.0.5", + "prettier": "3.4.2", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "styled-components": "^6.1.15", + "typescript": "5.7.3", + "vite": "^6.1.0" + }, + "peerDependencies": { + "blurhash": "^2.0.5", + "react": ">=17" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz", + "integrity": "sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.8", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.8", + "@babel/template": "^7.26.8", + "@babel/traverse": "^7.26.8", + "@babel/types": "^7.26.8", + "@types/gensync": "^1.0.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.8.tgz", + "integrity": "sha512-ef383X5++iZHWAXX0SXQR6ZyQhw/0KtTkrTz61WXRhFM6dhpHulO/RJz79L8S6ugZHJkOOkUrUdxgdF2YiPFnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.26.8", + "@babel/types": "^7.26.8", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", + "integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.7.tgz", + "integrity": "sha512-8NHiL98vsi0mbPQmYAGWwfcFaOy4j2HY49fXJCfuDcdE7fMIsH9a7GdaeXpIBsbT7307WU8KCMp5pUVDNL4f9A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.8.tgz", + "integrity": "sha512-TZIQ25pkSoaKEYYaHbbxkfL36GNsQ6iFiBbeuzAkLnXayKR1yP1zFe+NxuZWWsUyvt8icPU9CCq0sgWGXR1GEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.25.9.tgz", + "integrity": "sha512-y8quW6p0WHkEhmErnfe58r7x0A70uKphQm8Sp8cV7tjNQwK56sNVK0M73LK3WuYmsuyrftut4xAkjjgU0twaMg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.25.9.tgz", + "integrity": "sha512-+iqjT8xmXhhYv4/uiYd8FNQsraMFZIfxVSqxxVSZP0WbbSAWvBXAul0m/zu+7Vv4O/3WtApy9pmaTMiumEZgfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.8.tgz", + "integrity": "sha512-iNKaX3ZebKIsCvJ+0jd6embf+Aulaa3vNBqZ41kM7iTWjx5qzWKXGHiJUW3+nTpQ18SG11hdF8OAzKrpXkb96Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.26.8", + "@babel/types": "^7.26.8" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.8.tgz", + "integrity": "sha512-nic9tRkjYH0oB2dzr/JoGIm+4Q6SuYeLEiIiZDwBscRMYFJ+tMAz98fuel9ZnbXViA2I0HVSSRRK8DW5fjXStA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.8", + "@babel/parser": "^7.26.8", + "@babel/template": "^7.26.8", + "@babel/types": "^7.26.8", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.8.tgz", + "integrity": "sha512-eUuWapzEGWFEpHFxgEaBG8e3n6S8L3MSu0oda755rOfabWPnh0Our1AozNFVUxGFIhbKgd1ksprsoDGMinTOTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emotion/is-prop-valid": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", + "integrity": "sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@emotion/memoize": "^0.8.1" + } + }, + "node_modules/@emotion/memoize": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@emotion/unitless": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", + "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz", + "integrity": "sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.2.tgz", + "integrity": "sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.2.tgz", + "integrity": "sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.2.tgz", + "integrity": "sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz", + "integrity": "sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.2.tgz", + "integrity": "sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.2.tgz", + "integrity": "sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.2.tgz", + "integrity": "sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.2.tgz", + "integrity": "sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.2.tgz", + "integrity": "sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.2.tgz", + "integrity": "sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.2.tgz", + "integrity": "sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.2.tgz", + "integrity": "sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.2.tgz", + "integrity": "sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.2.tgz", + "integrity": "sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.2.tgz", + "integrity": "sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.2.tgz", + "integrity": "sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.24.2.tgz", + "integrity": "sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.2.tgz", + "integrity": "sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.2.tgz", + "integrity": "sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.2.tgz", + "integrity": "sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.2.tgz", + "integrity": "sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.2.tgz", + "integrity": "sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.2.tgz", + "integrity": "sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz", + "integrity": "sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.6.tgz", + "integrity": "sha512-+GcCXtOQoWuC7hhX1P00LqjjIiS/iOouHXhMdiDSnq/1DGTox4SpUvO52Xm+div6+106r+TcvOeo/cxvyEyTgg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.6.tgz", + "integrity": "sha512-E8+2qCIjciYUnCa1AiVF1BkRgqIGW9KzJeesQqVfyRITGQN+dFuoivO0hnro1DjT74wXLRZ7QF8MIbz+luGaJA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.6.tgz", + "integrity": "sha512-z9Ib+OzqN3DZEjX7PDQMHEhtF+t6Mi2z/ueChQPLS/qUMKY7Ybn5A2ggFoKRNRh1q1T03YTQfBTQCJZiepESAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.6.tgz", + "integrity": "sha512-PShKVY4u0FDAR7jskyFIYVyHEPCPnIQY8s5OcXkdU8mz3Y7eXDJPdyM/ZWjkYdR2m0izD9HHWA8sGcXn+Qrsyg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.6.tgz", + "integrity": "sha512-YSwyOqlDAdKqs0iKuqvRHLN4SrD2TiswfoLfvYXseKbL47ht1grQpq46MSiQAx6rQEN8o8URtpXARCpqabqxGQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.6.tgz", + "integrity": "sha512-HEP4CgPAY1RxXwwL5sPFv6BBM3tVeLnshF03HMhJYCNc6kvSqBgTMmsEjb72RkZBAWIqiPUyF1JpEBv5XT9wKQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.6.tgz", + "integrity": "sha512-88fSzjC5xeH9S2Vg3rPgXJULkHcLYMkh8faix8DX4h4TIAL65ekwuQMA/g2CXq8W+NJC43V6fUpYZNjaX3+IIg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.6.tgz", + "integrity": "sha512-wM4ztnutBqYFyvNeR7Av+reWI/enK9tDOTKNF+6Kk2Q96k9bwhDDOlnCUNRPvromlVXo04riSliMBs/Z7RteEg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.6.tgz", + "integrity": "sha512-9RyprECbRa9zEjXLtvvshhw4CMrRa3K+0wcp3KME0zmBe1ILmvcVHnypZ/aIDXpRyfhSYSuN4EPdCCj5Du8FIA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.6.tgz", + "integrity": "sha512-qTmklhCTyaJSB05S+iSovfo++EwnIEZxHkzv5dep4qoszUMX5Ca4WM4zAVUMbfdviLgCSQOu5oU8YoGk1s6M9Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.6.tgz", + "integrity": "sha512-4Qmkaps9yqmpjY5pvpkfOerYgKNUGzQpFxV6rnS7c/JfYbDSU0y6WpbbredB5cCpLFGJEqYX40WUmxMkwhWCjw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.6.tgz", + "integrity": "sha512-Zsrtux3PuaxuBTX/zHdLaFmcofWGzaWW1scwLU3ZbW/X+hSsFbz9wDIp6XvnT7pzYRl9MezWqEqKy7ssmDEnuQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.6.tgz", + "integrity": "sha512-aK+Zp+CRM55iPrlyKiU3/zyhgzWBxLVrw2mwiQSYJRobCURb781+XstzvA8Gkjg/hbdQFuDw44aUOxVQFycrAg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.6.tgz", + "integrity": "sha512-WoKLVrY9ogmaYPXwTH326+ErlCIgMmsoRSx6bO+l68YgJnlOXhygDYSZe/qbUJCSiCiZAQ+tKm88NcWuUXqOzw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.6.tgz", + "integrity": "sha512-Sht4aFvmA4ToHd2vFzwMFaQCiYm2lDFho5rPcvPBT5pCdC+GwHG6CMch4GQfmWTQ1SwRKS0dhDYb54khSrjDWw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.6.tgz", + "integrity": "sha512-zmmpOQh8vXc2QITsnCiODCDGXFC8LMi64+/oPpPx5qz3pqv0s6x46ps4xoycfUiVZps5PFn1gksZzo4RGTKT+A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.6.tgz", + "integrity": "sha512-3/q1qUsO/tLqGBaD4uXsB6coVGB3usxw3qyeVb59aArCgedSF66MPdgRStUd7vbZOsko/CgVaY5fo2vkvPLWiA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.6.tgz", + "integrity": "sha512-oLHxuyywc6efdKVTxvc0135zPrRdtYVjtVD5GUm55I3ODxhU/PwkQFD97z16Xzxa1Fz0AEe4W/2hzRtd+IfpOA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.6.tgz", + "integrity": "sha512-0PVwmgzZ8+TZ9oGBmdZoQVXflbvuwzN/HRclujpl4N/q3i+y0lqLw8n1bXA8ru3sApDjlmONaNAuYr38y1Kr9w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/gensync": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz", + "integrity": "sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/hoist-non-react-statics": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.6.tgz", + "integrity": "sha512-lPByRJUer/iN/xa4qpyL0qmL11DqNW81iU/IG1S3uvRUq4oKagz8VCxZjiWkumgt66YT3vOdDgZ0o32sGKtCEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, + "node_modules/@types/node": { + "version": "22.13.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.1.tgz", + "integrity": "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "node_modules/@types/prop-types": { + "version": "15.7.14", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.14.tgz", + "integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.0.8", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.8.tgz", + "integrity": "sha512-9P/o1IGdfmQxrujGbIMDyYaaCykhLKc0NGCtYcECNUr9UAaDe4gwvV9bR6tvd5Br1SG0j+PBpbKr2UYY8CwqSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.0.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.0.3.tgz", + "integrity": "sha512-0Knk+HJiMP/qOZgMyNFamlIjw9OFCsyC2ZbigmEEyXXixgre6IQpm/4V+r3qH4GC1JPvRJKInw+on2rV6YZLeA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.0.0" + } + }, + "node_modules/@types/styled-components": { + "version": "5.1.34", + "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-5.1.34.tgz", + "integrity": "sha512-mmiVvwpYklFIv9E8qfxuPyIt/OuyIrn6gMOAMOFUO3WJfSrSE+sGUoa4PiZj77Ut7bKZpaa6o1fBKS/4TOEvnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/hoist-non-react-statics": "*", + "@types/react": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/stylis": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.5.tgz", + "integrity": "sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.4.tgz", + "integrity": "sha512-SCCPBJtYLdE8PX/7ZQAs1QAZ8Jqwih+0VBLum1EGqmCCQal+MIUqLCzj3ZUy8ufbC0cAM4LRlSTm7IQJwWT4ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.26.0", + "@babel/plugin-transform-react-jsx-self": "^7.25.9", + "@babel/plugin-transform-react-jsx-source": "^7.25.9", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.14.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0" + } + }, + "node_modules/blurhash": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/blurhash/-/blurhash-2.0.5.tgz", + "integrity": "sha512-cRygWd7kGBQO3VEhPiTgq4Wc43ctsM+o46urrmPOiuAe+07fzlSB9OJVdpgDL0jPqXUVQ9ht7aq7kxOeJHRK+w==", + "dev": true, + "license": "MIT" + }, + "node_modules/browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/camelize": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", + "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001699", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001699.tgz", + "integrity": "sha512-b+uH5BakXZ9Do9iK+CkDmctUSEqZl+SP056vc5usa0PL+ev5OHw003rZXcnjNDv3L8P5j6rwT6C0BPKSikW08w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/css-color-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", + "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=4" + } + }, + "node_modules/css-to-react-native": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", + "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelize": "^1.0.0", + "css-color-keywords": "^1.0.0", + "postcss-value-parser": "^4.0.2" + } + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.96", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.96.tgz", + "integrity": "sha512-8AJUW6dh75Fm/ny8+kZKJzI1pgoE8bKLZlzDU2W1ENd+DXKJrx7I7l9hb8UWR4ojlnb5OlixMt00QWiYJoVw1w==", + "dev": true, + "license": "ISC" + }, + "node_modules/esbuild": { + "version": "0.24.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.2.tgz", + "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.24.2", + "@esbuild/android-arm": "0.24.2", + "@esbuild/android-arm64": "0.24.2", + "@esbuild/android-x64": "0.24.2", + "@esbuild/darwin-arm64": "0.24.2", + "@esbuild/darwin-x64": "0.24.2", + "@esbuild/freebsd-arm64": "0.24.2", + "@esbuild/freebsd-x64": "0.24.2", + "@esbuild/linux-arm": "0.24.2", + "@esbuild/linux-arm64": "0.24.2", + "@esbuild/linux-ia32": "0.24.2", + "@esbuild/linux-loong64": "0.24.2", + "@esbuild/linux-mips64el": "0.24.2", + "@esbuild/linux-ppc64": "0.24.2", + "@esbuild/linux-riscv64": "0.24.2", + "@esbuild/linux-s390x": "0.24.2", + "@esbuild/linux-x64": "0.24.2", + "@esbuild/netbsd-arm64": "0.24.2", + "@esbuild/netbsd-x64": "0.24.2", + "@esbuild/openbsd-arm64": "0.24.2", + "@esbuild/openbsd-x64": "0.24.2", + "@esbuild/sunos-x64": "0.24.2", + "@esbuild/win32-arm64": "0.24.2", + "@esbuild/win32-ia32": "0.24.2", + "@esbuild/win32-x64": "0.24.2" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/prettier": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/react": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz", + "integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.0.0.tgz", + "integrity": "sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "scheduler": "^0.25.0" + }, + "peerDependencies": { + "react": "^19.0.0" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/react-refresh": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", + "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.6.tgz", + "integrity": "sha512-wc2cBWqJgkU3Iz5oztRkQbfVkbxoz5EhnCGOrnJvnLnQ7O0WhQUYyv18qQI79O8L7DdHrrlJNeCHd4VGpnaXKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.34.6", + "@rollup/rollup-android-arm64": "4.34.6", + "@rollup/rollup-darwin-arm64": "4.34.6", + "@rollup/rollup-darwin-x64": "4.34.6", + "@rollup/rollup-freebsd-arm64": "4.34.6", + "@rollup/rollup-freebsd-x64": "4.34.6", + "@rollup/rollup-linux-arm-gnueabihf": "4.34.6", + "@rollup/rollup-linux-arm-musleabihf": "4.34.6", + "@rollup/rollup-linux-arm64-gnu": "4.34.6", + "@rollup/rollup-linux-arm64-musl": "4.34.6", + "@rollup/rollup-linux-loongarch64-gnu": "4.34.6", + "@rollup/rollup-linux-powerpc64le-gnu": "4.34.6", + "@rollup/rollup-linux-riscv64-gnu": "4.34.6", + "@rollup/rollup-linux-s390x-gnu": "4.34.6", + "@rollup/rollup-linux-x64-gnu": "4.34.6", + "@rollup/rollup-linux-x64-musl": "4.34.6", + "@rollup/rollup-win32-arm64-msvc": "4.34.6", + "@rollup/rollup-win32-ia32-msvc": "4.34.6", + "@rollup/rollup-win32-x64-msvc": "4.34.6", + "fsevents": "~2.3.2" + } + }, + "node_modules/scheduler": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.25.0.tgz", + "integrity": "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/styled-components": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.15.tgz", + "integrity": "sha512-PpOTEztW87Ua2xbmLa7yssjNyUF9vE7wdldRfn1I2E6RTkqknkBYpj771OxM/xrvRGinLy2oysa7GOd7NcZZIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@emotion/is-prop-valid": "1.2.2", + "@emotion/unitless": "0.8.1", + "@types/stylis": "4.2.5", + "css-to-react-native": "3.2.0", + "csstype": "3.1.3", + "postcss": "8.4.49", + "shallowequal": "1.1.0", + "stylis": "4.3.2", + "tslib": "2.6.2" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/styled-components" + }, + "peerDependencies": { + "react": ">= 16.8.0", + "react-dom": ">= 16.8.0" + } + }, + "node_modules/stylis": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.2.tgz", + "integrity": "sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true, + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true, + "license": "MIT" + }, + "node_modules/update-browserslist-db": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/vite": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.1.0.tgz", + "integrity": "sha512-RjjMipCKVoR4hVfPY6GQTgveinjNuyLw+qruksLDvA5ktI1150VmcMBKmQaEWJhg/j6Uaf6dNCNA0AfdzUb/hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.24.2", + "postcss": "^8.5.1", + "rollup": "^4.30.1" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/postcss": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", + "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + } + } +} diff --git a/package.json b/package.json index ed52437..d2fdf80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-blurhash", - "version": "0.3.0", + "version": "0.4.0", "description": "Blurhash implementation for React", "keywords": ["blurhash", "blur", "hash", "image", "react", "component"], "license": "MIT", @@ -13,37 +13,33 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "module": "dist/esm/index.js", + "type": "module", "scripts": { "prepublishOnly": "npm run build", - "build": "tsup", - "build:demo": "rm -rf ./docs && webpack -p --config webpack.demo.config.js", - "demo": "webpack-dev-server --config webpack.demo.config.js --hot --progress", + "build": "vite build", + "demo": "vite --config vite.config.ts", "prettier": "prettier src/**/*.ts", "prettier-fix": "npm run prettier -- --write", "ts": "tsc", "ts:watch": "npm run ts -- --noEmit --watch" }, "peerDependencies": { - "blurhash": "^2.0.3", - "react": ">=15" + "blurhash": "^2.0.5", + "react": ">=17" }, "devDependencies": { - "@types/prop-types": "^15.7.3", - "@types/react": "^16.9.53", - "@types/react-dom": "^16.9.8", - "@types/styled-components": "^5.1.4", - "blurhash": "^2.0.3", - "html-webpack-plugin": "^4.5.0", - "prettier": "2.1.2", - "react": "^16.8.6", - "react-dom": "^16.8.6", - "react-hot-loader": "^4.13.0", - "styled-components": "^5.2.0", - "ts-loader": "8.0.6", - "tsup": "^6.5.0", - "typescript": "4.0.3", - "webpack": "4.44.2", - "webpack-cli": "3.3.12", - "webpack-dev-server": "3.11.0" + "@types/node": "^22.13.1", + "@types/prop-types": "^15.7.14", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@types/styled-components": "^5.1.34", + "@vitejs/plugin-react": "^4.3.4", + "blurhash": "^2.0.5", + "prettier": "3.4.2", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "styled-components": "^6.1.15", + "typescript": "5.7.3", + "vite": "^6.1.0" } } diff --git a/src/Blurhash.tsx b/src/Blurhash.tsx index 6bab779..e88323d 100644 --- a/src/Blurhash.tsx +++ b/src/Blurhash.tsx @@ -33,17 +33,26 @@ export default class Blurhash extends React.PureComponent { }; componentDidUpdate() { - if (this.props.resolutionX <= 0) { + if ((this.props.resolutionX ?? 32) <= 0) { throw new Error('resolutionX must be larger than zero'); } - if (this.props.resolutionY <= 0) { + if ((this.props.resolutionY ?? 32) <= 0) { throw new Error('resolutionY must be larger than zero'); } } render() { - const { hash, height, width, punch, resolutionX, resolutionY, style, ...rest } = this.props; + const { + hash, + height, + width, + punch, + resolutionX = 32, + resolutionY = 32, + style, + ...rest + } = this.props; return (
& { hash: string; - height?: number; - punch?: number; - width?: number; + height: number | undefined; + punch: number | undefined; + width: number | undefined; }; export default class BlurhashCanvas extends React.PureComponent { @@ -14,7 +14,7 @@ export default class BlurhashCanvas extends React.PureComponent { width: 128, }; - canvas: HTMLCanvasElement = null; + canvas: HTMLCanvasElement | null = null; componentDidUpdate() { this.draw(); @@ -29,12 +29,14 @@ export default class BlurhashCanvas extends React.PureComponent { const { hash, height, punch, width } = this.props; if (this.canvas) { - const pixels = decode(hash, width, height, punch); + const pixels = decode(hash, width ?? 128, height ?? 128, punch ?? 1); const ctx = this.canvas.getContext('2d'); - const imageData = ctx.createImageData(width, height); - imageData.data.set(pixels); - ctx.putImageData(imageData, 0, 0); + if (ctx) { + const imageData = ctx.createImageData(width ?? 128, height ?? 128); + imageData.data.set(pixels); + ctx.putImageData(imageData, 0, 0); + } } }; diff --git a/tsconfig.demo.json b/tsconfig.demo.json index 1f60450..33fa61c 100644 --- a/tsconfig.demo.json +++ b/tsconfig.demo.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "rootDir": ".", - "module": "commonjs", + "module": "esnext", "declaration": false, "allowJs": true, "esModuleInterop": true diff --git a/tsconfig.json b/tsconfig.json index a293324..0e6fbe4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,11 @@ { "compilerOptions": { - "module": "commonjs", + "module": "esnext", + "strict": true, + "esModuleInterop": true, "moduleResolution": "node", "target": "es6", - "lib": ["esnext", "dom"], + "lib": ["dom", "dom.iterable", "esnext"], "declaration": true, "outDir": "./lib", "sourceMap": true, diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..56990ea --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,28 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +import path from 'path'; + +export default defineConfig({ + plugins: [react({})], + build: { + lib: { + entry: path.resolve(__dirname, 'src/index.ts'), + name: 'ReactBlurhash', + fileName: (format) => `react-blurhash.${format}.js`, + }, + rollupOptions: { + external: ['react', 'react-dom', 'blurhash'], + output: { + globals: { + react: 'React', + 'react-dom': 'ReactDOM', + blurhash: 'blurhash', + }, + }, + }, + }, + server: { + open: '/demo/index.html', + }, + root: path.resolve(__dirname, 'demo'), +});