@bodhiapp/bodhi-js-react-ext 0.0.29 → 0.0.31

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.
@@ -1 +1 @@
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
+ "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 p="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,"LoginOptionsBuilder",{enumerable:!0,get:()=>e.LoginOptionsBuilder});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=p;
@@ -1,52 +1,53 @@
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";
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { useRef as c, useMemo as d } from "react";
3
+ import { ExtUIClient as I } from "@bodhiapp/bodhi-js-ext";
4
4
  import { BodhiExtClient as f, EXT_BUILD_MODE as A, ExtUIClient as L } from "@bodhiapp/bodhi-js-ext";
5
- import { BodhiProvider as C } from "@bodhiapp/bodhi-js-react-core";
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 }) {
5
+ import { BodhiProvider as l } from "@bodhiapp/bodhi-js-react-core";
6
+ import { BodhiApiError as O, BodhiBadge as R, BodhiError as D, BodhiReactContext as S, ClientCtxState as U, INITIALIZING_CLIENT_CONTEXT_STATE as g, INITIAL_CLIENT_CONTEXT_STATE as w, LoginOptionsBuilder as M, clientStateToContextState as P, createApiError as X, createOperationError as y, isAuthError as z, isAuthLoading as v, isAuthenticated as b, isClientCtxInitialized as j, isClientCtxInitializing as q, isClientCtxNotInitialized as G, isClientCtxReady as W, isClientReady as Z, isDirectState as $, isExtensionState as k, isOverallReady as F, isWebUIClient as H, unwrapResponse as J, useBodhi as K } from "@bodhiapp/bodhi-js-react-core";
7
+ function h({ 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 = u(null), E = I(() => {
10
+ const r = c(null), E = d(() => {
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 d(e, a), r.current;
17
+ return r.current = new I(e, a), r.current;
18
18
  }, [t, e, i, o]);
19
- return /* @__PURE__ */ c(C, { client: E, basePath: o, ...s, children: n });
19
+ return /* @__PURE__ */ u(l, { client: E, basePath: o, ...s, children: n });
20
20
  }
21
- const m = "production";
21
+ const p = "production";
22
22
  export {
23
- R as BodhiApiError,
24
- D as BodhiBadge,
25
- O as BodhiError,
23
+ O as BodhiApiError,
24
+ R as BodhiBadge,
25
+ D as BodhiError,
26
26
  f as BodhiExtClient,
27
- B as BodhiProvider,
27
+ h as BodhiProvider,
28
28
  S as BodhiReactContext,
29
29
  U as ClientCtxState,
30
30
  A as EXT_BUILD_MODE,
31
31
  L as ExtUIClient,
32
- w as INITIALIZING_CLIENT_CONTEXT_STATE,
33
- M as INITIAL_CLIENT_CONTEXT_STATE,
34
- m as REACT_EXT_BUILD_MODE,
32
+ g as INITIALIZING_CLIENT_CONTEXT_STATE,
33
+ w as INITIAL_CLIENT_CONTEXT_STATE,
34
+ M as LoginOptionsBuilder,
35
+ p as REACT_EXT_BUILD_MODE,
35
36
  P as clientStateToContextState,
36
37
  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
38
+ y as createOperationError,
39
+ z as isAuthError,
40
+ v as isAuthLoading,
41
+ b as isAuthenticated,
42
+ j as isClientCtxInitialized,
43
+ q as isClientCtxInitializing,
44
+ G as isClientCtxNotInitialized,
45
+ W as isClientCtxReady,
46
+ Z as isClientReady,
47
+ $ as isDirectState,
48
+ k as isExtensionState,
49
+ F as isOverallReady,
50
+ H as isWebUIClient,
51
+ J as unwrapResponse,
52
+ K as useBodhi
52
53
  };
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 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';
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 LoginProgressCallback, type LoginProgressStage, type UserScope, type FlowType, type RequestedResourcesV1, type UIClient, type LogLevel, type BodhiErrorCode, type ApiResponse, LoginOptionsBuilder, 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.29",
3
+ "version": "0.0.31",
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.29",
46
- "@bodhiapp/setup-modal-types": "0.0.29",
47
- "@bodhiapp/bodhi-js-react-core": "0.0.29",
48
- "@bodhiapp/bodhi-js-ext": "0.0.29"
45
+ "@bodhiapp/bodhi-browser-types": "0.0.31",
46
+ "@bodhiapp/setup-modal-types": "0.0.31",
47
+ "@bodhiapp/bodhi-js-react-core": "0.0.31",
48
+ "@bodhiapp/bodhi-js-ext": "0.0.31"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "react": "^18.3.0 || ^19.0.0"