@evolu/react-native 12.0.1-preview.6 → 12.0.1-preview.8
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/components/EvoluIdenticon.d.ts +9 -0
- package/dist/components/EvoluIdenticon.d.ts.map +1 -0
- package/dist/components/EvoluIdenticon.js +14 -0
- package/dist/expo-sqlite.d.ts +0 -1
- package/dist/expo-sqlite.d.ts.map +1 -1
- package/dist/expo-sqlite.js +0 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/op-sqlite.d.ts +0 -1
- package/dist/op-sqlite.d.ts.map +1 -1
- package/dist/op-sqlite.js +0 -1
- package/dist/utils/LocalAuth.d.ts.map +1 -1
- package/dist/utils/LocalAuth.js +27 -27
- package/package.json +14 -3
- package/src/components/EvoluIdenticon.tsx +25 -0
- package/src/expo-sqlite.ts +0 -2
- package/src/index.ts +1 -0
- package/src/op-sqlite.ts +0 -2
- package/src/utils/LocalAuth.ts +64 -39
- package/dist/components/EvoluAvatar.d.ts +0 -8
- package/dist/components/EvoluAvatar.d.ts.map +0 -1
- package/dist/components/EvoluAvatar.js +0 -14
- package/src/components/EvoluAvatar.tsx +0 -27
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { IdenticonStyle, OwnerId } from "@evolu/common";
|
|
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/components/EvoluIdenticon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AACpC,OAAO,EAAmB,cAAc,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEzE,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,CAcA,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { SvgXml } from "react-native-svg";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { createIdenticon } from "@evolu/common";
|
|
6
|
+
export const EvoluIdenticon = ({ id, size = 32, borderRadius = 3, style }) => {
|
|
7
|
+
const svg = useMemo(() => createIdenticon(id, style), [id, style]);
|
|
8
|
+
return id ? (_jsx(View, { style: {
|
|
9
|
+
width: size,
|
|
10
|
+
height: size,
|
|
11
|
+
borderRadius,
|
|
12
|
+
overflow: "hidden",
|
|
13
|
+
}, children: _jsx(SvgXml, { xml: svg, width: size, height: size }) })) : null;
|
|
14
|
+
};
|
package/dist/expo-sqlite.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expo-sqlite.d.ts","sourceRoot":"","sources":["../src/expo-sqlite.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,SAAS,EAEV,MAAM,qBAAqB,CAAC;AA2B7B,
|
|
1
|
+
{"version":3,"file":"expo-sqlite.d.ts","sourceRoot":"","sources":["../src/expo-sqlite.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,SAAS,EAEV,MAAM,qBAAqB,CAAC;AA2B7B,eAAO,MAAM,SAAS,mCAGpB,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,SAMlC,CAAC"}
|
package/dist/expo-sqlite.js
CHANGED
|
@@ -19,7 +19,6 @@ const createDbWorker = () => createDbWorkerForPlatform({
|
|
|
19
19
|
const reloadApp = () => {
|
|
20
20
|
void Expo.reloadAppAsync();
|
|
21
21
|
};
|
|
22
|
-
export * from "./components/EvoluAvatar.js";
|
|
23
22
|
export const localAuth = createLocalAuth({
|
|
24
23
|
randomBytes: randomBytes,
|
|
25
24
|
secureStorage: createSecureStore(),
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components/EvoluIdenticon.js";
|
package/dist/op-sqlite.d.ts
CHANGED
package/dist/op-sqlite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"op-sqlite.d.ts","sourceRoot":"","sources":["../src/op-sqlite.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,SAAS,EAEV,MAAM,qBAAqB,CAAC;AA+B7B,
|
|
1
|
+
{"version":3,"file":"op-sqlite.d.ts","sourceRoot":"","sources":["../src/op-sqlite.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,SAAS,EAEV,MAAM,qBAAqB,CAAC;AA+B7B,eAAO,MAAM,SAAS,mCAGpB,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,SAMlC,CAAC"}
|
package/dist/op-sqlite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalAuth.d.ts","sourceRoot":"","sources":["../../src/utils/LocalAuth.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"LocalAuth.d.ts","sourceRoot":"","sources":["../../src/utils/LocalAuth.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,aAAa,EAId,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,iBAAiB,QAAO,aAqEpC,CAAC"}
|
package/dist/utils/LocalAuth.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import KVStore from
|
|
2
|
-
import * as SecureStore from
|
|
3
|
-
import { AUTH_DEFAULT_OPTIONS } from
|
|
1
|
+
import KVStore from "expo-sqlite/kv-store";
|
|
2
|
+
import * as SecureStore from "expo-secure-store";
|
|
3
|
+
import { AUTH_DEFAULT_OPTIONS } from "@evolu/common";
|
|
4
4
|
export const createSecureStore = () => {
|
|
5
5
|
const store = {
|
|
6
6
|
setItem: async (key, value, options) => {
|
|
7
7
|
const rnsiOpts = convertOptions(options);
|
|
8
|
-
const service = options?.service ??
|
|
9
|
-
const metadata = createMetadata(options?.accessControl ===
|
|
10
|
-
await KVStore.setItem(`${service}-${key}`,
|
|
8
|
+
const service = options?.service ?? "default";
|
|
9
|
+
const metadata = createMetadata(options?.accessControl === "none");
|
|
10
|
+
await KVStore.setItem(`${service}-${key}`, "1");
|
|
11
11
|
await SecureStore.setItemAsync(key, JSON.stringify({ value, metadata }), rnsiOpts);
|
|
12
12
|
return { metadata };
|
|
13
13
|
},
|
|
14
14
|
getItem: async (key, options) => {
|
|
15
15
|
const rnsiOpts = convertOptions(options);
|
|
16
|
-
const service = options?.service ??
|
|
16
|
+
const service = options?.service ?? "default";
|
|
17
17
|
let data;
|
|
18
18
|
try {
|
|
19
19
|
const result = await SecureStore.getItemAsync(key, rnsiOpts);
|
|
@@ -28,7 +28,7 @@ export const createSecureStore = () => {
|
|
|
28
28
|
},
|
|
29
29
|
deleteItem: async (key, options) => {
|
|
30
30
|
const rnsiOpts = convertOptions(options);
|
|
31
|
-
const service = options?.service ??
|
|
31
|
+
const service = options?.service ?? "default";
|
|
32
32
|
await Promise.all([
|
|
33
33
|
KVStore.removeItemAsync(`${service}-${key}`),
|
|
34
34
|
SecureStore.deleteItemAsync(key, rnsiOpts),
|
|
@@ -37,17 +37,21 @@ export const createSecureStore = () => {
|
|
|
37
37
|
},
|
|
38
38
|
getAllItems: async (options) => {
|
|
39
39
|
const keys = await KVStore.getAllKeysAsync();
|
|
40
|
-
const service = options?.service ??
|
|
41
|
-
const metadata = createMetadata(options?.accessControl ===
|
|
40
|
+
const service = options?.service ?? "default";
|
|
41
|
+
const metadata = createMetadata(options?.accessControl === "none");
|
|
42
42
|
return keys
|
|
43
|
-
.filter(key => key.startsWith(`${service}-`))
|
|
44
|
-
.map(key => ({
|
|
43
|
+
.filter((key) => key.startsWith(`${service}-`))
|
|
44
|
+
.map((key) => ({
|
|
45
|
+
key: key.slice(service.length + 1),
|
|
46
|
+
service,
|
|
47
|
+
metadata,
|
|
48
|
+
}));
|
|
45
49
|
},
|
|
46
50
|
clearService: async (options) => {
|
|
47
51
|
const rnsiOpts = convertOptions(options);
|
|
48
|
-
const service = options?.service ??
|
|
52
|
+
const service = options?.service ?? "default";
|
|
49
53
|
const items = await store.getAllItems(options);
|
|
50
|
-
await KVStore.multiRemove(items.map(item => `${service}-${item.key}`));
|
|
54
|
+
await KVStore.multiRemove(items.map((item) => `${service}-${item.key}`));
|
|
51
55
|
await Promise.all(items.map(async (item) => {
|
|
52
56
|
await SecureStore.deleteItemAsync(item.key, rnsiOpts);
|
|
53
57
|
}));
|
|
@@ -68,24 +72,20 @@ const createMetadata = (isSecure = true) => {
|
|
|
68
72
|
};
|
|
69
73
|
};
|
|
70
74
|
function convertOptions(options) {
|
|
71
|
-
const accessGroup = options?.keychainGroup
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
?? 'biometryCurrentSet');
|
|
80
|
-
const authenticationPrompt = options?.authenticationPrompt?.title
|
|
81
|
-
?? AUTH_DEFAULT_OPTIONS.authenticationPrompt?.title
|
|
82
|
-
?? '';
|
|
75
|
+
const accessGroup = options?.keychainGroup ?? AUTH_DEFAULT_OPTIONS.keychainGroup ?? "";
|
|
76
|
+
const keychainService = options?.service ?? AUTH_DEFAULT_OPTIONS.service ?? "";
|
|
77
|
+
const keychainAccessible = convertKeychainAccessible(options?.accessControl ??
|
|
78
|
+
AUTH_DEFAULT_OPTIONS.accessControl ??
|
|
79
|
+
"biometryCurrentSet");
|
|
80
|
+
const authenticationPrompt = options?.authenticationPrompt?.title ??
|
|
81
|
+
AUTH_DEFAULT_OPTIONS.authenticationPrompt?.title ??
|
|
82
|
+
"";
|
|
83
83
|
return {
|
|
84
84
|
accessGroup,
|
|
85
85
|
keychainService,
|
|
86
86
|
keychainAccessible,
|
|
87
87
|
authenticationPrompt,
|
|
88
|
-
requireAuthentication: options?.accessControl !==
|
|
88
|
+
requireAuthentication: options?.accessControl !== "none",
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
function convertKeychainAccessible(accessControl) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolu/react-native",
|
|
3
|
-
"version": "12.0.1-preview.
|
|
3
|
+
"version": "12.0.1-preview.8",
|
|
4
4
|
"description": "Evolu for React Native and Expo",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"evolu",
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"homepage": "https://evolu.dev",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js",
|
|
25
|
+
"react-native": "./dist/index.js"
|
|
26
|
+
},
|
|
22
27
|
"./expo-sqlite": {
|
|
23
28
|
"types": "./dist/expo-sqlite.d.ts",
|
|
24
29
|
"default": "./dist/expo-sqlite.js",
|
|
@@ -34,6 +39,9 @@
|
|
|
34
39
|
},
|
|
35
40
|
"typesVersions": {
|
|
36
41
|
"*": {
|
|
42
|
+
".": [
|
|
43
|
+
"./dist/index.d.ts"
|
|
44
|
+
],
|
|
37
45
|
"expo-sqlite": [
|
|
38
46
|
"./dist/expo-sqlite.d.ts"
|
|
39
47
|
],
|
|
@@ -47,6 +55,9 @@
|
|
|
47
55
|
"src/**",
|
|
48
56
|
"README.md"
|
|
49
57
|
],
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"blo": "^2.0.0"
|
|
60
|
+
},
|
|
50
61
|
"devDependencies": {
|
|
51
62
|
"@op-engineering/op-sqlite": "^15.0.3",
|
|
52
63
|
"expo": "^54.0.10",
|
|
@@ -59,12 +70,12 @@
|
|
|
59
70
|
"shx": "^0.4.0",
|
|
60
71
|
"typescript": "^5.9.2",
|
|
61
72
|
"vitest": "^4.0.4",
|
|
62
|
-
"@evolu/common": "6.0.1-preview.
|
|
73
|
+
"@evolu/common": "6.0.1-preview.26",
|
|
63
74
|
"@evolu/react": "9.0.1-preview.6",
|
|
64
75
|
"@evolu/tsconfig": "0.0.2"
|
|
65
76
|
},
|
|
66
77
|
"peerDependencies": {
|
|
67
|
-
"@evolu/common": "^6.0.1-preview.
|
|
78
|
+
"@evolu/common": "^6.0.1-preview.26",
|
|
68
79
|
"@evolu/react": "^9.0.1-preview.6",
|
|
69
80
|
"@op-engineering/op-sqlite": ">=12",
|
|
70
81
|
"expo": ">=54",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { View } from "react-native";
|
|
2
|
+
import { SvgXml } from "react-native-svg";
|
|
3
|
+
import { FC, useMemo } from "react";
|
|
4
|
+
import { createIdenticon, IdenticonStyle, OwnerId } from "@evolu/common";
|
|
5
|
+
|
|
6
|
+
export const EvoluIdenticon: FC<{
|
|
7
|
+
id: OwnerId;
|
|
8
|
+
size?: number;
|
|
9
|
+
borderRadius?: number;
|
|
10
|
+
style?: IdenticonStyle;
|
|
11
|
+
}> = ({ id, size = 32, borderRadius = 3, style }) => {
|
|
12
|
+
const svg = useMemo(() => createIdenticon(id, style), [id, style]);
|
|
13
|
+
return id ? (
|
|
14
|
+
<View
|
|
15
|
+
style={{
|
|
16
|
+
width: size,
|
|
17
|
+
height: size,
|
|
18
|
+
borderRadius,
|
|
19
|
+
overflow: "hidden",
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
<SvgXml xml={svg} width={size} height={size} />
|
|
23
|
+
</View>
|
|
24
|
+
) : null;
|
|
25
|
+
};
|
package/src/expo-sqlite.ts
CHANGED
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components/EvoluIdenticon.js";
|
package/src/op-sqlite.ts
CHANGED
package/src/utils/LocalAuth.ts
CHANGED
|
@@ -1,28 +1,41 @@
|
|
|
1
|
-
import KVStore from
|
|
2
|
-
import * as SecureStore from
|
|
3
|
-
import { AUTH_DEFAULT_OPTIONS } from
|
|
1
|
+
import KVStore from "expo-sqlite/kv-store";
|
|
2
|
+
import * as SecureStore from "expo-secure-store";
|
|
3
|
+
import { AUTH_DEFAULT_OPTIONS } from "@evolu/common";
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
LocalAuthOptions,
|
|
7
|
+
SecureStorage,
|
|
8
|
+
SensitiveInfoItem,
|
|
9
|
+
StorageMetadata,
|
|
10
|
+
AccessControl,
|
|
11
|
+
} from "@evolu/common";
|
|
6
12
|
|
|
7
13
|
export const createSecureStore = (): SecureStorage => {
|
|
8
14
|
const store: SecureStorage = {
|
|
9
15
|
setItem: async (key, value, options) => {
|
|
10
16
|
const rnsiOpts = convertOptions(options);
|
|
11
|
-
const service = options?.service ??
|
|
12
|
-
const metadata = createMetadata(options?.accessControl ===
|
|
13
|
-
await KVStore.setItem(`${service}-${key}`,
|
|
14
|
-
await SecureStore.setItemAsync(
|
|
17
|
+
const service = options?.service ?? "default";
|
|
18
|
+
const metadata = createMetadata(options?.accessControl === "none");
|
|
19
|
+
await KVStore.setItem(`${service}-${key}`, "1");
|
|
20
|
+
await SecureStore.setItemAsync(
|
|
21
|
+
key,
|
|
22
|
+
JSON.stringify({ value, metadata }),
|
|
23
|
+
rnsiOpts,
|
|
24
|
+
);
|
|
15
25
|
return { metadata };
|
|
16
26
|
},
|
|
17
27
|
|
|
18
28
|
getItem: async (key, options) => {
|
|
19
29
|
const rnsiOpts = convertOptions(options);
|
|
20
|
-
const service = options?.service ??
|
|
21
|
-
let data: {value: string; metadata: StorageMetadata};
|
|
30
|
+
const service = options?.service ?? "default";
|
|
31
|
+
let data: { value: string; metadata: StorageMetadata };
|
|
22
32
|
try {
|
|
23
33
|
const result = await SecureStore.getItemAsync(key, rnsiOpts);
|
|
24
34
|
if (!result) return null;
|
|
25
|
-
data = JSON.parse(result) as {
|
|
35
|
+
data = JSON.parse(result) as {
|
|
36
|
+
value: string;
|
|
37
|
+
metadata: StorageMetadata;
|
|
38
|
+
};
|
|
26
39
|
} catch (_error) {
|
|
27
40
|
return null;
|
|
28
41
|
}
|
|
@@ -31,7 +44,7 @@ export const createSecureStore = (): SecureStorage => {
|
|
|
31
44
|
|
|
32
45
|
deleteItem: async (key, options) => {
|
|
33
46
|
const rnsiOpts = convertOptions(options);
|
|
34
|
-
const service = options?.service ??
|
|
47
|
+
const service = options?.service ?? "default";
|
|
35
48
|
await Promise.all([
|
|
36
49
|
KVStore.removeItemAsync(`${service}-${key}`),
|
|
37
50
|
SecureStore.deleteItemAsync(key, rnsiOpts),
|
|
@@ -41,21 +54,27 @@ export const createSecureStore = (): SecureStorage => {
|
|
|
41
54
|
|
|
42
55
|
getAllItems: async (options) => {
|
|
43
56
|
const keys = await KVStore.getAllKeysAsync();
|
|
44
|
-
const service = options?.service ??
|
|
45
|
-
const metadata = createMetadata(options?.accessControl ===
|
|
57
|
+
const service = options?.service ?? "default";
|
|
58
|
+
const metadata = createMetadata(options?.accessControl === "none");
|
|
46
59
|
return keys
|
|
47
|
-
.filter(key => key.startsWith(`${service}-`))
|
|
48
|
-
.map(key => ({
|
|
60
|
+
.filter((key) => key.startsWith(`${service}-`))
|
|
61
|
+
.map((key) => ({
|
|
62
|
+
key: key.slice(service.length + 1),
|
|
63
|
+
service,
|
|
64
|
+
metadata,
|
|
65
|
+
}));
|
|
49
66
|
},
|
|
50
67
|
|
|
51
68
|
clearService: async (options) => {
|
|
52
69
|
const rnsiOpts = convertOptions(options);
|
|
53
|
-
const service = options?.service ??
|
|
70
|
+
const service = options?.service ?? "default";
|
|
54
71
|
const items = await store.getAllItems(options);
|
|
55
|
-
await KVStore.multiRemove(items.map(item => `${service}-${item.key}`));
|
|
56
|
-
await Promise.all(
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
await KVStore.multiRemove(items.map((item) => `${service}-${item.key}`));
|
|
73
|
+
await Promise.all(
|
|
74
|
+
items.map(async (item) => {
|
|
75
|
+
await SecureStore.deleteItemAsync(item.key, rnsiOpts);
|
|
76
|
+
}),
|
|
77
|
+
);
|
|
59
78
|
},
|
|
60
79
|
};
|
|
61
80
|
|
|
@@ -75,29 +94,34 @@ const createMetadata = (isSecure = true): SensitiveInfoItem["metadata"] => {
|
|
|
75
94
|
};
|
|
76
95
|
};
|
|
77
96
|
|
|
78
|
-
function convertOptions(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
??
|
|
85
|
-
const keychainAccessible = convertKeychainAccessible(
|
|
86
|
-
??
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
97
|
+
function convertOptions(
|
|
98
|
+
options?: LocalAuthOptions,
|
|
99
|
+
): SecureStore.SecureStoreOptions {
|
|
100
|
+
const accessGroup =
|
|
101
|
+
options?.keychainGroup ?? AUTH_DEFAULT_OPTIONS.keychainGroup ?? "";
|
|
102
|
+
const keychainService =
|
|
103
|
+
options?.service ?? AUTH_DEFAULT_OPTIONS.service ?? "";
|
|
104
|
+
const keychainAccessible = convertKeychainAccessible(
|
|
105
|
+
options?.accessControl ??
|
|
106
|
+
AUTH_DEFAULT_OPTIONS.accessControl ??
|
|
107
|
+
"biometryCurrentSet",
|
|
108
|
+
);
|
|
109
|
+
const authenticationPrompt =
|
|
110
|
+
options?.authenticationPrompt?.title ??
|
|
111
|
+
AUTH_DEFAULT_OPTIONS.authenticationPrompt?.title ??
|
|
112
|
+
"";
|
|
91
113
|
return {
|
|
92
114
|
accessGroup,
|
|
93
115
|
keychainService,
|
|
94
116
|
keychainAccessible,
|
|
95
117
|
authenticationPrompt,
|
|
96
|
-
requireAuthentication: options?.accessControl !==
|
|
118
|
+
requireAuthentication: options?.accessControl !== "none",
|
|
97
119
|
};
|
|
98
120
|
}
|
|
99
121
|
|
|
100
|
-
function convertKeychainAccessible(
|
|
122
|
+
function convertKeychainAccessible(
|
|
123
|
+
accessControl: AccessControl,
|
|
124
|
+
): SecureStore.KeychainAccessibilityConstant {
|
|
101
125
|
switch (accessControl) {
|
|
102
126
|
case "none":
|
|
103
127
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -111,8 +135,9 @@ function convertKeychainAccessible(accessControl: AccessControl): SecureStore.Ke
|
|
|
111
135
|
case "secureEnclaveBiometry":
|
|
112
136
|
return SecureStore.AFTER_FIRST_UNLOCK;
|
|
113
137
|
// Exhaustive check
|
|
114
|
-
default:
|
|
115
|
-
|
|
116
|
-
|
|
138
|
+
default:
|
|
139
|
+
accessControl satisfies never;
|
|
140
|
+
// Default (for typescript, should never hit)
|
|
141
|
+
return SecureStore.AFTER_FIRST_UNLOCK;
|
|
117
142
|
}
|
|
118
143
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EvoluAvatar.d.ts","sourceRoot":"","sources":["../../src/components/EvoluAvatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAgBA,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
import { SvgXml } from 'react-native-svg';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
|
-
import { bloSvg } from 'blo';
|
|
6
|
-
export const EvoluAvatar = ({ id, size = 32, borderRadius = 3 }) => {
|
|
7
|
-
const svg = useMemo(() => bloSvg(`0x${id}`), [id]);
|
|
8
|
-
return id ? (_jsx(View, { style: {
|
|
9
|
-
width: size,
|
|
10
|
-
height: size,
|
|
11
|
-
borderRadius,
|
|
12
|
-
overflow: 'hidden',
|
|
13
|
-
}, children: _jsx(SvgXml, { xml: svg, width: size, height: size }) })) : null;
|
|
14
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { View } from 'react-native';
|
|
2
|
-
import { SvgXml } from 'react-native-svg';
|
|
3
|
-
import { FC, useMemo } from 'react';
|
|
4
|
-
import { bloSvg } from 'blo';
|
|
5
|
-
import { OwnerId } from '@evolu/common';
|
|
6
|
-
|
|
7
|
-
export const EvoluAvatar: FC<{
|
|
8
|
-
id: OwnerId;
|
|
9
|
-
size?: number;
|
|
10
|
-
borderRadius?: number;
|
|
11
|
-
}> = ({ id, size = 32, borderRadius = 3 }) => {
|
|
12
|
-
const svg = useMemo(() => bloSvg(`0x${id}`), [id]);
|
|
13
|
-
return id ? (
|
|
14
|
-
<View style={{
|
|
15
|
-
width: size,
|
|
16
|
-
height: size,
|
|
17
|
-
borderRadius,
|
|
18
|
-
overflow: 'hidden',
|
|
19
|
-
}}>
|
|
20
|
-
<SvgXml
|
|
21
|
-
xml={svg}
|
|
22
|
-
width={size}
|
|
23
|
-
height={size}
|
|
24
|
-
/>
|
|
25
|
-
</View>
|
|
26
|
-
) : null;
|
|
27
|
-
}
|