@evolu/react-web 1.0.1-preview.5 → 1.0.1-preview.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EvoluIdenticon.d.ts +9 -0
- package/dist/EvoluIdenticon.d.ts.map +1 -0
- package/dist/EvoluIdenticon.js +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -6
- package/src/EvoluIdenticon.tsx +28 -0
- package/src/index.ts +1 -1
- package/dist/EvoluAvatar.d.ts +0 -8
- package/dist/EvoluAvatar.d.ts.map +0 -1
- package/dist/EvoluAvatar.js +0 -7
- package/src/EvoluAvatar.tsx +0 -19
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type IdenticonStyle, type OwnerId } from "@evolu/common";
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
export declare const EvoluIdenticon: FC<{
|
|
4
|
+
id: OwnerId;
|
|
5
|
+
size?: number;
|
|
6
|
+
borderRadius?: number;
|
|
7
|
+
style?: IdenticonStyle;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=EvoluIdenticon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvoluIdenticon.d.ts","sourceRoot":"","sources":["../src/EvoluIdenticon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAEpC,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB,CAeA,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createIdenticon, } from "@evolu/common";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
export const EvoluIdenticon = ({ id, size = 32, borderRadius = 3, style }) => {
|
|
5
|
+
const svg = useMemo(() => createIdenticon(id, style), [id, style]);
|
|
6
|
+
const uri = useMemo(() => `data:image/svg+xml,${encodeURIComponent(svg)}`, [svg]);
|
|
7
|
+
return (_jsx("img", { src: uri, width: size, height: size, style: { width: size, height: size, borderRadius }, alt: "Identicon" }));
|
|
8
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EvoluDeps } from "@evolu/common/evolu";
|
|
2
2
|
import { localAuth } from "@evolu/web";
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./EvoluIdenticon.js";
|
|
4
4
|
export { localAuth };
|
|
5
5
|
export declare const evoluReactWebDeps: EvoluDeps;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAgB,SAAS,EAAE,MAAM,YAAY,CAAC;AAGrD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAgB,SAAS,EAAE,MAAM,YAAY,CAAC;AAGrD,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB,eAAO,MAAM,iBAAiB,EAAE,SAG/B,CAAC"}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolu/react-web",
|
|
3
|
-
"version": "1.0.1-preview.
|
|
3
|
+
"version": "1.0.1-preview.6",
|
|
4
4
|
"description": "Evolu for React (web platform)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"evolu",
|
|
@@ -29,9 +29,6 @@
|
|
|
29
29
|
"src/**",
|
|
30
30
|
"README.md"
|
|
31
31
|
],
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"blo": "^2.0.0"
|
|
34
|
-
},
|
|
35
32
|
"devDependencies": {
|
|
36
33
|
"@types/react": "~19.1.13",
|
|
37
34
|
"@types/react-dom": "~19.1.9",
|
|
@@ -41,12 +38,12 @@
|
|
|
41
38
|
"typescript": "^5.9.2",
|
|
42
39
|
"user-agent-data-types": "^0.4.2",
|
|
43
40
|
"vitest": "^4.0.4",
|
|
44
|
-
"@evolu/common": "6.0.1-preview.
|
|
41
|
+
"@evolu/common": "6.0.1-preview.26",
|
|
45
42
|
"@evolu/tsconfig": "0.0.2",
|
|
46
43
|
"@evolu/web": "1.0.1-preview.7"
|
|
47
44
|
},
|
|
48
45
|
"peerDependencies": {
|
|
49
|
-
"@evolu/common": "^6.0.1-preview.
|
|
46
|
+
"@evolu/common": "^6.0.1-preview.26",
|
|
50
47
|
"@evolu/web": "^1.0.1-preview.7",
|
|
51
48
|
"react": ">=19",
|
|
52
49
|
"react-dom": ">=19"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createIdenticon,
|
|
3
|
+
type IdenticonStyle,
|
|
4
|
+
type OwnerId,
|
|
5
|
+
} from "@evolu/common";
|
|
6
|
+
import { FC, useMemo } from "react";
|
|
7
|
+
|
|
8
|
+
export const EvoluIdenticon: FC<{
|
|
9
|
+
id: OwnerId;
|
|
10
|
+
size?: number;
|
|
11
|
+
borderRadius?: number;
|
|
12
|
+
style?: IdenticonStyle;
|
|
13
|
+
}> = ({ id, size = 32, borderRadius = 3, style }) => {
|
|
14
|
+
const svg = useMemo(() => createIdenticon(id, style), [id, style]);
|
|
15
|
+
const uri = useMemo(
|
|
16
|
+
() => `data:image/svg+xml,${encodeURIComponent(svg)}`,
|
|
17
|
+
[svg],
|
|
18
|
+
);
|
|
19
|
+
return (
|
|
20
|
+
<img
|
|
21
|
+
src={uri}
|
|
22
|
+
width={size}
|
|
23
|
+
height={size}
|
|
24
|
+
style={{ width: size, height: size, borderRadius }}
|
|
25
|
+
alt="Identicon"
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { EvoluDeps } from "@evolu/common/evolu";
|
|
|
2
2
|
import { evoluWebDeps, localAuth } from "@evolu/web";
|
|
3
3
|
import { flushSync } from "react-dom";
|
|
4
4
|
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./EvoluIdenticon.js";
|
|
6
6
|
export { localAuth };
|
|
7
7
|
|
|
8
8
|
export const evoluReactWebDeps: EvoluDeps = {
|
package/dist/EvoluAvatar.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EvoluAvatar.d.ts","sourceRoot":"","sources":["../src/EvoluAvatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAEpC,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAUA,CAAC"}
|
package/dist/EvoluAvatar.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { blo } from "blo";
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
export const EvoluAvatar = ({ id, size = 32, borderRadius = 3 }) => {
|
|
5
|
-
const uri = useMemo(() => blo(`0x${id}`), [id]);
|
|
6
|
-
return (_jsx("img", { src: uri, width: size, height: size, style: { width: size, height: size, borderRadius } }));
|
|
7
|
-
};
|
package/src/EvoluAvatar.tsx
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { OwnerId } from "@evolu/common";
|
|
2
|
-
import { blo } from "blo";
|
|
3
|
-
import { FC, useMemo } from "react";
|
|
4
|
-
|
|
5
|
-
export const EvoluAvatar: FC<{
|
|
6
|
-
id: OwnerId;
|
|
7
|
-
size?: number;
|
|
8
|
-
borderRadius?: number;
|
|
9
|
-
}> = ({ id, size = 32, borderRadius = 3 }) => {
|
|
10
|
-
const uri = useMemo(() => blo(`0x${id}`), [id]);
|
|
11
|
-
return (
|
|
12
|
-
<img
|
|
13
|
-
src={uri}
|
|
14
|
-
width={size}
|
|
15
|
-
height={size}
|
|
16
|
-
style={{ width: size, height: size, borderRadius }}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
};
|