@bodhiapp/bodhi-js-react-ext 0.0.26 → 0.0.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/dist/bodhi-react-ext.cjs.js +1 -1
- package/dist/bodhi-react-ext.esm.js +37 -38
- package/dist/index.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),i=require("@bodhiapp/bodhi-js-ext"),e=require("@bodhiapp/bodhi-js-react-core");function O({children:d,authClientId:n,clientConfig:o,client:t,basePath:u,...l}){if(!t&&!n)throw new Error('BodhiProvider requires either "client" or "authClientId" prop');const r=a.useRef(null),b=a.useMemo(()=>{if(t)return t;if(r.current)return r.current;const c={...o,basePath:o?.basePath??u};return r.current=new i.ExtUIClient(n,c),r.current},[t,n,o,u]);return s.jsx(e.BodhiProvider,{client:b,basePath:u,...l,children:d})}const E="production";Object.defineProperty(exports,"BodhiExtClient",{enumerable:!0,get:()=>i.BodhiExtClient});Object.defineProperty(exports,"EXT_BUILD_MODE",{enumerable:!0,get:()=>i.EXT_BUILD_MODE});Object.defineProperty(exports,"ExtUIClient",{enumerable:!0,get:()=>i.ExtUIClient});Object.defineProperty(exports,"BodhiApiError",{enumerable:!0,get:()=>e.BodhiApiError});Object.defineProperty(exports,"BodhiBadge",{enumerable:!0,get:()=>e.BodhiBadge});Object.defineProperty(exports,"BodhiError",{enumerable:!0,get:()=>e.BodhiError});Object.defineProperty(exports,"BodhiReactContext",{enumerable:!0,get:()=>e.BodhiReactContext});Object.defineProperty(exports,"ClientCtxState",{enumerable:!0,get:()=>e.ClientCtxState});Object.defineProperty(exports,"INITIALIZING_CLIENT_CONTEXT_STATE",{enumerable:!0,get:()=>e.INITIALIZING_CLIENT_CONTEXT_STATE});Object.defineProperty(exports,"INITIAL_CLIENT_CONTEXT_STATE",{enumerable:!0,get:()=>e.INITIAL_CLIENT_CONTEXT_STATE});Object.defineProperty(exports,"clientStateToContextState",{enumerable:!0,get:()=>e.clientStateToContextState});Object.defineProperty(exports,"createApiError",{enumerable:!0,get:()=>e.createApiError});Object.defineProperty(exports,"createOperationError",{enumerable:!0,get:()=>e.createOperationError});Object.defineProperty(exports,"isAuthError",{enumerable:!0,get:()=>e.isAuthError});Object.defineProperty(exports,"isAuthLoading",{enumerable:!0,get:()=>e.isAuthLoading});Object.defineProperty(exports,"isAuthenticated",{enumerable:!0,get:()=>e.isAuthenticated});Object.defineProperty(exports,"isClientCtxInitialized",{enumerable:!0,get:()=>e.isClientCtxInitialized});Object.defineProperty(exports,"isClientCtxInitializing",{enumerable:!0,get:()=>e.isClientCtxInitializing});Object.defineProperty(exports,"isClientCtxNotInitialized",{enumerable:!0,get:()=>e.isClientCtxNotInitialized});Object.defineProperty(exports,"isClientCtxReady",{enumerable:!0,get:()=>e.isClientCtxReady});Object.defineProperty(exports,"isClientReady",{enumerable:!0,get:()=>e.isClientReady});Object.defineProperty(exports,"isDirectState",{enumerable:!0,get:()=>e.isDirectState});Object.defineProperty(exports,"isExtensionState",{enumerable:!0,get:()=>e.isExtensionState});Object.defineProperty(exports,"isOverallReady",{enumerable:!0,get:()=>e.isOverallReady});Object.defineProperty(exports,"isWebUIClient",{enumerable:!0,get:()=>e.isWebUIClient});Object.defineProperty(exports,"unwrapResponse",{enumerable:!0,get:()=>e.unwrapResponse});Object.defineProperty(exports,"useBodhi",{enumerable:!0,get:()=>e.useBodhi});exports.BodhiProvider=O;exports.REACT_EXT_BUILD_MODE=E;
|
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { ExtUIClient as
|
|
4
|
-
import { BodhiExtClient as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useMemo as I } from "react";
|
|
3
|
+
import { ExtUIClient as d } from "@bodhiapp/bodhi-js-ext";
|
|
4
|
+
import { BodhiExtClient as f, EXT_BUILD_MODE as A, ExtUIClient as L } from "@bodhiapp/bodhi-js-ext";
|
|
5
5
|
import { BodhiProvider as C } from "@bodhiapp/bodhi-js-react-core";
|
|
6
|
-
import { BodhiBadge as
|
|
7
|
-
function
|
|
6
|
+
import { BodhiApiError as R, BodhiBadge as D, BodhiError as O, BodhiReactContext as S, ClientCtxState as U, INITIALIZING_CLIENT_CONTEXT_STATE as w, INITIAL_CLIENT_CONTEXT_STATE as M, clientStateToContextState as P, createApiError as X, createOperationError as g, isAuthError as y, isAuthLoading as z, isAuthenticated as v, isClientCtxInitialized as b, isClientCtxInitializing as j, isClientCtxNotInitialized as q, isClientCtxReady as G, isClientReady as W, isDirectState as Z, isExtensionState as $, isOverallReady as k, isWebUIClient as F, unwrapResponse as H, useBodhi as J } from "@bodhiapp/bodhi-js-react-core";
|
|
7
|
+
function B({ children: n, authClientId: e, clientConfig: i, client: t, basePath: o, ...s }) {
|
|
8
8
|
if (!t && !e)
|
|
9
9
|
throw new Error('BodhiProvider requires either "client" or "authClientId" prop');
|
|
10
|
-
const r =
|
|
10
|
+
const r = u(null), E = I(() => {
|
|
11
11
|
if (t) return t;
|
|
12
12
|
if (r.current) return r.current;
|
|
13
13
|
const a = {
|
|
14
14
|
...i,
|
|
15
15
|
basePath: i?.basePath ?? o
|
|
16
16
|
};
|
|
17
|
-
return r.current = new
|
|
17
|
+
return r.current = new d(e, a), r.current;
|
|
18
18
|
}, [t, e, i, o]);
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ c(C, { client: E, basePath: o, ...s, children: n });
|
|
20
20
|
}
|
|
21
21
|
const m = "production";
|
|
22
22
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
R as BodhiApiError,
|
|
24
|
+
D as BodhiBadge,
|
|
25
|
+
O as BodhiError,
|
|
26
|
+
f as BodhiExtClient,
|
|
27
|
+
B as BodhiProvider,
|
|
28
|
+
S as BodhiReactContext,
|
|
29
|
+
U as ClientCtxState,
|
|
30
|
+
A as EXT_BUILD_MODE,
|
|
31
|
+
L as ExtUIClient,
|
|
32
|
+
w as INITIALIZING_CLIENT_CONTEXT_STATE,
|
|
33
|
+
M as INITIAL_CLIENT_CONTEXT_STATE,
|
|
32
34
|
m as REACT_EXT_BUILD_MODE,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
H as isOverallReady,
|
|
51
|
-
J as isWebUIClient,
|
|
52
|
-
K as useBodhi
|
|
35
|
+
P as clientStateToContextState,
|
|
36
|
+
X as createApiError,
|
|
37
|
+
g as createOperationError,
|
|
38
|
+
y as isAuthError,
|
|
39
|
+
z as isAuthLoading,
|
|
40
|
+
v as isAuthenticated,
|
|
41
|
+
b as isClientCtxInitialized,
|
|
42
|
+
j as isClientCtxInitializing,
|
|
43
|
+
q as isClientCtxNotInitialized,
|
|
44
|
+
G as isClientCtxReady,
|
|
45
|
+
W as isClientReady,
|
|
46
|
+
Z as isDirectState,
|
|
47
|
+
$ as isExtensionState,
|
|
48
|
+
k as isOverallReady,
|
|
49
|
+
F as isWebUIClient,
|
|
50
|
+
H as unwrapResponse,
|
|
51
|
+
J as useBodhi
|
|
53
52
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export { BodhiProvider, type BodhiProviderProps } from './BodhiProvider';
|
|
8
8
|
export { ExtUIClient, type ExtUIClientParams, BodhiExtClient } from '@bodhiapp/bodhi-js-ext';
|
|
9
|
-
export { BodhiReactContext, useBodhi, type BodhiContext, type SetupState, type ClientContextState, type ClientContextStatus, INITIAL_CLIENT_CONTEXT_STATE, INITIALIZING_CLIENT_CONTEXT_STATE, ClientCtxState, clientStateToContextState, isClientCtxInitialized, isClientCtxInitializing, isClientCtxNotInitialized, isClientCtxReady, isOverallReady, type
|
|
9
|
+
export { BodhiReactContext, useBodhi, type BodhiContext, type SetupState, type ClientContextState, type ClientContextStatus, INITIAL_CLIENT_CONTEXT_STATE, INITIALIZING_CLIENT_CONTEXT_STATE, ClientCtxState, clientStateToContextState, isClientCtxInitialized, isClientCtxInitializing, isClientCtxNotInitialized, isClientCtxReady, isOverallReady, type ClientState, type AuthState, type LoginOptions, type UserScope, type UIClient, type LogLevel, type BodhiErrorCode, type ApiResponse, BodhiError, BodhiApiError, unwrapResponse, isDirectState, isExtensionState, isWebUIClient, isAuthError, isAuthLoading, isAuthenticated, isClientReady, createApiError, createOperationError, BodhiBadge, type BodhiBadgeProps, type BodhiBadgeSize, type BodhiBadgeVariant, } from '@bodhiapp/bodhi-js-react-core';
|
|
10
10
|
export { BUILD_MODE as REACT_EXT_BUILD_MODE } from './build-info';
|
|
11
11
|
export { EXT_BUILD_MODE } from '@bodhiapp/bodhi-js-ext';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bodhiapp/bodhi-js-react-ext",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "React bindings for Bodhi Browser SDK with ExtUIClient preset (Chrome Extension)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/bodhi-react-ext.cjs.js",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"typecheck": "tsc --noEmit"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@bodhiapp/bodhi-browser-types": "0.0.
|
|
46
|
-
"@bodhiapp/setup-modal-types": "0.0.
|
|
47
|
-
"@bodhiapp/bodhi-js-react-core": "0.0.
|
|
48
|
-
"@bodhiapp/bodhi-js-ext": "0.0.
|
|
45
|
+
"@bodhiapp/bodhi-browser-types": "0.0.28",
|
|
46
|
+
"@bodhiapp/setup-modal-types": "0.0.28",
|
|
47
|
+
"@bodhiapp/bodhi-js-react-core": "0.0.28",
|
|
48
|
+
"@bodhiapp/bodhi-js-ext": "0.0.28"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"react": "^18.3.0 || ^19.0.0"
|