nostr-wot-sdk 0.8.1 → 0.8.2
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/react/index.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var react$1 = require('@nostr-wot/wot/react');
|
|
4
4
|
var react = require('@nostr-wot/data/react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
6
|
|
|
6
7
|
// src/react/index.ts
|
|
7
8
|
function NostrSdkProvider({
|
|
@@ -16,10 +17,10 @@ function NostrSdkProvider({
|
|
|
16
17
|
...profileAggregators !== void 0 ? { profileAggregators } : {},
|
|
17
18
|
...cache !== void 0 ? { cache } : {}
|
|
18
19
|
};
|
|
19
|
-
const wrapped = /* @__PURE__ */
|
|
20
|
+
const wrapped = /* @__PURE__ */ jsxRuntime.jsx(react.NostrDataProvider, { ...dataProps, children });
|
|
20
21
|
if (wot == null ? void 0 : wot.enabled) {
|
|
21
22
|
const { enabled: _enabled, ...wotProps } = wot;
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react$1.WoTProvider, { ...wotProps, children: wrapped });
|
|
23
24
|
}
|
|
24
25
|
return wrapped;
|
|
25
26
|
}
|
package/dist/react/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/nostr-sdk-provider.tsx"],"names":["NostrDataProvider","WoTProvider"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/react/nostr-sdk-provider.tsx"],"names":["jsx","NostrDataProvider","WoTProvider"],"mappings":";;;;;;;AAoCO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,QAAA;AAAA,EACA,MAAA;AAAA,EACA,kBAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAA0B;AACxB,EAAA,MAAM,SAAA,GAAY;AAAA,IAChB,GAAI,MAAA,KAAW,MAAA,GAAY,EAAE,MAAA,KAAW,EAAC;AAAA,IACzC,GAAI,kBAAA,KAAuB,MAAA,GAAY,EAAE,kBAAA,KAAuB,EAAC;AAAA,IACjE,GAAI,KAAA,KAAU,MAAA,GAAY,EAAE,KAAA,KAAU;AAAC,GACzC;AACA,EAAA,MAAM,OAAA,mBAAUA,cAAA,CAACC,uBAAA,EAAA,EAAmB,GAAG,WAAY,QAAA,EAAS,CAAA;AAC5D,EAAA,IAAI,2BAAK,OAAA,EAAS;AAChB,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,GAAG,UAAS,GAAI,GAAA;AAC3C,IAAA,uBAAOD,cAAA,CAACE,mBAAA,EAAA,EAAa,GAAG,QAAA,EAAW,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,EAC7C;AACA,EAAA,OAAO,OAAA;AACT","file":"index.cjs","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { NostrDataProvider } from '@nostr-wot/data/react';\nimport { WoTProvider, type WoTProviderProps } from '@nostr-wot/wot/react';\n\nexport interface NostrSdkProviderProps {\n children: ReactNode;\n /** Override the default relay set used by all data fetchers. */\n relays?: string[];\n /** Specialised aggregators for kind-0 lookups (e.g. purplepag.es). */\n profileAggregators?: string[];\n /** Cache configuration. The SWR layer persists profiles, follows,\n * and relay-lists to localStorage by default. */\n cache?: {\n namespace?: string;\n ttlMs?: number;\n };\n /** Web-of-Trust configuration. WoT is opt-in:\n * - Omit `wot` (or set `wot: { enabled: false }`) → no WoT context;\n * `useWoTContext()` returns null safely.\n * - Set `wot: { enabled: true, ... }` → wraps children with the\n * WoT context so `useWoT`, `useTrustScore`, `useIsInWoT`,\n * `useBatchWoT` work. */\n wot?: { enabled: boolean } & Omit<WoTProviderProps, 'children'>;\n}\n\n/**\n * Top-level provider for an app using the full Nostr WoT SDK. Composes:\n * - `<NostrDataProvider>` — sets default relays, profile aggregators,\n * cache namespace.\n * - `<WoTProvider>` (optional, when `wot.enabled === true`).\n *\n * For data-only apps (no WoT scoring), depend on `@nostr-wot/data` and\n * use `<NostrDataProvider>` directly — no need to install `@nostr-wot/wot`.\n */\nexport function NostrSdkProvider({\n children,\n relays,\n profileAggregators,\n cache,\n wot,\n}: NostrSdkProviderProps) {\n const dataProps = {\n ...(relays !== undefined ? { relays } : {}),\n ...(profileAggregators !== undefined ? { profileAggregators } : {}),\n ...(cache !== undefined ? { cache } : {}),\n };\n const wrapped = <NostrDataProvider {...dataProps}>{children}</NostrDataProvider>;\n if (wot?.enabled) {\n const { enabled: _enabled, ...wotProps } = wot;\n return <WoTProvider {...wotProps}>{wrapped}</WoTProvider>;\n }\n return wrapped;\n}\n"]}
|
package/dist/react/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { WoTProvider } from '@nostr-wot/wot/react';
|
|
|
2
2
|
export * from '@nostr-wot/wot/react';
|
|
3
3
|
import { NostrDataProvider } from '@nostr-wot/data/react';
|
|
4
4
|
export * from '@nostr-wot/data/react';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
6
|
|
|
6
7
|
// src/react/index.ts
|
|
7
8
|
function NostrSdkProvider({
|
|
@@ -16,10 +17,10 @@ function NostrSdkProvider({
|
|
|
16
17
|
...profileAggregators !== void 0 ? { profileAggregators } : {},
|
|
17
18
|
...cache !== void 0 ? { cache } : {}
|
|
18
19
|
};
|
|
19
|
-
const wrapped = /* @__PURE__ */
|
|
20
|
+
const wrapped = /* @__PURE__ */ jsx(NostrDataProvider, { ...dataProps, children });
|
|
20
21
|
if (wot == null ? void 0 : wot.enabled) {
|
|
21
22
|
const { enabled: _enabled, ...wotProps } = wot;
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ jsx(WoTProvider, { ...wotProps, children: wrapped });
|
|
23
24
|
}
|
|
24
25
|
return wrapped;
|
|
25
26
|
}
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/nostr-sdk-provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/react/nostr-sdk-provider.tsx"],"names":[],"mappings":";;;;;;;AAoCO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,QAAA;AAAA,EACA,MAAA;AAAA,EACA,kBAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAA0B;AACxB,EAAA,MAAM,SAAA,GAAY;AAAA,IAChB,GAAI,MAAA,KAAW,MAAA,GAAY,EAAE,MAAA,KAAW,EAAC;AAAA,IACzC,GAAI,kBAAA,KAAuB,MAAA,GAAY,EAAE,kBAAA,KAAuB,EAAC;AAAA,IACjE,GAAI,KAAA,KAAU,MAAA,GAAY,EAAE,KAAA,KAAU;AAAC,GACzC;AACA,EAAA,MAAM,OAAA,mBAAU,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,WAAY,QAAA,EAAS,CAAA;AAC5D,EAAA,IAAI,2BAAK,OAAA,EAAS;AAChB,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,GAAG,UAAS,GAAI,GAAA;AAC3C,IAAA,uBAAO,GAAA,CAAC,WAAA,EAAA,EAAa,GAAG,QAAA,EAAW,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,EAC7C;AACA,EAAA,OAAO,OAAA;AACT","file":"index.js","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { NostrDataProvider } from '@nostr-wot/data/react';\nimport { WoTProvider, type WoTProviderProps } from '@nostr-wot/wot/react';\n\nexport interface NostrSdkProviderProps {\n children: ReactNode;\n /** Override the default relay set used by all data fetchers. */\n relays?: string[];\n /** Specialised aggregators for kind-0 lookups (e.g. purplepag.es). */\n profileAggregators?: string[];\n /** Cache configuration. The SWR layer persists profiles, follows,\n * and relay-lists to localStorage by default. */\n cache?: {\n namespace?: string;\n ttlMs?: number;\n };\n /** Web-of-Trust configuration. WoT is opt-in:\n * - Omit `wot` (or set `wot: { enabled: false }`) → no WoT context;\n * `useWoTContext()` returns null safely.\n * - Set `wot: { enabled: true, ... }` → wraps children with the\n * WoT context so `useWoT`, `useTrustScore`, `useIsInWoT`,\n * `useBatchWoT` work. */\n wot?: { enabled: boolean } & Omit<WoTProviderProps, 'children'>;\n}\n\n/**\n * Top-level provider for an app using the full Nostr WoT SDK. Composes:\n * - `<NostrDataProvider>` — sets default relays, profile aggregators,\n * cache namespace.\n * - `<WoTProvider>` (optional, when `wot.enabled === true`).\n *\n * For data-only apps (no WoT scoring), depend on `@nostr-wot/data` and\n * use `<NostrDataProvider>` directly — no need to install `@nostr-wot/wot`.\n */\nexport function NostrSdkProvider({\n children,\n relays,\n profileAggregators,\n cache,\n wot,\n}: NostrSdkProviderProps) {\n const dataProps = {\n ...(relays !== undefined ? { relays } : {}),\n ...(profileAggregators !== undefined ? { profileAggregators } : {}),\n ...(cache !== undefined ? { cache } : {}),\n };\n const wrapped = <NostrDataProvider {...dataProps}>{children}</NostrDataProvider>;\n if (wot?.enabled) {\n const { enabled: _enabled, ...wotProps } = wot;\n return <WoTProvider {...wotProps}>{wrapped}</WoTProvider>;\n }\n return wrapped;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/relay';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/relay';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nostr-wot-sdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Meta-package re-exporting @nostr-wot/{wot,relay,data}. Existing imports keep working; new code should depend on the scoped packages directly.",
|
|
5
5
|
"author": "Leon Acosta <leon@nostr-wot.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -114,9 +114,9 @@
|
|
|
114
114
|
"prepublishOnly": "npm run build"
|
|
115
115
|
},
|
|
116
116
|
"dependencies": {
|
|
117
|
-
"@nostr-wot/data": "^0.1.
|
|
117
|
+
"@nostr-wot/data": "^0.1.1",
|
|
118
118
|
"@nostr-wot/relay": "^0.1.0",
|
|
119
|
-
"@nostr-wot/wot": "^0.1.
|
|
119
|
+
"@nostr-wot/wot": "^0.1.1"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
122
|
"react": ">=16.8.0",
|