@fencyai/react 0.1.26 → 0.1.28
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/lib/FencyProvider.d.ts +0 -7
- package/lib/FencyProvider.js +4 -1
- package/lib/index.d.ts +1 -1
- package/package.json +4 -4
package/lib/FencyProvider.d.ts
CHANGED
|
@@ -5,13 +5,6 @@ export declare const FencyContextValue: import("react").Context<FencyContext | u
|
|
|
5
5
|
* Expects a promise that resolves to a Fency instance
|
|
6
6
|
*/
|
|
7
7
|
export declare function FencyProvider({ fency, children }: FencyProviderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
export interface FencyOptions {
|
|
9
|
-
publishableKey: string;
|
|
10
|
-
endpoint?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Context for Fency instance
|
|
14
|
-
*/
|
|
15
8
|
export interface FencyContext {
|
|
16
9
|
fency: FencyInstance;
|
|
17
10
|
loading: boolean;
|
package/lib/FencyProvider.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useEffect, useState } from 'react';
|
|
3
3
|
// Create the context
|
|
4
4
|
export const FencyContextValue = createContext(undefined);
|
|
@@ -30,5 +30,8 @@ export function FencyProvider({ fency, children }) {
|
|
|
30
30
|
loading,
|
|
31
31
|
error,
|
|
32
32
|
};
|
|
33
|
+
if (error) {
|
|
34
|
+
return _jsxs("div", { children: ["Fency error: ", error.message] });
|
|
35
|
+
}
|
|
33
36
|
return (_jsx(FencyContextValue.Provider, { value: value, children: children }));
|
|
34
37
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { FencyProvider } from './FencyProvider';
|
|
2
2
|
export { useChatCompletion } from './hooks/useChatCompletion';
|
|
3
3
|
export { useFency } from './hooks/useFency';
|
|
4
|
-
export type { FencyContext,
|
|
4
|
+
export type { FencyContext, FencyProviderProps } from './FencyProvider';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"zod": "^4.0.5"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@fencyai/js": "^0.1.
|
|
38
|
+
"@fencyai/js": "^0.1.28",
|
|
39
39
|
"@types/jest": "^29.5.11",
|
|
40
40
|
"@types/node": "^20.10.5",
|
|
41
41
|
"@types/react": "^18.2.45",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"typescript": "^5.3.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@fencyai/js": "^0.1.
|
|
47
|
+
"@fencyai/js": "^0.1.28",
|
|
48
48
|
"react": ">=16.8.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "149bd6d1376f2c635d34e26c7b1efe6e280d34a3"
|
|
51
51
|
}
|