@nostrify/react 0.2.9 → 0.2.11

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.
Files changed (64) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +17 -0
  3. package/dist/NostrContext.js +2 -5
  4. package/dist/NostrContext.js.map +1 -1
  5. package/dist/example/test-helpers.js +4 -7
  6. package/dist/example/test-helpers.js.map +1 -1
  7. package/dist/example/useAuthor.js +7 -10
  8. package/dist/example/useAuthor.js.map +1 -1
  9. package/dist/example/useCurrentUser.js +12 -15
  10. package/dist/example/useCurrentUser.js.map +1 -1
  11. package/dist/example/useLoginActions.js +8 -11
  12. package/dist/example/useLoginActions.js.map +1 -1
  13. package/dist/example/useSocialFeed.js +5 -8
  14. package/dist/example/useSocialFeed.js.map +1 -1
  15. package/dist/login/NLogin.js +11 -15
  16. package/dist/login/NLogin.js.map +1 -1
  17. package/dist/login/NUser.d.ts +1 -1
  18. package/dist/login/NUser.d.ts.map +1 -1
  19. package/dist/login/NUser.js +9 -13
  20. package/dist/login/NUser.js.map +1 -1
  21. package/dist/login/NostrLoginContext.d.ts +1 -1
  22. package/dist/login/NostrLoginContext.d.ts.map +1 -1
  23. package/dist/login/NostrLoginContext.js +2 -5
  24. package/dist/login/NostrLoginContext.js.map +1 -1
  25. package/dist/login/NostrLoginProvider.js +6 -10
  26. package/dist/login/NostrLoginProvider.js.map +1 -1
  27. package/dist/login/mod.d.ts +4 -4
  28. package/dist/login/mod.d.ts.map +1 -1
  29. package/dist/login/mod.js +4 -11
  30. package/dist/login/mod.js.map +1 -1
  31. package/dist/login/nostrLoginReducer.d.ts +1 -1
  32. package/dist/login/nostrLoginReducer.d.ts.map +1 -1
  33. package/dist/login/nostrLoginReducer.js +1 -4
  34. package/dist/login/nostrLoginReducer.js.map +1 -1
  35. package/dist/login/useNostrLogin.d.ts +1 -1
  36. package/dist/login/useNostrLogin.d.ts.map +1 -1
  37. package/dist/login/useNostrLogin.js +4 -7
  38. package/dist/login/useNostrLogin.js.map +1 -1
  39. package/dist/login/useNostrLoginReducer.d.ts +2 -2
  40. package/dist/login/useNostrLoginReducer.d.ts.map +1 -1
  41. package/dist/login/useNostrLoginReducer.js +5 -8
  42. package/dist/login/useNostrLoginReducer.js.map +1 -1
  43. package/dist/mod.d.ts +2 -2
  44. package/dist/mod.d.ts.map +1 -1
  45. package/dist/mod.js +2 -7
  46. package/dist/mod.js.map +1 -1
  47. package/dist/tsconfig.tsbuildinfo +1 -1
  48. package/dist/useNostr.d.ts +1 -1
  49. package/dist/useNostr.d.ts.map +1 -1
  50. package/dist/useNostr.js +4 -7
  51. package/dist/useNostr.js.map +1 -1
  52. package/example/useAuthor.ts +1 -1
  53. package/example/useCurrentUser.ts +2 -2
  54. package/example/useSocialFeed.ts +1 -1
  55. package/login/NUser.ts +1 -1
  56. package/login/NostrLoginContext.ts +1 -1
  57. package/login/NostrLoginProvider.ts +2 -2
  58. package/login/mod.ts +4 -4
  59. package/login/nostrLoginReducer.ts +1 -1
  60. package/login/useNostrLogin.ts +1 -1
  61. package/login/useNostrLoginReducer.ts +2 -2
  62. package/mod.ts +2 -2
  63. package/package.json +11 -6
  64. package/useNostr.ts +1 -1
@@ -1,3 +1,3 @@
1
- import { type NostrContextType } from './NostrContext';
1
+ import { type NostrContextType } from './NostrContext.js';
2
2
  export declare function useNostr(): NostrContextType;
3
3
  //# sourceMappingURL=useNostr.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNostr.d.ts","sourceRoot":"","sources":["../useNostr.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAErE,wBAAgB,QAAQ,IAAI,gBAAgB,CAQ3C"}
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useNostr = useNostr;
4
- const react_1 = require("react");
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
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useNostr.js","sourceRoot":"","sources":["../useNostr.ts"],"names":[],"mappings":";;AAIA,4BAQC;AAZD,iCAAmC;AAEnC,iDAAqE;AAErE,SAAgB,QAAQ;IACtB,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAC;IAEzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
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"}
@@ -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();
@@ -1,6 +1,6 @@
1
1
  import { useSuspenseQuery, type UseSuspenseQueryResult } from '@tanstack/react-query';
2
2
 
3
- import { useNostr } from '../useNostr';
3
+ import { useNostr } from '../useNostr.js';
4
4
 
5
5
  import type { NostrEvent } from '@nostrify/nostrify';
6
6
 
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,6 +1,6 @@
1
1
  import { type Context, createContext } from 'react';
2
2
 
3
- import type { NLoginType } from './NLogin';
3
+ import type { NLoginType } from './NLogin.js';
4
4
 
5
5
  /**
6
6
  * NostrLoginContextType defines the shape of the context that will be provided
@@ -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';
@@ -1,4 +1,4 @@
1
- import type { NLoginType } from './NLogin';
1
+ import type { NLoginType } from './NLogin.js';
2
2
 
3
3
  export type NLoginAction =
4
4
  | { type: 'login.add'; login: NLoginType; set?: boolean }
@@ -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.9",
3
+ "version": "0.2.11",
4
4
  "exports": {
5
5
  ".": "./dist/mod.js",
6
6
  "./login": "./dist/login/mod.js"
@@ -8,16 +8,21 @@
8
8
  "main": "dist/mod.js",
9
9
  "types": "dist/mod.d.ts",
10
10
  "type": "module",
11
- "dependencies": {
12
- "@deno/vite-plugin": "^1.0.4",
13
- "@tanstack/react-query": "^5.69.0",
11
+ "devDependencies": {
14
12
  "@types/react": "^18.0.0",
13
+ "@types/node": "^24.1.0",
15
14
  "@vitejs/plugin-react": "^4.3.4",
15
+ "@deno/vite-plugin": "^1.0.4",
16
+ "vite": "^6.2.2"
17
+ },
18
+ "dependencies": {
19
+ "@tanstack/react-query": "^5.69.0",
16
20
  "happy-dom": "^17.4.4",
17
21
  "react": "^18.0.0",
18
22
  "react-dom": "^18.0.0",
19
- "vite": "^6.2.2",
20
- "@nostrify/nostrify": "0.46.5"
23
+ "nostr-tools": "^2.13.0",
24
+ "@nostrify/types": "0.36.3",
25
+ "@nostrify/nostrify": "0.46.7"
21
26
  },
22
27
  "publishConfig": {
23
28
  "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);