@fencyai/react 0.1.5 → 0.1.7
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/FencyProvider.d.ts +1 -1
- package/dist/FencyProvider.d.ts.map +1 -1
- package/dist/FencyProvider.js +1 -1
- package/dist/index.js +1 -25
- package/dist/types.d.ts +2 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/FencyProvider.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export declare const FencyContextValue: import("react").Context<FencyContext | u
|
|
|
4
4
|
* Provider component that provides Fency instance to child components
|
|
5
5
|
* Expects a promise that resolves to a Fency instance
|
|
6
6
|
*/
|
|
7
|
-
export declare function FencyProvider({ fency,
|
|
7
|
+
export declare function FencyProvider({ fency, children }: FencyProviderProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
8
|
//# sourceMappingURL=FencyProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FencyProvider.d.ts","sourceRoot":"","sources":["../src/FencyProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAiB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG/E,eAAO,MAAM,iBAAiB,mDAAqD,CAAC;AAEpF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"FencyProvider.d.ts","sourceRoot":"","sources":["../src/FencyProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAiB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG/E,eAAO,MAAM,iBAAiB,mDAAqD,CAAC;AAEpF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,kDAiCpE"}
|
package/dist/FencyProvider.js
CHANGED
|
@@ -6,7 +6,7 @@ export const FencyContextValue = createContext(undefined);
|
|
|
6
6
|
* Provider component that provides Fency instance to child components
|
|
7
7
|
* Expects a promise that resolves to a Fency instance
|
|
8
8
|
*/
|
|
9
|
-
export function FencyProvider({ fency,
|
|
9
|
+
export function FencyProvider({ fency, children }) {
|
|
10
10
|
const [fencyInstance, setFencyInstance] = useState(null);
|
|
11
11
|
const [loading, setLoading] = useState(true);
|
|
12
12
|
const [error, setError] = useState(null);
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
react/cjs/react.production.min.js:
|
|
5
|
-
(**
|
|
6
|
-
* @license React
|
|
7
|
-
* react.production.min.js
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*)
|
|
14
|
-
|
|
15
|
-
react/cjs/react-jsx-runtime.production.min.js:
|
|
16
|
-
(**
|
|
17
|
-
* @license React
|
|
18
|
-
* react-jsx-runtime.production.min.js
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*)
|
|
25
|
-
*/
|
|
1
|
+
import{createContext as f,useEffect as a,useState as t}from"react";import{jsx as d}from"react/jsx-runtime";var r=f(void 0);function l({fency:e,children:s}){let[o,y]=t(null),[u,c]=t(!0),[i,F]=t(null);if(a(()=>{e.then(n=>{y(n),c(!1)}).catch(n=>{F(n),c(!1)})},[e]),!o)return null;let p={fency:o,loading:u,error:i};return d(r.Provider,{value:p,children:s})}import{useContext as x}from"react";function m(){let e=x(r);if(e===void 0)throw new Error("useFency must be used within a FencyProvider");return e}export{l as FencyProvider,m as useFency};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
export interface FencyInstance {
|
|
2
2
|
publishableKey: string;
|
|
3
|
-
|
|
4
|
-
apiVersion: string;
|
|
5
|
-
endpoint: string;
|
|
6
|
-
};
|
|
7
|
-
version: string;
|
|
3
|
+
endpoint: string;
|
|
8
4
|
}
|
|
9
5
|
export interface FencyOptions {
|
|
10
6
|
publishableKey: string;
|
|
11
|
-
|
|
12
|
-
apiVersion?: string;
|
|
13
|
-
endpoint?: string;
|
|
14
|
-
};
|
|
7
|
+
endpoint?: string;
|
|
15
8
|
}
|
|
16
9
|
/**
|
|
17
10
|
* Context for Fency instance
|
|
@@ -26,7 +19,6 @@ export interface FencyContext {
|
|
|
26
19
|
*/
|
|
27
20
|
export interface FencyProviderProps {
|
|
28
21
|
fency: Promise<FencyInstance>;
|
|
29
|
-
options?: Omit<FencyOptions, 'publishableKey'>;
|
|
30
22
|
children: React.ReactNode;
|
|
31
23
|
}
|
|
32
24
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "React components for Fency integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "tsc && esbuild src/index.tsx --bundle --format=esm --outfile=dist/index.js --minify",
|
|
19
|
+
"build": "tsc && esbuild src/index.tsx --bundle --format=esm --outfile=dist/index.js --minify --external:react",
|
|
20
20
|
"dev": "tsc --watch",
|
|
21
21
|
"clean": "rm -rf dist",
|
|
22
22
|
"prepublishOnly": "npm run clean && npm run build",
|