@nostrify/react 0.2.9 → 0.2.10
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/NostrContext.js +2 -5
- package/dist/NostrContext.js.map +1 -1
- package/dist/example/test-helpers.js +4 -7
- package/dist/example/test-helpers.js.map +1 -1
- package/dist/example/useAuthor.js +7 -10
- package/dist/example/useAuthor.js.map +1 -1
- package/dist/example/useCurrentUser.js +12 -15
- package/dist/example/useCurrentUser.js.map +1 -1
- package/dist/example/useLoginActions.js +8 -11
- package/dist/example/useLoginActions.js.map +1 -1
- package/dist/example/useSocialFeed.js +5 -8
- package/dist/example/useSocialFeed.js.map +1 -1
- package/dist/login/NLogin.js +11 -15
- package/dist/login/NLogin.js.map +1 -1
- package/dist/login/NUser.d.ts +1 -1
- package/dist/login/NUser.d.ts.map +1 -1
- package/dist/login/NUser.js +9 -13
- package/dist/login/NUser.js.map +1 -1
- package/dist/login/NostrLoginContext.d.ts +1 -1
- package/dist/login/NostrLoginContext.d.ts.map +1 -1
- package/dist/login/NostrLoginContext.js +2 -5
- package/dist/login/NostrLoginContext.js.map +1 -1
- package/dist/login/NostrLoginProvider.js +6 -10
- package/dist/login/NostrLoginProvider.js.map +1 -1
- package/dist/login/mod.d.ts +4 -4
- package/dist/login/mod.d.ts.map +1 -1
- package/dist/login/mod.js +4 -11
- package/dist/login/mod.js.map +1 -1
- package/dist/login/nostrLoginReducer.d.ts +1 -1
- package/dist/login/nostrLoginReducer.d.ts.map +1 -1
- package/dist/login/nostrLoginReducer.js +1 -4
- package/dist/login/nostrLoginReducer.js.map +1 -1
- package/dist/login/useNostrLogin.d.ts +1 -1
- package/dist/login/useNostrLogin.d.ts.map +1 -1
- package/dist/login/useNostrLogin.js +4 -7
- package/dist/login/useNostrLogin.js.map +1 -1
- package/dist/login/useNostrLoginReducer.d.ts +2 -2
- package/dist/login/useNostrLoginReducer.d.ts.map +1 -1
- package/dist/login/useNostrLoginReducer.js +5 -8
- package/dist/login/useNostrLoginReducer.js.map +1 -1
- package/dist/mod.d.ts +2 -2
- package/dist/mod.d.ts.map +1 -1
- package/dist/mod.js +2 -7
- package/dist/mod.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/useNostr.d.ts +1 -1
- package/dist/useNostr.d.ts.map +1 -1
- package/dist/useNostr.js +4 -7
- package/dist/useNostr.js.map +1 -1
- package/example/useAuthor.ts +1 -1
- package/example/useCurrentUser.ts +2 -2
- package/example/useSocialFeed.ts +1 -1
- package/login/NUser.ts +1 -1
- package/login/NostrLoginContext.ts +1 -1
- package/login/NostrLoginProvider.ts +2 -2
- package/login/mod.ts +4 -4
- package/login/nostrLoginReducer.ts +1 -1
- package/login/useNostrLogin.ts +1 -1
- package/login/useNostrLoginReducer.ts +2 -2
- package/mod.ts +2 -2
- package/package.json +2 -2
- package/useNostr.ts +1 -1
package/dist/useNostr.d.ts
CHANGED
package/dist/useNostr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNostr.d.ts","sourceRoot":"","sources":["../useNostr.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useNostr.d.ts","sourceRoot":"","sources":["../useNostr.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAExE,wBAAgB,QAAQ,IAAI,gBAAgB,CAQ3C"}
|
package/dist/useNostr.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const NostrContext_1 = require("./NostrContext");
|
|
6
|
-
function useNostr() {
|
|
7
|
-
const context = (0, react_1.useContext)(NostrContext_1.NostrContext);
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { NostrContext } from './NostrContext.js';
|
|
3
|
+
export function useNostr() {
|
|
4
|
+
const context = useContext(NostrContext);
|
|
8
5
|
if (!context) {
|
|
9
6
|
throw new Error('useNostr must be used within a NostrProvider');
|
|
10
7
|
}
|
package/dist/useNostr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNostr.js","sourceRoot":"","sources":["../useNostr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNostr.js","sourceRoot":"","sources":["../useNostr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAyB,MAAM,mBAAmB,CAAC;AAExE,MAAM,UAAU,QAAQ;IACtB,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IAEzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/example/useAuthor.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type NostrEvent, type NostrMetadata, NSchema as n } from '@nostrify/nostrify';
|
|
2
2
|
import { useSuspenseQuery } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
|
-
import { useNostr } from '../useNostr';
|
|
4
|
+
import { useNostr } from '../useNostr.js';
|
|
5
5
|
|
|
6
6
|
export function useAuthor(
|
|
7
7
|
pubkey: string | undefined,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type NLoginType, NUser, useNostrLogin } from '@nostrify/react/login';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
|
|
4
|
-
import { useAuthor } from './useAuthor';
|
|
5
|
-
import { useNostr } from '../useNostr';
|
|
4
|
+
import { useAuthor } from './useAuthor.js';
|
|
5
|
+
import { useNostr } from '../useNostr.js';
|
|
6
6
|
|
|
7
7
|
export function useCurrentUser() {
|
|
8
8
|
const { nostr } = useNostr();
|
package/example/useSocialFeed.ts
CHANGED
package/login/NUser.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NBrowserSigner, NConnectSigner, type NostrSigner, type NPool, NSecSigner } from '@nostrify/nostrify';
|
|
2
2
|
import { nip19 } from 'nostr-tools';
|
|
3
3
|
|
|
4
|
-
import type { NLoginBunker, NLoginExtension, NLoginNsec } from './NLogin';
|
|
4
|
+
import type { NLoginBunker, NLoginExtension, NLoginNsec } from './NLogin.js';
|
|
5
5
|
|
|
6
6
|
/** Represents a Nostr user with authentication credentials. */
|
|
7
7
|
export class NUser {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
import { NostrLoginContext, NostrLoginContextType } from './NostrLoginContext';
|
|
4
|
-
import { useNostrLoginReducer } from './useNostrLoginReducer';
|
|
3
|
+
import { NostrLoginContext, NostrLoginContextType } from './NostrLoginContext.js';
|
|
4
|
+
import { useNostrLoginReducer } from './useNostrLoginReducer.js';
|
|
5
5
|
|
|
6
6
|
import type { FC, ReactNode } from 'react';
|
|
7
7
|
|
package/login/mod.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { NLogin, type NLoginType } from './NLogin';
|
|
2
|
-
export { NostrLoginProvider } from './NostrLoginProvider';
|
|
3
|
-
export { NUser } from './NUser';
|
|
4
|
-
export { useNostrLogin } from './useNostrLogin';
|
|
1
|
+
export { NLogin, type NLoginType } from './NLogin.js';
|
|
2
|
+
export { NostrLoginProvider } from './NostrLoginProvider.js';
|
|
3
|
+
export { NUser } from './NUser.js';
|
|
4
|
+
export { useNostrLogin } from './useNostrLogin.js';
|
package/login/useNostrLogin.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
|
|
3
|
-
import { NostrLoginContext, type NostrLoginContextType } from './NostrLoginContext';
|
|
3
|
+
import { NostrLoginContext, type NostrLoginContextType } from './NostrLoginContext.js';
|
|
4
4
|
|
|
5
5
|
export function useNostrLogin(): NostrLoginContextType {
|
|
6
6
|
const context = useContext(NostrLoginContext);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect, useReducer } from 'react';
|
|
2
2
|
|
|
3
|
-
import { type NLoginAction, nostrLoginReducer } from './nostrLoginReducer';
|
|
3
|
+
import { type NLoginAction, nostrLoginReducer } from './nostrLoginReducer.js';
|
|
4
4
|
|
|
5
|
-
import type { NLoginType } from './NLogin';
|
|
5
|
+
import type { NLoginType } from './NLogin.js';
|
|
6
6
|
|
|
7
7
|
export function useNostrLoginReducer(
|
|
8
8
|
storageKey: string,
|
package/mod.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { NostrContext, type NostrContextType } from './NostrContext';
|
|
2
|
-
export { useNostr } from './useNostr';
|
|
1
|
+
export { NostrContext, type NostrContextType } from './NostrContext.js';
|
|
2
|
+
export { useNostr } from './useNostr.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nostrify/react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./dist/mod.js",
|
|
6
6
|
"./login": "./dist/login/mod.js"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"react": "^18.0.0",
|
|
18
18
|
"react-dom": "^18.0.0",
|
|
19
19
|
"vite": "^6.2.2",
|
|
20
|
-
"@nostrify/nostrify": "0.46.
|
|
20
|
+
"@nostrify/nostrify": "0.46.6"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
package/useNostr.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
|
|
3
|
-
import { NostrContext, type NostrContextType } from './NostrContext';
|
|
3
|
+
import { NostrContext, type NostrContextType } from './NostrContext.js';
|
|
4
4
|
|
|
5
5
|
export function useNostr(): NostrContextType {
|
|
6
6
|
const context = useContext(NostrContext);
|