jazz-react-native 0.8.15 → 0.8.16
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +466 -457
- package/dist/auth/DemoAuthMethod.js +1 -2
- package/dist/auth/DemoAuthMethod.js.map +1 -1
- package/dist/auth/DemoAuthUI.d.ts +1 -1
- package/dist/auth/DemoAuthUI.js +25 -31
- package/dist/auth/DemoAuthUI.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/media.d.ts +1 -1
- package/dist/media.js.map +1 -1
- package/dist/provider.js +2 -4
- package/dist/provider.js.map +1 -1
- package/dist/storage/expo-secure-store-adapter.js.map +1 -1
- package/dist/storage/kv-store-context.js.map +1 -1
- package/package.json +7 -11
- package/src/auth/DemoAuthMethod.ts +168 -187
- package/src/auth/DemoAuthUI.tsx +239 -253
- package/src/index.ts +198 -202
- package/src/media.tsx +50 -51
- package/src/provider.tsx +265 -274
- package/src/storage/expo-secure-store-adapter.ts +21 -21
- package/src/storage/kv-store-context.ts +21 -21
- package/tsconfig.json +4 -8
- package/.eslintrc.cjs +0 -24
- package/.prettierrc.js +0 -9
@@ -71,8 +71,7 @@ export class RNDemoAuth {
|
|
71
71
|
}
|
72
72
|
// Save credentials using the unique username
|
73
73
|
await this.kvStore.set(localStorageKey, storageData);
|
74
|
-
await this.kvStore.set("demo-auth-existing-users-" +
|
75
|
-
uniqueUsername, storageData);
|
74
|
+
await this.kvStore.set("demo-auth-existing-users-" + uniqueUsername, storageData);
|
76
75
|
// Update the list of existing users
|
77
76
|
const updatedUsers = existingUsers
|
78
77
|
? `${existingUsers},${uniqueUsername}`
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DemoAuthMethod.js","sourceRoot":"","sources":["../../src/auth/DemoAuthMethod.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAqBzE,MAAM,eAAe,GAAG,4BAA4B,CAAC;AAErD,MAAM,OAAO,U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AAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;gCACpD,CAAC;6BACF,CAAC,CAAC;wBACL,CAAC;qBACF,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAED,KAAK,UAAU,MAAM;IACnB,MAAM,OAAO,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,CAAC;IAC1D,KAAK,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
package/dist/auth/DemoAuthUI.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { useMemo, useState, useEffect } from "react";
|
2
|
-
import {
|
2
|
+
import { StyleSheet, Text, TextInput, TouchableOpacity, View, } from "react-native";
|
3
3
|
import { RNDemoAuth } from "./DemoAuthMethod.js";
|
4
4
|
/** @category Auth Providers */
|
5
5
|
export function useDemoAuth({ seedAccounts, } = {}) {
|
@@ -61,52 +61,46 @@ export const DemoAuthBasicUI = ({ appName, state, }) => {
|
|
61
61
|
styles.container,
|
62
62
|
darkMode ? styles.darkBackground : styles.lightBackground,
|
63
63
|
]}>
|
64
|
-
|
65
|
-
|
64
|
+
{state.state === "loading" ? (<Text style={styles.loadingText}>Loading...</Text>) : state.state === "ready" ? (<View style={styles.formContainer}>
|
65
|
+
<Text style={[
|
66
66
|
styles.headerText,
|
67
67
|
darkMode ? styles.darkText : styles.lightText,
|
68
68
|
]}>
|
69
|
-
|
70
|
-
|
69
|
+
{appName}
|
70
|
+
</Text>
|
71
71
|
|
72
|
-
|
73
|
-
|
74
|
-
|
72
|
+
{state.errors.map((error) => (<Text key={error} style={styles.errorText}>
|
73
|
+
{error}
|
74
|
+
</Text>))}
|
75
75
|
|
76
|
-
|
76
|
+
{errorMessage && <Text style={styles.errorText}>{errorMessage}</Text>}
|
77
77
|
|
78
|
-
|
78
|
+
<TextInput placeholder="Display name" value={username} onChangeText={setUsername} placeholderTextColor={darkMode ? "#fff" : "#000"} style={[
|
79
79
|
styles.textInput,
|
80
80
|
darkMode ? styles.darkInput : styles.lightInput,
|
81
81
|
]}/>
|
82
82
|
|
83
|
-
|
83
|
+
<TouchableOpacity onPress={handleSignUp} style={[
|
84
84
|
styles.button,
|
85
85
|
darkMode ? styles.darkButton : styles.lightButton,
|
86
86
|
]}>
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
</Text>
|
92
|
-
</TouchableOpacity>
|
87
|
+
<Text style={darkMode ? styles.darkButtonText : styles.lightButtonText}>
|
88
|
+
Sign Up as new account
|
89
|
+
</Text>
|
90
|
+
</TouchableOpacity>
|
93
91
|
|
94
|
-
|
95
|
-
|
92
|
+
<View style={styles.existingUsersContainer}>
|
93
|
+
{state.existingUsers.map((user) => (<TouchableOpacity key={user} onPress={() => state.logInAs(user)} style={[
|
96
94
|
styles.existingUserButton,
|
97
|
-
darkMode
|
98
|
-
? styles.darkUserButton
|
99
|
-
: styles.lightUserButton,
|
95
|
+
darkMode ? styles.darkUserButton : styles.lightUserButton,
|
100
96
|
]}>
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
</View>) : null}
|
109
|
-
</View>);
|
97
|
+
<Text style={darkMode ? styles.darkText : styles.lightText}>
|
98
|
+
Log In as "{user}"
|
99
|
+
</Text>
|
100
|
+
</TouchableOpacity>))}
|
101
|
+
</View>
|
102
|
+
</View>) : null}
|
103
|
+
</View>);
|
110
104
|
};
|
111
105
|
const styles = StyleSheet.create({
|
112
106
|
container: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DemoAuthUI.js","sourceRoot":"","sources":["../../src/auth/DemoAuthUI.tsx"],"names":[],"mappings":"
|
1
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QACtB,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,EAAE;KACd;IACD,kBAAkB,EAAE;QAClB,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;QACf,cAAc,EAAE,CAAC;KAClB;IACD,cAAc,EAAE;QACd,eAAe,EAAE,MAAM;KACxB;IACD,eAAe,EAAE;QACf,eAAe,EAAE,MAAM;KACxB;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;KACd;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM;KACd;IACD,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;KACd;IACD,cAAc,EAAE;QACd,eAAe,EAAE,MAAM;KACxB;IACD,eAAe,EAAE;QACf,eAAe,EAAE,MAAM;KACxB;CACF,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { Account, AgentID, AnonymousJazzAgent, AuthMethod, CoValue, CoValueClass, CryptoProvider, ID, InviteSecret, SessionID } from "jazz-tools";
|
2
2
|
import { RawAccountID } from "cojson";
|
3
3
|
export { RNDemoAuth } from "./auth/DemoAuthMethod.js";
|
4
4
|
/** @category Context Creation */
|
@@ -31,7 +31,7 @@ export declare function createJazzRNContext<Acc extends Account>(options: Browse
|
|
31
31
|
/** @category Auth Providers */
|
32
32
|
export type SessionProvider = (accountID: ID<Account> | AgentID) => Promise<SessionID>;
|
33
33
|
export declare function provideLockSession(accountID: ID<Account> | AgentID, crypto: CryptoProvider): Promise<{
|
34
|
-
sessionID:
|
34
|
+
sessionID: `${RawAccountID}_session_z${string}` | `sealer_z${string}/signer_z${string}_session_z${string}`;
|
35
35
|
sessionDone: () => void;
|
36
36
|
}>;
|
37
37
|
/** @category Invite Links */
|
package/dist/index.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
3
3
|
import { cojsonInternals, createJazzContext, } from "jazz-tools";
|
4
|
-
import { PureJSCrypto } from "jazz-tools/native";
|
5
|
-
import { createWebSocketPeer } from "cojson-transport-ws";
|
6
4
|
import NetInfo from "@react-native-community/netinfo";
|
5
|
+
import { createWebSocketPeer } from "cojson-transport-ws";
|
7
6
|
import * as Linking from "expo-linking";
|
7
|
+
import { PureJSCrypto } from "jazz-tools/native";
|
8
8
|
export { RNDemoAuth } from "./auth/DemoAuthMethod.js";
|
9
9
|
import { KvStoreContext } from "./storage/kv-store-context.js";
|
10
10
|
export async function createJazzRNContext(options) {
|
@@ -33,9 +33,7 @@ export async function createJazzRNContext(options) {
|
|
33
33
|
crypto: await PureJSCrypto.create(),
|
34
34
|
peersToLoadFrom: [firstWsPeer],
|
35
35
|
});
|
36
|
-
const node = "account" in context
|
37
|
-
? context.account._raw.core.node
|
38
|
-
: context.agent.node;
|
36
|
+
const node = "account" in context ? context.account._raw.core.node : context.agent.node;
|
39
37
|
async function websocketReconnectLoop() {
|
40
38
|
while (shouldTryToReconnect) {
|
41
39
|
if (Object.keys(node.syncManager.peers).some((peerId) => peerId.includes(options.peer))) {
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,sDAAsD;AACtD,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,sDAAsD;AACtD,OAAO,EAWL,eAAe,EACf,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,OAAO,MAAM,iCAAiC,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAA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AO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,SAA6B,CAAC;IAClC,IAAI,OAA0B,CAAC;IAC/B,IAAI,YAAsC,CAAC;IAE3C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,OAAO,GAAG,KAAK,CAAC,CAAC,CAAU,CAAC;QAC5B,YAAY,GAAG,KAAK,CAAC,CAAC,CAAiB,CAAC;IAC1C,CAAC;SAAM,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,GAAG,KAAK,CAAC,CAAC,CAAU,CAAC;QAC5B,YAAY,GAAG,KAAK,CAAC,CAAC,CAAiB,CAAC;IAC1C,CAAC;IAED,IAAI,CAAC,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS;AAET,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,+BAA+B,CAAC"}
|
package/dist/media.d.ts
CHANGED
package/dist/media.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../src/media.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../src/media.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,sBAAsB;AACtB,MAAM,UAAU,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,GAIT;IACC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAEpC,SAAS,CAAC,CAAC;IAEb,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,cAAkC,CAAC;QACvC,IAAI,CAAC,KAAK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AM,MAAM,GAAG,iBAAiB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtD,OAAO,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/provider.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
2
2
|
import { Account, subscribeToCoValue, } from "jazz-tools";
|
3
|
-
import { createJazzRNContext, KvStoreContext, parseInviteLink, } from "./index.js";
|
4
3
|
import { Linking } from "react-native";
|
4
|
+
import { KvStoreContext, createJazzRNContext, parseInviteLink, } from "./index.js";
|
5
5
|
import { ExpoSecureStoreAdapter } from "./storage/expo-secure-store-adapter.js";
|
6
6
|
/** @category Context & Hooks */
|
7
7
|
export function createJazzRNApp({ kvStore = new ExpoSecureStoreAdapter(), AccountSchema = Account, } = {}) {
|
@@ -39,9 +39,7 @@ export function createJazzRNApp({ kvStore = new ExpoSecureStoreAdapter(), Accoun
|
|
39
39
|
void promiseWithDoneCallback.then((done) => done());
|
40
40
|
};
|
41
41
|
}, [AccountSchema, auth, peer, storage, sessionCount]);
|
42
|
-
return (<JazzContext.Provider value={ctx}>
|
43
|
-
{ctx && children}
|
44
|
-
</JazzContext.Provider>);
|
42
|
+
return (<JazzContext.Provider value={ctx}>{ctx && children}</JazzContext.Provider>);
|
45
43
|
}
|
46
44
|
function useAccount(depth) {
|
47
45
|
const context = React.useContext(JazzContext);
|
package/dist/provider.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAA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AAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;gBACxC,IAAI,GAAG;oBAAE,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;YAEH,OAAO,GAAG,EAAE;gBACV,eAAe,CAAC,MAAM,EAAE,CAAC;YAC3B,CAAC,CAAC;QACJ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,YAAY,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO;QACL,QAAQ;QACR,UAAU;QACV,iBAAiB;QACjB,UAAU;QACV,eAAe;KAChB,CAAC;AACJ,CAAC;AAsDD,cAAc,YAAY,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"expo-secure-store-adapter.js","sourceRoot":"","sources":["../../src/storage/expo-secure-store-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AAGjD,MAAM,OAAO,sBAAsB;
|
1
|
+
{"version":3,"file":"expo-secure-store-adapter.js","sourceRoot":"","sources":["../../src/storage/expo-secure-store-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AAGjD,MAAM,OAAO,sBAAsB;IACjC,GAAG,CAAC,GAAW;QACb,OAAO,WAAW,CAAC,YAAY,CAAC,GAAG,EAAE;YACnC,qBAAqB,EAAE,WAAW,CAAC,6BAA6B,EAAE;YAClE,kBAAkB,EAAE,WAAW,CAAC,kBAAkB;SACnD,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAa;QAClC,OAAO,WAAW,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE;YAC1C,qBAAqB,EAAE,WAAW,CAAC,6BAA6B,EAAE;YAClE,kBAAkB,EAAE,WAAW,CAAC,kBAAkB;SACnD,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,OAAO,WAAW,CAAC,eAAe,CAAC,GAAG,EAAE;YACtC,qBAAqB,EAAE,WAAW,CAAC,6BAA6B,EAAE;YAClE,kBAAkB,EAAE,WAAW,CAAC,kBAAkB;SACnD,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"kv-store-context.js","sourceRoot":"","sources":["../../src/storage/kv-store-context.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,cAAc;
|
1
|
+
{"version":3,"file":"kv-store-context.js","sourceRoot":"","sources":["../../src/storage/kv-store-context.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,cAAc;IACjB,MAAM,CAAC,QAAQ,CAAiB;IAChC,eAAe,GAAmB,IAAI,CAAC;IAE/C,gBAAuB,CAAC;IAEjB,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;YAC7B,cAAc,CAAC,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;QACjD,CAAC;QACD,OAAO,cAAc,CAAC,QAAQ,CAAC;IACjC,CAAC;IAEM,UAAU,CAAC,KAAc;QAC9B,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC/B,CAAC;IACH,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,eAAe,cAAc,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "jazz-react-native",
|
3
|
-
"version": "0.8.
|
3
|
+
"version": "0.8.16",
|
4
4
|
"type": "module",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/index.js",
|
@@ -17,9 +17,9 @@
|
|
17
17
|
"dependencies": {
|
18
18
|
"@scure/bip39": "^1.3.0",
|
19
19
|
"typescript": "^5.3.3",
|
20
|
-
"cojson": "0.8.
|
21
|
-
"cojson-transport-ws": "0.8.
|
22
|
-
"jazz-tools": "0.8.
|
20
|
+
"cojson": "0.8.16",
|
21
|
+
"cojson-transport-ws": "0.8.16",
|
22
|
+
"jazz-tools": "0.8.16"
|
23
23
|
},
|
24
24
|
"peerDependencies": {
|
25
25
|
"@react-native-community/netinfo": "*",
|
@@ -33,15 +33,11 @@
|
|
33
33
|
"expo-secure-store": "~13.0.2",
|
34
34
|
"react-native": "~0.74.5"
|
35
35
|
},
|
36
|
-
"lint-staged": {
|
37
|
-
"*.{ts,tsx}": "eslint --fix",
|
38
|
-
"*.{js,jsx,mdx,json}": "prettier --write"
|
39
|
-
},
|
40
36
|
"gitHead": "33c27053293b4801b968c61d5c4c989f93a67d13",
|
41
37
|
"scripts": {
|
42
38
|
"dev": "tsc --watch --sourceMap --outDir dist",
|
43
|
-
"lint": "
|
44
|
-
"format": "
|
45
|
-
"build": "
|
39
|
+
"format-and-lint": "biome check .",
|
40
|
+
"format-and-lint:fix": "biome check . --write",
|
41
|
+
"build": "rm -rf ./dist && tsc --sourceMap --outDir dist"
|
46
42
|
}
|
47
43
|
}
|